@openagt/dashboard 0.18.0 → 0.20.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.
- package/dist/dashboard/person.d.ts +22 -0
- package/dist/dashboard/person.d.ts.map +1 -0
- package/dist/dashboard/person.js +29 -0
- package/dist/dashboard/person.js.map +1 -0
- package/dist/dashboard/send-skills.d.ts +51 -0
- package/dist/dashboard/send-skills.d.ts.map +1 -0
- package/dist/dashboard/send-skills.js +122 -0
- package/dist/dashboard/send-skills.js.map +1 -0
- package/dist/dashboard-bundle/assets/astro-BZ97kZFP.js +1 -0
- package/dist/dashboard-bundle/assets/c-DWGmR78Y.js +1 -0
- package/dist/dashboard-bundle/assets/c-SSSlmE39.js +1 -0
- package/dist/dashboard-bundle/assets/core-Db3h5Pv3.js +12 -0
- package/dist/dashboard-bundle/assets/cpp-CJIxL8VH.js +1 -0
- package/dist/dashboard-bundle/assets/cpp-Cts1PyIS.js +1 -0
- package/dist/dashboard-bundle/assets/csharp-dmMxLVLW.js +1 -0
- package/dist/dashboard-bundle/assets/css-BGIxQoYs.js +1 -0
- package/dist/dashboard-bundle/assets/css-DUjzNfgv.js +1 -0
- package/dist/dashboard-bundle/assets/diff-woXpYk--.js +1 -0
- package/dist/dashboard-bundle/assets/docker-IyjqRm3v.js +1 -0
- package/dist/dashboard-bundle/assets/dotenv-CuH5my32.js +1 -0
- package/dist/dashboard-bundle/assets/engine-javascript-DbNy5Fxf.js +141 -0
- package/dist/dashboard-bundle/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/dashboard-bundle/assets/everforest-light-Df2xbC6M.js +1 -0
- package/dist/dashboard-bundle/assets/fish-BJitypiv.js +1 -0
- package/dist/dashboard-bundle/assets/go-rLFTqkRN.js +1 -0
- package/dist/dashboard-bundle/assets/graphql-DAzSVzvB.js +1 -0
- package/dist/dashboard-bundle/assets/graphql-DEIChqxY.js +1 -0
- package/dist/dashboard-bundle/assets/html-DSw1lh5G.js +1 -0
- package/dist/dashboard-bundle/assets/html-WQKKblVZ.js +1 -0
- package/dist/dashboard-bundle/assets/ini-B5eOa1yu.js +1 -0
- package/dist/dashboard-bundle/assets/java-BtIQNnN0.js +1 -0
- package/dist/dashboard-bundle/assets/java-DxlWrXwe.js +1 -0
- package/dist/dashboard-bundle/assets/javascript-BzbQS41l.js +1 -0
- package/dist/dashboard-bundle/assets/javascript-Yelw-5ZN.js +1 -0
- package/dist/dashboard-bundle/assets/json-B88Oqtu5.js +1 -0
- package/dist/dashboard-bundle/assets/json-CaljABEy.js +1 -0
- package/dist/dashboard-bundle/assets/json5-BR5RXkoi.js +1 -0
- package/dist/dashboard-bundle/assets/jsonc-CYpm1nAK.js +1 -0
- package/dist/dashboard-bundle/assets/jsx-D3KKoC5L.js +1 -0
- package/dist/dashboard-bundle/assets/jsx-hEbJ82HF.js +1 -0
- package/dist/dashboard-bundle/assets/kotlin-DhhofPvG.js +1 -0
- package/dist/dashboard-bundle/assets/less-DVTAwKKz.js +1 -0
- package/dist/dashboard-bundle/assets/lua-BJObVtAx.js +1 -0
- package/dist/dashboard-bundle/assets/lua-DjuecEsk.js +1 -0
- package/dist/dashboard-bundle/assets/main-BJq8FqaM.js +141 -0
- package/dist/dashboard-bundle/assets/main-NY2yoID8.css +2 -0
- package/dist/dashboard-bundle/assets/make-Dixweg8N.js +1 -0
- package/dist/dashboard-bundle/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/dashboard-bundle/assets/mdx-DQZ5AkYe.js +1 -0
- package/dist/dashboard-bundle/assets/module-BidWGbHQ.js +25 -0
- package/dist/dashboard-bundle/assets/php-D7kNSOJl.js +1 -0
- package/dist/dashboard-bundle/assets/postcss-D_Wz94rJ.js +1 -0
- package/dist/dashboard-bundle/assets/powershell-QtSnmXcu.js +1 -0
- package/dist/dashboard-bundle/assets/prisma-DMgNhnYS.js +1 -0
- package/dist/dashboard-bundle/assets/proto-DB4EqR-F.js +1 -0
- package/dist/dashboard-bundle/assets/python-gzcpVVnB.js +1 -0
- package/dist/dashboard-bundle/assets/ruby-DjBfgIB7.js +1 -0
- package/dist/dashboard-bundle/assets/rust-DpiIf5JO.js +1 -0
- package/dist/dashboard-bundle/assets/sass-DXrisJhu.js +1 -0
- package/dist/dashboard-bundle/assets/scss-8bKmll0B.js +1 -0
- package/dist/dashboard-bundle/assets/shellscript-BiGZg9Om.js +1 -0
- package/dist/dashboard-bundle/assets/shellscript-CqHdAlCp.js +1 -0
- package/dist/dashboard-bundle/assets/sql-BOsskAmu.js +1 -0
- package/dist/dashboard-bundle/assets/sql-CNu3Or2W.js +1 -0
- package/dist/dashboard-bundle/assets/svelte-CdeT-Ich.js +1 -0
- package/dist/dashboard-bundle/assets/swift-CyEgAFGc.js +1 -0
- package/dist/dashboard-bundle/assets/toml-CcmNWLt0.js +1 -0
- package/dist/dashboard-bundle/assets/tsx-5f3ulCja.js +1 -0
- package/dist/dashboard-bundle/assets/tsx-BOvsFOI6.js +1 -0
- package/dist/dashboard-bundle/assets/typescript-Utq2Cl8c.js +1 -0
- package/dist/dashboard-bundle/assets/typescript-j_1H8WHN.js +1 -0
- package/dist/dashboard-bundle/assets/vue-BqdMUtqy.js +1 -0
- package/dist/dashboard-bundle/assets/xml-CoDIzWF0.js +1 -0
- package/dist/dashboard-bundle/assets/xml-WY0zc4PG.js +1 -0
- package/dist/dashboard-bundle/assets/yaml-CxbubiML.js +1 -0
- package/dist/dashboard-bundle/assets/yaml-DijMHRDA.js +1 -0
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +3 -3
- package/dist/dashboard-rpc/index.d.ts +2 -1
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +4 -2
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/person.d.ts +5 -0
- package/dist/dashboard-rpc/person.d.ts.map +1 -0
- package/dist/dashboard-rpc/person.js +12 -0
- package/dist/dashboard-rpc/person.js.map +1 -0
- package/dist/dashboard-rpc/reads.d.ts +2 -2
- package/dist/dashboard-rpc/reads.d.ts.map +1 -1
- package/dist/dashboard-rpc/reads.js.map +1 -1
- package/dist/dashboard-rpc/skills.d.ts +22 -19
- package/dist/dashboard-rpc/skills.d.ts.map +1 -1
- package/dist/dashboard-rpc/skills.js +38 -10
- package/dist/dashboard-rpc/skills.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/module-types/dashboard/components/DriverModelMenu.d.ts +11 -1
- package/dist/module-types/dashboard/components/FileIcon.d.ts +2 -1
- package/dist/module-types/dashboard/components/file-icons.generated.d.ts +6 -0
- package/dist/module-types/dashboard/components/ui/row-item.d.ts +9 -0
- package/dist/module-types/dashboard/lib/effort.d.ts +1 -0
- package/dist/module-types/dashboard/lib/format-date.d.ts +2 -0
- package/dist/module-types/dashboard/lib/highlight.d.ts +16 -0
- package/dist/module-types/dashboard/lib/models.d.ts +11 -1
- package/dist/module-types/dashboard/lib/use-narrow.d.ts +6 -0
- package/dist/module-types/dashboard/module/index.d.ts +2 -0
- package/dist/module-types/src/dashboard/person.d.ts +21 -0
- package/dist/module-types/src/dashboard/send-skills.d.ts +50 -0
- package/dist/module-types/src/dashboard-rpc/index.d.ts +2 -1
- package/dist/module-types/src/dashboard-rpc/person.d.ts +4 -0
- package/dist/module-types/src/dashboard-rpc/reads.d.ts +2 -2
- package/dist/module-types/src/dashboard-rpc/skills.d.ts +22 -19
- package/dist/module-types/src/index.d.ts +1 -1
- package/dist/module-types/src/store/agent-store.d.ts +14 -4
- package/dist/module-types/src/store/git-host.d.ts +11 -1
- package/dist/module-types/src/store/index.d.ts +1 -1
- package/dist/module.css +4 -4
- package/dist/store/agent-store.d.ts +14 -4
- package/dist/store/agent-store.d.ts.map +1 -1
- package/dist/store/agent-store.js +10 -11
- package/dist/store/agent-store.js.map +1 -1
- package/dist/store/git-host.d.ts +11 -1
- package/dist/store/git-host.d.ts.map +1 -1
- package/dist/store/git-host.js +14 -0
- package/dist/store/git-host.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/run-record.d.ts.map +1 -1
- package/dist/store/run-record.js +2 -1
- package/dist/store/run-record.js.map +1 -1
- package/package.json +15 -13
- package/dist/dashboard-bundle/assets/main-BpK2OYXg.js +0 -141
- package/dist/dashboard-bundle/assets/main-DYV5aTCD.css +0 -2
- package/dist/dashboard-bundle/assets/module-C6swDbeD.js +0 -24
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-CZI7_Jkm.js";import{t as r}from"./react-dom-cJyBB_A4.js";import{t as i}from"./jsx-runtime-By8HlURe.js";var a=[`claude-code`,`codex`];function o(e){return e!==void 0&&a.includes(e)}var s={"claude-code":`Claude Code`,codex:`Codex`};function c(e){return e===`claude-web`||e===`github-actions`?`claude-code`:o(e)?e:void 0}var l=[`nothing`,`commit`,`branch`,`pr`,`merge`],u={nothing:`Off`,commit:`Commit`,branch:`Publish branch`,pr:`Open PR`,merge:`Merge on green`};function d(e,t=!0){return t?e?l:[`nothing`,`commit`,`branch`]:[`nothing`,`commit`]}function f(e){return e?`branch`:`commit`}function p(e,t,n=!0){return e===void 0?`commit`:d(t,n).includes(e)?e:f(n)}var m={humanIntervention:`notifyHumanIntervention`,newActivity:`notifyNewActivity`},h={browser:!0,categories:{humanIntervention:!0,newActivity:!1}};function g(e){return e.notifyBrowser??h.browser}function _(e,t){return e[m[t]]??h.categories[t]}var v=50;function y(e){try{let t=new URL(e.trim());if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let[n,r]=t.hash.slice(1).split(`.`);return!n||r&&t.protocol!==`https:`?null:{url:t.origin,door:t.origin+t.pathname,code:n,...r?{pin:r}:{}}}catch{return null}}var b=/^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;function x(e){return e===`localhost`||e===`::1`||e===`[::1]`||b.test(e)}function S(e){try{let t=new URL(e);return t.protocol===`http:`&&x(t.hostname)}catch{return!1}}var C=`/_rpc`;function w(e){return async(...t)=>{let n=t.length;for(;n>0&&t[n-1]===void 0;)n--;let r=await fetch(`${C}/${e}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.slice(0,n))}),i=await r.text(),a;try{a=i?JSON.parse(i):{}}catch{throw Error(`${e} got a non-JSON reply (${r.status})`)}if(!r.ok)throw Error(a.error??`${e} failed (${r.status})`);return a.ret}}async function T(e,t){let n=new URLSearchParams({projectId:e,...t?{agentId:t}:{}}),r=new AbortController,i=await fetch(`${C}/events?${n.toString()}`,{signal:r.signal});if(!i.ok||!i.body)throw Error(`could not subscribe to events (${i.status})`);let a,o,s=!1,c=e=>{s||(s=!0,o?.(e))};return(async()=>{let e=i.body.getReader(),t=new TextDecoder,n=``;try{for(;;){let{done:r,value:i}=await e.read();if(r)break;n+=t.decode(i,{stream:!0});let o=n.indexOf(`
|
|
2
|
-
|
|
3
|
-
`);for(;o>=0;o=n.indexOf(`
|
|
4
|
-
|
|
5
|
-
`)){let e=n.slice(0,o);n=n.slice(o+2);let t=e.split(`
|
|
6
|
-
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t)try{a?.(JSON.parse(t))}catch{}}}c()}catch(e){c(r.signal.aborted?void 0:e instanceof Error?e:Error(String(e)))}})(),{listen:e=>{a=e},onClose:e=>{o=e,s&&e()},close:()=>{s||r.abort(),c()}}}var E=`settings`;function D(e){return/^[a-z][a-z0-9]*$/.test(e)}var O=`project`;function k(e){let[t=``,n=``]=e.split(`?`),r=new URLSearchParams(n).get(O),i=r?{scope:r}:{},a=t.split(`/`).filter(Boolean).map(P),[o,s]=a;return o===E?{view:`settings`,projectId:null,agentId:null,...i}:o?D(o)?{projectId:null,agentId:null,page:o,pagePath:a.slice(1),...i}:{projectId:o,agentId:s??null,...r?{scope:o}:{}}:{projectId:null,agentId:null,...i}}function A(e){let t=!e.view&&!e.page?e.projectId:null,n=e.scope?t??e.scope:null;return M(e)+(n?`?${O}=${encodeURIComponent(n)}`:``)}function j(e,t){let[n=``,r=``]=e.split(`?`),i=new URLSearchParams(t);i.delete(O);for(let[e,t]of new URLSearchParams(r))i.set(e,t);let a=i.toString();return a?`${n}?${a}`:n}function M({view:e,projectId:t,agentId:n,page:r,pagePath:i}){if(e===`settings`)return`/${E}`;if(r)return[``,r,...i??[]].map(encodeURIComponent).join(`/`);if(!t)return`/`;let a=encodeURIComponent(t);return n?`/${a}/${encodeURIComponent(n)}`:`/${a}`}function N(e,t=typeof window>`u`?``:window.location.search){let n=new URLSearchParams(t).get(O);return A({projectId:null,agentId:null,page:e,...n?{scope:n}:{}})}function P(e){try{return decodeURIComponent(e)}catch{return e}}function F(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=F(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function I(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=F(e))&&(r&&(r+=` `),r+=t);return r}var L=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,R=I,z=(e,t)=>n=>{if(t?.variants==null)return R(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=L(t)||L(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return R(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},B=`-`,V=e=>{let t=W(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(B);return n[0]===``&&n.length!==1&&n.shift(),ee(n,t)||U(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},ee=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?ee(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(B);return t.validators.find(({validator:e})=>e(a))?.classGroupId},H=/^\[(.+)\]$/,U=e=>{if(H.test(e)){let t=H.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},W=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ie(Object.entries(e.classGroups),n).forEach(([e,n])=>{te(n,r,e,t)}),r},te=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:ne(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(re(e)){te(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{te(i,ne(t,e),n,r)})})},ne=(e,t)=>{let n=e;return t.split(B).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},re=e=>e.isThemeGetter,ie=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,ae=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},oe=`!`,se=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(oe);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},ce=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},le=e=>({cache:ae(e.cacheSize),parseClassName:se(e),...V(e)}),ue=/\s+/,de=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(ue),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=ce(c).join(`:`),h=l?m+oe:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function fe(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=pe(t))&&(r&&(r+=` `),r+=n);return r}var pe=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=pe(e[r]))&&(n&&(n+=` `),n+=t);return n};function me(e,...t){let n,r,i,a=o;function o(o){return n=le(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=de(e,n);return i(e,a),a}return function(){return a(fe.apply(null,arguments))}}var G=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},he=/^\[(?:([a-z-]+):)?(.+)\]$/i,ge=/^\d+\/\d+$/,_e=new Set([`px`,`full`,`screen`]),ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ye=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,be=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Se=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ce=e=>Te(e)||_e.has(e)||ge.test(e),we=e=>Re(e,`length`,ze),Te=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>Re(e,`number`,Te),De=e=>!!e&&Number.isInteger(Number(e)),Oe=e=>e.endsWith(`%`)&&Te(e.slice(0,-1)),ke=e=>he.test(e),Ae=e=>ve.test(e),je=new Set([`length`,`size`,`percentage`]),Me=e=>Re(e,je,Be),Ne=e=>Re(e,`position`,Be),Pe=new Set([`image`,`url`]),Fe=e=>Re(e,Pe,He),Ie=e=>Re(e,``,Ve),Le=()=>!0,Re=(e,t,n)=>{let r=he.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},ze=e=>ye.test(e)&&!be.test(e),Be=()=>!1,Ve=e=>xe.test(e),He=e=>Se.test(e),Ue=me(()=>{let e=G(`colors`),t=G(`spacing`),n=G(`blur`),r=G(`brightness`),i=G(`borderColor`),a=G(`borderRadius`),o=G(`borderSpacing`),s=G(`borderWidth`),c=G(`contrast`),l=G(`grayscale`),u=G(`hueRotate`),d=G(`invert`),f=G(`gap`),p=G(`gradientColorStops`),m=G(`gradientColorStopPositions`),h=G(`inset`),g=G(`margin`),_=G(`opacity`),v=G(`padding`),y=G(`saturate`),b=G(`scale`),x=G(`sepia`),S=G(`skew`),C=G(`space`),w=G(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,ke,t],O=()=>[ke,t],k=()=>[``,Ce,we],A=()=>[`auto`,Te,ke],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,ke],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[Te,ke];return{cacheSize:500,separator:`:`,theme:{colors:[Le],spacing:[Ce,we],blur:[`none`,``,Ae,ke],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,Ae,ke],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Oe,we],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,ke]}],container:[`container`],columns:[{columns:[Ae]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),ke]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,De,ke]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,ke]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,De,ke]}],"grid-cols":[{"grid-cols":[Le]}],"col-start-end":[{col:[`auto`,{span:[`full`,De,ke]},ke]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Le]}],"row-start-end":[{row:[`auto`,{span:[De,ke]},ke]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,ke]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,ke]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,ke,t]}],"min-w":[{"min-w":[ke,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[ke,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[Ae]},Ae]}],h:[{h:[ke,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[ke,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[ke,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[ke,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,Ae,we]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Ee]}],"font-family":[{font:[Le]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,ke]}],"line-clamp":[{"line-clamp":[`none`,Te,Ee]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Ce,ke]}],"list-image":[{"list-image":[`none`,ke]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,ke]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Ce,we]}],"underline-offset":[{"underline-offset":[`auto`,Ce,ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,ke]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,ke]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),Ne]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,Me]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Fe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Ce,ke]}],"outline-w":[{outline:[Ce,we]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Ce,we]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,Ae,Ie]}],"shadow-color":[{shadow:[Le]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,Ae,ke]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,ke]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,ke]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,ke]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[De,ke]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,ke]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,ke]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Ce,we,Ee]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function K(...e){return Ue(I(e))}var q=e(i(),1),We=z(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-[var(--color-primary)] text-[var(--color-primary-foreground)] hover:opacity-90`,outline:`border border-[var(--color-border)] bg-transparent hover:bg-[var(--color-accent)] hover:text-[var(--color-accent-foreground)]`,ghost:`hover:bg-[var(--color-accent)] hover:text-[var(--color-accent-foreground)]`,destructive:`bg-[var(--color-danger)] text-[var(--color-background)] hover:opacity-90`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3`,xs:`h-7 gap-1 px-2 text-xs`,icon:`h-9 w-9`,"icon-sm":`h-7 w-7`}},defaultVariants:{variant:`default`,size:`default`}});function Ge({className:e,variant:t,size:n,...r}){return(0,q.jsx)(`button`,{className:K(We({variant:t,size:n}),e),...r})}var Ke=w(`onMachines`),qe=w(`sendAddMachine`),Je=w(`sendRemoveMachine`),Ye=w(`onMachinesReachable`),Xe=w(`onMachineVersions`),Ze=w(`sendProjectToMachine`),Qe=w(`onProjectOnMachine`),J=e(n(),1),$e=null,et=new Set;function tt(e){if($e!==e){$e=e;for(let e of et)e()}}function nt(){return $e}function rt(e){return et.add(e),()=>et.delete(e)}function it(){return(0,J.useSyncExternalStore)(rt,nt,()=>null)}var at=[],ot=null,st=0,ct=0,lt=!1,ut=new Set;function dt(e){return ut.add(e),()=>ut.delete(e)}function ft(){let e=++st;return ct++,Ke().then(t=>{if(e===st){ot=t;for(let e of ut)e()}},()=>{}).finally(()=>ct--)}function pt(){ot===null&&ct===0&&ft(),!(lt||typeof window>`u`)&&(lt=!0,window.addEventListener(`focus`,()=>void ft()))}async function mt(e,t){let n=await qe(e,t);return n.ok&&await ft(),n}async function ht(e){let t=await Je(e).catch(()=>({ok:!1,error:`The machine could not be removed.`}));return t.ok&&nt()===e&&tt(null),await ft(),t}function gt(){let e=(0,J.useSyncExternalStore)(dt,()=>ot??at,()=>at);return(0,J.useEffect)(pt,[]),e}var _t=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},bt=(0,J.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,J.createElement)(`svg`,{ref:c,...yt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vt(`lucide`,i),...s},[...o.map(([e,t])=>(0,J.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xt=(e,t)=>{let n=(0,J.forwardRef)(({className:n,...r},i)=>(0,J.createElement)(bt,{ref:i,iconNode:t,className:vt(`lucide-${_t(e)}`,n),...r}));return n.displayName=`${e}`,n},St=xt(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ct=xt(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wt=xt(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Tt=xt(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Et=xt(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Dt=xt(`FileCode`,[[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}]]),Ot=xt(`FileCog`,[[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3.2 12.9-.9-.4`,key:`1i3dj5`}],[`path`,{d:`m3.2 15.1-.9.4`,key:`1fvgj0`}],[`path`,{d:`M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5`,key:`1yo3oz`}],[`path`,{d:`m4.9 11.2-.4-.9`,key:`otmhb9`}],[`path`,{d:`m4.9 16.8-.4.9`,key:`1b8z07`}],[`path`,{d:`m7.5 10.3-.4.9`,key:`11k65u`}],[`path`,{d:`m7.5 17.7-.4-.9`,key:`431x55`}],[`path`,{d:`m9.7 12.5-.9.4`,key:`87sjan`}],[`path`,{d:`m9.7 15.5-.9-.4`,key:`khqm91`}],[`circle`,{cx:`6`,cy:`14`,r:`3`,key:`a1xfv6`}]]),kt=xt(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),At=xt(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),jt=xt(`FileTerminal`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),Mt=xt(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Nt=xt(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),Pt=xt(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ft=xt(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function It(e){if(!e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function Lt(e,t=`—`){let n=It(e);return n?n.toLocaleString():t}function Rt(e,t=`—`){let n=It(e);return n?n.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):t}function zt(e,t=`—`){let n=It(e);if(!n)return t;let r=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:o<365?`${Math.floor(o/7)}w ago`:`${Math.floor(o/365)}y ago`}function Bt(e,t=`—`){let n=It(e);if(!n)return t;let r=Math.round((Date.now()-n.getTime())/1e3);if(r<60)return`just now`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);if(a<24)return`${a}h ago`;let o=Math.round(a/24);return o<=7?`${o}d ago`:n.toLocaleDateString()}function Vt(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function Ht(e,t){return`${e} ${t}${e===1?``:`s`}`}function Ut(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return Ht(t,`second`);let n=Math.floor(t/60);if(n<60)return Ht(n,`minute`);let r=Math.floor(n/60);return r<24?Ht(r,`hour`):Ht(Math.floor(r/24),`day`)}function Wt(e){return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}).toLowerCase().replace(/\s+/g,``)}function Gt(e){let t=new Date(e);return`${t.toLocaleDateString(void 0,{weekday:`long`})} ${Wt(t)}`}function Kt(e){let t=new Date(e),n=t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),r=Intl.DateTimeFormat().resolvedOptions().timeZone;return`Quota resets on ${n}, ${Wt(t)} (${r})`}function qt(){let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(null);return{busy:e,error:n,reset:(0,J.useCallback)(()=>r(null),[]),run:(0,J.useCallback)(async(e,n=`Something went wrong.`)=>{t(!0),r(null);try{let t=await e();return Jt(t)?(r(t.error??n),{ok:!1}):{ok:!0,value:t}}catch(e){return r(e instanceof Error?e.message:n),{ok:!1}}finally{t(!1)}},[])}}function Jt(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1}function Yt({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:K(`flex h-9 w-full min-w-0 rounded-md border border-border bg-transparent px-3 py-1 text-sm shadow-sm outline-none transition-colors`,`placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function Xt({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(t);return[i?e:a,J.useCallback(e=>{i||o(e)},[])]}var Zt={};function Qt(e,t){let n=J.useRef(Zt);return n.current===Zt&&(n.current=e(t)),n}function $t(e,t,n,r){let i=Qt(tn).current;return nn(i,e,t,n,r)&&an(i,[e,t,n,r]),i.callback}function en(e){let t=Qt(tn).current;return rn(t,e)&&an(t,e),t.callback}function tn(){return{callback:null,cleanup:null,refs:[]}}function nn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function rn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function an(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var on=J[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],sn=on&&on!==J.useLayoutEffect?on:e=>e();function Y(e){let t=Qt(cn).current;return t.next=e,sn(t.effect),t.trampoline}function cn(){let e={next:void 0,callback:ln,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ln(){}var un={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function dn(){}var fn=Object.freeze([]),pn=Object.freeze({}),mn={...J},hn=0;function gn(e,t=`mui`){let[n,r]=J.useState(e),i=e||n;return J.useEffect(()=>{n??(hn+=1,r(`${t}-${hn}`))},[n,t]),i}var _n=mn.useId;function vn(e,t){if(_n!==void 0){let n=_n();return e??(t?`${t}-${n}`:n)}return gn(e,t)}function yn(e){return vn(e,`base-ui`)}function bn(){return typeof window<`u`}function xn(e){return wn(e)?(e.nodeName||``).toLowerCase():`#document`}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){return((wn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function wn(e){return bn()?e instanceof Node||e instanceof Sn(e).Node:!1}function Tn(e){return bn()?e instanceof Element||e instanceof Sn(e).Element:!1}function En(e){return bn()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function Dn(e){return!bn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}function On(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function kn(e){return/^(table|td|th)$/.test(xn(e))}function An(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var jn=/transform|translate|scale|rotate|perspective|filter/,Mn=/paint|layout|strict|content/,Nn=e=>!!e&&e!==`none`,Pn;function Fn(e){let t=Tn(e)?zn(e):e;return Nn(t.transform)||Nn(t.translate)||Nn(t.scale)||Nn(t.rotate)||Nn(t.perspective)||!Ln()&&(Nn(t.backdropFilter)||Nn(t.filter))||jn.test(t.willChange||``)||Mn.test(t.contain||``)}function In(e){let t=Vn(e);for(;En(t)&&!Rn(t);){if(Fn(t))return t;if(An(t))return null;t=Vn(t)}return null}function Ln(){return Pn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Pn}function Rn(e){return/^(html|body|#document)$/.test(xn(e))}function zn(e){return Sn(e).getComputedStyle(e)}function Bn(e){return Tn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vn(e){if(xn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dn(e)&&e.host||Cn(e);return Dn(t)?t.host:t}function Hn(e){let t=Vn(e);return Rn(t)?(e.ownerDocument||e).body:En(t)&&On(t)?t:Hn(t)}function Un(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hn(e),i=r===e.ownerDocument?.body,a=Sn(r);if(i){let e=Wn(a);return t.concat(a,a.visualViewport||[],On(r)?r:[],e&&n?Un(e):[])}else return t.concat(r,Un(r,[],n))}function Wn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Gn=typeof navigator<`u`,Kn=tr(),qn=rr(),Jn=nr(),Yn=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Xn=Kn.platform===`MacIntel`&&Kn.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Kn.platform);Gn&&/firefox/i.test(Jn);var Zn=Gn&&/apple/i.test(navigator.vendor);Gn&&/Edg/i.test(Jn);var Qn=Gn&&/android/i.test(qn)||/android/i.test(Jn),$n=Gn&&qn.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,er=Jn.includes(`jsdom/`);function tr(){if(!Gn)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function nr(){if(!Gn)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function rr(){if(!Gn)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var ir=`data-base-ui-focusable`,ar=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,or=`ArrowLeft`,sr=`ArrowRight`,cr=`ArrowUp`,lr=`ArrowDown`;function ur(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function dr(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Dn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function fr(e){return`composedPath`in e?e.composedPath()[0]:e.target}function pr(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function mr(e){return e.matches(`html,body`)}function hr(e){return e?.ownerDocument||document}function gr(e){return En(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function _r(e){return e?e.getAttribute(`role`)===`combobox`&&gr(e):!1}function vr(e){if(!e||er)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function yr(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var br=e(r());function xr(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...xr(e,t.id,n)])}function Sr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Cr(e){e.preventDefault(),e.stopPropagation()}function wr(e){return`nativeEvent`in e}function Tr(e){return e.mozInputSource===0&&e.isTrusted?!0:Qn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Er(e){return er?!1:!Qn&&e.width===0&&e.height===0||Qn&&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 Dr(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Or(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function kr(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var Ar=[`top`,`right`,`bottom`,`left`],jr=Math.min,Mr=Math.max,Nr=Math.round,Pr=Math.floor,Fr=e=>({x:e,y:e}),Ir={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Lr(e,t,n){return Mr(e,jr(t,n))}function Rr(e,t){return typeof e==`function`?e(t):e}function zr(e){return e.split(`-`)[0]}function Br(e){return e.split(`-`)[1]}function Vr(e){return e===`x`?`y`:`x`}function Hr(e){return e===`y`?`height`:`width`}function Ur(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Wr(e){return Vr(Ur(e))}function Gr(e,t,n){n===void 0&&(n=!1);let r=Br(e),i=Wr(e),a=Hr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ei(o)),[o,ei(o)]}function Kr(e){let t=ei(e);return[qr(e),t,qr(t)]}function qr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Jr=[`left`,`right`],Yr=[`right`,`left`],Xr=[`top`,`bottom`],Zr=[`bottom`,`top`];function Qr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yr:Jr:t?Jr:Yr;case`left`:case`right`:return t?Xr:Zr;default:return[]}}function $r(e,t,n,r){let i=Br(e),a=Qr(zr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qr)))),a}function ei(e){let t=zr(e);return Ir[t]+e.slice(t.length)}function ti(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ni(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ti(e)}function ri(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ii(e,t,n){return Math.floor(e/t)!==n}function ai(e,t){return t<0||t>=e.current.length}function oi(e,t){return ci(e,{disabledIndices:t})}function si(e,t){return ci(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ci(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&pi(e,a,r));return a}function li(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!pi(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===`ArrowUp`){let n=g(`up`);if(n!==void 0)u&&Cr(t),d=n;else{if(u&&Cr(t),l===-1)d=c;else if(d=ci(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}ai(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&Cr(t),l===-1?d=s:(d=ci(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=ci(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),ai(e,d)&&(d=l)):(u&&Cr(t),d=n)}if(n===`both`){let n=Pr(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&Cr(t),l%a===a-1?r&&(d=ci(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=ci(e,{startingIndex:l,disabledIndices:o}),r&&ii(d,a,n)&&(d=ci(e,{startingIndex:l-l%a-1,disabledIndices:o}))),ii(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&Cr(t),l%a===0?r&&(d=ci(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=ci(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&ii(d,a,n)&&(d=ci(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),ii(d,a,n)&&(d=l));let s=Pr(c/a)===n;ai(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:ci(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function ui(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function di(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function fi(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function pi(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var mi=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[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] *)`].join(`,`),hi=typeof Element>`u`,gi=hi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_i=!hi&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},vi=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):vi(e.parentNode))},yi=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},bi=function(e,t,n){if(vi(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(mi));return t&&gi.call(e,mi)&&r.unshift(e),r=r.filter(n),r},xi=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!vi(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=xi(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{gi.call(a,mi)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!vi(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=xi(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Si=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Ci=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||yi(e))&&!Si(e)?0:e.tabIndex},wi=function(e,t){var n=Ci(e);return n<0&&t&&!Si(e)?0:n},Ti=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ei=function(e){return e.tagName===`INPUT`},Di=function(e){return Ei(e)&&e.type===`hidden`},Oi=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},ki=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Ai=function(e){if(!e.name)return!0;var t=e.form||_i(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){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`,e.message),!1}var i=ki(r,e.form);return!i||i===e},ji=function(e){return Ei(e)&&e.type===`radio`},Mi=function(e){return ji(e)&&!Ai(e)},Ni=function(e){var t=e&&_i(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=_i(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Pi=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Fi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=gi.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(gi.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=_i(e);if(s&&!s.shadowRoot&&r(s)===!0)return Pi(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(Ni(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Pi(e);return!1},Ii=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return gi.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Li=function(e,t){return!(t.disabled||Di(t)||Fi(t,e)||Oi(t)||Ii(t))},Ri=function(e,t){return!(Mi(t)||Ci(t)<0||!Li(e,t))},zi=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Bi=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=wi(a,i),s=i?Bi(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Ti).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Vi=function(e,t){return t||={},Bi(t.getShadowRoot?xi([e],t.includeContainer,{filter:Ri.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:zi}):bi(e,t.includeContainer,Ri.bind(null,t)))},Hi=function(e,t){return t||={},t.getShadowRoot?xi([e],t.includeContainer,{filter:Li.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):bi(e,t.includeContainer,Li.bind(null,t))},Ui=function(e,t){if(t||={},!e)throw Error(`No node provided`);return gi.call(e,mi)!==!1&&Ri(t,e)},Wi=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Gi(e,t){let n=Vi(e,Wi()),r=n.length;if(r===0)return;let i=ur(hr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ki(e){return Gi(hr(e).body,1)||e}function qi(e){return Gi(hr(e).body,-1)||e}function Ji(e,t){if(!e)return null;let n=Vi(hr(e).body,Wi()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Yi(e){return Ji(e,1)}function Xi(e){return Ji(e,-1)}function Zi(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!dr(n,r)}function Qi(e){Vi(e,Wi()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function $i(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var ea=`ArrowUp`,ta=`ArrowDown`,na=`ArrowLeft`,ra=`ArrowRight`,ia=`Home`,aa=new Set([na,ra]),oa=new Set([na,ra,ia,`End`]),sa=new Set([ea,ta]),ca=new Set([ea,ta,ia,`End`]),la=new Set([...aa,...sa]),ua=new Set([...la,ia,`End`]),da=new Set([ea,ta,na,ra,ia,`End`]),fa=`Shift`,pa=new Set([fa,`Control`,`Alt`,`Meta`]);function ma(e){return En(e)&&e.tagName===`INPUT`}function ha(e){return!!(ma(e)&&e.selectionStart!=null||En(e)&&e.tagName===`TEXTAREA`)}function ga(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=_a(e,t,`left`),a=va(e),o=va(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=_a(e,t,`top`),r=va(e),i=va(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function _a(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function va(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var X=typeof document<`u`?J.useLayoutEffect:()=>{},ya=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ba(){return J.useContext(ya)}function xa(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Y(i),o=J.useRef(0),s=Qt(Ca).current,c=Qt(Sa).current,[l,u]=J.useState(0),d=J.useRef(l),f=Y((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=Y(e=>{c.delete(e),d.current+=1,u(d.current)}),m=J.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(wa).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);X(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),X(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),X(()=>()=>{n.current=[]},[n]),X(()=>()=>{r&&(r.current=[])},[r]);let h=Y(e=>(s.add(e),()=>{s.delete(e)}));X(()=>{s.forEach(e=>e(m))},[s,m]);let g=J.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,q.jsx)(ya.Provider,{value:g,children:t})}function Sa(){return new Map}function Ca(){return new Set}function wa(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function Ta(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Ea=`data-composite-item-active`,Da=[];function Oa(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d=!1,disabledIndices:f,modifierKeys:p=Da}=e,[m,h]=J.useState(0),g=n>1,_=J.useRef(null),v=$t(_,l),y=J.useRef([]),b=J.useRef(!1),x=s??m,S=Y((e,t=!1)=>{if((c??h)(e),t){let t=y.current[e];ga(_.current,t,o,a)}}),C=Y(e=>{if(e.size===0||b.current)return;b.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&S(r),ga(_.current,n,o,a)}),w=J.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:v,onFocus(e){!_.current||!ha(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let s=u?ua:la;if(!s.has(e.key)||ka(e,p)||!_.current)return;let c=o===`rtl`,l=c?na:ra,m={horizontal:l,vertical:ta,both:l}[a],h=c?ra:na,v={horizontal:h,vertical:ea,both:h}[a];if(ha(e.target)&&!Ta(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==m&&t>0)return}let b=x,C=oi(y,f),w=si(y,f);if(g){let o=t||Array.from({length:y.current.length},()=>({width:1,height:1})),s=ui(o,n,i),l=s.findIndex(e=>e!=null&&!pi(y,e,f)),u=s.reduce((e,t,n)=>t!=null&&!pi(y,t,f)?n:e,-1);b=s[li({current:s.map(e=>e?y.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:fi([...f||y.current.map((e,t)=>pi(y,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:di(x>w?C:x,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[ta],both:[l,ta]}[a],E={horizontal:[h],vertical:[ea],both:[h,ea]}[a],D=g?s:{horizontal:u?oa:aa,vertical:u?ca:sa,both:s}[a];u&&(e.key===`Home`?b=C:e.key===`End`&&(b=w)),b===x&&(T.includes(e.key)||E.includes(e.key))&&(b=r&&b===w&&T.includes(e.key)?C:r&&b===C&&E.includes(e.key)?w:ci(y,{startingIndex:b,decrement:E.includes(e.key),disabledIndices:f})),b!==x&&!ai(y,b)&&(d&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))}}),[n,i,o,f,y,u,x,g,t,r,v,p,S,a,d]);return J.useMemo(()=>({props:w,highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:y,disabledIndices:f,onMapChange:C,relayKeyboardEvent:w.onKeyDown}),[w,x,S,y,f,C])}function ka(e,t){for(let n of pa.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var Aa=J.createContext(void 0);function ja(e=!1){let t=J.useContext(Aa);if(t===void 0&&!e)throw Error(kr(16));return t}var Ma=19;function Na(e){return Ma>=e}function Pa(e){if(!J.isValidElement(e))return null;let t=e,n=t.props;return(Na(19)?n?.ref:t.ref)??null}function Fa(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ia(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function La(e,t){return typeof e==`function`?e(t):e}function Ra(e,t){return typeof e==`function`?e(t):e}var za={};function Ba(e,t,n,r,i){let a={...Ka(e,za)};return t&&(a=Ha(a,t)),n&&(a=Ha(a,n)),r&&(a=Ha(a,r)),i&&(a=Ha(a,i)),a}function Va(e){if(e.length===0)return za;if(e.length===1)return Ka(e[0],za);let t={...Ka(e[0],za)};for(let n=1;n<e.length;n+=1)t=Ha(t,e[n]);return t}function Ha(e,t){return Ga(t)?t(e):Ua(e,t)}function Ua(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Fa(e.style,r);break;case`className`:e[n]=Ya(e.className,r);break;default:Wa(n,r)?e[n]=qa(e[n],r):e[n]=r}}return e}function Wa(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ga(e){return typeof e==`function`}function Ka(e,t){return Ga(e)?e(t):e??za}function qa(e,t){return t?e?n=>{if(Xa(n)){let r=n;Ja(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function Ja(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ya(e,t){return t?e?t+` `+e:t:e}function Xa(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var Za={style:{transition:`none`}},Qa=`data-base-ui-click-trigger`,$a={fallbackAxisSide:`none`},eo={fallbackAxisSide:`end`},to={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Z(e,t,n={}){let r=t.render,i=no(t,n);return n.enabled===!1?null:ro(e,r,i,n.state??pn)}function no(e,t={}){let{className:n,style:r,render:i}=e,{state:a=pn,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?La(n,a):void 0,d=l?Ra(r,a):void 0,f=l?Ia(a,c):pn,p=l?Fa(f,Array.isArray(s)?Va(s):s)??pn:pn;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=en([p.ref,Pa(i),...o]):p.ref=$t(p.ref,Pa(i),o):$t(null,null)),l?(u!==void 0&&(p.className=Ya(p.className,u)),d!==void 0&&(p.style=Fa(p.style,d)),p):pn}function ro(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ba(n,t.props);return e.ref=n.ref,J.cloneElement(t,e)}if(e&&typeof e==`string`)return io(e,n);throw Error(kr(8))}function io(e,t){return e===`button`?(0,J.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,J.createElement)(`img`,{alt:``,...t,key:t.key}):J.createElement(e,t)}var ao=J.createContext(void 0);function oo(){return J.useContext(ao)?.direction??`ltr`}function so(e){let{render:t,className:n,refs:r=fn,props:i=fn,state:a=pn,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:c,orientation:l,dense:u,itemSizes:d,loopFocus:f,cols:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=Oa({itemSizes:d,cols:p,loopFocus:f,dense:u,orientation:l,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:oo(),disabledIndices:v,modifierKeys:y}),k=Z(x,e,{state:a,ref:r,props:[C,...i,S],stateAttributesMapping:o}),A=J.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,q.jsx)(Aa.Provider,{value:A,children:(0,q.jsx)(xa,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}function co(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var lo=J.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:dn,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function uo(){return J.useContext(lo)}var fo=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}({}),po={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mo={valid(e){return e===null?null:e?{[fo.valid]:``}:{[fo.invalid]:``}}},ho=J.createContext({invalid:void 0,name:void 0,validityData:{state:po,errors:[],error:``,value:``,initialValue:null},setValidityData:dn,disabled:void 0,touched:!1,setTouched:dn,dirty:!1,setDirty:dn,filled:!1,setFilled:dn,focused:!1,setFocused:dn,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=pn)=>e,getInputValidationProps:(e=pn)=>e,inputRef:{current:null},commit:async()=>{}}});function go(e=!0){let t=J.useContext(ho);if(t.setValidityData===dn&&!e)throw Error(kr(28));return t}function _o(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=uo(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=go(),f=Y(e.getValue);X(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),X(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:co(u,c),validate(){let e=n;e===void 0&&(e=f()),l.current=!0,br.flushSync(()=>o(e))}})},[o,a,t,s,f,r,c,l,i,u,n]),X(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var vo=J.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function yo(e=!1){let t=J.useContext(vo);if(!t&&!e)throw Error(kr(86));return t}var bo=J.createContext({controlId:void 0,setControlId:dn,labelId:void 0,setLabelId:dn,messageIds:[],setMessageIds:dn,getDescriptionProps:e=>e});function xo(){return J.useContext(bo)}function So(e,t){let n=J.useRef(e),r=Y(t);X(()=>{n.current!==e&&r(n.current)},[e,r]),X(()=>{n.current=e},[e])}var Co=J.createContext({disabled:void 0,readOnly:void 0,required:void 0,name:void 0,checkedValue:``,setCheckedValue:dn,onValueChange:dn,touched:!1,setTouched:dn,registerControlRef:dn});function wo(){return J.useContext(Co)}var To=[fa],Eo=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,name:u,inputRef:d,id:f,...p}=e,{setTouched:m,setFocused:h,shouldValidateOnChange:g,validationMode:_,name:v,disabled:y,state:b,validation:x,setDirty:S,setFilled:C,validityData:w}=go(),{labelId:T}=xo(),{clearErrors:E}=uo(),D=yo(!0),O=y||i,k=v??u,A=yn(f),[j,M]=Xt({controlled:c,default:l,name:`RadioGroup`,state:`value`}),N=Y(s),P=Y((e,t)=>{N(e,t),!t.isCanceled&&M(e)}),F=J.useRef(null),I=Y(e=>{F.current==null&&e!=null&&(F.current=e)});_o({id:A,commit:x.commit,value:j,controlRef:F,name:k,getValue:()=>j??null}),So(j,()=>{E(k),S(j!==w.initialValue),C(j!=null),g()?x.commit(j):x.commit(j,!0)});let[L,R]=J.useState(!1),z=Y(e=>{dr(e.currentTarget,e.relatedTarget)||(m(!0),h(!1),_===`onBlur`&&x.commit(j))}),B=Y(e=>{e.key.startsWith(`Arrow`)&&(m(!0),R(!0),h(!0))}),V=J.useMemo(()=>j==null?``:typeof j==`string`?j:JSON.stringify(j),[j]),ee=Ba({value:V,ref:$t(x.inputRef,d),id:A,name:V?k:void 0,disabled:O,readOnly:a,required:o,"aria-labelledby":p[`aria-labelledby`]??D?.legendId,"aria-hidden":!0,tabIndex:-1,style:un,onChange:dn,onFocus(){F.current?.focus()}},x.getInputValidationProps),H=J.useMemo(()=>({...b,disabled:O??!1,required:o??!1,readOnly:a??!1}),[b,O,a,o]),U=J.useMemo(()=>({...b,checkedValue:j,disabled:O,validation:x,name:k,onValueChange:N,readOnly:a,registerControlRef:I,required:o,setCheckedValue:P,setTouched:R,touched:L}),[j,O,x,b,k,N,a,I,o,P,R,L]),W={role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":O||void 0,"aria-readonly":a||void 0,"aria-labelledby":T,onFocus(){h(!0)},onBlur:z,onKeyDownCapture:B};return(0,q.jsxs)(Co.Provider,{value:U,children:[(0,q.jsx)(so,{render:n,className:r,state:H,props:[W,x.getValidationProps,p],refs:[t],stateAttributesMapping:mo,enableHomeAndEndKeys:!1,modifierKeys:To}),(0,q.jsx)(`input`,{...ee})]})}),Do=`none`,Oo=`trigger-press`,ko=`trigger-hover`,Ao=`trigger-focus`,jo=`outside-press`,Mo=`item-press`,No=`close-press`,Po=`track-press`,Fo=`input-change`,Io=`focus-out`,Lo=`escape-key`,Ro=`list-navigation`,zo=`keyboard`,Bo=`drag`,Vo=`cancel-open`,Ho=`sibling-open`,Uo=`disabled`,Wo=`imperative-action`,Go=`window-resize`;function Q(e,t,n,r){let i=!1,a=!1,o=r??pn;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Ko(e,t,n){let r=n??pn;return{reason:e,event:t??new Event(`base-ui`),...r}}var qo=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Jo={[qo.startingStyle]:``},Yo={[qo.endingStyle]:``},Xo={transitionStatus(e){return e===`starting`?Jo:e===`ending`?Yo:null}},Zo=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,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}({}),Qo={checked(e){return e?{[Zo.checked]:``}:{[Zo.unchecked]:``}},...Xo,...mo};function $o(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:J.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function es(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=J.useRef(null),o=ja(!0)!==void 0,s=Y(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=$o({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=J.useCallback(()=>{let e=a.current;ts(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return X(l,[l]),{getButtonProps:J.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return Ba({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ja(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(Ja(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:Y(e=>{a.current=e,l()})}}function ts(e){return En(e)&&e.tagName===`BUTTON`}var ns=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function rs(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=ba(),f=J.useRef(-1),[p,m]=J.useState(a??(i===ns.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=J.useRef(null),g=J.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return X(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),X(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),J.useMemo(()=>({ref:g,index:p}),[p,g])}function is(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ja(),{ref:i,index:a}=rs(e),o=n===a,s=J.useRef(null),c=$t(i,s);return{compositeProps:J.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function as(e){let{render:t,className:n,state:r=pn,props:i=fn,refs:a=fn,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=is({metadata:o});return Z(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}var os=J.createContext({disabled:!1});function ss(){return J.useContext(os)}function cs(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=xo(),o=yn(t);return X(()=>{if(!(!n&&!t||a===dn)){if(n){let e=r?.current;Tn(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}var ls=J.createContext(void 0);function us(){let e=J.useContext(ls);if(e===void 0)throw Error(kr(52));return e}var ds=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,value:s,inputRef:c,nativeButton:l=!1,id:u,...d}=e,{disabled:f,readOnly:p,required:m,checkedValue:h,setCheckedValue:g,touched:_,setTouched:v,validation:y,registerControlRef:b}=wo(),{setDirty:x,validityData:S,setTouched:C,setFilled:w,state:T,disabled:E}=go(),D=ss(),{labelId:O,getDescriptionProps:k}=xo(),A=E||D.disabled||f||i,j=p||a,M=m||o,N=h===s,P=J.useRef(null),F=J.useRef(null),I=$t(c,F);X(()=>{F.current?.checked&&w(!0)},[w]);let L=yn(),R=cs({id:u,implicit:!1,controlRef:P}),z={role:`radio`,"aria-checked":N,"aria-required":M||void 0,"aria-disabled":A||void 0,"aria-readonly":j||void 0,"aria-labelledby":O,[Ea]:N?``:void 0,id:L,disabled:A,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){e.defaultPrevented||A||j||(e.preventDefault(),F.current?.click())},onFocus(e){e.defaultPrevented||A||j||!_||(F.current?.click(),v(!1))}},{getButtonProps:B,buttonRef:V}=es({disabled:A,native:l}),ee=J.useMemo(()=>({type:`radio`,ref:I,id:R,tabIndex:-1,style:un,"aria-hidden":!0,disabled:A,checked:N,required:M,readOnly:j,onChange(e){if(e.nativeEvent.defaultPrevented||A||j||s===void 0)return;let t=Q(Do,e.nativeEvent);t.isCanceled||(C(!0),x(s!==S.initialValue),w(!0),g(s,t))},onFocus(){P.current?.focus()}}),[N,A,R,I,j,M,g,x,C,w,S.initialValue,s]),H=J.useMemo(()=>({...T,required:M,disabled:A,readOnly:j,checked:N}),[T,A,j,N,M]),U=J.useMemo(()=>H,[H]),W=g!==dn,te=[t,b,P,V],ne=[z,k,y?.getValidationProps??pn,d,B],re=Z(`span`,e,{enabled:!W,state:H,ref:te,props:ne,stateAttributesMapping:Qo});return(0,q.jsxs)(ls.Provider,{value:U,children:[W?(0,q.jsx)(as,{tag:`span`,render:n,className:r,state:H,refs:te,props:ne,stateAttributesMapping:Qo}):re,(0,q.jsx)(`input`,{...ee})]})});function fs(e){let t=Qt(ps,e).current;return t.next=e,X(t.effect),t}function ps(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ms=[];function hs(e){J.useEffect(e,ms)}var gs=null;globalThis.requestAnimationFrame;var _s=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},vs=class e{static create(){return new e}static request(e){return _s.request(e)}static cancel(e){return _s.cancel(e)}currentId=gs;request(e){this.cancel(),this.currentId=_s.request(()=>{this.currentId=gs,e()})}cancel=()=>{this.currentId!==gs&&(_s.cancel(this.currentId),this.currentId=gs)};disposeEffect=()=>this.cancel};function ys(){let e=Qt(vs.create).current;return hs(e.disposeEffect),e}function bs(e){return e==null?e:`current`in e?e.current:e}function xs(e,t=!1,n=!0){let r=ys();return Y((i,a=null)=>{r.cancel();let o=bs(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||br.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;br.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function Ss(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=fs(n),o=Y(i),s=xs(r,n);J.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function Cs(e,t=!1,n=!1){let[r,i]=J.useState(e&&t?`idle`:void 0),[a,o]=J.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),X(()=>{if(!e&&a&&r!==`ending`&&n){let e=vs.request(()=>{i(`ending`)});return()=>{vs.cancel(e)}}},[e,a,r,n]),X(()=>{if(!e||t)return;let n=vs.request(()=>{br.flushSync(()=>{i(void 0)})});return()=>{vs.cancel(n)}},[t,e]),X(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=vs.request(()=>{i(`idle`)});return()=>{vs.cancel(n)}},[t,e,a,i,r]),J.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var ws=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=us(),s=o.checked,{transitionStatus:c,setMounted:l}=Cs(s),u=J.useMemo(()=>({...o,transitionStatus:c}),[o,c]),d=J.useRef(null),f=i||s,p=Z(`span`,e,{enabled:f,ref:[t,d],state:u,props:a,stateAttributesMapping:Qo});return Ss({open:s,ref:d,onComplete(){s||l(!1)}}),f?p:null});function Ts({className:e,disabled:t=!1,onKeyDown:n,...r}){return(0,q.jsx)(Eo,{"data-slot":`radio-group`,disabled:t,className:K(`grid gap-2`,e),onKeyDown:e=>{e.target.closest(`[role="radio"]`)||e.preventBaseUIHandler(),n?.(e)},...r})}function Es({className:e,disabled:t,...n}){return(0,q.jsx)(ds,{"data-slot":`radio-group-item`,...t===void 0?{}:{disabled:t},className:K(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-transparent`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(ws,{className:`h-2 w-2 rounded-full bg-primary`})})}function Ds({value:e,disabled:t,className:n,children:r}){let i=(0,J.useId)();return(0,q.jsxs)(`label`,{id:i,"data-slot":`radio-group-option`,className:K(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm leading-snug has-[[data-disabled]]:opacity-50`,n),children:[(0,q.jsx)(Es,{value:e,disabled:t,"aria-labelledby":i}),r]})}var Os=J.createContext(void 0);function ks(e){let t=J.useContext(Os);if(t===void 0&&!e)throw Error(kr(33));return t}var As=J.createContext(void 0);function js(e){let t=J.useContext(As);if(t===void 0&&!e)throw Error(kr(36));return t}var Ms=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=qo.startingStyle]=`startingStyle`,e[e.endingStyle=qo.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),Ns=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Ps={[Ns.popupOpen]:``},Fs={[Ns.popupOpen]:``,[Ns.pressed]:``},Is={[Ms.open]:``},Ls={[Ms.closed]:``},Rs={[Ms.anchorHidden]:``},zs={open(e){return e?Ps:null}},Bs={open(e){return e?Fs:null}},Vs={open(e){return e?Is:Ls},anchorHidden(e){return e?Rs:null}},Hs=J.createContext(void 0);function Us(e=!0){let t=J.useContext(Hs);if(t===void 0&&!e)throw Error(kr(25));return t}var Ws=J.createContext(void 0);function Gs(){let e=J.useContext(Ws);if(e===void 0)throw Error(kr(30));return e}var Ks={type:`regular-item`};function qs(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:o,itemMetadata:s,nodeId:c}=e,l=J.useRef(null),u=Us(!0),d=u!==void 0,{events:f}=a.useState(`floatingTreeRoot`),{getButtonProps:p,buttonRef:m}=es({disabled:n,focusableWhenDisabled:!0,native:o}),h=J.useCallback(e=>Ba({id:i,role:`menuitem`,tabIndex:r?0:-1,onMouseMove(e){c&&f.emit(`itemhover`,{nodeId:c,target:e.currentTarget})},onMouseEnter(){s.type===`submenu-trigger`&&s.setActive()},onKeyUp(e){e.key===` `&&a.context.typingRef.current&&e.preventBaseUIHandler()},onClick(e){t&&f.emit(`close`,{domEvent:e,reason:Mo})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1)return}l.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&s.type===`regular-item`&&l.current.click()}},e,p),[i,r,p,t,f,a,d,u,s,c]),g=$t(l,m);return J.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var Js=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),Ys={checked(e){return e?{[Js.checked]:``}:{[Js.unchecked]:``}},...Xo},Xs=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,...f}=e,p=rs({label:a}),m=ks(!0),h=yn(i),{store:g}=js(),_=g.useState(`isActive`,p.index),v=g.useState(`itemProps`),[y,b]=Xt({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:x,itemRef:S}=qs({closeOnClick:c,disabled:s,highlighted:_,id:h,store:g,nativeButton:o,nodeId:m?.nodeId,itemMetadata:Ks}),C=J.useMemo(()=>({disabled:s,highlighted:_,checked:y}),[s,_,y]),w=Z(`div`,e,{state:C,stateAttributesMapping:Ys,props:[v,{role:`menuitemcheckbox`,"aria-checked":y,onClick:Y(e=>{let t={...Q(Mo,e.nativeEvent),preventUnmountOnClose:()=>{}};d?.(!y,t),!t.isCanceled&&b(e=>!e)})},f,x],ref:[S,t,p.ref]});return(0,q.jsx)(Ws.Provider,{value:C,children:w})}),Zs=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=Gs(),s=J.useRef(null),{transitionStatus:c,setMounted:l}=Cs(o.checked);return Ss({open:o.checked,ref:s,onComplete(){o.checked||l(!1)}}),Z(`span`,e,{state:J.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:c}),[o.checked,o.disabled,o.highlighted,c]),ref:[t,s],stateAttributesMapping:Ys,props:{"aria-hidden":!0,...a},enabled:i||o.checked})}),Qs=J.createContext(void 0);function $s(){let e=J.useContext(Qs);if(e===void 0)throw Error(kr(31));return e}var ec=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,[a,o]=J.useState(void 0),s=J.useMemo(()=>({setLabelId:o}),[o]),c=Z(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":a,...i}});return(0,q.jsx)(Qs.Provider,{value:s,children:c})}),tc=J.forwardRef(function(e,t){let{className:n,render:r,id:i,...a}=e,o=yn(i),{setLabelId:s}=$s();return X(()=>(s(o),()=>{s(void 0)}),[s,o]),Z(`div`,e,{ref:t,props:{id:o,role:`presentation`,...a}})}),nc=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,...l}=e,u=rs({label:a}),d=ks(!0),f=yn(i),{store:p}=js(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),{getItemProps:g,itemRef:_}=qs({closeOnClick:c,disabled:s,highlighted:m,id:f,store:p,nativeButton:o,nodeId:d?.nodeId,itemMetadata:Ks});return Z(`div`,e,{state:J.useMemo(()=>({disabled:s,highlighted:m}),[s,m]),props:[h,l,g],ref:[_,t,u.ref]})}),rc=0,ic=class e{static create(){return new e}currentId=rc;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rc,t()},e)}isStarted(){return this.currentId!==rc}clear=()=>{this.currentId!==rc&&(clearTimeout(this.currentId),this.currentId=rc)};disposeEffect=()=>this.clear};function ac(){let e=Qt(ic.create).current;return hs(e.disposeEffect),e}function oc(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var sc=class{nodesRef={current:[]};events=oc();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},cc=J.createContext(null),lc=J.createContext(null),uc=()=>J.useContext(cc)?.id||null,dc=e=>{let t=J.useContext(lc);return e??t};function fc(e){let t=vn(),n=dc(e),r=uc();return X(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function pc(e){let{children:t,id:n}=e,r=uc();return(0,q.jsx)(cc.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function mc(e){let{children:t,externalTree:n}=e,r=Qt(()=>n??new sc).current;return(0,q.jsx)(lc.Provider,{value:r,children:t})}function hc(e){return`data-base-ui-${e}`}hc(`safe-polygon`),`${ar}`;function gc(e,t,n){if(n&&!Dr(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var _c=J.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ic,currentIdRef:{current:null},currentContextRef:{current:null}});function vc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=J.useRef(n),a=J.useRef(n),o=J.useRef(null),s=J.useRef(null),c=ac();return(0,q.jsx)(_c.Provider,{value:J.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function yc(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=J.useContext(_c),[p,m]=J.useState(!1);return X(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),X(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:gc(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Q(Do))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),X(()=>()=>{u.current=null},[u]),J.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function bc(e){return e?.ownerDocument||document}var xc=J.forwardRef(function(e,t){let[n,r]=J.useState();X(()=>{Zn&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:un,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Sc=0;function Cc(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Sc);let a=()=>e?.focus({preventScroll:n});i?a():Sc=requestAnimationFrame(a)}var wc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Tc(e){return e===`inert`?wc.inert:e===`aria-hidden`?wc[`aria-hidden`]:wc.none}var Ec=new WeakSet,Dc={},Oc=0,kc=e=>e&&(e.host||kc(e.parentNode)),Ac=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=kc(t);return e.contains(n)?n:null}).filter(e=>e!=null);function jc(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Ac(t,e),s=new Set,c=new Set(o),l=[];Dc[i]||(Dc[i]=new WeakMap);let u=Dc[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(xn(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Tc(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Ec.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Oc+=1,()=>{l.forEach(e=>{let t=Tc(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Ec.has(e)&&a&&e.removeAttribute(a),Ec.delete(e)),r||e.removeAttribute(i)}),--Oc,Oc||(wc.inert=new WeakMap,wc[`aria-hidden`]=new WeakMap,wc.none=new WeakMap,Ec=new WeakSet,Dc={})}}function Mc(e,t=!1,n=!1){let r=hr(e[0]).body;return jc(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var Nc=J.createContext(null),Pc=()=>J.useContext(Nc),Fc=hc(`portal`);function Ic(e={}){let{ref:t,container:n,componentProps:r=pn,elementProps:i,elementState:a}=e,o=vn(),s=Pc()?.portalNode,[c,l]=J.useState(null),[u,d]=J.useState(null),f=J.useRef(null);X(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(wn(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=Z(`div`,r,{ref:[t,d],state:a,props:[{id:o,[Fc]:``},i]});return{portalNode:u,portalSubtree:c&&p?br.createPortal(p,c):null}}var Lc=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=Ic({container:r,ref:t,componentProps:e,elementProps:s}),u=J.useRef(null),d=J.useRef(null),f=J.useRef(null),p=J.useRef(null),[m,h]=J.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;J.useEffect(()=>{if(!c||g)return;function e(e){c&&Zi(e)&&(e.type===`focusin`?$i:Qi)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),J.useEffect(()=>{!c||_||$i(c)},[_,c]);let y=J.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,q.jsxs)(J.Fragment,{children:[l,(0,q.jsxs)(Nc.Provider,{value:y,children:[v&&c&&(0,q.jsx)(xc,{"data-type":`outside`,ref:u,onFocus:e=>{Zi(e,c)?f.current?.focus():qi(m?m.domReference:null)?.focus()}}),v&&c&&(0,q.jsx)(`span`,{"aria-owns":c.id,style:to}),c&&br.createPortal(n,c),v&&c&&(0,q.jsx)(xc,{"data-type":`outside`,ref:d,onFocus:e=>{Zi(e,c)?p.current?.focus():(Ki(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Q(`focus-out`,e.nativeEvent)))}})]})]})});function Rc(e,t){let n=Sn(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`):``}var zc=20,Bc=[];function Vc(){Bc=Bc.filter(e=>e.isConnected)}function Hc(e){Vc(),e&&xn(e)!==`body`&&(Bc.push(e),Bc.length>zc&&(Bc=Bc.slice(-20)))}function Uc(){return Vc(),Bc[Bc.length-1]}function Wc(e){if(!e)return null;let t=Wi();return Ui(e,t)?e:Vi(e,t)[0]||e}function Gc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():zn(e).display!==`none`}function Kc(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Wi(),r=Hi(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Ui(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function qc(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=Y(()=>x.current.floatingContext?.nodeId),C=Y(d),w=a===!1,T=_r(v)&&w,E=fs(i),D=fs(a),O=fs(o),k=fs(u),A=dc(h),j=Pc(),M=J.useRef(null),N=J.useRef(null),P=J.useRef(!1),F=J.useRef(!1),I=J.useRef(!1),L=J.useRef(-1),R=J.useRef(``),z=J.useRef(``),B=ac(),V=ac(),ee=ys(),H=j!=null,U=yr(y),W=Y((e=U)=>e?Vi(e,Wi()):[]),te=Y(e=>{let t=W(e);return E.current.map(()=>t).filter(Boolean).flat()});J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&dr(U,ur(hr(U)))&&W().length===0&&!T&&Cr(e)}let t=hr(U);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,U,c,E,T,W,te]),J.useEffect(()=>{if(r||!y)return;function e(e){let t=fr(e),n=W().indexOf(t);n!==-1&&(L.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,W]),J.useEffect(()=>{if(r||!_)return;let e=hr(U);function t(){I.current=!1}function n(e){let t=fr(e),n=dr(y,t)||dr(v,t)||dr(j?.portalNode,t);I.current=!n,z.current=e.pointerType||`keyboard`}function i(){z.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,U,_,j]),J.useEffect(()=>{if(r||!l)return;function e(){F.current=!0,V.start(0,()=>{F.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=fr(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(dr(v,t)||dr(y,t)||dr(t,y)||dr(j?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>dr(e,t))||t?.hasAttribute(hc(`focus-guard`))||A&&(xr(A.nodesRef.current,i).find(e=>dr(e.context?.elements.floating,t)||dr(e.context?.elements.domReference,t))||Sr(A.nodesRef.current,i).find(e=>[e.context?.elements.floating,yr(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&U&&Kc(U,E),s&&n!==v&&!Gc(r)&&ur(hr(U))===hr(U).body){if(En(U)&&(U.focus(),s===`popup`)){ee.request(()=>{U.focus()});return}let e=L.current,t=W(),n=t[e]||t[t.length-1]||U;En(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!F.current&&(T||t!==Uc())&&(P.current=!0,g.setOpen(!1,Q(Io,e)))})}function n(){I.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let i=En(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),j&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,U,c,A,j,g,l,s,W,T,S,E,x,B,V,ee]);let ne=J.useRef(null),re=J.useRef(null),ie=$t(ne,m,j?.beforeInsideRef),ae=$t(re,j?.afterInsideRef);J.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${hc(`portal`)}]`)||[]),t=(A?Sr(A.nodesRef.current,S()):[]).find(e=>_r(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Mc([y,t,...e,...C(),M.current,N.current,ne.current,re.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,bs(p),bs(f),T?v:null].filter(e=>e!=null),c||T);return()=>{n()}},[_,r,v,y,c,E,j,T,A,S,C,f,p]),X(()=>{if(!_||r||!En(U))return;let e=ur(hr(U));queueMicrotask(()=>{let t=te(U),n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||U:bs(r),i=i||t[0]||U,!dr(U,e)&&Cc(i,{preventScroll:i===U})})},[r,_,U,w,te,D,k]),X(()=>{if(r||!U)return;let e=hr(U);Hc(ur(e));function t(e){if(e.open||(R.current=Rc(e.nativeEvent,z.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(Tr(e.nativeEvent)||Er(e.nativeEvent))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,un),H&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(R.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||Uc();return e&&e.isConnected?e:n}let r=v||Uc()||n;return bs(t)||r}return()=>{b.off(`openchange`,t);let r=ur(e),a=dr(y,r)||A&&xr(A.nodesRef.current,S(),!1).some(e=>dr(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Wc(o),i=typeof O.current!=`boolean`;O.current&&!P.current&&En(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,U,O,x,b,A,H,v,S]),J.useEffect(()=>{queueMicrotask(()=>{P.current=!1})},[r]),J.useEffect(()=>{if(r||!_)return;function e(e){fr(e)?.closest(`[data-base-ui-click-trigger]`)&&(F.current=!0)}let t=hr(U);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,U]),X(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,g,l,v]),X(()=>{if(!(r||!U))return Kc(U,E),()=>{queueMicrotask(Vc)}},[r,U,E]);let oe=!r&&(!c||!T)&&(H||c);return(0,q.jsxs)(J.Fragment,{children:[oe&&(0,q.jsx)(xc,{"data-type":`inside`,ref:ie,onFocus:e=>{if(c){let e=te();Cc(e[e.length-1])}else j?.portalNode&&(P.current=!1,Zi(e,j.portalNode)?Ki(v)?.focus():bs(p??j.beforeOutsideRef)?.focus())}}),n,oe&&(0,q.jsx)(xc,{"data-type":`inside`,ref:ae,onFocus:e=>{c?Cc(te()[0]):j?.portalNode&&(l&&(P.current=!0),Zi(e,j.portalNode)?qi(v)?.focus():bs(f??j.afterOutsideRef)?.focus())}})]})}function Jc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=J.useRef(void 0),d=ys(),f=ac(),p=J.useMemo(()=>({onPointerDown(e){u.current=e.pointerType},onMouseDown(e){let t=u.current,i=e.nativeEvent,p=n.select(`open`);if(e.button!==0||a===`click`||Dr(t,!0)&&s)return;let m=r.current.openEvent,h=m?.type,g=n.select(`domReferenceElement`)!==e.currentTarget,_=p&&g||!(p&&o&&(!(m&&c)||h===`click`||h===`mousedown`));if(gr(i.target)){let e=Q(Oo,i,i.target);_&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(_,e);return}let v=e.currentTarget;d.request(()=>{let e=Q(Oo,i,v);_&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(_,e)})},onClick(e){if(a===`mousedown-only`)return;let t=u.current;if(a===`mousedown`&&t){u.current=void 0;return}if(Dr(t,!0)&&s)return;let i=n.select(`open`),d=r.current.openEvent,p=n.select(`domReferenceElement`)!==e.currentTarget,m=i&&p||!(i&&o&&(!(d&&c)||Or(d))),h=Q(Oo,e.nativeEvent,e.currentTarget);m&&t===`touch`&&l>0?f.start(l,()=>{n.setOpen(!0,h)}):n.setOpen(m,h)},onKeyDown(){u.current=void 0}}),[r,a,s,n,c,o,d,f,l]);return J.useMemo(()=>i?{reference:p}:pn,[i,p])}function Yc(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Xc(e){return e!=null&&e.clientX!=null}function Zc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=J.useRef(!1),f=J.useRef(null),[p,m]=J.useState(),[h,g]=J.useState([]),_=Y((e,t)=>{d.current||o.current.openEvent&&!Xc(o.current.openEvent)||n.set(`positionReference`,Yc(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=Y(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=Dr(p)?i:r,b=J.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=Sn(i);function t(n){let r=fr(n);dr(i,r)?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Xc(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);J.useEffect(()=>b(),[b,h]),J.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),J.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),X(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=J.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return J.useMemo(()=>s?{reference:x}:{},[s,x])}function Qc(e,t,n){let{reference:r,floating:i}=e,a=Ur(t),o=Wr(t),s=Hr(o),c=zr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Br(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function $c(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Rr(t,e),p=ni(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ri(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ri(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var el=50,tl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$c},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<el&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Qc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},nl=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Rr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=zr(r),_=Ur(o),v=zr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ei(o)]:Kr(o)),x=p!==`none`;!d&&x&&b.push(...$r(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Gr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Ur(t))||T.every(e=>Ur(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ur(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function rl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function il(e){return Ar.some(t=>e[t]>=0)}var al=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Rr(e,t);switch(i){case`referenceHidden`:{let e=rl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:il(e)}}}case`escaped`:{let e=rl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:il(e)}}}default:return{}}}}},ol=new Set([`left`,`top`]);async function sl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=zr(n),s=Br(n),c=Ur(n)===`y`,l=ol.has(o)?-1:1,u=a&&c?-1:1,d=Rr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var cl=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await sl(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ll=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Rr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ur(i),p=Vr(f),m=u[p],h=u[f],g=(e,t)=>Lr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ul=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Rr(e,t),u={x:n,y:r},d=Ur(i),f=Vr(d),p=u[f],m=u[d],h=Rr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ol.has(zr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},dl=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Rr(e,t),c=await i.detectOverflow(t,s),l=zr(n),u=Br(n),d=Ur(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=jr(p-c[m],g),y=jr(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Mr(c.left,c.right):S=p-2*Mr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function fl(e){let t=zn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=En(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nr(n)!==a||Nr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pl(e){return Tn(e)?e:e.contextElement}function ml(e){let t=pl(e);if(!En(t))return Fr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=fl(t),o=(a?Nr(n.width):n.width)/r,s=(a?Nr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var hl=Fr(0);function gl(e){let t=Sn(e);return!Ln()||!t.visualViewport?hl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _l(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Sn(e)}function vl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pl(e),o=Fr(1);t&&(r?Tn(r)&&(o=ml(r)):o=ml(e));let s=_l(a,n,r)?gl(a):Fr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Sn(a),t=Tn(r)?Sn(r):r,n=e,i=Wn(n);for(;i&&t!==n;){let e=ml(i),t=i.getBoundingClientRect(),r=zn(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Sn(i),i=Wn(n)}}return ri({width:u,height:d,x:c,y:l})}function yl(e,t){let n=Bn(e).scrollLeft;return t?t.left+n:vl(Cn(e)).left+n}function bl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yl(e,n),y:n.top+t.scrollTop}}function xl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cn(r),s=t?An(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fr(1),u=Fr(0),d=En(r);if((d||!a)&&((xn(r)!==`body`||On(o))&&(c=Bn(r)),d)){let e=vl(r);l=ml(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?bl(o,c):Fr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Cl(e){let t=Bn(e),n=e.ownerDocument.body,r=Mr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Mr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+yl(e),o=-t.scrollTop;return zn(n).direction===`rtl`&&(a+=Mr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var wl=25;function Tl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Sn(e),a=Cn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ln()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(yl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=wl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function El(e,t){let n=vl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ml(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Dl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Tl(e,n,t);else if(t===`document`)r=Cl(Cn(e));else if(Tn(t))r=El(t,n);else{let n=gl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ri(r)}function Ol(e,t){let n=t.get(e);if(n)return n;let r=Un(e,[],!1).filter(e=>Tn(e)&&xn(e)!==`body`),i=null,a=zn(e).position===`fixed`,o=a?Vn(e):e;for(;Tn(o)&&!Rn(o);){let e=zn(o),t=Fn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vn(o)}return t.set(e,r),r}function kl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?An(t)?[]:Ol(t,this._c):[].concat(n),r],o=Dl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Dl(t,a[e],i);s=Mr(n.top,s),c=jr(n.right,c),l=jr(n.bottom,l),u=Mr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Al(e){let{width:t,height:n}=fl(e);return{width:t,height:n}}function jl(e,t,n){let r=En(t),i=Cn(t),a=n===`fixed`,o=vl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Fr(0);if((r||!a)&&((xn(t)!==`body`||On(i))&&(s=Bn(t)),r)){let e=vl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=yl(i));let l=i&&!r&&!a?bl(i,s):Fr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ml(e){return zn(e).position===`static`}function Nl(e,t){if(!En(e)||zn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function Pl(e,t){let n=Sn(e);if(An(e))return n;if(!En(e)){let t=Vn(e);for(;t&&!Rn(t);){if(Tn(t)&&!Ml(t))return t;t=Vn(t)}return n}let r=Nl(e,t);for(;r&&kn(r)&&Ml(r);)r=Nl(r,t);return r&&Rn(r)&&Ml(r)&&!Fn(r)?n:r||In(e)||n}var Fl=async function(e){let t=this.getOffsetParent||Pl,n=this.getDimensions,r=await n(e.floating);return{reference:jl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Il(e){return zn(e).direction===`rtl`}var Ll={convertOffsetParentRelativeRectToViewportRelativeRect:xl,getDocumentElement:Cn,getClippingRect:kl,getOffsetParent:Pl,getElementRects:Fl,getClientRects:Sl,getDimensions:Al,getScale:ml,isElement:Tn,isRTL:Il};function Rl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zl(e,t,n){let r=null,i,a=Cn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Pr(d),h=Pr(a.clientWidth-(u+f)),g=Pr(a.clientHeight-(d+p)),_=Pr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Mr(0,jr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Rl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Sn(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Bl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=pl(e),u=i||a?[...l?Un(l):[],...t?Un(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?zl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?vl(e):null;c&&g();function g(){let t=vl(e);h&&!Rl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Vl=cl,Hl=ll,Ul=nl,Wl=dl,Gl=al,Kl=ul,ql=(e,t,n)=>{let r=new Map,i=n??{},a={...Ll,...i.platform,_c:r};return tl(e,t,{...i,platform:a})},Jl=typeof document<`u`?J.useLayoutEffect:function(){};function Yl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Yl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Yl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Xl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zl(e,t){let n=Xl(e);return Math.round(t*n)/n}function Ql(e){let t=J.useRef(e);return Jl(()=>{t.current=e}),t}function $l(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);Yl(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=Ql(c),D=Ql(i),O=Ql(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ql(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Yl(w.current,t)&&(w.current=t,br.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Jl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Jl(()=>(A.current=!0,()=>{A.current=!1}),[]),Jl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Zl(M.floating,u.x),r=Zl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Xl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var eu=(e,t)=>{let n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},tu=(e,t)=>{let n=Hl(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>({fn:Kl(e).fn,options:[e,t]}),ru=(e,t)=>{let n=Ul(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{let n=Wl(e);return{name:n.name,fn:n.fn,options:[e,t]}},au=(e,t)=>{let n=Gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou={intentional:`onClick`,sloppy:`onPointerDown`};function su(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function cu(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=dc(_),y=Y(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=J.useRef(!1),{escapeKey:S,outsidePress:C}=su(g),w=J.useRef(null),T=ac(),E=ac(),D=Y(()=>{E.clear(),c.current.insideReactTree=!1}),O=J.useRef(!1),k=J.useRef(``),A=Y(e=>{k.current=e.pointerType}),j=Y(()=>{let e=k.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),M=Y(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?xr(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Q(Lo,wr(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),N=Y(e=>{let t=j();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),P=Y(()=>{c.current.insideReactTree=!0,E.start(0,D)}),F=Y((e,t=!1)=>{if(N(e)){D();return}if(c.current.insideReactTree){D();return}if(j()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=fr(e),i=`[${hc(`inert`)}]`,a=hr(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>dr(e,r))))return;let s=Tn(r)?r:null;for(;s&&!Rn(s);){let e=Vn(s);if(Rn(e)||!Tn(e))break;s=e}if(a.length&&Tn(r)&&!mr(r)&&!dr(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!dr(s,e)))return;if(En(r)&&!(`touches`in e)){let t=Rn(r),n=zn(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&xr(v.nodesRef.current,l).some(t=>pr(e,t.context?.elements.floating));if(pr(e,n.select(`floatingElement`))||pr(e,n.select(`domReferenceElement`))||u)return;let d=v?xr(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Q(jo,e)),D()}),I=Y(e=>{j()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||pr(e,n.select(`floatingElement`))||pr(e,n.select(`domReferenceElement`))||F(e)}),L=Y(e=>{if(j()!==`sloppy`||!n.select(`open`)||!l||pr(e,n.select(`floatingElement`))||pr(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),R=Y(e=>{let t=fr(e);function n(){L(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),z=Y(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=fr(e);function r(){e.type===`pointerdown`?I(e):F(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),B=Y(e=>{if(j()!==`sloppy`||!w.current||pr(e,n.select(`floatingElement`))||pr(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(F(e),T.clear(),w.current=null)}),V=Y(e=>{let t=fr(e);function n(){B(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ee=Y(e=>{j()!==`sloppy`||!w.current||pr(e,n.select(`floatingElement`))||pr(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&F(e),T.clear(),w.current=null)}),H=Y(e=>{let t=fr(e);function n(){ee(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});J.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new ic;function t(e){n.setOpen(!1,Q(Do,e))}function s(){e.clear(),O.current=!0}function d(){e.start(Ln()?5:0,()=>{O.current=!1})}let f=hr(i);f.addEventListener(`pointerdown`,A,!0),u&&(f.addEventListener(`keydown`,M),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,z,!0),f.addEventListener(`pointerdown`,z,!0),f.addEventListener(`touchstart`,R,!0),f.addEventListener(`touchmove`,V,!0),f.addEventListener(`touchend`,H,!0),f.addEventListener(`mousedown`,z,!0));let p=[];return h&&(Tn(o)&&(p=Un(o)),Tn(i)&&(p=p.concat(Un(i))),!Tn(a)&&a&&a.contextElement&&(p=p.concat(Un(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,A,!0),u&&(f.removeEventListener(`keydown`,M),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,z,!0),f.removeEventListener(`pointerdown`,z,!0),f.removeEventListener(`touchstart`,R,!0),f.removeEventListener(`touchmove`,V,!0),f.removeEventListener(`touchend`,H,!0),f.removeEventListener(`mousedown`,z,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,M,F,z,I,R,V,H,A,n]),J.useEffect(D,[b,D]);let U=J.useMemo(()=>({onKeyDown:M,...p&&{[ou[m]]:e=>{n.setOpen(!1,Q(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Q(`trigger-press`,e.nativeEvent))}}}}),[M,n,p,m]),W=Y(e=>{let t=fr(e.nativeEvent);!dr(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),te=J.useMemo(()=>({onKeyDown:M,onPointerDown:W,onMouseDown:W,onMouseUp:W,onClickCapture:P,onMouseDownCapture:P,onPointerDownCapture:P,onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,W,P]);return J.useMemo(()=>l?{reference:U,floating:te,trigger:U}:{},[l,U,te])}var lu=Symbol(`NOT_FOUND`);function uu(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function du(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var fu=e=>Array.isArray(e)?e:[e];function pu(e){let t=Array.isArray(e[0])?e[0]:e;return du(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function mu(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function hu(e){let t;return{get(n){return t&&e(t.key,n)?t.value:lu},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function gu(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return lu}function i(t,i){r(t)===lu&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var _u=(e,t)=>e===t;function vu(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function yu(e,t){let{equalityCheck:n=_u,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=vu(n),o=0,s=r<=1?hu(a):gu(r,a);function c(){let t=s.get(arguments);if(t===lu){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var bu=class{constructor(e){this.value=e}deref(){return this.value}},xu=typeof WeakRef>`u`?bu:WeakRef,Su=0,Cu=1;function wu(){return{s:Su,v:void 0,o:null,p:null}}function Tu(e){return e instanceof xu?e.deref():e}function Eu(e,t={}){let n=wu(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=wu(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=wu(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Cu)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=Tu(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new xu(c):c}return s.s=Cu,s.v=c,c}return o.clearCache=()=>{n=wu(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Du(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),uu(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Eu,argsMemoizeOptions:u=[]}={...n,...a},d=fu(c),f=fu(u),p=pu(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=mu(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}Du({memoize:yu,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(kr(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Ou=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ku=t(((e,t)=>{t.exports=Ou()})),Au=t((e=>{var t=n(),r=ku();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ju=t(((e,t)=>{t.exports=Au()})),Mu=ku(),Nu=ju(),Pu=Na(19)?Iu:Lu;function Fu(e,t,n,r,i){return Pu(e,t,n,r,i)}function Iu(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Mu.useSyncExternalStore)(e.subscribe,a,a)}function Lu(e,t,n,r,i){return(0,Nu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ru=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},zu=class extends Ru{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){J.useDebugValue(e),X(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){X(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){X(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){J.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),X(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{J.useDebugValue(e);let i=this.selectors[e];return Fu(this,i,t,n,r)};useContextCallback(e,t){J.useDebugValue(e);let n=Y(t??dn);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Bu={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},Vu=class extends zu{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:oc(),nested:t,noEmit:n,triggerElements:i},Bu)}setOpen=(e,t)=>{if((!e||!this.state.open||Or(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function Hu(e,t){let n=J.useRef(null);return J.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function Uu(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Hu(e,n),o=Y(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return X(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Wu(e){let t=e.useState(`open`);X(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function Gu(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Cs(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=Y(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Ss({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Ku=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function qu(){return new Vu({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Ku,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function Ju(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:qu(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:pn,inactiveTriggerProps:pn,popupProps:pn}}var Yu={open:$(e=>e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:$(e=>e.activeTriggerId),activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Xu(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=vn(),a=uc()!=null,o=Qt(()=>new Vu({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new Ku,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return X(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Tn(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function Zu(e={}){let{nodeId:t,externalTree:n}=e,r=Xu(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=J.useState(null),c=J.useRef(null),l=dc(n);X(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=$l({...e,elements:{...a,...o&&{reference:o}}}),d=J.useCallback(e=>{let t=Tn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=J.useState(null),[m,h]=J.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,Tn(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=J.useCallback(e=>{(Tn(e)||e===null)&&(c.current=e,p(e)),(Tn(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Tn(e))&&u.refs.setReference(e)},[u.refs,p]),_=J.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=J.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=J.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=J.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return X(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),J.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function Qu(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=vn(),o=uc()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=Qt(()=>new Vu({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return X(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Tn(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var $u=$n&&Zn;function ed(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=J.useRef(!1),c=ac(),l=J.useRef(!0);J.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Sn(e);function r(){!n.select(`open`)&&En(e)&&e===ur(hr(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),$u&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),$u&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),J.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=J.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=fr(e.nativeEvent);if(o&&Tn(t)){if($u&&!e.relatedTarget){if(!l.current&&!gr(t))return}else if(!vr(t))return}n.setOpen(!0,Q(Ao,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Tn(t)&&t.hasAttribute(hc(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=ur(o?o.ownerDocument:document);!t&&s===o||dr(i.current.floatingContext?.refs.floating.current,s)||dr(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Q(Ao,r))})}}),[i,n,o,c]);return J.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var td=hc(`safe-polygon`),nd=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${ar}`;function rd(e){return e?!!e.closest(nd):!1}function id(e){let t=J.useRef(void 0),n=J.useRef(!1),r=J.useRef(void 0),i=J.useRef(!0),a=J.useRef(!1),o=J.useRef(()=>{}),s=J.useRef(!1),c=ac(),l=ac(),u=J.useRef(void 0);return J.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var ad=new Set([`click`,`mousedown`]);function od(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=id(n),v=dc(l),y=uc(),b=Y(()=>d.current?!0:o.current.openEvent?ad.has(o.current.openEvent.type):!1),x=Y(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=J.useCallback((e,t=!0)=>{let r=sd(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,Q(ko,e))):t&&(g.clear(),n.setOpen(!1,Q(ko,e)))},[c,f,n,u,g]),C=Y(()=>{m.current(),f.current=void 0}),w=Y(()=>{if(p.current){let e=hr(i).body;e.style.pointerEvents=``,e.removeAttribute(td),p.current=!1}}),T=Y(e=>{if(!rd(fr(e))){d.current=!1;return}d.current=!0});X(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),J.useEffect(()=>()=>{C()},[C]),J.useEffect(()=>w,[w]),X(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&Tn(a)&&i){p.current=!0;let e=hr(i).body;e.setAttribute(td,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),J.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function sd(e,t){return t&&!Dr(t)?0:typeof e==`function`?e():e}function cd(e){return typeof e==`function`?e():e}var ld={current:null};function ud(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=ld,externalTree:f,isActiveTrigger:p=!0}=t,m=dc(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=id(n),T=fs(s),E=fs(o),D=fs(l);p&&(w.current=T.current?.__options);let O=Y(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),k=J.useCallback((e,t=!0)=>{let r=gc(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,Q(ko,e))):t&&(S.clear(),n.setOpen(!1,Q(ko,e)))},[E,_,n,h,S]),A=Y(()=>{b.current(),_.current=void 0}),j=Y(()=>{if(y.current){let e=hr(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(td),y.current=!1}});J.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let M=Y(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e)}})(e)});return J.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!Tn(e))return;function t(e){if(S.clear(),v.current=!1,c&&!Dr(h.current)||cd(D.current)>0&&!gc(E.current,`open`))return;let t=gc(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>dr(t,e.target)))&&(!r||!dr(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,Q(ko,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,Q(ko,e,o))}function i(e){if(O()){j();return}b.current();let t=hr(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),O()||k(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!dr(n.select(`floatingElement`),e.relatedTarget))&&k(e)}}function o(e){M(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[A,j,v,r,E,k,n,a,T,M,p,O,c,u,h,D,C,x,S,d,m,b,_]),J.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>dr(t,e.target)))&&(!i||!dr(i,e.target));if(c&&!Dr(h.current)||o&&!s||cd(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,Q(ko,t,r))}h.current===`touch`?br.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start(cd(D.current),l))}}},[v,c,n,h,D,C,x])}function dd(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=J.useCallback(t=>fd(t,e,`reference`),t),o=J.useCallback(t=>fd(t,e,`floating`),n),s=J.useCallback(t=>fd(t,e,`item`),r),c=J.useCallback(t=>fd(t,e,`trigger`),i);return J.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function fd(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[ir]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&pd(a,s,i,r)}return pd(a,e,i,r),a}function pd(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var md=`Escape`;function hd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gd(e,t){return hd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _d(e,t,n){return hd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vd(e,t,n){return hd(t,n?e===or:e===sr,e===lr)}function yd(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===md:hd(t,n?e===sr:e===or,e===cr)}function bd(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,scrollItemIntoView:w=!0,itemSizes:T,dense:E=!1,id:D,resetOnPointerLeave:O=!0,externalTree:k}=t,A=fs(yr(i)),j=uc(),M=dc(k);X(()=>{o.current.orientation=x},[o,x]);let N=_r(a),P=J.useRef(_),F=J.useRef(d??-1),I=J.useRef(null),L=J.useRef(!0),R=Y(e=>{l(F.current===-1?null:F.current,e)}),z=J.useRef(R),B=J.useRef(!!i),V=J.useRef(r),ee=J.useRef(!1),H=J.useRef(!1),U=fs(b),W=fs(r),te=fs(w),ne=fs(d),re=fs(O),ie=Y(()=>{function e(e){g?M?.events.emit(`virtualfocus`,e):Cc(e,{sync:ee.current,preventScroll:!0})}let t=s.current[F.current],n=H.current;t&&e(t),(ee.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[F.current]||t;if(!r)return;t||e(r);let i=te.current;i&&oe&&(n||!L.current)&&r.scrollIntoView?.(typeof i==`boolean`?{block:`nearest`,inline:`nearest`}:i)})});X(()=>{u&&(r&&i?(F.current=d??-1,P.current&&d!=null&&(H.current=!0,R())):B.current&&(F.current=-1,z.current()))},[u,r,i,d,R]),X(()=>{if(u){if(!r){ee.current=!1;return}if(i)if(c==null){if(ee.current=!1,ne.current!=null)return;if(B.current&&(F.current=-1,ie()),(!V.current||!B.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(F.current=I.current==null||_d(I.current,x,h)||m?oi(s):si(s),I.current=null,R())};t()}}else ai(s,c)||(F.current=c,ie(),H.current=!1)}},[u,r,i,c,ne,m,s,x,h,R,ie,U]),X(()=>{if(!u||i||!M||g||!B.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=ur(hr(i)),r=e.some(e=>e.context&&dr(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[u,i,M,j,g]),X(()=>{z.current=R,V.current=r,B.current=!!i}),X(()=>{r||(I.current=null,P.current=_)},[r,_]);let ae=c!=null,oe=J.useMemo(()=>{function e(e){if(!W.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&F.current!==t&&(F.current=t,R(e))}return{onFocus(t){ee.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){ee.current=!0,H.current=!1,v&&e(t)},onPointerLeave(e){if(!W.current||!L.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;!v||s.current.includes(t)||re.current&&(F.current=-1,R(e),g||A.current?.focus({preventScroll:!0}))}}},[W,A,v,s,R,re,g]),se=J.useCallback(()=>S??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation,[j,M,S]),ce=Y(e=>{if(L.current=!1,ee.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(m&&yd(e.key,x,h,C)){gd(e.key,se())||Cr(e),n.setOpen(!1,Q(Ro,e.nativeEvent)),En(a)&&(g?M?.events.emit(`virtualfocus`,a):a.focus());return}let t=F.current,i=oi(s,b),o=si(s,b);if(N||(e.key===`Home`&&(Cr(e),F.current=i,R(e)),e.key===`End`&&(Cr(e),F.current=o,R(e))),C>1){let t=T||Array.from({length:s.current.length},()=>({width:1,height:1})),n=ui(t,C,E),r=n.findIndex(e=>e!=null&&!pi(s,e,b)),a=n.reduce((e,t,n)=>t!=null&&!pi(s,t,b)?n:e,-1),c=n[li({current:n.map(e=>e==null?null:s.current[e])},{event:e,orientation:x,loopFocus:p,rtl:h,cols:C,disabledIndices:fi([...(typeof b==`function`?null:b)||s.current.map((e,t)=>pi(s,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:di(F.current>o?i:F.current,t,n,C,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(F.current=c,R(e)),x===`both`)return}if(gd(e.key,x)){if(Cr(e),r&&!g&&ur(e.currentTarget.ownerDocument)===e.currentTarget){F.current=_d(e.key,x,h)?i:o,R(e);return}_d(e.key,x,h)?p?t>=o?f&&t!==s.current.length?F.current=-1:(ee.current=!1,F.current=i):F.current=ci(s,{startingIndex:t,disabledIndices:b}):F.current=Math.min(o,ci(s,{startingIndex:t,disabledIndices:b})):p?t<=i?f&&t!==-1?F.current=s.current.length:(ee.current=!1,F.current=o):F.current=ci(s,{startingIndex:t,decrement:!0,disabledIndices:b}):F.current=Math.max(i,ci(s,{startingIndex:t,decrement:!0,disabledIndices:b})),ai(s,F.current)&&(F.current=-1),R(e)}}),le=J.useMemo(()=>g&&r&&ae&&{"aria-activedescendant":`${D}-${c}`},[g,r,ae,D,c]),ue=J.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...N?{}:le,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=fr(e.nativeEvent);if(t&&!dr(A.current,t))return;Cr(e),n.setOpen(!1,Q(Io,e.nativeEvent)),En(a)&&a.focus();return}ce(e)},onPointerMove(){L.current=!0}}),[le,ce,A,x,N,n,r,g,a]),de=J.useMemo(()=>{function e(e){_===`auto`&&Tr(e.nativeEvent)&&(P.current=!g)}function t(e){P.current=_,_===`auto`&&Er(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(e){let t=n.select(`open`);L.current=!1;let r=e.key.startsWith(`Arrow`),i=vd(e.key,se(),h),a=gd(e.key,x),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return ce(e);if(!(!t&&!y&&r)){if(o){let t=gd(e.key,se());I.current=m&&t?null:e.key}if(m){i&&(Cr(e),t?(F.current=oi(s,U.current),R(e)):n.setOpen(!0,Q(Ro,e.nativeEvent,e.currentTarget)));return}a&&(ne.current!=null&&(F.current=ne.current),Cr(e),!t&&y?n.setOpen(!0,Q(Ro,e.nativeEvent,e.currentTarget)):ce(e),t&&R(e))}},onFocus(e){n.select(`open`)&&!g&&(F.current=-1,R(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,U,_,s,m,R,n,y,x,se,h,ne,g]),fe=J.useMemo(()=>({...le,...de}),[le,de]);return J.useMemo(()=>u?{reference:fe,floating:ue,item:oe,trigger:de}:{},[u,fe,ue,de,oe])}var xd=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Sd(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=vn(),u=a?.id||l,d=J.useMemo(()=>yr(o)?.id||i,[o,i]),f=xd.get(c)??c,p=uc()!=null,m=J.useMemo(()=>f===`tooltip`||c===`label`?pn:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=J.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=J.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=J.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return J.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function Cd(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.context.dataRef,{listRef:a,activeIndex:o,onMatch:s,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=fn,selectedIndex:p=null}=t,m=ac(),h=J.useRef(``),g=J.useRef(p??o??-1),_=J.useRef(null);X(()=>{r&&(m.clear(),_.current=null,h.current=``)},[r,m]),X(()=>{r&&h.current===``&&(g.current=p??o??-1)},[r,p,o]);let v=Y(e=>{e?i.current.typing||(i.current.typing=e,c?.(e)):i.current.typing&&(i.current.typing=e,c?.(e))}),y=Y(e=>{function t(e,t,n){let r=u?u(t,n):t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let n=a.current;if(h.current.length>0&&h.current[0]!==` `&&(t(n,n,h.current)===-1?v(!1):e.key===` `&&Cr(e)),n==null||f.includes(e.key)||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;r&&e.key!==` `&&(Cr(e),v(!0)),n.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(d,()=>{h.current=``,g.current=_.current,v(!1)});let i=g.current,o=t(n,[...n.slice((i||0)+1),...n.slice(0,(i||0)+1)],h.current);o===-1?e.key!==` `&&(h.current=``,v(!1)):(s?.(o),_.current=o)}),b=J.useMemo(()=>({onKeyDown:y}),[y]),x=J.useMemo(()=>({onKeyDown:y,onKeyUp(e){e.key===` `&&v(!1)}}),[y,v]);return J.useMemo(()=>l?{reference:b,floating:x}:{},[l,b,x])}function wd(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Td(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ed(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new ic,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=fr(f),v=f.type===`mouseleave`,y=dr(s.floating,_),b=dr(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=Td(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Tn(f.relatedTarget)&&dr(s.floating,f.relatedTarget)||d&&xr(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break;default:}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]];default:return[]}}if(!wd([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}wd([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var Dd=J.createContext(void 0);function Od(e){let t=J.useContext(Dd);if(t===void 0&&!e)throw Error(kr(69));return t}function kd(e){return e===`starting`?Za:pn}var Ad={...Vs,...Xo},jd=J.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o}=js(),{side:s,align:c}=ks(),l=Od(!0)!=null,u=o.useState(`open`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`mounted`),m=o.useState(`instantType`),h=o.useState(`activeTriggerElement`),g=o.useState(`parent`),_=o.useState(`lastOpenChangeReason`),v=o.useState(`rootId`),y=o.useState(`floatingRootContext`),b=o.useState(`floatingTreeRoot`),x=o.useState(`closeDelay`),S=o.useState(`activeTriggerElement`);Ss({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){o.setOpen(!1,Q(e.reason,e.domEvent))}return b.events.on(`close`,e),()=>{b.events.off(`close`,e)}},[b.events,o]);let C=o.useState(`hoverEnabled`),w=o.useState(`disabled`);od(y,{enabled:C&&!w&&g.type!==`context-menu`&&g.type!==`menubar`,closeDelay:x});let T=Z(`div`,e,{state:J.useMemo(()=>({transitionStatus:d,side:s,align:c,open:u,nested:g.type===`menu`,instant:m}),[d,s,c,u,g.type,m]),ref:[t,o.context.popupRef],stateAttributesMapping:Ad,props:[f,{onKeyDown(e){l&&da.has(e.key)&&e.stopPropagation()}},kd(d),a,{"data-rootownerid":v}]}),E=g.type===void 0||g.type===`context-menu`;return(h||g.type===`menubar`&&_!==`outside-press`)&&(E=!0),(0,q.jsx)(qc,{context:y,modal:!1,disabled:!p,returnFocus:i===void 0?E:i,initialFocus:g.type!==`menu`,restoreFocus:!0,externalTree:g.type===`menubar`?void 0:b,previousFocusableElement:S,nextFocusableElement:g.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:T})}),Md=J.createContext(void 0);function Nd(){let e=J.useContext(Md);if(e===void 0)throw Error(kr(32));return e}var Pd=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=js();return i.useState(`mounted`)||n?(0,q.jsx)(Md.Provider,{value:n,children:(0,q.jsx)(Lc,{ref:t,...r})}):null});function Fd(e){return Na(19)?e:e?`true`:void 0}var Id=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Rr(e,t)||{};if(l==null)return{};let f=ni(u),p={x:n,y:r},m=Wr(i),h=Hr(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Lr(k,j,A),N=!c.arrow&&Br(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Ld=(e,t)=>({...Id(e),options:[e,t]}),Rd={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await au().fn(e)).data?.referenceHidden||a}}}},zd={sideX:`left`,sideY:`top`},Bd={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Sn(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:zd};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=bc(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=zr(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:zd.sideX,g=f===`top`?`bottom`:zd.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Vd(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Hd(e,t,n){let{rects:r,placement:i}=e;return{side:Vd(t,zr(i),n),align:Br(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ud(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=J.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=Y(E),O=E?D:t,k=fs(t),A=oo()===`rtl`,j=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":A?`left`:`right`,"inline-start":A?`right`:`left`}[r],M=a===`center`?j:`${j}-${a}`,N=c,P=+(r===`bottom`),F=+(r===`top`),I=+(r===`right`),L=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+L,bottom:N+F,left:N+I}:N&&={top:(N.top||0)+P,right:(N.right||0)+L,bottom:(N.bottom||0)+F,left:(N.left||0)+I};let R={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},z=J.useRef(null),B=fs(i),V=fs(o),ee=[eu(e=>{let t=Hd(e,r,A),n=typeof B.current==`function`?B.current(t):B.current,i=typeof V.current==`function`?V.current(t):V.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,A,r])],H=w===`none`&&C!==`shift`,U=!H&&(l||g||C===`shift`),W=C===`none`?null:ru({...R,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),te=H?null:tu(e=>{let t=bc(e.elements.floating).documentElement;return{...R,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:U,limiter:l||g?void 0:nu(e=>{if(!z.current)return{};let{width:t,height:n}=z.current.getBoundingClientRect(),r=Ur(zr(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[R,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?ee.push(te,W):ee.push(W,te),ee.push(iu({...R,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),Ld(()=>({element:z.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=zr(a),l=Ur(c),u=z.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Hd(e,r,A)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,U&&l===`y`&&b?S:x),{}}},Rd,v),X(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ne=J.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:re,elements:ie,x:ae,y:oe,middlewareData:se,update:ce,placement:le,context:ue,isPositioned:de,floatingStyles:fe}=Zu({rootContext:p,placement:M,middleware:ee,strategy:n,whileElementsMounted:f?void 0:(...e)=>Bl(...e,ne),nodeId:_,externalTree:b}),{sideX:pe,sideY:me}=se.adaptiveOrigin||zd,G=de?n:`fixed`,he=J.useMemo(()=>v?{position:G,[pe]:ae,[me]:oe}:{position:G,...fe},[v,G,pe,ae,me,oe,fe]),ge=J.useRef(null);X(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(Wd(t)?t.current:t)||null;n!==ge.current&&(re.setPositionReference(n),ge.current=n)},[m,re,O,k]),J.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&Wd(e)&&e.current!==ge.current&&(re.setPositionReference(e.current),ge.current=e.current)},[m,re,O,k]),J.useEffect(()=>{if(f&&m&&ie.domReference&&ie.floating)return Bl(ie.domReference,ie.floating,ce,ne)},[f,m,ie,ce,ne]);let _e=zr(le),ve=Vd(r,_e,A),ye=Br(le)||`center`,be=!!se.hide?.referenceHidden;X(()=>{y&&m&&de&&S(_e)},[y,m,de,_e]);let xe=J.useMemo(()=>({position:`absolute`,top:se.arrow?.y,left:se.arrow?.x}),[se.arrow]),Se=se.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:he,arrowStyles:xe,arrowRef:z,arrowUncentered:Se,side:ve,align:ye,physicalSide:_e,anchorHidden:be,refs:re,context:ue,isPositioned:de,update:ce}),[he,xe,z,Se,ve,ye,_e,be,re,ue,de,ce])}function Wd(e){return e!=null&&`current`in e}var Gd=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
7
|
-
0% 0%,
|
|
8
|
-
100% 0%,
|
|
9
|
-
100% 100%,
|
|
10
|
-
0% 100%,
|
|
11
|
-
0% 0%,
|
|
12
|
-
${e.left}px ${e.top}px,
|
|
13
|
-
${e.left}px ${e.bottom}px,
|
|
14
|
-
${e.right}px ${e.bottom}px,
|
|
15
|
-
${e.right}px ${e.top}px,
|
|
16
|
-
${e.left}px ${e.top}px
|
|
17
|
-
)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Kd=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=$a,...g}=e,{store:_}=js(),v=Nd(),y=Us(!0),b=_.useState(`parent`),x=_.useState(`floatingRootContext`),S=_.useState(`floatingTreeRoot`),C=_.useState(`mounted`),w=_.useState(`open`),T=_.useState(`modal`),E=_.useState(`activeTriggerElement`),D=_.useState(`lastOpenChangeReason`),O=_.useState(`floatingNodeId`),k=_.useState(`floatingParentNodeId`),A=n,j=c,M=l,N=s;b.type===`context-menu`&&(A=n??b.context?.anchor,N??=`start`,!o&&N!==`center`&&(M=e.alignOffset??2,j=e.sideOffset??-5));let P=o,F=N;b.type===`menu`?(P??=`inline-end`,F??=`start`):b.type===`menubar`&&(P??=`bottom`,F??=`start`);let I=b.type===`context-menu`,L=Ud({anchor:A,floatingRootContext:x,positionMethod:y?`fixed`:r,mounted:C,side:P,sideOffset:j,align:F,alignOffset:M,arrowPadding:I?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:O,keepMounted:v,disableAnchorTracking:m,collisionAvoidance:h,shiftCrossAxis:I,externalTree:S}),R=J.useMemo(()=>{let e={};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!C,style:{...L.positionerStyles,...e}}},[w,C,L.positionerStyles]);J.useEffect(()=>{function e(e){e.open?(e.parentNodeId===O&&_.set(`hoverEnabled`,!1),e.nodeId!==O&&e.parentNodeId===_.select(`floatingParentNodeId`)&&_.setOpen(!1,Q(Ho))):e.parentNodeId===O&&e.reason!==`sibling-open`&&_.set(`hoverEnabled`,!0)}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[_,S.events,O]),J.useEffect(()=>{if(_.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==_.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;_.setOpen(!1,Q(t))}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[S.events,_]),J.useEffect(()=>{function e(e){!w||e.nodeId!==_.select(`floatingParentNodeId`)||e.target&&E&&E!==e.target&&_.setOpen(!1,Q(Ho))}return S.events.on(`itemhover`,e),()=>{S.events.off(`itemhover`,e)}},[S.events,w,E,_]),J.useEffect(()=>{let e={open:w,nodeId:O,parentNodeId:k,reason:_.select(`lastOpenChangeReason`)};S.events.emit(`menuopenchange`,e)},[S.events,w,_,O,k]);let z=J.useMemo(()=>({open:w,side:L.side,align:L.align,anchorHidden:L.anchorHidden,nested:b.type===`menu`}),[w,L.side,L.align,L.anchorHidden,b.type]),B=J.useMemo(()=>({side:L.side,align:L.align,arrowRef:L.arrowRef,arrowUncentered:L.arrowUncentered,arrowStyles:L.arrowStyles,nodeId:L.context.nodeId}),[L.side,L.align,L.arrowRef,L.arrowUncentered,L.arrowStyles,L.context.nodeId]),V=Z(`div`,e,{state:z,stateAttributesMapping:Vs,ref:[t,_.useStateSetter(`positionerElement`)],props:[R,g]}),ee=C&&b.type!==`menu`&&(b.type!==`menubar`&&T&&D!==`trigger-hover`||b.type===`menubar`&&b.context.modal),H=null;return b.type===`menubar`?H=b.context.contentElement:b.type===void 0&&(H=E),(0,q.jsxs)(Os.Provider,{value:B,children:[ee&&(0,q.jsx)(Gd,{ref:b.type===`context-menu`||b.type===`nested-context-menu`?b.context.internalBackdropRef:null,inert:Fd(!w),cutout:H}),(0,q.jsx)(pc,{id:O,children:(0,q.jsx)(xa,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:V})})]})}),qd={},Jd={},Yd=``;function Xd(e){if(typeof document>`u`)return!1;let t=bc(e);return Sn(t).innerWidth-t.documentElement.clientWidth>0}function Zd(e){let t=bc(e),n=t.documentElement,r=t.body,i=On(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function Qd(e){let t=bc(e),n=t.documentElement,r=t.body,i=Sn(n),a=0,o=0,s=vs.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(Yn&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,qd={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Yd=n.style.scrollBehavior,Jd={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=On(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,qd),Object.assign(r.style,Jd),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Yd)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var $d=new class{lockCount=0;restore=null;timeoutLock=ic.create();timeoutUnlock=ic.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=bc(e).documentElement,n=Sn(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=dn;return}let r=Xn||!Xd(e);this.restore=r?Zd(e):Qd(e)}};function ef(e=!0,t=null){X(()=>{if(e)return $d.acquire(t)},[e,t])}var tf=J.createContext(null);function nf(e){let t=J.useContext(tf);if(t===null&&!e)throw Error(kr(5));return t}function rf(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function af(e){let[t,n]=J.useState(null),r=Y((t,r)=>{e||n(r)}),i=J.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=rf(r);return J.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}var of={...Yu,disabled:$(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:$(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),allowMouseEnter:$(e=>e.parent.type===`menu`?e.parent.store.select(`allowMouseEnter`):e.allowMouseEnter),stickIfOpen:$(e=>e.stickIfOpen),parent:$(e=>e.parent),rootId:$(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:$(e=>e.activeIndex),isActive:$((e,t)=>e.activeIndex===t),hoverEnabled:$(e=>e.hoverEnabled),instantType:$(e=>e.instantType),lastOpenChangeReason:$(e=>e.openChangeReason),floatingTreeRoot:$(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:$(e=>e.floatingNodeId),floatingParentNodeId:$(e=>e.floatingParentNodeId),itemProps:$(e=>e.itemProps),closeDelay:$(e=>e.closeDelay),keyboardEventRelay:$(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},sf=class e extends zu{constructor(e){super({...cf(),...e},{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:new Ku},of),this.observe($(e=>e.allowMouseEnter),(e,t)=>{this.state.parent.type===`menu`&&e!==t&&this.state.parent.store.set(`allowMouseEnter`,e)}),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){return Qt(()=>t??new e(n)).current}unsubscribeParentListener=null};function cf(){return{...Ju(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new sc,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:pn,keyboardEventRelay:void 0,closeDelay:0}}var lf=J.createContext(void 0);function uf(){return J.useContext(lf)}function df(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!0,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=Us(!0),_=js(!0),v=nf(!0),y=uf(),b=J.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=sf.useStore(f?.store,{parent:b}),S=x.useState(`floatingTreeRoot`),C=fc(S),w=uc();X(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]),x.useControlledProp(`open`,n,a),x.useControlledProp(`activeTriggerId`,p,m),x.useContextCallback(`onOpenChangeComplete`,i);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`modal`),A=x.useState(`disabled`),j=x.useState(`lastOpenChangeReason`),M=x.useState(`parent`),N=x.useState(`activeIndex`),P=x.useState(`payload`),F=x.useState(`floatingParentNodeId`),I=J.useRef(null),L=F!=null,R;x.useSyncedValues({disabled:o,modal:M.type===void 0?s:void 0,rootId:vn()});let{openMethod:z,triggerProps:B,reset:V}=af(T);Wu(x);let{forceUnmount:ee}=Gu(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0}),V()}),H=J.useRef(M.type!==`context-menu`),U=ac();J.useEffect(()=>{if(T||(I.current=null),M.type===`context-menu`){if(!T){U.clear(),H.current=!1;return}U.start(500,()=>{H.current=!0})}},[U,T,M.type]),ef(T&&k&&j!==`trigger-hover`&&z!==`touch`,D),X(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let W=J.useRef(!0),te=ac(),ne=Y((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:L};R?.emit(`openchange`,i);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!W.current)return;if(!e&&N!==null){let e=x.context.itemDomElements.current[N];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(W.current=!1,te.start(300,()=>{W.current=!0})):(W.current=!0,te.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0&&a?.isTrusted,s=!e&&(n===`escape-key`||n==null);function c(){let r={open:e,openChangeReason:n};I.current=t.event??null;let i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),x.update(r)}n===`trigger-hover`?br.flushSync(c):c(),M.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),re=J.useCallback(e=>{let t=Q(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),ie=J.useCallback(()=>{x.setOpen(!1,re(Wo))},[x,re]);J.useImperativeHandle(u,()=>({unmount:ee,close:ie}),[ee,ie]);let ae;M.type===`context-menu`&&(ae=M.context),J.useImperativeHandle(ae?.positionerRef,()=>D,[D]),J.useImperativeHandle(ae?.actionsRef,()=>({setOpen:ne}),[ne]);let oe=Qu({popupStore:x,onOpenChange:ne});R=oe.context.events,J.useEffect(()=>{let e=({open:e,eventDetails:t})=>ne(e,t);return R.on(`setOpen`,e),()=>{R?.off(`setOpen`,e)}},[R,ne]);let se=cu(oe,{enabled:!A,bubbles:d&&M.type===`menu`,outsidePress(){return M.type!==`context-menu`||I.current?.type===`contextmenu`||H.current},externalTree:L?S:void 0}),ce=Sd(oe,{role:`menu`}),le=oo(),ue=J.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),de=bd(oe,{enabled:!A,listRef:x.context.itemDomElements,activeIndex:N,nested:M.type!==void 0,loopFocus:c,orientation:l,parentOrientation:M.type===`menubar`?M.context.orientation:void 0,rtl:le===`rtl`,disabledIndices:fn,onNavigate:ue,openOnArrowKeyDown:M.type!==`context-menu`,externalTree:L?S:void 0,focusItemOnHover:h}),fe=J.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:pe,getFloatingProps:me,getItemProps:G,getTriggerProps:he}=dd([se,ce,de,Cd(oe,{listRef:x.context.itemLabels,activeIndex:N,resetMs:500,onMatch:e=>{T&&e!==N&&x.set(`activeIndex`,e)},onTypingChange:fe})]),ge=J.useMemo(()=>{let e=Ba(pe(),{onMouseEnter(){x.set(`hoverEnabled`,!0)},onMouseMove(){x.set(`allowMouseEnter`,!0)}},B);return delete e.role,e},[pe,x,B]),_e=J.useMemo(()=>{let e=he();if(!e)return e;let{role:t,"aria-controls":n,...r}=e;return r},[he]),ve=ys(),ye=J.useMemo(()=>me({onMouseEnter(){M.type===`menu`&&ve.request(()=>x.set(`hoverEnabled`,!1))},onMouseMove(){x.set(`allowMouseEnter`,!0)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[me,M.type,ve,x]),be=J.useMemo(()=>G(),[G]);x.useSyncedValues({floatingRootContext:oe,activeTriggerProps:ge,inactiveTriggerProps:_e,popupProps:ye,itemProps:be});let xe=J.useMemo(()=>({store:x,parent:b}),[x,b]),Se=(0,q.jsx)(As.Provider,{value:xe,children:typeof t==`function`?t({payload:P}):t});return M.type===void 0||M.type===`context-menu`?(0,q.jsx)(mc,{externalTree:S,children:Se}):Se}function ff(e){let{closeParentOnEsc:t=!1}=e,n=js().store,r=J.useMemo(()=>({parentMenu:n}),[n]);return(0,q.jsx)(lf.Provider,{value:r,children:(0,q.jsx)(df,{...e,closeParentOnEsc:t})})}function pf(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}function mf(e){if(En(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Rn(e))return mf(Vn(e))}function hf(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,bc(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:pn,[t,n,r])}var gf=2,_f=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,...f}=e,p=js(!0),m=u?.store??p?.store;if(!m)throw Error(kr(85));let h=yn(o),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=J.useRef(null),b=yf(),x=ja(!0),S=dc(),C=J.useMemo(()=>S??new sc,[S]),{registerTrigger:w,isMountedByThisTrigger:T}=Uu(h,y,m,{payload:d,closeDelay:l,parent:b,floatingTreeRoot:C,floatingNodeId:fc(C),floatingParentNodeId:uc(),keyboardEventRelay:x?.relayKeyboardEvent}),E=m.useState(`disabled`),D=i||E||b.type===`menubar`&&b.context.disabled,{getButtonProps:O,buttonRef:k}=es({disabled:D,native:a});J.useEffect(()=>{!v&&b.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,v,b.type]);let A=J.useRef(null),j=ac(),M=Y(e=>{if(!A.current)return;j.clear(),m.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(dr(A.current,t)||dr(m.select(`positionerElement`),t)||t===A.current||t!=null&&mf(t)===m.select(`rootId`))return;let n=pf(A.current);e.clientX>=n.left-gf&&e.clientX<=n.right+gf&&e.clientY>=n.top-gf&&e.clientY<=n.bottom+gf||C.events.emit(`close`,{domEvent:e,reason:Vo})});J.useEffect(()=>{v&&m.select(`lastOpenChangeReason`)===`trigger-hover`&&bc(A.current).addEventListener(`mouseup`,M,{once:!0})},[v,M,m]);let N=b.type===`menubar`&&b.context.hasSubmenuOpen,P=ud(_,{enabled:(s??N??!1)&&!D&&b.type!==`context-menu`&&(b.type!==`menubar`||N&&!T),handleClose:Ed({blockPointerEvents:b.type!==`menubar`}),mouseOnly:!0,move:!1,restMs:b.type===void 0?c:void 0,delay:{close:l},triggerElementRef:y,externalTree:C,isActiveTrigger:g}),F=vf(v,m.select(`lastOpenChangeReason`)),I=Jc(_,{enabled:!D&&b.type!==`context-menu`,event:v&&b.type===`menubar`?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0&&F}),L=ed(_,{enabled:!D&&(b.type!==`menubar`&&v||N)}),R=hf({open:v,enabled:b.type===`menubar`,mouseDownAction:`open`}),z=dd([I,L]),B=b.type===`menubar`,V=J.useMemo(()=>({disabled:D,open:v}),[D,v]),ee=m.useState(`triggerProps`,T),H=[A,t,k,w,y],U=[z.getReferenceProps(),P??pn,ee,{"aria-haspopup":`menu`,id:h,onMouseDown:e=>{m.select(`open`)||(j.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),bc(e.currentTarget).addEventListener(`mouseup`,M,{once:!0}))}},B?{role:`menuitem`}:{},R,f,O],W=J.useRef(null),te=Y(e=>{br.flushSync(()=>{m.setOpen(!1,Q(Io,e.nativeEvent,e.currentTarget))}),Xi(W.current)?.focus()}),ne=Y(e=>{let t=m.select(`positionerElement`);if(t&&Zi(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{br.flushSync(()=>{m.setOpen(!1,Q(Io,e.nativeEvent,e.currentTarget))});let n=Yi(y.current);for(;n!==null&&dr(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=Ki(n),n===e)break}n?.focus()}}),re=Z(`button`,e,{enabled:!B,stateAttributesMapping:Bs,state:V,ref:H,props:U});return B?(0,q.jsx)(as,{tag:`button`,render:n,className:r,state:V,refs:H,props:U,stateAttributesMapping:Bs}):v?(0,q.jsxs)(J.Fragment,{children:[(0,q.jsx)(xc,{ref:W,onFocus:te},`${h}-pre-focus-guard`),(0,q.jsx)(J.Fragment,{children:re},h),(0,q.jsx)(xc,{ref:m.context.triggerFocusTargetRef,onFocus:ne},`${h}-post-focus-guard`)]}):(0,q.jsx)(J.Fragment,{children:re},h)});function vf(e,t){let n=ac(),[r,i]=J.useState(!1);return X(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function yf(){let e=Us(!0),t=js(!0),n=nf(!0);return J.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var bf=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return Z(`div`,e,{state:J.useMemo(()=>({orientation:i}),[i]),ref:t,props:[{role:`separator`,"aria-orientation":i},a]})}),xf=J.forwardRef(function(e,t){let{render:n,className:r,label:i,id:a,nativeButton:o=!1,openOnHover:s=!0,delay:c=100,closeDelay:l=0,disabled:u=!1,...d}=e,f=rs(),p=ks(),{store:m}=js(),h=yn(a),g=m.useState(`open`),_=m.useState(`floatingRootContext`),v=m.useState(`floatingTreeRoot`),y=Hu(h,m),b=J.useCallback(e=>{let t=y(e);return e!==null&&m.select(`open`)&&m.select(`activeTriggerId`)==null&&m.update({activeTriggerId:h,activeTriggerElement:e,closeDelay:l}),t},[y,l,m,h]),x=J.useRef(null),S=J.useCallback(e=>{x.current=e,m.set(`activeTriggerElement`,e)},[m]),C=uf();if(!C?.parentMenu)throw Error(kr(37));m.useSyncedValue(`closeDelay`,l);let w=C.parentMenu,T=w.useState(`itemProps`),E=w.useState(`isActive`,f.index),D=J.useMemo(()=>({type:`submenu-trigger`,setActive:()=>w.set(`activeIndex`,f.index)}),[w,f.index]),O=m.useState(`disabled`),k=u||O,{getItemProps:A,itemRef:j}=qs({closeOnClick:!1,disabled:k,highlighted:E,id:h,store:m,nativeButton:o,itemMetadata:D,nodeId:p?.nodeId}),M=m.useState(`hoverEnabled`),N=m.useState(`allowMouseEnter`),P=ud(_,{enabled:M&&s&&!k,handleClose:Ed({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:N?c:void 0,delay:{open:N?c:10**10,close:l},triggerElementRef:x,externalTree:v}),F=dd([Jc(_,{enabled:!k,event:`mousedown`,toggle:!s,ignoreMouse:s,stickIfOpen:!1})]),I=m.useState(`triggerProps`,!0);return delete I.id,Z(`div`,e,{state:J.useMemo(()=>({disabled:k,highlighted:E,open:g}),[k,E,g]),stateAttributesMapping:zs,props:[F.getReferenceProps(),P,I,T,{tabIndex:g||E?0:-1,onBlur(){E&&w.set(`activeIndex`,null)}},d,A],ref:[t,f.ref,j,b,S]})}),Sf=J.createContext(void 0);function Cf(){let e=J.useContext(Sf);if(e===void 0)throw Error(kr(53));return e}var wf=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});function Tf(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=n===`x`?`Inline`:`Block`;return n===`x`&&t===`margin`?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}var Ef=function(e){return e.orientation=`data-orientation`,e.hovering=`data-hovering`,e.scrolling=`data-scrolling`,e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),Df=`base-ui-disable-scrollbar`,Of={className:Df,element:(0,q.jsx)(`style`,{href:Df,precedence:`base-ui:low`,children:`.${Df}{scrollbar-width:none}.${Df}::-webkit-scrollbar{display:none}`})},kf=function(e){return e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),Af={hasOverflowX:e=>e?{[kf.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[kf.hasOverflowY]:``}:null,overflowXStart:e=>e?{[kf.overflowXStart]:``}:null,overflowXEnd:e=>e?{[kf.overflowXEnd]:``}:null,overflowYStart:e=>e?{[kf.overflowYStart]:``}:null,overflowYEnd:e=>e?{[kf.overflowYEnd]:``}:null,cornerHidden:()=>null},jf={width:0,height:0},Mf={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Nf=J.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,...a}=e,[o,s]=J.useState(!1),[c,l]=J.useState(!1),[u,d]=J.useState(!1),[f,p]=J.useState(jf),[m,h]=J.useState(jf),[g,_]=J.useState(!1),[v,y]=J.useState(Mf),b=yn(),x=J.useRef(null),S=J.useRef(null),C=J.useRef(null),w=J.useRef(null),T=J.useRef(null),E=J.useRef(null),D=J.useRef(null),O=J.useRef(!1),k=J.useRef(0),A=J.useRef(0),j=J.useRef(0),M=J.useRef(0),N=J.useRef(`vertical`),P=ac(),F=ac(),I=J.useRef({x:0,y:0}),[L,R]=J.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),z=Pf(i),B=Y(e=>{let t=e.x-I.current.x,n=e.y-I.current.y;I.current=e,n!==0&&(d(!0),P.start(500,()=>{d(!1)})),t!==0&&(l(!0),F.start(500,()=>{l(!1)}))}),V=Y(e=>{e.button===0&&(O.current=!0,k.current=e.clientY,A.current=e.clientX,N.current=e.currentTarget.getAttribute(Ef.orientation),S.current&&(j.current=S.current.scrollTop,M.current=S.current.scrollLeft),T.current&&N.current===`vertical`&&T.current.setPointerCapture(e.pointerId),E.current&&N.current===`horizontal`&&E.current.setPointerCapture(e.pointerId))}),ee=Y(e=>{if(!O.current)return;let t=e.clientY-k.current,n=e.clientX-A.current;if(S.current){let r=S.current.scrollHeight,i=S.current.clientHeight,a=S.current.scrollWidth,o=S.current.clientWidth;if(T.current&&C.current&&N.current===`vertical`){let n=Tf(C.current,`padding`,`y`),a=Tf(T.current,`margin`,`y`),o=T.current.offsetHeight,s=t/(C.current.offsetHeight-o-n-a);S.current.scrollTop=j.current+s*(r-i),e.preventDefault(),d(!0),P.start(500,()=>{d(!1)})}if(E.current&&w.current&&N.current===`horizontal`){let t=Tf(w.current,`padding`,`x`),r=Tf(E.current,`margin`,`x`),i=E.current.offsetWidth,s=n/(w.current.offsetWidth-i-t-r);S.current.scrollLeft=M.current+s*(a-o),e.preventDefault(),l(!0),F.start(500,()=>{l(!1)})}}}),H=Y(e=>{O.current=!1,T.current&&N.current===`vertical`&&T.current.releasePointerCapture(e.pointerId),E.current&&N.current===`horizontal`&&E.current.releasePointerCapture(e.pointerId)});function U(e){let t=e.pointerType===`touch`;if(_(t),!t){let t=dr(x.current,e.target);s(t)}}let W=J.useMemo(()=>({hasOverflowX:!L.scrollbarXHidden,hasOverflowY:!L.scrollbarYHidden,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:L.cornerHidden}),[L.scrollbarXHidden,L.scrollbarYHidden,L.cornerHidden,v]),te={role:`presentation`,onPointerEnter:U,onPointerMove:U,onPointerDown({pointerType:e}){_(e===`touch`)},onPointerLeave(){s(!1)},style:{position:`relative`,[wf.scrollAreaCornerHeight]:`${f.height}px`,[wf.scrollAreaCornerWidth]:`${f.width}px`}},ne=Z(`div`,e,{state:W,ref:[t,x],props:[te,a],stateAttributesMapping:Af}),re=J.useMemo(()=>({handlePointerDown:V,handlePointerMove:ee,handlePointerUp:H,handleScroll:B,cornerSize:f,setCornerSize:p,thumbSize:m,setThumbSize:h,touchModality:g,cornerRef:D,scrollingX:c,setScrollingX:l,scrollingY:u,setScrollingY:d,hovering:o,setHovering:s,viewportRef:S,rootRef:x,scrollbarYRef:C,scrollbarXRef:w,thumbYRef:T,thumbXRef:E,rootId:b,hiddenState:L,setHiddenState:R,overflowEdges:v,setOverflowEdges:y,viewportState:W,overflowEdgeThreshold:z}),[V,ee,H,B,f,m,g,D,c,l,u,d,o,s,S,x,C,w,T,E,b,L,v,W,z]);return(0,q.jsxs)(Sf.Provider,{value:re,children:[Of.element,ne]})});function Pf(e){if(typeof e==`number`){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}var Ff=J.createContext(void 0);function If(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Lf(e,t){if(typeof IntersectionObserver>`u`)return()=>{};let n=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}var Rf=function(e){return e.scrollAreaOverflowXStart=`--scroll-area-overflow-x-start`,e.scrollAreaOverflowXEnd=`--scroll-area-overflow-x-end`,e.scrollAreaOverflowYStart=`--scroll-area-overflow-y-start`,e.scrollAreaOverflowYEnd=`--scroll-area-overflow-y-end`,e}({}),zf=!1;function Bf(){zf||Yn||(typeof CSS<`u`&&`registerProperty`in CSS&&[Rf.scrollAreaOverflowXStart,Rf.scrollAreaOverflowXEnd,Rf.scrollAreaOverflowYStart,Rf.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),zf=!0)}var Vf=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{viewportRef:a,scrollbarYRef:o,scrollbarXRef:s,thumbYRef:c,thumbXRef:l,cornerRef:u,setCornerSize:d,setThumbSize:f,rootId:p,setHiddenState:m,hiddenState:h,handleScroll:g,setHovering:_,setOverflowEdges:v,overflowEdges:y,overflowEdgeThreshold:b}=Cf(),x=oo(),S=J.useRef(!0),C=ac(),w=ac();function T(){let e=a.current,t=o.current,n=s.current,r=c.current,i=l.current,p=u.current;if(!e)return;let h=e.scrollHeight,g=e.scrollWidth,_=e.clientHeight,y=e.clientWidth,S=e.scrollTop,C=e.scrollLeft;if(h===0||g===0)return;let w=_>=h,T=y>=g,E=y/g,D=_/h,O=Math.max(0,g-y),k=Math.max(0,h-_),A=0,j=0;T||(A=If(x===`rtl`?-C:C,0,O),j=O-A);let M=w?0:If(S,0,k),N=w?0:k-M,P=T?0:y,F=w?0:_,I=Tf(n,`padding`,`x`),L=Tf(t,`padding`,`y`),R=Tf(i,`margin`,`x`),z=Tf(r,`margin`,`y`),B=P-I-R,V=F-L-z,ee=n?Math.min(n.offsetWidth,B):B,H=t?Math.min(t.offsetHeight,V):V,U=Math.max(16,ee*E),W=Math.max(16,H*D);if(f(e=>e.height===W&&e.width===U?e:{width:U,height:W}),t&&r){let e=t.offsetHeight-W-L-z,n=h-_,i=n===0?0:S/n,a=Math.min(e,Math.max(0,i*e));r.style.transform=`translate3d(0,${a}px,0)`}if(n&&i){let e=n.offsetWidth-U-I-R,t=g-y,r=t===0?0:C/t,a=x===`rtl`?If(r*e,-e,0):If(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let te=If(A,0,O),ne=If(j,0,O),re=If(M,0,k),ie=If(N,0,k),ae=[[Rf.scrollAreaOverflowXStart,te],[Rf.scrollAreaOverflowXEnd,ne],[Rf.scrollAreaOverflowYStart,re],[Rf.scrollAreaOverflowYEnd,ie]];for(let[t,n]of ae)e.style.setProperty(t,`${n}px`);if(p){if(T||w)d({width:0,height:0});else if(!T&&!w){let e=t?.offsetWidth||0,r=n?.offsetHeight||0;d({width:e,height:r})}}m(e=>{let t=w||T;return e.scrollbarYHidden===w&&e.scrollbarXHidden===T&&e.cornerHidden===t?e:{scrollbarYHidden:w,scrollbarXHidden:T,cornerHidden:t}});let oe={xStart:!T&&te>b.xStart,xEnd:!T&&ne>b.xEnd,yStart:!w&&re>b.yStart,yEnd:!w&&ie>b.yEnd};v(e=>e.xStart===oe.xStart&&e.xEnd===oe.xEnd&&e.yStart===oe.yStart&&e.yEnd===oe.yEnd?e:oe)}let E=Y(()=>{br.flushSync(T)});X(()=>{if(a.current)return Bf(),Lf(a.current,E)},[E,a]),X(()=>{queueMicrotask(E)},[E,h,x]),X(()=>{a.current?.matches(`:hover`)&&_(!0)},[a,_]),J.useEffect(()=>{let e=a.current;if(typeof ResizeObserver>`u`||!e)return;let t=new ResizeObserver(E);return t.observe(e),w.start(0,()=>{Promise.all(e.getAnimations({subtree:!0}).map(e=>e.finished)).then(E).catch(()=>{})}),()=>{t.disconnect(),w.clear()}},[E,a,w]);function D(){S.current=!1}let O={role:`presentation`,...p&&{"data-id":`${p}-viewport`},...(!h.scrollbarXHidden||!h.scrollbarYHidden)&&{tabIndex:0},className:Of.className,style:{overflow:`scroll`},onScroll(){a.current&&(E(),S.current||g({x:a.current.scrollLeft,y:a.current.scrollTop}),C.start(100,()=>{S.current=!0}))},onWheel:D,onTouchMove:D,onPointerMove:D,onPointerEnter:D,onKeyDown:D},k=J.useMemo(()=>({hasOverflowX:!h.scrollbarXHidden,hasOverflowY:!h.scrollbarYHidden,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.cornerHidden}),[h.scrollbarXHidden,h.scrollbarYHidden,h.cornerHidden,y]),A=Z(`div`,e,{ref:[t,a],state:k,props:[O,i],stateAttributesMapping:Af}),j=J.useMemo(()=>({computeThumbPosition:E}),[E]);return(0,q.jsx)(Ff.Provider,{value:j,children:A})}),Hf=J.createContext(void 0);function Uf(){let e=J.useContext(Hf);if(e===void 0)throw Error(kr(54));return e}var Wf=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({}),Gf=J.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,...o}=e,{hovering:s,scrollingX:c,scrollingY:l,hiddenState:u,overflowEdges:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,rootId:y,thumbSize:b}=Cf(),x=J.useMemo(()=>({hovering:s,scrolling:{horizontal:c,vertical:l}[i],orientation:i,hasOverflowX:!u.scrollbarXHidden,hasOverflowY:!u.scrollbarYHidden,overflowXStart:d.xStart,overflowXEnd:d.xEnd,overflowYStart:d.yStart,overflowYEnd:d.yEnd,cornerHidden:u.cornerHidden}),[s,c,l,i,u,d]),S=oo();J.useEffect(()=>{let e=m.current,t=i===`vertical`?f.current:p.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),i===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(i===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;i===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[i,p,f,m]);let C={...y&&{"data-id":`${y}-scrollbar`},onPointerDown(e){if(e.button===0&&e.currentTarget===e.target&&m.current){if(h.current&&f.current&&i===`vertical`){let t=Tf(h.current,`margin`,`y`),n=Tf(f.current,`padding`,`y`),r=h.current.offsetHeight,i=f.current.getBoundingClientRect(),a=e.clientY-i.top-r/2-n+t/2,o=m.current.scrollHeight,s=m.current.clientHeight,c=a/(f.current.offsetHeight-r-n-t)*(o-s);m.current.scrollTop=c}if(g.current&&p.current&&i===`horizontal`){let t=Tf(g.current,`margin`,`x`),n=Tf(p.current,`padding`,`x`),r=g.current.offsetWidth,i=p.current.getBoundingClientRect(),a=e.clientX-i.left-r/2-n+t/2,o=m.current.scrollWidth,s=m.current.clientWidth,c=a/(p.current.offsetWidth-r-n-t),l;S===`rtl`?(l=(1-c)*(o-s),m.current.scrollLeft<=0&&(l=-l)):l=c*(o-s),m.current.scrollLeft=l}_(e)}},onPointerUp:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,...i===`vertical`&&{top:0,bottom:`var(${wf.scrollAreaCornerHeight})`,insetInlineEnd:0,[Wf.scrollAreaThumbHeight]:`${b.height}px`},...i===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${wf.scrollAreaCornerWidth})`,bottom:0,[Wf.scrollAreaThumbWidth]:`${b.width}px`}}},w=Z(`div`,e,{ref:[t,i===`vertical`?f:p],state:x,props:[C,o],stateAttributesMapping:Af}),T=J.useMemo(()=>({orientation:i}),[i]),E=i===`vertical`?u.scrollbarYHidden:u.scrollbarXHidden;return a||!E?(0,q.jsx)(Hf.Provider,{value:T,children:w}):null}),Kf=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{thumbYRef:a,thumbXRef:o,handlePointerDown:s,handlePointerMove:c,handlePointerUp:l,setScrollingX:u,setScrollingY:d}=Cf(),{orientation:f}=Uf(),p=J.useMemo(()=>({orientation:f}),[f]);return Z(`div`,e,{ref:[t,f===`vertical`?a:o],state:p,props:[{onPointerDown:s,onPointerMove:c,onPointerUp(e){f===`vertical`&&d(!1),f===`horizontal`&&u(!1),l(e)},style:{...f===`vertical`&&{height:`var(${Wf.scrollAreaThumbHeight})`},...f===`horizontal`&&{width:`var(${Wf.scrollAreaThumbWidth})`}}},i]})}),qf=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:o,hiddenState:s}=Cf(),c=Z(`div`,e,{ref:[t,a],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},i]});return s.cornerHidden?null:c});function Jf({className:e,children:t,viewportClassName:n,...r}){return(0,q.jsxs)(Nf,{"data-slot":`scroll-area`,className:K(`relative`,e),...r,children:[(0,q.jsx)(Vf,{"data-slot":`scroll-area-viewport`,className:K(`w-full rounded-[inherit] outline-none`,n??`h-full`),children:t}),(0,q.jsx)(Yf,{}),(0,q.jsx)(qf,{})]})}function Yf({className:e,...t}){return(0,q.jsx)(Gf,{"data-slot":`scroll-area-scrollbar`,orientation:`vertical`,className:K(`flex h-full w-2.5 touch-none select-none border-l border-l-transparent p-px`,e),...t,children:(0,q.jsx)(Kf,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground/70`})})}var Xf=`min-w-[13rem] rounded-md border border-[var(--color-border)] bg-[var(--color-card)] text-[var(--color-card-foreground)] shadow-md outline-none`;function Zf({children:e}){return(0,q.jsx)(Jf,{viewportClassName:`max-h-[var(--available-height)]`,children:(0,q.jsx)(`div`,{className:`p-1`,children:e})})}var Qf=`relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-[var(--color-accent)] data-[highlighted]:text-[var(--color-accent-foreground)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,$f=df,ep=ec,tp=ff,np=`data-[popup-open]:bg-[var(--color-accent)] data-[popup-open]:text-[var(--color-accent-foreground)]`;function rp({className:e,...t}){return(0,q.jsx)(_f,{className:typeof e==`function`?e:K(np,e),...t})}function ip({className:e,sideOffset:t=6,align:n=`start`,children:r,...i}){return(0,q.jsx)(Pd,{children:(0,q.jsx)(Kd,{sideOffset:t,align:n,className:`z-50 outline-none`,children:(0,q.jsx)(jd,{className:K(Xf,e),...i,children:(0,q.jsx)(Zf,{children:r})})})})}function ap({className:e,...t}){return(0,q.jsx)(nc,{className:K(Qf,e),...t})}function op({className:e,children:t,closeOnClick:n=!1,...r}){return(0,q.jsxs)(Xs,{className:K(Qf,e),closeOnClick:n,...r,children:[(0,q.jsx)(`span`,{className:`mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:(0,q.jsx)(Zs,{children:(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`})})}),t]})}function sp({className:e,children:t,...n}){return(0,q.jsxs)(xf,{className:K(Qf,`data-[popup-open]:bg-[var(--color-accent)]`,e),...n,children:[t,(0,q.jsx)(Tt,{className:`ml-auto h-3.5 w-3.5 shrink-0 opacity-70`})]})}function cp({className:e,children:t,...n}){return(0,q.jsx)(Pd,{children:(0,q.jsx)(Kd,{side:`right`,align:`start`,sideOffset:2,className:`z-50 outline-none`,children:(0,q.jsx)(jd,{className:K(Xf,e),...n,children:(0,q.jsx)(Zf,{children:t})})})})}function lp({className:e,...t}){return(0,q.jsx)(bf,{className:K(`-mx-1 my-1 h-px bg-[var(--color-border)]`,e),...t})}function up({className:e,...t}){return(0,q.jsx)(tc,{className:K(`px-2 py-1.5 text-xs font-semibold text-[var(--color-muted-foreground)]`,e),...t})}var dp=J.createContext(void 0);function fp(e){let t=J.useContext(dp);if(t===void 0&&!e)throw Error(kr(72));return t}var pp={...Yu,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeDelay:$(e=>e.closeDelay)},mp=class e extends zu{constructor(e){super({...hp(),...e},{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Ku},pp)}setOpen=(e,t)=>{let n=t.reason,r=n===ko,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?br.flushSync(o):o()};static useStore(t,n){let r=Qt(()=>t??new e(n)).current,i=Qu({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function hp(){return{...Ju(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function gp(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=mp.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;X(()=>{m&&t&&p.setOpen(!1,Q(Uo))},[m,t,p]),p.useSyncedValue(`disabled`,t),Wu(p);let{forceUnmount:v,transitionStatus:y}=Gu(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=J.useRef(null);X(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),X(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=J.useCallback(()=>{p.setOpen(!1,_p(p,Wo))},[p]);J.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=dd([ed(T,{enabled:!t}),cu(T,{enabled:!t,referencePress:!0}),Zc(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=J.useMemo(()=>E(),[E]),A=J.useMemo(()=>O(),[O]),j=J.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,q.jsx)(dp.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function _p(e,t){let n=Q(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var vp=J.createContext(void 0);function yp(){return J.useContext(vp)}var bp=J.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=fp(!0),f=i?.store??d;if(!f)throw Error(kr(82));let p=yn(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=J.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=Uu(p,_,f,{payload:a,closeDelay:y}),S=yp(),{delayRef:C,isInstantPhase:w,hasProvider:T}=yc(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),k=f.useState(`disableHoverablePopup`),A=ud(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!k&&O!==`both`?Ed():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),j=J.useMemo(()=>({open:g}),[g]),M=f.useState(`triggerProps`,x);return Z(`button`,e,{state:j,ref:[t,b,_],props:[A,M,{id:p},u],stateAttributesMapping:zs})}),xp=J.createContext(void 0);function Sp(){let e=J.useContext(xp);if(e===void 0)throw Error(kr(70));return e}var Cp=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=Ic({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,q.jsxs)(J.Fragment,{children:[c,s&&br.createPortal(n,s)]})}),wp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return fp().useState(`mounted`)||n?(0,q.jsx)(xp.Provider,{value:n,children:(0,q.jsx)(Cp,{ref:t,...r})}):null}),Tp=J.createContext(void 0);function Ep(){let e=J.useContext(Tp);if(e===void 0)throw Error(kr(71));return e}var Dp=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=eo,...g}=e,_=fp(),v=Sp(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=Ud({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:Bd}),D=J.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=J.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),k=J.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),A=Z(`div`,e,{state:O,props:[D,kd(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:Vs});return(0,q.jsx)(Tp.Provider,{value:k,children:A})});function Op(e){let t=zn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=En(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(Nr(n)!==a||Nr(r)!==o)&&(n=a,r=o),{width:n,height:r}}var kp=typeof ResizeObserver<`u`,Ap=()=>!0;function jp(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=Ap,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=J.useRef(!0),d=xs(t,!0,!1),f=ys(),p=J.useRef(null),m=Y(o),h=Y(s),g=J.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:pn},[c,l]);X(()=>{if(!i||!a()||!kp){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=Mp(t,`position`,`static`),o=Mp(t,`transform`,`none`),s=Mp(t,`scale`,`1`),c=Mp(n,`--available-width`,`max-content`),l=Mp(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=Op(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=Op(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function Mp(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var Np={...Vs,...Xo},Pp=J.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=fp(),{side:o,align:s}=Ep(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=oo();Ss({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}jp({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return od(g,{enabled:!b,closeDelay:x}),Z(`div`,e,{state:J.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,kd(d),i],stateAttributesMapping:Np})}),Fp=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=J.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=J.useMemo(()=>({open:t,close:n}),[t,n]);return(0,q.jsx)(vp.Provider,{value:i,children:(0,q.jsx)(vc,{delay:a,timeoutMs:r,children:e.children})})},Ip=gp;function Lp(e){return(0,q.jsx)(bp,{delay:0,...e})}function Rp({className:e,sideOffset:t=6,side:n,align:r,children:i,...a}){return(0,q.jsx)(wp,{children:(0,q.jsx)(Dp,{className:`z-50`,sideOffset:t,...n?{side:n}:{},...r?{align:r}:{},children:(0,q.jsx)(Pp,{role:`tooltip`,className:K(`rounded-md border border-border bg-card px-2 py-1 text-xs text-card-foreground shadow-md`,e),...a,children:i})})})}function zp({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(bf,{orientation:t,"data-slot":`separator`,className:K(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}function Bp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-md bg-accent`,e),...t})}var Vp=J.createContext(void 0);function Hp(e){let t=J.useContext(Vp);if(e===!1&&t===void 0)throw Error(kr(27));return t}var Up={...Vs,...Xo},Wp=J.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=Hp(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return Z(`div`,e,{state:J.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:Up,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),Gp=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=Hp(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Q(No,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=es({disabled:i,native:a});return Z(`button`,e,{state:J.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),Kp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Hp(),s=yn(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Z(`p`,e,{ref:t,props:[{id:s},a]})}),qp=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Jp=function(e){return e[e.open=Ms.open]=`open`,e[e.closed=Ms.closed]=`closed`,e[e.startingStyle=Ms.startingStyle]=`startingStyle`,e[e.endingStyle=Ms.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Yp=J.createContext(void 0);function Xp(){let e=J.useContext(Yp);if(e===void 0)throw Error(kr(26));return e}var Zp={...Vs,...Xo,nestedDialogOpen(e){return e?{[Jp.nestedDialogOpen]:``}:null}},Qp=J.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=Hp(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);Xp(),Ss({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e!==`touch`||s.context.popupRef.current}let S=i===void 0?x:i,C=h>0,w=Z(`div`,e,{state:J.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){da.has(e.key)&&e.stopPropagation()},style:{[qp.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:Zp});return(0,q.jsx)(qc,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),$p=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Hp(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,q.jsx)(Yp.Provider,{value:n,children:(0,q.jsxs)(Lc,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(Gd,{ref:i.context.internalBackdropRef,inert:Fd(!open)}),e.children]})}):null});function em(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=af(i);Wu(t);let{forceUnmount:d}=Gu(i,t,()=>{u()}),f=Y(e=>{let n=Q(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=J.useCallback(()=>{t.setOpen(!1,f(Wo))},[t,f]);J.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Qu({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=J.useState(0),_=h===0,v=Sd(m),y=cu(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=fr(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||dr(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});ef(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=dd([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),J.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=J.useMemo(()=>b(l),[b,l]),w=J.useMemo(()=>S(l),[S,l]),T=J.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var tm={...Yu,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},nm=class extends zu{constructor(e){super(rm(e),{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),triggerElements:new Ku,onOpenChange:void 0,onOpenChangeComplete:void 0},tm)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function rm(e={}){return{...Ju(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function im(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=Hp(!0),p=!!f,m=Qt(()=>l?.store??new nm({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);em({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=J.useMemo(()=>({store:m}),[m]);return(0,q.jsx)(Vp.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var am=J.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=Hp(),s=yn(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),Z(`h2`,e,{ref:t,props:[{id:s},a]})}),om=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,...l}=e,u=Hp(!0),d=c?.store??u?.store;if(!d)throw Error(kr(79));let f=yn(o),p=d.useState(`floatingRootContext`),m=d.useState(`isOpenedByTrigger`,f),h=J.useRef(null),{registerTrigger:g,isMountedByThisTrigger:_}=Uu(f,h,d,{payload:s}),{getButtonProps:v,buttonRef:y}=es({disabled:i,native:a}),b=dd([Jc(p,{enabled:p!=null})]),x=J.useMemo(()=>({disabled:i,open:m}),[i,m]),S=d.useState(`triggerProps`,_);return Z(`button`,e,{state:x,ref:[y,t,g,h],props:[b.getReferenceProps(),S,{[Qa]:``,id:f},l,v],stateAttributesMapping:zs})});function sm({label:e,description:t}){return(0,q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`leading-tight`,children:e}),t&&(0,q.jsx)(`span`,{className:`text-xs font-normal text-[var(--color-muted-foreground)]`,children:t})]})}var cm=new Map,lm=500;function um(e,t){cm.delete(e),cm.set(e,t),cm.size>lm&&cm.delete(cm.keys().next().value)}function dm(e){e===void 0?cm.clear():cm.delete(e)}var fm=new Set;function pm(e,t){cm.has(e)||fm.has(e)||(fm.add(e),t().then(t=>{cm.has(e)||um(e,t)}).catch(()=>{}).finally(()=>fm.delete(e)))}function mm(e,t,n,r,i){let a=e&&typeof i==`object`?i.remember:void 0,[o,s]=(0,J.useState)(()=>a!==void 0&&cm.has(a)?cm.get(a):t),[c,l]=(0,J.useState)(()=>a!==void 0&&cm.has(a)),u=(0,J.useRef)(t),d=(0,J.useRef)({live:!1}),f=(0,J.useRef)(r),p=(0,J.useCallback)((e,t)=>t().then(t=>{e.live&&(e.key!==void 0&&um(e.key,t),s(t),l(!0))}).catch(()=>{}),[]);(0,J.useEffect)(()=>{let t=e&&typeof i==`object`?i.remember:void 0,a={live:!0,...t===void 0?{}:{key:t}};if(d.current=a,t!==void 0&&cm.has(t)?(s(cm.get(t)),l(!0)):(i!==`previous`&&s(u.current),l(!1)),f.current=r,!e)return()=>void(a.live=!1);let o=()=>void p(a,e);if(o(),n===null)return()=>void(a.live=!1);let c=setInterval(o,n);return()=>{a.live=!1,clearInterval(c)}},r);let m=(0,J.useCallback)(()=>e?p(d.current,e):Promise.resolve(),r);if(!hm(f.current,r)){let t=e&&typeof i==`object`?i.remember:void 0;return t!==void 0&&cm.has(t)?{value:cm.get(t),reload:m,loaded:!0}:{value:i===`previous`?o:u.current,reload:m,loaded:!1}}return{value:o,reload:m,loaded:c}}function hm(e,t){return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))}function gm(e,t,n,r){return mm(e,t,null,n,r).value}function _m(e,t,n,r,i){return mm(e,t,n,r,i)}function vm({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex min-h-16 w-full min-w-0 rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm outline-none transition-colors`,`placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}function ym({open:e,onOpenChange:t,title:n,children:r}){return(0,q.jsx)(im,{open:e,onOpenChange:t,children:(0,q.jsxs)($p,{children:[(0,q.jsx)(Wp,{className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-[1px]`}),(0,q.jsxs)(Qp,{className:`fixed left-1/2 top-1/2 z-50 w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-4 text-card-foreground shadow-lg outline-none`,children:[(0,q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,q.jsx)(am,{className:`text-sm font-semibold`,children:n}),(0,q.jsx)(Gp,{"aria-label":`Close`,className:`rounded p-0.5 text-muted-foreground outline-none hover:text-foreground`,children:(0,q.jsx)(Ft,{className:`h-4 w-4`,"aria-hidden":!0})})]}),r]})]})})}function bm({onClose:e,onAdded:t}){let[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=y(n),d=u!==null,f=async()=>{if(!d||o)return;s(!0),l(null);let r=await mt(n,i.trim()||void 0).catch(()=>({ok:!1,error:`The machine could not be saved.`}));if(s(!1),!r.ok)return l(r.error);t(),e()};return(0,q.jsx)(ym,{open:!0,onOpenChange:t=>{t||e()},title:`Add a machine`,children:(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),f())},children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On the other machine, open Settings, find Devices, and press Add device. Copy the link under the code and paste it here. It works once, and for a short time.`}),(0,q.jsx)(Yt,{type:`text`,value:n,placeholder:`http://studio.local:4201/…`,autoFocus:!0,onChange:e=>r(e.target.value),className:`h-8 bg-background px-2 font-mono text-xs`}),(0,q.jsx)(Yt,{type:`text`,value:i,maxLength:60,placeholder:u?`Name (optional) — defaults to ${new URL(u.url).host}`:`Name (optional)`,onChange:e=>a(e.target.value),className:`h-8 bg-background px-2`}),n.trim()!==``&&!d&&(0,q.jsx)(`p`,{className:`text-xs text-warning`,children:`That is not the link another machine gives for a new device.`}),c&&(0,q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:c}),(0,q.jsxs)(`div`,{className:`mt-1 flex items-center justify-end gap-2`,children:[(0,q.jsx)(Ge,{type:`button`,variant:`ghost`,size:`sm`,onClick:e,children:`Cancel`}),(0,q.jsx)(Ge,{type:`button`,size:`sm`,disabled:!d||o,onClick:()=>void f(),children:o?`Adding…`:`Add machine`})]})]})})}var xm=`oa.pending-draft`;function Sm(){try{return globalThis.sessionStorage}catch{return}}function Cm(e){Sm()?.setItem(xm,e)}function wm(){let e=Sm();if(!e)return null;let t=e.getItem(xm);return t!==null&&e.removeItem(xm),t}var Tm=w(`onModels`);function Em(){return gm(Tm,void 0,[])}function Dm(e){return a.map(t=>{let n=e?.[t],r=n?`error`in n?n.error:`No models listed`:`Asking ${s[t]}…`;return{value:t,label:s[t],models:(n?.models??[]).map(e=>({value:e.id,label:e.name})),modelsNote:r}})}function Om(e,t){return(e?.models.find(e=>e.id===t)??e?.models.find(e=>e.resolvedId===t))?.name??t}function km(e,t,n){if(!t||!n)return[];let r=e?.[t]?.models??[];return(r.find(e=>e.id===n)??r.find(e=>e.resolvedId===n))?.efforts??[]}function Am(e,t,n){if(!t||!n)return;let r=e?.[t]?.models??[];return(r.find(e=>e.id===n)??r.find(e=>e.resolvedId===n))?.contextWindow}function jm(){return Dm(Em())}function Mm({text:e,label:t,className:n}){let[r,i]=(0,J.useState)(!1),a=(0,J.useRef)(void 0);(0,J.useEffect)(()=>()=>clearTimeout(a.current),[]);let o=()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),clearTimeout(a.current),a.current=setTimeout(()=>i(!1),1500)})},s=r?Ct:Et;return(0,q.jsxs)(Ip,{children:[(0,q.jsx)(Lp,{render:(0,q.jsx)(`button`,{type:`button`,onClick:o,"aria-label":t,className:K(`inline-flex shrink-0 items-center rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground`,r&&`text-success`,n)}),children:(0,q.jsx)(s,{className:`h-3 w-3`,"aria-hidden":!0})}),(0,q.jsx)(Rp,{children:r?`Copied`:t})]})}function Nm({text:e,compact:t=!1}){return(0,q.jsx)(`div`,{className:t?`space-y-1.5 text-xs leading-relaxed`:`space-y-2.5 text-sm leading-5`,children:qm(e.replace(/\r\n/g,`
|
|
18
|
-
`).split(`
|
|
19
|
-
`),t)})}function Pm(e){if(e.startsWith(`+`)&&!e.startsWith(`+++`))return`text-success`;if(e.startsWith(`-`)&&!e.startsWith(`---`))return`text-danger`;if(e.startsWith(`@@`))return`text-muted-foreground`}function Fm(e,t,n){let r=e.join(`
|
|
20
|
-
`);return(0,q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-muted/50`,children:[(0,q.jsxs)(`div`,{className:`flex h-7 items-center justify-between gap-2 border-b border-border/70 px-2 text-[11px] text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`truncate font-mono`,children:t}),(0,q.jsx)(Mm,{text:r,label:`Copy the code`})]}),(0,q.jsx)(`pre`,{className:`overflow-x-auto p-2 text-xs`,children:(0,q.jsx)(`code`,{children:t===`diff`?e.map((t,n)=>(0,q.jsx)(`span`,{className:Pm(t),children:n<e.length-1?`${t}\n`:t},n)):r})})]},n)}function Im(e){let t=e.trim().split(`|`);return t[0]?.trim()===``&&t.shift(),t[t.length-1]?.trim()===``&&t.pop(),t.map(e=>e.trim())}function Lm(e){return Im(e).length>0&&Im(e).every(e=>/^:?-+:?$/.test(e))}function Rm(e){return e.replace(/^[ \t]*/,e=>e.replace(/\t/g,` `))}function zm(e){return/^ */.exec(Rm(e))[0].length}function Bm(e,t){let n=0;for(let r=0;n<e.length;n++){let i=e[n]===` `?1:e[n]===` `?4:0;if(i===0||r+i>t)break;r+=i}return e.slice(n)}function Vm(e){let t=/^[ \t]*[-*]\s+(.*)$/.exec(e);if(t)return{indent:zm(e),ordered:!1,start:1,text:t[1]};let n=/^[ \t]*(\d{1,3})[.)]\s+(.*)$/.exec(e);return n?{indent:zm(e),ordered:!0,start:Number(n[1]),text:n[2]}:null}function Hm(e){return/^\s*(?:([-*_])\1{2,}|([-*_])(?: \2){2,})\s*$/.test(e)}function Um(e){return/^\s*```/.test(e)}var Wm=12;function Gm(e,t){let n=Vm(e[t]).indent,r=t+1,i=!1;for(let a=t+1;a<e.length;a++){let t=e[a];if(i){Um(t)&&(i=!1),r=a+1;continue}if(!t.trim())continue;let o=zm(t)>=n+2,s=Vm(t)!==null&&!Hm(t);if(!o&&!s)break;o&&Um(t)&&(i=!0),r=a+1}return r}function Km(e,t,n,r){let i=[],a=Vm(e[0]),o=a.ordered,s=a.start,c=[],l=null,u=[],d=1/0,f=!1,p=[],m=()=>{f&&(f=!1,p.at(-1)[1]=u.length-1)},h=()=>{if(l===null)return;m();let e=/^\[([ xX])\]\s+(.*)$/.exec(l),r=u.map(()=>d);for(let[e,t]of p){let n=t=>t>e&&!Um(u[t]),i=d;for(let r=e;r<=t;r++)n(r)&&u[r].trim()&&(i=Math.min(i,zm(u[r])));for(let a=e;a<=t;a++)n(a)&&(r[a]=i)}let i=u.length>0?qm(u.map((e,t)=>Bm(e,r[t])),t,n+1):null;c.push(e?(0,q.jsxs)(`li`,{className:`list-none -ml-4 flex items-start gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e[1].toLowerCase()===`x`,readOnly:!0,className:`mt-1`}),i?(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsx)(`span`,{children:eh(e[2])}),i]}):(0,q.jsx)(`span`,{children:eh(e[2])})]},c.length):(0,q.jsxs)(`li`,{className:i?`space-y-1`:void 0,children:[eh(l),i]},c.length)),l=null,u=[],d=1/0,p=[]},g=()=>{h(),c.length!==0&&(i.push(o?(0,q.jsx)(`ol`,{start:s,className:`ml-6 list-decimal space-y-1 [&>li]:pl-1`,children:c},`${r}-${i.length}`):(0,q.jsx)(`ul`,{className:`ml-6 list-disc space-y-1 [&>li]:pl-1`,children:c},`${r}-${i.length}`)),c=[])};for(let t of e){if(f){u.push(t),Um(t)&&m();continue}let e=Vm(t);e&&e.indent<a.indent+2?(e.ordered!==o&&(g(),o=e.ordered,s=e.start),h(),l=e.text):t.trim()?(u.push(t),d=Math.min(d,zm(t)),Um(t)&&(f=!0,p.push([u.length-1,u.length-1]))):u.length>0&&u.push(t)}return g(),i}function qm(e,t=!1,n=0){let r=[],i=null,a=[],o=0,s=()=>{if(a.length===0)return;let e=a;if(a=[],e.length>=2&&Lm(e[1])){let t=Im(e[0]),n=e.slice(2).map(Im);r.push((0,q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,q.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsx)(`tr`,{children:t.map((e,t)=>(0,q.jsx)(`th`,{className:`border-b border-border px-2 py-1 text-left font-semibold`,children:eh(e)},t))})}),(0,q.jsx)(`tbody`,{children:n.map((e,n)=>(0,q.jsx)(`tr`,{children:t.map((t,n)=>(0,q.jsx)(`td`,{className:`border-b border-border/50 px-2 py-1 align-top`,children:eh(e[n]??``)},n))},n))})]})},o++))}else for(let t of e)r.push((0,q.jsx)(`p`,{children:eh(t)},o++))};for(let c=0;c<e.length;c++){let l=e[c],u=/^\s*```\s*([\w+-]*)/.exec(l);if(u){i===null?(s(),i={lines:[],language:u[1].toLowerCase()}):(r.push(Fm(i.lines,i.language,o++)),i=null);continue}if(i!==null){i.lines.push(l);continue}if(/^\s*\|.*\|\s*$/.test(l)){a.push(l);continue}s();let d=/^(#{1,6})\s+(.*)$/.exec(l);if(d){let e=d[1].length,n=t?[`text-sm`,`text-sm`,`text-xs`,`text-xs`,`text-xs`,`text-xs`]:[`text-lg`,`text-base`,`text-sm`,`text-sm`,`text-sm`,`text-sm`];r.push((0,q.jsx)(`p`,{className:`font-semibold ${n[e-1]}`,children:eh(d[2])},o++));continue}if(Hm(l)){r.push((0,q.jsx)(`hr`,{className:`border-border`},o++));continue}if(n<Wm&&/^\s*>/.test(l)){let i=c;for(;i<e.length&&/^\s*>/.test(e[i]);)i++;let a=e.slice(c,i).map(e=>e.replace(/^\s*>\s?/,``));r.push((0,q.jsx)(`blockquote`,{className:`space-y-1.5 border-l-2 border-border pl-3 text-muted-foreground`,children:qm(a,t,n+1)},o++)),c=i-1;continue}if(n<Wm&&Vm(l)){let i=Gm(e,c);for(let a of Km(e.slice(c,i),t,n,o++))r.push(a);c=i-1;continue}l.trim()&&r.push((0,q.jsx)(`p`,{children:eh(l)},o++))}return s(),i!==null&&r.push(Fm(i.lines,i.language,o++)),r}var Jm=`text-primary underline underline-offset-2 break-all`,Ym=`rounded-[5px] border-[0.5px] border-foreground/10 bg-foreground/5 px-[3px] py-px text-[0.9em] text-(--code-foreground)`,Xm=`whitespace-nowrap rounded bg-primary/10 px-1.5 text-primary hover:bg-primary/15`,Zm=(0,J.createContext)(void 0);function Qm({number:e}){let t=(0,J.useContext)(Zm);return t?(0,q.jsxs)(`a`,{href:`${t}/issues/${e}`,target:`_blank`,rel:`noreferrer`,className:Xm,children:[`#`,e]}):`#${e}`}function $m(e,t,n){return(0,q.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:Jm,children:t},n)}function eh(e){let t=[],n=/(`[^`]+`|\[[^\]]+\]\((?:https?:\/\/)?[^\s):]+\)|\*\*[^*]+\*\*|\*[^*]+\*|https?:\/\/[^\s<>)\]]+|(?<![\w/&#])#\d+\b)/g,r=0,i,a=0;for(;i=n.exec(e);){i.index>r&&t.push((0,q.jsx)(J.Fragment,{children:e.slice(r,i.index)},a++));let n=i[0];if(n.startsWith("`"))t.push((0,q.jsx)(`code`,{className:Ym,children:n.slice(1,-1)},a++));else if(n.startsWith(`[`)){let e=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(n),r=/^\[([^\]]+)\]\(([^\s):]+)\)$/.exec(n);e?t.push($m(e[2],e[1],a++)):r?t.push((0,q.jsx)(`code`,{title:r[2],className:Ym,children:r[1]},a++)):t.push((0,q.jsx)(J.Fragment,{children:n},a++))}else n.startsWith(`**`)?t.push((0,q.jsx)(`strong`,{children:eh(n.slice(2,-2))},a++)):n.startsWith(`*`)?t.push((0,q.jsx)(`em`,{children:eh(n.slice(1,-1))},a++)):n.startsWith(`#`)?t.push((0,q.jsx)(Qm,{number:n.slice(1)},a++)):t.push($m(n,n,a++));r=i.index+n.length}return r<e.length&&t.push((0,q.jsx)(J.Fragment,{children:e.slice(r)},a++)),t}function th(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:o,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Hp(),d=!!u,f=Qt(()=>s?.store??new nm({open:n??r,activeTriggerId:c===void 0?l:c,modal:!0,disablePointerDismissal:!0,nested:d,role:`alertdialog`})).current;f.useControlledProp(`open`,n,r),f.useControlledProp(`activeTriggerId`,c,l),f.useSyncedValue(`nested`,d),f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a);let p=f.useState(`payload`);em({store:f,actionsRef:o,parentContext:u?.store.context,onOpenChange:i,triggerIdProp:c});let m=J.useMemo(()=>({store:f}),[f]);return(0,q.jsx)(Vp.Provider,{value:m,children:typeof t==`function`?t({payload:p}):t})}function nh({trigger:e,open:t,onOpenChange:n,title:r,body:i,confirmLabel:a,confirmBusyLabel:o=`Working…`,onConfirm:s,onSuccess:c,fallbackError:l=`Something went wrong.`,destructive:u=!0}){let[d,f]=(0,J.useState)(!1),p=t??d,m=n??f,{busy:h,error:g,run:_,reset:v}=qt();return(0,q.jsxs)(th,{open:p,onOpenChange:e=>{h||(m(e),e&&v())},children:[e&&(0,q.jsx)(om,{render:e}),(0,q.jsxs)($p,{children:[(0,q.jsx)(Wp,{className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-[1px]`}),(0,q.jsxs)(Qp,{className:`fixed left-1/2 top-1/2 z-50 w-[min(26rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-lg`,children:[(0,q.jsx)(am,{className:`text-sm font-semibold`,children:r}),(0,q.jsx)(Kp,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:i}),g&&(0,q.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:g}),(0,q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,q.jsx)(Gp,{render:(0,q.jsx)(Ge,{variant:`outline`,size:`sm`,disabled:h,children:`Cancel`})}),(0,q.jsx)(Ge,{variant:u?`destructive`:`default`,size:`sm`,disabled:h,onClick:()=>{_(s,l).then(e=>{e.ok&&(m(!1),queueMicrotask(()=>c?.()))})},className:K(h&&`cursor-progress`),children:h?o:a})]})]})]})]})}var rh=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,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}({});function ih(e){return J.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[rh.checked]:``}:{[rh.unchecked]:``}},...mo}),[e.indeterminate])}var ah=J.createContext(void 0);function oh(e=!0){let t=J.useContext(ah);if(t===void 0&&!e)throw Error(kr(3));return t}var sh=J.createContext(void 0);function ch(){let e=J.useContext(sh);if(e===void 0)throw Error(kr(14));return e}var lh=`data-parent`,uh=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,disabled:a=!1,id:o,indeterminate:s=!1,inputRef:c,name:l,onCheckedChange:u,parent:d=!1,readOnly:f=!1,render:p,required:m=!1,uncheckedValue:h,value:g,nativeButton:_=!1,...v}=e,{clearErrors:y}=uo(),{disabled:b,name:x,setDirty:S,setFilled:C,setFocused:w,setTouched:T,state:E,validationMode:D,validityData:O,shouldValidateOnChange:k,validation:A}=go(),j=ss(),{labelId:M,controlId:N,setControlId:P,getDescriptionProps:F}=xo(),I=oh(),L=I?.parent,R=L&&I.allValues,z=b||j.disabled||I?.disabled||a,B=x??l,V=g??B,ee=yn(),H=yn(),U=N;R?U=d?H:`${L.id}-${V}`:o&&(U=o);let W={};R&&(d?W=I.parent.getParentProps():V&&(W=I.parent.getChildProps(V)));let te=Y(u),{checked:ne=n,indeterminate:re=s,onCheckedChange:ie,...ae}=W,oe=I?.value,se=I?.setValue,ce=I?.defaultValue,le=J.useRef(null),{getButtonProps:ue,buttonRef:de}=es({disabled:z,native:_}),fe=I?.validation??A,[pe,me]=Xt({controlled:V&&oe&&!d?oe.includes(V):ne,default:V&&ce&&!d?ce.includes(V):i,name:`Checkbox`,state:`checked`});X(()=>{if(P!==dn)return P(U),()=>{P(void 0)}},[U,I,P,d]),_o({enabled:!I,id:ee,commit:fe.commit,value:pe,controlRef:le,name:B,getValue:()=>pe});let G=J.useRef(null),he=$t(c,G,fe.inputRef);X(()=>{G.current&&(G.current.indeterminate=re,pe&&C(!0))},[pe,re,C]),So(pe,()=>{I&&!d||(y(B),C(pe),S(pe!==O.initialValue),k()?fe.commit(pe):fe.commit(pe,!0))});let ge=Ba({checked:pe,disabled:z,name:d?void 0:B,id:U??void 0,required:m,ref:he,style:un,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Q(Do,e.nativeEvent);if(ie?.(t,n),te(t,n),!n.isCanceled&&(me(t),V&&oe&&se&&!d)){let e=t?[...oe,V]:oe.filter(e=>e!==V);se(e,n)}},onFocus(){le.current?.focus()}},g===void 0?pn:{value:(I?pe&&g:g)||``},F,I?fe.getValidationProps:fe.getInputValidationProps),_e=R?!!ne:pe,ve=R&&re||s;J.useEffect(()=>{L&&V&&L.disabledStatesRef.current.set(V,z)},[L,z,V]);let ye=J.useMemo(()=>({...E,checked:_e,disabled:z,readOnly:f,required:m,indeterminate:ve}),[E,_e,z,f,m,ve]),be=ih(ye),xe=Z(`span`,e,{state:ye,ref:[de,le,t,I?.registerControlRef],props:[{id:ee,role:`checkbox`,"aria-checked":re?`mixed`:pe,"aria-readonly":f||void 0,"aria-required":m||void 0,"aria-labelledby":M,[lh]:d?``:void 0,onFocus(){w(!0)},onBlur(){let e=G.current;e&&(T(!0),w(!1),D===`onBlur`&&fe.commit(I?oe:e.checked))},onClick(e){f||z||(e.preventDefault(),G.current?.click())}},F,fe.getValidationProps,v,ae,ue],stateAttributesMapping:be});return(0,q.jsxs)(sh.Provider,{value:ye,children:[xe,!pe&&!I&&B&&!d&&h!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:B,value:h}),(0,q.jsx)(`input`,{...ge})]})}),dh=J.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=ch(),s=o.checked||o.indeterminate,{transitionStatus:c,setMounted:l}=Cs(s),u=J.useRef(null),d=J.useMemo(()=>({...o,transitionStatus:c}),[o,c]);Ss({open:s,ref:u,onComplete(){s||l(!1)}});let f=ih(o),p=J.useMemo(()=>({...f,...Xo,...mo}),[f]),m=i||s,h=Z(`span`,e,{enabled:m,ref:[t,u],state:d,stateAttributesMapping:p,props:a});return m?h:null});function fh({className:e,disabled:t=!1,...n}){return(0,q.jsx)(uh,{disabled:t,className:K(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-border bg-transparent`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(dh,{className:`flex items-center justify-center text-current`,children:(0,q.jsx)(Ct,{className:`h-3 w-3`,strokeWidth:3,"aria-hidden":!0})})})}var ph=w(`onModules`),mh=w(`runModuleCommand`),hh=w(`runComputerCommand`),gh=w(`readModule`);function _h({className:e,...t}){return(0,q.jsx)(`span`,{className:K(`inline-flex items-center rounded-full border border-[var(--color-border)] px-2 py-0.5 text-xs font-medium`,e),...t})}function vh({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`rounded-lg border border-border bg-card text-card-foreground`,e),...t})}function yh({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`flex flex-col gap-1 px-4 pt-4`,e),...t})}function bh({className:e,...t}){return(0,q.jsx)(`h3`,{className:K(`text-sm font-semibold`,e),...t})}function xh({icon:e,children:t,segment:n,onOpen:r,className:i}){return(0,q.jsx)(bh,{className:K(`text-base`,i),children:(0,q.jsxs)(`a`,{href:N(n),onClick:e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),r())},className:`group -mx-1 inline-flex items-center gap-2 rounded px-1 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,children:[e,t,(0,q.jsx)(St,{className:`h-3.5 w-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 max-md:opacity-100`,"aria-hidden":!0})]})})}function Sh({className:e,...t}){return(0,q.jsx)(`div`,{className:K(`p-4`,e),...t})}var Ch=J.createContext(void 0);function wh(){let e=J.useContext(Ch);if(e===void 0)throw Error(kr(63));return e}var Th=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,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}({}),Eh={...mo,checked(e){return e?{[Th.checked]:``}:{[Th.unchecked]:``}}},Dh=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:l,readOnly:u=!1,required:d=!1,disabled:f=!1,render:p,uncheckedValue:m,...h}=e,{clearErrors:g}=uo(),{state:_,setTouched:v,setDirty:y,validityData:b,setFilled:x,setFocused:S,shouldValidateOnChange:C,validationMode:w,disabled:T,name:E,validation:D}=go(),{labelId:O}=xo(),k=T||f,A=E??s,j=Y(l),M=J.useRef(null),N=$t(M,o,D.inputRef),P=J.useRef(null),F=yn(),I=cs({id:a,implicit:!1,controlRef:P}),[L,R]=Xt({controlled:n,default:!!i,name:`Switch`,state:`checked`});_o({id:F,commit:D.commit,value:L,controlRef:P,name:A,getValue:()=>L}),X(()=>{M.current&&x(M.current.checked)},[M,x]),So(L,()=>{g(A),y(L!==b.initialValue),x(L),C()?D.commit(L):D.commit(L,!0)});let{getButtonProps:z,buttonRef:B}=es({disabled:k,native:c}),V={id:F,role:`switch`,"aria-checked":L,"aria-readonly":u||void 0,"aria-labelledby":O,onFocus(){k||S(!0)},onBlur(){let e=M.current;!e||k||(v(!0),S(!1),w===`onBlur`&&D.commit(e.checked))},onClick(e){u||k||(e.preventDefault(),M?.current?.click())}},ee=J.useMemo(()=>Ba({checked:L,disabled:k,id:I,name:A,required:d,style:un,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:N,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Q(Do,e.nativeEvent);j?.(t,n),!n.isCanceled&&R(t)},onFocus(){P.current?.focus()}},D.getInputValidationProps),[L,k,N,I,A,j,d,R,D]),H=J.useMemo(()=>({..._,checked:L,disabled:k,readOnly:u,required:d}),[_,L,k,u,d]),U=Z(`span`,e,{state:H,ref:[t,P,B],props:[V,D.getValidationProps,h,z],stateAttributesMapping:Eh});return(0,q.jsxs)(Ch.Provider,{value:H,children:[U,!L&&A&&m!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:A,value:m}),(0,q.jsx)(`input`,{...ee})]})}),Oh=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=go(),o=wh();return Z(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:Eh,props:i})});function kh({className:e,disabled:t=!1,...n}){return(0,q.jsx)(Dh,{disabled:t,className:K(`inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted p-0.5`,`transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[checked]:border-primary data-[checked]:bg-primary`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:(0,q.jsx)(Oh,{className:`block h-3.5 w-3.5 rounded-full bg-foreground/70 transition-transform data-[checked]:translate-x-4 data-[checked]:bg-primary-foreground`})})}function Ah({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,q.jsx)(`table`,{"data-slot":`table`,className:K(`w-full caption-bottom text-left text-sm`,e),...t})})}function jh({className:e,...t}){return(0,q.jsx)(`thead`,{"data-slot":`table-header`,className:K(`text-xs text-muted-foreground [&_tr]:border-b [&_tr]:border-border [&_tr:hover]:bg-transparent`,e),...t})}function Mh({className:e,...t}){return(0,q.jsx)(`tbody`,{"data-slot":`table-body`,className:K(`[&_tr:last-child]:border-0`,e),...t})}function Nh({className:e,...t}){return(0,q.jsx)(`tr`,{"data-slot":`table-row`,className:K(`border-b border-border transition-colors hover:bg-accent/60`,e),...t})}function Ph({className:e,...t}){return(0,q.jsx)(`th`,{"data-slot":`table-head`,className:K(`h-9 whitespace-nowrap px-3 text-left align-middle font-normal first:pl-0 last:pr-0`,e),...t})}function Fh({className:e,...t}){return(0,q.jsx)(`td`,{"data-slot":`table-cell`,className:K(`px-3 py-2 align-middle first:pl-0 last:pr-0`,e),...t})}function Ih({className:e,...t}){return(0,q.jsx)(`label`,{"data-slot":`label`,className:K(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm leading-snug has-[[data-disabled]]:opacity-50`,e),...t})}function Lh(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}var Rh=J.createContext(null),zh=J.createContext(null);function Bh(){let e=J.useContext(Rh);if(e===null)throw Error(kr(60));return e}function Vh(){let e=J.useContext(zh);if(e===null)throw Error(kr(61));return e}var Hh=(e,t)=>Object.is(e,t);function Uh(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Wh(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&Uh(e,t,n))}function Gh(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&Uh(e,t,n))}function Kh(e,t,n){return e.filter(e=>!Uh(e,t,n))}function qh(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Jh(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Yh(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return qh(e)}function Xh(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?qh(e.value):qh(e)}function Zh(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??Yh(e,n);if(Array.isArray(t)){let r=Jh(t)?t.flatMap(e=>e.items):t;if(e==null){let t=r.find(e=>e.value==null);return t&&t.label!=null?t.label:Yh(e,n)}if(typeof e!=`object`){let t=r.find(t=>t&&t.value===e);return t&&t.label!=null?t.label:Yh(e,n)}if(`value`in e){let t=r.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return Yh(e,n)}function Qh(e,t){return!Array.isArray(e)||e.length===0?``:e.map(e=>Yh(e,t)).join(`, `)}var $h={id:$(e=>e.id),modal:$(e=>e.modal),multiple:$(e=>e.multiple),items:$(e=>e.items),itemToStringLabel:$(e=>e.itemToStringLabel),itemToStringValue:$(e=>e.itemToStringValue),isItemEqualToValue:$(e=>e.isItemEqualToValue),value:$(e=>e.value),open:$(e=>e.open),mounted:$(e=>e.mounted),forceMount:$(e=>e.forceMount),transitionStatus:$(e=>e.transitionStatus),touchModality:$(e=>e.touchModality),activeIndex:$(e=>e.activeIndex),selectedIndex:$(e=>e.selectedIndex),isActive:$((e,t)=>e.activeIndex===t),isSelected:$((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Uh(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null||Uh(i,n,r)}),isSelectedByFocus:$((e,t)=>e.selectedIndex===t),popupProps:$(e=>e.popupProps),triggerProps:$(e=>e.triggerProps),triggerElement:$(e=>e.triggerElement),positionerElement:$(e=>e.positionerElement),listElement:$(e=>e.listElement),scrollUpArrowVisible:$(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$(e=>e.scrollDownArrowVisible),hasScrollArrows:$(e=>e.hasScrollArrows),serializedValue:$(e=>{let{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?``:Xh(n,r)})};function eg(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,disabled:l=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:h,items:g,multiple:_=!1,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b=Hh,highlightItemOnHover:x=!0,children:S}=e,{clearErrors:C}=uo(),{setDirty:w,shouldValidateOnChange:T,validityData:E,setFilled:D,name:O,disabled:k,validation:A}=go(),{controlId:j}=xo(),M=cs({id:t}),N=k||l,P=O??c,[F,I]=Xt({controlled:n,default:_?r??fn:r,name:`Select`,state:`value`}),[L,R]=Xt({controlled:a,default:o,name:`Select`,state:`open`}),z=J.useRef([]),B=J.useRef([]),V=J.useRef(null),ee=J.useRef(null),H=J.useRef(0),U=J.useRef(null),W=J.useRef([]),te=J.useRef(!1),ne=J.useRef(!1),re=J.useRef(null),ie=J.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ae=J.useRef(!1),{mounted:oe,setMounted:se,transitionStatus:ce}=Cs(L),le=Qt(()=>new Ru({id:M,modal:f,multiple:_,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b,value:F,open:L,mounted:oe,transitionStatus:ce,items:g,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ue=Fu(le,$h.activeIndex),de=Fu(le,$h.selectedIndex),fe=Fu(le,$h.triggerElement),pe=Fu(le,$h.positionerElement),me=J.useMemo(()=>_&&Array.isArray(F)&&F.length===0?``:Xh(F,y),[_,F,y]),G=fs(le.state.triggerElement);_o({id:M,commit:A.commit,value:F,controlRef:G,name:P,getValue:()=>F});let he=J.useRef(F);X(()=>{F!==he.current&&le.set(`forceMount`,!0)},[le,F]),X(()=>{D(F!==null)},[F,D]),X(function(){if(L)return;let e=W.current;if(_){let t=Array.isArray(F)?F:[];if(t.length===0){le.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Gh(e,n,b);le.set(`selectedIndex`,r===-1?null:r);return}let t=Gh(e,F,b);le.set(`selectedIndex`,t===-1?null:t)},[_,L,F,W,b,le]),So(F,()=>{C(P),w(F!==E.initialValue),T()?A.commit(F):A.commit(F,!0)});let ge=Y((e,t)=>{if(s?.(e,t),!t.isCanceled&&(R(e),!e&&le.state.activeIndex!==null)){let e=z.current[le.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),_e=Y(()=>{se(!1),le.set(`activeIndex`,null),h?.(!1)});Ss({enabled:!p,open:L,ref:V,onComplete(){L||_e()}}),J.useImperativeHandle(p,()=>({unmount:_e}),[_e]);let ve=Y((e,t)=>{i?.(e,t),!t.isCanceled&&I(e)}),ye=Y(()=>{let e=le.state.listElement||V.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;le.state.scrollUpArrowVisible!==r&&le.set(`scrollUpArrowVisible`,r),le.state.scrollDownArrowVisible!==i&&le.set(`scrollDownArrowVisible`,i)}),be=Xu({open:L,onOpenChange:ge,elements:{reference:fe,floating:pe}}),{getReferenceProps:xe,getFloatingProps:Se,getItemProps:Ce}=dd([Jc(be,{enabled:!u&&!N,event:`mousedown`}),cu(be,{bubbles:!1}),bd(be,{enabled:!u&&!N,listRef:z,activeIndex:ue,selectedIndex:de,disabledIndices:fn,onNavigate(e){e===null&&!L||le.set(`activeIndex`,e)},focusItemOnHover:!1}),Cd(be,{enabled:!u&&!N&&(L||!_),listRef:B,activeIndex:ue,selectedIndex:de,onMatch(e){L?le.set(`activeIndex`,e):ve(W.current[e],Q(`none`))},onTypingChange(e){te.current=e}})]);Lh(()=>{le.update({popupProps:Se(),triggerProps:xe()})}),X(()=>{le.update({id:M,modal:f,multiple:_,value:F,open:L,mounted:oe,transitionStatus:ce,popupProps:Se(),triggerProps:xe(),items:g,itemToStringLabel:v,itemToStringValue:y,isItemEqualToValue:b})},[le,M,f,_,F,L,oe,ce,Se,xe,g,v,y,b]);let we=J.useMemo(()=>({store:le,name:P,required:d,disabled:N,readOnly:u,multiple:_,itemToStringLabel:v,itemToStringValue:y,highlightItemOnHover:x,setValue:ve,setOpen:ge,listRef:z,popupRef:V,scrollHandlerRef:ee,handleScrollArrowVisibility:ye,scrollArrowsMountedCountRef:H,getItemProps:Ce,events:be.context.events,valueRef:U,valuesRef:W,labelsRef:B,typingRef:te,selectionRef:ie,selectedItemTextRef:re,validation:A,onOpenChangeComplete:h,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:ae,initialValueRef:he}),[le,P,d,N,u,_,v,y,x,ve,ge,Ce,be.context.events,A,h,ye]),Te=$t(m,A.inputRef),Ee=_&&Array.isArray(F)&&F.length>0,De=J.useMemo(()=>!_||!Array.isArray(F)||!P?null:F.map(e=>{let t=Xh(e,y);return(0,q.jsx)(`input`,{type:`hidden`,name:P,value:t},t)}),[_,F,P,y]);return(0,q.jsx)(Rh.Provider,{value:we,children:(0,q.jsxs)(zh.Provider,{value:be,children:[S,(0,q.jsx)(`input`,{...A.getInputValidationProps({onFocus(){le.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Q(Do,e.nativeEvent);function r(){if(_)return;let e=W.current.find(e=>Xh(e,y).toLowerCase()===t.toLowerCase());e!=null&&(w(e!==E.initialValue),ve(e,n),T()&&A.commit(e))}le.set(`forceMount`,!0),queueMicrotask(r)}}),id:t||j||void 0,name:_?void 0:P,value:me,disabled:N,required:d&&!Ee,readOnly:u,ref:Te,style:un,tabIndex:-1,"aria-hidden":!0}),De]})})}var tg=2,ng={...Bs,...mo,value:()=>null},rg=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{setTouched:s,setFocused:c,validationMode:l,state:u,disabled:d}=go(),{labelId:f}=xo(),{store:p,setOpen:m,selectionRef:h,validation:g,readOnly:_,alignItemWithTriggerActiveRef:v,disabled:y,keyboardActiveRef:b}=Bh(),x=d||y||i,S=Fu(p,$h.open),C=Fu(p,$h.value),w=Fu(p,$h.triggerProps),T=Fu(p,$h.positionerElement),E=Fu(p,$h.listElement),D=Fu(p,$h.serializedValue),O=fs(T),k=J.useRef(null),A=ac(),j=ac(),{getButtonProps:M,buttonRef:N}=es({disabled:x,native:a}),P=$t(t,k,N,Y(e=>{p.set(`triggerElement`,e)})),F=ac(),I=ac();J.useEffect(()=>{if(S)return I.start(200,()=>{h.current.allowUnselectedMouseUp=!0,F.start(200,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{F.clear(),I.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[S,h,j,F,I]);let L=J.useMemo(()=>E?.id??yr(T)?.id,[E,T]),R=Ba(w,{role:`combobox`,"aria-expanded":S?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":S?L:void 0,"aria-labelledby":f,"aria-readonly":_||void 0,tabIndex:x?-1:0,ref:P,onFocus(e){c(!0),S&&v.current&&m(!1,Q(Io,e.nativeEvent)),A.start(0,()=>{p.set(`forceMount`,!0)})},onBlur(){s(!0),c(!1),l===`onBlur`&&g.commit(C)},onPointerMove({pointerType:e}){b.current=!1,p.set(`touchModality`,e===`touch`)},onPointerDown({pointerType:e}){p.set(`touchModality`,e===`touch`)},onKeyDown(){b.current=!0},onMouseDown(e){if(S)return;let t=bc(e.currentTarget);function n(e){if(!k.current)return;let t=e.target;if(dr(k.current,t)||dr(O.current,t)||t===k.current)return;let n=pf(k.current);e.clientX>=n.left-tg&&e.clientX<=n.right+tg&&e.clientY>=n.top-tg&&e.clientY<=n.bottom+tg||m(!1,Q(Vo,e))}j.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},g.getValidationProps,o,M);R.role=`combobox`;let z=J.useMemo(()=>({...u,open:S,disabled:x,value:C,readOnly:_,placeholder:!D}),[u,S,x,C,_,D]);return Z(`button`,e,{ref:[t,k],state:z,stateAttributesMapping:ng,props:R})}),ig={value:()=>null},ag=J.forwardRef(function(e,t){let{className:n,render:r,children:i,...a}=e,{store:o,valueRef:s}=Bh(),c=Fu(o,$h.value),l=Fu(o,$h.items),u=Fu(o,$h.itemToStringLabel),d=Fu(o,$h.serializedValue),f=J.useMemo(()=>({value:c,placeholder:!d}),[c,d]),p=typeof i==`function`?i(c):i??(Array.isArray(c)?Qh(c,u):Zh(c,l,u));return Z(`span`,e,{state:f,ref:[t,s],props:[{children:p},a],stateAttributesMapping:ig})}),og=J.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Bh(),o=Fu(a,$h.open);return Z(`span`,e,{state:J.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:zs})}),sg=J.createContext(void 0),cg=J.forwardRef(function(e,t){let{store:n}=Bh(),r=Fu(n,$h.mounted),i=Fu(n,$h.forceMount);return r||i?(0,q.jsx)(sg.Provider,{value:!0,children:(0,q.jsx)(Lc,{ref:t,...e})}):null}),lg=J.createContext(void 0);function ug(){let e=J.useContext(lg);if(!e)throw Error(kr(59));return e}function dg(e,t){e&&Object.assign(e.style,t)}var fg={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},pg={position:`fixed`},mg=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=$a,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=Bh(),D=Vh(),O=Fu(v,$h.open),k=Fu(v,$h.mounted),A=Fu(v,$h.modal),j=Fu(v,$h.value),M=Fu(v,$h.touchModality),N=Fu(v,$h.positionerElement),P=Fu(v,$h.triggerElement),F=Fu(v,$h.isItemEqualToValue),I=J.useRef(null),L=J.useRef(null),[R,z]=J.useState(h),B=k&&R&&!M;!k&&R!==h&&z(h),X(()=>{k||($h.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),$h.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),J.useImperativeHandle(x,()=>B),ef((B||A)&&O&&!M,P);let V=Ud({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??B,collisionAvoidance:g,keepMounted:!0}),ee=B?`none`:V.side,H=B?pg:V.positionerStyles,U=J.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...H,...e}}},[O,k,H]),W=J.useMemo(()=>({open:O,side:ee,align:V.align,anchorHidden:V.anchorHidden}),[O,ee,V.align,V.anchorHidden]),te=Z(`div`,e,{ref:[t,Y(e=>{v.set(`positionerElement`,e)})],state:W,stateAttributesMapping:Vs,props:[U,_]}),ne=J.useRef(0),re=Y(e=>{if(e.size===0&&ne.current===0||C.current.length===0)return;let t=ne.current;if(ne.current=e.size,e.size===t)return;let n=Q(Do);if(t!==0&&!v.state.multiple&&j!==null&&Gh(C.current,j,F)===-1){let e=w.current,t=e!=null&&Wh(C.current,e,F)?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=j.filter(e=>Wh(C.current,e,F));(e.length!==j.length||e.some(e=>!Wh(j,e,F)))&&(E(e,n),e.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&B){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};dg(N,e),dg(T.current,e)}}),ie=J.useMemo(()=>({...V,side:ee,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[V,ee,B,z]);return(0,q.jsx)(xa,{elementsRef:y,labelsRef:b,onMapChange:re,children:(0,q.jsxs)(lg.Provider,{value:ie,children:[k&&A&&(0,q.jsx)(Gd,{inert:Fd(!O),cutout:P}),te]})})});function hg(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var gg={...Vs,...Xo},_g=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:o,onOpenChangeComplete:s,setOpen:c,valueRef:l,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:m}=Bh(),{side:h,align:g,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:y,scrollUpArrowRef:b}=ug(),x=Od(!0)!=null,S=Vh(),C=ac(),w=Fu(a,$h.id),T=Fu(a,$h.open),E=Fu(a,$h.mounted),D=Fu(a,$h.popupProps),O=Fu(a,$h.transitionStatus),k=Fu(a,$h.triggerElement),A=Fu(a,$h.positionerElement),j=Fu(a,$h.listElement),M=J.useRef(0),N=J.useRef(!1),P=J.useRef(0),F=J.useRef(!1),I=J.useRef({}),L=ys(),R=Y(e=>{if(!A||!o.current||!F.current)return;if(N.current||!_){p();return}let t=A.style.top===`0px`,n=A.style.bottom===`0px`,r=A.getBoundingClientRect().height,i=bc(A),a=getComputedStyle(A),s=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=i.documentElement.clientHeight-s-c,u=e.scrollTop,d=e.scrollHeight-e.clientHeight,f=null,m=null,h=!1;if(t){let e=r+(d-u),t=Math.min(e,l);f=t,t===l?h=!0:m=d}else if(n){let e=u-0,t=r+e,n=Math.min(t,l),i=t-l;f=n,n===l?(h=!0,u<d&&(m=u-(e-i))):m=0}f!=null&&(A.style.height=`${f}px`),m!=null&&(e.scrollTop=m),h&&(N.current=!0),p()});J.useImperativeHandle(m,()=>R,[R]),Ss({open:T,ref:o,onComplete(){T&&s?.(!0)}});let z=J.useMemo(()=>({open:T,transitionStatus:O,side:h,align:g}),[T,O,h,g]);X(()=>{!A||!o.current||Object.keys(I.current).length||(I.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[o,A]),X(()=>{E||_||(F.current=!1,N.current=!1,M.current=0,P.current=0,dg(A,I.current))},[E,_,A,o]),X(()=>{let e=o.current;if(!(!E||!k||!A||!e)){if(!_){F.current=!0,L.request(p);return}queueMicrotask(()=>{let t=getComputedStyle(A),n=getComputedStyle(e),r=bc(k),i=Sn(A),a=k.getBoundingClientRect(),o=A.getBoundingClientRect(),s=a.left,c=a.height,d=j||e,f=d.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,y=r.documentElement.clientHeight-h-g,b=r.documentElement.clientWidth,x=y-a.bottom+c,S=u.current,C=l.current,w=0,T=0;if(S&&C){let e=C.getBoundingClientRect(),t=S.getBoundingClientRect(),n=e.left-s,r=t.left-o.left,i=e.top-a.top+e.height/2,c=t.top-o.top+t.height/2;w=n-r,T=c-i}let E=x+T+g+m,D=Math.min(y,E),O=y-h-g,P=E-D,L=Math.max(5,s+w),R=b-5,z=Math.max(0,L+o.width-R);A.style.left=`${L-z}px`,A.style.height=`${D}px`,A.style.maxHeight=`auto`,A.style.marginTop=`${h}px`,A.style.marginBottom=`${g}px`,e.style.height=`100%`;let B=d.scrollHeight-d.clientHeight,V=P>=B;V&&(D=Math.min(y,o.height)-(P-B));let ee=a.top<20||a.bottom>y-20||D<Math.min(f,_),H=(i.visualViewport?.scale??1)!==1&&Yn;if(ee||H){F.current=!0,dg(A,I.current),br.flushSync(()=>v(!1));return}if(V){let e=Math.max(0,y-E);A.style.top=o.height>=O?`0`:`${e}px`,A.style.height=`${D}px`,d.scrollTop=d.scrollHeight-d.clientHeight,M.current=Math.max(_,D)}else A.style.bottom=`0`,M.current=Math.max(_,D),d.scrollTop=P;M.current===y&&(N.current=!0),p(),setTimeout(()=>{F.current=!0})})}},[a,E,A,k,l,u,o,p,_,v,L,y,b,j]),J.useEffect(()=>{if(!_||!A||!E)return;let e=Sn(A);function t(e){c(!1,Q(Go,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[c,_,A,E]);let B={...j?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":f||void 0,id:`${w}-list`},onKeyDown(e){d.current=!0,x&&da.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(hg(e)||e.pointerType===`touch`)return;let t=e.currentTarget;C.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){j||m.current?.(e.currentTarget)},..._&&{style:j?{height:`100%`}:fg}},V=Z(`div`,e,{ref:[t,o],state:z,stateAttributesMapping:gg,props:[D,B,kd(O),{className:!j&&_?Of.className:void 0},i]});return(0,q.jsxs)(J.Fragment,{children:[Of.element,(0,q.jsx)(qc,{context:S,modal:!1,disabled:!E,restoreFocus:!0,children:V})]})}),vg=J.createContext(void 0);function yg(){let e=J.useContext(vg);if(!e)throw Error(kr(57));return e}var bg=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=J.useRef(null),u=rs({label:a,textRef:l,indexGuessBehavior:ns.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=Bh(),x=ac(),S=Fu(d,$h.isActive,u.index),C=Fu(d,$h.isSelected,u.index,i),w=Fu(d,$h.isSelectedByFocus,u.index),T=Fu(d,$h.isItemEqualToValue),E=u.index,D=E!==-1,O=J.useRef(null),k=fs(E);X(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),X(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Uh(t,i,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A=J.useMemo(()=>({disabled:o,selected:C,highlighted:S}),[o,C,S]),j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=J.useRef(null),N=J.useRef(`mouse`),P=J.useRef(!1),{getButtonProps:F,buttonRef:I}=es({disabled:o,focusableWhenDisabled:!0,native:s});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[],r=C?Kh(n,i,T):[...n,i];m(r,Q(Mo,e))}else m(i,Q(Mo,e)),p(!1,Q(Mo,e))}let R={role:`option`,"aria-selected":C,"aria-disabled":o||void 0,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||hg(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||L(e.nativeEvent)}},z=Z(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,R,c,F]}),B=J.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,q.jsx)(vg.Provider,{value:B,children:z})})),xg=J.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=yg();return n||r?(0,q.jsx)(Sg,{...e,ref:t}):null}),Sg=J.memo(J.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=yg(),s=J.useRef(null),{transitionStatus:c,setMounted:l}=Cs(o),u=J.useMemo(()=>({selected:o,transitionStatus:c}),[o,c]),d=Z(`span`,e,{ref:[t,s],state:u,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:Xo});return Ss({open:o,ref:s,onComplete(){o||l(!1)}}),d})),Cg=J.memo(J.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=yg(),{selectedItemTextRef:o}=Bh(),{className:s,render:c,...l}=e;return Z(`div`,e,{ref:[J.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})})),wg=eg;function Tg(e){return(0,q.jsx)(ag,{"data-slot":`select-value`,...e})}function Eg({className:e,size:t=`default`,children:n,...r}){return(0,q.jsxs)(rg,{"data-slot":`select-trigger`,className:K(`inline-flex min-w-0 max-w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-border bg-background text-left text-sm shadow-sm outline-none transition-colors`,`hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]`,`data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t===`sm`?`h-8 px-2`:`h-9 px-3`,typeof e==`string`?e:void 0),...r,children:[(0,q.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),(0,q.jsx)(og,{className:`shrink-0 text-muted-foreground`,children:(0,q.jsx)(wt,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]})}function Dg({className:e,sideOffset:t=4,align:n=`start`,children:r,...i}){return(0,q.jsx)(cg,{children:(0,q.jsx)(mg,{sideOffset:t,align:n,alignItemWithTrigger:!1,className:`z-50 outline-none`,children:(0,q.jsx)(_g,{"data-slot":`select-content`,className:K(`max-h-[min(var(--available-height),20rem)] min-w-[var(--anchor-width)] max-w-[var(--available-width)] overflow-y-auto rounded-md border border-border bg-card p-1 text-card-foreground shadow-md outline-none`,typeof e==`string`?e:void 0),...i,children:r})})})}function Og({className:e,children:t,...n}){return(0,q.jsxs)(bg,{"data-slot":`select-item`,className:K(`relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none`,`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,typeof e==`string`?e:void 0),...n,children:[(0,q.jsx)(Cg,{children:t}),(0,q.jsx)(xg,{className:`absolute right-2 flex items-center`,children:(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]})}var kg=J.createContext(void 0);function Ag(e){let t=J.useContext(kg);if(t===void 0&&!e)throw Error(kr(47));return t}function jg(){return{...Ju(),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}}var Mg={...Yu,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),openMethod:$(e=>e.openMethod),openChangeReason:$(e=>e.openChangeReason),modal:$(e=>e.modal),stickIfOpen:$(e=>e.stickIfOpen),titleElementId:$(e=>e.titleElementId),descriptionElementId:$(e=>e.descriptionElementId),openOnHover:$(e=>e.openOnHover),closeDelay:$(e=>e.closeDelay)},Ng=class e extends zu{constructor(e){let t={...jg(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),stickIfOpenTimeout:new ic,triggerElements:new Ku},Mg)}setOpen=(e,t)=>{let n=t.reason===ko,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),br.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Qt(()=>t??new e(n)).current;return hs(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function Pg({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Ng.useStore(s?.store,{open:n??r,modal:o,activeTriggerId:c===void 0?l:c});u.useControlledProp(`open`,n,r),u.useControlledProp(`activeTriggerId`,c,l);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=af(d);Wu(u);let{forceUnmount:v}=Gu(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});ef(d&&o===!0&&m!==`trigger-hover`&&h!==`touch`,f),J.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=J.useCallback(e=>{let t=Q(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=J.useCallback(()=>{u.setOpen(!1,y(Wo))},[u,y]);J.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Qu({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=dd([cu(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Sd(x)]),T=J.useMemo(()=>S(g),[S,g]),E=J.useMemo(()=>w(g),[w,g]),D=J.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:uc()!=null});let O=J.useMemo(()=>({store:u}),[u]);return(0,q.jsx)(kg.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function Fg(e){return Ag(!0)?(0,q.jsx)(Pg,{props:e}):(0,q.jsx)(mc,{children:(0,q.jsx)(Pg,{props:e})})}var Ig=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,...f}=e,p=Ag(!0),m=o?.store??p?.store;if(!m)throw Error(kr(74));let h=yn(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=J.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=Uu(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=ud(_,{enabled:_!=null&&c&&(w!==`touch`||S!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Ed(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=dd([Jc(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O=J.useMemo(()=>({disabled:i,open:v}),[i,v]),{getButtonProps:k,buttonRef:A}=es({disabled:i,native:a}),j=J.useMemo(()=>({open(e){return e&&S===`trigger-press`?Bs.open(e):zs.open(e)}}),[S]),M=Z(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[Qa]:``,id:h},f,k],stateAttributesMapping:j}),N=J.useRef(null),P=Y(e=>{br.flushSync(()=>{m.setOpen(!1,Q(Io,e.nativeEvent,e.currentTarget))}),Xi(N.current)?.focus()}),F=Y(e=>{let t=m.select(`positionerElement`);if(t&&Zi(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{br.flushSync(()=>{m.setOpen(!1,Q(Io,e.nativeEvent,e.currentTarget))});let n=Yi(y.current);for(;n!==null&&dr(t,n)||n?.hasAttribute(`aria-hidden`);){let e=n;if(n=Ki(n),n===e)break}n?.focus()}});return g?(0,q.jsxs)(J.Fragment,{children:[(0,q.jsx)(xc,{ref:N,onFocus:P}),(0,q.jsx)(J.Fragment,{children:M},h),(0,q.jsx)(xc,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,q.jsx)(J.Fragment,{children:M},h)}),Lg=J.createContext(void 0);function Rg(){let e=J.useContext(Lg);if(e===void 0)throw Error(kr(45));return e}var zg=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Ag();return i.useState(`mounted`)||n?(0,q.jsx)(Lg.Provider,{value:n,children:(0,q.jsx)(Lc,{ref:t,...r,renderGuards:!1})}):null}),Bg=J.createContext(void 0);function Vg(){let e=J.useContext(Bg);if(!e)throw Error(kr(46));return e}var Hg=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=eo,...g}=e,{store:_}=Ag(),v=Rg(),y=fc(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=J.useRef(null),A=xs(E,!1,!1),j=Ud({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:Bd}),M=J.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...j.positionerStyles,...e}}},[S,x,j.positionerStyles]),N=J.useMemo(()=>({props:M,...j}),[M,j]),P=b?.select(`domReferenceElement`);X(()=>{let e=P,t=k.current;if(e&&(k.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return A(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,A,_]);let F=J.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:D}),[S,N.side,N.align,N.anchorHidden,D]),I=J.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=Z(`div`,e,{state:F,props:[N.props,kd(O),g],ref:[t,I],stateAttributesMapping:Vs});return(0,q.jsxs)(Bg.Provider,{value:N,children:[x&&T===!0&&C!==`trigger-hover`&&(0,q.jsx)(Gd,{ref:_.context.internalBackdropRef,inert:Fd(!S),cutout:w}),(0,q.jsx)(pc,{id:y,children:L})]})}),Ug={...Vs,...Xo},Wg=J.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=Ag(),c=Vg(),l=Od(!0)!=null,u=oo(),d=s.useState(`open`),f=s.useState(`openMethod`),p=s.useState(`instantType`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`titleElementId`),_=s.useState(`descriptionElementId`),v=s.useState(`modal`),y=s.useState(`mounted`),b=s.useState(`openChangeReason`),x=s.useState(`popupElement`),S=s.useState(`payload`),C=s.useState(`positionerElement`),w=s.useState(`activeTriggerElement`),T=s.useState(`floatingRootContext`);Ss({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}});let E=s.useState(`disabled`),D=s.useState(`openOnHover`),O=s.useState(`closeDelay`);od(T,{enabled:D&&!E,closeDelay:O});function k(e){return e!==`touch`||s.context.popupRef.current}let A=i===void 0?k:i,j=J.useMemo(()=>({open:d,side:c.side,align:c.align,instant:p,transitionStatus:m}),[d,c.side,c.align,p,m]),M=J.useCallback(e=>{s.set(`popupElement`,e)},[s]);function N(){T.context.events.emit(`measure-layout`)}function P(e,t){T.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}jp({popupElement:x,positionerElement:C,mounted:y,content:S,enabled:J.useCallback(()=>s.context.triggerElements.size>1,[s]),onMeasureLayout:N,onMeasureLayoutComplete:P,side:c.side,direction:u});let F=Z(`div`,e,{state:j,ref:[t,s.context.popupRef,M],props:[h,{"aria-labelledby":g,"aria-describedby":_,onKeyDown(e){l&&da.has(e.key)&&e.stopPropagation()}},kd(m),o],stateAttributesMapping:Ug});return(0,q.jsx)(qc,{context:T,openInteractionType:f,modal:v===`trap-focus`,disabled:!y||b===`trigger-hover`,initialFocus:A,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:En(w)?w:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:F})}),Gg=`data-[popup-open]:bg-[var(--color-accent)] data-[popup-open]:text-[var(--color-accent-foreground)]`,Kg=Fg;function qg({className:e,...t}){return(0,q.jsx)(Ig,{className:typeof e==`function`?e:K(Gg,e),...t})}function Jg({className:e,sideOffset:t=6,align:n=`start`,children:r,...i}){return(0,q.jsx)(zg,{children:(0,q.jsx)(Hg,{sideOffset:t,align:n,className:`z-50 outline-none`,children:(0,q.jsx)(Wg,{className:K(`rounded-md border border-[var(--color-border)] bg-[var(--color-card)] text-[var(--color-card-foreground)] shadow-md outline-none`,e),...i,children:(0,q.jsx)(Jf,{viewportClassName:`max-h-[var(--available-height)]`,children:(0,q.jsx)(`div`,{className:`p-3`,children:r})})})})})}function Yg(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Xg(e,t){return e-t}function Zg(e,t,n){let r=e.slice();return r[t]=n,r.sort(Xg)}function Qg(e,t,n,r,i,a){let o=e;return o=If(o,n,r),i&&(o=Zg(a,t,If(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function $g(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var e_={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},t_=J.createContext(void 0);function n_(){let e=J.useContext(t_);if(e===void 0)throw Error(kr(62));return e}function r_(e){return`key`in e?zo:Fo}function i_(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Yg(e,t):!1}var a_=J.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,name:m,onValueChange:h,onValueCommitted:g,orientation:_=`horizontal`,step:v=1,thumbCollisionBehavior:y=`push`,thumbAlignment:b=`center`,value:x,...S}=e,C=yn(o),w=Y(h),T=Y(g),{clearErrors:E}=uo(),{state:D,disabled:O,name:k,setTouched:A,setDirty:j,validityData:M,shouldValidateOnChange:N,validation:P}=go(),{labelId:F}=xo(),I=n??F,L=O||a,R=k??m,[z,B]=Xt({controlled:x,default:i??f,name:`Slider`}),V=J.useRef(null),ee=J.useRef(null),H=J.useRef([]),U=J.useRef(null),W=J.useRef(null),te=J.useRef(-1),ne=J.useRef(null),re=J.useRef(null),ie=J.useRef(`none`),ae=fs(s),[oe,se]=J.useState(-1),[ce,le]=J.useState(-1),[ue,de]=J.useState(!1),[fe,pe]=J.useState(()=>new Map),[me,G]=J.useState([void 0,void 0]),he=Y(e=>{se(e),e!==-1&&le(e)});_o({id:C,commit:P.commit,value:z,controlRef:ee,name:R,getValue:()=>z}),So(z,()=>{E(R),N()?P.commit(z):P.commit(z,!0);let e=M.initialValue,t;t=Array.isArray(z)&&Array.isArray(e)?!Yg(z,e):z!==e,j(t)});let ge=Y(e=>{e&&(ee.current=e)}),_e=Array.isArray(z),ve=J.useMemo(()=>_e?z.slice().sort(Xg):[If(z,f,d)],[d,f,_e,z]),ye=Y((e,t)=>{if(Number.isNaN(e)||i_(e,z))return;let n=t??Q(`none`,void 0,void 0,{activeThumbIndex:-1});ie.current=n.reason;let r=new event.constructor(event.type,event);Object.defineProperty(r,"target",{writable:!0,value:{value:e,name:R}}),n.event=r,re.current=e,w(e,n),!n.isCanceled&&B(e)}),be=Y((e,t,n)=>{let r=Qg(e,t,f,d,_e,ve);if($g(r,v,p)){let e=r_(n);ye(r,Q(e,n.nativeEvent,void 0,{activeThumbIndex:t})),A(!0);let i=re.current??r;T(i,Ko(e,n.nativeEvent))}});X(()=>{let e=ur(bc(V.current));L&&e&&V.current?.contains(e)&&e.blur()},[L]),L&&oe!==-1&&he(-1);let xe=J.useMemo(()=>({...D,activeThumbIndex:oe,disabled:L,dragging:ue,orientation:_,max:d,min:f,minStepsBetweenValues:p,step:v,values:ve}),[D,oe,L,ue,d,f,p,_,v,ve]),Se=J.useMemo(()=>({active:oe,controlRef:ee,disabled:L,dragging:ue,validation:P,formatOptionsRef:ae,handleInputChange:be,indicatorPosition:me,inset:b!==`center`,labelId:I,largeStep:c,lastUsedThumbIndex:ce,lastChangedValueRef:re,lastChangeReasonRef:ie,locale:l,max:d,min:f,minStepsBetweenValues:p,name:R,onValueCommitted:T,orientation:_,pressedInputRef:U,pressedThumbCenterOffsetRef:W,pressedThumbIndexRef:te,pressedValuesRef:ne,registerFieldControlRef:ge,renderBeforeHydration:b===`edge`,setActive:he,setDragging:de,setIndicatorPosition:G,setValue:ye,state:xe,step:v,thumbCollisionBehavior:y,thumbMap:fe,thumbRefs:H,values:ve}),[oe,ee,I,L,ue,P,ae,be,me,c,ce,re,ie,l,d,f,p,R,T,_,U,W,te,ne,ge,he,de,G,ye,xe,v,y,b,fe,H,ve]),Ce=Z(`div`,e,{state:xe,ref:[t,V],props:[{"aria-labelledby":I,id:C,role:`group`},P.getValidationProps,S],stateAttributesMapping:e_});return(0,q.jsx)(t_.Provider,{value:Se,children:(0,q.jsx)(xa,{elementsRef:H,onMapChange:pe,children:Ce})})}),o_=new Map;function s_(e,t){let n=JSON.stringify({locale:e,options:t}),r=o_.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return o_.set(n,i),i}function c_(e,t,n){return e==null?``:s_(t,n).format(e)}function l_(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function u_(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function d_(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(u_(t)))}function f_({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=If(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=If(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=If(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function p_({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=If(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=f_({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=If(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:f_({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=If(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var m_=2;function h_(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function g_(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var __=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{disabled:a,dragging:o,validation:s,inset:c,lastChangedValueRef:l,lastChangeReasonRef:u,max:d,min:f,minStepsBetweenValues:p,onValueCommitted:m,orientation:h,pressedInputRef:g,pressedThumbCenterOffsetRef:_,pressedThumbIndexRef:v,pressedValuesRef:y,registerFieldControlRef:b,renderBeforeHydration:x,setActive:S,setDragging:C,setValue:w,state:T,step:E,thumbCollisionBehavior:D,thumbRefs:O,values:k}=n_(),A=oo(),j=k.length>1,M=h===`vertical`,N=J.useRef(null),P=J.useRef(null),F=Y(e=>{e&&P.current==null&&(P.current??=getComputedStyle(e))}),I=J.useRef(null),L=J.useRef(0),R=J.useRef(0),z=fs(k),B=Y(e=>{v.current!==e&&(v.current=e);let t=O.current[e];if(!t){_.current=null,g.current=null;return}g.current=t.querySelector(`input[type="range"]`)}),V=Y(e=>{let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=h_(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=_.current??0,m=e.x-u,h=e.y-u,g=If(((M?i-h-s.end:(A===`rtl`?o-m:m-a)-s.start)-c)/l,0,1),b=(d-f)*g+f;if(b=d_(b,E,f),b=If(b,f,d),!j)return{value:b,thumbIndex:0,didSwap:!1};let x=v.current;if(x<0)return null;let S=p_({behavior:D,values:k,currentValues:z.current??k,initialValues:y.current,pressedIndex:x,nextValue:b,min:f,max:d,step:E,minStepsBetweenValues:p});return D===`swap`&&S.didSwap?B(S.thumbIndex):v.current=S.thumbIndex,S}),ee=Y(e=>{y.current=j?k.slice():null,z.current=k;let t=v.current,n=t;if(t>-1&&t<k.length){if(k[t]===d){let e=t;for(;e>0&&k[e-1]===d;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(Tn(a)){let o=l_(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&B(n),c){let e=O.current[n];if(Tn(e)){let t=e.getBoundingClientRect();R.current=t[M?`height`:`width`]/2}}}),H=Y(e=>{O.current?.[e]?.querySelector(`input[type="range"]`)?.focus({preventScroll:!0})}),U=Y(e=>{let t=g_(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){W(e);return}let n=V(t);n!=null&&$g(n.value,E,p)&&(!o&&L.current>m_&&C(!0),w(n.value,Q(Bo,e,void 0,{activeThumbIndex:n.thumbIndex})),z.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&H(n.thumbIndex))});function W(e){S(-1),C(!1),g.current=null,_.current=null,v.current=-1;let t=g_(e,I),n=t==null?null:V(t);if(n!=null){let t=u.current;s.commit(l.current??n.value),m(l.current??n.value,Ko(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),I.current=null,y.current=null,ne()}let te=Y(e=>{if(a)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=g_(e,I);if(n!=null){ee(n);let t=V(n);if(t==null)return;H(t.thumbIndex),w(t.value,Q(Po,e,void 0,{activeThumbIndex:t.thumbIndex})),z.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&H(t.thumbIndex)}L.current=0;let r=bc(N.current);r.addEventListener(`touchmove`,U,{passive:!0}),r.addEventListener(`touchend`,W,{passive:!0})}),ne=Y(()=>{let e=bc(N.current);e.removeEventListener(`pointermove`,U),e.removeEventListener(`pointerup`,W),e.removeEventListener(`touchmove`,U),e.removeEventListener(`touchend`,W),y.current=null}),re=ys();return J.useEffect(()=>{let e=N.current;return e?(e.addEventListener(`touchstart`,te,{passive:!0}),()=>{e.removeEventListener(`touchstart`,te),re.cancel(),ne()}):()=>ne()},[ne,te,N,re]),J.useEffect(()=>{a&&ne()},[a,ne]),Z(`div`,e,{state:T,ref:[t,b,N,F],props:[{"data-base-ui-slider-control":x?``:void 0,onPointerDown(e){let t=N.current;if(!t||a||e.defaultPrevented||!Tn(e.target)||e.button!==0)return;let n=g_(e,I);if(n!=null){ee(n);let r=V(n);if(r==null)return;dr(O.current[r.thumbIndex],ur(bc(t)))?e.preventDefault():re.request(()=>{H(r.thumbIndex)}),C(!0),_.current??(w(r.value,Q(Po,e.nativeEvent,void 0,{activeThumbIndex:r.thumbIndex})),z.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&H(r.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let r=bc(N.current);r.addEventListener(`pointermove`,U,{passive:!0}),r.addEventListener(`pointerup`,W,{once:!0})},tabIndex:-1},i],stateAttributesMapping:e_})}),v_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=n_();return Z(`div`,e,{state:a,ref:t,props:[{style:{position:`relative`}},i],stateAttributesMapping:e_})});function y_(e,t,n){return(e-t)*100/(n-t)}var b_=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),x_=`PageUp`,S_=`PageDown`,C_=new Set([ea,ta,na,ra,ia,`End`,x_,S_]);function w_(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${c_(e[t],r,n)} start range`:`${c_(e[t],r,n)} end range`:n?c_(e[t],r,n):void 0}function T_(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}var E_=J.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,disabled:c=!1,getAriaLabel:l,getAriaValueText:u,id:d,index:f,inputRef:p,onBlur:m,onFocus:h,onKeyDown:g,tabIndex:_,...v}=e,y=yn(d),{active:b,lastUsedThumbIndex:x,controlRef:S,disabled:C,validation:w,formatOptionsRef:T,handleInputChange:E,inset:D,labelId:O,largeStep:k,locale:A,max:j,min:M,minStepsBetweenValues:N,name:P,orientation:F,pressedInputRef:I,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:B,setIndicatorPosition:V,state:ee,step:H,values:U}=n_(),W=oo(),te=c||C,ne=U.length>1,re=F===`vertical`,ie=W===`rtl`,{setTouched:ae,setFocused:oe,validationMode:se}=go(),ce=J.useRef(null),le=J.useRef(null),ue=yn(),de=cs(),fe=ne?ue:de,{ref:pe,index:me}=rs({metadata:J.useMemo(()=>({inputId:fe}),[fe])}),G=ne?f??me:0,he=G===U.length-1,ge=U[G],_e=y_(ge,M,j),[ve,ye]=J.useState(!1),[be,xe]=J.useState();hs(()=>ye(!0));let Se=x>=0&&x<U.length?x:-1,Ce=Y(()=>{let e=S.current,t=ce.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=re?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*_e/100)/r[i]*100;xe(o),G===0?V(e=>[o,e[1]]):he&&V(e=>[e[0],o])});X(()=>{D&&queueMicrotask(Ce)},[Ce,D]),X(()=>{D&&Ce()},[Ce,D,_e]);let we=J.useCallback(()=>{let e=re?`bottom`:`insetInlineStart`,t=re?`left`:`top`,n;return ne?b===G?n=2:Se===G&&(n=1):b===G&&(n=1),D?{"--position":`${be}%`,visibility:z&&!ve||be===void 0?`hidden`:void 0,position:`absolute`,[e]:`var(--position)`,[t]:`50%`,translate:`${(re||!ie?-1:1)*50}% ${(re?1:-1)*50}%`,zIndex:n}:Number.isFinite(_e)?{position:`absolute`,[e]:`${_e}%`,[t]:`50%`,translate:`${(re||!ie?-1:1)*50}% ${(re?1:-1)*50}%`,zIndex:n}:un},[b,G,D,ve,be,ne,z,ie,Se,_e,re]),Te;F===`vertical`&&(Te=ie?`vertical-rl`:`vertical-lr`);let Ee=Ba({"aria-label":typeof l==`function`?l(G):o,"aria-labelledby":s??O,"aria-describedby":a,"aria-orientation":F,"aria-valuenow":ge,"aria-valuetext":typeof u==`function`?u(c_(ge,A,T.current??void 0),ge,G):w_(U,G,T.current??void 0,A),disabled:te,id:fe,max:j,min:M,name:P,onChange(e){E(e.target.valueAsNumber,G,e)},onFocus(){B(G),oe(!0)},onBlur(){ce.current&&(B(-1),ae(!0),oe(!1),se===`onBlur`&&w.commit(Qg(ge,G,M,j,ne,U)))},onKeyDown(e){if(!C_.has(e.key))return;da.has(e.key)&&e.stopPropagation();let t=null,n=d_(ge,H,M);switch(e.key){case ea:t=T_(n,e.shiftKey?k:H,1,M,j);break;case ra:t=T_(n,e.shiftKey?k:H,ie?-1:1,M,j);break;case ta:t=T_(n,e.shiftKey?k:H,-1,M,j);break;case na:t=T_(n,e.shiftKey?k:H,ie?1:-1,M,j);break;case x_:t=T_(n,k,1,M,j);break;case S_:t=T_(n,k,-1,M,j);break;case`End`:t=j,ne&&(t=Number.isFinite(U[G+1])?U[G+1]-H*N:j);break;case ia:t=M,ne&&(t=Number.isFinite(U[G-1])?U[G-1]+H*N:M);break;default:break}t!==null&&(E(t,G,e),e.preventDefault())},step:H,style:{...un,width:`100%`,height:`100%`,writingMode:Te},tabIndex:_??void 0,type:`range`,value:ge??``},w.getInputValidationProps),De=$t(le,w.inputRef,p);return Z(`div`,e,{state:ee,ref:[t,pe,ce],props:[{[b_.index]:G,children:(0,q.jsxs)(J.Fragment,{children:[r,(0,q.jsx)(`input`,{ref:De,...Ee}),D&&!ve&&z&&he&&(0,q.jsx)(`script`,{dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:y,onBlur:m,onFocus:h,onPointerDown(e){if(R.current=G,ce.current!=null){let t=F===`horizontal`?`x`:`y`,n=l_(ce.current),r=(F===`horizontal`?e.clientX:e.clientY)-n[t];L.current=r}le.current!=null&&I.current!==le.current&&(I.current=le.current)},style:we(),suppressHydrationWarning:z||void 0,tabIndex:-1},v],stateAttributesMapping:e_})});function D_(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&!a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function O_(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var k_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{indicatorPosition:a,inset:o,max:s,min:c,orientation:l,renderBeforeHydration:u,state:d,values:f}=n_(),[p,m]=J.useState(!1);hs(()=>m(!0));let h=l===`vertical`,g=f.length>1,_=o?D_(h,g,a[0],a[1],u,p):O_(h,g,y_(f[0],c,s),y_(f[f.length-1],c,s));return Z(`div`,e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":u?``:void 0,style:_,suppressHydrationWarning:u||void 0},i],stateAttributesMapping:e_})}),A_=`h-3.5 w-3.5 rounded-full border border-primary bg-card shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-1`;function j_({value:e,onValueChange:t,min:n=0,max:r=10,className:i,"aria-label":a}){return(0,q.jsx)(a_,{value:e,onValueChange:e=>{Array.isArray(e)&&e.length===2&&t([e[0],e[1]])},min:n,max:r,step:1,className:K(`w-full`,i),children:(0,q.jsx)(__,{className:`flex w-full touch-none select-none items-center py-1.5`,children:(0,q.jsxs)(v_,{className:`relative h-1 w-full rounded-full bg-[var(--color-muted)]`,children:[(0,q.jsx)(k_,{className:`rounded-full bg-primary`}),(0,q.jsx)(E_,{"aria-label":a?`${a} minimum`:`Minimum`,className:A_}),(0,q.jsx)(E_,{"aria-label":a?`${a} maximum`:`Maximum`,className:A_})]})})})}function M_({added:e,removed:t,className:n,zeros:r=!1}){let i=e=>r||e>0;return(0,q.jsxs)(`span`,{className:K(`shrink-0 font-mono text-[10px] tabular-nums`,n),children:[i(e)&&(0,q.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),i(e)&&i(t)&&` `,i(t)&&(0,q.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function N_(e){let[t,n]=J.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=J.useRef(null),i=J.useRef(null),a=J.useRef(null),o=J.useRef(null),s=J.useRef(!0),c=J.useRef(null),l=vn(),u=J.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,q.jsx)(Hs.Provider,{value:u,children:(0,q.jsx)(As.Provider,{value:void 0,children:(0,q.jsx)(df,{...e})})})}var P_=500,F_=J.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{setAnchor:a,actionsRef:o,internalBackdropRef:s,backdropRef:c,positionerRef:l,allowMouseUpTriggerRef:u,initialCursorPointRef:d,rootId:f}=Us(!1),{store:p}=js(!1),m=p.useState(`open`),h=J.useRef(null),g=J.useRef(null),_=ac(),v=ac(),y=J.useRef(!1);function b(e,t,n){let r=n.type.startsWith(`touch`);d.current={x:e,y:t},a({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),y.current=!1,o.current?.setOpen(!0,Q(Oo,n)),v.start(P_,()=>{y.current=!0})}function x(e){u.current=!0,Cr(e),b(e.clientX,e.clientY,e.nativeEvent),bc(h.current).addEventListener(`mouseup`,e=>{if(u.current=!1,!y.current)return;v.clear(),y.current=!1;let t=fr(e);dr(l.current,t)||f&&t&&mf(t)===f||o.current?.setOpen(!1,Q(Vo,e))},{once:!0})}function S(e){if(u.current=!1,e.touches.length===1){e.stopPropagation();let t=e.touches[0];g.current={x:t.clientX,y:t.clientY},_.start(P_,()=>{g.current&&b(g.current.x,g.current.y,e.nativeEvent)})}}function C(e){if(_.isStarted()&&g.current&&e.touches.length===1){let t=e.touches[0],n=Math.abs(t.clientX-g.current.x),r=Math.abs(t.clientY-g.current.y);(n>10||r>10)&&_.clear()}}function w(){_.clear(),g.current=null}return J.useEffect(()=>{function e(e){let t=fr(e);(dr(h.current,t)||dr(s.current,t)||dr(c.current,t))&&e.preventDefault()}let t=bc(h.current);return t.addEventListener(`contextmenu`,e),()=>{t.removeEventListener(`contextmenu`,e)}},[c,s]),Z(`div`,e,{state:J.useMemo(()=>({open:m}),[m]),ref:[h,t],props:[{onContextMenu:x,onTouchStart:S,onTouchMove:C,onTouchEnd:w,onTouchCancel:w,style:{WebkitTouchCallout:`none`}},i],stateAttributesMapping:Bs})}),I_=N_,L_=F_,R_=(0,J.createContext)({title:null,actions:null});function z_({children:e}){let{title:t}=(0,J.useContext)(R_);return t?(0,br.createPortal)(e,t):null}function B_({children:e}){let{actions:t}=(0,J.useContext)(R_);return t?(0,br.createPortal)(e,t):null}var V_={icon:kt,className:`text-pink-500`},H_={icon:Dt,className:`text-orange-500`},U_={icon:Mt,className:`text-emerald-500`},W_={icon:At,className:`text-amber-500`},G_={icon:jt,className:`text-lime-600`},K_={icon:Ot,className:`text-muted-foreground`},q_={icon:Nt,className:`text-muted-foreground`},J_=e=>({icon:Dt,className:e}),Y_={png:V_,jpg:V_,jpeg:V_,gif:V_,webp:V_,svg:V_,ico:V_,avif:V_,bmp:V_,html:H_,htm:H_,xml:H_,vue:H_,svelte:H_,md:U_,mdx:U_,txt:U_,rst:U_,pdf:U_,json:W_,jsonc:W_,yml:W_,yaml:W_,toml:W_,ini:W_,lock:W_,env:W_,sh:G_,bash:G_,zsh:G_,fish:G_,ts:J_(`text-blue-500`),tsx:J_(`text-blue-500`),mts:J_(`text-blue-500`),cts:J_(`text-blue-500`),js:J_(`text-yellow-500`),jsx:J_(`text-yellow-500`),mjs:J_(`text-yellow-500`),cjs:J_(`text-yellow-500`),css:J_(`text-sky-500`),scss:J_(`text-pink-400`),less:J_(`text-sky-600`),py:J_(`text-sky-600`),go:J_(`text-cyan-500`),rs:J_(`text-orange-600`),rb:J_(`text-red-500`),java:J_(`text-red-600`),kt:J_(`text-violet-500`),swift:J_(`text-orange-500`),c:J_(`text-blue-600`),h:J_(`text-blue-600`),cpp:J_(`text-blue-600`),cs:J_(`text-violet-600`),php:J_(`text-indigo-400`),sql:J_(`text-amber-600`)};function X_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase(),n=t.lastIndexOf(`.`);return n===-1?q_:Y_[t.slice(n+1)]||(n===0?K_:q_)}function Z_({path:e,className:t}){let{icon:n,className:r}=X_(e);return(0,q.jsx)(n,{"aria-hidden":!0,className:K(`size-4 shrink-0`,r,t)})}function Q_({icon:e,label:t,busyLabel:n=`Starting…`,ariaLabel:r,menuAriaLabel:i,tooltip:a,tooltipClassName:o,prompt:s,configureDescription:c,onStart:l,onConfigure:u,busy:d=!1,starting:f=!1,disabled:p=!1,variant:m=`outline`,size:h=`xs`,className:g}){let _=()=>{Cm(s),u()};return(0,q.jsxs)(`div`,{className:`inline-flex shrink-0 items-center`,children:[(0,q.jsxs)(Ip,{children:[(0,q.jsxs)(Lp,{render:(0,q.jsx)(Ge,{type:`button`,variant:m,size:h,disabled:p||d,onClick:l,...r?{"aria-label":r}:{},className:K(`rounded-r-none`,m===`outline`&&`border-r-0`,g)}),children:[f?(0,q.jsx)(Pt,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}):e,t!==void 0&&(f?n:t)]}),(0,q.jsx)(Rp,{...o?{className:o}:{},children:a})]}),(0,q.jsxs)($f,{children:[(0,q.jsx)(rp,{type:`button`,disabled:p,"aria-label":i,className:K(We({variant:m,size:h}),`w-auto rounded-l-none px-1.5`,m==="default"&&`border-l border-[var(--color-primary-foreground)]/25`,g),children:(0,q.jsx)(wt,{className:`h-3 w-3`,"aria-hidden":!0})}),(0,q.jsx)(ip,{align:`end`,className:`max-w-[20rem]`,children:(0,q.jsx)(ap,{onClick:_,className:`items-start`,children:(0,q.jsx)(sm,{label:`Configure first, then run`,description:c})})})]})]})}var $_=`modulepreload`,ev=function(e){return`/`+e},tv={},nv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ev(t,n),t=s(t),t in tv)return;tv[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:$_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},rv=50,iv={pages:[],cards:[],linkActions:[],panels:[],runSlots:[],settings:[],loaded:!1},av=new Map;function ov(e){let t=av.get(e);return t||(t=nv(()=>import(e).then(t=>{let n=t.default;if(!(!n||typeof n!=`object`)){if(n.stylesheet){let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=new URL(n.stylesheet,new URL(e,window.location.href)).href,document.head.appendChild(t)}return n}},t=>{console.warn(`[openagent] the module at ${e} did not load:`,t)}),[]),av.set(e,t)),t}var sv=[];function cv(e,t){return(e.order??rv)-(t.order??rv)||e.package.localeCompare(t.package)}function lv(e=0){let{value:t,loaded:n}=_m(ph,sv,3e4,[e]),[r,i]=(0,J.useState)(iv);return(0,J.useEffect)(()=>{if(!n)return;let e=!0;return Promise.all(t.map(async e=>({module:e,definition:await ov(e.url)}))).then(t=>{if(!e)return;let n=[],r=[],a=[],o=[],s=[],c=[],l,u;for(let{module:e,definition:i}of t){for(let t of i?.pages??[])!D(t.segment)||n.some(e=>e.segment===t.segment)||n.push({...t,package:e.package,projects:e.projects});for(let t of i?.cards??[])r.push({...t,package:e.package,projects:e.projects});for(let t of i?.linkActions??[])a.push({...t,package:e.package,projects:e.projects});for(let t of i?.panels??[])o.push({...t,package:e.package,projects:e.projects});for(let t of i?.settings??[])c.push({...t,package:e.package,projects:e.projects});i?.usageLimit&&(l??={...i.usageLimit,package:e.package,projects:e.projects}),i?.schedule&&(u??={...i.schedule,package:e.package,projects:e.projects});let t=i?.run;t?.summary&&s.push({...t,package:e.package,projects:e.projects})}r.sort(cv),c.sort(cv),i({pages:n,cards:r,linkActions:a,panels:o,runSlots:s,settings:c,...l?{usageLimit:l}:{},...u?{schedule:u}:{},loaded:!0})}),()=>{e=!1}},[t,n]),r}var uv=(0,J.createContext)(iv);function dv(){return(0,J.useContext)(uv)}var fv={openAgent(){},openPage(){},async startRun(){return{ok:!1,error:`no dashboard to start a run from`}},configureRun(){},async agents(){return[]},async machines(){return{version:`unknown`,machines:[]}},async addMachine(){return{ok:!1,error:`no dashboard to save a machine in`}},async removeMachine(){return{ok:!1,error:`no dashboard to remove a machine from`}},async watchScreen(){},async sendToScreen(){return!1}},pv=(0,J.createContext)(null);function mv(e){return{...(0,J.useContext)(pv)??fv,package:e}}function hv({projects:e,targets:t,resetKey:n,label:r,tooltip:i,disabled:a=!1,size:o=`sm`,variant:s=`outline`}){let{linkActions:c}=dv(),l=(0,J.useContext)(pv),u=c.filter(t=>e.some(e=>t.projects.includes(e))),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(new Set),[h,g]=(0,J.useState)(null);(0,J.useEffect)(()=>{m(new Set),g(null)},[n??e.join(`
|
|
21
|
-
`)]);let _=e=>`${e.package}\n${e.label}`,v=async e=>{if(d!==null)return;f(_(e)),g(null);let n={ok:!0};try{let r=typeof t==`function`?await t():t,i=hy({...l??fv,package:e.package},{acts:!0});for(let{projectId:t,links:a}of r)if(!(!e.projects.includes(t)||a.length===0)&&(n=await e.run(i,t,a),!n.ok))break}catch(e){n={ok:!1,error:e instanceof Error?e.message:String(e)}}f(null),n.ok?m(t=>new Set(t).add(_(e))):g(n.error)};return u.length===0?null:(0,q.jsxs)(q.Fragment,{children:[u.map(e=>{let t=e.icon,n=p.has(_(e)),c=n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ct,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),` `,(0,q.jsx)(`span`,{className:`max-md:min-w-0 max-md:truncate`,children:e.doneLabel??e.label})]}):(0,q.jsxs)(q.Fragment,{children:[t&&(0,q.jsx)(t,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,q.jsx)(`span`,{className:`max-md:min-w-0 max-md:truncate`,children:r?r(e):e.label})]}),l={variant:s,size:o,className:`gap-1.5 md:shrink-0 max-md:min-w-0`,disabled:a||d!==null||n,onClick:()=>void v(e)};return i?(0,q.jsxs)(Ip,{children:[(0,q.jsx)(Lp,{render:(0,q.jsx)(Ge,{...l}),children:c}),(0,q.jsx)(Rp,{children:i})]},_(e)):(0,q.jsx)(Ge,{...l,children:c},_(e))}),h&&(0,q.jsx)(`p`,{role:`alert`,className:`basis-full text-xs text-danger`,children:h})]})}function gv({title:e,description:t,action:n,children:r}){return(0,q.jsxs)(vh,{children:[(0,q.jsxs)(yh,{className:K(n!==void 0&&`flex flex-row items-start justify-between gap-3`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,q.jsx)(bh,{children:e}),t&&(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),n!==void 0&&(0,q.jsx)(`div`,{className:`shrink-0`,children:n})]}),(0,q.jsx)(Sh,{children:(0,q.jsx)(`div`,{className:`divide-y divide-border`,children:r})})]})}function _v({label:e,description:t,control:n,dimmed:r=!1}){return(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-3 first:pt-0 last:pb-0`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:K(`text-sm`,r&&`text-muted-foreground`),children:e}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),(0,q.jsx)(`div`,{className:`shrink-0`,children:n})]})}var vv=`(no value)`;function yv({label:e,description:t,value:n,options:r,onChange:i}){if(r.length===0)return null;let a=(r.some(e=>e.value===n)?r:[...r,{value:n,label:n}]).map(e=>({value:e.value===``?vv:e.value,label:e.label,disabled:e.disabled===!0}));return(0,q.jsx)(_v,{label:e,description:t,control:(0,q.jsxs)(wg,{items:a,value:n===``?vv:n,onValueChange:e=>i(e===vv?``:e),children:[(0,q.jsx)(Eg,{size:`sm`,"aria-label":e,className:`max-w-[min(16rem,45vw)]`,children:(0,q.jsx)(Tg,{})}),(0,q.jsx)(Dg,{align:`end`,children:a.map(e=>(0,q.jsx)(Og,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})})}var bv=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(bv||{}),xv=[0,1],Sv=[1,0],Cv=[2,3],wv=[3,2],Tv={L:xv,M:Sv,Q:Cv,H:wv},Ev=/^\d*$/,Dv=/^[A-Z0-9 $%*+./:-]*$/,Ov=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,kv=1,Av=40,jv=3,Mv=3,Nv=40,Pv=10,Fv=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Iv=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],Lv=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<kv||e>Av)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,bv.Timing),this.setFunctionModule(e,6,e%2==0,bv.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,zv(r,e));this.setFunctionModule(8,7,zv(r,6)),this.setFunctionModule(8,8,zv(r,7)),this.setFunctionModule(7,8,zv(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,zv(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,zv(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,zv(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=zv(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,bv.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,bv.Alignment)}setFunctionModule(e,t,n,r=bv.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==ey(t,n))throw RangeError(`Invalid argument`);let r=Iv[n[0]][t],i=Fv[n[0]][t],a=Math.floor($v(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=ty(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=ny(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor($v(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=zv(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=jv:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Nv),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Nv}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=jv:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Nv),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Nv}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=Mv)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Pv,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function Rv(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function zv(e,t){return(e>>>t&1)!=0}var Bv=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},Vv=[1,10,12,14],Hv=[2,9,11,13],Uv=[4,8,16,16];function Wv(e,t){return e[Math.floor((t+7)/17)+1]}function Gv(e){let t=[];for(let n of e)Rv(n,8,t);return new Bv(Uv,e.length,t)}function Kv(e){if(!Yv(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);Rv(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new Bv(Vv,e.length,t)}function qv(e){if(!Xv(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n;for(n=0;n+2<=e.length;n+=2){let r=Ov.indexOf(e.charAt(n))*45;r+=Ov.indexOf(e.charAt(n+1)),Rv(r,11,t)}return n<e.length&&Rv(Ov.indexOf(e.charAt(n)),6,t),new Bv(Hv,e.length,t)}function Jv(e){return e===``?[]:Yv(e)?[Kv(e)]:Xv(e)?[qv(e)]:[Gv(Qv(e))]}function Yv(e){return Ev.test(e)}function Xv(e){return Dv.test(e)}function Zv(e,t){let n=0;for(let r of e){let e=Wv(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function Qv(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function $v(e){if(e<kv||e>Av)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function ey(e,t){return Math.floor($v(e)/8)-Fv[t[0]][e]*Iv[t[0]][e]}function ty(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=ry(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=ry(n,2)}return t}function ny(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=ry(t,e))}return n}function ry(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function iy(e,t,n=1,r=40,i=-1,a=!0){if(!(kv<=n&&n<=r&&r<=Av)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=ey(o,t)*8,i=Zv(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[Sv,Cv,wv])a&&s<=ey(o,e)*8&&(t=e);let c=[];for(let t of e){Rv(t.mode[0],4,c),Rv(t.numChars,Wv(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=ey(o,t)*8;Rv(0,Math.min(4,l-c.length),c),Rv(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)Rv(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new Lv(o,t,u,i)}function ay(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?Jv(e):Array.isArray(e)?[Gv(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=iy(c,Tv[n],i,a,o,r),u=oy({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function oy(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=bv.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function sy({text:e,label:t}){let{data:n,size:r}=ay(e,{ecc:`M`,border:2}),i=``;return n.forEach((e,t)=>{e.forEach((e,n)=>{e&&(i+=`M${n} ${t}h1v1h-1z`)})}),(0,q.jsx)(`svg`,{role:`img`,"aria-label":t,viewBox:`0 0 ${r} ${r}`,shapeRendering:`crispEdges`,className:`h-56 w-56 max-w-full rounded-md bg-white`,children:(0,q.jsx)(`path`,{d:i,fill:`black`})})}var cy={};function ly(e){let{schedule:t,pages:n,loaded:r}=dv(),i=(0,J.useContext)(pv)??fv,a=e.map(e=>e.id).join(`,`),{value:o}=_m(async()=>{if(!r)return cy;let n=t?hy({...i,package:t.package}):void 0,a=await Promise.all(e.map(async e=>!t||!n||!t.projects.includes(e.id)?[e.id,[]]:t.read(n,e).then(t=>[e.id,t],()=>void 0)));return Object.fromEntries(a.filter(e=>e!==void 0))},cy,1e4,[r,t?.package,t?.projects.join(`,`),a],`previous`),s=Object.fromEntries(e.flatMap(e=>o[e.id]?[[e.id,o[e.id]]]:[]));if(!t)return{commands:s,open:()=>{}};let c=n.find(e=>e.segment===t.page)?.label??t.page;return{page:{segment:t.page,label:c,href:N(t.page)},commands:s,open:()=>i.openPage(t.page)}}function uy(e){if(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`/`))return;let[t,...n]=e.split(`/`).filter(Boolean);if(!(!t||!D(t)||n.length===0))return{segment:t,rest:n}}function dy(e){let t=e.match(/(?<![\w./:@-])[a-z][a-z0-9]*\/[^\s()[\]<>"'`]+/g)??[];return[...new Set(t.map(e=>e.replace(/[.,;:!?]+$/,``)).filter(e=>uy(e)!==void 0))]}var fy={};function py(e){let{pages:t}=dv(),n=(0,J.useContext)(pv)??fv,r=e.map(({projectId:e,paths:t})=>`${e}\n${[...t].sort().join(`
|
|
22
|
-
`)}`).join(`
|
|
23
|
-
|
|
24
|
-
`),i=t.filter(e=>e.names!==void 0),{value:a}=_m(async()=>{let t={};return await Promise.all(e.flatMap(({projectId:e,paths:r})=>i.filter(t=>t.projects.includes(e)).map(async i=>{let a=r.filter(e=>uy(e)?.segment===i.segment);if(a.length===0)return;let o=await i.names(hy({...n,package:i.package}),e,a).catch(()=>({}));for(let n of a){let r=o[n];r&&typeof r.title==`string`&&r.title.trim()!==``&&(t[`${e}\n${n}`]={title:r.title,href:typeof r.href==`string`?r.href:n})}}))),t},fy,6e4,[r,i.map(e=>e.package).join(`,`)],`previous`);return(e,t)=>{let r=a[`${e}\n${t}`],i=r&&uy(r.href);return r&&i?{title:r.title,open:()=>n.openPage(i.segment,[e,...i.rest])}:void 0}}function my(e){return e}function hy(e,t={}){return{...e,runCommand:(n,r,i)=>mh(n,e.package,r,i,t.acts??!1),act:(t,n,r)=>mh(t,e.package,n,r,!0),runComputerCommand:(t,n)=>hh(e.package,t,n),read:(t,n,r={})=>gh(t,e.package,n,r)}}var gy=(0,J.createContext)(null);function _y(){let e=(0,J.useContext)(gy);if(!e)throw Error(`useModuleHost is only available inside a module page`);return`runCommand`in e?e:hy(e)}export{Nm as $,Bt as $t,wg as A,S as An,$f as At,jh as B,c as Bn,rp as Bt,I_ as C,z as Cn,Wp as Ct,Kg as D,k as Dn,Rp as Dt,j_ as E,N as En,Ip as Et,Ih as F,u as Fn,up as Ft,yh as G,Z as Gt,kh as H,Ts as Ht,Ah as I,d as In,lp as It,_h as J,zt as Jt,bh as K,Yt as Kt,Mh as L,p as Ln,tp as Lt,Og as M,v as Mn,ip as Mt,Eg as N,g as Nn,ep as Nt,Jg as O,T as On,Fp as Ot,Tg as P,_ as Pn,ap as Pt,Zm as Q,Ut as Qt,Fh as R,a as Rn,cp as Rt,z_ as S,K as Sn,Gp as St,M_ as T,j as Tn,zp as Tt,vh as U,Es as Ut,Nh as V,Jf as Vt,Sh as W,Ds as Wt,nh as X,Rt as Xt,fh as Y,Lt as Yt,th as Z,Vt as Zt,dv as _,Ye as _n,am as _t,dy as a,Et as an,jm as at,B_ as b,Ge as bn,Qp as bt,sy as c,Ct as cn,wm as ct,yv as d,mt as dn,vm as dt,Gt as en,Mm as et,hv as f,ht as fn,dm as ft,lv as g,Xe as gn,sm as gt,uv as h,it as hn,_m as ht,_y as i,Mt as in,Om as it,Dg as j,x as jn,op as jt,qg as k,w as kn,Lp as kt,_v as l,St as ln,bm as lt,mv as m,tt as mn,gm as mt,my as n,Ft as nn,Am as nt,py as o,Tt as on,Em as ot,pv as p,gt as pn,pm as pt,xh as q,qt,hy as r,Pt as rn,km as rt,ly as s,wt as sn,Cm as st,gy as t,Kt as tn,Dm as tt,gv as u,xt as un,ym as ut,Q_ as v,Qe as vn,im as vt,L_ as w,A as wn,Bp as wt,R_ as x,We as xn,Kp as xt,Z_ as y,Ze as yn,$p as yt,Ph as z,s as zn,sp as zt};
|