@mrpatronz/nexusflow 2.20.0 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/gui/assets/AgentsPage-BKwrbZTW.js +3 -0
  2. package/dist/gui/assets/DashboardPage-B5DuTyhZ.js +1 -0
  3. package/dist/gui/assets/{DocumentPreview-B1-9LSiH.js → DocumentPreview-Os281E1X.js} +1 -1
  4. package/dist/gui/assets/{GettingStartedPage-KkTgBu7C.js → GettingStartedPage-bcbneczR.js} +1 -1
  5. package/dist/gui/assets/MonacoDiffAdapter-D1wWcPlt.js +1 -0
  6. package/dist/gui/assets/ProjectsPage-CIEM54GU.js +1 -0
  7. package/dist/gui/assets/ScaffoldRepoInline-DoqywP_g.js +1 -0
  8. package/dist/gui/assets/SettingsPage-sCzTlpxr.js +1 -0
  9. package/dist/gui/assets/SkillsPage-CoMf5sLE.js +7 -0
  10. package/dist/gui/assets/StartWorkPage-CVnUwx7O.js +1 -0
  11. package/dist/gui/assets/StrategiesPage-UIiETHGq.js +3 -0
  12. package/dist/gui/assets/WorkroomsPage-BTcKu4E8.js +4 -0
  13. package/dist/gui/assets/WorkspacesPage-2tYcZu28.js +17 -0
  14. package/dist/gui/assets/alert-dialog-CdWem4Th.js +1 -0
  15. package/dist/gui/assets/badge-DQIZRRDZ.js +1 -0
  16. package/dist/gui/assets/bot-D5yM1Tw6.js +1 -0
  17. package/dist/gui/assets/{brand-hHByyyzq.js → brand-Bj6g9sFF.js} +1 -1
  18. package/dist/gui/assets/{client-B5szthbF.js → client-CQ3EdyuW.js} +1 -1
  19. package/dist/gui/assets/cpu-Y6k3dlHb.js +1 -0
  20. package/dist/gui/assets/empty-DK2eW2rF.js +1 -0
  21. package/dist/gui/assets/index-qvc4aLwP.js +75 -0
  22. package/dist/gui/assets/index-zHrkxd7h.css +2 -0
  23. package/dist/gui/assets/input-LtE7Sz4D.js +1 -0
  24. package/dist/gui/assets/isElementDisabled-Cpw8EvLX.js +1 -0
  25. package/dist/gui/assets/{queries-DYi6drfC.js → queries-CtxmqmGJ.js} +1 -1
  26. package/dist/gui/assets/tabs-7VC4aq4J.js +1 -0
  27. package/dist/gui/assets/textarea-0lXkxsuX.js +1 -0
  28. package/dist/gui/assets/{useAriaLabelledBy-DAWGcnTk.js → useAriaLabelledBy-BAD_HQgN.js} +1 -1
  29. package/dist/gui/assets/useValueChanged-DcnEcpiS.js +1 -0
  30. package/dist/gui/index.html +8 -8
  31. package/dist/terminal/manager.d.ts +1 -0
  32. package/dist/terminal/manager.d.ts.map +1 -1
  33. package/dist/terminal/manager.js +4 -3
  34. package/dist/terminal/manager.js.map +1 -1
  35. package/dist/utils/session-finder.d.ts.map +1 -1
  36. package/dist/utils/session-finder.js +49 -1
  37. package/dist/utils/session-finder.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/gui/assets/AgentsPage-DsJ8dxJG.js +0 -3
  40. package/dist/gui/assets/DashboardPage-CtJnqdvu.js +0 -1
  41. package/dist/gui/assets/MonacoDiffAdapter-CsyKXuq8.js +0 -1
  42. package/dist/gui/assets/ProjectsPage-Dsl46Cx5.js +0 -1
  43. package/dist/gui/assets/ScaffoldRepoInline-BZBzfuYr.js +0 -1
  44. package/dist/gui/assets/SettingsPage-BYuNRM43.js +0 -1
  45. package/dist/gui/assets/SkillsPage-BmsLo_kt.js +0 -7
  46. package/dist/gui/assets/StartWorkPage-CY9s8_zb.js +0 -1
  47. package/dist/gui/assets/StrategiesPage-Bd9vJ5ml.js +0 -3
  48. package/dist/gui/assets/WorkroomsPage-Yoy1dJFI.js +0 -4
  49. package/dist/gui/assets/WorkspacesPage-CpZsBgiV.js +0 -13
  50. package/dist/gui/assets/alert-dialog-D24plC11.js +0 -1
  51. package/dist/gui/assets/badge-BObbahyU.js +0 -1
  52. package/dist/gui/assets/index-B5-rK_Uq.css +0 -2
  53. package/dist/gui/assets/index-CxyTuBKc.js +0 -80
  54. package/dist/gui/assets/isElementDisabled-BONWqXlb.js +0 -1
  55. package/dist/gui/assets/tabs--FCq-tVR.js +0 -1
  56. package/dist/gui/assets/useValueChanged-DfJmRF2P.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-DE3RlOCf.js";import{a as i,c as a,d as o,f as s,i as c,l,m as u,o as d,p as f,s as p,u as m}from"./button-BrcP8Wxx.js";var h=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),g=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),v={"data-starting-style":``},y={"data-ending-style":``},b={transitionStatus(e){return e===`starting`?v:e===`ending`?y:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=_.startingStyle]=`startingStyle`,e[e.endingStyle=_.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var x={"data-popup-open":``},S={"data-popup-open":``,"data-pressed":``},C={"data-open":``},w={"data-closed":``},T={"data-anchor-hidden":``},E={open(e){return e?x:null}},D={open(e){return e?S:null}},O={open(e){return e?C:w},anchorHidden(e){return e?T:null}},k={...O,...b},A=`none`,j=`trigger-press`,M=`trigger-hover`,N=`trigger-focus`,ee=`outside-press`,P=`item-press`,F=`close-press`,te=`focus-out`,ne=`escape-key`,I=`list-navigation`,re=`cancel-open`,ie=`sibling-open`,ae=`disabled`,oe=`missing`,L=`initial`,se=`imperative-action`,R=`window-resize`,z=e(g(),1),B=r(),V=e(n(),1);function H({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i?e:a,V.useCallback(e=>{i||o(e)},[])]}function ce(){return typeof window<`u`}function U(e){return ue(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){return((ue(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ue(e){return ce()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return ce()?e instanceof Element||e instanceof W(e).Element:!1}function K(e){return ce()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function de(e){return!ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function fe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function pe(e){return/^(table|td|th)$/.test(U(e))}function me(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var he=/transform|translate|scale|rotate|perspective|filter/,ge=/paint|layout|strict|content/,_e=e=>!!e&&e!==`none`,ve;function ye(e){let t=G(e)?Ce(e):e;return _e(t.transform)||_e(t.translate)||_e(t.scale)||_e(t.rotate)||_e(t.perspective)||!xe()&&(_e(t.backdropFilter)||_e(t.filter))||he.test(t.willChange||``)||ge.test(t.contain||``)}function be(e){let t=Te(e);for(;K(t)&&!Se(t);){if(ye(t))return t;if(me(t))return null;t=Te(t)}return null}function xe(){return ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ve}function Se(e){return/^(html|body|#document)$/.test(U(e))}function Ce(e){return W(e).getComputedStyle(e)}function we(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Te(e){if(U(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||de(e)&&e.host||le(e);return de(t)?t.host:t}function Ee(e){let t=Te(e);return Se(t)?(e.ownerDocument||e).body:K(t)&&fe(t)?t:Ee(t)}function De(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],fe(r)?r:[],e&&n?De(e):[])}return t.concat(r,De(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var ke={...V},Ae=ke.useInsertionEffect,je=Ae&&Ae!==ke.useLayoutEffect?Ae:e=>e();function q(e){let t=s(Me).current;return t.next=e,je(t.effect),t.trampoline}function Me(){let e={next:void 0,callback:Ne,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ne(){}var J=typeof document<`u`?V.useLayoutEffect:()=>{},Pe=V.createContext(void 0);function Fe(e=!1){let t=V.useContext(Pe);if(t===void 0&&!e)throw Error(f(16));return t}function Ie(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Y(e){return e?.ownerDocument||document}function Le(e,t,{detail:n=0}={}){e.dispatchEvent(new(W(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Re(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=V.useRef(null),c=Fe(!0),l=o??c!==void 0,{props:u}=Ie({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),f=V.useCallback(()=>{let e=s.current;ze(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return J(f,[f]),{getButtonProps:V.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:o,onKeyDown:s,onPointerDown:c,...f}=e;return d({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(i(e),s?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,o=ze(r),c=!a&&Be(r),u=n&&(a?o:!c),d=e.key===`Enter`,f=e.key===` `,p=r.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(n&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),(!a||o)&&(e.preventBaseUIHandler(),Le(r,e));return}if(!u||a||!f&&!d){n&&c&&f&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),d&&(e.preventBaseUIHandler(),Le(r,e)))},onKeyUp(e){if(!t){if(i(e),o?.(e),e.target===e.currentTarget&&a&&l&&ze(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Le(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}c?.(e)}},a?{type:`button`}:{role:`button`},u,f)},[t,u,l,a]),buttonRef:q(e=>{s.current=e,f()})}}function ze(e){return K(e)&&e.tagName===`BUTTON`}function Be(e){return K(e)&&e.tagName===`A`&&!!e.href}function Ve(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:He,platform:Ue,maxTouchPoints:We}=Ve(),Ge=He.toLowerCase(),Ke=Ue.toLowerCase(),qe=/^i(os$|p)/.test(Ke)||Ke===`macintel`&&We>1,Je=`android`,Ye=Ke===Je||Ge.includes(Je),Xe=!qe&&Ke.startsWith(`mac`);Ke.startsWith(`win`),!Ye&&/^(linux|chrome os)/.test(Ke);var Ze=Xe||qe,Qe=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Qe&&Ge.includes(`firefox`),!Qe&&Ge.includes(`chrom`);var $e=Ze,et=/jsdom|happydom/.test(Ge),tt=0;function nt(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(tt+=1,r(`${t}-${tt}`))},[n,t]),i}var rt=ke.useId;function it(e,t){if(rt!==void 0){let n=rt();return e??(t?`${t}-${n}`:n)}return nt(e,t)}function at(e){return it(e,`base-ui`)}function ot(e,t,n,r){let i=!1,o=!1,s=r??a;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...s}}function st(e){V.useEffect(e,p)}var ct=null;globalThis.requestAnimationFrame;var lt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ut=class e{static create(){return new e}static request(e){return lt.request(e)}static cancel(e){return lt.cancel(e)}currentId=ct;request(e){this.cancel(),this.currentId=lt.request(()=>{this.currentId=ct,e()})}cancel=()=>{this.currentId!==ct&&(lt.cancel(this.currentId),this.currentId=ct)};disposeEffect=()=>this.cancel};function dt(){let e=s(ut.create).current;return st(e.disposeEffect),e}function ft(e,t=!1,n=!1){let[r,i]=V.useState(e&&t?`idle`:void 0),[a,o]=V.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),J(()=>{if(!e&&a&&r!==`ending`&&n){let e=ut.request(()=>{i(`ending`)});return()=>{ut.cancel(e)}}},[e,a,r,n]),J(()=>{if(!e||t)return;let n=ut.request(()=>{i(void 0)});return()=>{ut.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ut.request(()=>{i(`idle`)});return()=>{ut.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function X(e){return e==null?e:`current`in e?e.current:e}function pt(e,t=!1){let n=dt();return q((r,i=null)=>{n.cancel();let a=X(e);if(a==null)return;let o=a,s=()=>{z.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function mt(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=pt(r,n);V.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ht=0,gt=class e{static create(){return new e}currentId=ht;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ht,t()},e)}isStarted(){return this.currentId!==ht}clear=()=>{this.currentId!==ht&&(clearTimeout(this.currentId),this.currentId=ht)};disposeEffect=()=>this.clear};function _t(){let e=s(gt.create).current;return st(e.disposeEffect),e}function vt(e){e.preventDefault(),e.stopPropagation()}function yt(e){return`nativeEvent`in e}function bt(e){return e.pointerType===``&&e.isTrusted?!0:Ye&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function xt(e){return et?!1:!Ye&&e.width===0&&e.height===0||Ye&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function St(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ct(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var wt=`data-base-ui-focusable`,Tt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Et=`ArrowLeft`,Dt=`ArrowRight`,Ot=`ArrowUp`,kt=`ArrowDown`;function Z(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&de(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function At(e){return`composedPath`in e?e.composedPath()[0]:e.target}function jt(e,t){if(!G(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Mt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Nt(e){return e.matches(`html,body`)}function Pt(e){return K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ft(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Tt}`)!=null}function It(e){return e?e.getAttribute(`role`)===`combobox`&&Pt(e):!1}function Lt(e){if(!e||et)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Rt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Bt(e){let t=s(Vt,e).current;return t.next=e,J(t.effect),t}function Vt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ht={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ut={...Ht,position:`fixed`,top:0,left:0},Wt={...Ht,position:`absolute`},Gt=V.forwardRef(function(e,t){let[n,r]=V.useState();J(()=>{$e&&Qe&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Kt(e,t){return t<0||t>=e.length}function qt(e,t){return Yt(e.current,{disabledIndices:t})}function Jt(e,t){return Yt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Yt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Xt(e,a,r));return a}function Xt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Qt(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Zt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Qt(e,t=e?Ce(e):null){return!e||!e.isConnected||!t||Zt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var $t=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function en(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return de(n)?n.host:null}function tn(e){for(let t of Array.from(e.children))if(U(t)===`summary`)return t;return null}function nn(e,t){let n=tn(t);return!!n&&(e===n||Q(n,e))}function rn(e){let t=e?U(e):``;return e!=null&&e.matches($t)&&(t!==`summary`||e.parentElement!=null&&U(e.parentElement)===`details`&&tn(e.parentElement)===e)&&(t!==`details`||tn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function an(e){if(!rn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=en(t)){let n=t!==e,r=U(t)===`slot`;if(t.hasAttribute(`inert`)||n&&U(t)===`details`&&!t.open&&!nn(e,t)||t.hasAttribute(`hidden`)||!r&&!on(t,n))return!1}return!0}function on(e,t){let n=Ce(e);return t?n.display!==`none`:Qt(e,n)}function sn(e){let t=e.tabIndex;if(t<0){let t=U(e);if(t===`details`||t===`audio`||t===`video`||K(e)&&e.isContentEditable)return 0}return t}function cn(e){if(U(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ln(e,t){let n=cn(e);if(!n)return!0;let r=t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cn(e);return t?.name===n.name&&t.form===n.form})===n}function un(e){if(K(e)&&U(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dn(e,t){un(e).forEach(e=>{rn(e)&&t.push(e),dn(e,t)})}function fn(e,t,n){un(e).forEach(e=>{K(e)&&e.matches(t)&&n.push(e),fn(e,t,n)})}function pn(e){return an(e)&&sn(e)>=0}function mn(e){let t=[];return dn(e,t),t.filter(an)}function hn(e){let t=mn(e);return t.filter(e=>sn(e)>=0&&ln(e,t))}function gn(e,t){let n=hn(e),r=n.length;if(r===0)return;let i=Z(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _n(e){return gn(Y(e).body,1)||e}function vn(e){return gn(Y(e).body,-1)||e}function yn(e,t){if(!e)return null;let n=hn(Y(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function bn(e){return yn(e,1)}function xn(e){return yn(e,-1)}function Sn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Cn(e){hn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function wn(e){let t=[];fn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Tn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Tn(e,t.id,n)])}function En(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Dn(e){return`data-base-ui-${e}`}var On=0;function kn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(On);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),l;let o=requestAnimationFrame(a);return On=o,()=>{On===o&&(cancelAnimationFrame(o),On=0)}}var An={inert:new WeakMap,"aria-hidden":new WeakMap},jn=`data-base-ui-inert`,Mn={inert:new WeakSet,"aria-hidden":new WeakSet},Nn=new WeakMap,Pn=0;function Fn(e){return Mn[e]}function In(e){return e?de(e)?e.host:In(e.parentNode):null}var Ln=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=In(t);return e.contains(n)?n:null}).filter(e=>e!=null),Rn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{U(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bn(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Ln(t,e),l=i?zn(t,Rn(c),new Set(c)):[],u=[],d=[];if(a){let e=An[a],n=Fn(a);s=n,o=e;let r=Ln(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zn(t,Rn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Nn.get(e)||0)+1;Nn.set(e,t),d.push(e),t===1&&e.setAttribute(jn,``)}),Pn+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Nn.get(e)||0)-1;Nn.set(e,t),t||e.removeAttribute(jn)}),--Pn,Pn||(An.inert=new WeakMap,An[`aria-hidden`]=new WeakMap,Mn.inert=new WeakSet,Mn[`aria-hidden`]=new WeakSet,Nn=new WeakMap)}}function Vn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Y(e[0]).body;return Bn(e,a,n,r,{mark:i})}var Hn={style:{transition:`none`}},Un=`data-base-ui-click-trigger`,Wn={fallbackAxisSide:`none`},Gn={fallbackAxisSide:`end`},Kn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},qn=V.createContext(null),Jn=()=>V.useContext(qn),Yn=Dn(`portal`);function Xn(e={}){let{ref:t,container:n,componentProps:r=a,elementProps:i}=e,o=it(),s=Jn()?.portalNode,[l,u]=V.useState(null),[d,f]=V.useState(null),p=q(e=>{e!==null&&f(e)}),m=V.useRef(null);J(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(ue(n)?n:n.current))??s??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,s]);let h=c(`div`,r,{ref:[t,p],props:[{id:o,[Yn]:``},i]}),g=l&&h?z.createPortal(h,l):null;return{node:d,nodeId:V.isValidElement(h)?h.props.id:void 0,subtree:g}}var Zn=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Xn({container:o,ref:t,componentProps:e,elementProps:s}),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),[h,g]=V.useState(null),_=V.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;V.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&Sn(e)&&(e.type===`focusin`?_.current&&=(wn(c),!1):(Cn(c),_.current=!0))}return zt($(c,`focusin`,e,!0),$(c,`focusout`,e,!0))},[c,v]),J(()=>{!c||y!==!0||!_.current||(wn(c),_.current=!1)},[y,c]);let x=V.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,B.jsxs)(V.Fragment,{children:[u,(0,B.jsxs)(qn.Provider,{value:x,children:[b&&c&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:d,onFocus:e=>{Sn(e,c)?p.current?.focus():vn(h?h.domReference:null)?.focus()}}),b&&c&&(0,B.jsx)(`span`,{"aria-owns":l,style:Kn}),c&&z.createPortal(a,c),b&&c&&(0,B.jsx)(Gt,{"data-type":`outside`,ref:f,onFocus:e=>{Sn(e,c)?m.current?.focus():(_n(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ot(`focus-out`,e.nativeEvent)))}})]})]})});function Qn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var $n=class{nodesRef={current:[]};events=Qn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},er=V.createContext(null),tr=V.createContext(null),nr=()=>V.useContext(er)?.id||null,rr=e=>{let t=V.useContext(tr);return e??t};function ir(e){let t=it(),n=rr(e),r=nr();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ar(e){let{children:t,id:n}=e,r=nr();return(0,B.jsx)(er.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function or(e){let{children:t,externalTree:n}=e,r=s(()=>n??new $n).current;return(0,B.jsx)(tr.Provider,{value:r,children:t})}function sr(e,t){let n=W(At(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var cr=20,lr=[];function ur(){lr=lr.filter(e=>e.deref()?.isConnected)}function dr(e){ur(),e&&U(e)!==`body`&&(lr.push(new WeakRef(e)),lr.length>cr&&(lr=lr.slice(-20)))}function fr(){return ur(),lr[lr.length-1]?.deref()}function pr(e){return e?pn(e)?e:hn(e)[0]||e:null}function mr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function hr(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=q(()=>x.current.floatingContext?.nodeId),C=i===!1,w=It(v)&&C,T=Bt(i),E=Bt(a),D=Bt(u),O=Bt(_),k=rr(m),A=Jn(),j=V.useRef(!1),M=V.useRef(!1),N=V.useRef(!1),ee=V.useRef(null),P=V.useRef(``),F=V.useRef(``),ne=V.useRef(null),I=V.useRef(null),re=o(ne,p,A?.beforeInsideRef),ie=o(I,A?.afterInsideRef),ae=_t(),oe=_t(),L=dt(),se=A!=null,R=Rt(y),z=q((e=R)=>e?hn(e):[]),H=q(()=>h?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(R,Z(Y(R)))&&z().length===0&&!w&&vt(e)}return $(Y(R),`keydown`,e)},[r,R,c,w,z]),V.useEffect(()=>{if(r||!_)return;let e=Y(R);function t(){N.current=!1}function n(e){let t=At(e),n=H(),r=Q(y,t)||Q(v,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,oe.start(0,()=>{M.current=!1}))}function i(){F.current=`keyboard`}return zt($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,y,v,R,_,A,oe,H]),V.useEffect(()=>{if(r||!l)return;let e=Y(R);function t(){M.current=!0,oe.start(0,()=>{M.current=!1})}function n(e){let t=At(e);pn(t)&&(ee.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=At(t);c&&n==null&&i!=null&&Q(y,i)&&dr(i),queueMicrotask(()=>{let a=S(),o=g.context.triggerElements,l=H(),u=n?.hasAttribute(Dn(`focus-guard`))&&[ne.current,I.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,X(f),X(d)].includes(n),p=!(Q(v,n)||Q(y,n)||Q(n,y)||Q(A?.portalNode,n)||l.some(e=>e===n||Q(e,n))||o.hasMatchingElement(e=>Q(e,n))||u||k&&(Tn(k.nodesRef.current,a).find(e=>Q(e.context?.elements.floating,n)||Q(e.context?.elements.domReference,n))||En(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Rt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&R&&mr(R),s&&r!==v&&!Qt(i)&&Z(e)===e.body){if(K(R)&&(R.focus(),s===`popup`)){L.request(()=>{R.focus()});return}let e=z(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;K(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&n&&p&&!M.current&&(w||n!==fr())&&(j.current=!0,g.setOpen(!1,ot(te,t)))})}function a(){N.current||(x.current.insideReactTree=!0,ae.start(0,()=>{x.current.insideReactTree=!1}))}let o=K(v)?v:null;if(!(!y&&!o))return zt(o&&$(o,`focusout`,i),o&&$(o,`pointerdown`,t),y&&$(y,`focusin`,n),y&&$(y,`focusout`,i),y&&A&&$(y,`focusout`,a,!0))},[r,v,y,R,c,k,A,g,l,s,z,w,S,x,ae,oe,L,d,f,H]),V.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Dn(`portal`)}]`)||[]),t=(k?En(k.nodesRef.current,S()):[]).find(e=>It(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Vn([y,...e,ne.current,I.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...H(),t,X(f),X(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Vn([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,d,f,H]),J(()=>{if(!_||r||!K(R))return;P.current=``,F.current=``;let e=Y(R),t=Z(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(R,t))return;let i=null,a=()=>(i??=z(R),i[0]||R),o;o=r===!0||r===null?a():X(r),o||=a();let s=Q(R,Z(e));kn(o,{preventScroll:o===R,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Z(e);return!(t!==o&&Q(R,t))}})})},[r,_,R,z,T,D,O]),J(()=>{if(r||!R)return;let e=Y(R),t=Z(e),n=D.current==null;dr(t);function i(e){if(e.open||(P.current=sr(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(bt(e.nativeEvent)||xt(e.nativeEvent))j.current=!1;else{let e=!1;Y(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&U(t)!==`body`?t:null,s=n?o||a:a||o;return s||=fr()||null,typeof i==`boolean`?s:X(i)||s||null}return()=>{b.off(`openchange`,i);let t=Z(e),n=H(),r=Q(y,t)||n.some(e=>e===t||Q(e,t))||k&&Tn(k.nodesRef.current,S(),!1).some(e=>Q(e.context?.elements.floating,t)),o=E.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=pr(c),i=typeof o!=`boolean`;if(o&&!j.current&&K(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,R,E,D,b,k,v,S,H]),J(()=>{if(!Qe||_||!y)return;let e=Z(Y(y));!K(e)||!Pt(e)||Q(y,e)&&e.blur()},[_,y]),J(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),J(()=>{if(!(r||!R))return mr(R),()=>{queueMicrotask(ur)}},[r,R]);let ce=!r&&(!c||!w)&&(se||c);return(0,B.jsxs)(V.Fragment,{children:[ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:re,onFocus:e=>{if(c){let e=z();kn(e[e.length-1])}else A?.portalNode&&(j.current=!1,Sn(e,A.portalNode)?_n(v)?.focus():X(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,B.jsx)(Gt,{"data-type":`inside`,ref:ie,onFocus:e=>{c?kn(z()[0]):A?.portalNode&&(l&&(j.current=!0),Sn(e,A.portalNode)?vn(v)?.focus():X(d??A.afterOutsideRef)?.focus())}})]})}function gr(){return!1}function _r(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function vr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=gr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=rr(c),m=q(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=q(()=>a),{escapeKey:v,outsidePress:y}=_r(s),b=V.useRef(!1),x=V.useRef(!1),S=V.useRef(!1),C=V.useRef(!1),w=V.useRef(``),T=V.useRef(null),E=_t(),D=_t(),O=q(()=>{D.clear(),f.current.insideReactTree=!1}),k=q(e=>{let t=f.current.floatingContext?.nodeId;return(p?Tn(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=q(e=>Mt(e,l.select(`floatingElement`))||Mt(e,l.select(`domReferenceElement`))),M=q(e=>{o()&&l.setOpen(!1,ot(j,e.nativeEvent))}),N=q(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=ot(ne,yt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),P=q(()=>{f.current.insideReactTree=!0,D.start(0,O)}),F=q(e=>{if(!u||!n||e.button!==0)return;let t=At(e.nativeEvent);Q(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=q(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});V.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new gt,t=new gt;function i(){e.clear(),C.current=!0}function a(){e.start(Qe?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&Tn(p.nodesRef.current,t).some(t=>Mt(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=At(e),r=`[${Dn(`inert`)}]`,i=G(n)?n.getRootNode():null,a=Array.from((de(i)?i:Y(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Q(e,n))))return;let s=G(n)?n:null;for(;s&&!Se(s);){let e=Te(s);if(Se(e)||!G(e))break;s=e}if(!(a.length&&G(n)&&!Nt(n)&&!Q(n,l.select(`floatingElement`))&&a.every(e=>!Q(s,e)))){if(K(n)&&!(`touches`in e)){let t=Se(n),r=Ce(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,ot(ee,e)),O())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=At(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function te(e){w.current=`touch`,F(e,P)}function ne(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):j(e)})}function I(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function re(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ie(e){F(e,re)}function ae(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function oe(e){F(e,ae)}let L=Y(d),se=zt(r&&zt($(L,`keydown`,N),$(L,`compositionstart`,i),$(L,`compositionend`,a)),g&&zt($(L,`click`,ne,!0),$(L,`pointerdown`,ne,!0),$(L,`pointerup`,I,!0),$(L,`pointercancel`,I,!0),$(L,`mousedown`,ne,!0),$(L,`mouseup`,I,!0),$(L,`touchstart`,te,!0),$(L,`touchmove`,ie,!0),$(L,`touchend`,oe,!0)));return()=>{se(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,N,O,_,k,A,p,l,E]);let I=V.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),re=V.useMemo(()=>({onKeyDown:N,onPointerDown:te,onMouseDown:te,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,te]);return V.useMemo(()=>n?{reference:I,floating:re,trigger:I}:{},[n,I,re])}var yr=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),br=t(((e,t)=>{t.exports=yr()})),xr=t((e=>{var t=n(),r=br();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Sr=t(((e,t)=>{t.exports=xr()})),Cr=br(),wr=Sr(),Tr=[],Er=void 0;function Dr(){return Er}function Or(e){Tr.push(e)}function kr(e){let t=(t,n)=>{let r=s(jr).current,i;try{Er=r;for(let e of Tr)e.before(r);i=e(t,n);for(let e of Tr)e.after(r);r.didInitialize=!0}finally{Er=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ar(e){return V.forwardRef(kr(e))}function jr(){return{didInitialize:!1}}var Mr=m(19)?Fr:Ir;function Nr(e,t,n,r,i){return Mr(e,t,n,r,i)}function Pr(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Cr.useSyncExternalStore)(e.subscribe,a,a)}Or({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Cr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Fr(e,t,n,r,i){let a=Dr();if(!a)return Pr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Ir(e,t,n,r,i){return(0,wr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Lr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Nr(this,e,t,n,r)}},Rr=class extends Lr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Nr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=q(t??l);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},zr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Br=class extends Rr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Qn(),nested:n,triggerElements:i},zr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ct(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Vr(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=V.useRef(null);r===void 0&&f.current===null&&(f.current=new Br({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};G(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Hr={tabIndex:-1,[wt]:``};function Ur(e){return t=>t!==`touch`||e.current}function Wr(e,t=!1){let n=it(),r=nr()!=null,i=s(()=>e(n,r)).current;return Vr({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Gr({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function Kr(e,t){let n=V.useRef(null),r=V.useRef(null);return V.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function qr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Jr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Yr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Kr(e,n),o=q(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=V.useCallback(e=>{a(e),e&&o(e)},[a,o]);return J(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Xr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=V.useRef(null),i=e.useState(`open`);J(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ot(A);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Zr(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ft(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return mt({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Qr(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:a,inactiveTriggerProps:a,popupProps:a})},[e])}function $r(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ei=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ti=`ArrowUp`,ni=`ArrowDown`,ri=`ArrowLeft`,ii=`ArrowRight`,ai=`Home`,oi=new Set([ti,ni,ri,ii,ai,`End`]),si=[`Shift`,`Control`,`Alt`,`Meta`];function ci(e){return K(e)&&e.tagName===`INPUT`}function li(e){return!!(ci(e)&&e.selectionStart!=null||K(e)&&e.tagName===`TEXTAREA`)}function ui(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=di(e,t,`left`),a=fi(e),o=fi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=di(e,t,`top`),r=fi(e),i=fi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function di(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function fi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function pi(e){return m(19)?e:e?`true`:void 0}var mi=V.createContext(void 0);function hi(){return V.useContext(mi)?.direction??`ltr`}var gi=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),_i={},vi={},yi=``;function bi(e,t){return fe(e)?e:t}function xi(e,t,n){return/hidden|clip/.test(e.getComputedStyle(bi(t,n)).overflowY)}function Si(e){if(typeof document>`u`)return!1;let t=Y(e);return W(t).innerWidth-t.documentElement.clientWidth>0}function Ci(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=bi(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function wi(e){let t=Y(e),n=t.documentElement,r=t.body,i=bi(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ti(e){let t=Y(e),n=t.documentElement,r=t.body,i=W(n),a=0,o=0,s=!1,c=ut.create();if(Qe&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,_i={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},yi=n.style.scrollBehavior,vi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=bi(n,r);if(s=Ci(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,_i),Object.assign(r.style,vi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=yi)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Ei=new class{lockCount=0;restore=null;timeoutLock=gt.create();timeoutUnlock=gt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Y(e),n=t.documentElement,r=t.body,i=W(n);if(xi(i,n,r)){let t=new i.MutationObserver(()=>{xi(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=qe||!Si(e);this.restore=a?wi(e):Ti(e)}};function Di(e=!0,t=null){J(()=>{if(e)return Ei.acquire(t)},[e,t])}var Oi=`base-ui-disable-scrollbar`,ki={className:Oi,getElement(e){return(0,B.jsx)(`style`,{nonce:e,href:Oi,precedence:`base-ui:low`,children:`.${Oi}{scrollbar-width:none}.${Oi}::-webkit-scrollbar{display:none}`})}},Ai=V.createContext(void 0),ji={disableStyleElements:!1};function Mi(){return V.useContext(Ai)??ji}function Ni(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Pi(e,t){return Math.max(0,e-t)}function Fi(e,t){if(t<=0)return 0;let n=Ni(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var Ii={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Li={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ri={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},zi={invalid:void 0,name:void 0,validityData:{state:Ii,errors:[],error:``,value:``,initialValue:null},setValidityData:l,disabled:void 0,setTouched:l,setDirty:l,setFilled:l,setFocused:l,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Li,registerFieldControl:l,validation:{getValidationProps:(e,t=a)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:l,getInputControl:()=>null,commit:async()=>{},change:l}},Bi=V.createContext(zi);function Vi(e=!0){let t=V.useContext(Bi);if(t.setValidityData===l&&!e)throw Error(f(28));return t}var Hi=V.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:l,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Ui(){return V.useContext(Hi)}var Wi=V.createContext({controlId:void 0,registerControlId:l,labelId:void 0,setLabelId:l,messageIds:[],setMessageIds:l,getDescriptionProps:e=>e});function Gi(){return V.useContext(Wi)}function Ki(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=Gi(),o=at(t),c=n?i:void 0,u=s(()=>Symbol()),d=V.useRef(!1),f=V.useRef(t!=null),p=q(()=>{!d.current||a===l||(d.current=!1,a(u.current,void 0))});return J(()=>{if(a===l)return;let e;if(n){let n=r?.current;e=G(n)&&n.closest(`label`)!=null?t??null:c??o}else if(t!=null)f.current=!0,e=t;else if(f.current)e=o;else{p();return}if(e===void 0){p();return}d.current=!0,a(u.current,e)},[t,r,c,a,n,o,u,p]),V.useEffect(()=>p,[p]),i??o}function qi(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Vi(),c=s(()=>Symbol());J(()=>{let s=c.current;if(!i){o(s,void 0);return}o(s,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,c,n]),J(()=>{let e=c.current;return()=>{o(e,void 0)}},[o,c])}var Ji=V.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Vi(),{clearErrors:w}=Ui(),T=g||s,E=h??a,D={...m,disabled:T},{labelId:O}=Gi(),k=Ki({id:i});J(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let j=V.useRef(null);J(()=>{d&&j.current===Z(Y(j.current))&&b(!0)},[d,b]);let[M]=H({controlled:o,default:u,name:`FieldControl`,state:`value`}),N=o!==void 0,ee=N?M:void 0,P=q(()=>C.inputRef.current?.value);return qi(C.inputRef,k,ee,P,!T,a),c(`input`,e,{ref:[t,j],state:D,props:[{id:k,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...N?{value:ee}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,ot(A,e.nativeEvent)),v(t!==(y.initialValue??``)),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:Ri})}),Yi=V.forwardRef(function(e,t){return(0,B.jsx)(Ji,{ref:t,...e})});function Xi({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=u(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),o;if(r){let{style:e,onValueChange:n,...r}=i;o=(0,B.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else o=(0,B.jsx)(Yi,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i});return(0,B.jsx)(`span`,{className:u(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:o})}export{$n as $,qe as $t,Jr as A,te as An,Z as At,Br as B,M as Bn,vt as Bt,ai as C,me as Cn,$ as Ct,ei as D,F as Dn,It as Dt,ui as E,re as En,jt as Et,Qr as F,oe as Fn,Dt as Ft,br as G,D as Gn,ft as Gt,Nr as H,R as Hn,_t as Ht,Wr as I,A as In,Ot as It,ar as J,g as Jn,ot as Jt,vr as K,E as Kn,dt as Kt,$r as L,ee as Ln,St as Lt,qr as M,L as Mn,At as Mt,Xr as N,P as Nn,kt as Nt,Hr as O,ae as On,Pt as Ot,Zr as P,I as Pn,Et as Pt,rr as Q,Qe as Qt,Yr as R,ie as Rn,bt as Rt,oi as S,pe as Sn,zt as St,li as T,H as Tn,Ft as Tt,kr as U,O as Un,mt as Ut,Rr as V,j as Vn,gt as Vt,Ar as W,k as Wn,pt as Wt,ir as X,it as Xt,or as Y,at as Yt,nr as Z,et as Zt,pi as _,ye as _n,Xt as _t,Gi as a,Fe as an,kn as at,ii as b,Se as bn,Wt as bt,Ri as c,Ce as cn,_n as ct,Ni as d,Oe as dn,Sn as dt,Xe as en,Zn as et,Mi as f,U as fn,Yt as ft,hi as g,W as gn,Kt as gt,gi as h,Te as hn,Qt as ht,Ki as i,Pe as in,Gn as it,Ur as j,se as jn,Q as jt,Gr as k,ne as kn,Lt as kt,Pi as l,be as ln,bn as lt,Di as m,De as mn,qt as mt,Ji as n,Le as nn,Hn as nt,Ui as o,J as on,Dn as ot,ki as p,we as pn,Jt as pt,hr as q,b as qn,st as qt,qi as r,Y as rn,Wn as rt,Vi as s,q as sn,Tn as st,Xi as t,Re as tn,Un as tt,Fi as u,le as un,xn as ut,ni as v,G as vn,Gt as vt,si as w,xe as wn,Rt as wt,ti as x,fe as xn,Bt as xt,ri as y,K as yn,Ut as yt,Vr as z,N as zn,xt as zt};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{$t as r,An as i,At as a,Bt as o,Cn as s,Dt as c,Ft as l,Ht as u,It as d,Jn as f,Jt as p,Kt as m,Lt as h,Mt as g,Nt as _,Ot as v,Pn as y,Pt as b,Q as x,Qt as S,Rt as C,Sn as w,Un as T,Vn as E,Z as D,Zt as ee,_n as O,_t as te,at as k,bn as A,cn as j,dn as ne,fn as M,ft as re,g as N,gn as P,gt as ie,hn as F,ht as ae,jt as oe,ln as se,m as ce,mn as I,mt as le,nt as ue,on as L,pn as R,pt as de,rn as fe,sn as z,un as B,vn as V,wn as H,wt as pe,xn as me,xt as he,yn as ge,zt as _e}from"./input-LtE7Sz4D.js";import{c as U,f as W,h as ve,i as G,p as K,s as ye}from"./button-BrcP8Wxx.js";import{t as be}from"./useValueChanged-DcnEcpiS.js";var xe=ve(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),q=e(t(),1),J=q.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Se(){return q.useContext(J)}function Ce(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Se(),u=q.useRef(-1),[d,f]=q.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=q.useRef(null),h=q.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return L(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var we=Math.min,Y=Math.max,Te=Math.round,Ee=Math.floor,X=e=>({x:e,y:e}),De={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Oe(e,t,n){return Y(e,we(t,n))}function Z(e,t){return typeof e==`function`?e(t):e}function Q(e){return e.split(`-`)[0]}function ke(e){return e.split(`-`)[1]}function Ae(e){return e===`x`?`y`:`x`}function je(e){return e===`y`?`height`:`width`}function $(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Me(e){return Ae($(e))}function Ne(e,t,n){n===void 0&&(n=!1);let r=ke(e),i=Me(e),a=je(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=He(o)),[o,He(o)]}function Pe(e){let t=He(e);return[Fe(e),t,Fe(t)]}function Fe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ie=[`left`,`right`],Le=[`right`,`left`],Re=[`top`,`bottom`],ze=[`bottom`,`top`];function Be(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Le:Ie:t?Ie:Le;case`left`:case`right`:return t?Re:ze;default:return[]}}function Ve(e,t,n,r){let i=ke(e),a=Be(Q(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Fe)))),a}function He(e){let t=Q(e);return De[t]+e.slice(t.length)}function Ue(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function We(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ue(e)}function Ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ke(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=E}=t,l=`rootStore`in e?e.rootStore:e,d=l.context.dataRef,f=q.useRef(void 0),_=m(),y=u(),b=q.useMemo(()=>{function e(e,t,n,r){let i=p(c,t,n);e&&r===`touch`&&s>0?y.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){f.current=h(e.pointerType,!0)&&_e(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||h(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=g(o);if(v(u)){e(c,o,u,i);return}let d=n.currentTarget;_.request(()=>{e(c,o,d,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;if(r===`mousedown`&&i){f.current=void 0;return}h(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,a,c,l,o,i,_,y,s]);return q.useMemo(()=>n?{reference:b}:U,[n,b])}function qe(e,t,n){let{reference:r,floating:i}=e,a=$(t),o=Me(t),s=je(o),c=Q(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ke(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Je(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Z(t,e),p=We(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ye=50,Xe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Je},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qe(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ze=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Q(r),_=$(o),v=Q(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[He(o)]:Pe(o)),x=p!==`none`;!d&&x&&b.push(...Ve(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ne(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===$(t)||T.every(e=>$(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Qe=new Set([`left`,`top`]);async function $e(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Q(n),s=ke(n),c=$(n)===`y`,l=Qe.has(o)?-1:1,u=a&&c?-1:1,d=Z(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var et=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await $e(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$(i),p=Ae(f),m=u[p],h=u[f],g=(e,t)=>Oe(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},nt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Z(e,t),u={x:n,y:r},d=$(i),f=Ae(d),p=u[f],m=u[d],h=Z(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Qe.has(Q(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Z(e,t),c=await i.detectOverflow(t,s),l=Q(n),u=ke(n),d=$(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=we(p-c[m],g),y=we(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Y(c.left,c.right):S=p-2*Y(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function it(e){let t=j(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ge(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Te(n)!==a||Te(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function at(e){return V(e)?e:e.contextElement}function ot(e){let t=at(e);if(!ge(t))return X(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=it(t),o=(a?Te(n.width):n.width)/r,s=(a?Te(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var st=X(0);function ct(e){let t=P(e);return!H()||!t.visualViewport?st:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===P(e)}function ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=at(e),o=X(1);t&&(r?V(r)&&(o=ot(r)):o=ot(e));let s=lt(a,n,r)?ct(a):X(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=P(a),t=V(r)?P(r):r,n=e,i=ne(n);for(;i&&t!==n;){let e=ot(i),t=i.getBoundingClientRect(),r=j(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=P(i),i=ne(n)}}return Ge({width:u,height:d,x:c,y:l})}function dt(e,t){let n=R(e).scrollLeft;return t?t.left+n:ut(B(e)).left+n}function ft(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dt(e,n),y:n.top+t.scrollTop}}function pt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=B(r),c=t?s(t.floating):!1;if(r===o||c&&a)return n;let l={scrollLeft:0,scrollTop:0},u=X(1),d=X(0),f=ge(r);if((f||!a)&&((M(r)!==`body`||me(o))&&(l=R(r)),f)){let e=ut(r);u=ot(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=o&&!f&&!a?ft(o,l):X(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function mt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ht(e){let t=R(e),n=e.ownerDocument.body,r=Y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+dt(e),o=-t.scrollTop;return j(n).direction===`rtl`&&(a+=Y(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var gt=25;function _t(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=P(e),a=B(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!H()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(dt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=gt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function vt(e,t){let n=ut(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ot(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=_t(e,n,t);else if(t===`document`)r=ht(B(e));else if(V(t))r=vt(t,n);else{let n=ct(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ge(r)}function bt(e,t){let n=t.get(e);if(n)return n;let r=I(e,[],!1).filter(e=>V(e)&&M(e)!==`body`),i=null,a=j(e).position===`fixed`,o=a?F(e):e;for(;V(o)&&!A(o);){let e=j(o),t=O(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=F(o)}return t.set(e,r),r}function xt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?s(t)?[]:bt(t,this._c):[].concat(n),r],o=yt(t,a[0],i),c=o.top,l=o.right,u=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=yt(t,a[e],i);c=Y(n.top,c),l=we(n.right,l),u=we(n.bottom,u),d=Y(n.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function St(e){let{width:t,height:n}=it(e);return{width:t,height:n}}function Ct(e,t,n){let r=ge(t),i=B(t),a=n===`fixed`,o=ut(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=X(0);if((r||!a)&&((M(t)!==`body`||me(i))&&(s=R(t)),r)){let e=ut(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=dt(i));let l=i&&!r&&!a?ft(i,s):X(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function wt(e){return j(e).position===`static`}function Tt(e,t){if(!ge(e)||j(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return B(e)===n&&(n=n.ownerDocument.body),n}function Et(e,t){let n=P(e);if(s(e))return n;if(!ge(e)){let t=F(e);for(;t&&!A(t);){if(V(t)&&!wt(t))return t;t=F(t)}return n}let r=Tt(e,t);for(;r&&w(r)&&wt(r);)r=Tt(r,t);return r&&A(r)&&wt(r)&&!O(r)?n:r||se(e)||n}var Dt=async function(e){let t=this.getOffsetParent||Et,n=this.getDimensions,r=await n(e.floating);return{reference:Ct(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ot(e){return j(e).direction===`rtl`}var kt={convertOffsetParentRelativeRectToViewportRelativeRect:pt,getDocumentElement:B,getClippingRect:xt,getOffsetParent:Et,getElementRects:Dt,getClientRects:mt,getDimensions:St,getScale:ot,isElement:V,isRTL:Ot};function At(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jt(e,t,n){let r=null,i,a=B(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ee(d),h=Ee(a.clientWidth-(u+f)),g=Ee(a.clientHeight-(d+p)),_=Ee(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Y(0,we(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!At(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=P(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Mt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=at(e),u=i||a?[...l?I(l):[],...t?I(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?jt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ut(e):null;c&&g();function g(){let t=ut(e);h&&!At(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Nt=et,Pt=tt,Ft=Ze,It=rt,Lt=nt,Rt=(e,t,n)=>{let r=new Map,i=n??{},a={...kt,...i.platform,_c:r};return Xe(e,t,{...i,platform:a})},zt=e(f(),1),Bt=typeof document<`u`?q.useLayoutEffect:function(){};function Vt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Vt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ht(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ut(e,t){let n=Ht(e);return Math.round(t*n)/n}function Wt(e){let t=q.useRef(e);return Bt(()=>{t.current=e}),t}function Gt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=q.useState(r);Vt(f,r)||p(r);let[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=q.useRef(null),C=q.useRef(null),w=q.useRef(u),T=c!=null,E=Wt(c),D=Wt(i),ee=Wt(l),O=q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Rt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};te.current&&!Vt(w.current,t)&&(w.current=t,zt.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Bt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=q.useRef(!1);Bt(()=>(te.current=!0,()=>{te.current=!1}),[]),Bt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let k=q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=q.useMemo(()=>({reference:b,floating:x}),[b,x]),j=q.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Ut(A.floating,u.x),r=Ut(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ht(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:O,refs:k,elements:A,floatingStyles:j}),[u,O,k,A,j])}var Kt=(e,t)=>{let n=Nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Pt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=(e,t)=>({fn:Lt(e).fn,options:[e,t]}),Yt=(e,t)=>{let n=Ft(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xt=(e,t)=>{let n=It(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Zt(e){return Qt(e,e.rootContext)}function Qt(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=q.useState(null),[d,f]=q.useState(void 0),[p,m]=q.useState(void 0),h=q.useRef(null),g=x(r),_=q.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Gt({...e,elements:{..._,...l&&{reference:l}}}),y=V(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let S=q.useCallback(e=>{let t=V(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),C=q.useCallback(e=>{(V(e)||e===null)&&(h.current=e,f(e)),(V(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!V(e))&&v.refs.setReference(e)},[v.refs,f]),w=q.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),T=q.useMemo(()=>({...v.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[v.refs,C,w,S]),E=q.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=q.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[v,T,E,n,t,s,c]);return L(()=>{o&&(h.current=o)},[o]),L(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),q.useMemo(()=>({...v,context:D,refs:T,elements:E,rootStore:t}),[v,T,E,D,t])}var $t=`Escape`;function en(e){return S&&e.movementX===0&&e.movementY===0}function tn(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function nn(e,t){return tn(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function rn(e,t,n){return tn(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function an(e,t,n){return tn(t,n?e===b:e===l,e===_)}function on(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===$t:tn(t,n?e===l:e===b,e===d)}function sn(e,t){let{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loopFocus:f=!1,nested:h=!1,rtl:_=!1,virtual:v=!1,focusItemOnOpen:b=`auto`,focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:T=void 0,orientation:E=`vertical`,parentOrientation:ee,id:O,resetOnPointerLeave:te=!0,externalTree:A,grid:j}=t,ne=j!=null,M=`rootStore`in e?e.rootStore:e,N=M.useState(`open`),P=M.useState(`floatingElement`),F=M.useState(`domReferenceElement`),ae=M.context.dataRef,se=pe(P),ce=c(F),I=he(se),ue=D(),R=x(A),B=q.useRef(b),V=q.useRef(u??-1),H=q.useRef(null),me=q.useRef(!0),U=z(e=>{s(V.current===-1?null:V.current,e)}),W=q.useRef(!!P),ve=q.useRef(N),G=q.useRef(!1),K=q.useRef(!1),ye=q.useRef(null),be=he(T),xe=he(N),J=he(u),Se=he(te),Ce=m(),we=m(),Y=z(()=>{function e(e){v?R?.events.emit(`virtualfocus`,e):ye.current=k(e,{sync:G.current,preventScroll:!0})}let t=n.current[V.current],r=K.current;t&&e(t),(G.current?e=>e():e=>Ce.request(e))(()=>{let i=n.current[V.current]||t;i&&(t||e(i),Z&&(r||!me.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});L(()=>{ae.current.orientation=E},[ae,E]),L(()=>{l&&(N&&P?(V.current=u??-1,B.current&&u!=null&&(K.current=!0,U())):W.current&&(V.current=-1,U()))},[l,N,P,u,U]),L(()=>{if(l){if(!N){G.current=!1;return}if(P){if(r==null){if(G.current=!1,J.current!=null)return;if(W.current&&(V.current=-1,Y()),(!ve.current||!W.current)&&B.current&&(H.current!=null||B.current===!0&&H.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>we.request(e):queueMicrotask)(t),e+=1):(V.current=H.current==null||rn(H.current,E,_)||h?le(n):de(n),H.current=null,U())};t()}}else ie(n.current,r)||(V.current=r,Y(),K.current=!1)}}},[l,N,P,r,J,h,n,E,_,U,Y,we]),L(()=>{if(!l||P||!R||v||!W.current)return;let e=R.nodesRef.current,t=e.find(e=>e.id===ue)?.context?.elements.floating,n=a(fe(F??t??null)),r=e.some(e=>e.context&&oe(e.context.elements.floating,n));t&&!r&&me.current&&t.focus({preventScroll:!0})},[l,P,F,R,ue,v]),L(()=>{ve.current=N,W.current=!!P}),L(()=>{N||(H.current=null,B.current=b)},[N,b]);let Te=r!=null,Ee=z(e=>{if(!xe.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(V.current!==t||r!==t)&&(V.current=t,U(e))}),X=z(()=>ee??R?.nodesRef.current.find(e=>e.id===ue)?.context?.dataRef?.current.orientation),De=z(()=>le(n,be.current)),Oe=z(e=>{if(me.current=!1,G.current=!0,e.which===229||!xe.current&&e.currentTarget===I.current)return;if(h&&on(e.key,E,_,ne)){nn(e.key,X())||o(e),M.setOpen(!1,p(y,e.nativeEvent)),ge(F)&&(v?R?.events.emit(`virtualfocus`,F):F.focus());return}let t=V.current,r=le(n,T),i=de(n,T);if(ce||(e.key===`Home`&&(o(e),V.current=r,U(e)),e.key===`End`&&(o(e),V.current=i,U(e))),j!=null){let t=j(e,V.current,n,E,f,_,T,r,i);if(t!=null&&(V.current=t,U(e)),E===`both`)return}if(nn(e.key,E)){if(o(e),N&&!v&&a(e.currentTarget.ownerDocument)===e.currentTarget){V.current=rn(e.key,E,_)?r:i,U(e);return}rn(e.key,E,_)?f?t>=i?d&&t!==n.current.length?V.current=-1:(G.current=!1,V.current=r):V.current=re(n.current,{startingIndex:t,disabledIndices:T}):V.current=Math.min(i,re(n.current,{startingIndex:t,disabledIndices:T})):f?t<=r?d&&t!==-1?V.current=n.current.length:(G.current=!1,V.current=i):V.current=re(n.current,{startingIndex:t,decrement:!0,disabledIndices:T}):V.current=Math.max(r,re(n.current,{startingIndex:t,decrement:!0,disabledIndices:T})),ie(n.current,V.current)&&(V.current=-1),U(e)}}),Z=q.useMemo(()=>({onFocus(e){G.current=!0,Ee(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){en(e)||(G.current=!0,K.current=!1,S&&Ee(e))},onPointerLeave(e){if(!xe.current||!me.current||e.pointerType===`touch`)return;G.current=!0;let t=e.relatedTarget;if(!(!S||n.current.includes(t))&&Se.current&&(ye.current?.(),ye.current=null,V.current=-1,U(e),!v)){let e=I.current,t=a(fe(e));e&&oe(e,t)&&e.focus({preventScroll:!0})}}}),[Ee,xe,I,S,n,U,Se,v]),Q=q.useMemo(()=>v&&N&&Te&&{"aria-activedescendant":`${O}-${r}`},[v,N,Te,O,r]),ke=q.useMemo(()=>({"aria-orientation":E===`both`?void 0:E,...ce?{}:Q,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&N&&!v){let t=g(e.nativeEvent);if(t&&!oe(I.current,t))return;o(e),M.setOpen(!1,p(i,e.nativeEvent)),ge(F)&&F.focus();return}Oe(e)},onPointerMove(e){en(e)||(me.current=!0)}}),[Q,Oe,I,E,ce,M,N,v,F]),Ae=q.useMemo(()=>{function e(e){M.setOpen(!0,p(y,e.nativeEvent,e.currentTarget))}function t(e){b===`auto`&&C(e.nativeEvent)&&(B.current=!v)}function n(e){B.current=b,b===`auto`&&_e(e.nativeEvent)&&(B.current=!0)}return{onKeyDown(t){let n=M.select(`open`);me.current=!1;let r=t.key.startsWith(`Arrow`),i=an(t.key,X(),_),a=nn(t.key,E),s=(h?i:a)||t.key===`Enter`||t.key.trim()===``;if(v&&n)return Oe(t);if(!(!n&&!w&&r)){if(s){let e=nn(t.key,X());H.current=h&&e?null:t.key}if(h){i&&(o(t),n?(V.current=De(),U(t)):e(t));return}a&&(J.current!=null&&(V.current=J.current),o(t),!n&&w?e(t):Oe(t),n&&U(t))}},onFocus(e){M.select(`open`)&&!v&&(V.current=-1,U(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[Oe,b,De,h,U,M,w,E,X,_,J,v]),je=q.useMemo(()=>({...Q,...Ae}),[Q,Ae]);return q.useMemo(()=>l?{reference:je,floating:ke,item:Z,trigger:Ae}:{},[l,je,ke,Ae,Z])}function cn(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:d=750,selectedIndex:f=null}=t,p=`rootStore`in e?e.rootStore:e,m=p.useState(`open`),h=u(),g=q.useRef(``),_=q.useRef(f??i??-1),v=q.useRef(null),y=z(e=>{function t(e){return r?.current[e]}function l(e){let n=t(e);return n&&!ae(n)||n?.matches(`:disabled`)?!1:s==null||!te(ye,e,s)}function u(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!l(n)))return n}return-1}let p=n.current;if(g.current.length>0&&e.key===` `&&(o(e),c?.(!0)),g.current.length>0&&g.current[0]!==` `&&u(p,g.current)===-1&&e.key!==` `&&c?.(!1),p==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;m&&e.key!==` `&&(o(e),c?.(!0));let y=g.current===``;y&&(_.current=f??i??-1),p.every((e,t)=>e&&l(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,_.current=v.current),g.current+=e.key,h.start(d,()=>{g.current=``,_.current=v.current,c?.(!1)});let b=((y?f??i??-1:_.current)??0)+1,x=u(p,g.current,b);x===-1?e.key!==` `&&(g.current=``,c?.(!1)):(a?.(x),v.current=x)}),b=z(e=>{let t=e.relatedTarget,n=p.select(`domReferenceElement`),r=p.select(`floatingElement`);oe(n,t)||oe(r,t)||(h.clear(),g.current=``,_.current=v.current,c?.(!1))});L(()=>{!m&&f!==null||(h.clear(),v.current=null,g.current!==``&&(g.current=``))},[m,f,h]);let x=q.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return q.useMemo(()=>l?{reference:x,floating:x}:{},[l,x])}var ln=q.createContext(void 0);function un(e){let t=q.useContext(ln);if(t===void 0&&!e)throw Error(K(69));return t}var dn=n();function fn(e){return e===`starting`?ue:U}var pn=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Z(e,t)||{};if(l==null)return{};let f=We(u),p={x:n,y:r},m=Me(i),h=je(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),ee=Math.min(f[y],E),O=D,te=w-g[h]-ee,k=w/2-g[h]/2+T,A=Oe(O,k,te),j=!c.arrow&&ke(i)!=null&&k!==A&&a.reference[h]/2-(k<O?D:ee)-g[h]/2<0,ne=j?k<O?k-O:k-te:0;return{[m]:p[m]+ne,data:{[m]:A,centerOffset:k-A-ne,...j&&{alignmentOffset:ne}},reset:j}}}),mn=(e,t)=>({...pn(e),options:[e,t]}),hn={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},gn={sideX:`left`,sideY:`top`},_n=`--available-width`,vn=`--available-height`;function yn(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function bn(e,t,n){let{rects:r,placement:i}=e;return{side:yn(t,Q(i),n),align:ke(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function xn(e){return Sn(e,Zt)}function Sn(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=q.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,ee=v?.crossAxis??!1,O=v?.rootBoundary,te=typeof n==`function`?n:void 0,k=z(te),A=te?k:n,j=he(n),ne=he(g),M=N()===`rtl`,re=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":M?`left`:`right`,"inline-start":M?`right`:`left`}[i],ie=o===`center`?re:`${re}-${o}`,F=l;typeof F==`number`?F={top:F,right:F,bottom:F,left:F}:F&&={top:F.top||0,right:F.right||0,bottom:F.bottom||0,left:F.left||0};let ae=+(i===`bottom`),oe=+(i===`top`),se=+(i===`right`),ce=+(i===`left`),I={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:F},le=q.useRef(null),ue=he(a),R=he(s),de=typeof a==`function`?0:a,B=typeof s==`function`?0:s,V=[];p&&V.push(p),V.push(Kt(e=>{let t=bn(e,i,M),n=typeof ue.current==`function`?ue.current(t):ue.current,r=typeof R.current==`function`?R.current(t):R.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[de,B,M,i]));let H=E===`none`&&T!==`shift`,pe=!H&&(u||ee||T===`shift`),me=T===`none`?null:Yt({...I,padding:{top:F.top+1+ae,right:F.right+1+ce,bottom:F.bottom+1+oe,left:F.left+1+se},mainAxis:!ee&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ge=H?null:qt({...I,rootBoundary:O,mainAxis:E!==`none`,crossAxis:pe,limiter:u||ee?void 0:Jt(e=>{if(!le.current)return{};let{width:t,height:n}=le.current.getBoundingClientRect(),r=$(Q(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})},[I,u,ee,O,F,E]);T===`shift`||E===`shift`||o===`center`?V.push(ge,me):V.push(me,ge),V.push(Xt({...I,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ne.current)return;let i=e.style;i.setProperty(_n,`${t}px`),i.setProperty(vn,`${n}px`);let a=P(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),mn(e=>({element:le.current||fe(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Q(r),l=$(c),u=le.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(bn(e,i,M)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,pe&&l===`y`&&b?S:x),{}}},hn,b),L(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let _e=q.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:W,x:ve,y:G,middlewareData:K,update:ye,placement:be,context:xe,isPositioned:J,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:ie,middleware:V,strategy:r,whileElementsMounted:m?void 0:(...e)=>Mt(...e,_e),nodeId:y,externalTree:S}),{sideX:Ce,sideY:we}=K.adaptiveOrigin||gn,Y=J?r:`fixed`,Te=q.useMemo(()=>{let e;return e=J?b?{position:Y,[Ce]:ve,[we]:G}:{...Se,position:Y}:{position:Y,top:0,left:0},e[_n]=`100vw`,e[vn]=`100vh`,J||(e.opacity=0),e},[b,Y,Ce,ve,we,G,Se,J]),Ee=q.useRef(null);L(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(Cn(t)?t.current:t)||null;n!==Ee.current&&(U.setPositionReference(n),Ee.current=n)},[g,U,A,j]),q.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&Cn(e)&&e.current!==Ee.current&&(U.setPositionReference(e.current),Ee.current=e.current)},[g,U,A,j]),q.useEffect(()=>{if(m&&g&&W.reference&&W.floating)return Mt(W.reference,W.floating,ye,_e)},[m,g,W,ye,_e]);let X=Q(be),De=yn(i,X,M),Oe=ke(be)||`center`,Z=!!K.hide?.referenceHidden;L(()=>{x&&g&&J&&X!==re&&w(X)},[x,g,J,X,re]);let Ae=q.useMemo(()=>({position:`absolute`,top:K.arrow?.y,left:K.arrow?.x}),[K.arrow]),je=K.arrow?.centerOffset!==0;return q.useMemo(()=>({positionerStyles:Te,arrowStyles:Ae,arrowRef:le,arrowUncentered:je,side:De,align:Oe,physicalSide:X,anchorHidden:Z,refs:U,context:xe,isPositioned:J,update:ye}),[Te,Ae,le,je,De,Oe,X,Z,U,xe,J,ye])}function Cn(e){return e!=null&&`current`in e}function wn(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=z(i),[,o]=q.useState(!1),s=W(En).current,c=W(Tn).current,l=q.useRef(0),u=q.useRef(!0),d=q.useRef([]),f=q.useRef(null),p=z(()=>{u.current||(u.current=!0,o(e=>!e))}),m=z((e,t)=>{c.set(e,t),p()}),h=z(e=>{c.delete(e),p()}),g=z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!kn(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&An(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=On(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=z(()=>{let[e,t]=Dn(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});L(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),L(()=>{u.current&&v()}),L(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=z(e=>(s.add(e),()=>{s.delete(e)})),b=q.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,dn.jsx)(J.Provider,{value:b,children:t})}function Tn(){return new Map}function En(){return new Set}function Dn(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>An(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function On(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function kn(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function An(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function jn(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),G(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},fn(r),i],stateAttributesMapping:T})}var Mn=20;function Nn(e,t,n,r){let[i,a]=q.useState(!1);L(()=>{if(!e||!t||n==null){a(!1);return}let r=fe(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Mn)},[e,t,n]),ce(e&&(!t||i),r)}function Pn(e){let t=q.useRef(``),n=q.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:q.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Fn(e,t){let{onClick:n,onPointerDown:i}=Pn(z((n,i)=>{(typeof e==`function`?e():e)||t(i||(r?`touch`:``))}));return q.useMemo(()=>({onClick:n,onPointerDown:i}),[n,i])}function In(e){let[t,n]=q.useState(null),r=Fn(e,n);return be(e,t=>{t&&!e&&n(null)}),q.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Ln=5;function Rn(e,t){let n=zn(t);return e.clientX>=n.left-Ln&&e.clientX<=n.right+Ln&&e.clientY>=n.top-Ln&&e.clientY<=n.bottom+Ln}function zn(e){let t=e.getBoundingClientRect(),n=P(e);if(ee)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Bn(e){let[t,n]=q.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Vn(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}export{Q as _,Fn as a,Ce as b,wn as c,fn as d,un as f,Ke as g,kt as h,In as i,xn as l,sn as m,Bn as n,Nn as o,cn as p,Rn as r,jn as s,Vn as t,gn as u,Ge as v,xe as x,Te as y};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r}from"./button-BrcP8Wxx.js";import{o as i}from"./monaco-DLwhzYMT.js";import{c as a,m as o}from"./brand-hHByyyzq.js";import{n as s}from"./client-B5szthbF.js";var c=e(t(),1),l=n(),u=c.createContext(void 0),d=e=>{let t=c.useContext(u);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},f=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,l.jsx)(u.Provider,{value:e,children:t})),p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function h(e){setTimeout(e,0)}var g=typeof window>`u`||`Deno`in globalThis;function _(){}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return typeof e==`number`&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==w(o,t.options))return!1}else if(!E(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!E(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function w(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!E(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!E(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=O(e)&&O(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function O(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{m.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t){return typeof e==`function`?e(...t):!!e}function de(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fe=()=>g,pe=()=>fe(),k=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},me=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=h;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var A=ge(),_e=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(_);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new be(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),p=()=>ye(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(pe()?0:3),a=e.retryDelay??ve,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y(this.gcTime)&&(this.#e=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(m.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{de(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>x(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!b(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends k{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||x(this.options.staleTime,this.#t)!==x(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#h(e){return!pe()&&x(this.options.enabled,this.#t)!==!1&&y(e)}#g(){this.#b();let e=x(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#u=m.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=m.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(m.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(m.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ae(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ae(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Fe(e,t),refetch:this.refetch,isEnabled:x(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();A.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function je(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||x(t.retryOnMount,e)!==!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(x(t.enabled,e)!==!1&&x(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(x(t.staleTime,e))}var Ie=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Le(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Le(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Re=class extends k{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Le();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ze=c.createContext(!1),Be=()=>c.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=c.createContext(Ve()),Ue=()=>c.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ue(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{c.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ue(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe(e,t,n){let r=Be(),i=Ue(),a=d(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let[u]=c.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&l;if(c.useSyncExternalStore(c.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):_;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(o)},[o,u]),Je(o,f))throw Ye(o,u,i);if(Ke({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:u.trackResult(f)}function j(e,t){return Xe(e,Ae,t)}function M(e,t){let n=d(t),[r]=c.useState(()=>new Re(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);let i=c.useSyncExternalStore(c.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=c.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(_)},[r]);if(i.error&&ue(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ze=r(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Qe=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$e=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,et=/^[\\/]{2}/;function tt(e,t){return t+e.replace(/\\/g,`/`)}var nt=`popstate`;function rt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function it(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=I(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),st(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:F(t))}function r(e,t){P(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return ct(t,n,r,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function at(){return Math.random().toString(36).substring(2,10)}function ot(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||at(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ct(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u()+1;let d=ot(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u();let i=ot(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return lt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(nt,d),c=e,()=>{i.removeEventListener(nt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function lt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&et.test(i)&&(i=r+i),new URL(i,r)}function ut(e,t,n=`/`){return dt(e,t,n,!1)}function dt(e,t,n,r,i){let a=R((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ft(e),s=null,c=Ot(a);for(let e=0;s==null&&e<o.length;++e)s=Tt(o[e],c,r);return s}function ft(e){let t=pt(e);return ht(t),t}function pt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=B([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ct(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of mt(e.path))a(e,t,!0,n)}),t}function mt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=mt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ht(e){e.sort((e,t)=>e.score===t.score?wt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var gt=/^:[\w-]+$/,_t=3,vt=2,yt=1,bt=10,xt=-2,St=e=>e===`*`;function Ct(e,t){let n=e.split(`/`),r=n.length;return n.some(St)&&(r+=xt),t&&(r+=vt),n.filter(e=>!St(e)).reduce((e,t)=>e+(gt.test(t)?_t:t===``?yt:bt),r)}function wt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Et(u,l,s.matcher,s.compiledParams):L(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:B([a,d.pathname]),pathnameBase:Ft(B([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=B([a,d.pathnameBase]))}return o}function L(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dt(e.path,e.caseSensitive,e.end);return Et(e,t,n,r)}function Et(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=V(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=V(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Dt(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ot(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function kt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Pt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?At(n.substring(1),`/`):At(n,t)):a=t,{pathname:a,search:It(r),hash:Lt(i)}}function At(e,t){let n=V(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function jt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Mt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Nt(e){let t=Mt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function z(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),jt(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),jt(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),jt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=kt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pt=e=>e.replace(/[\\/]{2,}/g,`/`),B=e=>Pt(e.join(`/`));function V(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ft=e=>V(e).replace(/^\/*/,`/`),It=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Lt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Rt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Bt(e){return B(e.map(e=>e.route.path).filter(Boolean))||`/`}var Vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ht(e,t){let n=e;if(typeof n!=`string`||!$e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Vt)try{let e=new URL(window.location.href),r=et.test(n)?new URL(tt(n,e.protocol)):new URL(n),a=R(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ut=new URL(`http://localhost`);function Wt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ut)}catch{return Ut}}function Gt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Kt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gt(i,n),s=!Gt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Kt(e,i)||!Gt(i,a)))throw Error(`External navigation is not allowed`)}var Jt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Jt);var Yt=[`GET`,...Jt];new Set(Yt);var Xt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Zt(e){try{return Xt.includes(new URL(e).protocol)}catch{return!1}}var H=c.createContext(null);H.displayName=`DataRouter`;var U=c.createContext(null);U.displayName=`DataRouterState`;var Qt=c.createContext(!1);function $t(){return c.useContext(Qt)}var en=c.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=c.createContext(new Map);tn.displayName=`Fetchers`;var nn=c.createContext(null);nn.displayName=`Await`;var W=c.createContext(null);W.displayName=`Navigation`;var G=c.createContext(null);G.displayName=`Location`;var K=c.createContext({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var rn=c.createContext(null);rn.displayName=`RouteError`;var an=`REACT_ROUTER_ERROR`,on=`REDIRECT`,sn=`ROUTE_ERROR_RESPONSE`;function cn(e){if(e.startsWith(`${an}:${on}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ln(e){if(e.startsWith(`${an}:${sn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Rt(t.status,t.statusText,t.data)}catch{}}function un(e,{relative:t}={}){N(q(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=c.useContext(W),{hash:i,pathname:a,search:o}=Y(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:B([n,a])),r.createHref({pathname:s,search:o,hash:i})}function q(){return c.useContext(G)!=null}function J(){return N(q(),`useLocation() may be used only in the context of a <Router> component.`),c.useContext(G).location}var dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function fn(e){c.useContext(W).static||c.useLayoutEffect(e)}function pn(){let{isDataRoute:e}=c.useContext(K);return e?jn():mn()}function mn(){N(q(),`useNavigate() may be used only in the context of a <Router> component.`);let e=c.useContext(H),{basename:t,navigator:n}=c.useContext(W),{matches:r}=c.useContext(K),{pathname:i}=J(),a=JSON.stringify(Nt(r)),o=c.useRef(!1);return fn(()=>{o.current=!0}),c.useCallback((r,s={})=>{if(P(o.current,dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=z(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),qt(typeof r==`string`?r:F(r),n.createHref(c),Wt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}c.createContext(null);function Y(e,{relative:t}={}){let{matches:n}=c.useContext(K),{pathname:r}=J(),i=JSON.stringify(Nt(n));return c.useMemo(()=>z(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function hn(e,t){return gn(e,t)}function gn(e,t,n){N(q(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=c.useContext(W),{matches:i}=c.useContext(K),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;Nn(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r}from"./button-BrcP8Wxx.js";import{o as i}from"./monaco-DLwhzYMT.js";import{o as a,u as o}from"./brand-Bj6g9sFF.js";import{n as s}from"./client-CQ3EdyuW.js";var c=e(t(),1),l=n(),u=c.createContext(void 0),d=e=>{let t=c.useContext(u);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},f=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,l.jsx)(u.Provider,{value:e,children:t})),p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function h(e){setTimeout(e,0)}var g=typeof window>`u`||`Deno`in globalThis;function _(){}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return typeof e==`number`&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==w(o,t.options))return!1}else if(!E(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!E(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function w(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!E(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!E(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=O(e)&&O(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function O(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{m.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t){return typeof e==`function`?e(...t):!!e}function de(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fe=()=>g,pe=()=>fe(),k=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},me=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=h;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var A=ge(),_e=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(_);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new be(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),p=()=>ye(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(pe()?0:3),a=e.retryDelay??ve,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y(this.gcTime)&&(this.#e=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(m.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{de(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>x(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!b(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends k{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||x(this.options.staleTime,this.#t)!==x(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#h(e){return!pe()&&x(this.options.enabled,this.#t)!==!1&&y(e)}#g(){this.#b();let e=x(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#u=m.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=m.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(m.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(m.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ae(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ae(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Fe(e,t),refetch:this.refetch,isEnabled:x(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();A.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function je(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||x(t.retryOnMount,e)!==!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(x(t.enabled,e)!==!1&&x(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(x(t.staleTime,e))}var Ie=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Le(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Le(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Re=class extends k{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Le();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ze=c.createContext(!1),Be=()=>c.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=c.createContext(Ve()),Ue=()=>c.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ue(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{c.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ue(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe(e,t,n){let r=Be(),i=Ue(),a=d(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let[u]=c.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&l;if(c.useSyncExternalStore(c.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):_;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(o)},[o,u]),Je(o,f))throw Ye(o,u,i);if(Ke({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:u.trackResult(f)}function j(e,t){return Xe(e,Ae,t)}function M(e,t){let n=d(t),[r]=c.useState(()=>new Re(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);let i=c.useSyncExternalStore(c.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=c.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(_)},[r]);if(i.error&&ue(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ze=r(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Qe=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$e=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,et=/^[\\/]{2}/;function tt(e,t){return t+e.replace(/\\/g,`/`)}var nt=`popstate`;function rt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function it(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=I(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),st(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:F(t))}function r(e,t){P(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return ct(t,n,r,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function at(){return Math.random().toString(36).substring(2,10)}function ot(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||at(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ct(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u()+1;let d=ot(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u();let i=ot(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return lt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(nt,d),c=e,()=>{i.removeEventListener(nt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function lt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&et.test(i)&&(i=r+i),new URL(i,r)}function ut(e,t,n=`/`){return dt(e,t,n,!1)}function dt(e,t,n,r,i){let a=R((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ft(e),s=null,c=Ot(a);for(let e=0;s==null&&e<o.length;++e)s=Tt(o[e],c,r);return s}function ft(e){let t=pt(e);return ht(t),t}function pt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=B([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ct(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of mt(e.path))a(e,t,!0,n)}),t}function mt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=mt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ht(e){e.sort((e,t)=>e.score===t.score?wt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var gt=/^:[\w-]+$/,_t=3,vt=2,yt=1,bt=10,xt=-2,St=e=>e===`*`;function Ct(e,t){let n=e.split(`/`),r=n.length;return n.some(St)&&(r+=xt),t&&(r+=vt),n.filter(e=>!St(e)).reduce((e,t)=>e+(gt.test(t)?_t:t===``?yt:bt),r)}function wt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Et(u,l,s.matcher,s.compiledParams):L(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:B([a,d.pathname]),pathnameBase:Ft(B([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=B([a,d.pathnameBase]))}return o}function L(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dt(e.path,e.caseSensitive,e.end);return Et(e,t,n,r)}function Et(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=V(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=V(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Dt(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ot(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function kt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Pt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?At(n.substring(1),`/`):At(n,t)):a=t,{pathname:a,search:It(r),hash:Lt(i)}}function At(e,t){let n=V(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function jt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Mt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Nt(e){let t=Mt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function z(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),jt(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),jt(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),jt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=kt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pt=e=>e.replace(/[\\/]{2,}/g,`/`),B=e=>Pt(e.join(`/`));function V(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ft=e=>V(e).replace(/^\/*/,`/`),It=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Lt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Rt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Bt(e){return B(e.map(e=>e.route.path).filter(Boolean))||`/`}var Vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ht(e,t){let n=e;if(typeof n!=`string`||!$e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Vt)try{let e=new URL(window.location.href),r=et.test(n)?new URL(tt(n,e.protocol)):new URL(n),a=R(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ut=new URL(`http://localhost`);function Wt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ut)}catch{return Ut}}function Gt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Kt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gt(i,n),s=!Gt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Kt(e,i)||!Gt(i,a)))throw Error(`External navigation is not allowed`)}var Jt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Jt);var Yt=[`GET`,...Jt];new Set(Yt);var Xt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Zt(e){try{return Xt.includes(new URL(e).protocol)}catch{return!1}}var H=c.createContext(null);H.displayName=`DataRouter`;var U=c.createContext(null);U.displayName=`DataRouterState`;var Qt=c.createContext(!1);function $t(){return c.useContext(Qt)}var en=c.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=c.createContext(new Map);tn.displayName=`Fetchers`;var nn=c.createContext(null);nn.displayName=`Await`;var W=c.createContext(null);W.displayName=`Navigation`;var G=c.createContext(null);G.displayName=`Location`;var K=c.createContext({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var rn=c.createContext(null);rn.displayName=`RouteError`;var an=`REACT_ROUTER_ERROR`,on=`REDIRECT`,sn=`ROUTE_ERROR_RESPONSE`;function cn(e){if(e.startsWith(`${an}:${on}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ln(e){if(e.startsWith(`${an}:${sn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Rt(t.status,t.statusText,t.data)}catch{}}function un(e,{relative:t}={}){N(q(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=c.useContext(W),{hash:i,pathname:a,search:o}=Y(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:B([n,a])),r.createHref({pathname:s,search:o,hash:i})}function q(){return c.useContext(G)!=null}function J(){return N(q(),`useLocation() may be used only in the context of a <Router> component.`),c.useContext(G).location}var dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function fn(e){c.useContext(W).static||c.useLayoutEffect(e)}function pn(){let{isDataRoute:e}=c.useContext(K);return e?jn():mn()}function mn(){N(q(),`useNavigate() may be used only in the context of a <Router> component.`);let e=c.useContext(H),{basename:t,navigator:n}=c.useContext(W),{matches:r}=c.useContext(K),{pathname:i}=J(),a=JSON.stringify(Nt(r)),o=c.useRef(!1);return fn(()=>{o.current=!0}),c.useCallback((r,s={})=>{if(P(o.current,dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=z(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),qt(typeof r==`string`?r:F(r),n.createHref(c),Wt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}c.createContext(null);function Y(e,{relative:t}={}){let{matches:n}=c.useContext(K),{pathname:r}=J(),i=JSON.stringify(Nt(n));return c.useMemo(()=>z(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function hn(e,t){return gn(e,t)}function gn(e,t,n){N(q(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=c.useContext(W),{matches:i}=c.useContext(K),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;Nn(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
3
  Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=J(),f;if(t){let e=typeof t==`string`?I(t):t;N(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ut(e,{pathname:m});P(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),P(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Cn(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:B([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:B([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?c.createElement(G.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function _n(){let e=An(),t=zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=c.createElement(c.Fragment,null,c.createElement(`p`,null,`💿 Hey developer 👋`),c.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,c.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,c.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),c.createElement(c.Fragment,null,c.createElement(`h2`,null,`Unexpected Application Error!`),c.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?c.createElement(`pre`,{style:i},n):null,o)}var vn=c.createElement(_n,null),yn=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:c.createElement(K.Provider,{value:this.props.routeContext},c.createElement(rn.Provider,{value:e,children:this.props.component}));return this.context?c.createElement(xn,{error:e},t):t}};yn.contextType=Qt;var bn=new WeakMap;function xn({children:e,error:t}){let{basename:n,navigator:r}=c.useContext(W);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=cn(t.digest);if(e){let i=bn.get(t);if(i)throw i;let a=Ht(e.location,n),o=a.absoluteURL||a.to;if(qt(e.location,o,Wt(r),`allow-explicit`),Zt(o))throw Error(`Invalid redirect location`);if(Vt&&!bn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw bn.set(t,n),n}}return c.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Sn({routeContext:e,match:t,children:n}){let r=c.useContext(H);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(K.Provider,{value:e},n)}function Cn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Bt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||vn,o&&(s<0&&l===0?(Nn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(Sn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?c.createElement(yn,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function wn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tn(e){let t=c.useContext(H);return N(t,wn(e)),t}function En(e){let t=c.useContext(U);return N(t,wn(e)),t}function Dn(e){let t=c.useContext(K);return N(t,wn(e)),t}function On(e){let t=Dn(e),n=t.matches[t.matches.length-1];return N(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kn(){return On(`useRouteId`)}function An(){let e=c.useContext(rn),t=En(`useRouteError`),n=On(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jn(){let{router:e}=Tn(`useNavigate`),t=On(`useNavigate`),n=c.useRef(!1);return fn(()=>{n.current=!0}),c.useCallback(async(r,i={})=>{P(n.current,dn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mn={};function Nn(e,t,n){!t&&!Mn[e]&&(Mn[e]=!0,P(!1,n))}c.memo(Pn);function Pn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return gn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Fn({to:e,replace:t,state:n,relative:r}){N(q(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=c.useContext(W);P(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=c.useContext(K),{pathname:s}=J(),l=pn(),u=z(e,Nt(o),s,r===`path`);qt(typeof e==`string`?e:F(e),a.createHref(u),Wt(a),`reject`);let d=JSON.stringify(u);return c.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function In(e){N(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ln({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){N(!q(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),l=c.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=c.useMemo(()=>{let e=R(u,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,u,d,f,p,m,r,h]);return P(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:c.createElement(W.Provider,{value:l},c.createElement(G.Provider,{children:t,value:g}))}function Rn({children:e,location:t}){return hn(zn(e),t)}c.Component;function zn(e,t=[]){let n=[];return c.Children.forEach(e,(e,r)=>{if(!c.isValidElement(e))return;let i=[...t,r];if(e.type===c.Fragment){n.push.apply(n,zn(e.props.children,i));return}N(e.type===In,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),N(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zn(e.props.children,i)),n.push(a)}),n}var Bn=`get`,Vn=`application/x-www-form-urlencoded`;function Hn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Un(e){return Hn(e)&&e.tagName.toLowerCase()===`button`}function Wn(e){return Hn(e)&&e.tagName.toLowerCase()===`form`}function Gn(e){return Hn(e)&&e.tagName.toLowerCase()===`input`}function Kn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qn(e,t){return e.button===0&&(!t||t===`_self`)&&!Kn(e)}function Jn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yn(e,t){let n=Jn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xn=null;function Zn(){if(Xn===null)try{new FormData(document.createElement(`form`),0),Xn=!1}catch{Xn=!0}return Xn}var Qn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $n(e){return e!=null&&!Qn.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vn}"`),null):e}function er(e,t){let n,r,i,a,o;if(Wn(e)){let o=e.getAttribute(`action`);r=o?R(o,t):null,n=e.getAttribute(`method`)||Bn,i=$n(e.getAttribute(`enctype`))||Vn,a=new FormData(e)}else if(Un(e)||Gn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?R(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bn,i=$n(e.getAttribute(`formenctype`))||$n(o.getAttribute(`enctype`))||Vn,a=new FormData(o,e),!Zn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Hn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bn,r=null,i=Vn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function tr(e,t){if(e===!1||e==null)throw Error(t)}function nr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&R(i.pathname,t)===`/`?`${V(t)}/_root.${r}`:`${V(i.pathname)}.${r}`,i}async function rr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ir(e){return e!=null&&typeof e.page==`string`}function ar(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function or(e,t,n){return dr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ar).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function sr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function cr(e,t,{includeHydrateFallback:n}={}){return lr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function lr(e){return[...new Set(e)]}function ur(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function dr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ir(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ur(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function fr(){let e=c.useContext(H);return tr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function pr(){let e=c.useContext(U);return tr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var mr=c.createContext(void 0);mr.displayName=`FrameworkContext`;function hr(){let e=c.useContext(mr);return tr(e,`You must render this element inside a <HydratedRouter> element`),e}function gr(e,t){let n=c.useContext(mr),[r,i]=c.useState(!1),[a,o]=c.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=c.useRef(null);c.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),c.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:X(s,m),onBlur:X(l,h),onMouseEnter:X(u,m),onMouseLeave:X(d,h),onTouchStart:X(f,m)}]:[a,p,{}]:[!1,p,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function _r({page:e,...t}){let n=$t(),{nonce:r}=hr(),{router:i}=fr(),a=c.useMemo(()=>ut(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?c.createElement(yr,{page:e,matches:a,...t}):c.createElement(br,{page:e,matches:a,...t})):null}function vr(e){let{manifest:t,routeModules:n}=hr(),[r,i]=c.useState([]);return c.useEffect(()=>{let r=!1;return or(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function yr({page:e,matches:t,...n}){let r=J(),{future:i}=hr(),{basename:a}=fr(),o=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,o.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function br({page:e,matches:t,...n}){let r=J(),{future:i,manifest:a,routeModules:o}=hr(),{basename:s}=fr(),{loaderData:l,matches:u}=pr(),d=c.useMemo(()=>sr(e,t,u,a,r,`data`),[e,t,u,a,r]),f=c.useMemo(()=>sr(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,c=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?c=!0:n.add(e.route.id))}),n.size===0)return[];let u=nr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return c&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=c.useMemo(()=>cr(f,a),[f,a]),h=vr(f);return c.createElement(c.Fragment,null,p.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>c.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>c.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function xr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}c.Component;var Sr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Sr&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Cr({basename:e,children:t,useTransitions:n,window:r}){let i=c.useRef();i.current??=it({window:r,v5Compat:!0});let a=i.current,[o,s]=c.useState({action:a.action,location:a.location}),l=c.useCallback(e=>{n===!1?s(e):c.startTransition(()=>s(e))},[n]);return c.useLayoutEffect(()=>a.listen(l),[a,l]),c.createElement(Ln,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var wr=c.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=c.useContext(W),y=typeof u==`string`&&$e.test(u),b=Ht(u,g);u=b.to;let x=un(u,{relative:r}),S=J(),C=null;if(o){let e=z(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:B([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=gr(n,m),ee=kr(u,{replace:a,mask:o,state:s,target:l,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let D=!(b.isExternal||i),O=c.createElement(`a`,{...m,...E,href:(D?C:void 0)||b.absoluteURL||x,onClick:D?te:e,ref:xr(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?c.createElement(c.Fragment,null,O,c.createElement(_r,{page:x})):O});wr.displayName=`Link`;var Tr=c.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...l},u){let d=Y(a,{relative:l.relative}),f=J(),p=c.useContext(U),{navigator:m,basename:h}=c.useContext(W),g=p!=null&&Fr(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=R(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return c.createElement(wr,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Tr.displayName=`NavLink`;var Er=c.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bn,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=c.useContext(W),_=Nr(),v=Pr(s,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&$e.test(s);return c.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?c.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Er.displayName=`Form`;function Dr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Or(e){let t=c.useContext(H);return N(t,Dr(e)),t}function kr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=pn(),f=J(),p=Y(e,{relative:o});return c.useCallback(m=>{if(qn(m,t)){m.preventDefault();let t=n===void 0?F(f)===F(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l});u?c.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,l,u])}function Ar(e){P(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(Jn(e)),n=c.useRef(!1),r=J(),i=c.useMemo(()=>Yn(r.search,n.current?null:t.current),[r.search]),a=pn();return[i,c.useCallback((e,t)=>{let r=Jn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var jr=0,Mr=()=>`__${String(++jr)}__`;function Nr(){let{router:e}=Or(`useSubmit`),{basename:t}=c.useContext(W),n=kn(),r=e.fetch,i=e.navigate;return c.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=er(e,t);if(a.navigate===!1){let e=a.fetcherKey||Mr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Pr(e,{relative:t}={}){let{basename:n}=c.useContext(W),r=c.useContext(K);N(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Y(e||`.`,{relative:t})},o=J();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:B([n,a.pathname])),F(a)}function Fr(e,{relative:t}={}){let n=c.useContext(en);N(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Or(`useViewTransitionState`),i=Y(e,{relative:t});if(!n.isTransitioning)return!1;let a=R(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=R(n.nextLocation.pathname,r)||n.nextLocation.pathname;return L(i.pathname,o)!=null||L(i.pathname,a)!=null}var Z={isOpen:!1,isMinimized:!1,isMaximized:!1,openTabs:[],activeTab:null,splitTab:null,splitRatio:50,position:null,size:{width:560,height:680},drafts:{},modes:{},harnesses:{},terminalLaunches:{}};function Ir(){try{let e=localStorage.getItem(a)??localStorage.getItem(o);if(!e)return Z;let t=JSON.parse(e);return{drafts:{},harnesses:Object.fromEntries(Object.entries(t.harnesses??{}).filter(([,e])=>typeof e==`string`)),terminalLaunches:{},modes:Object.fromEntries(Object.entries(t.modes??{}).filter(([,e])=>e===`cli`||e===`chat`)),isOpen:typeof t.isOpen==`boolean`?t.isOpen:Z.isOpen,isMinimized:typeof t.isMinimized==`boolean`?t.isMinimized:Z.isMinimized,isMaximized:typeof t.isMaximized==`boolean`?t.isMaximized:Z.isMaximized,openTabs:Array.isArray(t.openTabs)?t.openTabs.filter(e=>typeof e==`string`):[],activeTab:typeof t.activeTab==`string`?t.activeTab:null,splitTab:typeof t.splitTab==`string`&&t.splitTab!==t.activeTab?t.splitTab:null,splitRatio:typeof t.splitRatio==`number`&&Number.isFinite(t.splitRatio)?Math.max(25,Math.min(75,t.splitRatio)):50,position:t.position&&typeof t.position.x==`number`&&typeof t.position.y==`number`?{x:t.position.x,y:t.position.y}:null,size:t.size&&typeof t.size.width==`number`&&typeof t.size.height==`number`?{width:Math.max(380,Math.min(t.size.width,window.innerWidth||1200)),height:Math.max(420,Math.min(t.size.height,window.innerHeight||900))}:Z.size}}catch{return Z}}var Lr=Ir(),Rr=new Set;function zr(){try{localStorage.setItem(a,JSON.stringify({...Lr,terminalLaunches:{},drafts:{}}))}catch{}for(let e of Rr)e()}function Q(e){Lr=e(Lr),zr()}var $={getState:()=>Lr,subscribe:e=>(Rr.add(e),()=>Rr.delete(e)),openTerminal:(e,t=`shell`,n,r)=>{$.open(e),$.setHarness(e,t),Q(i=>({...i,modes:{...i.modes,[e]:`cli`},terminalLaunches:{...i.terminalLaunches,[e]:{id:crypto.randomUUID(),target:t,sessionId:n,cwd:r}}}))},consumeTerminalLaunch:(e,t)=>{Q(n=>{if(n.terminalLaunches[e]?.id!==t)return n;let r={...n.terminalLaunches};return delete r[e],{...n,terminalLaunches:r}})},setMode:(e,t)=>Q(n=>({...n,modes:{...n.modes,[e]:t}})),setHarness:(e,t)=>Q(n=>({...n,harnesses:{...n.harnesses,[e]:t}})),openDraft:(e,t)=>{$.open(e),$.setMode(e,`chat`),Q(n=>({...n,drafts:{...n.drafts,[e]:{id:crypto.randomUUID(),text:t}}}))},consumeDraft:(e,t)=>{Q(n=>{if(n.drafts[e]?.id!==t)return n;let r={...n.drafts};return delete r[e],{...n,drafts:r}})},openCli:e=>$.open(e,`cli`),open:(e,t)=>{Q(n=>{let r=[...n.openTabs],i=n.activeTab;return e?(r.includes(e)||r.push(e),i=e):!i&&r.length>0&&(i=r[0]),{...n,isOpen:!0,isMinimized:!1,openTabs:r,activeTab:i,modes:e&&t?{...n.modes,[e]:t}:n.modes,splitTab:i===n.splitTab?n.activeTab:n.splitTab}})},close:()=>{Q(e=>({...e,isOpen:!1,isMinimized:!1}))},minimize:()=>{Q(e=>({...e,isMinimized:!0}))},restore:()=>{Q(e=>({...e,isOpen:!0,isMinimized:!1}))},toggleMaximize:()=>{Q(e=>({...e,isMaximized:!e.isMaximized,isMinimized:!1}))},addTab:e=>{Q(t=>{let n=t.openTabs.includes(e)?t.openTabs:[...t.openTabs,e];return{...t,isOpen:!0,isMinimized:!1,openTabs:n,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab}})},removeTab:e=>{Q(t=>{let n=t.openTabs.filter(t=>t!==e),r=t.activeTab;return r===e&&(r=n.find(e=>e!==t.splitTab)??n[0]??null),{...t,openTabs:n,activeTab:r,splitTab:e===t.splitTab||r===t.splitTab?null:t.splitTab,isOpen:n.length>0&&t.isOpen}})},setActiveTab:e=>{Q(t=>t.openTabs.includes(e)?{...t,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab,isMinimized:!1}:t)},setSplitTab:e=>{Q(t=>{if(e===t.activeTab)return t;let n=e&&!t.openTabs.includes(e)?[...t.openTabs,e]:t.openTabs;return{...t,openTabs:n,splitTab:e,isMaximized:e?!0:t.isMaximized}})},setSplitRatio:e=>Q(t=>({...t,splitRatio:Math.max(25,Math.min(75,e))})),setPosition:e=>{Q(t=>({...t,position:e}))},setSize:e=>{Q(t=>({...t,size:{width:Math.max(380,Math.min(e.width,window.innerWidth||1200)),height:Math.max(420,Math.min(e.height,window.innerHeight||900))}}))}};function Br(){return{...(0,c.useSyncExternalStore)($.subscribe,$.getState,()=>Z),...$}}function Vr(){return j({queryKey:[`config`],queryFn:()=>s(`/api/config`)})}function Hr(){return j({queryKey:[`workspaces`],queryFn:()=>s(`/api/workspaces`)})}function Ur(e={}){return j({queryKey:[`workspaces-status`],queryFn:()=>s(`/api/workspaces/status`),enabled:e.enabled??!0,refetchInterval:e.intervalMs??!1})}function Wr(){return j({queryKey:[`domain-packs`],queryFn:async()=>(await s(`/api/enterprise/domain-packs`))?.domainPacks??[]})}function Gr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Kr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e.id)}`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function qr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Jr(){let e=d();return M({mutationFn:e=>s(`/api/workspace`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Yr(){return j({queryKey:[`projects`],queryFn:()=>s(`/api/projects`)})}function Xr(){let e=d();return M({mutationFn:e=>s(`/api/projects`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function Zr(){let e=d();return M({mutationFn:({id:e,...t})=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function Qr(){let e=d();return M({mutationFn:e=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function $r(){return j({queryKey:[`repos`],queryFn:()=>s(`/api/repos`)})}function ei(e,t){return j({queryKey:[`repo-branches`,e],queryFn:()=>s(`/api/repos/branches?path=${encodeURIComponent(e)}`),enabled:t,staleTime:6e4})}function ti(e,t=!0){return j({queryKey:[`repos-freshness`,e],queryFn:()=>s(`/api/repos/freshness`,{method:`POST`,body:JSON.stringify({repos:e})}),enabled:t&&e.length>0,staleTime:3e4})}function ni(){let e=d();return M({mutationFn:e=>s(`/api/repos/pull`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`repo-freshness`]}),e.invalidateQueries({queryKey:[`repos-freshness`]})}})}function ri(){let e=d();return M({mutationFn:e=>s(`/api/repos/new`,{method:`POST`,body:JSON.stringify({name:e})}),onSuccess:()=>e.invalidateQueries({queryKey:[`repos`]})})}function ii(){return j({queryKey:[`ai-detect`],queryFn:()=>s(`/api/ai-detect`),staleTime:6e4})}function ai(){return j({queryKey:[`editor-detect`],queryFn:()=>s(`/api/editor-detect`),staleTime:6e4})}function oi(){return j({queryKey:[`workspace-launch-targets`],queryFn:()=>s(`/api/workspace-launch-targets`),staleTime:6e4})}function si(e,t){return j({queryKey:[`workspace-recent-sessions`,e],queryFn:async()=>{let t=new URLSearchParams({limit:`3`,desktopHandoffOnly:`true`});return(await s(`/api/workspace/${encodeURIComponent(e)}/sessions?${t}`)).sessions},enabled:t,staleTime:3e4})}function ci(){return j({queryKey:[`workflow-templates`],queryFn:async()=>(await s(`/api/workflows/templates`)).templates})}function li(e){return j({queryKey:[`workspace-services`,e],queryFn:()=>s(`/api/workspace/${encodeURIComponent(e)}/services`),enabled:!!e,refetchInterval:3e3,retry:1})}function ui(e){let t=d();return M({mutationFn:({action:t,service:n})=>{let r=`/api/workspace/${encodeURIComponent(e)}/services`,i=n?`${r}/${encodeURIComponent(n)}/${t}`:`${r}/${t}`;return s(i,{method:`POST`})},onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function di(e){let t=d();return M({mutationFn:({action:t,id:n})=>s(`/api/workspace/${encodeURIComponent(e)}/orchestrators/${t}`,{method:`POST`,body:JSON.stringify({id:n})}),onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function fi(){return j({queryKey:[`skill-categories`],queryFn:async()=>(await s(`/api/skills/categories`)).categories})}function pi(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function mi(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function hi(e){return{queryKey:[`skills`,e],queryFn:()=>s(e?`/api/skills?workspace=${encodeURIComponent(e)}`:`/api/skills`)}}function gi(e){return j({...hi(e),select:e=>e.diagnostics??[]})}function _i(e){return j({...hi(e),select:e=>e.skills})}function vi(){let e=d();return M({mutationFn:e=>s(`/api/skills`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function yi(){let e=d();return M({mutationFn:e=>{let t=typeof e==`string`?e:e.id,n=typeof e==`string`?void 0:e.workspaceId,r=n?`/api/skills/${encodeURIComponent(t)}?workspace=${encodeURIComponent(n)}`:`/api/skills/${encodeURIComponent(t)}`;return s(r,{method:`DELETE`})},onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function bi(){return j({queryKey:[`codex-agents`],queryFn:async()=>(await s(`/api/agents`)).agents})}function xi(){let e=d();return M({mutationFn:e=>s(`/api/agents`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Si(){let e=d();return M({mutationFn:({toml:e,category:t})=>s(`/api/agents/import`,{method:`POST`,body:JSON.stringify({toml:e,category:t})}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Ci(){let e=d();return M({mutationFn:e=>s(`/api/agents/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function wi(e){return j({queryKey:[`workspace-skills`,e],queryFn:async()=>(await s(`/api/skills/workspace/${encodeURIComponent(e)}`)).config,enabled:!!e})}function Ti(){let e=d();return M({mutationFn:({workspaceId:e,expectedRevision:t,...n})=>s(`/api/skills/workspace/${encodeURIComponent(e)}/assign`,{method:`POST`,body:JSON.stringify({...n,expectedRevision:t})}),onSuccess:(t,n)=>{e.setQueryData([`workspace-skills`,n.workspaceId],t.config),e.invalidateQueries({queryKey:[`skills`]})}})}function Ei(){return M({mutationFn:async({workspaceId:e,...t})=>t.assistant?($.openTerminal(e,t.assistant,t.sessionId,t.cwd),{success:!0,command:t.assistant}):s(`/api/workspace/${encodeURIComponent(e)}/terminal`,{method:`POST`,body:JSON.stringify(t)})})}function Di(){let e=d();return M({mutationFn:({workspaceId:e,force:t})=>s(`/api/workspace/${encodeURIComponent(e)}/refresh`,{method:`POST`,body:JSON.stringify({force:t})}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspace-skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Oi(e){return j({queryKey:[`workspace-lifecycle`,e],queryFn:async()=>await s(`/api/workspace/${encodeURIComponent(e)}/lifecycle`),enabled:!!e,staleTime:1e4})}export{Qe as $,fi as A,Hr as B,$r as C,vi as D,Kr as E,oi as F,wr as G,$ as H,Oi as I,In as J,Tr as K,si as L,_i as M,Zr as N,pi as O,ci as P,Ar as Q,li as R,ei as S,xi as T,Br as U,Ur as V,Cr as W,J as X,Rn as Y,pn as Z,Ei as _,f as _t,Gr as a,A as at,ni as b,Jr as c,v as ct,Qr as d,C as dt,Ze as et,yi as f,S as ft,Si as g,ce as gt,ai as h,x as ht,Vr as i,_e as it,gi as j,ui as k,Ci as l,T as lt,Wr as m,E as mt,ii as n,Ie as nt,Xr as o,me as ot,mi as p,_ as pt,Fn as q,Ti as r,Ee as rt,ri as s,k as st,bi as t,j as tt,qr as u,w as ut,di as v,d as vt,ti as w,Di as x,Yr as y,wi as z};