octomux 1.0.0

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/README.md +60 -0
  2. package/bin/octomux.js +139 -0
  3. package/cli/dist/client.js +56 -0
  4. package/cli/dist/commands/add-agent.js +20 -0
  5. package/cli/dist/commands/cancel-task.js +10 -0
  6. package/cli/dist/commands/close-task.js +16 -0
  7. package/cli/dist/commands/create-task.js +35 -0
  8. package/cli/dist/commands/delete-task.js +16 -0
  9. package/cli/dist/commands/get-task.js +37 -0
  10. package/cli/dist/commands/list-tasks.js +31 -0
  11. package/cli/dist/commands/resume-task.js +18 -0
  12. package/cli/dist/commands/send-message.js +18 -0
  13. package/cli/dist/format.js +40 -0
  14. package/cli/dist/index.js +36 -0
  15. package/cli/package.json +9 -0
  16. package/dist/assets/TaskDetail-GGGQ2C1J.js +1 -0
  17. package/dist/assets/TerminalView-CguHyqU9.js +3 -0
  18. package/dist/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  19. package/dist/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  20. package/dist/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  21. package/dist/assets/index-Br9dLOzs.css +1 -0
  22. package/dist/assets/index-Bsj_BLLM.js +2 -0
  23. package/dist/assets/vendor-react-BZ8ItZjw.js +49 -0
  24. package/dist/assets/vendor-router-DRLGqALp.js +12 -0
  25. package/dist/assets/vendor-ui-CWZtXYLx.js +31 -0
  26. package/dist/assets/vendor-xterm-DYP7pi_n.css +32 -0
  27. package/dist/assets/vendor-xterm-DvXGiZvM.js +9 -0
  28. package/dist/index.html +17 -0
  29. package/dist/logo.png +0 -0
  30. package/dist-server/api.d.ts +2 -0
  31. package/dist-server/api.js +447 -0
  32. package/dist-server/app.d.ts +2 -0
  33. package/dist-server/app.js +13 -0
  34. package/dist-server/db.d.ts +7 -0
  35. package/dist-server/db.js +107 -0
  36. package/dist-server/events.d.ts +13 -0
  37. package/dist-server/events.js +35 -0
  38. package/dist-server/hook-settings.d.ts +5 -0
  39. package/dist-server/hook-settings.js +195 -0
  40. package/dist-server/hooks.d.ts +2 -0
  41. package/dist-server/hooks.js +118 -0
  42. package/dist-server/index.d.ts +5 -0
  43. package/dist-server/index.js +81 -0
  44. package/dist-server/orchestrator.d.ts +4 -0
  45. package/dist-server/orchestrator.js +37 -0
  46. package/dist-server/poller.d.ts +17 -0
  47. package/dist-server/poller.js +170 -0
  48. package/dist-server/pr-template.d.ts +7 -0
  49. package/dist-server/pr-template.js +29 -0
  50. package/dist-server/task-runner.d.ts +28 -0
  51. package/dist-server/task-runner.js +359 -0
  52. package/dist-server/terminal.d.ts +13 -0
  53. package/dist-server/terminal.js +173 -0
  54. package/dist-server/types.d.ts +73 -0
  55. package/dist-server/types.js +1 -0
  56. package/package.json +113 -0
@@ -0,0 +1,12 @@
1
+ import{r as i}from"./vendor-react-BZ8ItZjw.js";/**
2
+ * react-router v7.13.1
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */var ue="popstate";function ce(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function _e(e={}){function t(n,a){var f;let o=(f=a.state)==null?void 0:f.masked,{pathname:l,search:u,hash:s}=o||n.location;return Q("",{pathname:l,search:u,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:_(a)}return Be(t,r,null,e)}function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function S(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ae(){return Math.random().toString(36).substring(2,10)}function fe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Q(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?N(t):t,state:r,key:t&&t.key||n||Ae(),unstable_mask:a}}function _({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function N(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Be(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,u="POP",s=null,f=d();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function d(){return(l.state||{idx:null}).idx}function c(){u="POP";let m=d(),h=m==null?null:m-f;f=m,s&&s({action:u,location:y.location,delta:h})}function p(m,h){u="PUSH";let R=ce(m)?m:Q(y.location,m,h);f=d()+1;let w=fe(R,f),C=y.createHref(R.unstable_mask||R);try{l.pushState(w,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(C)}o&&s&&s({action:u,location:y.location,delta:1})}function g(m,h){u="REPLACE";let R=ce(m)?m:Q(y.location,m,h);f=d();let w=fe(R,f),C=y.createHref(R.unstable_mask||R);l.replaceState(w,"",C),o&&s&&s({action:u,location:y.location,delta:0})}function v(m){return We(m)}let y={get action(){return u},get location(){return e(a,l)},listen(m){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(ue,c),s=m,()=>{a.removeEventListener(ue,c),s=null}},createHref(m){return t(a,m)},createURL:v,encodeLocation(m){let h=v(m);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:p,replace:g,go(m){return l.go(m)}};return y}function We(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),E(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:_(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function ye(e,t,r="/"){return He(e,t,r,!1)}function He(e,t,r,n){let a=typeof t=="string"?N(t):t,o=$(a.pathname||"/",r);if(o==null)return null;let l=ge(e);je(l);let u=null;for(let s=0;u==null&&s<l.length;++s){let f=et(o);u=Qe(l[s],f,n)}return u}function ge(e,t=[],r=[],n="",a=!1){let o=(l,u,s=a,f)=>{let d={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&s)return;E(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let c=k([n,d.relativePath]),p=r.concat(d);l.children&&l.children.length>0&&(E(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),ge(l.children,t,p,c,s)),!(l.path==null&&!l.index)&&t.push({path:c,score:qe(c,l.index),routesMeta:p})};return e.forEach((l,u)=>{var s;if(l.path===""||!((s=l.path)!=null&&s.includes("?")))o(l,u);else for(let f of ve(l.path))o(l,u,!0,f)}),t}function ve(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=ve(n.join("/")),u=[];return u.push(...l.map(s=>s===""?o:[o,s].join("/"))),a&&u.push(...l),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function je(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xe(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var ze=/^:[\w-]+$/,Ve=3,Je=2,Ke=1,Ye=10,Ge=-2,de=e=>e==="*";function qe(e,t){let r=e.split("/"),n=r.length;return r.some(de)&&(n+=Ge),t&&(n+=Je),r.filter(a=>!de(a)).reduce((a,o)=>a+(ze.test(o)?Ve:o===""?Ke:Ye),n)}function Xe(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Qe(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let u=0;u<n.length;++u){let s=n[u],f=u===n.length-1,d=o==="/"?t:t.slice(o.length)||"/",c=V({path:s.relativePath,caseSensitive:s.caseSensitive,end:f},d),p=s.route;if(!c&&f&&r&&!n[n.length-1].route.index&&(c=V({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},d)),!c)return null;Object.assign(a,c.params),l.push({params:a,pathname:k([o,c.pathname]),pathnameBase:at(k([o,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(o=k([o,c.pathnameBase]))}return l}function V(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Ze(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:n.reduce((f,{paramName:d,isOptional:c},p)=>{if(d==="*"){let v=u[p]||"";l=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const g=u[p];return c&&!g?f[d]=void 0:f[d]=(g||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function Ze(e,t=!1,r=!0){S(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,s,f,d)=>{if(n.push({paramName:u,isOptional:s!=null}),s){let c=d.charAt(f+l.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function et(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return S(!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 $(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}var tt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function rt(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?N(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=he(r.substring(1),"/"):o=he(r,t)):o=t,{pathname:o,search:ot(n),hash:lt(a)}}function he(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function G(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Re(e){let t=nt(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function te(e,t,r,n=!1){let a;typeof e=="string"?a=N(e):(a={...e},E(!a.pathname||!a.pathname.includes("?"),G("?","pathname","search",a)),E(!a.pathname||!a.pathname.includes("#"),G("#","pathname","hash",a)),E(!a.search||!a.search.includes("#"),G("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,u;if(l==null)u=r;else{let c=t.length-1;if(!n&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),c-=1;a.pathname=p.join("/")}u=c>=0?t[c]:"/"}let s=rt(a,u),f=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(f||d)&&(s.pathname+="/"),s}var k=e=>e.join("/").replace(/\/\/+/g,"/"),at=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ot=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,lt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,it=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function st(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ut(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var we=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e,t){let r=e;if(typeof r!="string"||!tt.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(we)try{let o=new URL(window.location.href),l=r.startsWith("//")?new URL(o.protocol+r):new URL(r),u=$(l.pathname,t);l.origin===o.origin&&u!=null?r=u+l.search+l.hash:a=!0}catch{S(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xe=["POST","PUT","PATCH","DELETE"];new Set(xe);var ct=["GET",...xe];new Set(ct);var M=i.createContext(null);M.displayName="DataRouter";var J=i.createContext(null);J.displayName="DataRouterState";var ft=i.createContext(!1),Ce=i.createContext({isTransitioning:!1});Ce.displayName="ViewTransition";var dt=i.createContext(new Map);dt.displayName="Fetchers";var ht=i.createContext(null);ht.displayName="Await";var b=i.createContext(null);b.displayName="Navigation";var A=i.createContext(null);A.displayName="Location";var P=i.createContext({outlet:null,matches:[],isDataRoute:!1});P.displayName="Route";var re=i.createContext(null);re.displayName="RouteError";var be="REACT_ROUTER_ERROR",pt="REDIRECT",mt="ROUTE_ERROR_RESPONSE";function yt(e){if(e.startsWith(`${be}:${pt}:{`))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 gt(e){if(e.startsWith(`${be}:${mt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new it(t.status,t.statusText,t.data)}catch{}}function vt(e,{relative:t}={}){E(B(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(b),{hash:a,pathname:o,search:l}=W(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:k([r,o])),n.createHref({pathname:u,search:l,hash:a})}function B(){return i.useContext(A)!=null}function T(){return E(B(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(A).location}var Se="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Pe(e){i.useContext(b).static||i.useLayoutEffect(e)}function Le(){let{isDataRoute:e}=i.useContext(P);return e?It():Rt()}function Rt(){E(B(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(M),{basename:t,navigator:r}=i.useContext(b),{matches:n}=i.useContext(P),{pathname:a}=T(),o=JSON.stringify(Re(n)),l=i.useRef(!1);return Pe(()=>{l.current=!0}),i.useCallback((s,f={})=>{if(S(l.current,Se),!l.current)return;if(typeof s=="number"){r.go(s);return}let d=te(s,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:k([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,o,a,e])}var wt=i.createContext(null);function Et(e){let t=i.useContext(P).outlet;return i.useMemo(()=>t&&i.createElement(wt.Provider,{value:e},t),[t,e])}function gr(){let{matches:e}=i.useContext(P),t=e[e.length-1];return t?t.params:{}}function W(e,{relative:t}={}){let{matches:r}=i.useContext(P),{pathname:n}=T(),a=JSON.stringify(Re(r));return i.useMemo(()=>te(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function xt(e,t){return ke(e,t)}function ke(e,t,r){var m;E(B(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=i.useContext(b),{matches:a}=i.useContext(P),o=a[a.length-1],l=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",f=o&&o.route;{let h=f&&f.path||"";Te(u,!f||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${h}">) 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.
11
+
12
+ Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let d=T(),c;if(t){let h=typeof t=="string"?N(t):t;E(s==="/"||((m=h.pathname)==null?void 0:m.startsWith(s)),`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 "${s}" but pathname "${h.pathname}" was given in the \`location\` prop.`),c=h}else c=d;let p=c.pathname||"/",g=p;if(s!=="/"){let h=s.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(h.length).join("/")}let v=ye(e,{pathname:g});S(f||v!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),S(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${c.pathname}${c.search}${c.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 y=Lt(v&&v.map(h=>Object.assign({},h,{params:Object.assign({},l,h.params),pathname:k([s,n.encodeLocation?n.encodeLocation(h.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:k([s,n.encodeLocation?n.encodeLocation(h.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),a,r);return t&&y?i.createElement(A.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...c},navigationType:"POP"}},y):y}function Ct(){let e=Dt(),t=st(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,l)}var bt=i.createElement(Ct,null),$e=class extends i.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?e.error:t.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"){const r=gt(e.digest);r&&(e=r)}let t=e!==void 0?i.createElement(P.Provider,{value:this.props.routeContext},i.createElement(re.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(St,{error:e},t):t}};$e.contextType=ft;var q=new WeakMap;function St({children:e,error:t}){let{basename:r}=i.useContext(b);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=yt(t.digest);if(n){let a=q.get(t);if(a)throw a;let o=Ee(n.location,r);if(we&&!q.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw q.set(t,l),l}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Pt({routeContext:e,match:t,children:r}){let n=i.useContext(M);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(P.Provider,{value:e},r)}function Lt(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let d=a.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);E(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(r&&n){l=n.renderFallback;for(let d=0;d<a.length;d++){let c=a[d];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=d),c.route.id){let{loaderData:p,errors:g}=n,v=c.route.loader&&!p.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||v){r.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let s=r==null?void 0:r.onError,f=n&&s?(d,c)=>{var p,g;s(d,{location:n.location,params:((g=(p=n.matches)==null?void 0:p[0])==null?void 0:g.params)??{},unstable_pattern:ut(n.matches),errorInfo:c})}:void 0;return a.reduceRight((d,c,p)=>{let g,v=!1,y=null,m=null;n&&(g=o&&c.route.id?o[c.route.id]:void 0,y=c.route.errorElement||bt,l&&(u<0&&p===0?(Te("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,m=null):u===p&&(v=!0,m=c.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,p+1)),R=()=>{let w;return g?w=y:v?w=m:c.route.Component?w=i.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=d,i.createElement(Pt,{match:c,routeContext:{outlet:d,matches:h,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?i.createElement($e,{location:n.location,revalidation:n.revalidation,component:y,error:g,children:R(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:f}):R()},null)}function ne(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kt(e){let t=i.useContext(M);return E(t,ne(e)),t}function $t(e){let t=i.useContext(J);return E(t,ne(e)),t}function Tt(e){let t=i.useContext(P);return E(t,ne(e)),t}function ae(e){let t=Tt(e),r=t.matches[t.matches.length-1];return E(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ft(){return ae("useRouteId")}function Dt(){var n;let e=i.useContext(re),t=$t("useRouteError"),r=ae("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function It(){let{router:e}=kt("useNavigate"),t=ae("useNavigate"),r=i.useRef(!1);return Pe(()=>{r.current=!0}),i.useCallback(async(a,o={})=>{S(r.current,Se),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var pe={};function Te(e,t,r){!t&&!pe[e]&&(pe[e]=!0,S(!1,r))}i.memo(Nt);function Nt({routes:e,future:t,state:r,isStatic:n,onError:a}){return ke(e,void 0,{state:r,isStatic:n,onError:a})}function vr(e){return Et(e.context)}function Mt(e){E(!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 Ot({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){E(!B(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=i.useMemo(()=>({basename:u,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[u,a,o,l]);typeof r=="string"&&(r=N(r));let{pathname:f="/",search:d="",hash:c="",state:p=null,key:g="default",unstable_mask:v}=r,y=i.useMemo(()=>{let m=$(f,u);return m==null?null:{location:{pathname:m,search:d,hash:c,state:p,key:g,unstable_mask:v},navigationType:n}},[u,f,d,c,p,g,n,v]);return S(y!=null,`<Router basename="${u}"> is not able to match the URL "${f}${d}${c}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:i.createElement(b.Provider,{value:s},i.createElement(A.Provider,{children:t,value:y}))}function Rr({children:e,location:t}){return xt(Z(e),t)}function Z(e,t=[]){let r=[];return i.Children.forEach(e,(n,a)=>{if(!i.isValidElement(n))return;let o=[...t,a];if(n.type===i.Fragment){r.push.apply(r,Z(n.props.children,o));return}E(n.type===Mt,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=Z(n.props.children,o)),r.push(l)}),r}var j="get",z="application/x-www-form-urlencoded";function K(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ut(e){return K(e)&&e.tagName.toLowerCase()==="button"}function _t(e){return K(e)&&e.tagName.toLowerCase()==="form"}function At(e){return K(e)&&e.tagName.toLowerCase()==="input"}function Bt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wt(e,t){return e.button===0&&(!t||t==="_self")&&!Bt(e)}function ee(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Ht(e,t){let r=ee(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var H=null;function jt(){if(H===null)try{new FormData(document.createElement("form"),0),H=!1}catch{H=!0}return H}var zt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function X(e){return e!=null&&!zt.has(e)?(S(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`),null):e}function Vt(e,t){let r,n,a,o,l;if(_t(e)){let u=e.getAttribute("action");n=u?$(u,t):null,r=e.getAttribute("method")||j,a=X(e.getAttribute("enctype"))||z,o=new FormData(e)}else if(Ut(e)||At(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(n=s?$(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||j,a=X(e.getAttribute("formenctype"))||X(u.getAttribute("enctype"))||z,o=new FormData(u,e),!jt()){let{name:f,type:d,value:c}=e;if(d==="image"){let p=f?`${f}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else f&&o.append(f,c)}}else{if(K(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=j,n=null,a=z,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Jt(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&$(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function Kt(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Yt(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 Gt(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await Kt(o,r);return l.links?l.links():[]}return[]}));return Zt(n.flat(1).filter(Yt).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function me(e,t,r,n,a,o){let l=(s,f)=>r[f]?s.route.id!==r[f].route.id:!0,u=(s,f)=>{var d;return r[f].pathname!==s.pathname||((d=r[f].route.path)==null?void 0:d.endsWith("*"))&&r[f].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,f)=>l(s,f)||u(s,f)):o==="data"?t.filter((s,f)=>{var c;let d=n.routes[s.route.id];if(!d||!d.hasLoader)return!1;if(l(s,f)||u(s,f))return!0;if(s.route.shouldRevalidate){let p=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((c=r[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function qt(e,t,{includeHydrateFallback:r}={}){return Xt(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Xt(e){return[...new Set(e)]}function Qt(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Zt(e,t){let r=new Set;return new Set(t),e.reduce((n,a)=>{let o=JSON.stringify(Qt(a));return r.has(o)||(r.add(o),n.push({key:o,link:a})),n},[])}function Fe(){let e=i.useContext(M);return oe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function er(){let e=i.useContext(J);return oe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var le=i.createContext(void 0);le.displayName="FrameworkContext";function De(){let e=i.useContext(le);return oe(e,"You must render this element inside a <HydratedRouter> element"),e}function tr(e,t){let r=i.useContext(le),[n,a]=i.useState(!1),[o,l]=i.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:f,onMouseLeave:d,onTouchStart:c}=t,p=i.useRef(null);i.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let y=h=>{h.forEach(R=>{l(R.isIntersecting)})},m=new IntersectionObserver(y,{threshold:.5});return p.current&&m.observe(p.current),()=>{m.disconnect()}}},[e]),i.useEffect(()=>{if(n){let y=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(y)}}},[n]);let g=()=>{a(!0)},v=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:U(u,g),onBlur:U(s,v),onMouseEnter:U(f,g),onMouseLeave:U(d,v),onTouchStart:U(c,g)}]:[!1,p,{}]}function U(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function rr({page:e,...t}){let{router:r}=Fe(),n=i.useMemo(()=>ye(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?i.createElement(ar,{page:e,matches:n,...t}):null}function nr(e){let{manifest:t,routeModules:r}=De(),[n,a]=i.useState([]);return i.useEffect(()=>{let o=!1;return Gt(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function ar({page:e,matches:t,...r}){let n=T(),{future:a,manifest:o,routeModules:l}=De(),{basename:u}=Fe(),{loaderData:s,matches:f}=er(),d=i.useMemo(()=>me(e,t,f,o,n,"data"),[e,t,f,o,n]),c=i.useMemo(()=>me(e,t,f,o,n,"assets"),[e,t,f,o,n]),p=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,m=!1;if(t.forEach(R=>{var C;let w=o.routes[R.route.id];!w||!w.hasLoader||(!d.some(x=>x.route.id===R.route.id)&&R.route.id in s&&((C=l[R.route.id])!=null&&C.shouldRevalidate)||w.hasClientLoader?m=!0:y.add(R.route.id))}),y.size===0)return[];let h=Jt(e,u,a.unstable_trailingSlashAwareDataRequests,"data");return m&&y.size>0&&h.searchParams.set("_routes",t.filter(R=>y.has(R.route.id)).map(R=>R.route.id).join(",")),[h.pathname+h.search]},[u,a.unstable_trailingSlashAwareDataRequests,s,n,o,d,t,e,l]),g=i.useMemo(()=>qt(c,o),[c,o]),v=nr(c);return i.createElement(i.Fragment,null,p.map(y=>i.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),g.map(y=>i.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),v.map(({key:y,link:m})=>i.createElement("link",{key:y,nonce:r.nonce,...m,crossOrigin:m.crossOrigin??r.crossOrigin})))}function or(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var lr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lr&&(window.__reactRouterVersion="7.13.1")}catch{}function wr({basename:e,children:t,unstable_useTransitions:r,window:n}){let a=i.useRef();a.current==null&&(a.current=_e({window:n,v5Compat:!0}));let o=a.current,[l,u]=i.useState({action:o.action,location:o.location}),s=i.useCallback(f=>{r===!1?u(f):i.startTransition(()=>u(f))},[r]);return i.useLayoutEffect(()=>o.listen(s),[o,s]),i.createElement(Ot,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:r})}var Ie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=i.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,unstable_mask:u,state:s,target:f,to:d,preventScrollReset:c,viewTransition:p,unstable_defaultShouldRevalidate:g,...v},y){let{basename:m,navigator:h,unstable_useTransitions:R}=i.useContext(b),w=typeof d=="string"&&Ie.test(d),C=Ee(d,m);d=C.to;let x=vt(d,{relative:a}),L=T(),F=null;if(u){let D=te(u,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);m!=="/"&&(D.pathname=D.pathname==="/"?m:k([m,D.pathname])),F=h.createHref(D)}let[I,O,Y]=tr(n,v),Oe=cr(d,{replace:l,unstable_mask:u,state:s,target:f,preventScrollReset:c,relative:a,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:R});function Ue(D){t&&t(D),D.defaultPrevented||Oe(D)}let ie=!(C.isExternal||o),se=i.createElement("a",{...v,...Y,href:(ie?F:void 0)||C.absoluteURL||x,onClick:ie?Ue:t,ref:or(y,O),target:f,"data-discover":!w&&r==="render"?"true":void 0});return I&&!w?i.createElement(i.Fragment,null,se,i.createElement(rr,{page:x})):se});Ne.displayName="Link";var ir=i.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:u,children:s,...f},d){let c=W(l,{relative:f.relative}),p=T(),g=i.useContext(J),{navigator:v,basename:y}=i.useContext(b),m=g!=null&&mr(c)&&u===!0,h=v.encodeLocation?v.encodeLocation(c).pathname:c.pathname,R=p.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,h=h.toLowerCase()),w&&y&&(w=$(w,y)||w);const C=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let x=R===h||!a&&R.startsWith(h)&&R.charAt(C)==="/",L=w!=null&&(w===h||!a&&w.startsWith(h)&&w.charAt(h.length)==="/"),F={isActive:x,isPending:L,isTransitioning:m},I=x?t:void 0,O;typeof n=="function"?O=n(F):O=[n,x?"active":null,L?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let Y=typeof o=="function"?o(F):o;return i.createElement(Ne,{...f,"aria-current":I,className:O,ref:d,style:Y,to:l,viewTransition:u},typeof s=="function"?s(F):s)});ir.displayName="NavLink";var sr=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=j,action:u,onSubmit:s,relative:f,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:p,...g},v)=>{let{unstable_useTransitions:y}=i.useContext(b),m=hr(),h=pr(u,{relative:f}),R=l.toLowerCase()==="get"?"get":"post",w=typeof u=="string"&&Ie.test(u),C=x=>{if(s&&s(x),x.defaultPrevented)return;x.preventDefault();let L=x.nativeEvent.submitter,F=(L==null?void 0:L.getAttribute("formmethod"))||l,I=()=>m(L||x.currentTarget,{fetcherKey:t,method:F,navigate:r,replace:a,state:o,relative:f,preventScrollReset:d,viewTransition:c,unstable_defaultShouldRevalidate:p});y&&r!==!1?i.startTransition(()=>I()):I()};return i.createElement("form",{ref:v,method:R,action:h,onSubmit:n?s:C,...g,"data-discover":!w&&e==="render"?"true":void 0})});sr.displayName="Form";function ur(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Me(e){let t=i.useContext(M);return E(t,ur(e)),t}function cr(e,{target:t,replace:r,unstable_mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:s,unstable_useTransitions:f}={}){let d=Le(),c=T(),p=W(e,{relative:l});return i.useCallback(g=>{if(Wt(g,t)){g.preventDefault();let v=r!==void 0?r:_(c)===_(p),y=()=>d(e,{replace:v,unstable_mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:s});f?i.startTransition(()=>y()):y()}},[c,d,p,r,n,a,t,e,o,l,u,s,f])}function Er(e){S(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=i.useRef(ee(e)),r=i.useRef(!1),n=T(),a=i.useMemo(()=>Ht(n.search,r.current?null:t.current),[n.search]),o=Le(),l=i.useCallback((u,s)=>{const f=ee(typeof u=="function"?u(new URLSearchParams(a)):u);r.current=!0,o("?"+f,s)},[o,a]);return[a,l]}var fr=0,dr=()=>`__${String(++fr)}__`;function hr(){let{router:e}=Me("useSubmit"),{basename:t}=i.useContext(b),r=Ft(),n=e.fetch,a=e.navigate;return i.useCallback(async(o,l={})=>{let{action:u,method:s,encType:f,formData:d,body:c}=Vt(o,t);if(l.navigate===!1){let p=l.fetcherKey||dr();await n(p,r,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:c,formMethod:l.method||s,formEncType:l.encType||f,flushSync:l.flushSync})}else await a(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:c,formMethod:l.method||s,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[n,a,t,r])}function pr(e,{relative:t}={}){let{basename:r}=i.useContext(b),n=i.useContext(P);E(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...W(e||".",{relative:t})},l=T();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(d=>d==="")){u.delete("index"),s.filter(c=>c).forEach(c=>u.append("index",c));let d=u.toString();o.search=d?`?${d}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:k([r,o.pathname])),_(o)}function mr(e,{relative:t}={}){let r=i.useContext(Ce);E(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Me("useViewTransitionState"),a=W(e,{relative:t});if(!r.isTransitioning)return!1;let o=$(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=$(r.nextLocation.pathname,n)||r.nextLocation.pathname;return V(a.pathname,l)!=null||V(a.pathname,o)!=null}export{wr as B,Ne as L,vr as O,Rr as R,Le as a,gr as b,Mt as c,Er as d,T as u};
@@ -0,0 +1,31 @@
1
+ var Qs=Object.defineProperty;var ei=(e,t,n)=>t in e?Qs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var se=(e,t,n)=>ei(e,typeof t!="symbol"?t+"":t,n);import{r as d,R as hr,j as Z,a as Je,b as br}from"./vendor-react-BZ8ItZjw.js";function Xn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Mt={};function vr(e,t,n,o,r){let s={...qn(e,Mt)};return t&&(s=en(s,t)),n&&(s=en(s,n)),o&&(s=en(s,o)),s}function ti(e){if(e.length===0)return Mt;if(e.length===1)return qn(e[0],Mt);let t={...qn(e[0],Mt)};for(let n=1;n<e.length;n+=1)t=en(t,e[n]);return t}function en(e,t){return yr(t)?t(e):ni(e,t)}function ni(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Xn(e.style,o);break}case"className":{e[n]=Er(e.className,o);break}default:oi(n,o)?e[n]=ri(e[n],o):e[n]=o}}return e}function oi(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function yr(e){return typeof e=="function"}function qn(e,t){return yr(e)?e(t):e??Mt}function ri(e,t){return t?e?n=>{if(si(n)){const r=n;Gn(r);const s=t(r);return r.baseUIHandlerPrevented||e==null||e(r),s}const o=t(n);return e==null||e(n),o}:t:e}function Gn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Er(e,t){return t?e?t+" "+e:t:e}function si(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function ii(e,t){return function(o,...r){const s=new URL(e);return s.searchParams.set("code",o.toString()),r.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${o}; visit ${s} for the full message.`}}const We=ii("https://base-ui.com/production-error","Base UI"),Io={};function Ae(e,t){const n=d.useRef(Io);return n.current===Io&&(n.current=e(t)),n}function rn(e,t,n,o){const r=Ae(Rr).current;return li(r,e,t,n,o)&&Sr(r,[e,t,n,o]),r.callback}function ci(e){const t=Ae(Rr).current;return ai(t,e)&&Sr(t,e),t.callback}function Rr(){return{callback:null,cleanup:null,refs:[]}}function li(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function ai(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Sr(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const ui=parseInt(d.version,10);function so(e){return ui>=e}function ko(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(so(19)?n==null?void 0:n.ref:t.ref)??null}function fi(e,t){const n={};for(const o in e){const r=e[o];if(t!=null&&t.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function di(e,t){return typeof e=="function"?e(t):e}function pi(e,t){return typeof e=="function"?e(t):e}function Ce(){}const Te=Object.freeze({}),gi=500,mi={style:{transition:"none"}},io="data-base-ui-click-trigger",hi={fallbackAxisSide:"end"},bi={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ne(e,t,n={}){const o=t.render,r=vi(t,n);if(n.enabled===!1)return null;const s=n.state??Te;return Ei(e,o,r,s)}function vi(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Te,ref:i,props:c,stateAttributesMapping:a,enabled:l=!0}=t,u=l?di(n,s):void 0,f=l?pi(o,s):void 0,b=l?fi(s,a):Te,h=l?Xn(b,Array.isArray(c)?ti(c):c)??Te:Te;return typeof document<"u"&&(l?Array.isArray(i)?h.ref=ci([h.ref,ko(r),...i]):h.ref=rn(h.ref,ko(r),i):rn(null,null)),l?(u!==void 0&&(h.className=Er(h.className,u)),f!==void 0&&(h.style=Xn(h.style,f)),h):Te}const yi=Symbol.for("react.lazy");function Ei(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=vr(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===yi&&(s=d.Children.toArray(t)[0]),d.cloneElement(s,r)}if(e&&typeof e=="string")return Ri(e,n);throw new Error(We(8))}function Ri(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}function xu(e){return Ne(e.defaultTagName??"div",e,e)}function hn(){return typeof window<"u"}function st(e){return co(e)?(e.nodeName||"").toLowerCase():"#document"}function Se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qe(e){var t;return(t=(co(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function co(e){return hn()?e instanceof Node||e instanceof Se(e).Node:!1}function ae(e){return hn()?e instanceof Element||e instanceof Se(e).Element:!1}function ye(e){return hn()?e instanceof HTMLElement||e instanceof Se(e).HTMLElement:!1}function Ft(e){return!hn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Se(e).ShadowRoot}function it(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ke(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Si(e){return/^(table|td|th)$/.test(st(e))}function bn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const wi=/transform|translate|scale|rotate|perspective|filter/,xi=/paint|layout|strict|content/,ft=e=>!!e&&e!=="none";let An;function lo(e){const t=ae(e)?ke(e):e;return ft(t.transform)||ft(t.translate)||ft(t.scale)||ft(t.rotate)||ft(t.perspective)||!vn()&&(ft(t.backdropFilter)||ft(t.filter))||wi.test(t.willChange||"")||xi.test(t.contain||"")}function Ti(e){let t=Qe(e);for(;ye(t)&&!ze(t);){if(lo(t))return t;if(bn(t))return null;t=Qe(t)}return null}function vn(){return An==null&&(An=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),An}function ze(e){return/^(html|body|#document)$/.test(st(e))}function ke(e){return Se(e).getComputedStyle(e)}function yn(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qe(e){if(st(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ft(e)&&e.host||qe(e);return Ft(t)?t.host:t}function wr(e){const t=Qe(e);return ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&&it(t)?t:wr(t)}function Lt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=wr(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Se(r);if(s){const c=Kn(i);return t.concat(i,i.visualViewport||[],it(r)?r:[],c&&n?Lt(c):[])}else return t.concat(r,Lt(r,[],n))}function Kn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mn=hr[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Ci=Mn&&Mn!==d.useLayoutEffect?Mn:e=>e();function G(e){const t=Ae(Pi).current;return t.next=e,Ci(t.effect),t.trampoline}function Pi(){const e={next:void 0,callback:Oi,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Oi(){}const Ii={...hr},ki=()=>{},K=typeof document<"u"?d.useLayoutEffect:ki,Ai=d.createContext(void 0);function Mi(e=!1){const t=d.useContext(Ai);if(t===void 0&&!e)throw new Error(We(16));return t}function Fi(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function En(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0,composite:s}=e,i=d.useRef(null),c=Mi(!0),a=s??c!==void 0,{props:l}=Fi({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:o,isNativeButton:r}),u=d.useCallback(()=>{const h=i.current;Fn(h)&&a&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,a]);K(u,[u]);const f=d.useCallback((h={})=>{const{onClick:g,onMouseDown:p,onKeyUp:m,onKeyDown:S,onPointerDown:v,...R}=h;return vr({type:r?"button":void 0,onClick(y){if(t){y.preventDefault();return}g==null||g(y)},onMouseDown(y){t||p==null||p(y)},onKeyDown(y){if(t||(Gn(y),S==null||S(y),y.baseUIHandlerPrevented))return;const x=y.target===y.currentTarget,w=y.currentTarget,I=Fn(w),F=!r&&Li(w),V=x&&(r?I:!F),D=y.key==="Enter",A=y.key===" ",T=w.getAttribute("role"),M=(T==null?void 0:T.startsWith("menuitem"))||T==="option"||T==="gridcell";if(x&&a&&A){if(y.defaultPrevented&&M)return;y.preventDefault(),F||r&&I?(w.click(),y.preventBaseUIHandler()):V&&(g==null||g(y),y.preventBaseUIHandler());return}V&&(!r&&(A||D)&&y.preventDefault(),!r&&D&&(g==null||g(y)))},onKeyUp(y){if(!t){if(Gn(y),m==null||m(y),y.target===y.currentTarget&&r&&a&&Fn(y.currentTarget)&&y.key===" "){y.preventDefault();return}y.baseUIHandlerPrevented||y.target===y.currentTarget&&!r&&!a&&y.key===" "&&(g==null||g(y))}},onPointerDown(y){if(t){y.preventDefault();return}v==null||v(y)}},r?void 0:{role:"button"},l,R)},[t,l,a,r]),b=G(h=>{i.current=h,u()});return{getButtonProps:f,buttonRef:b}}function Fn(e){return ye(e)&&e.tagName==="BUTTON"}function Li(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Tu=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,focusableWhenDisabled:i=!1,nativeButton:c=!0,...a}=t,{getButtonProps:l,buttonRef:u}=En({disabled:s,focusableWhenDisabled:i,native:c});return Ne("button",t,{state:{disabled:s},ref:[n,u],props:[a,l]})}),xr=d.createContext(void 0);function gt(e){const t=d.useContext(xr);if(e===!1&&t===void 0)throw new Error(We(27));return t}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Di={[Dt.startingStyle]:""},Ni={[Dt.endingStyle]:""},ao={transitionStatus(e){return e==="starting"?Di:e==="ending"?Ni:null}};let dt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),zn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Vi={[zn.popupOpen]:""},Bi={[zn.popupOpen]:"",[zn.pressed]:""},$i={[dt.open]:""},Wi={[dt.closed]:""},_i={[dt.anchorHidden]:""},Tr={open(e){return e?Vi:null}},ji={open(e){return e?Bi:null}},Rn={open(e){return e?$i:Wi},anchorHidden(e){return e?_i:null}},Hi={...Rn,...ao},Cu=d.forwardRef(function(t,n){const{render:o,className:r,forceRender:s=!1,...i}=t,{store:c}=gt(),a=c.useState("open"),l=c.useState("nested"),u=c.useState("mounted"),f=c.useState("transitionStatus");return Ne("div",t,{state:{open:a,transitionStatus:f},ref:[c.context.backdropRef,n],stateAttributesMapping:Hi,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})}),Yi="none",yt="trigger-press",Oe="trigger-hover",Cr="outside-press",Ui="close-press",Nt="focus-out",Pr="escape-key",Or="imperative-action";function he(e,t,n,o){let r=!1,s=!1;const i=Te;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}const Pu=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{store:a}=gt(),l=a.useState("open");function u(g){l&&a.setOpen(!1,he(Ui,g.nativeEvent))}const{getButtonProps:f,buttonRef:b}=En({disabled:s,native:i});return Ne("button",t,{state:{disabled:s},ref:[n,b],props:[{onClick:u},c,f]})});let Ao=0;function Xi(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(Ao+=1,o(`${t}-${Ao}`))},[n,t]),r}const Mo=Ii.useId;function xt(e,t){if(Mo!==void 0){const n=Mo();return e??(t?`${t}-${n}`:n)}return Xi(e,t)}function Sn(e){return xt(e,"base-ui")}const qi=[];function wn(e){d.useEffect(e,qi)}const It=0;class $e{constructor(){se(this,"currentId",It);se(this,"clear",()=>{this.currentId!==It&&(clearTimeout(this.currentId),this.currentId=It)});se(this,"disposeEffect",()=>this.clear)}static create(){return new $e}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=It,n()},t)}isStarted(){return this.currentId!==It}}function Et(){const e=Ae($e.create).current;return wn(e.disposeEffect),e}const Tt=typeof navigator<"u",Ln=zi(),Ir=Ji(),kr=Zi(),Ar=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Mr=Ln.platform==="MacIntel"&&Ln.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ln.platform),Gi=Tt&&/apple/i.test(navigator.vendor),Zn=Tt&&/android/i.test(Ir)||/android/i.test(kr);Tt&&Ir.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ki=kr.includes("jsdom/");function zi(){if(!Tt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Zi(){if(!Tt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Ji(){if(!Tt)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Jn="data-base-ui-focusable",Fr="active",Lr="selected",Dr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ot(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function te(e,t){var o;if(!e||!t)return!1;const n=(o=t.getRootNode)==null?void 0:o.call(t);if(e.contains(t))return!0;if(n&&Ft(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Nr(e,t){if(!ae(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,o]of t.entries())if(te(o,n))return!o.hasAttribute("data-trigger-disabled");return!1}function Le(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Be(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Qi(e){return e.matches("html,body")}function uo(e){return ye(e)&&e.matches(Dr)}function Fo(e){return e?e.getAttribute("role")==="combobox"&&uo(e):!1}function Qn(e){return e?e.hasAttribute(Jn)?e:e.querySelector(`[${Jn}]`)||e:null}function Ze(e,t,n=!0){return e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Ze(e,r.id,n)])}function Lo(e,t){var r;let n=[],o=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function ec(e){e.preventDefault(),e.stopPropagation()}function tc(e){return"nativeEvent"in e}function nc(e){return e.pointerType===""&&e.isTrusted?!0:Zn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oc(e){return Ki?!1:!Zn&&e.width===0&&e.height===0||Zn&&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 Vt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Vr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const rc=["top","right","bottom","left"],Rt=Math.min,Ie=Math.max,sn=Math.round,Ut=Math.floor,Xe=e=>({x:e,y:e}),sc={left:"right",right:"left",bottom:"top",top:"bottom"};function eo(e,t,n){return Ie(e,Rt(t,n))}function et(e,t){return typeof e=="function"?e(t):e}function Pe(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function fo(e){return e==="x"?"y":"x"}function po(e){return e==="y"?"height":"width"}function De(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function go(e){return fo(De(e))}function ic(e,t,n){n===void 0&&(n=!1);const o=ct(e),r=go(e),s=po(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=cn(i)),[i,cn(i)]}function cc(e){const t=cn(e);return[to(e),t,to(t)]}function to(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Do=["left","right"],No=["right","left"],lc=["top","bottom"],ac=["bottom","top"];function uc(e,t,n){switch(e){case"top":case"bottom":return n?t?No:Do:t?Do:No;case"left":case"right":return t?lc:ac;default:return[]}}function fc(e,t,n,o){const r=ct(e);let s=uc(Pe(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(to)))),s}function cn(e){const t=Pe(e);return sc[t]+e.slice(t.length)}function dc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Br(e){return typeof e!="number"?dc(e):{top:e,right:e,bottom:e,left:e}}function ln(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function pc(e){return ke(e).display!=="none"}/*!
2
+ * tabbable 6.4.0
3
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
+ */var gc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],an=gc.join(","),$r=typeof Element>"u",St=$r?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,un=!$r&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},fn=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):fn(t.parentNode));return i},mc=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Wr=function(t,n,o){if(fn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(an));return n&&St.call(t,an)&&r.unshift(t),r=r.filter(o),r},dn=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!fn(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=dn(a,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=St.call(i,an);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),b=!fn(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&b){var h=dn(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return r},_r=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},jr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||mc(t))&&!_r(t)?0:t.tabIndex},hc=function(t,n){var o=jr(t);return o<0&&n&&!_r(t)?0:o},bc=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Hr=function(t){return t.tagName==="INPUT"},vc=function(t){return Hr(t)&&t.type==="hidden"},yc=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ec=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Rc=function(t){if(!t.name)return!0;var n=t.form||un(t),o=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Ec(r,t.form);return!s||s===t},Sc=function(t){return Hr(t)&&t.type==="radio"},wc=function(t){return Sc(t)&&!Rc(t)},xc=function(t){var n,o=t&&un(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,c,a;for(s=!!((i=r)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(r)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&r;){var l,u,f;o=un(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},Vo=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Tc=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=St.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(St.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var l=t.parentElement,u=un(t);if(l&&!l.shadowRoot&&r(l)===!0)return Vo(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(xc(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Vo(t);return!1},Cc=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return St.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},no=function(t,n){return!(n.disabled||vc(n)||Tc(n,t)||yc(n)||Cc(n))},oo=function(t,n){return!(wc(n)||jr(n)<0||!no(t,n))},Pc=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Yr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,c=i?r.scopeParent:r,a=hc(c,i),l=i?Yr(r.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):o.push({documentOrder:s,tabIndex:a,item:r,isScope:i,content:l})}),o.sort(bc).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Bt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=dn([t],n.includeContainer,{filter:oo.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Pc}):o=Wr(t,n.includeContainer,oo.bind(null,n)),Yr(o)},Oc=function(t,n){n=n||{};var o;return n.getShadowRoot?o=dn([t],n.includeContainer,{filter:no.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Wr(t,n.includeContainer,no.bind(null,n)),o},Ur=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return St.call(t,an)===!1?!1:oo(n,t)};function de(e){return(e==null?void 0:e.ownerDocument)||document}const Ct=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Xr(e,t){const n=Bt(e,Ct()),o=n.length;if(o===0)return;const r=ot(de(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function mo(e){return Xr(de(e).body,1)||e}function qr(e){return Xr(de(e).body,-1)||e}function Gr(e,t){if(!e)return null;const n=Bt(de(e).body,Ct()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Ic(e){return Gr(e,1)}function kc(e){return Gr(e,-1)}function bt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!te(n,o)}function Ac(e){Bt(e,Ct()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Mc(e,t){return t!=null&&!Vt(t)?0:typeof e=="function"?e():e}function tn(e,t,n){const o=Mc(e,n);return typeof o=="number"?o:o==null?void 0:o[t]}function $o(e){return typeof e=="function"?e():e}function Kr(e,t){return t||e==="click"||e==="mousedown"}function Ue(e){const t=Ae(Fc,e).current;return t.next=e,K(t.effect),t}function Fc(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Xt=null;class Lc{constructor(){se(this,"callbacks",[]);se(this,"callbacksCount",0);se(this,"nextId",1);se(this,"startId",1);se(this,"isScheduled",!1);se(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)(r=n[s])==null||r.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const qt=new Lc;class Ye{constructor(){se(this,"currentId",Xt);se(this,"cancel",()=>{this.currentId!==Xt&&(qt.cancel(this.currentId),this.currentId=Xt)});se(this,"disposeEffect",()=>this.cancel)}static create(){return new Ye}static request(t){return qt.request(t)}static cancel(t){return qt.cancel(t)}request(t){this.cancel(),this.currentId=qt.request(()=>{this.currentId=Xt,t()})}}function ho(){const e=Ae(Ye.create).current;return wn(e.disposeEffect),e}const Dc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Nc={...Dc,position:"fixed",top:0,left:0},wt=d.forwardRef(function(t,n){const[o,r]=d.useState();K(()=>{Gi&&r("button")},[]);const s={tabIndex:0,role:o};return Z.jsx("span",{...t,ref:n,style:Nc,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});function pn(e){return`data-base-ui-${e}`}let Wo=0;function Dn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Wo);const s=()=>e==null?void 0:e.focus({preventScroll:n});r?s():Wo=requestAnimationFrame(s)}const Nn={inert:new WeakMap,"aria-hidden":new WeakMap},_o="data-base-ui-inert",ro={inert:new WeakSet,"aria-hidden":new WeakSet};let kt=new WeakMap,Vn=0;function Vc(e){return ro[e]}function zr(e){return e?Ft(e)?e.host:zr(e.parentNode):null}const Bn=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=zr(n);return e.contains(o)?o:null}).filter(n=>n!=null),jo=e=>{const t=new Set;return e.forEach(n=>{let o=n;for(;o&&!t.has(o);)t.add(o),o=o.parentNode}),t},Ho=(e,t,n)=>{const o=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{st(i)!=="script"&&(t.has(i)?r(i):o.push(i))})};return r(e),o};function Bc(e,t,n,o,{mark:r=!0,markerIgnoreElements:s=[]}){const i=o?"inert":n?"aria-hidden":null;let c=null,a=null;const l=Bn(t,e),u=r?Bn(t,s):[],f=new Set(u),b=r?Ho(t,jo(l),new Set(l)).filter(p=>!f.has(p)):[],h=[],g=[];if(i){const p=Nn[i],m=Vc(i);a=m,c=p;const S=Bn(t,Array.from(t.querySelectorAll("[aria-live]"))),v=l.concat(S);Ho(t,jo(v),new Set(v)).forEach(E=>{const y=E.getAttribute(i),x=y!==null&&y!=="false",w=(p.get(E)||0)+1;p.set(E,w),h.push(E),w===1&&x&&m.add(E),x||E.setAttribute(i,i==="inert"?"":"true")})}return r&&b.forEach(p=>{const m=(kt.get(p)||0)+1;kt.set(p,m),g.push(p),m===1&&p.setAttribute(_o,"")}),Vn+=1,()=>{c&&h.forEach(p=>{const S=(c.get(p)||0)-1;c.set(p,S),S||(!(a!=null&&a.has(p))&&i&&p.removeAttribute(i),a==null||a.delete(p))}),r&&g.forEach(p=>{const m=(kt.get(p)||0)-1;kt.set(p,m),m||p.removeAttribute(_o)}),Vn-=1,Vn||(Nn.inert=new WeakMap,Nn["aria-hidden"]=new WeakMap,ro.inert=new WeakSet,ro["aria-hidden"]=new WeakSet,kt=new WeakMap)}}function Yo(e,t={}){const{ariaHidden:n=!1,inert:o=!1,mark:r=!0,markerIgnoreElements:s=[]}=t,i=de(e[0]).body;return Bc(e,i,n,o,{mark:r,markerIgnoreElements:s})}const Zr=d.createContext(null),Jr=()=>d.useContext(Zr),$c=pn("portal");function Wc(e={}){const{ref:t,container:n,componentProps:o=Te,elementProps:r}=e,s=xt(),i=Jr(),c=i==null?void 0:i.portalNode,[a,l]=d.useState(null),[u,f]=d.useState(null),b=G(m=>{m!==null&&f(m)}),h=d.useRef(null);K(()=>{if(n===null){h.current&&(h.current=null,f(null),l(null));return}if(s==null)return;const m=(n&&(co(n)?n:n.current))??c??document.body;if(m==null){h.current&&(h.current=null,f(null),l(null));return}h.current!==m&&(h.current=m,f(null),l(m))},[n,c,s]);const g=Ne("div",o,{ref:[t,b],props:[{id:s,[$c]:""},r]});return{portalNode:u,portalSubtree:a&&g?Je.createPortal(g,a):null}}const Qr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...a}=t,{portalNode:l,portalSubtree:u}=Wc({container:r,ref:n,componentProps:t,elementProps:a}),f=d.useRef(null),b=d.useRef(null),h=d.useRef(null),g=d.useRef(null),[p,m]=d.useState(null),S=p==null?void 0:p.modal,v=p==null?void 0:p.open,R=typeof c=="boolean"?c:!!p&&!p.modal&&p.open&&!!l;d.useEffect(()=>{if(!l||S)return;function y(x){l&&x.relatedTarget&&bt(x)&&(x.type==="focusin"?Bo:Ac)(l)}return l.addEventListener("focusin",y,!0),l.addEventListener("focusout",y,!0),()=>{l.removeEventListener("focusin",y,!0),l.removeEventListener("focusout",y,!0)}},[l,S]),d.useEffect(()=>{!l||v||Bo(l)},[v,l]);const E=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:b,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:m}),[l]);return Z.jsxs(d.Fragment,{children:[u,Z.jsxs(Zr.Provider,{value:E,children:[R&&l&&Z.jsx(wt,{"data-type":"outside",ref:f,onFocus:y=>{var x;if(bt(y,l))(x=h.current)==null||x.focus();else{const w=p?p.domReference:null,I=qr(w);I==null||I.focus()}}}),R&&l&&Z.jsx("span",{"aria-owns":l.id,style:bi}),l&&Je.createPortal(o,l),R&&l&&Z.jsx(wt,{"data-type":"outside",ref:b,onFocus:y=>{var x;if(bt(y,l))(x=g.current)==null||x.focus();else{const w=p?p.domReference:null,I=mo(w);I==null||I.focus(),p!=null&&p.closeOnFocusOut&&(p==null||p.onOpenChange(!1,he(Nt,y.nativeEvent)))}}})]})]})});function es(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}class _c{constructor(){se(this,"nodesRef",{current:[]});se(this,"events",es())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ts=d.createContext(null),ns=d.createContext(null),mt=()=>{var e;return((e=d.useContext(ts))==null?void 0:e.id)||null},Pt=e=>{const t=d.useContext(ns);return e??t};function jc(e){const t=xt(),n=Pt(e),o=mt();return K(()=>{if(!t)return;const r={id:t,parentId:o};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,o]),t}function Hc(e){const{children:t,id:n}=e,o=mt();return Z.jsx(ts.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Yc(e){const{children:t,externalTree:n}=e,o=Ae(()=>n??new _c).current;return Z.jsx(ns.Provider,{value:o,children:t})}function Ke(e){return e==null?e:"current"in e?e.current:e}function Uc(e,t){const n=Se(e.target);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"):""}const Uo=20;let rt=[];function bo(){rt=rt.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Xc(e){bo(),e&&st(e)!=="body"&&(rt.push(new WeakRef(e)),rt.length>Uo&&(rt=rt.slice(-Uo)))}function $n(){var e;return bo(),(e=rt[rt.length-1])==null?void 0:e.deref()}function qc(e){if(!e)return null;const t=Ct();return Ur(e,t)?e:Bt(e,t)[0]||e}function Gc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():pc(e)}function Xo(e,t){var i;if(!t.current.includes("floating")&&!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=Ct(),r=Oc(e,n).filter(c=>{const a=c.getAttribute("data-tabindex")||"";return Ur(c,n)||c.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function os(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:a=!0,openInteractionType:l="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:b,externalTree:h,getInsideElements:g}=e,p="rootStore"in t?t.rootStore:t,m=p.useState("open"),S=p.useState("domReferenceElement"),v=p.useState("floatingElement"),{events:R,dataRef:E}=p.context,y=G(()=>{var W;return(W=E.current.floatingContext)==null?void 0:W.nodeId}),x=r===!1,w=Fo(S)&&x,I=d.useRef(["content"]),F=Ue(r),V=Ue(s),D=Ue(l),A=Pt(h),T=Jr(),M=d.useRef(!1),C=d.useRef(!1),B=d.useRef(!1),L=d.useRef(-1),P=d.useRef(""),N=d.useRef(""),z=d.useRef(null),j=d.useRef(null),ne=rn(z,b,T==null?void 0:T.beforeInsideRef),ge=rn(j,T==null?void 0:T.afterInsideRef),oe=Et(),J=Et(),_=ho(),pe=T!=null,H=Qn(v),fe=G((W=H)=>W?Bt(W,Ct()):[]),ue=G(()=>(g==null?void 0:g().filter(W=>W!=null))??[]),Ee=G(W=>{const ee=fe(W);return I.current.map(()=>ee).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function W(q){q.key==="Tab"&&te(H,ot(de(H)))&&fe().length===0&&!w&&ec(q)}const ee=de(H);return ee.addEventListener("keydown",W),()=>{ee.removeEventListener("keydown",W)}},[o,S,H,c,I,w,fe,Ee]),d.useEffect(()=>{if(o||!m)return;const W=de(H);function ee(){B.current=!1}function q(Y){const U=Le(Y),be=ue(),$=te(v,U)||te(S,U)||te(T==null?void 0:T.portalNode,U)||be.some(O=>O===U||te(O,U));B.current=!$,N.current=Y.pointerType||"keyboard",U!=null&&U.closest(`[${io}]`)&&(C.current=!0)}function me(){N.current="keyboard"}return W.addEventListener("pointerdown",q,!0),W.addEventListener("pointerup",ee,!0),W.addEventListener("pointercancel",ee,!0),W.addEventListener("keydown",me,!0),()=>{W.removeEventListener("pointerdown",q,!0),W.removeEventListener("pointerup",ee,!0),W.removeEventListener("pointercancel",ee,!0),W.removeEventListener("keydown",me,!0)}},[o,v,S,H,m,T,ue]),d.useEffect(()=>{if(o||!a)return;const W=de(H);function ee(){C.current=!0,J.start(0,()=>{C.current=!1})}function q($){const O=Le($),Q=fe().indexOf(O);Q!==-1&&(L.current=Q)}function me($){const O=$.relatedTarget,k=$.currentTarget,Q=Le($);queueMicrotask(()=>{const re=y(),xe=p.context.triggerElements,_e=ue(),je=(O==null?void 0:O.hasAttribute(pn("focus-guard")))&&[z.current,j.current,T==null?void 0:T.beforeInsideRef.current,T==null?void 0:T.afterInsideRef.current,T==null?void 0:T.beforeOutsideRef.current,T==null?void 0:T.afterOutsideRef.current,Ke(f),Ke(u)].includes(O),at=!(te(S,O)||te(v,O)||te(O,v)||te(T==null?void 0:T.portalNode,O)||_e.some(ve=>ve===O||te(ve,O))||O!=null&&xe.hasElement(O)||xe.hasMatchingElement(ve=>te(ve,O))||je||A&&(Ze(A.nodesRef.current,re).find(ve=>{var we,ie;return te((we=ve.context)==null?void 0:we.elements.floating,O)||te((ie=ve.context)==null?void 0:ie.elements.domReference,O)})||Lo(A.nodesRef.current,re).find(ve=>{var we,ie,Me;return[(we=ve.context)==null?void 0:we.elements.floating,Qn((ie=ve.context)==null?void 0:ie.elements.floating)].includes(O)||((Me=ve.context)==null?void 0:Me.elements.domReference)===O})));if(k===S&&H&&Xo(H,I),i&&k!==S&&!Gc(Q)&&ot(W)===W.body){if(ye(H)&&(H.focus(),i==="popup")){_.request(()=>{H.focus()});return}const ve=L.current,we=fe(),ie=we[ve]||we[we.length-1]||H;ye(ie)&&ie.focus()}if(E.current.insideReactTree){E.current.insideReactTree=!1;return}(w||!c)&&O&&at&&!C.current&&(w||O!==$n())&&(M.current=!0,p.setOpen(!1,he(Nt,$)))})}function Y(){B.current||(E.current.insideReactTree=!0,oe.start(0,()=>{E.current.insideReactTree=!1}))}const U=ye(S)?S:null,be=[];if(!(!v&&!U))return U&&(U.addEventListener("focusout",me),U.addEventListener("pointerdown",ee),be.push(()=>{U.removeEventListener("focusout",me),U.removeEventListener("pointerdown",ee)})),v&&(v.addEventListener("focusin",q),v.addEventListener("focusout",me),T&&(v.addEventListener("focusout",Y,!0),be.push(()=>{v.removeEventListener("focusout",Y,!0)})),be.push(()=>{v.removeEventListener("focusin",q),v.removeEventListener("focusout",me)})),()=>{be.forEach($=>{$()})}},[o,S,v,H,c,A,T,p,a,i,fe,w,y,I,E,oe,J,_,u,f,ue]),d.useEffect(()=>{var O,k,Q;if(o||!v||!m)return;const W=Array.from(((O=T==null?void 0:T.portalNode)==null?void 0:O.querySelectorAll(`[${pn("portal")}]`))||[]),q=(Q=(k=(A?Lo(A.nodesRef.current,y()):[]).find(re=>{var xe;return Fo(((xe=re.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:k.context)==null?void 0:Q.elements.domReference,Y=[...[v,...W,z.current,j.current,T==null?void 0:T.beforeOutsideRef.current,T==null?void 0:T.afterOutsideRef.current,...ue()],q,Ke(f),Ke(u),w?S:null].filter(re=>re!=null),U=Yo(Y,{ariaHidden:c||w,mark:!1}),be=[v,...W].filter(re=>re!=null),$=Yo(be);return()=>{$(),U()}},[m,o,S,v,c,I,T,w,A,y,u,f,ue]),K(()=>{if(!m||o||!ye(H))return;const W=de(H),ee=ot(W);queueMicrotask(()=>{const q=Ee(H),me=F.current,Y=typeof me=="function"?me(D.current||""):me;if(Y===void 0||Y===!1)return;let U;Y===!0||Y===null?U=q[0]||H:U=Ke(Y),U=U||q[0]||H,!te(H,ee)&&Dn(U,{preventScroll:U===H})})},[o,m,H,x,Ee,F,D]),K(()=>{if(o||!H)return;const W=de(H),ee=ot(W);Xc(ee);function q(Y){if(Y.open||(P.current=Uc(Y.nativeEvent,N.current)),Y.reason===Oe&&Y.nativeEvent.type==="mouseleave"&&(M.current=!0),Y.reason===Cr)if(Y.nested)M.current=!1;else if(nc(Y.nativeEvent)||oc(Y.nativeEvent))M.current=!1;else{let U=!1;document.createElement("div").focus({get preventScroll(){return U=!0,!1}}),U?M.current=!1:M.current=!0}}R.on("openchange",q);function me(){const Y=V.current;let U=typeof Y=="function"?Y(P.current):Y;if(U===void 0||U===!1)return null;if(U===null&&(U=!0),typeof U=="boolean"){const $=S||$n();return $&&$.isConnected?$:null}const be=S||$n();return Ke(U)||be||null}return()=>{R.off("openchange",q);const Y=ot(W),U=ue(),be=te(v,Y)||U.some(O=>O===Y||te(O,Y))||A&&Ze(A.nodesRef.current,y(),!1).some(O=>{var k;return te((k=O.context)==null?void 0:k.elements.floating,Y)}),$=me();queueMicrotask(()=>{const O=qc($),k=typeof V.current!="boolean";V.current&&!M.current&&ye(O)&&(!(!k&&O!==Y&&Y!==W.body)||be)&&O.focus({preventScroll:!0}),M.current=!1})}},[o,v,H,V,E,R,A,S,y,ue]),K(()=>{if(!Ar||m||!v)return;const W=ot(de(v));!ye(W)||!uo(W)||te(v,W)&&W.blur()},[m,v]),K(()=>{if(!(o||!T))return T.setFocusManagerState({modal:c,closeOnFocusOut:a,open:m,onOpenChange:p.setOpen,domReference:S}),()=>{T.setFocusManagerState(null)}},[o,T,c,m,p,a,S]),K(()=>{if(!(o||!H))return Xo(H,I),()=>{queueMicrotask(bo)}},[o,H,I]);const lt=!o&&(c?!w:!0)&&(pe||c);return Z.jsxs(d.Fragment,{children:[lt&&Z.jsx(wt,{"data-type":"inside",ref:ne,onFocus:W=>{var ee;if(c){const q=Ee();Dn(q[q.length-1])}else if(T!=null&&T.portalNode)if(M.current=!1,bt(W,T.portalNode)){const q=mo(S);q==null||q.focus()}else(ee=Ke(f??T.beforeOutsideRef))==null||ee.focus()}}),n,lt&&Z.jsx(wt,{"data-type":"inside",ref:ge,onFocus:W=>{var ee;if(c)Dn(Ee()[0]);else if(T!=null&&T.portalNode)if(a&&(M.current=!0),bt(W,T.portalNode)){const q=qr(S);q==null||q.focus()}else(ee=Ke(u??T.afterOutsideRef))==null||ee.focus()}})]})}function rs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:u=yt}=t,f=d.useRef(void 0),b=ho(),h=Et(),g=d.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const m=f.current,S=p.nativeEvent,v=n.select("open");if(p.button!==0||s==="click"||Vt(m,!0)&&c)return;const R=o.current.openEvent,E=R==null?void 0:R.type,y=n.select("domReferenceElement")!==p.currentTarget,x=v&&y||!(v&&i&&(!(R&&a)||E==="click"||E==="mousedown"));if(uo(S.target)){const I=he(u,S,S.target);x&&m==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(x,I);return}const w=p.currentTarget;b.request(()=>{const I=he(u,S,w);x&&m==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(x,I)})},onClick(p){if(s==="mousedown-only")return;const m=f.current;if(s==="mousedown"&&m){f.current=void 0;return}if(Vt(m,!0)&&c)return;const S=n.select("open"),v=o.current.openEvent,R=n.select("domReferenceElement")!==p.currentTarget,E=S&&R||!(S&&i&&(!(v&&a)||Vr(v))),y=he(u,p.nativeEvent,p.currentTarget);E&&m==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,y)}):n.setOpen(E,y)},onKeyDown(){f.current=void 0}}),[o,s,c,n,a,i,b,h,l,u]);return d.useMemo(()=>r?{reference:g}:Te,[r,g])}const Kc={intentional:"onClick",sloppy:"onPointerDown"};function zc(){return!1}function Zc(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function ss(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:c=!0,outsidePress:a=!0,outsidePressEvent:l="sloppy",referencePress:u=zc,referencePressEvent:f="sloppy",bubbles:b,externalTree:h}=t,g=Pt(h),p=G(typeof a=="function"?a:()=>!1),m=typeof a=="function"?p:a,S=m!==!1,v=G(()=>l),R=d.useRef(!1),E=d.useRef(!1),y=d.useRef(!1),{escapeKey:x,outsidePress:w}=Zc(b),I=d.useRef(null),F=Et(),V=Et(),D=G(()=>{V.clear(),s.current.insideReactTree=!1}),A=d.useRef(!1),T=d.useRef(""),M=G(u),C=G(j=>{var _;if(!o||!i||!c||j.key!=="Escape"||A.current)return;const ne=(_=s.current.floatingContext)==null?void 0:_.nodeId,ge=g?Ze(g.nodesRef.current,ne):[];if(!x&&ge.length>0){let pe=!0;if(ge.forEach(H=>{var fe;(fe=H.context)!=null&&fe.open&&!H.context.dataRef.current.__escapeKeyBubbles&&(pe=!1)}),!pe)return}const oe=tc(j)?j.nativeEvent:j,J=he(Pr,oe);n.setOpen(!1,J),!x&&!J.isPropagationAllowed&&j.stopPropagation()}),B=G(()=>{s.current.insideReactTree=!0,V.start(0,D)});d.useEffect(()=>{if(!o||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=w;const j=new $e,ne=new $e;function ge(){j.clear(),A.current=!0}function oe(){j.start(vn()?5:0,()=>{A.current=!1})}function J(){y.current=!0,ne.start(0,()=>{y.current=!1})}function _(){R.current=!1,E.current=!1}function pe(){const O=T.current,k=O==="pen"||!O?"mouse":O,Q=v(),re=typeof Q=="function"?Q():Q;return typeof re=="string"?re:re[k]}function H(O){const k=pe();return k==="intentional"&&O.type!=="click"||k==="sloppy"&&O.type==="click"}function fe(O){var re;const k=(re=s.current.floatingContext)==null?void 0:re.nodeId,Q=g&&Ze(g.nodesRef.current,k).some(xe=>{var _e;return Be(O,(_e=xe.context)==null?void 0:_e.elements.floating)});return Be(O,n.select("floatingElement"))||Be(O,n.select("domReferenceElement"))||Q}function ue(O){var we;if(H(O)){D();return}if(s.current.insideReactTree){D();return}const k=Le(O),Q=`[${pn("inert")}]`;let re=Array.from(de(n.select("floatingElement")).querySelectorAll(Q));const xe=ae(k)?k.getRootNode():null;Ft(xe)&&(re=re.concat(Array.from(xe.querySelectorAll(Q))));const _e=n.context.triggerElements;if(k&&(_e.hasElement(k)||_e.hasMatchingElement(ie=>te(ie,k))))return;let je=ae(k)?k:null;for(;je&&!ze(je);){const ie=Qe(je);if(ze(ie)||!ae(ie))break;je=ie}if(re.length&&ae(k)&&!Qi(k)&&!te(k,n.select("floatingElement"))&&re.every(ie=>!te(je,ie)))return;if(ye(k)&&!("touches"in O)){const ie=ze(k),Me=ke(k),tt=/auto|scroll/,Wt=ie||tt.test(Me.overflowX),_t=ie||tt.test(Me.overflowY),jt=Wt&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ht=_t&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,Yt=Me.direction==="rtl",ce=Ht&&(Yt?O.offsetX<=k.offsetWidth-k.clientWidth:O.offsetX>k.clientWidth),Re=jt&&O.offsetY>k.clientHeight;if(ce||Re)return}if(fe(O))return;if(pe()==="intentional"&&y.current){ne.clear(),y.current=!1;return}if(typeof m=="function"&&!m(O))return;const at=(we=s.current.floatingContext)==null?void 0:we.nodeId,ve=g?Ze(g.nodesRef.current,at):[];if(ve.length>0){let ie=!0;if(ve.forEach(Me=>{var tt;(tt=Me.context)!=null&&tt.open&&!Me.context.dataRef.current.__outsidePressBubbles&&(ie=!1)}),!ie)return}n.setOpen(!1,he(Cr,O)),D()}function Ee(O){pe()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!i||Be(O,n.select("floatingElement"))||Be(O,n.select("domReferenceElement"))||ue(O)}function lt(O){if(pe()!=="sloppy"||!n.select("open")||!i||Be(O,n.select("floatingElement"))||Be(O,n.select("domReferenceElement")))return;const k=O.touches[0];k&&(I.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},F.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function W(O){T.current="touch";const k=Le(O);function Q(){lt(O),k==null||k.removeEventListener(O.type,Q)}k==null||k.addEventListener(O.type,Q)}function ee(O){if(F.clear(),O.type==="pointerdown"&&(T.current=O.pointerType),O.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const k=Le(O);function Q(){O.type==="pointerdown"?Ee(O):ue(O),k==null||k.removeEventListener(O.type,Q)}k==null||k.addEventListener(O.type,Q)}function q(O){if(!R.current)return;const k=E.current;if(_(),pe()==="intentional"){if(O.type==="pointercancel"){k&&J();return}if(!fe(O)){if(k){J();return}typeof m=="function"&&!m(O)||(ne.clear(),y.current=!0,D())}}}function me(O){if(pe()!=="sloppy"||!I.current||Be(O,n.select("floatingElement"))||Be(O,n.select("domReferenceElement")))return;const k=O.touches[0];if(!k)return;const Q=Math.abs(k.clientX-I.current.startX),re=Math.abs(k.clientY-I.current.startY),xe=Math.sqrt(Q*Q+re*re);xe>5&&(I.current.dismissOnTouchEnd=!0),xe>10&&(ue(O),F.clear(),I.current=null)}function Y(O){const k=Le(O);function Q(){me(O),k==null||k.removeEventListener(O.type,Q)}k==null||k.addEventListener(O.type,Q)}function U(O){pe()!=="sloppy"||!I.current||Be(O,n.select("floatingElement"))||Be(O,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&ue(O),F.clear(),I.current=null)}function be(O){const k=Le(O);function Q(){U(O),k==null||k.removeEventListener(O.type,Q)}k==null||k.addEventListener(O.type,Q)}const $=de(r);return c&&($.addEventListener("keydown",C),$.addEventListener("compositionstart",ge),$.addEventListener("compositionend",oe)),S&&($.addEventListener("click",ee,!0),$.addEventListener("pointerdown",ee,!0),$.addEventListener("pointerup",q,!0),$.addEventListener("pointercancel",q,!0),$.addEventListener("mousedown",ee,!0),$.addEventListener("mouseup",q,!0),$.addEventListener("touchstart",W,!0),$.addEventListener("touchmove",Y,!0),$.addEventListener("touchend",be,!0)),()=>{c&&($.removeEventListener("keydown",C),$.removeEventListener("compositionstart",ge),$.removeEventListener("compositionend",oe)),S&&($.removeEventListener("click",ee,!0),$.removeEventListener("pointerdown",ee,!0),$.removeEventListener("pointerup",q,!0),$.removeEventListener("pointercancel",q,!0),$.removeEventListener("mousedown",ee,!0),$.removeEventListener("mouseup",q,!0),$.removeEventListener("touchstart",W,!0),$.removeEventListener("touchmove",Y,!0),$.removeEventListener("touchend",be,!0)),j.clear(),ne.clear(),_(),y.current=!1}},[s,r,c,S,m,o,i,x,w,C,D,v,g,n,F]),d.useEffect(D,[m,D]);const L=d.useMemo(()=>({onKeyDown:C,[Kc[f]]:j=>{M()&&n.setOpen(!1,he(yt,j.nativeEvent))},...f!=="intentional"&&{onClick(j){M()&&n.setOpen(!1,he(yt,j.nativeEvent))}}}),[C,n,f,M]),P=G(j=>{if(!o||!i||j.button!==0)return;const ne=Le(j.nativeEvent);te(n.select("floatingElement"),ne)&&(R.current||(R.current=!0,E.current=!1))}),N=G(j=>{!o||!i||(j.defaultPrevented||j.nativeEvent.defaultPrevented)&&R.current&&(E.current=!0)}),z=d.useMemo(()=>({onKeyDown:C,onPointerDown:N,onMouseDown:N,onClickCapture:B,onMouseDownCapture(j){B(),P(j)},onPointerDownCapture(j){B(),P(j)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[C,B,P,N]);return d.useMemo(()=>i?{reference:L,floating:z,trigger:L}:{},[i,L,z])}function qo(e,t,n){let{reference:o,floating:r}=e;const s=De(t),i=go(t),c=po(i),a=Pe(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,b=o[c]/2-r[c]/2;let h;switch(a){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(ct(t)){case"start":h[i]-=b*(n&&l?-1:1);break;case"end":h[i]+=b*(n&&l?-1:1);break}return h}async function Jc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:b=!1,padding:h=0}=et(t,e),g=Br(h),m=c[b?f==="floating"?"reference":"floating":f],S=ln(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),v=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},y=ln(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:R,strategy:a}):v);return{top:(S.top-y.top+g.top)/E.y,bottom:(y.bottom-S.bottom+g.bottom)/E.y,left:(S.left-y.left+g.left)/E.x,right:(y.right-S.right+g.right)/E.x}}const Qc=50,el=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Jc},a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=qo(l,o,a),b=o,h=0;const g={};for(let p=0;p<s.length;p++){const m=s[p];if(!m)continue;const{name:S,fn:v}=m,{x:R,y:E,data:y,reset:x}=await v({x:u,y:f,initialPlacement:o,placement:b,strategy:r,middlewareData:g,rects:l,platform:c,elements:{reference:e,floating:t}});u=R??u,f=E??f,g[S]={...g[S],...y},x&&h<Qc&&(h++,typeof x=="object"&&(x.placement&&(b=x.placement),x.rects&&(l=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):x.rects),{x:u,y:f}=qo(l,b,a)),p=-1)}return{x:u,y:f,placement:b,strategy:r,middlewareData:g}},tl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:b,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=et(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=Pe(r),v=De(c),R=Pe(c)===c,E=await(a.isRTL==null?void 0:a.isRTL(l.floating)),y=b||(R||!p?[cn(c)]:cc(c)),x=g!=="none";!b&&x&&y.push(...fc(c,p,g,E));const w=[c,...y],I=await a.detectOverflow(t,m),F=[];let V=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&F.push(I[S]),f){const M=ic(r,i,E);F.push(I[M[0]],I[M[1]])}if(V=[...V,{placement:r,overflows:F}],!F.every(M=>M<=0)){var D,A;const M=(((D=s.flip)==null?void 0:D.index)||0)+1,C=w[M];if(C&&(!(f==="alignment"?v!==De(C):!1)||V.every(P=>De(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:M,overflows:V},reset:{placement:C}};let B=(A=V.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(h){case"bestFit":{var T;const L=(T=V.filter(P=>{if(x){const N=De(P.placement);return N===v||N==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(N=>N>0).reduce((N,z)=>N+z,0)]).sort((P,N)=>P[1]-N[1])[0])==null?void 0:T[0];L&&(B=L);break}case"initialPlacement":B=c;break}if(r!==B)return{reset:{placement:B}}}return{}}}};function Go(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ko(e){return rc.some(t=>e[t]>=0)}const nl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=et(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=Go(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ko(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=Go(i,n.floating);return{data:{escapedOffsets:c,escaped:Ko(c)}}}default:return{}}}}},is=new Set(["left","top"]);async function ol(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Pe(n),c=ct(n),a=De(n)==="y",l=is.has(i)?-1:1,u=s&&a?-1:1,f=et(t,e);let{mainAxis:b,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*u,y:b*l}:{x:b*l,y:h*u}}const rl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await ol(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},sl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:S=>{let{x:v,y:R}=S;return{x:v,y:R}}},...l}=et(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),b=De(Pe(r)),h=fo(b);let g=u[h],p=u[b];if(i){const S=h==="y"?"top":"left",v=h==="y"?"bottom":"right",R=g+f[S],E=g-f[v];g=eo(R,g,E)}if(c){const S=b==="y"?"top":"left",v=b==="y"?"bottom":"right",R=p+f[S],E=p-f[v];p=eo(R,p,E)}const m=a.fn({...t,[h]:g,[b]:p});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:i,[b]:c}}}}}},il=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=et(e,t),u={x:n,y:o},f=De(r),b=fo(f);let h=u[b],g=u[f];const p=et(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(a){const R=b==="y"?"height":"width",E=s.reference[b]-s.floating[R]+m.mainAxis,y=s.reference[b]+s.reference[R]-m.mainAxis;h<E?h=E:h>y&&(h=y)}if(l){var S,v;const R=b==="y"?"width":"height",E=is.has(Pe(r)),y=s.reference[f]-s.floating[R]+(E&&((S=i.offset)==null?void 0:S[f])||0)+(E?0:m.crossAxis),x=s.reference[f]+s.reference[R]+(E?0:((v=i.offset)==null?void 0:v[f])||0)-(E?m.crossAxis:0);g<y?g=y:g>x&&(g=x)}return{[b]:h,[f]:g}}}},cl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=et(e,t),u=await i.detectOverflow(t,l),f=Pe(r),b=ct(r),h=De(r)==="y",{width:g,height:p}=s.floating;let m,S;f==="top"||f==="bottom"?(m=f,S=b===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(S=f,m=b==="end"?"top":"bottom");const v=p-u.top-u.bottom,R=g-u.left-u.right,E=Rt(p-u[m],v),y=Rt(g-u[S],R),x=!t.middlewareData.shift;let w=E,I=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(w=v),x&&!b){const V=Ie(u.left,0),D=Ie(u.right,0),A=Ie(u.top,0),T=Ie(u.bottom,0);h?I=g-2*(V!==0||D!==0?V+D:Ie(u.left,u.right)):w=p-2*(A!==0||T!==0?A+T:Ie(u.top,u.bottom))}await a({...t,availableWidth:I,availableHeight:w});const F=await i.getDimensions(c.floating);return g!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function cs(e){const t=ke(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ye(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=sn(n)!==s||sn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function vo(e){return ae(e)?e:e.contextElement}function vt(e){const t=vo(e);if(!ye(t))return Xe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=cs(t);let i=(s?sn(n.width):n.width)/o,c=(s?sn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ll=Xe(0);function ls(e){const t=Se(e);return!vn()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function al(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Se(e)?!1:t}function pt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=vo(e);let i=Xe(1);t&&(o?ae(o)&&(i=vt(o)):i=vt(e));const c=al(s,n,o)?ls(s):Xe(0);let a=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const b=Se(s),h=o&&ae(o)?Se(o):o;let g=b,p=Kn(g);for(;p&&o&&h!==g;){const m=vt(p),S=p.getBoundingClientRect(),v=ke(p),R=S.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,E=S.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;a*=m.x,l*=m.y,u*=m.x,f*=m.y,a+=R,l+=E,g=Se(p),p=Kn(g)}}return ln({width:u,height:f,x:a,y:l})}function xn(e,t){const n=yn(e).scrollLeft;return t?t.left+n:pt(qe(e)).left+n}function as(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-xn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ul(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=qe(o),c=t?bn(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=Xe(1);const u=Xe(0),f=ye(o);if((f||!f&&!s)&&((st(o)!=="body"||it(i))&&(a=yn(o)),f)){const h=pt(o);l=vt(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const b=i&&!f&&!s?as(i,a):Xe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+b.x,y:n.y*l.y-a.scrollTop*l.y+u.y+b.y}}function fl(e){return Array.from(e.getClientRects())}function dl(e){const t=qe(e),n=yn(e),o=e.ownerDocument.body,r=Ie(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Ie(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+xn(e);const c=-n.scrollTop;return ke(o).direction==="rtl"&&(i+=Ie(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const zo=25;function pl(e,t){const n=Se(e),o=qe(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const u=vn();(!u||u&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const l=xn(o);if(l<=0){const u=o.ownerDocument,f=u.body,b=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-h);g<=zo&&(s-=g)}else l<=zo&&(s+=l);return{width:s,height:i,x:c,y:a}}function gl(e,t){const n=pt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ye(e)?vt(e):Xe(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,l=o*s.y;return{width:i,height:c,x:a,y:l}}function Zo(e,t,n){let o;if(t==="viewport")o=pl(e,n);else if(t==="document")o=dl(qe(e));else if(ae(t))o=gl(t,n);else{const r=ls(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ln(o)}function us(e,t){const n=Qe(e);return n===t||!ae(n)||ze(n)?!1:ke(n).position==="fixed"||us(n,t)}function ml(e,t){const n=t.get(e);if(n)return n;let o=Lt(e,[],!1).filter(c=>ae(c)&&st(c)!=="body"),r=null;const s=ke(e).position==="fixed";let i=s?Qe(e):e;for(;ae(i)&&!ze(i);){const c=ke(i),a=lo(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||it(i)&&!a&&us(e,i))?o=o.filter(u=>u!==i):r=c,i=Qe(i)}return t.set(e,o),o}function hl(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?bn(t)?[]:ml(t,this._c):[].concat(n),o],c=Zo(t,i[0],r);let a=c.top,l=c.right,u=c.bottom,f=c.left;for(let b=1;b<i.length;b++){const h=Zo(t,i[b],r);a=Ie(h.top,a),l=Rt(h.right,l),u=Rt(h.bottom,u),f=Ie(h.left,f)}return{width:l-f,height:u-a,x:f,y:a}}function bl(e){const{width:t,height:n}=cs(e);return{width:t,height:n}}function vl(e,t,n){const o=ye(t),r=qe(t),s=n==="fixed",i=pt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Xe(0);function l(){a.x=xn(r)}if(o||!o&&!s)if((st(t)!=="body"||it(r))&&(c=yn(t)),o){const h=pt(t,!0,s,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?as(r,c):Xe(0),f=i.left+c.scrollLeft-a.x-u.x,b=i.top+c.scrollTop-a.y-u.y;return{x:f,y:b,width:i.width,height:i.height}}function Wn(e){return ke(e).position==="static"}function Jo(e,t){if(!ye(e)||ke(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qe(e)===n&&(n=n.ownerDocument.body),n}function fs(e,t){const n=Se(e);if(bn(e))return n;if(!ye(e)){let r=Qe(e);for(;r&&!ze(r);){if(ae(r)&&!Wn(r))return r;r=Qe(r)}return n}let o=Jo(e,t);for(;o&&Si(o)&&Wn(o);)o=Jo(o,t);return o&&ze(o)&&Wn(o)&&!lo(o)?n:o||Ti(e)||n}const yl=async function(e){const t=this.getOffsetParent||fs,n=this.getDimensions,o=await n(e.floating);return{reference:vl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function El(e){return ke(e).direction==="rtl"}const Rl={convertOffsetParentRelativeRectToViewportRelativeRect:ul,getDocumentElement:qe,getClippingRect:hl,getOffsetParent:fs,getElementRects:yl,getClientRects:fl,getDimensions:bl,getScale:vt,isElement:ae,isRTL:El};function ds(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sl(e,t){let n=null,o;const r=qe(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:b,height:h}=l;if(c||t(),!b||!h)return;const g=Ut(f),p=Ut(r.clientWidth-(u+b)),m=Ut(r.clientHeight-(f+h)),S=Ut(u),R={rootMargin:-g+"px "+-p+"px "+-m+"px "+-S+"px",threshold:Ie(0,Rt(1,a))||1};let E=!0;function y(x){const w=x[0].intersectionRatio;if(w!==a){if(!E)return i();w?i(!1,w):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!ds(l,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(y,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(y,R)}n.observe(e)}return i(!0),s}function Qo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=vo(e),u=r||s?[...l?Lt(l):[],...t?Lt(t):[]]:[];u.forEach(S=>{r&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const f=l&&c?Sl(l,n):null;let b=-1,h=null;i&&(h=new ResizeObserver(S=>{let[v]=S;v&&v.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=h)==null||R.observe(t)})),n()}),l&&!a&&h.observe(l),t&&h.observe(t));let g,p=a?pt(e):null;a&&m();function m(){const S=pt(e);p&&!ds(p,S)&&n(),p=S,g=requestAnimationFrame(m)}return n(),()=>{var S;u.forEach(v=>{r&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f==null||f(),(S=h)==null||S.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const wl=rl,xl=sl,Tl=tl,Cl=cl,Pl=nl,Ol=il,Il=(e,t,n)=>{const o=new Map,r={platform:Rl,...n},s={...r.platform,_c:o};return el(e,t,{...r,platform:s})};var kl=typeof document<"u",Al=function(){},nn=kl?d.useLayoutEffect:Al;function gn(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!gn(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!gn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ps(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function er(e,t){const n=ps(e);return Math.round(t*n)/n}function _n(e){const t=d.useRef(e);return nn(()=>{t.current=e}),t}function Ml(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,h]=d.useState(o);gn(b,o)||h(o);const[g,p]=d.useState(null),[m,S]=d.useState(null),v=d.useCallback(P=>{P!==x.current&&(x.current=P,p(P))},[]),R=d.useCallback(P=>{P!==w.current&&(w.current=P,S(P))},[]),E=s||g,y=i||m,x=d.useRef(null),w=d.useRef(null),I=d.useRef(u),F=a!=null,V=_n(a),D=_n(r),A=_n(l),T=d.useCallback(()=>{if(!x.current||!w.current)return;const P={placement:t,strategy:n,middleware:b};D.current&&(P.platform=D.current),Il(x.current,w.current,P).then(N=>{const z={...N,isPositioned:A.current!==!1};M.current&&!gn(I.current,z)&&(I.current=z,Je.flushSync(()=>{f(z)}))})},[b,t,n,D,A]);nn(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const M=d.useRef(!1);nn(()=>(M.current=!0,()=>{M.current=!1}),[]),nn(()=>{if(E&&(x.current=E),y&&(w.current=y),E&&y){if(V.current)return V.current(E,y,T);T()}},[E,y,T,V,F]);const C=d.useMemo(()=>({reference:x,floating:w,setReference:v,setFloating:R}),[v,R]),B=d.useMemo(()=>({reference:E,floating:y}),[E,y]),L=d.useMemo(()=>{const P={position:n,left:0,top:0};if(!B.floating)return P;const N=er(B.floating,u.x),z=er(B.floating,u.y);return c?{...P,transform:"translate("+N+"px, "+z+"px)",...ps(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:z}},[n,c,B.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:T,refs:C,elements:B,floatingStyles:L}),[u,T,C,B,L])}const Fl=(e,t)=>{const n=wl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ll=(e,t)=>{const n=xl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dl=(e,t)=>({fn:Ol(e).fn,options:[e,t]}),Nl=(e,t)=>{const n=Tl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vl=(e,t)=>{const n=Cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bl=(e,t)=>{const n=Pl(e);return{name:n.name,fn:n.fn,options:[e,t]}};var mn=Symbol("NOT_FOUND");function $l(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wl(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _l(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var tr=e=>Array.isArray(e)?e:[e];function jl(e){const t=Array.isArray(e[0])?e[0]:e;return _l(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Hl(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Yl(e){let t;return{get(n){return t&&e(t.key,n)?t.value:mn},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ul(e,t){let n=[];function o(c){const a=n.findIndex(l=>t(c,l.key));if(a>-1){const l=n[a];return a>0&&(n.splice(a,1),n.unshift(l)),l.value}return mn}function r(c,a){o(c)===mn&&(n.unshift({key:c,value:a}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Xl=(e,t)=>e===t;function ql(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Gl(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Xl,maxSize:r=1,resultEqualityCheck:s}=n,i=ql(o);let c=0;const a=r<=1?Yl(i):Ul(r,i);function l(){let u=a.get(arguments);if(u===mn){if(u=e.apply(null,arguments),c++,s){const b=a.getEntries().find(h=>s(h.value,u));b&&(u=b.value,c!==0&&c--)}a.put(arguments,u)}return u}return l.clearCache=()=>{a.clear(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}var Kl=class{constructor(e){this.value=e}deref(){return this.value}},zl=typeof WeakRef<"u"?WeakRef:Kl,Zl=0,nr=1;function Gt(){return{s:Zl,v:void 0,o:null,p:null}}function gs(e,t={}){let n=Gt();const{resultEqualityCheck:o}=t;let r,s=0;function i(){var f;let c=n;const{length:a}=arguments;for(let b=0,h=a;b<h;b++){const g=arguments[b];if(typeof g=="function"||typeof g=="object"&&g!==null){let p=c.o;p===null&&(c.o=p=new WeakMap);const m=p.get(g);m===void 0?(c=Gt(),p.set(g,c)):c=m}else{let p=c.p;p===null&&(c.p=p=new Map);const m=p.get(g);m===void 0?(c=Gt(),p.set(g,c)):c=m}}const l=c;let u;if(c.s===nr)u=c.v;else if(u=e.apply(null,arguments),s++,o){const b=((f=r==null?void 0:r.deref)==null?void 0:f.call(r))??r;b!=null&&o(b,u)&&(u=b,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new zl(u):u}return l.s=nr,l.v=u,u}return i.clearCache=()=>{n=Gt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function ms(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,c,a={},l=r.pop();typeof l=="object"&&(a=l,l=r.pop()),$l(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...a},{memoize:f,memoizeOptions:b=[],argsMemoize:h=gs,argsMemoizeOptions:g=[]}=u,p=tr(b),m=tr(g),S=jl(r),v=f(function(){return s++,l.apply(null,arguments)},...p),R=h(function(){i++;const y=Hl(S,arguments);return c=v.apply(null,y),c},...m);return Object.assign(R,{resultFunc:l,memoizedResultFunc:v,dependencies:S,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:h})};return Object.assign(o,{withTypes:()=>o}),o}var Jl=ms(gs),Ql=Object.assign((e,t=Jl)=>{Wl(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,c,a)=>(i[n[a]]=c,i),{}))},{withTypes:()=>Ql});ms({memoize:Gl,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const X=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(We(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var jn={exports:{}},Hn={};/**
5
+ * @license React
6
+ * use-sync-external-store-shim.production.js
7
+ *
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */var or;function ea(){if(or)return Hn;or=1;var e=br();function t(f,b){return f===b&&(f!==0||1/f===1/b)||f!==f&&b!==b}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(f,b){var h=b(),g=o({inst:{value:h,getSnapshot:b}}),p=g[0].inst,m=g[1];return s(function(){p.value=h,p.getSnapshot=b,a(p)&&m({inst:p})},[f,h,b]),r(function(){return a(p)&&m({inst:p}),f(function(){a(p)&&m({inst:p})})},[f]),i(h),h}function a(f){var b=f.getSnapshot;f=f.value;try{var h=b();return!n(f,h)}catch{return!0}}function l(f,b){return b()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Hn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Hn}var rr;function hs(){return rr||(rr=1,jn.exports=ea()),jn.exports}var ta=hs(),Yn={exports:{}},Un={};/**
13
+ * @license React
14
+ * use-sync-external-store-shim/with-selector.production.js
15
+ *
16
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
17
+ *
18
+ * This source code is licensed under the MIT license found in the
19
+ * LICENSE file in the root directory of this source tree.
20
+ */var sr;function na(){if(sr)return Un;sr=1;var e=br(),t=hs();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Un.useSyncExternalStoreWithSelector=function(l,u,f,b,h){var g=s(null);if(g.current===null){var p={hasValue:!1,value:null};g.current=p}else p=g.current;g=c(function(){function S(x){if(!v){if(v=!0,R=x,x=b(x),h!==void 0&&p.hasValue){var w=p.value;if(h(w,x))return E=w}return E=x}if(w=E,o(R,x))return w;var I=b(x);return h!==void 0&&h(w,I)?(R=x,w):(R=x,E=I)}var v=!1,R,E,y=f===void 0?null:f;return[function(){return S(u())},y===null?void 0:function(){return S(y())}]},[u,f,b,h]);var m=r(l,g[0],g[1]);return i(function(){p.hasValue=!0,p.value=m},[m]),a(m),m},Un}var ir;function oa(){return ir||(ir=1,Yn.exports=na()),Yn.exports}var ra=oa();const sa=so(19),ia=sa?la:aa;function bs(e,t,n,o,r){return ia(e,t,n,o,r)}function ca(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return ta.useSyncExternalStore(e.subscribe,s,s)}function la(e,t,n,o,r){return ca(e,t,n,o,r)}function aa(e,t,n,o,r){return ra.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class ua{constructor(t){se(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));se(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return bs(this,t,n,o,r)}}class yo extends ua{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){d.useDebugValue(t),K(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;K(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);K(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){d.useDebugValue(t);const o=n!==void 0;K(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o])}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return d.useDebugValue(t),bs(this,this.selectors[t],n,o,r)}useContextCallback(t,n){d.useDebugValue(t);const o=G(n??Ce);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}const fa={open:X(e=>e.open),domReferenceElement:X(e=>e.domReferenceElement),referenceElement:X(e=>e.positionReference??e.referenceElement),floatingElement:X(e=>e.floatingElement),floatingId:X(e=>e.floatingId)};class Eo extends yo{constructor(n){const{nested:o,noEmit:r,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:es(),nested:o,noEmit:r,triggerElements:i},fa);se(this,"setOpen",(n,o)=>{var r,s;if((!n||!this.state.open||Vr(o.event))&&(this.context.dataRef.current.openEvent=n?o.event:void 0),!this.context.noEmit){const i={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",i)}(s=(r=this.context).onOpenChange)==null||s.call(r,n,o)})}}function da(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),K(()=>{if(!e&&s&&o!=="ending"&&n){const c=Ye.request(()=>{r("ending")});return()=>{Ye.cancel(c)}}},[e,s,o,n]),K(()=>{if(!e||t)return;const c=Ye.request(()=>{r(void 0)});return()=>{Ye.cancel(c)}},[t,e]),K(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=Ye.request(()=>{r("idle")});return()=>{Ye.cancel(c)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}function vs(e,t=!1,n=!0){const o=ho();return G((r,s=null)=>{o.cancel();function i(){Je.flushSync(r)}const c=Ke(e);if(c==null)return;const a=c;if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Dt.startingStyle;if(!a.hasAttribute(f)){o.request(u);return}const b=new MutationObserver(()=>{a.hasAttribute(f)||(b.disconnect(),u())});b.observe(a,{attributes:!0,attributeFilter:[f]}),s==null||s.addEventListener("abort",()=>b.disconnect(),{once:!0})},u=function(){Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{s!=null&&s.aborted||i()}).catch(()=>{const f=a.getAnimations();if(n){if(s!=null&&s.aborted)return;i()}else f.length>0&&f.some(b=>b.pending||b.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Ro(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=G(r),i=vs(o,n,!1);d.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}function pa(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,c=t.context.triggerElements.getById(s);i&&c===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function ys(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=pa(e,n),i=G(c=>{if(s(c),!c||!n.select("open"))return;const a=n.select("activeTriggerId");if(a===e){n.update({activeTriggerElement:c,...o});return}a==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...o})});return K(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Es(e){const t=e.useState("open");K(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Rs(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=da(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=G(()=>{var a,l;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(l=(a=t.context).onOpenChangeComplete)==null||l.call(a,!1)}),c=t.useState("preventUnmountingOnClose");return Ro({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class Tn{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function ga(){return new Eo({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Tn,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ss(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:ga(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Te,inactiveTriggerProps:Te,popupProps:Te}}const Kt=X(e=>e.triggerIdProp??e.activeTriggerId),ws={open:X(e=>e.openProp??e.open),mounted:X(e=>e.mounted),transitionStatus:X(e=>e.transitionStatus),floatingRootContext:X(e=>e.floatingRootContext),preventUnmountingOnClose:X(e=>e.preventUnmountingOnClose),payload:X(e=>e.payload),activeTriggerId:Kt,activeTriggerElement:X(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:X((e,t)=>t!==void 0&&Kt(e)===t),isOpenedByTrigger:X((e,t)=>t!==void 0&&Kt(e)===t&&e.open),isMountedByTrigger:X((e,t)=>t!==void 0&&Kt(e)===t&&e.mounted),triggerProps:X((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:X(e=>e.popupProps),popupElement:X(e=>e.popupElement),positionerElement:X(e=>e.positionerElement)};function ma(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=xt(),s=mt()!=null,i=Ae(()=>new Eo({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new Tn,floatingId:r,nested:s,noEmit:!1})).current;return K(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=ae(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function ha(e={}){const{nodeId:t,externalTree:n}=e,o=ma(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=d.useState(null),a=d.useRef(null),l=Pt(n);K(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const u=Ml({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(w=>{const I=ae(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(I),u.refs.setReference(I)},[u.refs]),[b,h]=d.useState(null),[g,p]=d.useState(null);r.useSyncedValue("referenceElement",b),r.useSyncedValue("domReferenceElement",ae(b)?b:null),r.useSyncedValue("floatingElement",g);const m=d.useCallback(w=>{(ae(w)||w===null)&&(a.current=w,h(w)),(ae(u.refs.reference.current)||u.refs.reference.current===null||w!==null&&!ae(w))&&u.refs.setReference(w)},[u.refs,h]),S=d.useCallback(w=>{p(w),u.refs.setFloating(w)},[u.refs]),v=d.useMemo(()=>({...u.refs,setReference:m,setFloating:S,setPositionReference:f,domReference:a}),[u.refs,m,S,f]),R=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),E=r.useState("open"),y=r.useState("floatingId"),x=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:E,onOpenChange:r.setOpen,events:r.context.events,floatingId:y,refs:v,elements:R,nodeId:t,rootStore:r}),[u,v,R,t,r,E,y]);return K(()=>{r.context.dataRef.current.floatingContext=x;const w=l==null?void 0:l.nodesRef.current.find(I=>I.id===t);w&&(w.context=x)}),d.useMemo(()=>({...u,context:x,refs:v,elements:R,rootStore:r}),[u,v,R,x,r])}function xs(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=xt(),i=mt()!=null,c=t.useState("open"),a=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=Ae(()=>new Eo({open:c,referenceElement:a,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return K(()=>{const b={open:c,floatingId:s,referenceElement:a,floatingElement:l};ae(a)&&(b.domReferenceElement=a),f.state.positionReference===f.state.referenceElement&&(b.positionReference=a),f.update(b)},[c,s,a,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const ba=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Dr}`;function va(e){return e?!!e.closest(ba):!1}class So{constructor(){se(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});se(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new $e,this.restTimeout=new $e,this.handleCloseOptions=void 0}static create(){return new So}}function wo(e){var t,n,o;e.performedPointerEventsMutation&&((t=e.pointerEventsScopeElement)==null||t.style.removeProperty("pointer-events"),(n=e.pointerEventsReferenceElement)==null||n.style.removeProperty("pointer-events"),(o=e.pointerEventsFloatingElement)==null||o.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function ya(e,t){const{scopeElement:n,referenceElement:o,floatingElement:r}=t;wo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=r,n.style.pointerEvents="none",o.style.pointerEvents="auto",r.style.pointerEvents="auto"}function Ts(e){const t=Ae(So.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),wn(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Ea(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:c=!0,closeDelay:a=0}=t,l=Ts(n),u=Pt(),f=mt(),b=G(()=>{var R;return Kr((R=i.current.openEvent)==null?void 0:R.type,l.interactedInside)}),h=G(()=>{var E;const R=(E=i.current.openEvent)==null?void 0:E.type;return(R==null?void 0:R.includes("mouse"))&&R!=="mousedown"}),g=G(R=>Nr(R,n.context.triggerElements)),p=d.useCallback(R=>{const E=tn(a,"close",l.pointerType),y=()=>{n.setOpen(!1,he(Oe,R)),u==null||u.events.emit("floating.closed",R)};E?l.openChangeTimeout.start(E,y):(l.openChangeTimeout.clear(),y())},[a,n,l,u]),m=G(()=>{wo(l)}),S=G(R=>{const E=Le(R);if(!va(E)){l.interactedInside=!1;return}l.interactedInside=(E==null?void 0:E.closest("[aria-haspopup]"))!=null});K(()=>{o||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,m())},[o,l,m]),d.useEffect(()=>m,[m]),K(()=>{var R,E,y,x,w;if(c&&o&&(R=l.handleCloseOptions)!=null&&R.blockPointerEvents&&h()&&ae(s)&&r){const I=s,F=r,V=de(r),D=(y=(E=u==null?void 0:u.nodesRef.current.find(T=>T.id===f))==null?void 0:E.context)==null?void 0:y.elements.floating;D&&(D.style.pointerEvents="");const A=((w=(x=l.handleCloseOptions)==null?void 0:x.getScope)==null?void 0:w.call(x))??l.pointerEventsScopeElement??D??I.closest("[data-rootownerid]")??V.body;return ya(l,{scopeElement:A,referenceElement:I,floatingElement:F}),()=>{m()}}},[c,o,s,r,l,h,u,f,m]);const v=Et();d.useEffect(()=>{if(!c)return;function R(){l.openChangeTimeout.clear(),v.clear(),u==null||u.events.off("floating.closed",y),m()}function E(w){if(u&&f&&Ze(u.nodesRef.current,f).length>0){u.events.on("floating.closed",y);return}if(!g(w.relatedTarget)){if(l.handler){l.handler(w);return}m(),b()||p(w)}}function y(w){!u||!f||Ze(u.nodesRef.current,f).length>0||v.start(0,()=>{u.events.off("floating.closed",y),n.setOpen(!1,he(Oe,w)),u.events.emit("floating.closed",w)})}const x=r;return x&&(x.addEventListener("mouseenter",R),x.addEventListener("mouseleave",E),x.addEventListener("pointerdown",S,!0)),()=>{x&&(x.removeEventListener("mouseenter",R),x.removeEventListener("mouseleave",E),x.removeEventListener("pointerdown",S,!0)),u==null||u.events.off("floating.closed",y)}},[c,r,n,i,b,g,p,m,S,l,u,f,v])}const Ra={current:null};function Sa(e,t={}){var D;const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:c=null,mouseOnly:a=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Ra,externalTree:b,isActiveTrigger:h=!0,getHandleCloseContext:g}=t,p=Pt(b),m=Ts(n),S=Ue(c),v=Ue(i),R=Ue(l),E=Ue(s);h&&(m.handleCloseOptions=(D=S.current)==null?void 0:D.__options);const y=G(()=>{var A;return Kr((A=o.current.openEvent)==null?void 0:A.type,m.interactedInside)}),x=G(A=>Nr(A,n.context.triggerElements)),w=G((A,T,M)=>{const C=n.context.triggerElements;if(C.hasElement(T))return!A||!te(A,T);if(!ae(M))return!1;const B=M;return C.hasMatchingElement(L=>te(L,B))&&(!A||!te(A,B))}),I=d.useCallback((A,T=!0)=>{const M=tn(v.current,"close",m.pointerType);M?m.openChangeTimeout.start(M,()=>{n.setOpen(!1,he(Oe,A)),p==null||p.events.emit("floating.closed",A)}):T&&(m.openChangeTimeout.clear(),n.setOpen(!1,he(Oe,A)),p==null||p.events.emit("floating.closed",A))},[v,n,m,p]),F=G(()=>{if(!m.handler)return;de(n.select("domReferenceElement")).removeEventListener("mousemove",m.handler),m.handler=void 0});d.useEffect(()=>F,[F]);const V=G(()=>{wo(m)});return d.useEffect(()=>{if(!s)return;function A(T){T.open||(F(),m.openChangeTimeout.clear(),m.restTimeout.clear(),m.blockMouseMove=!0,m.restTimeoutPending=!1)}return r.on("openchange",A),()=>{r.off("openchange",A)}},[s,r,m,F]),d.useEffect(()=>{if(!s)return;const A=f.current??(h?n.select("domReferenceElement"):null);if(!ae(A))return;function T(C){if(m.openChangeTimeout.clear(),m.blockMouseMove=!1,a&&!Vt(m.pointerType)||$o(R.current)>0&&!tn(v.current,"open"))return;const L=tn(v.current,"open",m.pointerType),P=C.currentTarget??null,N=n.select("domReferenceElement"),z=P==null?!1:w(N,P,C.target),j=n.select("open"),ne=!j||z;z&&j?n.setOpen(!0,he(Oe,C,P)):L?m.openChangeTimeout.start(L,()=>{ne&&n.setOpen(!0,he(Oe,C,P))}):ne&&n.setOpen(!0,he(Oe,C,P))}function M(C){if(y()){V();return}F();const B=n.select("domReferenceElement"),L=de(B);m.restTimeout.clear(),m.restTimeoutPending=!1;const P=o.current.floatingContext??(g==null?void 0:g());if(x(C.relatedTarget))return;if(S.current&&P){n.select("open")||m.openChangeTimeout.clear();const j=f.current;m.handler=S.current({...P,tree:p,x:C.clientX,y:C.clientY,onClose(){V(),F(),E.current&&!y()&&j===n.select("domReferenceElement")&&I(C,!0)}}),L.addEventListener("mousemove",m.handler),m.handler(C);return}(m.pointerType==="touch"?!te(n.select("floatingElement"),C.relatedTarget):!0)&&I(C)}return u&&A.addEventListener("mousemove",T,{once:!0}),A.addEventListener("mouseenter",T),A.addEventListener("mouseleave",M),()=>{u&&A.removeEventListener("mousemove",T),A.removeEventListener("mouseenter",T),A.removeEventListener("mouseleave",M)}},[F,V,o,v,I,n,s,S,m,h,w,y,x,a,u,R,f,p,E,g]),d.useMemo(()=>{if(!s)return;function A(T){m.pointerType=T.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(T){const{nativeEvent:M}=T,C=T.currentTarget,B=n.select("domReferenceElement"),L=n.select("open"),P=w(B,C,T.target);if(a&&!Vt(m.pointerType))return;const N=$o(R.current);if(L&&!P||N===0||!P&&m.restTimeoutPending&&T.movementX**2+T.movementY**2<2)return;m.restTimeout.clear();function z(){if(m.restTimeoutPending=!1,y())return;const j=n.select("open");!m.blockMouseMove&&(!j||P)&&n.setOpen(!0,he(Oe,M,C))}m.pointerType==="touch"?Je.flushSync(()=>{z()}):P&&L?z():(m.restTimeoutPending=!0,m.restTimeout.start(N,z))}}},[s,m,y,w,a,n,R])}function Cn(e=[]){const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),o=e.map(l=>l==null?void 0:l.item),r=e.map(l=>l==null?void 0:l.trigger),s=d.useCallback(l=>zt(l,e,"reference"),t),i=d.useCallback(l=>zt(l,e,"floating"),n),c=d.useCallback(l=>zt(l,e,"item"),o),a=d.useCallback(l=>zt(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:a}),[s,i,c,a])}function zt(e,t,n){var i;const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Jn]="");for(const c in e)r&&e&&(c===Fr||c===Lr)||(s[c]=e[c]);for(let c=0;c<t.length;c+=1){let a;const l=(i=t[c])==null?void 0:i[n];typeof l=="function"?a=e?l(e):null:a=l,a&&cr(s,a,r,o)}return cr(s,e,r,o),s}function cr(e,t,n,o){var r;for(const s in t){const i=t[s];n&&(s===Fr||s===Lr)||(s.startsWith("on")?(o.has(s)||o.set(s,[]),typeof i=="function"&&((r=o.get(s))==null||r.push(i),e[s]=(...c)=>{var a;return(a=o.get(s))==null?void 0:a.map(l=>l(...c)).find(l=>l!==void 0)})):e[s]=i)}}const wa=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Cs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:c="dialog"}=t,a=xt(),l=(s==null?void 0:s.id)||a,u=d.useMemo(()=>{var v;return((v=Qn(i))==null?void 0:v.id)||r},[i,r]),f=wa.get(c)??c,h=mt()!=null,g=d.useMemo(()=>f==="tooltip"||c==="label"?Te:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&h&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,h,c]),p=d.useMemo(()=>f==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?u:void 0}:{...g,"aria-expanded":o?"true":"false","aria-controls":o?u:void 0,...f==="menu"&&{id:l}},[f,u,o,l,c,g]),m=d.useMemo(()=>{const v={id:u,...f&&{role:f}};return f==="tooltip"||c==="label"?v:{...v,...f==="menu"&&{"aria-labelledby":l}}},[f,u,l,c]),S=d.useCallback(({active:v,selected:R})=>{const E={role:"option",...v&&{id:`${u}-fui-option`}};switch(c){case"select":case"combobox":return{...E,"aria-selected":R}}return{}},[u,c]);return d.useMemo(()=>({reference:p,floating:m,item:S,trigger:g}),[p,m,g,S])}const lr=.1,xa=lr*lr,le=.5;function Zt(e,t,n,o,r,s){return o>=t!=s>=t&&e<=(r-n)*(t-o)/(s-o)+n}function Jt(e,t,n,o,r,s,i,c,a,l){let u=!1;return Zt(e,t,n,o,r,s)&&(u=!u),Zt(e,t,r,s,i,c)&&(u=!u),Zt(e,t,i,c,a,l)&&(u=!u),Zt(e,t,a,l,n,o)&&(u=!u),u}function Ta(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Qt(e,t,n,o,r,s){const i=Math.min(n,r),c=Math.max(n,r),a=Math.min(o,s),l=Math.max(o,s);return e>=i&&e<=c&&t>=a&&t<=l}function Ca(e={}){const{blockPointerEvents:t=!1}=e,n=new $e,o=({x:r,y:s,placement:i,elements:c,onClose:a,nodeId:l,tree:u})=>{const f=i==null?void 0:i.split("-")[0];let b=!1,h=null,g=null,p=typeof performance<"u"?performance.now():0;function m(v,R){const E=performance.now(),y=E-p;if(h===null||g===null||y===0)return h=v,g=R,p=E,!1;const x=v-h,w=R-g,I=x*x+w*w,F=y*y*xa;return h=v,g=R,p=E,I<F}function S(){n.clear(),a()}return function(R){n.clear();const E=c.domReference,y=c.floating;if(!E||!y||f==null||r==null||s==null)return;const{clientX:x,clientY:w}=R,I=Le(R),F=R.type==="mouseleave",V=te(y,I),D=te(E,I);if(V&&(b=!0,!F))return;if(D&&(b=!1,!F)){b=!0;return}if(F&&ae(R.relatedTarget)&&te(y,R.relatedTarget))return;function A(){return!!(u&&Ze(u.nodesRef.current,l).length>0)}function T(){A()||S()}if(A())return;const M=E.getBoundingClientRect(),C=y.getBoundingClientRect(),B=r>C.right-C.width/2,L=s>C.bottom-C.height/2,P=C.width>M.width,N=C.height>M.height,z=(P?M:C).left,j=(P?M:C).right,ne=(N?M:C).top,ge=(N?M:C).bottom;if(f==="top"&&s>=M.bottom-1||f==="bottom"&&s<=M.top+1||f==="left"&&r>=M.right-1||f==="right"&&r<=M.left+1){T();return}let oe=!1;switch(f){case"top":oe=Qt(x,w,z,M.top+1,j,C.bottom-1);break;case"bottom":oe=Qt(x,w,z,C.top+1,j,M.bottom-1);break;case"left":oe=Qt(x,w,C.right-1,ge,M.left+1,ne);break;case"right":oe=Qt(x,w,M.right-1,ge,C.left+1,ne);break}if(oe)return;if(b&&!Ta(x,w,M)){T();return}if(!F&&m(x,w)){T();return}let J=!1;switch(f){case"top":{const _=P?le/2:le*4,pe=P||B?r+_:r-_,H=P?r-_:B?r+_:r-_,fe=s+le+1,ue=B||P?C.bottom-le:C.top,Ee=B?P?C.bottom-le:C.top:C.bottom-le;J=Jt(x,w,pe,fe,H,fe,C.left,ue,C.right,Ee);break}case"bottom":{const _=P?le/2:le*4,pe=P||B?r+_:r-_,H=P?r-_:B?r+_:r-_,fe=s-le,ue=B||P?C.top+le:C.bottom,Ee=B?P?C.top+le:C.bottom:C.top+le;J=Jt(x,w,pe,fe,H,fe,C.left,ue,C.right,Ee);break}case"left":{const _=N?le/2:le*4,pe=N||L?s+_:s-_,H=N?s-_:L?s+_:s-_,fe=r+le+1,ue=L||N?C.right-le:C.left,Ee=L?N?C.right-le:C.left:C.right-le;J=Jt(x,w,ue,C.top,Ee,C.bottom,fe,pe,fe,H);break}case"right":{const _=N?le/2:le*4,pe=N||L?s+_:s-_,H=N?s-_:L?s+_:s-_,fe=r-le,ue=L||N?C.left+le:C.right,Ee=L?N?C.left+le:C.right:C.left+le;J=Jt(x,w,fe,pe,fe,H,ue,C.top,Ee,C.bottom);break}}J?b||n.start(40,T):T()}};return o.__options={blockPointerEvents:t},o}let Pa=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Oa=(function(e){return e[e.open=dt.open]="open",e[e.closed=dt.closed]="closed",e[e.startingStyle=dt.startingStyle]="startingStyle",e[e.endingStyle=dt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Ps=d.createContext(void 0);function Ia(){const e=d.useContext(Ps);if(e===void 0)throw new Error(We(26));return e}const Os="ArrowUp",Is="ArrowDown",ks="ArrowLeft",As="ArrowRight",Ms="Home",Fs="End",ka=new Set([ks,As]),Aa=new Set([Os,Is]),Ma=new Set([...ka,...Aa]);[...Ma];const Ls=new Set([Os,Is,ks,As,Ms,Fs]),Fa={...Rn,...ao,nestedDialogOpen(e){return e?{[Oa.nestedDialogOpen]:""}:null}},Ou=d.forwardRef(function(t,n){const{className:o,finalFocus:r,initialFocus:s,render:i,...c}=t,{store:a}=gt(),l=a.useState("descriptionElementId"),u=a.useState("disablePointerDismissal"),f=a.useState("floatingRootContext"),b=a.useState("popupProps"),h=a.useState("modal"),g=a.useState("mounted"),p=a.useState("nested"),m=a.useState("nestedOpenDialogCount"),S=a.useState("open"),v=a.useState("openMethod"),R=a.useState("titleElementId"),E=a.useState("transitionStatus"),y=a.useState("role");Ia(),Ro({open:S,ref:a.context.popupRef,onComplete(){var D,A;S&&((A=(D=a.context).onOpenChangeComplete)==null||A.call(D,!0))}});function x(D){return D==="touch"?a.context.popupRef.current:!0}const w=s===void 0?x:s,I=m>0,V=Ne("div",t,{state:{open:S,nested:p,transitionStatus:E,nestedDialogOpen:I},props:[b,{"aria-labelledby":R??void 0,"aria-describedby":l??void 0,role:y,tabIndex:-1,hidden:!g,onKeyDown(D){Ls.has(D.key)&&D.stopPropagation()},style:{[Pa.nestedDialogs]:m}},c],ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],stateAttributesMapping:Fa});return Z.jsx(os,{context:f,openInteractionType:v,disabled:!g,closeOnFocusOut:!u,initialFocus:w,returnFocus:r,modal:h!==!1,restoreFocus:"popup",children:V})});function Ds(e){return so(19)?e:e?"true":void 0}const Ns=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o==null?void 0:o.getBoundingClientRect();s=`polygon(
21
+ 0% 0%,
22
+ 100% 0%,
23
+ 100% 100%,
24
+ 0% 100%,
25
+ 0% 0%,
26
+ ${i.left}px ${i.top}px,
27
+ ${i.left}px ${i.bottom}px,
28
+ ${i.right}px ${i.bottom}px,
29
+ ${i.right}px ${i.top}px,
30
+ ${i.left}px ${i.top}px
31
+ )`}return Z.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Iu=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=gt(),i=s.useState("mounted"),c=s.useState("modal"),a=s.useState("open");return i||o?Z.jsx(Ps.Provider,{value:o,children:Z.jsxs(Qr,{ref:n,...r,children:[i&&c===!0&&Z.jsx(Ns,{ref:s.context.internalBackdropRef,inert:Ds(!a)}),t.children]})}):null});function Vs(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}let ar={},ur={},fr="";function La(e){if(typeof document>"u")return!1;const t=de(e);return Se(t).innerWidth-t.documentElement.clientWidth>0}function Da(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=de(e),o=n.documentElement,r=n.body,s=it(o)?o:r,i=s.style.overflowY,c=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=c,a===l}function Na(e){const t=de(e),n=t.documentElement,o=t.body,r=it(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function Va(e){var b;const t=de(e),n=t.documentElement,o=t.body,r=Se(n);let s=0,i=0,c=!1;const a=Ye.create();if(Ar&&(((b=r.visualViewport)==null?void 0:b.scale)??1)!==1)return()=>{};function l(){const h=r.getComputedStyle(n),g=r.getComputedStyle(o),S=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,ar={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},fr=n.style.scrollBehavior,ur={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const v=n.scrollHeight>n.clientHeight,R=n.scrollWidth>n.clientWidth,E=h.overflowY==="scroll"||g.overflowY==="scroll",y=h.overflowX==="scroll"||g.overflowX==="scroll",x=Math.max(0,r.innerWidth-o.clientWidth),w=Math.max(0,r.innerHeight-o.clientHeight),I=parseFloat(g.marginTop)+parseFloat(g.marginBottom),F=parseFloat(g.marginLeft)+parseFloat(g.marginRight),V=it(n)?n:o;if(c=Da(e),c){n.style.scrollbarGutter=S,V.style.overflowY="hidden",V.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(v||E)&&(n.style.overflowY="scroll"),(R||y)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:I||w?`calc(100dvh - ${I+w}px)`:"100dvh",width:F||x?`calc(100vw - ${F+x}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,ar),Object.assign(o.style,ur),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=fr)}function f(){u(),a.request(l)}return l(),r.addEventListener("resize",f),()=>{a.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class Ba{constructor(){se(this,"lockCount",0);se(this,"restore",null);se(this,"timeoutLock",$e.create());se(this,"timeoutUnlock",$e.create());se(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});se(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=de(t).documentElement,r=Se(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Ce;return}const s=Mr||!La(t);this.restore=s?Na(t):Va(t)}}const $a=new Ba;function Bs(e=!0,t=null){K(()=>{if(e)return $a.acquire(t)},[e,t])}function Wa(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function _a(e,t){const n=d.useRef(e),o=G(t);K(()=>{n.current!==e&&o(n.current)},[e,o]),K(()=>{n.current=e},[e])}function $s(e){const[t,n]=d.useState(null),o=G((i,c)=>{e||n(c||(Mr?"touch":""))});_a(e,i=>{i&&!e&&n(null)});const{onClick:r,onPointerDown:s}=Wa(o);return d.useMemo(()=>({openMethod:t,triggerProps:{onClick:r,onPointerDown:s}}),[t,r,s])}function ja(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),c=t.useState("popupElement"),{openMethod:a,triggerProps:l}=$s(r);Es(t);const{forceUnmount:u}=Rs(r,t),f=G(F=>{const V=he(F);return V.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},V}),b=d.useCallback(()=>{t.setOpen(!1,f(Or))},[t,f]);d.useImperativeHandle(o,()=>({unmount:u,close:b}),[u,b]);const h=xs({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,p]=d.useState(0),m=g===0,S=Cs(h),v=ss(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const V=Le(F);if(m&&!s){const D=V;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===D||t.context.backdropRef.current===D||te(D,c)&&!(D!=null&&D.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:m});Bs(r&&i===!0,c);const{getReferenceProps:R,getFloatingProps:E,getTriggerProps:y}=Cn([S,v]);t.useContextCallback("onNestedDialogOpen",F=>{p(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{p(0)}),d.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&r&&n.onNestedDialogOpen(g),n!=null&&n.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,g]);const x=d.useMemo(()=>R(l),[R,l]),w=d.useMemo(()=>y(l),[y,l]),I=d.useMemo(()=>E(),[E]);t.useSyncedValues({openMethod:a,activeTriggerProps:x,inactiveTriggerProps:w,popupProps:I,floatingRootContext:h,nestedOpenDialogCount:g})}const Ha={...ws,modal:X(e=>e.modal),nested:X(e=>e.nested),nestedOpenDialogCount:X(e=>e.nestedOpenDialogCount),disablePointerDismissal:X(e=>e.disablePointerDismissal),openMethod:X(e=>e.openMethod),descriptionElementId:X(e=>e.descriptionElementId),titleElementId:X(e=>e.titleElementId),viewportElement:X(e=>e.viewportElement),role:X(e=>e.role)};class Ya extends yo{constructor(n){super(Ua(n),{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Tn,onOpenChange:void 0,onOpenChangeComplete:void 0},Ha);se(this,"setOpen",(n,o)=>{var c,a,l,u;if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),(a=(c=this.context).onOpenChange)==null||a.call(c,n,o),o.isCanceled)return;const r={open:n,nativeEvent:o.event,reason:o.reason,nested:this.state.nested};(l=this.state.floatingRootContext.context.events)==null||l.emit("openchange",r);const s={open:n},i=((u=o.trigger)==null?void 0:u.id)??null;(i||n)&&(s.activeTriggerId=i,s.activeTriggerElement=o.trigger??null),this.update(s)})}}function Ua(e={}){return{...Ss(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function ku(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:a,handle:l,triggerId:u,defaultTriggerId:f=null}=e,b=gt(!0),h=!!b,g=Ae(()=>(l==null?void 0:l.store)??new Ya({open:o,openProp:n,activeTriggerId:f,triggerIdProp:u,modal:c,disablePointerDismissal:i,nested:h})).current;Vs(()=>{n===void 0&&g.state.open===!1&&o===!0&&g.update({open:!0,activeTriggerId:f})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",u),g.useSyncedValues({disablePointerDismissal:i,nested:h,modal:c}),g.useContextCallback("onOpenChange",r),g.useContextCallback("onOpenChangeComplete",s);const p=g.useState("payload");ja({store:g,actionsRef:a,parentContext:b==null?void 0:b.store.context});const m=d.useMemo(()=>({store:g}),[g]);return Z.jsx(xr.Provider,{value:m,children:typeof t=="function"?t({payload:p}):t})}const Au=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:c}=gt(),a=Sn(s);return c.useSyncedValueWithCleanup("titleElementId",a),Ne("h2",t,{ref:n,props:[{id:a},i]})}),Mu=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:c,payload:a,handle:l,...u}=t,f=gt(!0),b=(l==null?void 0:l.store)??(f==null?void 0:f.store);if(!b)throw new Error(We(79));const h=Sn(c),g=b.useState("floatingRootContext"),p=b.useState("isOpenedByTrigger",h),m=d.useRef(null),{registerTrigger:S,isMountedByThisTrigger:v}=ys(h,m,b,{payload:a}),{getButtonProps:R,buttonRef:E}=En({disabled:s,native:i}),y=rs(g,{enabled:g!=null}),x=Cn([y]),w={disabled:s,open:p},I=b.useState("triggerProps",v);return Ne("button",t,{state:w,ref:[E,n,S,m],props:[x.getReferenceProps(),I,{[io]:"",id:h},u,R],stateAttributesMapping:Tr})}),Ws=d.createContext(void 0);function $t(e){const t=d.useContext(Ws);if(t===void 0&&!e)throw new Error(We(47));return t}function Xa(){return{...Ss(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const qa={...ws,disabled:X(e=>e.disabled),instantType:X(e=>e.instantType),openMethod:X(e=>e.openMethod),openChangeReason:X(e=>e.openChangeReason),modal:X(e=>e.modal),stickIfOpen:X(e=>e.stickIfOpen),titleElementId:X(e=>e.titleElementId),descriptionElementId:X(e=>e.descriptionElementId),openOnHover:X(e=>e.openOnHover),closeDelay:X(e=>e.closeDelay),hasViewport:X(e=>e.hasViewport)};class xo extends yo{constructor(n){const o={...Xa(),...n};o.open&&(n==null?void 0:n.mounted)===void 0&&(o.mounted=!0);super(o,{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),stickIfOpenTimeout:new $e,triggerElements:new Tn},qa);se(this,"setOpen",(n,o)=>{var u,f;const r=o.reason===Oe,s=o.reason===yt&&o.event.detail===0,i=!n&&(o.reason===Pr||o.reason==null);if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(f=(u=this.context).onOpenChange)==null||f.call(u,n,o),o.isCanceled)return;const c={open:n,nativeEvent:o.event,reason:o.reason,nested:this.state.nested,triggerElement:o.trigger},a=this.state.floatingRootContext.context.events;a==null||a.emit("openchange",c);const l=()=>{var g;const b={open:n,openChangeReason:o.reason},h=((g=o.trigger)==null?void 0:g.id)??null;(h||n)&&(b.activeTriggerId=h,b.activeTriggerElement=o.trigger??null),this.update(b)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(gi,()=>{this.set("stickIfOpen",!1)}),Je.flushSync(l)):l(),s||i?this.set("instantType",s?"click":"dismiss"):o.reason===Nt?this.set("instantType","focus"):this.set("instantType",void 0)});se(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,o){const r=Ae(()=>new xo(o)).current,s=n??r;return wn(r.disposeEffect),s}}function dr({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,modal:i=!1,handle:c,triggerId:a,defaultTriggerId:l=null}=e,u=xo.useStore(c==null?void 0:c.store,{modal:i,open:o,openProp:n,activeTriggerId:l,triggerIdProp:a});Vs(()=>{n===void 0&&u.state.open===!1&&o===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp("openProp",n),u.useControlledProp("triggerIdProp",a);const f=u.useState("open"),b=u.useState("positionerElement"),h=u.useState("payload"),g=u.useState("openChangeReason");u.useContextCallback("onOpenChange",r),u.useContextCallback("onOpenChangeComplete",s);const{openMethod:p,triggerProps:m}=$s(f);Es(u);const{forceUnmount:S}=Rs(f,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});Bs(f&&i===!0&&g!==Oe&&p!=="touch",b),d.useEffect(()=>{f||u.context.stickIfOpenTimeout.clear()},[u,f]);const v=d.useCallback(M=>{const C=he(M);return C.preventUnmountOnClose=()=>{u.set("preventUnmountingOnClose",!0)},C},[u]),R=d.useCallback(()=>{u.setOpen(!1,v(Or))},[u,v]);d.useImperativeHandle(e.actionsRef,()=>({unmount:S,close:R}),[S,R]);const E=xs({popupStore:u,onOpenChange:u.setOpen}),y=ss(E,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),x=Cs(E),{getReferenceProps:w,getFloatingProps:I,getTriggerProps:F}=Cn([y,x]),V=d.useMemo(()=>w(m),[w,m]),D=d.useMemo(()=>F(m),[F,m]),A=d.useMemo(()=>I(),[I]);u.useSyncedValues({modal:i,openMethod:p,activeTriggerProps:V,inactiveTriggerProps:D,popupProps:A,floatingRootContext:E,nested:mt()!=null});const T=d.useMemo(()=>({store:u}),[u]);return Z.jsx(Ws.Provider,{value:T,children:typeof t=="function"?t({payload:h}):t})}function Fu(e){return $t(!0)?Z.jsx(dr,{props:e}):Z.jsx(Yc,{children:Z.jsx(dr,{props:e})})}const Ga=300,Lu=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,handle:c,payload:a,openOnHover:l=!1,delay:u=Ga,closeDelay:f=0,id:b,...h}=t,g=$t(!0),p=(c==null?void 0:c.store)??(g==null?void 0:g.store);if(!p)throw new Error(We(74));const m=Sn(b),S=p.useState("isTriggerActive",m),v=p.useState("floatingRootContext"),R=p.useState("isOpenedByTrigger",m),E=d.useRef(null),{registerTrigger:y,isMountedByThisTrigger:x}=ys(m,E,p,{payload:a,disabled:s,openOnHover:l,closeDelay:f}),w=p.useState("openChangeReason"),I=p.useState("stickIfOpen"),F=p.useState("openMethod"),V=Sa(v,{enabled:v!=null&&l&&(F!=="touch"||w!==yt),mouseOnly:!0,move:!1,handleClose:Ca(),restMs:u,delay:{close:f},triggerElementRef:E,isActiveTrigger:S}),D=rs(v,{enabled:v!=null,stickIfOpen:I}),A=Cn([D]),T=p.useState("triggerProps",x),M={disabled:s,open:R},{getButtonProps:C,buttonRef:B}=En({disabled:s,native:i}),L=d.useMemo(()=>({open(ne){return ne&&w===yt?ji.open(ne):Tr.open(ne)}}),[w]),P=Ne("button",t,{state:M,ref:[B,n,y,E],props:[A.getReferenceProps(),V,T,{[io]:"",id:m},h,C],stateAttributesMapping:L}),N=d.useRef(null),z=G(ne=>{Je.flushSync(()=>{p.setOpen(!1,he(Nt,ne.nativeEvent,ne.currentTarget))});const ge=kc(N.current);ge==null||ge.focus()}),j=G(ne=>{var oe;const ge=p.select("positionerElement");if(ge&&bt(ne,ge))(oe=p.context.beforeContentFocusGuardRef.current)==null||oe.focus();else{Je.flushSync(()=>{p.setOpen(!1,he(Nt,ne.nativeEvent,ne.currentTarget))});let J=Ic(p.context.triggerFocusTargetRef.current||E.current);for(;J!==null&&te(ge,J);){const _=J;if(J=mo(J),J===_)break}J==null||J.focus()}});return S?Z.jsxs(d.Fragment,{children:[Z.jsx(wt,{ref:N,onFocus:z}),Z.jsx(d.Fragment,{children:P},m),Z.jsx(wt,{ref:p.context.triggerFocusTargetRef,onFocus:j})]}):Z.jsx(d.Fragment,{children:P},m)}),_s=d.createContext(void 0);function Ka(){const e=d.useContext(_s);if(e===void 0)throw new Error(We(45));return e}const Du=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=$t();return s.useState("mounted")||o?Z.jsx(_s.Provider,{value:o,children:Z.jsx(Qr,{ref:n,...r})}):null}),js=d.createContext(void 0);function za(){const e=d.useContext(js);if(!e)throw new Error(We(46));return e}const Za=d.createContext(void 0);function Ja(){const e=d.useContext(Za);return(e==null?void 0:e.direction)??"ltr"}const Qa=e=>({name:"arrow",options:e,async fn(t){var N,z;const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:u=0,offsetParent:f="real"}=et(e,t)||{};if(l==null)return{};const b=Br(u),h={x:n,y:o},g=go(r),p=po(g),m=await i.getDimensions(l),S=g==="y",v=S?"top":"left",R=S?"bottom":"right",E=S?"clientHeight":"clientWidth",y=s.reference[p]+s.reference[g]-h[g]-s.floating[p],x=h[g]-s.reference[g],w=f==="real"?await((N=i.getOffsetParent)==null?void 0:N.call(i,l)):c.floating;let I=c.floating[E]||s.floating[p];(!I||!await((z=i.isElement)==null?void 0:z.call(i,w)))&&(I=c.floating[E]||s.floating[p]);const F=y/2-x/2,V=I/2-m[p]/2-1,D=Math.min(b[v],V),A=Math.min(b[R],V),T=D,M=I-m[p]-A,C=I/2-m[p]/2+F,B=eo(T,C,M),L=!a.arrow&&ct(r)!=null&&C!==B&&s.reference[p]/2-(C<T?D:A)-m[p]/2<0,P=L?C<T?C-T:C-M:0;return{[g]:h[g]+P,data:{[g]:B,centerOffset:C-B-P,...L&&{alignmentOffset:P}},reset:L}}}),eu=(e,t)=>({...Qa(e),options:[e,t]}),tu={name:"hide",async fn(e){var c;const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:((c=(await Bl().fn(e)).data)==null?void 0:c.referenceHidden)||s}}}},on={sideX:"left",sideY:"top"},nu={name:"adaptiveOrigin",async fn(e){var v,R;const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=e,a=Se(r),l=a.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:on};const f=await((v=s.getOffsetParent)==null?void 0:v.call(s,r));let b={width:0,height:0};if(i==="fixed"&&(a!=null&&a.visualViewport))b={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const E=de(r);b={width:E.documentElement.clientWidth,height:E.documentElement.clientHeight}}else await((R=s.isElement)==null?void 0:R.call(s,f))&&(b=await s.getDimensions(f));const h=Pe(c);let g=t,p=n;h==="left"&&(g=b.width-(t+o.width)),h==="top"&&(p=b.height-(n+o.height));const m=h==="left"?"right":on.sideX,S=h==="top"?"bottom":on.sideY;return{x:g,y:p,data:{sideX:m,sideY:S}}}};function Hs(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function pr(e,t,n){const{rects:o,placement:r}=e;return{side:Hs(t,Pe(r),n),align:ct(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function ou(e){var Ht,Yt;const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:b=!1,floatingRootContext:h,mounted:g,collisionAvoidance:p,shiftCrossAxis:m=!1,nodeId:S,adaptiveOrigin:v,lazyFlip:R=!1,externalTree:E}=e,[y,x]=d.useState(null);!g&&y!==null&&x(null);const w=p.side||"flip",I=p.align||"flip",F=p.fallbackAxisSide||"end",V=typeof t=="function"?t:void 0,D=G(V),A=V?D:t,T=Ue(t),C=Ja()==="rtl",B=y||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[o],L=s==="center"?B:`${B}-${s}`;let P=a;const N=1,z=o==="bottom"?N:0,j=o==="top"?N:0,ne=o==="right"?N:0,ge=o==="left"?N:0;typeof P=="number"?P={top:P+z,right:P+ge,bottom:P+j,left:P+ne}:P&&(P={top:(P.top||0)+z,right:(P.right||0)+ge,bottom:(P.bottom||0)+j,left:(P.left||0)+ne});const oe={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:P},J=d.useRef(null),_=Ue(r),pe=Ue(i),ue=[Fl(ce=>{const Re=pr(ce,o,C),He=typeof _.current=="function"?_.current(Re):_.current,Fe=typeof pe.current=="function"?pe.current(Re):pe.current;return{mainAxis:He,crossAxis:Fe,alignmentAxis:Fe}},[typeof r!="function"?r:0,typeof i!="function"?i:0,C,o])],Ee=I==="none"&&w!=="shift",lt=!Ee&&(l||m||w==="shift"),W=w==="none"?null:Nl({...oe,padding:{top:P.top+N,right:P.right+N,bottom:P.bottom+N,left:P.left+N},mainAxis:!m&&w==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),ee=Ee?null:Ll(ce=>{const Re=de(ce.elements.floating).documentElement;return{...oe,rootBoundary:m?{x:0,y:0,width:Re.clientWidth,height:Re.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:lt,limiter:l||m?void 0:Dl(He=>{if(!J.current)return{};const{width:Fe,height:Ge}=J.current.getBoundingClientRect(),Ve=De(Pe(He.placement)),ut=Ve==="y"?Fe:Ge,ht=Ve==="y"?P.left+P.right:P.top+P.bottom;return{offset:ut/2+ht/2}})}},[oe,l,m,P,I]);w==="shift"||I==="shift"||s==="center"?ue.push(ee,W):ue.push(W,ee),ue.push(Vl({...oe,apply({elements:{floating:ce},availableWidth:Re,availableHeight:He,rects:Fe}){const Ge=ce.style;Ge.setProperty("--available-width",`${Re}px`),Ge.setProperty("--available-height",`${He}px`);const Ve=window.devicePixelRatio||1,{x:ut,y:ht,width:nt,height:Pn}=Fe.reference,On=(Math.round((ut+nt)*Ve)-Math.round(ut*Ve))/Ve,In=(Math.round((ht+Pn)*Ve)-Math.round(ht*Ve))/Ve;Ge.setProperty("--anchor-width",`${On}px`),Ge.setProperty("--anchor-height",`${In}px`)}}),eu(()=>({element:J.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(ce){var Co,Po,Oo;const{elements:Re,middlewareData:He,placement:Fe,rects:Ge,y:Ve}=ce,ut=Pe(Fe),ht=De(ut),nt=J.current,Pn=((Co=He.arrow)==null?void 0:Co.x)||0,On=((Po=He.arrow)==null?void 0:Po.y)||0,In=(nt==null?void 0:nt.clientWidth)||0,qs=(nt==null?void 0:nt.clientHeight)||0,kn=Pn+In/2,To=On+qs/2,Gs=Math.abs(((Oo=He.shift)==null?void 0:Oo.y)||0),Ks=Ge.reference.height/2,Ot=typeof r=="function"?r(pr(ce,o,C)):r,zs=Gs>Ot,Zs={top:`${kn}px calc(100% + ${Ot}px)`,bottom:`${kn}px ${-Ot}px`,left:`calc(100% + ${Ot}px) ${To}px`,right:`${-Ot}px ${To}px`}[ut],Js=`${kn}px ${Ge.reference.y+Ks-Ve}px`;return Re.floating.style.setProperty("--transform-origin",lt&&ht==="y"&&zs?Js:Zs),{}}},tu,v),K(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,h]);const q=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:me,elements:Y,x:U,y:be,middlewareData:$,update:O,placement:k,context:Q,isPositioned:re,floatingStyles:xe}=ha({rootContext:h,placement:L,middleware:ue,strategy:n,whileElementsMounted:b?void 0:(...ce)=>Qo(...ce,q),nodeId:S,externalTree:E}),{sideX:_e,sideY:je}=$.adaptiveOrigin||on,at=re?n:"fixed",ve=d.useMemo(()=>{const ce=v?{position:at,[_e]:U,[je]:be}:{position:at,...xe};return re||(ce.opacity=0),ce},[v,at,_e,U,je,be,xe,re]),we=d.useRef(null);K(()=>{if(!g)return;const ce=T.current,Re=typeof ce=="function"?ce():ce,Fe=(gr(Re)?Re.current:Re)||null||null;Fe!==we.current&&(me.setPositionReference(Fe),we.current=Fe)},[g,me,A,T]),d.useEffect(()=>{if(!g)return;const ce=T.current;typeof ce!="function"&&gr(ce)&&ce.current!==we.current&&(me.setPositionReference(ce.current),we.current=ce.current)},[g,me,A,T]),d.useEffect(()=>{if(b&&g&&Y.domReference&&Y.floating)return Qo(Y.domReference,Y.floating,O,q)},[b,g,Y,O,q]);const ie=Pe(k),Me=Hs(o,ie,C),tt=ct(k)||"center",Wt=!!((Ht=$.hide)!=null&&Ht.referenceHidden);K(()=>{R&&g&&re&&x(ie)},[R,g,re,ie]);const _t=d.useMemo(()=>{var ce,Re;return{position:"absolute",top:(ce=$.arrow)==null?void 0:ce.y,left:(Re=$.arrow)==null?void 0:Re.x}},[$.arrow]),jt=((Yt=$.arrow)==null?void 0:Yt.centerOffset)!==0;return d.useMemo(()=>({positionerStyles:ve,arrowStyles:_t,arrowRef:J,arrowUncentered:jt,side:Me,align:tt,physicalSide:ie,anchorHidden:Wt,refs:me,context:Q,isPositioned:re,update:O}),[ve,_t,J,jt,Me,tt,ie,Wt,me,Q,re,O])}function gr(e){return e!=null&&"current"in e}function Ys(e){return e==="starting"?mi:Te}const Nu=d.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:a="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:b=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:p=!1,collisionAvoidance:m=hi,...S}=t,{store:v}=$t(),R=Ka(),E=jc(),y=v.useState("floatingRootContext"),x=v.useState("mounted"),w=v.useState("open"),I=v.useState("openChangeReason"),F=v.useState("activeTriggerElement"),V=v.useState("modal"),D=v.useState("positionerElement"),A=v.useState("instantType"),T=v.useState("transitionStatus"),M=v.useState("hasViewport"),C=d.useRef(null),B=vs(D,!1,!1),L=ou({anchor:s,floatingRootContext:y,positionMethod:i,mounted:x,side:c,sideOffset:l,align:a,alignOffset:u,arrowPadding:h,collisionBoundary:f,collisionPadding:b,sticky:g,disableAnchorTracking:p,keepMounted:R,nodeId:E,collisionAvoidance:m,adaptiveOrigin:M?nu:void 0}),P=d.useMemo(()=>{const oe={};return w||(oe.pointerEvents="none"),{role:"presentation",hidden:!x,style:{...L.positionerStyles,...oe}}},[w,x,L.positionerStyles]),N=d.useMemo(()=>({props:P,...L}),[P,L]),z=y.useState("domReferenceElement");K(()=>{const oe=z,J=C.current;if(oe&&(C.current=oe),J&&oe&&oe!==J){v.set("instantType",void 0);const _=new AbortController;return B(()=>{v.set("instantType","trigger-change")},_.signal),()=>{_.abort()}}},[z,B,v]);const j={open:w,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:A},ne=d.useCallback(oe=>{v.set("positionerElement",oe)},[v]),ge=Ne("div",t,{state:j,props:[N.props,Ys(T),S],ref:[n,ne],stateAttributesMapping:Rn});return Z.jsxs(js.Provider,{value:N,children:[x&&V===!0&&I!==Oe&&Z.jsx(Ns,{ref:v.context.internalBackdropRef,inert:Ds(!w),cutout:F}),Z.jsx(Hc,{id:E,children:ge})]})}),ru=d.createContext(void 0);function su(e){return d.useContext(ru)}const iu=d.createContext(void 0);function cu(){const[e,t]=d.useState(0),n=G(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:d.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function lu(e){const{value:t,children:n}=e;return Z.jsx(iu.Provider,{value:t,children:n})}const au={...Rn,...ao},Vu=d.forwardRef(function(t,n){const{className:o,render:r,initialFocus:s,finalFocus:i,...c}=t,{store:a}=$t(),l=za(),u=su()!=null,{context:f,hasClosePart:b}=cu(),h=a.useState("open"),g=a.useState("openMethod"),p=a.useState("instantType"),m=a.useState("transitionStatus"),S=a.useState("popupProps"),v=a.useState("titleElementId"),R=a.useState("descriptionElementId"),E=a.useState("modal"),y=a.useState("mounted"),x=a.useState("openChangeReason"),w=a.useState("activeTriggerElement"),I=a.useState("floatingRootContext");Ro({open:h,ref:a.context.popupRef,onComplete(){var P,N;h&&((N=(P=a.context).onOpenChangeComplete)==null||N.call(P,!0))}});const F=a.useState("disabled"),V=a.useState("openOnHover"),D=a.useState("closeDelay");Ea(I,{enabled:V&&!F,closeDelay:D});function A(P){return P==="touch"?a.context.popupRef.current:!0}const T=s===void 0?A:s,M={open:h,side:l.side,align:l.align,instant:p,transitionStatus:m},C=E!==!1&&b,B=d.useCallback(P=>{a.set("popupElement",P)},[a]),L=Ne("div",t,{state:M,ref:[n,a.context.popupRef,B],props:[S,{"aria-labelledby":v,"aria-describedby":R,onKeyDown(P){u&&Ls.has(P.key)&&P.stopPropagation()}},Ys(m),c],stateAttributesMapping:au});return Z.jsx(os,{context:I,openInteractionType:g,modal:C,disabled:!y||x===Oe,initialFocus:T,returnFocus:i,restoreFocus:"popup",previousFocusableElement:ye(w)?w:void 0,nextFocusableElement:a.context.triggerFocusTargetRef,beforeContentFocusGuardRef:a.context.beforeContentFocusGuardRef,children:Z.jsx(lu,{value:f,children:L})})});let mr=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const uu={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},At={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},fu={disabled:!1,...At},du={valid(e){return e===null?null:e?{[mr.valid]:""}:{[mr.invalid]:""}}},pu=d.createContext({invalid:void 0,name:void 0,validityData:{state:uu,errors:[],error:"",value:"",initialValue:null},setValidityData:Ce,disabled:void 0,touched:At.touched,setTouched:Ce,dirty:At.dirty,setDirty:Ce,filled:At.filled,setFilled:Ce,focused:At.focused,setFocused:Ce,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:fu,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Te)=>e,getInputValidationProps:(e=Te)=>e,inputRef:{current:null},commit:async()=>{}}});function Us(e=!0){const t=d.useContext(pu);if(t.setValidityData===Ce&&!e)throw new Error(We(28));return t}const gu=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ce,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function mu(){return d.useContext(gu)}const hu=d.createContext({controlId:void 0,registerControlId:Ce,labelId:void 0,setLabelId:Ce,messageIds:[],setMessageIds:Ce,getDescriptionProps:e=>e});function Xs(){return d.useContext(hu)}function bu(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function vu({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=d.useRef(e!==void 0),[s,i]=d.useState(t),c=r?e:s,a=d.useCallback(l=>{r||i(l)},[]);return[c,a]}function yu(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=Xs(),i=Sn(t),c=n?r:void 0,a=Ae(()=>Symbol("labelable-control")),l=d.useRef(!1),u=d.useRef(t!=null),f=G(()=>{!l.current||s===Ce||(l.current=!1,s(a.current,void 0))});return K(()=>{if(s===Ce)return;let b;if(n){const h=o==null?void 0:o.current;ae(h)&&h.closest("label")!=null?b=t??null:b=c??i}else if(t!=null)u.current=!0,b=t;else if(u.current)b=i;else{f();return}if(b===void 0){f();return}l.current=!0,s(a.current,b)},[t,o,c,s,n,i,a,f]),d.useEffect(()=>f,[f]),r??i}function Eu(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=mu(),{invalid:a,markedDirtyRef:l,validityData:u,setValidityData:f}=Us(),b=G(e.getValue);K(()=>{if(!t)return;let h=n;h===void 0&&(h=b()),u.initialValue===null&&h!==null&&f(g=>({...g,initialValue:h}))},[t,f,n,u.initialValue,b]),K(()=>{!t||!o||c.current.fields.set(o,{getValue:b,name:r,controlRef:s,validityData:bu(u,a),validate(h=!0){let g=n;g===void 0&&(g=b()),l.current=!0,h?Je.flushSync(()=>i(g)):i(g)}})},[i,s,t,c,b,o,a,l,r,u,n]),K(()=>{const h=c.current.fields;return()=>{o&&h.delete(o)}},[c,o])}const Ru=d.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:c,disabled:a=!1,onValueChange:l,defaultValue:u,autoFocus:f=!1,...b}=t,{state:h,name:g,disabled:p,setTouched:m,setDirty:S,validityData:v,setFocused:R,setFilled:E,validationMode:y,validation:x}=Us(),w=p||a,I=g??i,F={...h,disabled:w},{labelId:V}=Xs(),D=yu({id:s});K(()=>{var P;const L=c!=null;(P=x.inputRef.current)!=null&&P.value||L&&c!==""?E(!0):L&&c===""&&E(!1)},[x.inputRef,E,c]);const A=d.useRef(null);K(()=>{f&&A.current===ot(de(A.current))&&R(!0)},[f,R]);const[T]=vu({controlled:c,default:u,name:"FieldControl",state:"value"}),M=c!==void 0,C=M?T:void 0;return Eu({id:D,name:I,commit:x.commit,value:C,getValue:()=>{var L;return(L=x.inputRef.current)==null?void 0:L.value},controlRef:x.inputRef}),Ne("input",t,{ref:[n,A],state:F,props:[{id:D,disabled:w,name:I,ref:x.inputRef,"aria-labelledby":V,autoFocus:f,...M?{value:C}:{defaultValue:u},onChange(L){const P=L.currentTarget.value;l==null||l(P,he(Yi,L.nativeEvent)),S(P!==v.initialValue),E(P!=="")},onFocus(){R(!0)},onBlur(L){m(!0),R(!1),y==="onBlur"&&x.commit(L.currentTarget.value)},onKeyDown(L){L.currentTarget.tagName==="INPUT"&&L.key==="Enter"&&(m(!0),x.commit(L.currentTarget.value))}},x.getInputValidationProps(),b],stateAttributesMapping:du})}),Bu=d.forwardRef(function(t,n){return Z.jsx(Ru,{ref:n,...t})});export{Tu as B,ku as D,Bu as I,Fu as P,Mu as a,Ou as b,Pu as c,Au as d,Iu as e,Cu as f,Lu as g,Du as h,Nu as i,Vu as j,vr as m,xu as u};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}