@tanstack/query-devtools 5.108.0 → 5.108.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{DevtoolsComponent-u2WBBkWz.js → DevtoolsComponent-CJG_H2ix.js} +2 -2
- package/build/DevtoolsComponent-CJG_H2ix.js.map +1 -0
- package/build/{DevtoolsComponent-BGJcHYi5.cjs → DevtoolsComponent-CJb6tQE-.cjs} +1 -1
- package/build/{DevtoolsPanelComponent-1kShldEU.cjs → DevtoolsPanelComponent-BXsLpTv2.cjs} +1 -1
- package/build/{DevtoolsPanelComponent-DKq0vg7C.js → DevtoolsPanelComponent-By2KdGQW.js} +2 -2
- package/build/DevtoolsPanelComponent-By2KdGQW.js.map +1 -0
- package/build/{DevtoolsSubscriptionsProvider-B_iiu5dm.cjs → DevtoolsSubscriptionsProvider-CBn1lU_l.cjs} +1 -1
- package/build/{DevtoolsSubscriptionsProvider-BQAD7Uyk.js → DevtoolsSubscriptionsProvider-DQhbYH9U.js} +2 -2
- package/build/DevtoolsSubscriptionsProvider-DQhbYH9U.js.map +1 -0
- package/build/index.cjs +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/utils-DC2pN79q.js.map +1 -1
- package/package.json +2 -2
- package/build/DevtoolsComponent-u2WBBkWz.js.map +0 -1
- package/build/DevtoolsPanelComponent-DKq0vg7C.js.map +0 -1
- package/build/DevtoolsSubscriptionsProvider-BQAD7Uyk.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,l as s,n as c,r as l,s as u,t as d}from"./DevtoolsSubscriptionsProvider-
|
|
3
|
-
//# sourceMappingURL=DevtoolsComponent-
|
|
2
|
+
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{a as r,c as i,d as a,f as o,l as s,n as c,r as l,s as u,t as d}from"./DevtoolsSubscriptionsProvider-DQhbYH9U.js";const f=f=>{let[p,m]=a({prefix:`TanstackQueryDevtools`}),h=n(),g=t(()=>{let e=f.theme||p.theme_preference||`system`;return e===`system`?h():e});return e(s.Provider,{value:f,get children(){return e(c,{get children(){return e(l,{get children(){return e(d,{get children(){return e(i,{localStore:p,setLocalStore:m,get children(){return e(u.Provider,{value:g,get children(){return e(o,{locale:`en-US`,get children(){return e(r,{localStore:p,setLocalStore:m})}})}})}})}})}})}})}})};export{f as default};
|
|
3
|
+
//# sourceMappingURL=DevtoolsComponent-CJG_H2ix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevtoolsComponent-CJG_H2ix.js","names":["I18nProvider","createLocalStorage","createMemo","Devtools","PiPProvider","QueryDevtoolsContext","ThemeContext","DevtoolsOfflineProvider","DevtoolsStateProvider","DevtoolsSubscriptionsProvider","getPreferredColorScheme","DevtoolsComponent","props","localStore","setLocalStore","prefix","colorScheme","theme","preference","theme_preference","_$createComponent","Provider","value","children","locale","createComponent","createMemo","getPreferredColorScheme","Devtools","PiPProvider","createLocalStorage","I18nProvider","QueryDevtoolsContext","DevtoolsStateProvider","DevtoolsOfflineProvider","ThemeContext","DevtoolsSubscriptionsProvider","DevtoolsComponent","localStore","setLocalStore","colorScheme","theme","preference","props"],"sources":["../src/DevtoolsComponent.tsx"],"sourcesContent":["import { I18nProvider } from '@kobalte/core'\nimport { createLocalStorage } from '@solid-primitives/storage'\nimport { createMemo } from 'solid-js'\nimport { Devtools } from './Devtools'\nimport { THEME_PREFERENCE } from './constants'\nimport { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'\nimport { DevtoolsOfflineProvider } from './providers/DevtoolsOfflineProvider'\nimport { DevtoolsStateProvider } from './providers/DevtoolsStateProvider'\nimport { DevtoolsSubscriptionsProvider } from './providers/DevtoolsSubscriptionsProvider'\nimport { getPreferredColorScheme } from './utils'\nimport type { DevtoolsComponentType } from './Devtools'\nimport type { Theme } from './contexts'\n\nconst DevtoolsComponent: DevtoolsComponentType = (props) => {\n const [localStore, setLocalStore] = createLocalStorage({\n prefix: 'TanstackQueryDevtools',\n })\n\n const colorScheme = getPreferredColorScheme()\n\n const theme = createMemo(() => {\n const preference = (props.theme ||\n localStore.theme_preference ||\n THEME_PREFERENCE) as Theme\n if (preference !== 'system') return preference\n return colorScheme()\n })\n\n return (\n <QueryDevtoolsContext.Provider value={props}>\n <DevtoolsStateProvider>\n <DevtoolsOfflineProvider>\n <DevtoolsSubscriptionsProvider>\n <PiPProvider localStore={localStore} setLocalStore={setLocalStore}>\n <ThemeContext.Provider value={theme}>\n <I18nProvider locale=\"en-US\">\n <Devtools\n localStore={localStore}\n setLocalStore={setLocalStore}\n />\n </I18nProvider>\n </ThemeContext.Provider>\n </PiPProvider>\n </DevtoolsSubscriptionsProvider>\n </DevtoolsOfflineProvider>\n </DevtoolsStateProvider>\n </QueryDevtoolsContext.Provider>\n )\n}\n\nexport default DevtoolsComponent\n"],"mappings":";A,8KAaA,MAAMW,EAA4CC,GAAU,CAC1D,GAAM,CAACC,EAAYC,GAAiBb,EAAmB,CACrDc,OAAQ,uBACV,CAAC,EAEKC,EAAcN,EAAwB,EAEtCO,EAAQf,MAAiB,CAC7B,IAAMgB,EAAcN,EAAMK,OACxBJ,EAAWM,kBAAAA,SAGb,OADID,IAAe,SACZF,EAAY,EADiBE,CAEtC,CAAC,EAED,OAAAE,EACGf,EAAqBgB,SAAQ,CAACC,MAAOV,EAAK,IAAAW,UAAA,CAAA,OAAAH,EACxCZ,EAAqB,CAAA,IAAAe,UAAA,CAAA,OAAAH,EACnBb,EAAuB,CAAA,IAAAgB,UAAA,CAAA,OAAAH,EACrBX,EAA6B,CAAA,IAAAc,UAAA,CAAA,OAAAH,EAC3BhB,EAAW,CAAaS,aAA2BC,gBAAa,IAAAS,UAAA,CAAA,OAAAH,EAC9Dd,EAAae,SAAQ,CAACC,MAAOL,EAAK,IAAAM,UAAA,CAAA,OAAAH,EAChCpB,EAAY,CAACwB,OAAM,QAAA,IAAAD,UAAA,CAAA,OAAAH,EACjBjB,EAAQ,CACKU,aACGC,eAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAUhD,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
const e=require("./utils-DJl-N7L2.cjs"),t=require("./DevtoolsSubscriptionsProvider-
|
|
2
|
+
const e=require("./utils-DJl-N7L2.cjs"),t=require("./DevtoolsSubscriptionsProvider-CBn1lU_l.cjs"),n=n=>{let[r,i]=t.d({prefix:`TanstackQueryDevtools`}),a=e.a(),o=e.W(()=>{let e=n.theme||r.theme_preference||`system`;return e===`system`?a():e});return e.B(t.l.Provider,{value:n,get children(){return e.B(t.n,{get children(){return e.B(t.r,{get children(){return e.B(t.t,{get children(){return e.B(t.c,{localStore:r,setLocalStore:i,get children(){return e.B(t.s.Provider,{value:o,get children(){return e.B(t.f,{locale:`en-US`,get children(){return e.B(t.a,{localStore:r,setLocalStore:i})}})}})}})}})}})}})}})};exports.default=n;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
const e=require("./utils-DJl-N7L2.cjs"),t=require("./DevtoolsSubscriptionsProvider-
|
|
2
|
+
const e=require("./utils-DJl-N7L2.cjs"),t=require("./DevtoolsSubscriptionsProvider-CBn1lU_l.cjs"),n=n=>{let[r,i]=t.d({prefix:`TanstackQueryDevtools`}),a=e.a(),o=e.W(()=>{let e=n.theme||r.theme_preference||`system`;return e===`system`?a():e});return e.B(t.l.Provider,{value:n,get children(){return e.B(t.n,{get children(){return e.B(t.r,{get children(){return e.B(t.t,{get children(){return e.B(t.c,{disabled:!0,localStore:r,setLocalStore:i,get children(){return e.B(t.s.Provider,{value:o,get children(){return e.B(t.f,{locale:`en-US`,get children(){return e.B(t.o,{get children(){return e.B(t.i,{localStore:r,setLocalStore:i,get onClose(){return n.onClose},showPanelViewOnly:!0})}})}})}})}})}})}})}})}})};exports.default=n;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{c as r,d as i,f as a,i as o,l as s,n as c,o as l,r as u,s as d,t as f}from"./DevtoolsSubscriptionsProvider-
|
|
3
|
-
//# sourceMappingURL=DevtoolsPanelComponent-
|
|
2
|
+
import{B as e,W as t,a as n}from"./utils-DC2pN79q.js";import{c as r,d as i,f as a,i as o,l as s,n as c,o as l,r as u,s as d,t as f}from"./DevtoolsSubscriptionsProvider-DQhbYH9U.js";const p=p=>{let[m,h]=i({prefix:`TanstackQueryDevtools`}),g=n(),_=t(()=>{let e=p.theme||m.theme_preference||`system`;return e===`system`?g():e});return e(s.Provider,{value:p,get children(){return e(c,{get children(){return e(u,{get children(){return e(f,{get children(){return e(r,{disabled:!0,localStore:m,setLocalStore:h,get children(){return e(d.Provider,{value:_,get children(){return e(a,{locale:`en-US`,get children(){return e(l,{get children(){return e(o,{localStore:m,setLocalStore:h,get onClose(){return p.onClose},showPanelViewOnly:!0})}})}})}})}})}})}})}})}})};export{p as default};
|
|
3
|
+
//# sourceMappingURL=DevtoolsPanelComponent-By2KdGQW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevtoolsPanelComponent-By2KdGQW.js","names":["I18nProvider","createLocalStorage","createMemo","ContentView","ParentPanel","PiPProvider","QueryDevtoolsContext","ThemeContext","DevtoolsOfflineProvider","DevtoolsStateProvider","DevtoolsSubscriptionsProvider","getPreferredColorScheme","DevtoolsPanelComponent","props","localStore","setLocalStore","prefix","colorScheme","theme","preference","theme_preference","_$createComponent","Provider","value","children","disabled","locale","onClose","showPanelViewOnly","createComponent","createMemo","getPreferredColorScheme","PiPProvider","createLocalStorage","I18nProvider","ContentView","QueryDevtoolsContext","DevtoolsStateProvider","ParentPanel","DevtoolsOfflineProvider","ThemeContext","DevtoolsSubscriptionsProvider","DevtoolsPanelComponent","localStore","setLocalStore","colorScheme","theme","preference","props"],"sources":["../src/DevtoolsPanelComponent.tsx"],"sourcesContent":["import { I18nProvider } from '@kobalte/core'\nimport { createLocalStorage } from '@solid-primitives/storage'\nimport { createMemo } from 'solid-js'\nimport { ContentView, ParentPanel } from './Devtools'\nimport { THEME_PREFERENCE } from './constants'\nimport { PiPProvider, QueryDevtoolsContext, ThemeContext } from './contexts'\nimport { DevtoolsOfflineProvider } from './providers/DevtoolsOfflineProvider'\nimport { DevtoolsStateProvider } from './providers/DevtoolsStateProvider'\nimport { DevtoolsSubscriptionsProvider } from './providers/DevtoolsSubscriptionsProvider'\nimport { getPreferredColorScheme } from './utils'\nimport type { DevtoolsComponentType } from './Devtools'\nimport type { Theme } from './contexts'\n\nconst DevtoolsPanelComponent: DevtoolsComponentType = (props) => {\n const [localStore, setLocalStore] = createLocalStorage({\n prefix: 'TanstackQueryDevtools',\n })\n\n const colorScheme = getPreferredColorScheme()\n\n const theme = createMemo(() => {\n const preference = (props.theme ||\n localStore.theme_preference ||\n THEME_PREFERENCE) as Theme\n if (preference !== 'system') return preference\n return colorScheme()\n })\n\n return (\n <QueryDevtoolsContext.Provider value={props}>\n <DevtoolsStateProvider>\n <DevtoolsOfflineProvider>\n <DevtoolsSubscriptionsProvider>\n <PiPProvider\n disabled\n localStore={localStore}\n setLocalStore={setLocalStore}\n >\n <ThemeContext.Provider value={theme}>\n <I18nProvider locale=\"en-US\">\n <ParentPanel>\n <ContentView\n localStore={localStore}\n setLocalStore={setLocalStore}\n onClose={props.onClose}\n showPanelViewOnly\n />\n </ParentPanel>\n </I18nProvider>\n </ThemeContext.Provider>\n </PiPProvider>\n </DevtoolsSubscriptionsProvider>\n </DevtoolsOfflineProvider>\n </DevtoolsStateProvider>\n </QueryDevtoolsContext.Provider>\n )\n}\n\nexport default DevtoolsPanelComponent\n"],"mappings":";A,qLAaA,MAAMY,EAAiDC,GAAU,CAC/D,GAAM,CAACC,EAAYC,GAAiBd,EAAmB,CACrDe,OAAQ,uBACV,CAAC,EAEKC,EAAcN,EAAwB,EAEtCO,EAAQhB,MAAiB,CAC7B,IAAMiB,EAAcN,EAAMK,OACxBJ,EAAWM,kBAAAA,SAGb,OADID,IAAe,SACZF,EAAY,EADiBE,CAEtC,CAAC,EAED,OAAAE,EACGf,EAAqBgB,SAAQ,CAACC,MAAOV,EAAK,IAAAW,UAAA,CAAA,OAAAH,EACxCZ,EAAqB,CAAA,IAAAe,UAAA,CAAA,OAAAH,EACnBb,EAAuB,CAAA,IAAAgB,UAAA,CAAA,OAAAH,EACrBX,EAA6B,CAAA,IAAAc,UAAA,CAAA,OAAAH,EAC3BhB,EAAW,CACVoB,SAAQ,GACIX,aACGC,gBAAa,IAAAS,UAAA,CAAA,OAAAH,EAE3Bd,EAAae,SAAQ,CAACC,MAAOL,EAAK,IAAAM,UAAA,CAAA,OAAAH,EAChCrB,EAAY,CAAC0B,OAAM,QAAA,IAAAF,UAAA,CAAA,OAAAH,EACjBjB,EAAW,CAAA,IAAAoB,UAAA,CAAA,OAAAH,EACTlB,EAAW,CACEW,aACGC,gBAAa,IAC5BY,SAAO,CAAA,OAAEd,EAAMc,OAAO,EACtBC,kBAAiB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAWvC,E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @refresh skip */
|
|
2
|
-
const e=require("./utils-DJl-N7L2.cjs"),t=e=>e!=null,n=e=>e.filter(t);function r(e){return(...t)=>{for(let n of e)n&&n(...t)}}const i=e=>typeof e==`function`&&!e.length?e():e,a=e=>Array.isArray(e)?e:e?[e]:[];function o(e,...t){return typeof e==`function`?e(...t):e}const s=e.et;function c(e,t,n,r){let i=e.length,a=t.length,o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,c;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(c of e)t.includes(c)||n(c)}function l(e,t,n,r){return e.addEventListener(t,n,r),s(e.removeEventListener.bind(e,t,n,r))}function u(t,n,r,o){let s=()=>{a(i(t)).forEach(e=>{e&&a(i(n)).forEach(t=>l(e,t,r,o))})};typeof t==`function`?e.U(s):e.G(s)}const d=Symbol(`fallback`);function f(e){for(let t of e)t.dispose()}function p(t,n,r,i={}){let a=/* @__PURE__ */ new Map;return e.et(()=>f(a.values())),()=>{let r=t()||[];return r[e.N],e.rt(()=>{if(!r.length)return f(a.values()),a.clear(),i.fallback?[e.K(e=>(a.set(d,{dispose:e}),i.fallback()))]:[];let t=Array(r.length),s=a.get(d);if(!a.size||s){s?.dispose(),a.delete(d);for(let e=0;e<r.length;e++){let i=r[e],a=n(i,e);o(t,i,e,a)}return t}let c=new Set(a.keys());for(let e=0;e<r.length;e++){let i=r[e],s=n(i,e);c.delete(s);let l=a.get(s);l?(t[e]=l.mapped,l.setIndex?.(e),l.setItem(()=>i)):o(t,i,e,s)}for(let e of c)a.get(e)?.dispose(),a.delete(e);return t})};function o(t,n,i,o){e.K(s=>{let[c,l]=e.q(n),u={setItem:l,dispose:s};if(r.length>1){let[t,n]=e.q(i);u.setIndex=n,u.mapped=r(c,t)}else u.mapped=r(c);a.set(o,u),t[i]=u.mapped})}}function m(t){let{by:n}=t;return e.W(p(()=>t.each,typeof n==`function`?n:e=>e[n],t.children,`fallback`in t?{fallback:()=>t.fallback}:void 0))}const h=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function g(e){let t={},n;for(;n=h.exec(e);)t[n[1]]=n[2];return t}function _(e,t){if(typeof e==`string`){if(typeof t==`string`)return`${e};${t}`;e=g(e)}else typeof t==`string`&&(t=g(t));return{...e,...t}}function v(...e){return r(e)}const y=e=>e instanceof Element;function b(e,t){if(t(e))return e;if(typeof e==`function`&&!e.length)return b(e(),t);if(Array.isArray(e)){let n=[];for(let r of e){let e=b(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function x(t,n=y,r=y){let i=e.W(t),a=e.W(()=>b(i(),n));return a.toArray=()=>{let e=a();return Array.isArray(e)?e:e?[e]:[]},a}function S(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function C(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function w(e){return typeof e==`number`}function T(e){return Object.prototype.toString.call(e)===`[object String]`}function E(e){return typeof e==`function`}function D(e){return t=>`${e()}-${t}`}function O(e,t){return e?e===t||e.contains(t):!1}function k(e,t=!1){let{activeElement:n}=j(e);if(!n?.nodeName)return null;if(M(n)&&n.contentDocument)return k(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=j(n).getElementById(e);if(t)return t}}return n}function A(e){return j(e).defaultView||window}function j(e){return e?e.ownerDocument||e:document}function M(e){return e.tagName===`IFRAME`}var N=/* @__PURE__ */ (e=>(e.Escape=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`,e.Space=` `,e.ArrowDown=`ArrowDown`,e.ArrowLeft=`ArrowLeft`,e.ArrowRight=`ArrowRight`,e.ArrowUp=`ArrowUp`,e.End=`End`,e.Home=`Home`,e.PageDown=`PageDown`,e.PageUp=`PageUp`,e))(N||{});function P(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function F(){return P(/^Mac/i)}function ee(){return P(/^iPhone/i)}function I(){return P(/^iPad/i)||F()&&navigator.maxTouchPoints>1}function L(){return ee()||I()}function te(){return F()||L()}function R(e,t){return t&&(E(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function z(e){return t=>{for(let n of e)R(t,n)}}function ne(e){return F()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function B(e){if(e){if(re())e.focus({preventScroll:!0});else{let t=ie(e);e.focus(),ae(t)}}}var V=null;function re(){if(V==null){V=!1;try{document.createElement(`div`).focus({get preventScroll(){return V=!0,!0}})}catch{}}return V}function ie(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function ae(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var oe=[`input:not([type='hidden']):not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`[tabindex]`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable='false'])`],se=[...oe,`[tabindex]:not([tabindex="-1"]):not([disabled])`],ce=`${oe.join(`:not([hidden]),`)},[tabindex]:not([disabled]):not([hidden])`,le=se.join(`:not([hidden]):not([tabindex="-1"]),`);function ue(e,t){let n=Array.from(e.querySelectorAll(ce)).filter(de);return t&&de(e)&&n.unshift(e),n.forEach((e,t)=>{if(M(e)&&e.contentDocument){let r=e.contentDocument.body,i=ue(r,!1);n.splice(t,1,...i)}}),n}function de(e){return fe(e)&&!pe(e)}function fe(e){return e.matches(ce)&&me(e)}function pe(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function me(e,t){return e.nodeName!==`#comment`&&he(e)&&ge(e,t)&&(!e.parentElement||me(e.parentElement,e))}function he(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r=t!==`none`&&n!==`hidden`&&n!==`collapse`;if(r){if(!e.ownerDocument.defaultView)return r;let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:i}=t(e);r=n!==`none`&&i!==`hidden`&&i!==`collapse`}return r}function ge(e,t){return!e.hasAttribute(`hidden`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function _e(e,t){return t.some(t=>t.contains(e))}function ve(e,t,n){let r=t?.tabbable?le:ce,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(r)&&me(e)&&(!n||_e(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function ye(e){let t=e;for(;t&&!be(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function be(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function xe(){}function Se(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=a,o=0,s=e-1;o<e;s=o++){let[a,c]=t[o],[l,u]=t[s],[,d]=t[s===0?e-1:s-1]||[0,0],f=(c-u)*(n-a)-(a-l)*(r-c);if(u<c){if(r>=u&&r<c){if(f===0)return!0;f>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(c<u){if(r>c&&r<=u){if(f===0)return!0;f<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r===c&&(n>=l&&n<=a||n>=a&&n<=l))return!0}return i}function H(t,n){return e.Q(t,n)}var Ce=/* @__PURE__ */ new Map,we=/* @__PURE__ */ new Set;function Te(){if(typeof window>`u`||document.body===null)return;let e=e=>{if(!e.target)return;let n=Ce.get(e.target);n||(n=/* @__PURE__ */ new Set,Ce.set(e.target,n),e.target.addEventListener(`transitioncancel`,t)),n.add(e.propertyName)},t=e=>{if(!e.target)return;let n=Ce.get(e.target);if(n&&(n.delete(e.propertyName),n.size===0&&(e.target.removeEventListener(`transitioncancel`,t),Ce.delete(e.target)),Ce.size===0)){for(let e of we)e();we.clear()}};document.body.addEventListener(`transitionrun`,e),document.body.addEventListener(`transitionend`,t)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Te):Te());function Ee(e,t){let n=De(e,t,`left`),r=De(e,t,`top`),i=t.offsetWidth,a=t.offsetHeight,o=e.scrollLeft,s=e.scrollTop,c=o+e.offsetWidth,l=s+e.offsetHeight;n<=o?o=n:n+i>c&&(o+=n+i-c),r<=s?s=r:r+a>l&&(s+=r+a-l),e.scrollLeft=o,e.scrollTop=s}function De(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Oe(e,t){if(document.contains(e)){let n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow!==`hidden`){let{left:n,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(n-i)>1||Math.abs(r-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let t=ye(e);for(;e&&t&&e!==n&&t!==n;)Ee(t,e),e=t,t=ye(e)}}}var ke={border:`0`,clip:`rect(0 0 0 0)`,"clip-path":`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,"white-space":`nowrap`};function Ae(e){let t=e.startIndex??0,n=e.startLevel??0,r=[],i=t=>{if(t==null)return``;let n=e.getKey??`key`,r=T(n)?t[n]:n(t);return r==null?``:String(r)},a=t=>{if(t==null)return``;let n=e.getTextValue??`textValue`,r=T(n)?t[n]:n(t);return r==null?``:String(r)},o=t=>{if(t==null)return!1;let n=e.getDisabled??`disabled`;return(T(n)?t[n]:n(t))??!1},s=t=>{if(t!=null)return T(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(let c of e.dataSource)if(T(c)||w(c))r.push({type:`item`,rawValue:c,key:String(c),textValue:String(c),disabled:o(c),level:n,index:t}),t++;else if(s(c)!=null){r.push({type:`section`,rawValue:c,key:``,textValue:``,disabled:!1,level:n,index:t}),t++;let i=s(c)??[];if(i.length>0){let a=Ae({dataSource:i,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...a),t+=a.length}}else r.push({type:`item`,rawValue:c,key:i(c),textValue:a(c),disabled:o(c),level:n,index:t}),t++;return r}function je(t,n=[]){return e.W(()=>{let e=Ae({dataSource:i(t.dataSource),getKey:i(t.getKey),getTextValue:i(t.getTextValue),getDisabled:i(t.getDisabled),getSectionChildren:i(t.getSectionChildren)});for(let e=0;e<n.length;e++)n[e]();return t.factory(e)})}var Me=/* @__PURE__ */ new Set([`Avst`,`Arab`,`Armi`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Ne=/* @__PURE__ */ new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Pe(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script??``;return Me.has(t)}let t=e.split(`-`)[0];return Ne.has(t)}function Fe(e){return Pe(e)?`rtl`:`ltr`}function Ie(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;return{locale:e,direction:Fe(e)}}var Le=Ie(),Re=/* @__PURE__ */ new Set;function ze(){Le=Ie();for(let e of Re)e(Le)}function Be(){let[t,n]=e.q(Le),r=e.W(()=>t());return e.tt(()=>{Re.size===0&&window.addEventListener(`languagechange`,ze),Re.add(n),e.et(()=>{Re.delete(n),Re.size===0&&window.removeEventListener(`languagechange`,ze)})}),{locale:()=>r().locale,direction:()=>r().direction}}var Ve=e.H();function He(t){let n=Be();return e.B(Ve.Provider,{value:{locale:()=>t.locale??n.locale(),direction:()=>t.locale?Fe(t.locale):n.direction()},get children(){return t.children}})}function Ue(){let t=Be();return e.it(Ve)||t}var We=/* @__PURE__ */ new Map;function Ge(t){let{locale:n}=Ue(),r=e.W(()=>n()+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``));return e.W(()=>{let e=r(),i;return We.has(e)&&(i=We.get(e)),i||(i=new Intl.Collator(n(),t),We.set(e,i)),i})}function Ke(t){let[n,r]=e.q(t.defaultValue?.()),i=e.W(()=>t.value?.()!==void 0),a=e.W(()=>i()?t.value?.():n());return[a,n=>{e.rt(()=>{let e=o(n,a());return Object.is(e,a())||(i()||r(e),t.onChange?.(e)),e})}]}function qe(e){let[t,n]=Ke(e);return[()=>t()??!1,n]}function Je(e){let[t,n]=Ke(e);return[()=>t()??[],n]}var Ye=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function Xe(e){let[t,n]=Ke(e);return[()=>t()??new Ye,n]}function Ze(e){return te()?e.altKey:e.ctrlKey}function Qe(e){return F()?e.metaKey:e.ctrlKey}function $e(e){return new Ye(e)}function et(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function tt(t){let n=H({selectionMode:`none`,selectionBehavior:`toggle`},t),[r,a]=e.q(!1),[o,s]=e.q(),[c,l]=Xe({value:e.W(()=>{let e=i(n.selectedKeys);return e==null?e:$e(e)}),defaultValue:e.W(()=>{let e=i(n.defaultSelectedKeys);return e==null?new Ye:$e(e)}),onChange:e=>n.onSelectionChange?.(e)}),[u,d]=e.q(i(n.selectionBehavior));return e.U(()=>{let e=c();i(n.selectionBehavior)===`replace`&&u()===`toggle`&&typeof e==`object`&&e.size===0&&d(`replace`)}),e.U(()=>{d(i(n.selectionBehavior)??`toggle`)}),{selectionMode:()=>i(n.selectionMode),disallowEmptySelection:()=>i(n.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:r,setFocused:a,focusedKey:o,setFocusedKey:s,selectedKeys:c,setSelectedKeys:e=>{(i(n.allowDuplicateSelectionEvents)||!et(e,c()))&&l(e)}}}function nt(t){let[n,r]=e.q(``),[a,o]=e.q(-1);return{typeSelectHandlers:{onKeyDown:e=>{if(i(t.isDisabled))return;let s=i(t.keyboardDelegate),c=i(t.selectionManager);if(!s.getKeyForSearch)return;let l=rt(e.key);if(!l||e.ctrlKey||e.metaKey)return;l===` `&&n().trim().length>0&&(e.preventDefault(),e.stopPropagation());let u=r(e=>e+l),d=s.getKeyForSearch(u,c.focusedKey())??s.getKeyForSearch(u);d==null&&it(u)&&(u=u[0],d=s.getKeyForSearch(u,c.focusedKey())??s.getKeyForSearch(u)),d!=null&&(c.setFocusedKey(d),t.onTypeSelect?.(d)),clearTimeout(a()),o(window.setTimeout(()=>r(``),500))}}}}function rt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function it(e){return e.split(``).every(t=>t===e[0])}function at(t,n,r){let a=e.Q({selectOnFocus:()=>i(t.selectionManager).selectionBehavior()===`replace`},t),o=()=>r?.()??n(),{direction:s}=Ue(),c={top:0,left:0};u(()=>i(a.isVirtualized)?void 0:o(),`scroll`,()=>{let e=o();e&&(c={top:e.scrollTop,left:e.scrollLeft})});let{typeSelectHandlers:l}=nt({isDisabled:()=>i(a.disallowTypeAhead),keyboardDelegate:()=>i(a.keyboardDelegate),selectionManager:()=>i(a.selectionManager)}),d=()=>i(a.orientation)??`vertical`,f=e=>{R(e,l.onKeyDown),e.altKey&&e.key===`Tab`&&e.preventDefault();let t=n();if(!t?.contains(e.target))return;let r=i(a.selectionManager),o=i(a.selectOnFocus),c=t=>{t!=null&&(r.setFocusedKey(t),e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&!Ze(e)&&r.replaceSelection(t))},u=i(a.keyboardDelegate),f=i(a.shouldFocusWrap),p=r.focusedKey();switch(e.key){case d()===`vertical`?`ArrowDown`:`ArrowRight`:if(u.getKeyBelow){e.preventDefault();let t;t=p==null?u.getFirstKey?.():u.getKeyBelow(p),t==null&&f&&(t=u.getFirstKey?.(p)),c(t)}break;case d()===`vertical`?`ArrowUp`:`ArrowLeft`:if(u.getKeyAbove){e.preventDefault();let t;t=p==null?u.getLastKey?.():u.getKeyAbove(p),t==null&&f&&(t=u.getLastKey?.(p)),c(t)}break;case d()===`vertical`?`ArrowLeft`:`ArrowUp`:if(u.getKeyLeftOf){e.preventDefault();let t=s()===`rtl`,n;n=p==null?t?u.getFirstKey?.():u.getLastKey?.():u.getKeyLeftOf(p),c(n)}break;case d()===`vertical`?`ArrowRight`:`ArrowDown`:if(u.getKeyRightOf){e.preventDefault();let t=s()===`rtl`,n;n=p==null?t?u.getLastKey?.():u.getFirstKey?.():u.getKeyRightOf(p),c(n)}break;case`Home`:if(u.getFirstKey){e.preventDefault();let t=u.getFirstKey(p,Qe(e));t!=null&&(r.setFocusedKey(t),Qe(e)&&e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&r.replaceSelection(t))}break;case`End`:if(u.getLastKey){e.preventDefault();let t=u.getLastKey(p,Qe(e));t!=null&&(r.setFocusedKey(t),Qe(e)&&e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&r.replaceSelection(t))}break;case`PageDown`:u.getKeyPageBelow&&p!=null&&(e.preventDefault(),c(u.getKeyPageBelow(p)));break;case`PageUp`:u.getKeyPageAbove&&p!=null&&(e.preventDefault(),c(u.getKeyPageAbove(p)));break;case`a`:Qe(e)&&r.selectionMode()===`multiple`&&i(a.disallowSelectAll)!==!0&&(e.preventDefault(),r.selectAll());break;case`Escape`:!e.defaultPrevented&&!i(a.disallowEmptySelection)&&(e.preventDefault(),r.clearSelection());break;case`Tab`:if(!i(a.allowsTabNavigation)){if(e.shiftKey)t.focus();else{let e=ve(t,{tabbable:!0}),n,r;do r=e.lastChild(),r&&(n=r);while(r);n&&!n.contains(document.activeElement)&&B(n)}break}}},p=e=>{let t=i(a.selectionManager),n=i(a.keyboardDelegate),r=i(a.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target)){if(t.setFocused(!0),t.focusedKey()==null){let i=e=>{e!=null&&(t.setFocusedKey(e),r&&t.replaceSelection(e))},a=e.relatedTarget;a&&e.currentTarget.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?i(t.lastSelectedKey()??n.getLastKey?.()):i(t.firstSelectedKey()??n.getFirstKey?.())}else if(!i(a.isVirtualized)){let e=o();if(e){e.scrollTop=c.top,e.scrollLeft=c.left;let n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(B(n),Ee(e,n))}}}},m=e=>{let t=i(a.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)},h=e=>{o()===e.target&&e.preventDefault()},g=()=>{let e=i(a.autoFocus);if(!e)return;let t=i(a.selectionManager),r=i(a.keyboardDelegate),o;e===`first`&&(o=r.getFirstKey?.()),e===`last`&&(o=r.getLastKey?.());let s=t.selectedKeys();s.size&&(o=s.values().next().value),t.setFocused(!0),t.setFocusedKey(o);let c=n();c&&o==null&&!i(a.shouldUseVirtualFocus)&&B(c)};return e.tt(()=>{a.deferAutoFocus?setTimeout(g,0):g()}),e.U(e.$([o,()=>i(a.isVirtualized),()=>i(a.selectionManager).focusedKey()],e=>{let[t,n,r]=e;if(n)r&&a.scrollToKey?.(r);else if(r&&t){let e=t.querySelector(`[data-key="${r}"]`);e&&Ee(t,e)}})),{tabIndex:e.W(()=>{if(!i(a.shouldUseVirtualFocus))return i(a.selectionManager).focusedKey()==null?0:-1}),onKeyDown:f,onMouseDown:h,onFocusIn:p,onFocusOut:m}}function ot(t,n){let r=()=>i(t.selectionManager),a=()=>i(t.key),o=()=>i(t.shouldUseVirtualFocus),s=e=>{r().selectionMode()!==`none`&&(r().selectionMode()===`single`?r().isSelected(a())&&!r().disallowEmptySelection()?r().toggleSelection(a()):r().replaceSelection(a()):e?.shiftKey?r().extendSelection(a()):r().selectionBehavior()===`toggle`||Qe(e)||`pointerType`in e&&e.pointerType===`touch`?r().toggleSelection(a()):r().replaceSelection(a()))},c=()=>r().isSelected(a()),l=()=>i(t.disabled)||r().isDisabled(a()),u=()=>!l()&&r().canSelectItem(a()),d=null,f=e=>{u()&&(d=e.pointerType,e.pointerType===`mouse`&&e.button===0&&!i(t.shouldSelectOnPressUp)&&s(e))},p=e=>{u()&&e.pointerType===`mouse`&&e.button===0&&i(t.shouldSelectOnPressUp)&&i(t.allowsDifferentPressOrigin)&&s(e)},m=e=>{u()&&(i(t.shouldSelectOnPressUp)&&!i(t.allowsDifferentPressOrigin)||d!==`mouse`)&&s(e)},h=e=>{u()&&[`Enter`,` `].includes(e.key)&&(Ze(e)?r().toggleSelection(a()):s(e))},g=e=>{l()&&e.preventDefault()},_=e=>{let t=n();o()||l()||!t||e.target===t&&r().setFocusedKey(a())},v=e.W(()=>{if(!(o()||l()))return a()===r().focusedKey()?0:-1}),y=e.W(()=>i(t.virtualized)?void 0:a());return e.U(e.$([n,a,o,()=>r().focusedKey(),()=>r().isFocused()],([e,n,r,i,a])=>{e&&n===i&&a&&!r&&document.activeElement!==e&&(t.focus?t.focus():B(e))})),{isSelected:c,isDisabled:l,allowsSelection:u,tabIndex:v,dataKey:y,onPointerDown:f,onPointerUp:p,onClick:m,onKeyDown:h,onMouseDown:g,onFocus:_}}var st=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()===`none`)return!1;let t=this.getKey(e);return t!=null&&this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;let e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Ye(n,r,t);for(let e of this.getKeyRange(r,n.currentKey||t))i.delete(e);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&i.add(e);this.state.setSelectedKeys(i)}getKeyRange(e,t){let n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){let n=[],r=e;for(;r!=null;){let e=this.collection().getItem(r);if(e&&e.type===`item`&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){let t=this.collection().getItem(e);return t?!t||t.type!==`item`?null:t.key:e}toggleSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Ye(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Ye([t],t,t):new Ye;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()===`none`)return;let t=new Ye;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode()===`single`))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()===`multiple`&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){let e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Ye)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!==`none`&&(this.selectionMode()===`single`?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()===`toggle`||t&&t.pointerType===`touch`?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;let t=this.selectedKeys();if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()===`none`)return!1;let t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){let t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){let e=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){let n=this.collection().getItem(t);if(!n)continue;n.type===`item`&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},ct=class{keyMap=/* @__PURE__ */ new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(let t of e)this.keyMap.set(t.key,t);if(this.keyMap.size===0)return;let t,n=0;for(let[e,r]of this.keyMap)t?(t.nextKey=e,r.prevKey=t.key):(this.firstKey=e,r.prevKey=void 0),r.type===`item`&&(r.index=n++),t=r,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}};function lt(t){let n=tt(t),r=je({dataSource:()=>i(t.dataSource),getKey:()=>i(t.getKey),getTextValue:()=>i(t.getTextValue),getDisabled:()=>i(t.getDisabled),getSectionChildren:()=>i(t.getSectionChildren),factory:e=>t.filter?new ct(t.filter(e)):new ct(e)},[()=>t.filter]),a=new st(r,n);return e.V(()=>{let e=n.focusedKey();e!=null&&!r().getItem(e)&&n.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>a}}var ut=e.H();function dt(){return e.it(ut)}function ft(){let e=dt();if(e===void 0)throw Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function pt(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function mt(e,t){let n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){let t=e[r]?.ref();if(t&&pt(t,n))return r+1}return 0}function ht(e){let t=e.map((e,t)=>[t,e]),n=!1;return t.sort(([e,t],[r,i])=>{let a=t.ref(),o=i.ref();return a===o||!a||!o?0:pt(a,o)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1)}),n?t.map(([e,t])=>t):e}function gt(e,t){let n=ht(e);e!==n&&t(n)}function _t(e){let t=e[0],n=e[e.length-1]?.ref(),r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return j(r).body}function vt(t,n){e.U(()=>{let r=setTimeout(()=>{gt(t(),n)});e.et(()=>clearTimeout(r))})}function yt(t,n){if(typeof IntersectionObserver!=`function`){vt(t,n);return}let r=[];e.U(()=>{let i=()=>{let e=!!r.length;r=t(),e&>(t(),n)},a=_t(t()),o=new IntersectionObserver(i,{root:a});for(let e of t()){let t=e.ref();t&&o.observe(t)}e.et(()=>o.disconnect())})}function bt(t={}){let[n,r]=Je({value:()=>i(t.items),onChange:e=>t.onItemsChange?.(e)});yt(n,r);let a=e=>(r(t=>S(t,e,mt(t,e))),()=>{r(t=>{let n=t.filter(t=>t.ref()!==e.ref());return t.length===n.length?t:n})});return{DomCollectionProvider:t=>e.B(ut.Provider,{value:{registerItem:a},get children(){return t.children}})}}function xt(t){let n=ft(),r=H({shouldRegisterItem:!0},t);e.U(()=>{if(!r.shouldRegisterItem)return;let t=n.registerItem(r.getItem());e.et(t)})}function U(t){let[n,r]=e.nt(t,[`as`]);if(!n.as)throw Error("[kobalte]: Polymorphic is missing the required `as` prop.");return e.B(e.v,e.Q(r,{get component(){return n.as}}))}var St=Object.defineProperty,Ct=(e,t)=>{for(var n in t)St(e,n,{get:t[n],enumerable:!0})},W=e=>typeof e==`function`?e():e,wt=t=>{let n=e.W(()=>{let e=W(t.element);if(e)return getComputedStyle(e)}),r=()=>n()?.animationName??`none`,[i,a]=e.q(W(t.show)?`present`:`hidden`),o=e=>{a(e),t.onStateChange?.(e)},s=`none`;return e.U(i=>{let a=W(t.show);return e.rt(()=>{if(i===a)return a;let e=s,t=r();a?o(`present`):t===`none`||n()?.display===`none`?o(`hidden`):o(i===!0&&e!==t?`hiding`:`hidden`)}),a},W(t.show)),e.U(()=>{let n=W(t.element);if(!n)return;let a=e=>{e.target===n&&(s=r())},c=e=>{let t=r().includes(e.animationName);e.target===n&&t&&i()===`hiding`&&o(`hidden`)};n.addEventListener(`animationstart`,a),n.addEventListener(`animationcancel`,c),n.addEventListener(`animationend`,c),e.et(()=>{n.removeEventListener(`animationstart`,a),n.removeEventListener(`animationcancel`,c),n.removeEventListener(`animationend`,c)})}),{present:()=>i()===`present`||i()===`hiding`,state:i}};function Tt(t,n){let r=new ResizeObserver(t);return e.et(r.disconnect.bind(r)),{observe:e=>r.observe(e,n),unobserve:r.unobserve.bind(r)}}function Et(t,r,o){let s=/* @__PURE__ */ new WeakMap,{observe:l,unobserve:u}=Tt(e=>{for(let t of e){let{contentRect:e,target:n}=t,i=Math.round(e.width),a=Math.round(e.height),o=s.get(n);o&&o.width===i&&o.height===a||(r(e,n,t),s.set(n,{width:i,height:a}))}},o);e.U(e=>{let r=n(a(i(t)));return c(r,e,l,u),r},[])}var Dt=`data-kb-top-layer`,Ot,kt=!1,At=[];function jt(e){return At.findIndex(t=>t.node===e)}function Mt(e){return At[jt(e)]}function Nt(e){return At.length>0&&At[At.length-1].node===e}function Pt(){return At.filter(e=>e.isPointerBlocking)}function Ft(){return[...Pt()].slice(-1)[0]}function It(){return Pt().length>0}function Lt(e){let t=jt(Ft()?.node);return jt(e)<t}function Rt(e){At.push(e)}function zt(e){let t=jt(e);t<0||At.splice(t,1)}function Bt(){for(let{node:e}of At)e.style.pointerEvents=Lt(e)?`none`:`auto`}function Vt(e){if(It()&&!kt){let t=j(e);Ot=document.body.style.pointerEvents,t.body.style.pointerEvents=`none`,kt=!0}}function Ht(e){if(It())return;let t=j(e);t.body.style.pointerEvents=Ot,t.body.style.length===0&&t.body.removeAttribute(`style`),kt=!1}var G={layers:At,isTopMostLayer:Nt,hasPointerBlockingLayer:It,isBelowPointerBlockingLayer:Lt,addLayer:Rt,removeLayer:zt,indexOf:jt,find:Mt,assignPointerEventToLayers:Bt,disableBodyPointerEvents:Vt,restoreBodyPointerEvents:Ht};function Ut(t,n){let[r,i]=e.q(Wt(n?.()));return e.U(()=>{i(t()?.tagName.toLowerCase()||Wt(n?.()))}),r}function Wt(e){return T(e)?e:void 0}Ct({},{Button:()=>Jt,Root:()=>qt});var Gt=[`button`,`color`,`file`,`image`,`reset`,`submit`];function Kt(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?Gt.indexOf(e.type)!==-1:!1}function qt(t){let n,r=H({type:`button`},t),[i,a]=e.nt(r,[`ref`,`type`,`disabled`]),o=Ut(()=>n,()=>`button`),s=e.W(()=>{let e=o();return e!=null&&Kt({tagName:e,type:i.type})}),c=e.W(()=>o()===`input`),l=e.W(()=>o()===`a`&&n?.getAttribute(`href`)!=null);return e.B(U,e.Q({as:`button`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)},get type(){return s()||c()?i.type:void 0},get role(){return!s()&&!l()?`button`:void 0},get tabIndex(){return!s()&&!l()&&!i.disabled?0:void 0},get disabled(){return s()||c()?i.disabled:void 0},get"aria-disabled"(){return!s()&&!c()&&i.disabled?!0:void 0},get"data-disabled"(){return i.disabled?``:void 0}},a))}var Jt=qt;function Yt(e){return t=>(e(t),()=>e(void 0))}const Xt=Symbol(`store-raw`),Zt=Symbol(`store-node`),Qt=Symbol(`store-has`),$t=Symbol(`store-self`);function en(t){let n=t[e.M];if(!n&&(Object.defineProperty(t,e.M,{value:n=new Proxy(t,ln)}),!Array.isArray(t))){let e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),i=Object.getPrototypeOf(t),a=i!==null&&typeof t==`object`&&!!t&&!Array.isArray(t)&&i!==Object.prototype;if(a){let t=Object.getOwnPropertyDescriptors(i);e.push(...Object.keys(t)),Object.assign(r,t)}for(let i=0,o=e.length;i<o;i++){let o=e[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(t,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(n)})}}return n}function tn(t){let n;return typeof t==`object`&&!!t&&(t[e.M]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function nn(e,t=/* @__PURE__ */ new Set){let n,r,i,a;if(n=e!=null&&e[Xt])return n;if(!tn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=nn(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=nn(i,t))!==i&&(e[a]=r))}return e}function rn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function an(t,n,r){if(t[n])return t[n];let[i,a]=e.q(r,{equals:!1,internal:!0});return i.$=a,t[n]=i}function on(t,n){let r=Reflect.getOwnPropertyDescriptor(t,n);return!r||r.get||!r.configurable||n===e.M||n===Zt||(delete r.value,delete r.writable,r.get=()=>t[e.M][n]),r}function sn(t){e.Y()&&an(rn(t,Zt),$t)()}function cn(e){return sn(e),Reflect.ownKeys(e)}const ln={get(t,n,r){if(n===Xt)return t;if(n===e.M)return r;if(n===e.N)return sn(t),r;let i=rn(t,Zt),a=i[n],o=a?a():t[n];if(n===Zt||n===Qt||n===`__proto__`)return o;if(!a){let r=Object.getOwnPropertyDescriptor(t,n);e.Y()&&(typeof o!=`function`||Object.prototype.hasOwnProperty.call(t,n))&&!(r&&r.get)&&(o=an(i,n,o)())}return tn(o)?en(o):o},has(t,n){return n===Xt||n===e.M||n===e.N||n===Zt||n===Qt||n===`__proto__`||(e.Y()&&an(rn(t,Qt),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:cn,getOwnPropertyDescriptor:on};function un(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[Qt]&&e[Qt][t]&&i!==void 0&&e[Qt][t].$()):(e[t]=n,e[Qt]&&e[Qt][t]&&i===void 0&&e[Qt][t].$());let o=rn(e,Zt),s;if((s=an(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=an(o,`length`,a))&&s.$(e.length)}(s=o[$t])&&s.$()}function dn(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];fn(i)||un(e,i,t[i])}}function fn(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function pn(e,t){if(typeof t==`function`&&(t=t(e)),t=nn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&un(e,n,r)}un(e,`length`,r)}else dn(e,t)}function mn(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&fn(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)mn(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&mn(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)mn(e,[r].concat(t),n);return}if(t.length>1){mn(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=nn(a),r===void 0||tn(i)&&tn(a)&&!Array.isArray(a)?dn(i,a):un(e,r,a))}function hn(...[t,n]){let r=nn(t||{}),i=Array.isArray(r),a=en(r);function o(...t){e.z(()=>{i&&t.length===1?pn(r,t[0]):mn(r,t)})}return[a,o]}const gn=Symbol(`store-root`);function _n(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function vn(e,t,n,r,i){if(_n(n))return;let a=t[n];if(e===a)return;let o=Array.isArray(e);if(n!==gn&&(!tn(e)||!tn(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){un(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let t,n,o,s,c,l,u,d;for(o=0,s=Math.min(a.length,e.length);o<s&&(a[o]===e[o]||i&&a[o]&&e[o]&&a[o][i]&&a[o][i]===e[o][i]);o++)vn(e[o],a,o,r,i);let f=Array(e.length),p=/* @__PURE__ */ new Map;for(s=a.length-1,c=e.length-1;s>=o&&c>=o&&(a[s]===e[c]||i&&a[s]&&e[c]&&a[s][i]&&a[s][i]===e[c][i]);s--,c--)f[c]=a[s];if(o>c||o>s){for(n=o;n<=c;n++)un(a,n,e[n]);for(;n<e.length;n++)un(a,n,f[n]),vn(e[n],a,n,r,i);a.length>e.length&&un(a,`length`,e.length);return}for(u=Array(c+1),n=c;n>=o;n--)l=e[n],d=i&&l?l[i]:l,t=p.get(d),u[n]=t===void 0?-1:t,p.set(d,n);for(t=o;t<=s;t++)l=a[t],d=i&&l?l[i]:l,n=p.get(d),n!==void 0&&n!==-1&&(f[n]=a[t],n=u[n],p.set(d,n));for(n=o;n<e.length;n++)n in f?(un(a,n,f[n]),vn(e[n],a,n,r,i)):un(a,n,e[n])}else for(let t=0,n=e.length;t<n;t++)vn(e[t],a,t,r,i);a.length>e.length&&un(a,`length`,e.length);return}let s=Object.keys(e);for(let t=0,n=s.length;t<n;t++)_n(s[t])||vn(e[s[t]],a,s[t],r,i);let c=Object.keys(a);for(let t=0,n=c.length;t<n;t++)e[c[t]]===void 0&&un(a,c[t],void 0)}function yn(e,t={}){let{merge:n,key:r=`id`}=t,i=nn(e);return e=>{if(!tn(e)||!tn(i))return i;let t=vn(i,{[gn]:e},gn,n,r);return t===void 0?e:t}}function bn(e={}){let[t,n]=qe({value:()=>i(e.isSelected),defaultValue:()=>!!i(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{!i(e.isReadOnly)&&!i(e.isDisabled)&&n(t)},toggle:()=>{!i(e.isReadOnly)&&!i(e.isDisabled)&&n(!t())}}}const xn=[`top`,`right`,`bottom`,`left`],Sn=Math.min,Cn=Math.max,wn=Math.round,Tn=Math.floor,En=e=>({x:e,y:e}),Dn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function On(e,t,n){return Cn(e,Sn(t,n))}function kn(e,t){return typeof e==`function`?e(t):e}function An(e){return e.split(`-`)[0]}function jn(e){return e.split(`-`)[1]}function Mn(e){return e===`x`?`y`:`x`}function Nn(e){return e===`y`?`height`:`width`}function Pn(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fn(e){return Mn(Pn(e))}function In(e,t,n){n===void 0&&(n=!1);let r=jn(e),i=Fn(e),a=Nn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Gn(o)),[o,Gn(o)]}function Ln(e){let t=Gn(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}const zn=[`left`,`right`],Bn=[`right`,`left`],Vn=[`top`,`bottom`],Hn=[`bottom`,`top`];function Un(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Bn:zn:t?zn:Bn;case`left`:case`right`:return t?Vn:Hn;default:return[]}}function Wn(e,t,n,r){let i=jn(e),a=Un(An(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Rn)))),a}function Gn(e){let t=An(e);return Dn[t]+e.slice(t.length)}function Kn(e){return{top:0,right:0,bottom:0,left:0,...e}}function qn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Kn(e)}function Jn(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 Yn(e,t,n){let{reference:r,floating:i}=e,a=Pn(t),o=Fn(t),s=Nn(o),c=An(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}}switch(jn(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Xn(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}=kn(t,e),p=qn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Jn(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=Jn(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}}const Zn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Yn(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<50&&(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}=Yn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qn=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}=kn(e,t)||{};if(l==null)return{};let d=qn(u),f={x:n,y:r},p=Fn(i),m=Nn(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Sn(d[_],T),D=Sn(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=On(O,A,k),M=!c.arrow&&jn(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),$n=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}=kn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=An(r),_=Pn(o),v=An(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Gn(o)]:Ln(o)),x=p!==`none`;!d&&x&&b.push(...Wn(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=In(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`||_===Pn(t)||T.every(e=>Pn(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=Pn(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function er(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tr(e){return xn.some(t=>e[t]>=0)}const nr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=kn(e,t);switch(i){case`referenceHidden`:{let e=er(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tr(e)}}}case`escaped`:{let e=er(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tr(e)}}}default:return{}}}}},rr=/*#__PURE__*/ new Set([`left`,`top`]);async function ir(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=An(n),s=jn(n),c=Pn(n)===`y`,l=rr.has(o)?-1:1,u=a&&c?-1:1,d=kn(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}}const ar=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 ir(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}}}}},or=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}=kn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Pn(An(i)),p=Mn(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=On(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=On(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=kn(e,t),u=await o.detectOverflow(t,l),d=An(i),f=jn(i),p=Pn(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Sn(h-u[g],v),x=Sn(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Cn(u.left,0),t=Cn(u.right,0),n=Cn(u.top,0),r=Cn(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Cn(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Cn(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<`u`}function lr(e){return fr(e)?(e.nodeName||``).toLowerCase():`#document`}function ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){return((fr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fr(e){return cr()?e instanceof Node||e instanceof ur(e).Node:!1}function pr(e){return cr()?e instanceof Element||e instanceof ur(e).Element:!1}function mr(e){return cr()?e instanceof HTMLElement||e instanceof ur(e).HTMLElement:!1}function hr(e){return!cr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot}function gr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _r(e){return/^(table|td|th)$/.test(lr(e))}function vr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}const yr=/transform|translate|scale|rotate|perspective|filter/,br=/paint|layout|strict|content/,xr=e=>!!e&&e!==`none`;let Sr;function Cr(e){let t=pr(e)?Dr(e):e;return xr(t.transform)||xr(t.translate)||xr(t.scale)||xr(t.rotate)||xr(t.perspective)||!Tr()&&(xr(t.backdropFilter)||xr(t.filter))||yr.test(t.willChange||``)||br.test(t.contain||``)}function wr(e){let t=kr(e);for(;mr(t)&&!Er(t);){if(Cr(t))return t;if(vr(t))return null;t=kr(t)}return null}function Tr(){return Sr??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sr}function Er(e){return/^(html|body|#document)$/.test(lr(e))}function Dr(e){return ur(e).getComputedStyle(e)}function Or(e){return pr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kr(e){if(lr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hr(e)&&e.host||dr(e);return hr(t)?t.host:t}function Ar(e){let t=kr(e);return Er(t)?e.ownerDocument?e.ownerDocument.body:e.body:mr(t)&&gr(t)?t:Ar(t)}function jr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ar(e),i=r===e.ownerDocument?.body,a=ur(r);if(i){let e=Mr(a);return t.concat(a,a.visualViewport||[],gr(r)?r:[],e&&n?jr(e):[])}return t.concat(r,jr(r,[],n))}function Mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nr(e){let t=Dr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wn(n)!==a||wn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pr(e){return pr(e)?e:e.contextElement}function Fr(e){let t=Pr(e);if(!mr(t))return En(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nr(t),o=(a?wn(n.width):n.width)/r,s=(a?wn(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const Ir=/*#__PURE__*/ En(0);function Lr(e){let t=ur(e);return!Tr()||!t.visualViewport?Ir:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ur(e)?!1:t}function zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pr(e),o=En(1);t&&(r?pr(r)&&(o=Fr(r)):o=Fr(e));let s=Rr(a,n,r)?Lr(a):En(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){let e=ur(a),t=r&&pr(r)?ur(r):r,n=e,i=Mr(n);for(;i&&r&&t!==n;){let e=Fr(i),t=i.getBoundingClientRect(),r=Dr(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=ur(i),i=Mr(n)}}return Jn({width:u,height:d,x:c,y:l})}function Br(e,t){let n=Or(e).scrollLeft;return t?t.left+n:zr(dr(e)).left+n}function Vr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Br(e,n),y:n.top+t.scrollTop}}function Hr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=dr(r),s=t?vr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=En(1),u=En(0),d=mr(r);if((d||!d&&!a)&&((lr(r)!==`body`||gr(o))&&(c=Or(r)),d)){let e=zr(r);l=Fr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vr(o,c):En(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 Ur(e){return Array.from(e.getClientRects())}function Wr(e){let t=dr(e),n=Or(e),r=e.ownerDocument.body,i=Cn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Cn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Br(e),s=-n.scrollTop;return Dr(r).direction===`rtl`&&(o+=Cn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Gr(e,t){let n=ur(e),r=dr(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Tr();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Br(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function Kr(e,t){let n=zr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mr(e)?Fr(e):En(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function qr(e,t,n){let r;if(t===`viewport`)r=Gr(e,n);else if(t===`document`)r=Wr(dr(e));else if(pr(t))r=Kr(t,n);else{let n=Lr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jn(r)}function Jr(e,t){let n=kr(e);return n===t||!pr(n)||Er(n)?!1:Dr(n).position===`fixed`||Jr(n,t)}function Yr(e,t){let n=t.get(e);if(n)return n;let r=jr(e,[],!1).filter(e=>pr(e)&&lr(e)!==`body`),i=null,a=Dr(e).position===`fixed`,o=a?kr(e):e;for(;pr(o)&&!Er(o);){let t=Dr(o),n=Cr(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||gr(o)&&!n&&Jr(e,o))?r=r.filter(e=>e!==o):i=t,o=kr(o)}return t.set(e,r),r}function Xr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vr(t)?[]:Yr(t,this._c):[].concat(n),r],o=qr(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=qr(t,a[e],i);s=Cn(n.top,s),c=Sn(n.right,c),l=Sn(n.bottom,l),u=Cn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zr(e){let{width:t,height:n}=Nr(e);return{width:t,height:n}}function Qr(e,t,n){let r=mr(t),i=dr(t),a=n===`fixed`,o=zr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=En(0);function l(){c.x=Br(i)}if(r||!r&&!a){if((lr(t)!==`body`||gr(i))&&(s=Or(t)),r){let e=zr(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Vr(i,s):En(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function $r(e){return Dr(e).position===`static`}function ei(e,t){if(!mr(e)||Dr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return dr(e)===n&&(n=n.ownerDocument.body),n}function ti(e,t){let n=ur(e);if(vr(e))return n;if(!mr(e)){let t=kr(e);for(;t&&!Er(t);){if(pr(t)&&!$r(t))return t;t=kr(t)}return n}let r=ei(e,t);for(;r&&_r(r)&&$r(r);)r=ei(r,t);return r&&Er(r)&&$r(r)&&!Cr(r)?n:r||wr(e)||n}const ni=async function(e){let t=this.getOffsetParent||ti,n=this.getDimensions,r=await n(e.floating);return{reference:Qr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ri(e){return Dr(e).direction===`rtl`}const ii={convertOffsetParentRelativeRectToViewportRelativeRect:Hr,getDocumentElement:dr,getClippingRect:Xr,getOffsetParent:ti,getElementRects:ni,getClientRects:Ur,getDimensions:Zr,getScale:Fr,isElement:pr,isRTL:ri};function ai(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oi(e,t){let n=null,r,i=dr(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Tn(d),h=Tn(i.clientWidth-(u+f)),g=Tn(i.clientHeight-(d+p)),_=Tn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Cn(0,Sn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ai(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function si(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=Pr(e),u=i||a?[...l?jr(l):[],...t?jr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?oi(l,n):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?zr(e):null;c&&g();function g(){let t=zr(e);h&&!ai(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)}}const ci=ar,li=or,ui=$n,di=sr,fi=nr,pi=Qn,mi=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i={platform:ii,...n},a={...i.platform,_c:r};return Zn(e,t,{...i,platform:a})};var hi=e.H();function gi(){let t=e.it(hi);if(t===void 0)throw Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return t}var _i=/* @__PURE__ */ e.A(`<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">`),vi=30,yi=vi/2,bi={top:180,right:-90,bottom:0,left:90};function xi(t){let n=gi(),r=H({size:vi},t),[i,a]=e.nt(r,[`ref`,`style`,`size`]),o=()=>n.currentPlacement().split(`-`)[0],s=Si(n.contentRef),c=()=>s()?.getPropertyValue(`background-color`)||`none`,l=()=>s()?.getPropertyValue(`border-${o()}-color`)||`none`,u=()=>s()?.getPropertyValue(`border-${o()}-width`)||`0px`,d=()=>Number.parseInt(u())*2*(vi/i.size),f=()=>`rotate(${bi[o()]} ${yi} ${yi}) translate(0 2)`;return e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setArrowRef,i.ref);typeof t==`function`&&t(e)},"aria-hidden":`true`,get style(){return _({position:`absolute`,"font-size":`${i.size}px`,width:`1em`,height:`1em`,"pointer-events":`none`,fill:c(),stroke:l(),"stroke-width":d()},i.style)}},a,{get children(){let t=_i(),n=t.firstChild;return e.G(()=>e.D(n,`transform`,f())),t}}))}function Si(t){let[n,r]=e.q();return e.U(()=>{let e=t();e&&r(A(e).getComputedStyle(e))}),n}function Ci(t){let n=gi(),[r,i]=e.nt(t,[`ref`,`style`]);return e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setPositionerRef,r.ref);typeof t==`function`&&t(e)},"data-popper-positioner":``,get style(){return _({position:`absolute`,top:0,left:0,"min-width":`max-content`},r.style)}},i))}function wi(e){let{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect==`function`)return new DOMRect(t,n,r,i);let a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function Ti(e,t){return{contextElement:e,getBoundingClientRect:()=>{let n=t(e);return n?wi(n):e?e.getBoundingClientRect():wi()}}}function Ei(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Di={top:`bottom`,right:`left`,bottom:`top`,left:`right`};function Oi(e,t){let[n,r]=e.split(`-`),i=Di[n];return r?n===`left`||n===`right`?`${i} ${r===`start`?`top`:`bottom`}`:r===`start`?`${i} ${t===`rtl`?`right`:`left`}`:`${i} ${t===`rtl`?`left`:`right`}`:`${i} center`}function ki(t){let n=H({getAnchorRect:e=>e?.getBoundingClientRect(),placement:`bottom`,gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},t),[r,i]=e.q(),[a,o]=e.q(),[s,c]=e.q(n.placement),l=()=>Ti(n.anchorRef?.(),n.getAnchorRect),{direction:u}=Ue();async function d(){let e=l(),t=r(),i=a();if(!e||!t)return;let o=(i?.clientHeight||0)/2,s=typeof n.gutter==`number`?n.gutter+o:n.gutter??o;t.style.setProperty(`--kb-popper-content-overflow-padding`,`${n.overflowPadding}px`),e.getBoundingClientRect();let d=[ci(({placement:e})=>{let t=!!e.split(`-`)[1];return{mainAxis:s,crossAxis:t?void 0:n.shift,alignmentAxis:n.shift}})];if(n.flip!==!1){let e=typeof n.flip==`string`?n.flip.split(` `):void 0;if(e!==void 0&&!e.every(Ei))throw Error("`flip` expects a spaced-delimited list of placements");d.push(ui({padding:n.overflowPadding,fallbackPlacements:e}))}(n.slide||n.overlap)&&d.push(li({mainAxis:n.slide,crossAxis:n.overlap,padding:n.overflowPadding})),d.push(di({padding:n.overflowPadding,apply({availableWidth:e,availableHeight:r,rects:i}){let a=Math.round(i.reference.width);e=Math.floor(e),r=Math.floor(r),t.style.setProperty(`--kb-popper-anchor-width`,`${a}px`),t.style.setProperty(`--kb-popper-content-available-width`,`${e}px`),t.style.setProperty(`--kb-popper-content-available-height`,`${r}px`),n.sameWidth&&(t.style.width=`${a}px`),n.fitViewport&&(t.style.maxWidth=`${e}px`,t.style.maxHeight=`${r}px`)}})),n.hideWhenDetached&&d.push(fi({padding:n.detachedPadding})),i&&d.push(pi({element:i,padding:n.arrowPadding}));let f=await mi(e,t,{placement:n.placement,strategy:`absolute`,middleware:d,platform:{...ii,isRTL:()=>u()===`rtl`}});if(c(f.placement),n.onCurrentPlacementChange?.(f.placement),!t)return;t.style.setProperty(`--kb-popper-content-transform-origin`,Oi(f.placement,u()));let p=Math.round(f.x),m=Math.round(f.y),h;if(n.hideWhenDetached&&(h=f.middlewareData.hide?.referenceHidden?`hidden`:`visible`),Object.assign(t.style,{top:`0`,left:`0`,transform:`translate3d(${p}px, ${m}px, 0)`,visibility:h}),i&&f.middlewareData.arrow){let{x:e,y:t}=f.middlewareData.arrow,n=f.placement.split(`-`)[0];Object.assign(i.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`100%`})}}e.U(()=>{let t=l(),n=r();if(!t||!n)return;let i=si(t,n,d,{elementResize:typeof ResizeObserver==`function`});e.et(i)}),e.U(()=>{let e=r(),t=n.contentRef?.();e&&t&&queueMicrotask(()=>{e.style.zIndex=getComputedStyle(t).zIndex})});let f={currentPlacement:s,contentRef:()=>n.contentRef?.(),setPositionerRef:i,setArrowRef:o};return e.B(hi.Provider,{value:f,get children(){return n.children}})}var Ai=Object.assign(ki,{Arrow:xi,Context:hi,usePopperContext:gi,Positioner:Ci});function ji(t){let n=e=>{e.key===N.Escape&&t.onEscapeKeyDown?.(e)};e.U(()=>{if(i(t.isDisabled))return;let r=t.ownerDocument?.()??j();r.addEventListener(`keydown`,n),e.et(()=>{r.removeEventListener(`keydown`,n)})})}function Mi(e){let t=(typeof e.composedPath==`function`?e.composedPath():void 0)?.[0]??e.target;return t instanceof Element?t:null}function Ni(e,t){if(!e)return!1;let n=t;for(;n;){if(O(e,n))return!0;let t=n.getRootNode();n=t instanceof ShadowRoot?t.host:null}return!1}function Pi(e,t){let n=e;for(;n;){let e=n.closest(t);if(e)return e;let r=n.getRootNode();n=r instanceof ShadowRoot?r.host:null}return null}var Fi=`interactOutside.pointerDownOutside`,Ii=`interactOutside.focusOutside`;function Li(t,n){let r,a=xe,o=()=>j(n()),s=e=>t.onPointerDownOutside?.(e),c=e=>t.onFocusOutside?.(e),l=e=>t.onInteractOutside?.(e),u=e=>{let r=Mi(e);return!r||Pi(r,`[data-kb-top-layer]`)||!Ni(o(),r)||Ni(n(),r)?!1:!t.shouldExcludeElement?.(r)},d=e=>{function t(){let t=n(),r=Mi(e);if(!t||!r||!u(e))return;let i=z([s,l]);r.addEventListener(Fi,i,{once:!0});let a=new CustomEvent(Fi,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:e.button===2||ne(e)&&e.button===0}});r.dispatchEvent(a)}e.pointerType===`touch`?(o().removeEventListener(`click`,t),a=t,o().addEventListener(`click`,t,{once:!0})):t()},f=e=>{let t=n(),r=Mi(e);if(!t||!r||!u(e))return;let i=z([c,l]);r.addEventListener(Ii,i,{once:!0});let a=new CustomEvent(Ii,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(a)};e.U(()=>{i(t.isDisabled)||(r=window.setTimeout(()=>{o().addEventListener(`pointerdown`,d,!0)},0),o().addEventListener(`focusin`,f,!0),e.et(()=>{window.clearTimeout(r),o().removeEventListener(`click`,a),o().removeEventListener(`pointerdown`,d,!0),o().removeEventListener(`focusin`,f,!0)}))})}var Ri=e.H();function zi(){return e.it(Ri)}function Bi(t){let n,r=zi(),[i,a]=e.nt(t,[`ref`,`disableOutsidePointerEvents`,`excludedElements`,`onEscapeKeyDown`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onDismiss`,`bypassTopMostLayerCheck`]),o=/* @__PURE__ */ new Set([]),s=e=>{o.add(e);let t=r?.registerNestedLayer(e);return()=>{o.delete(e),t?.()}};Li({shouldExcludeElement:e=>n?i.excludedElements?.some(t=>O(t(),e))||[...o].some(t=>O(t,e)):!1,onPointerDownOutside:e=>{n&&!G.isBelowPointerBlockingLayer(n)&&(i.bypassTopMostLayerCheck||G.isTopMostLayer(n))&&(i.onPointerDownOutside?.(e),i.onInteractOutside?.(e),e.defaultPrevented||i.onDismiss?.())},onFocusOutside:e=>{i.onFocusOutside?.(e),i.onInteractOutside?.(e),e.defaultPrevented||i.onDismiss?.()}},()=>n),ji({ownerDocument:()=>j(n),onEscapeKeyDown:e=>{n&&G.isTopMostLayer(n)&&(i.onEscapeKeyDown?.(e),!e.defaultPrevented&&i.onDismiss&&(e.preventDefault(),i.onDismiss()))}}),e.tt(()=>{if(!n)return;G.addLayer({node:n,isPointerBlocking:i.disableOutsidePointerEvents,dismiss:i.onDismiss});let t=r?.registerNestedLayer(n);G.assignPointerEventToLayers(),G.disableBodyPointerEvents(n),e.et(()=>{n&&(G.removeLayer(n),t?.(),G.assignPointerEventToLayers(),G.restoreBodyPointerEvents(n))})}),e.U(e.$([()=>n,()=>i.disableOutsidePointerEvents],([t,n])=>{if(!t)return;let r=G.find(t);r&&r.isPointerBlocking!==n&&(r.isPointerBlocking=n,G.assignPointerEventToLayers()),n&&G.disableBodyPointerEvents(t),e.et(()=>{G.restoreBodyPointerEvents(t)})},{defer:!0}));let c={registerNestedLayer:s};return e.B(Ri.Provider,{value:c,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)}},a))}})}function Vi(e={}){let[t,n]=qe({value:()=>i(e.open),defaultValue:()=>!!i(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},a=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:a,toggle:()=>{t()?a():r()}}}var Hi=[`id`,`name`,`validationState`,`required`,`disabled`,`readOnly`];function Ui(t){let n=H({id:`form-control-${e.J()}`},t),[r,a]=e.q(),[o,s]=e.q(),[c,l]=e.q(),[u,d]=e.q();return{formControlContext:{name:()=>i(n.name)??i(n.id),dataset:e.W(()=>({"data-valid":i(n.validationState)===`valid`?``:void 0,"data-invalid":i(n.validationState)===`invalid`?``:void 0,"data-required":i(n.required)?``:void 0,"data-disabled":i(n.disabled)?``:void 0,"data-readonly":i(n.readOnly)?``:void 0})),validationState:()=>i(n.validationState),isRequired:()=>i(n.required),isDisabled:()=>i(n.disabled),isReadOnly:()=>i(n.readOnly),labelId:r,fieldId:o,descriptionId:c,errorMessageId:u,getAriaLabelledBy:(e,t,n)=>{let i=n!=null||r()!=null;return[n,r(),i&&t!=null?e:void 0].filter(Boolean).join(` `)||void 0},getAriaDescribedBy:e=>[c(),u(),e].filter(Boolean).join(` `)||void 0,generateId:D(()=>i(n.id)),registerLabel:Yt(a),registerField:Yt(s),registerDescription:Yt(l),registerErrorMessage:Yt(d)}}}var Wi=e.H();function Gi(){let t=e.it(Wi);if(t===void 0)throw Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return t}function Ki(t){let n=Gi(),r=H({id:n.generateId(`description`)},t);return e.U(()=>e.et(n.registerDescription(r.id))),e.B(U,e.Q({as:`div`},()=>n.dataset(),r))}var qi=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight),i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i==null?null:this.getItem(i);return i}getKeyPageBelow(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight),i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i==null?null:this.getItem(i);return i}getKeyForSearch(e,t){let n=this.collator?.();if(!n)return;let r=t==null?this.getFirstKey():this.getKeyBelow(t);for(;r!=null;){let t=this.collection().getItem(r);if(t){let i=t.textValue.slice(0,e.length);if(t.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function Ji(t,n,r){let a=Ge({usage:`search`,sensitivity:`base`});return at({selectionManager:()=>i(t.selectionManager),keyboardDelegate:e.W(()=>i(t.keyboardDelegate)||new qi(t.collection,n,a)),autoFocus:()=>i(t.autoFocus),deferAutoFocus:()=>i(t.deferAutoFocus),shouldFocusWrap:()=>i(t.shouldFocusWrap),disallowEmptySelection:()=>i(t.disallowEmptySelection),selectOnFocus:()=>i(t.selectOnFocus),disallowTypeAhead:()=>i(t.disallowTypeAhead),shouldUseVirtualFocus:()=>i(t.shouldUseVirtualFocus),allowsTabNavigation:()=>i(t.allowsTabNavigation),isVirtualized:()=>i(t.isVirtualized),scrollToKey:e=>i(t.scrollToKey)?.(e),orientation:()=>i(t.orientation)},n,r)}var Yi=`focusScope.autoFocusOnMount`,Xi=`focusScope.autoFocusOnUnmount`,Zi={bubbles:!1,cancelable:!0},Qi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=C(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=C(this.stack,e),this.active()?.resume()}};function $i(t,n){let[r,a]=e.q(!1),o={pause(){a(!0)},resume(){a(!1)}},s=null,c=e=>t.onMountAutoFocus?.(e),l=e=>t.onUnmountAutoFocus?.(e),u=()=>j(n()),d=()=>{let e=u().createElement(`span`);return e.setAttribute(`data-focus-trap`,``),e.tabIndex=0,Object.assign(e.style,ke),e},f=()=>{let e=n();return e?ue(e,!0).filter(e=>!e.hasAttribute(`data-focus-trap`)):[]},p=()=>{let e=f();return e.length>0?e[0]:null},m=()=>{let e=f();return e.length>0?e[e.length-1]:null},h=()=>{let e=n();if(!e)return!1;let t=k(e);return!t||O(e,t)?!1:fe(t)};e.U(()=>{let t=n();if(!t)return;Qi.add(o);let r=k(t);if(!O(t,r)){let e=new CustomEvent(Yi,Zi);t.addEventListener(Yi,c),t.dispatchEvent(e),e.defaultPrevented||setTimeout(()=>{B(p()),k(t)===r&&B(t)},0)}e.et(()=>{t.removeEventListener(Yi,c),setTimeout(()=>{let e=new CustomEvent(Xi,Zi);h()&&e.preventDefault(),t.addEventListener(Xi,l),t.dispatchEvent(e),e.defaultPrevented||B(r??u().body),t.removeEventListener(Xi,l),Qi.remove(o)},0)})}),e.U(()=>{let a=n();if(!a||!i(t.trapFocus)||r())return;let o=e=>{let t=e.target;t?.closest(`[data-kb-top-layer]`)||(O(a,t)?s=t:B(s))},c=e=>{let t=e.relatedTarget??k(a);t?.closest(`[data-kb-top-layer]`)||O(a,t)||B(s)};u().addEventListener(`focusin`,o),u().addEventListener(`focusout`,c),e.et(()=>{u().removeEventListener(`focusin`,o),u().removeEventListener(`focusout`,c)})}),e.U(()=>{let a=n();if(!a||!i(t.trapFocus)||r())return;let o=d();a.insertAdjacentElement(`afterbegin`,o);let s=d();a.insertAdjacentElement(`beforeend`,s);function c(e){let t=p(),n=m();e.relatedTarget===t?B(n):B(t)}o.addEventListener(`focusin`,c),s.addEventListener(`focusin`,c);let l=new MutationObserver(e=>{for(let t of e)t.previousSibling===s&&(s.remove(),a.insertAdjacentElement(`beforeend`,s)),t.nextSibling===o&&(o.remove(),a.insertAdjacentElement(`afterbegin`,o))});l.observe(a,{childList:!0,subtree:!1}),e.et(()=>{o.removeEventListener(`focusin`,c),s.removeEventListener(`focusin`,c),o.remove(),s.remove(),l.disconnect()})})}var ea=`data-live-announcer`;function ta(t){e.U(()=>{i(t.isDisabled)||e.et(ia(i(t.targets),i(t.root)))})}var na=/* @__PURE__ */ new WeakMap,ra=[];function ia(e,t=document.body){let n=new Set(e),r=/* @__PURE__ */ new Set,i=e=>{for(let t of e.querySelectorAll(`[${ea}], [${Dt}]`))n.add(t);let t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),o=t(e);if(o===NodeFilter.FILTER_ACCEPT&&a(e),o!==NodeFilter.FILTER_REJECT){let e=i.nextNode();for(;e!=null;)a(e),e=i.nextNode()}},a=e=>{let t=na.get(e)??0;(e.getAttribute(`aria-hidden`)!==`true`||t!==0)&&(t===0&&setTimeout(()=>requestAnimationFrame(()=>e.setAttribute(`aria-hidden`,`true`))),r.add(e),na.set(e,t+1))};ra.length&&ra[ra.length-1].disconnect(),i(t);let o=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`&&t.addedNodes.length!==0&&![...n,...r].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&(e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer===`true`)?n.add(e):e instanceof Element&&i(e)}});o.observe(t,{childList:!0,subtree:!0});let s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return ra.push(s),()=>{o.disconnect();for(let e of r){let t=na.get(e);if(t==null)return;t===1?setTimeout(()=>requestAnimationFrame(()=>{let t=na.get(e);t===1?(e.removeAttribute(`aria-hidden`),na.delete(e)):t!=null&&t>1&&na.set(e,t-1)})):na.set(e,t-1)}s===ra[ra.length-1]?(ra.pop(),ra.length&&ra[ra.length-1].observe()):ra.splice(ra.indexOf(s),1)}}function aa(t){let n,r=Gi(),i=H({id:r.generateId(`label`)},t),[a,o]=e.nt(i,[`ref`]),s=Ut(()=>n,()=>`label`);return e.U(()=>e.et(r.registerLabel(o.id))),e.B(U,e.Q({as:`label`,ref(e){let t=v(e=>n=e,a.ref);typeof t==`function`&&t(e)},get for(){return e.T(()=>s()===`label`)()?r.fieldId():void 0}},()=>r.dataset(),o))}function oa(t,n){e.U(e.$(t,t=>{if(t==null)return;let r=sa(t);r!=null&&(r.addEventListener(`reset`,n,{passive:!0}),e.et(()=>{r.removeEventListener(`reset`,n)}))}))}function sa(e){return ca(e)?e.form:e.closest(`form`)}function ca(e){return e.matches(`textarea, input, select, button`)}function la(t){let n=Gi(),r=H({id:n.generateId(`error-message`)},t),[i,a]=e.nt(r,[`forceMount`]),o=()=>n.validationState()===`invalid`;return e.U(()=>{o()&&e.et(n.registerErrorMessage(a.id))}),e.B(e.L,{get when(){return i.forceMount||o()},get children(){return e.B(U,e.Q({as:`div`},()=>n.dataset(),a))}})}var ua=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},da=/* @__PURE__ */ new Map,fa=t=>{e.U(()=>{let n=W(t.style)??{},r=W(t.properties)??[],i={};for(let e in n)i[e]=t.element.style[e];let a=da.get(t.key);a?a.activeCount++:da.set(t.key,{activeCount:1,originalStyles:i,properties:r.map(e=>e.key)}),Object.assign(t.element.style,t.style);for(let e of r)t.element.style.setProperty(e.key,e.value);e.et(()=>{let e=da.get(t.key);if(e){if(e.activeCount!==1)e.activeCount--;else{da.delete(t.key);for(let[n,r]of Object.entries(e.originalStyles))t.element.style[n]=r;for(let n of e.properties)t.element.style.removeProperty(n);t.element.style.length===0&&t.element.removeAttribute(`style`),t.cleanup?.()}}})})},pa=(e,t)=>{switch(t){case`x`:return[e.clientWidth,e.scrollLeft,e.scrollWidth];case`y`:return[e.clientHeight,e.scrollTop,e.scrollHeight]}},ma=(e,t)=>{let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return r===`auto`||r===`scroll`||e.tagName===`HTML`&&r===`visible`},ha=(e,t,n)=>{let r=t===`x`&&window.getComputedStyle(e).direction===`rtl`?-1:1,i=e,a=0,o=0,s=!1;do{let[e,c,l]=pa(i,t),u=l-e-r*c;(c!==0||u!==0)&&ma(i,t)&&(a+=u,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[ga,_a]=e.q([]),va=e=>ga().indexOf(e)===ga().length-1,ya=t=>{let n=e.Q({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:`padding`,restoreScrollPosition:!0,allowPinchZoom:!1},t),r=e.J(),i=[0,0],a=null,o=null;e.U(()=>{W(n.enabled)&&(_a(e=>[...e,r]),e.et(()=>{_a(e=>e.filter(e=>e!==r))}))}),e.U(()=>{if(!W(n.enabled)||!W(n.hideScrollbar))return;let{documentElement:e}=document,t=window.innerWidth-e.clientWidth;if(W(n.preventScrollbarShift)){let r={overflow:`hidden`},i=[];t>0&&(W(n.preventScrollbarShiftMode)===`padding`?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${t}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${t}px)`,i.push({key:`--scrollbar-width`,value:`${t}px`}));let a=window.scrollY,o=window.scrollX;fa({key:`prevent-scroll`,element:e,style:r,properties:i,cleanup:()=>{W(n.restoreScrollPosition)&&t>0&&window.scrollTo(o,a)}})}else fa({key:`prevent-scroll`,element:e,style:{overflow:`hidden`}})}),e.U(()=>{va(r)&&W(n.enabled)&&(document.addEventListener(`wheel`,c,{passive:!1}),document.addEventListener(`touchstart`,s,{passive:!1}),document.addEventListener(`touchmove`,l,{passive:!1}),e.et(()=>{document.removeEventListener(`wheel`,c),document.removeEventListener(`touchstart`,s),document.removeEventListener(`touchmove`,l)}))});let s=e=>{i=xa(e),a=null,o=null},c=e=>{let t=e.target,r=W(n.element),i=ba(e),a=Math.abs(i[0])>Math.abs(i[1])?`x`:`y`,o=Sa(t,a,a===`x`?i[0]:i[1],r),s;s=r&&ua(r,t)?!o:!0,s&&e.cancelable&&e.preventDefault()},l=e=>{let t=W(n.element),r=e.target,s;if(e.touches.length===2)s=!W(n.allowPinchZoom);else{if(a==null||o===null){let t=xa(e).map((e,t)=>i[t]-e),n=Math.abs(t[0])>Math.abs(t[1])?`x`:`y`;a=n,o=n===`x`?t[0]:t[1]}if(r.type===`range`)s=!1;else{let e=Sa(r,a,o,t);s=t&&ua(t,r)?!e:!0}}s&&e.cancelable&&e.preventDefault()}},ba=e=>[e.deltaX,e.deltaY],xa=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Sa=(e,t,n,r)=>{let[i,a]=ha(e,t,r!==null&&ua(r,e)?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(a)<1)},Ca=ya,wa={};Ct(wa,{Description:()=>Ki,ErrorMessage:()=>la,Item:()=>ka,ItemControl:()=>Aa,ItemDescription:()=>ja,ItemIndicator:()=>Ma,ItemInput:()=>Na,ItemLabel:()=>Pa,Label:()=>Fa,RadioGroup:()=>La,Root:()=>Ia,useRadioGroupContext:()=>Ea});var Ta=e.H();function Ea(){let t=e.it(Ta);if(t===void 0)throw Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return t}var Da=e.H();function Oa(){let t=e.it(Da);if(t===void 0)throw Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return t}function ka(t){let n=Gi(),r=Ea(),i=H({id:`${n.generateId(`item`)}-${e.J()}`},t),[a,o]=e.nt(i,[`value`,`disabled`,`onPointerDown`]),[s,c]=e.q(),[l,u]=e.q(),[d,f]=e.q(),[p,m]=e.q(),[h,g]=e.q(!1),_=e.W(()=>r.isDefaultValue(a.value)),v=e.W(()=>r.isSelectedValue(a.value)),y=e.W(()=>a.disabled||n.isDisabled()||!1),b=e=>{R(e,a.onPointerDown),h()&&e.preventDefault()},x=e.W(()=>({...n.dataset(),"data-disabled":y()?``:void 0,"data-checked":v()?``:void 0})),S={value:()=>a.value,dataset:x,isDefault:_,isSelected:v,isDisabled:y,inputId:s,labelId:l,descriptionId:d,inputRef:p,select:()=>r.setSelectedValue(a.value),generateId:D(()=>o.id),registerInput:Yt(c),registerLabel:Yt(u),registerDescription:Yt(f),setIsFocused:g,setInputRef:m};return e.B(Da.Provider,{value:S,get children(){return e.B(U,e.Q({as:`div`,role:`group`,onPointerDown:b},x,o))}})}function Aa(t){let n=Oa(),r=H({id:n.generateId(`control`)},t),[i,a]=e.nt(r,[`onClick`,`onKeyDown`]);return e.B(U,e.Q({as:`div`,onClick:e=>{R(e,i.onClick),n.select(),n.inputRef()?.focus({preventScroll:!0})},onKeyDown:e=>{R(e,i.onKeyDown),e.key===N.Space&&(n.select(),n.inputRef()?.focus({preventScroll:!0}))}},()=>n.dataset(),a))}function ja(t){let n=Oa(),r=H({id:n.generateId(`description`)},t);return e.U(()=>e.et(n.registerDescription(r.id))),e.B(U,e.Q({as:`div`},()=>n.dataset(),r))}function Ma(t){let n=Oa(),r=H({id:n.generateId(`indicator`)},t),[i,a]=e.nt(r,[`ref`,`forceMount`]),[o,s]=e.q(),{present:c}=wt({show:()=>i.forceMount||n.isSelected(),element:()=>o()??null});return e.B(e.L,{get when(){return c()},get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(s,i.ref);typeof t==`function`&&t(e)}},()=>n.dataset(),a))}})}function Na(t){let n=Gi(),r=Ea(),i=Oa(),a=H({id:i.generateId(`input`)},t),[o,s]=e.nt(a,[`ref`,`style`,`aria-labelledby`,`aria-describedby`,`onChange`,`onFocus`,`onBlur`]),c=()=>[o[`aria-labelledby`],i.labelId(),o[`aria-labelledby`]!=null&&s[`aria-label`]!=null?s.id:void 0].filter(Boolean).join(` `)||void 0,l=()=>[o[`aria-describedby`],i.descriptionId(),r.ariaDescribedBy()].filter(Boolean).join(` `)||void 0,[u,d]=e.q(!1);return e.U(e.$([()=>i.isSelected(),()=>i.value()],e=>{if(!e[0]&&e[1]===i.value())return;d(!0);let t=i.inputRef();t?.dispatchEvent(new Event(`input`,{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0}))},{defer:!0})),e.U(()=>e.et(i.registerInput(s.id))),e.B(U,e.Q({as:`input`,ref(e){let t=v(i.setInputRef,o.ref);typeof t==`function`&&t(e)},type:`radio`,get name(){return n.name()},get value(){return i.value()},get checked(){return i.isSelected()},get required(){return n.isRequired()},get disabled(){return i.isDisabled()},get readonly(){return n.isReadOnly()},get style(){return _({...ke},o.style)},get"aria-labelledby"(){return c()},get"aria-describedby"(){return l()},onChange:e=>{if(R(e,o.onChange),e.stopPropagation(),!u()){r.setSelectedValue(i.value());let t=e.target;t.checked=i.isSelected()}d(!1)},onFocus:e=>{R(e,o.onFocus),i.setIsFocused(!0)},onBlur:e=>{R(e,o.onBlur),i.setIsFocused(!1)}},()=>i.dataset(),s))}function Pa(t){let n=Oa(),r=H({id:n.generateId(`label`)},t);return e.U(()=>e.et(n.registerLabel(r.id))),e.B(U,e.Q({as:`label`,get for(){return n.inputId()}},()=>n.dataset(),r))}function Fa(t){return e.B(aa,e.Q({as:`span`},t))}function Ia(t){let n,r=H({id:`radiogroup-${e.J()}`,orientation:`vertical`},t),[a,o,s]=e.nt(r,[`ref`,`value`,`defaultValue`,`onChange`,`orientation`,`aria-labelledby`,`aria-describedby`],Hi),[c,l]=Ke({value:()=>a.value,defaultValue:()=>a.defaultValue,onChange:e=>a.onChange?.(e)}),{formControlContext:u}=Ui(o);oa(()=>n,()=>l(a.defaultValue??``));let d=()=>u.getAriaLabelledBy(i(o.id),s[`aria-label`],a[`aria-labelledby`]),f=()=>u.getAriaDescribedBy(a[`aria-describedby`]),p=e=>e===t.defaultValue,m=e=>e===c(),h={ariaDescribedBy:f,isDefaultValue:p,isSelectedValue:m,setSelectedValue:e=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(e),n))for(let e of n.querySelectorAll(`[type='radio']`)){let t=e;t.checked=m(t.value)}}};return e.B(Wi.Provider,{value:u,get children(){return e.B(Ta.Provider,{value:h,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,a.ref);typeof t==`function`&&t(e)},role:`radiogroup`,get id(){return i(o.id)},get"aria-invalid"(){return u.validationState()===`invalid`||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return a.orientation},get"aria-labelledby"(){return d()},get"aria-describedby"(){return f()}},()=>u.dataset(),s))}})}})}var La=Object.assign(Ia,{Description:Ki,ErrorMessage:la,Item:ka,ItemControl:Aa,ItemDescription:ja,ItemIndicator:Ma,ItemInput:Na,ItemLabel:Pa,Label:Fa}),Ra=e.H();function za(){return e.it(Ra)}var Ba=e.H();function Va(){return e.it(Ba)}var Ha=e.H();function Ua(){return e.it(Ha)}function Wa(){let e=Ua();if(e===void 0)throw Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Ga=e.H();function Ka(){let t=e.it(Ga);if(t===void 0)throw Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return t}function qa(e,t,n){let r=e.split(`-`)[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case`top`:a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case`right`:a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case`bottom`:a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case`left`:a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top])}return a}function Ja(e,t){return t?Se([e.clientX,e.clientY],t):!1}function Ya(t){let n=Ka(),r=dt(),i=Ua(),a=za(),o=Va(),s=H({placement:n.orientation()===`horizontal`?`bottom-start`:`right-start`},t),[c,l]=e.nt(s,[`open`,`defaultOpen`,`onOpenChange`]),u=0,d=null,f=`right`,[p,m]=e.q(),[h,g]=e.q(),[_,v]=e.q(),[y,b]=e.q(),[x,S]=e.q(!0),[w,T]=e.q(l.placement),[E,D]=e.q([]),[O,k]=e.q([]),{DomCollectionProvider:A}=bt({items:O,onItemsChange:k}),j=Vi({open:()=>c.open,defaultOpen:()=>c.defaultOpen,onOpenChange:e=>c.onOpenChange?.(e)}),{present:M}=wt({show:()=>n.forceMount()||j.isOpen(),element:()=>y()??null}),N=lt({selectionMode:`none`,dataSource:O}),P=e=>{S(e),j.open()},F=(e=!1)=>{j.close(),e&&i&&i.close(!0)},ee=e=>{S(e),j.toggle()},I=()=>{let e=y();e&&(B(e),N.selectionManager().setFocused(!0),N.selectionManager().setFocusedKey(void 0))},L=()=>{o==null?I():setTimeout(()=>I())},te=e=>{D(t=>[...t,e]);let t=i?.registerNestedMenu(e);return()=>{D(t=>C(t,e)),t?.()}},R=e=>f===d?.side&&Ja(e,d?.area),z=e=>{R(e)&&e.preventDefault()},ne=e=>{R(e)||L()},V=e=>{R(e)&&e.preventDefault()};ta({isDisabled:()=>!(i==null&&j.isOpen()&&n.isModal()),targets:()=>[y(),...E()].filter(Boolean)}),e.U(()=>{let t=y();if(!t||!i)return;let n=i.registerNestedMenu(t);e.et(()=>{n()})}),e.U(()=>{i===void 0&&a?.registerMenu(n.value(),[y(),...E()])}),e.U(()=>{i===void 0&&a!==void 0&&(a.value()===n.value()?(_()?.focus(),a.autoFocusMenu()&&P(!0)):F())}),e.U(()=>{i===void 0&&a!==void 0&&j.isOpen()&&a.setValue(n.value())}),e.et(()=>{i===void 0&&a?.unregisterMenu(n.value())});let re={dataset:e.W(()=>({"data-expanded":j.isOpen()?``:void 0,"data-closed":j.isOpen()?void 0:``})),isOpen:j.isOpen,contentPresent:M,nestedMenus:E,currentPlacement:w,pointerGraceTimeoutId:()=>u,autoFocus:x,listState:()=>N,parentMenuContext:()=>i,triggerRef:_,contentRef:y,triggerId:p,contentId:h,setTriggerRef:v,setContentRef:b,open:P,close:F,toggle:ee,focusContent:L,onItemEnter:z,onItemLeave:ne,onTriggerLeave:V,setPointerDir:e=>f=e,setPointerGraceTimeoutId:e=>u=e,setPointerGraceIntent:e=>d=e,registerNestedMenu:te,registerItemToParentDomCollection:r?.registerItem,registerTriggerId:Yt(m),registerContentId:Yt(g)};return e.B(A,{get children(){return e.B(Ha.Provider,{value:re,get children(){return e.B(e.L,{when:o===void 0,get fallback(){return l.children},get children(){return e.B(Ai,e.Q({anchorRef:_,contentRef:y,onCurrentPlacementChange:T},l))}})}})}})}var Xa=e.H();function Za(){let t=e.it(Xa);if(t===void 0)throw Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return t}function Qa(t){let n,r=Ka(),i=Wa(),a=H({id:r.generateId(`item-${e.J()}`)},t),[o,s]=e.nt(a,[`ref`,`textValue`,`disabled`,`closeOnSelect`,`checked`,`indeterminate`,`onSelect`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),[c,l]=e.q(),[u,d]=e.q(),[f,p]=e.q(),m=()=>i.listState().selectionManager(),h=()=>s.id,g=()=>m().focusedKey()===h(),_=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{i.close(!0)},1)};xt({getItem:()=>({ref:()=>n,type:`item`,key:h(),textValue:o.textValue??f()?.textContent??n?.textContent??``,disabled:o.disabled??!1})});let y=ot({key:h,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>n),b=e=>{R(e,o.onPointerMove),e.pointerType===`mouse`&&(o.disabled?i.onItemLeave(e):(i.onItemEnter(e),e.defaultPrevented||(B(e.currentTarget),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(h()))))},x=e=>{R(e,o.onPointerLeave),e.pointerType===`mouse`&&i.onItemLeave(e)},S=e=>{R(e,o.onPointerUp),!o.disabled&&e.button===0&&_()},C=e=>{if(R(e,o.onKeyDown),!e.repeat&&!o.disabled)switch(e.key){case`Enter`:case` `:_()}},w=e.W(()=>{if(o.indeterminate)return`mixed`;if(o.checked!=null)return o.checked}),T=e.W(()=>({"data-indeterminate":o.indeterminate?``:void 0,"data-checked":o.checked&&!o.indeterminate?``:void 0,"data-disabled":o.disabled?``:void 0,"data-highlighted":g()?``:void 0})),E={isChecked:()=>o.checked,dataset:T,setLabelRef:p,generateId:D(()=>s.id),registerLabel:Yt(l),registerDescription:Yt(d)};return e.B(Xa.Provider,{value:E,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,o.ref);typeof t==`function`&&t(e)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return c()},get"aria-describedby"(){return u()},get"data-key"(){return y.dataKey()},get onPointerDown(){return z([o.onPointerDown,y.onPointerDown])},get onPointerUp(){return z([S,y.onPointerUp])},get onClick(){return z([o.onClick,y.onClick])},get onKeyDown(){return z([C,y.onKeyDown])},get onMouseDown(){return z([o.onMouseDown,y.onMouseDown])},get onFocus(){return z([o.onFocus,y.onFocus])},onPointerMove:b,onPointerLeave:x},T,s))}})}function $a(t){let n=H({closeOnSelect:!1},t),[r,i]=e.nt(n,[`checked`,`defaultChecked`,`onChange`,`onSelect`]),a=bn({isSelected:()=>r.checked,defaultIsSelected:()=>r.defaultChecked,onSelectedChange:e=>r.onChange?.(e),isDisabled:()=>i.disabled});return e.B(Qa,e.Q({role:`menuitemcheckbox`,get checked(){return a.isSelected()},onSelect:()=>{r.onSelect?.(),a.toggle()}},i))}var eo={next:(e,t)=>e===`ltr`?t===`horizontal`?`ArrowRight`:`ArrowDown`:t===`horizontal`?`ArrowLeft`:`ArrowUp`,previous:(e,t)=>eo.next(e===`ltr`?`rtl`:`ltr`,t)},to={first:e=>e===`horizontal`?`ArrowDown`:`ArrowRight`,last:e=>e===`horizontal`?`ArrowUp`:`ArrowLeft`};function no(t){let n=Ka(),r=Wa(),i=za(),{direction:a}=Ue(),o=H({id:n.generateId(`trigger`)},t),[s,c]=e.nt(o,[`ref`,`id`,`disabled`,`onPointerDown`,`onClick`,`onKeyDown`,`onMouseOver`,`onFocus`]),l=()=>n.value();i!==void 0&&(l=()=>n.value()??s.id,i.lastValue()===void 0&&i.setLastValue(l));let u=Ut(()=>r.triggerRef(),()=>`button`),d=e.W(()=>u()===`a`&&r.triggerRef()?.getAttribute(`href`)!=null);e.U(e.$(()=>i?.value(),e=>{d()&&e===l()&&r.triggerRef()?.focus()}));let f=()=>{i===void 0?r.toggle(!0):r.isOpen()?i.value()===l()&&i.closeMenu():(i.autoFocusMenu()||i.setAutoFocusMenu(!0),r.open(!1))};return e.U(()=>e.et(r.registerTriggerId(s.id))),e.B(qt,e.Q({ref(e){let t=v(r.setTriggerRef,s.ref);typeof t==`function`&&t(e)},get"data-kb-menu-value-trigger"(){return n.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":`true`,get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return e.T(()=>!!r.isOpen())()?r.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&i?.value()===l()||void 0},get tabIndex(){return i===void 0?void 0:i.value()===l()||i.lastValue()===l()?0:-1},onPointerDown:e=>{R(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,!s.disabled&&e.pointerType!==`touch`&&e.button===0&&f()},onMouseOver:e=>{R(e,s.onMouseOver),r.triggerRef()?.dataset.pointerType!==`touch`&&!s.disabled&&i!==void 0&&i.value()!==void 0&&i.setValue(l)},onClick:e=>{R(e,s.onClick),s.disabled||e.currentTarget.dataset.pointerType===`touch`&&f()},onKeyDown:e=>{if(R(e,s.onKeyDown),!s.disabled){if(d())switch(e.key){case`Enter`:case` `:return}switch(e.key){case`Enter`:case` `:case to.first(n.orientation()):e.stopPropagation(),e.preventDefault(),Oe(e.currentTarget),r.open(`first`),i?.setAutoFocusMenu(!0),i?.setValue(l);break;case to.last(n.orientation()):e.stopPropagation(),e.preventDefault(),r.open(`last`);break;case eo.next(a(),n.orientation()):if(i===void 0)break;e.stopPropagation(),e.preventDefault(),i.nextMenu();break;case eo.previous(a(),n.orientation()):if(i===void 0)break;e.stopPropagation(),e.preventDefault(),i.previousMenu()}}},onFocus:e=>{R(e,s.onFocus),i!==void 0&&e.currentTarget.dataset.pointerType!==`touch`&&i.setValue(l)},role:i===void 0?void 0:`menuitem`},()=>r.dataset(),c))}function ro(t){let n,r=Ka(),i=Wa(),a=za(),o=Va(),{direction:s}=Ue(),c=H({id:r.generateId(`content-${e.J()}`)},t),[l,u]=e.nt(c,[`ref`,`id`,`style`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeyDown`,`onFocusOutside`,`onPointerEnter`,`onPointerMove`,`onKeyDown`,`onMouseDown`,`onFocusIn`,`onFocusOut`]),d=0,f=()=>i.parentMenuContext()==null&&a===void 0&&r.isModal(),p=Ji({selectionManager:i.listState().selectionManager,collection:i.listState().collection,autoFocus:i.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!i.listState().selectionManager().isFocused(),orientation:()=>r.orientation()===`horizontal`?`vertical`:`horizontal`},()=>n);$i({trapFocus:()=>f()&&i.isOpen(),onMountAutoFocus:e=>{a===void 0&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>n);let m=e=>{if(O(e.currentTarget,e.target)&&(e.key===`Tab`&&i.isOpen()&&e.preventDefault(),a!==void 0&&e.currentTarget.getAttribute(`aria-haspopup`)!==`true`))switch(e.key){case eo.next(s(),r.orientation()):e.stopPropagation(),e.preventDefault(),i.close(!0),a.setAutoFocusMenu(!0),a.nextMenu();break;case eo.previous(s(),r.orientation()):if(e.currentTarget.hasAttribute(`data-closed`))break;e.stopPropagation(),e.preventDefault(),i.close(!0),a.setAutoFocusMenu(!0),a.previousMenu()}},h=e=>{l.onEscapeKeyDown?.(e),a?.setAutoFocusMenu(!1),i.close(!0)},g=e=>{l.onFocusOutside?.(e),r.isModal()&&e.preventDefault()},y=e=>{R(e,l.onPointerEnter),i.isOpen()&&(i.parentMenuContext()?.listState().selectionManager().setFocused(!1),i.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=e=>{if(R(e,l.onPointerMove),e.pointerType!==`mouse`)return;let t=e.target,n=d!==e.clientX;O(e.currentTarget,t)&&n&&(i.setPointerDir(e.clientX>d?`right`:`left`),d=e.clientX)};e.U(()=>e.et(i.registerContentId(l.id))),e.et(()=>i.setContentRef(void 0));let x={ref:v(e=>{i.setContentRef(e),n=e},l.ref),role:`menu`,get id(){return l.id},get tabIndex(){return p.tabIndex()},get"aria-labelledby"(){return i.triggerId()},onKeyDown:z([l.onKeyDown,p.onKeyDown,m]),onMouseDown:z([l.onMouseDown,p.onMouseDown]),onFocusIn:z([l.onFocusIn,p.onFocusIn]),onFocusOut:z([l.onFocusOut,p.onFocusOut]),onPointerEnter:y,onPointerMove:b,get"data-orientation"(){return r.orientation()}};return e.B(e.L,{get when(){return i.contentPresent()},get children(){return e.B(e.L,{get when(){return o===void 0||i.parentMenuContext()!=null},get fallback(){return e.B(U,e.Q({as:`div`},()=>i.dataset(),x,u))},get children(){return e.B(Ai.Positioner,{get children(){return e.B(Bi,e.Q({get disableOutsidePointerEvents(){return e.T(()=>!!f())()&&i.isOpen()},get excludedElements(){return[i.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return _({"--kb-menu-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},l.style)},onEscapeKeyDown:h,onFocusOutside:g,get onDismiss(){return i.close}},()=>i.dataset(),x,u))}})}})}})}function io(t){let n,r=Ka(),i=Wa(),[a,o]=e.nt(t,[`ref`]);return Ca({element:()=>n??null,enabled:()=>i.contentPresent()&&r.preventScroll()}),e.B(ro,e.Q({ref(e){let t=v(e=>{n=e},a.ref);typeof t==`function`&&t(e)}},o))}var ao=e.H();function oo(){let t=e.it(ao);if(t===void 0)throw Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return t}function so(t){let n=H({id:Ka().generateId(`group-${e.J()}`)},t),[r,i]=e.q(),a={generateId:D(()=>n.id),registerLabelId:Yt(i)};return e.B(ao.Provider,{value:a,get children(){return e.B(U,e.Q({as:`div`,role:`group`,get"aria-labelledby"(){return r()}},n))}})}function co(t){let n=oo(),r=H({id:n.generateId(`label`)},t),[i,a]=e.nt(r,[`id`]);return e.U(()=>e.et(n.registerLabelId(i.id))),e.B(U,e.Q({as:`span`,get id(){return i.id},"aria-hidden":`true`},a))}function lo(t){let n=Wa(),r=H({children:`▼`},t);return e.B(U,e.Q({as:`span`,"aria-hidden":`true`},()=>n.dataset(),r))}function uo(t){return e.B(Qa,e.Q({role:`menuitem`,closeOnSelect:!0},t))}function fo(t){let n=Za(),r=H({id:n.generateId(`description`)},t),[i,a]=e.nt(r,[`id`]);return e.U(()=>e.et(n.registerDescription(i.id))),e.B(U,e.Q({as:`div`,get id(){return i.id}},()=>n.dataset(),a))}function po(t){let n=Za(),r=H({id:n.generateId(`indicator`)},t),[i,a]=e.nt(r,[`forceMount`]);return e.B(e.L,{get when(){return i.forceMount||n.isChecked()},get children(){return e.B(U,e.Q({as:`div`},()=>n.dataset(),a))}})}function mo(t){let n=Za(),r=H({id:n.generateId(`label`)},t),[i,a]=e.nt(r,[`ref`,`id`]);return e.U(()=>e.et(n.registerLabel(i.id))),e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setLabelRef,i.ref);typeof t==`function`&&t(e)},get id(){return i.id}},()=>n.dataset(),a))}function ho(t){let n=Wa();return e.B(e.L,{get when(){return n.contentPresent()},get children(){return e.B(e.y,t)}})}var go=e.H();function _o(){let t=e.it(go);if(t===void 0)throw Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return t}function vo(t){let n=H({id:Ka().generateId(`radiogroup-${e.J()}`)},t),[r,i]=e.nt(n,[`value`,`defaultValue`,`onChange`,`disabled`]),[a,o]=Ke({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)});return e.B(go.Provider,{value:{isDisabled:()=>r.disabled,isSelectedValue:e=>e===a(),setSelectedValue:e=>o(e)},get children(){return e.B(so,i)}})}function yo(t){let n=_o(),r=H({closeOnSelect:!1},t),[i,a]=e.nt(r,[`value`,`onSelect`]);return e.B(Qa,e.Q({role:`menuitemradio`,get checked(){return n.isSelectedValue(i.value)},onSelect:()=>{i.onSelect?.(),n.setSelectedValue(i.value)}},a))}function bo(t){let n=za(),r=H({id:`menu-${e.J()}`,modal:!0},t),[i,a]=e.nt(r,[`id`,`modal`,`preventScroll`,`forceMount`,`open`,`defaultOpen`,`onOpenChange`,`value`,`orientation`]),o=Vi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:e=>i.onOpenChange?.(e)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:D(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??n?.orientation()??`horizontal`};return e.B(Ga.Provider,{value:s,get children(){return e.B(Ya,e.Q({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}function xo(t){let{direction:n}=Ue();return e.B(Ya,e.Q({get placement(){return n()===`rtl`?`left-start`:`right-start`},flip:!0},t))}var So={close:(e,t)=>e===`ltr`?[t===`horizontal`?`ArrowLeft`:`ArrowUp`]:[t===`horizontal`?`ArrowRight`:`ArrowDown`]};function Co(t){let n=Wa(),r=Ka(),[i,a]=e.nt(t,[`onFocusOutside`,`onKeyDown`]),{direction:o}=Ue();return e.B(ro,e.Q({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{i.onFocusOutside?.(e);let t=e.target;O(n.triggerRef(),t)||n.close()},onKeyDown:e=>{R(e,i.onKeyDown);let t=O(e.currentTarget,e.target),a=So.close(o(),r.orientation()).includes(e.key),s=n.parentMenuContext()!=null;t&&a&&s&&(n.close(),B(n.triggerRef()))}},a))}var wo=[`Enter`,` `],To={open:(e,t)=>e===`ltr`?[...wo,t===`horizontal`?`ArrowRight`:`ArrowDown`]:[...wo,t===`horizontal`?`ArrowLeft`:`ArrowUp`]};function Eo(t){let n,r=Ka(),i=Wa(),a=H({id:r.generateId(`sub-trigger-${e.J()}`)},t),[o,s]=e.nt(a,[`ref`,`id`,`textValue`,`disabled`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),c=null,l=()=>{c&&window.clearTimeout(c),c=null},{direction:u}=Ue(),d=()=>o.id,f=()=>{let e=i.parentMenuContext();if(e==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},p=()=>i.listState().collection(),m=()=>f().focusedKey()===d(),h=ot({key:d,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>n),g=e=>{R(e,o.onClick),!i.isOpen()&&!o.disabled&&i.open(!0)},_=e=>{if(R(e,o.onPointerMove),e.pointerType!==`mouse`)return;let t=i.parentMenuContext();t?.onItemEnter(e),!e.defaultPrevented&&(o.disabled?t?.onItemLeave(e):(!i.isOpen()&&!c&&(i.parentMenuContext()?.setPointerGraceIntent(null),c=window.setTimeout(()=>{i.open(!1),l()},100)),t?.onItemEnter(e),e.defaultPrevented||(i.listState().selectionManager().isFocused()&&(i.listState().selectionManager().setFocused(!1),i.listState().selectionManager().setFocusedKey(void 0)),B(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(d()))))},y=e=>{if(R(e,o.onPointerLeave),e.pointerType!==`mouse`)return;l();let t=i.parentMenuContext(),n=i.contentRef();if(n){t?.setPointerGraceIntent({area:qa(i.currentPlacement(),e,n),side:i.currentPlacement().split(`-`)[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());let r=window.setTimeout(()=>{t?.setPointerGraceIntent(null)},300);t?.setPointerGraceTimeoutId(r)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)},b=e=>{R(e,o.onKeyDown),e.repeat||o.disabled||To.open(u(),r.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),f().setFocused(!1),f().setFocusedKey(void 0),i.isOpen()||i.open(`first`),i.focusContent(),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(p().getFirstKey()))};return e.U(()=>{if(i.registerItemToParentDomCollection==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");let t=i.registerItemToParentDomCollection({ref:()=>n,type:`item`,key:d(),textValue:o.textValue??n?.textContent??``,disabled:o.disabled??!1});e.et(t)}),e.U(e.$(()=>i.parentMenuContext()?.pointerGraceTimeoutId(),t=>{e.et(()=>{window.clearTimeout(t),i.parentMenuContext()?.setPointerGraceIntent(null)})})),e.U(()=>e.et(i.registerTriggerId(o.id))),e.et(()=>{l()}),e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>{i.setTriggerRef(e),n=e},o.ref);typeof t==`function`&&t(e)},get id(){return o.id},role:`menuitem`,get tabIndex(){return h.tabIndex()},"aria-haspopup":`true`,get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return e.T(()=>!!i.isOpen())()?i.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return m()?``:void 0},get"data-disabled"(){return o.disabled?``:void 0},get onPointerDown(){return z([o.onPointerDown,h.onPointerDown])},get onPointerUp(){return z([o.onPointerUp,h.onPointerUp])},get onClick(){return z([g,h.onClick])},get onKeyDown(){return z([b,h.onKeyDown])},get onMouseDown(){return z([o.onMouseDown,h.onMouseDown])},get onFocus(){return z([o.onFocus,h.onFocus])},onPointerMove:_,onPointerLeave:y},()=>i.dataset(),s))}Ct({},{Root:()=>Do,Separator:()=>Oo});function Do(t){let n,r=H({orientation:`horizontal`},t),[i,a]=e.nt(r,[`ref`,`orientation`]),o=Ut(()=>n,()=>`hr`);return e.B(U,e.Q({as:`hr`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)},get role(){return o()===`hr`?void 0:`separator`},get"aria-orientation"(){return i.orientation===`vertical`?`vertical`:void 0},get"data-orientation"(){return i.orientation}},a))}var Oo=Do,K={};Ct(K,{Arrow:()=>xi,CheckboxItem:()=>$a,Content:()=>ko,DropdownMenu:()=>jo,Group:()=>so,GroupLabel:()=>co,Icon:()=>lo,Item:()=>uo,ItemDescription:()=>fo,ItemIndicator:()=>po,ItemLabel:()=>mo,Portal:()=>ho,RadioGroup:()=>vo,RadioItem:()=>yo,Root:()=>Ao,Separator:()=>Do,Sub:()=>xo,SubContent:()=>Co,SubTrigger:()=>Eo,Trigger:()=>no});function ko(t){let n=Ka(),r=Wa(),[i,a]=e.nt(t,[`onCloseAutoFocus`,`onInteractOutside`]),o=!1;return e.B(io,e.Q({onCloseAutoFocus:e=>{i.onCloseAutoFocus?.(e),o||B(r.triggerRef()),o=!1,e.preventDefault()},onInteractOutside:e=>{i.onInteractOutside?.(e),(!n.isModal()||e.detail.isContextMenu)&&(o=!0)}},a))}function Ao(t){let n=H({id:`dropdownmenu-${e.J()}`},t);return e.B(bo,n)}var jo=Object.assign(Ao,{Arrow:xi,CheckboxItem:$a,Content:ko,Group:so,GroupLabel:co,Icon:lo,Item:uo,ItemDescription:fo,ItemIndicator:po,ItemLabel:mo,Portal:ho,RadioGroup:vo,RadioItem:yo,Separator:Do,Sub:xo,SubContent:Co,SubTrigger:Eo,Trigger:no});function Mo(t){let[n,r]=e.q(),i=t?.throw?(e,t)=>{throw r(e instanceof Error?e:Error(t)),e}:(e,t)=>{r(e instanceof Error?e:Error(t))},a=t?.api?Array.isArray(t.api)?t.api:[t.api]:[globalThis.localStorage].filter(Boolean),o=t?.prefix?`${t.prefix}.`:``,s=/* @__PURE__ */ new Map,c=new Proxy({},{get(n,r){let c=s.get(r);c||(c=e.q(void 0,{equals:!1}),s.set(r,c)),c[0]();let l=a.reduce((e,t)=>{if(e!==null||!t)return e;try{return t.getItem(`${o}${r}`)}catch(e){return i(e,`Error reading ${o}${r} from ${t.name}`),null}},null);return l!==null&&t?.deserializer?t.deserializer(l,r,t.options):l}});return t?.sync!==!1&&e.tt(()=>{let t=e=>{let t=!1;a.forEach(n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(t){i(t,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}}),t&&e.key&&s.get(e.key)?.[1]()};`addEventListener`in globalThis?(globalThis.addEventListener(`storage`,t),e.et(()=>globalThis.removeEventListener(`storage`,t))):(a.forEach(e=>e.addEventListener?.(`storage`,t)),e.et(()=>a.forEach(e=>e.removeEventListener?.(`storage`,t))))}),[c,(e,n,r)=>{let c=t?.serializer?t.serializer(n,e,r??t.options):n,l=`${o}${e}`;a.forEach(t=>{try{t.getItem(l)!==c&&t.setItem(l,c)}catch(n){i(n,`Error setting ${o}${e} to ${c} in ${t.name}`)}});let u=s.get(e);u&&u[1]()},{clear:()=>a.forEach(e=>{try{e.clear()}catch(t){i(t,`Error clearing ${e.name}`)}}),error:n,remove:e=>a.forEach(t=>{try{t.removeItem(`${o}${e}`)}catch(n){i(n,`Error removing ${o}${e} from ${t.name}`)}}),toJSON:()=>{let e={},n=(n,r)=>{if(!e.hasOwnProperty(n)){let i=r&&t?.deserializer?t.deserializer(r,n,t.options):r;i&&(e[n]=i)}};return a.forEach(t=>{if(typeof t.getAll==`function`){let e;try{e=t.getAll()}catch(e){i(e,`Error getting all values from in ${t.name}`)}for(let t of e)n(t,e[t])}else{let r=0,a;try{for(;a=t.key(r++);)e.hasOwnProperty(a)||n(a,t.getItem(a))}catch(e){i(e,`Error getting all values from ${t.name}`)}}}),e}}]}var No=Mo,Po=e=>(typeof e.clear==`function`||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Fo=e=>{if(!e)return``;let t=``;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r==`boolean`?`; ${n}`:`; ${n}=${r}`}return t},Io=Po({_cookies:[globalThis.document,`cookie`],getItem:e=>Io._cookies[0][Io._cookies[1]].match(`(^|;)\\s*`+e+`\\s*=\\s*([^;]+)`)?.pop()??null,setItem:(e,t,n)=>{let r=Io.getItem(e);Io._cookies[0][Io._cookies[1]]=`${e}=${t}${Fo(n)}`;let i=Object.assign(new Event(`storage`),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Io});window.dispatchEvent(i)},removeItem:e=>{Io._cookies[0][Io._cookies[1]]=`${e}=deleted${Fo({expires:/* @__PURE__ */ new Date(0)})}`},key:e=>{let t=null,n=0;return Io._cookies[0][Io._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),``)),t},get length(){let e=0;return Io._cookies[0][Io._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=+!!t,``)),e}});const Lo={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,Ấ:`A`,Ắ:`A`,Ẳ:`A`,Ẵ:`A`,Ặ:`A`,Æ:`AE`,Ầ:`A`,Ằ:`A`,Ȃ:`A`,Ç:`C`,Ḉ:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ế:`E`,Ḗ:`E`,Ề:`E`,Ḕ:`E`,Ḝ:`E`,Ȇ:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ḯ:`I`,Ȋ:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,Ố:`O`,Ṍ:`O`,Ṓ:`O`,Ȏ:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,Ý:`Y`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,ấ:`a`,ắ:`a`,ẳ:`a`,ẵ:`a`,ặ:`a`,æ:`ae`,ầ:`a`,ằ:`a`,ȃ:`a`,ç:`c`,ḉ:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ế:`e`,ḗ:`e`,ề:`e`,ḕ:`e`,ḝ:`e`,ȇ:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ḯ:`i`,ȋ:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,ố:`o`,ṍ:`o`,ṓ:`o`,ȏ:`o`,ù:`u`,ú:`u`,û:`u`,ü:`u`,ý:`y`,ÿ:`y`,Ā:`A`,ā:`a`,Ă:`A`,ă:`a`,Ą:`A`,ą:`a`,Ć:`C`,ć:`c`,Ĉ:`C`,ĉ:`c`,Ċ:`C`,ċ:`c`,Č:`C`,č:`c`,C̆:`C`,c̆:`c`,Ď:`D`,ď:`d`,Đ:`D`,đ:`d`,Ē:`E`,ē:`e`,Ĕ:`E`,ĕ:`e`,Ė:`E`,ė:`e`,Ę:`E`,ę:`e`,Ě:`E`,ě:`e`,Ĝ:`G`,Ǵ:`G`,ĝ:`g`,ǵ:`g`,Ğ:`G`,ğ:`g`,Ġ:`G`,ġ:`g`,Ģ:`G`,ģ:`g`,Ĥ:`H`,ĥ:`h`,Ħ:`H`,ħ:`h`,Ḫ:`H`,ḫ:`h`,Ĩ:`I`,ĩ:`i`,Ī:`I`,ī:`i`,Ĭ:`I`,ĭ:`i`,Į:`I`,į:`i`,İ:`I`,ı:`i`,IJ:`IJ`,ij:`ij`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,Ḱ:`K`,ḱ:`k`,K̆:`K`,k̆:`k`,Ĺ:`L`,ĺ:`l`,Ļ:`L`,ļ:`l`,Ľ:`L`,ľ:`l`,Ŀ:`L`,ŀ:`l`,Ł:`l`,ł:`l`,Ḿ:`M`,ḿ:`m`,M̆:`M`,m̆:`m`,Ń:`N`,ń:`n`,Ņ:`N`,ņ:`n`,Ň:`N`,ň:`n`,ʼn:`n`,N̆:`N`,n̆:`n`,Ō:`O`,ō:`o`,Ŏ:`O`,ŏ:`o`,Ő:`O`,ő:`o`,Œ:`OE`,œ:`oe`,P̆:`P`,p̆:`p`,Ŕ:`R`,ŕ:`r`,Ŗ:`R`,ŗ:`r`,Ř:`R`,ř:`r`,R̆:`R`,r̆:`r`,Ȓ:`R`,ȓ:`r`,Ś:`S`,ś:`s`,Ŝ:`S`,ŝ:`s`,Ş:`S`,Ș:`S`,ș:`s`,ş:`s`,Š:`S`,š:`s`,Ţ:`T`,ţ:`t`,ț:`t`,Ț:`T`,Ť:`T`,ť:`t`,Ŧ:`T`,ŧ:`t`,T̆:`T`,t̆:`t`,Ũ:`U`,ũ:`u`,Ū:`U`,ū:`u`,Ŭ:`U`,ŭ:`u`,Ů:`U`,ů:`u`,Ű:`U`,ű:`u`,Ų:`U`,ų:`u`,Ȗ:`U`,ȗ:`u`,V̆:`V`,v̆:`v`,Ŵ:`W`,ŵ:`w`,Ẃ:`W`,ẃ:`w`,X̆:`X`,x̆:`x`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Y̆:`Y`,y̆:`y`,Ź:`Z`,ź:`z`,Ż:`Z`,ż:`z`,Ž:`Z`,ž:`z`,ſ:`s`,ƒ:`f`,Ơ:`O`,ơ:`o`,Ư:`U`,ư:`u`,Ǎ:`A`,ǎ:`a`,Ǐ:`I`,ǐ:`i`,Ǒ:`O`,ǒ:`o`,Ǔ:`U`,ǔ:`u`,Ǖ:`U`,ǖ:`u`,Ǘ:`U`,ǘ:`u`,Ǚ:`U`,ǚ:`u`,Ǜ:`U`,ǜ:`u`,Ứ:`U`,ứ:`u`,Ṹ:`U`,ṹ:`u`,Ǻ:`A`,ǻ:`a`,Ǽ:`AE`,ǽ:`ae`,Ǿ:`O`,ǿ:`o`,Þ:`TH`,þ:`th`,Ṕ:`P`,ṕ:`p`,Ṥ:`S`,ṥ:`s`,X́:`X`,x́:`x`,Ѓ:`Г`,ѓ:`г`,Ќ:`К`,ќ:`к`,A̋:`A`,a̋:`a`,E̋:`E`,e̋:`e`,I̋:`I`,i̋:`i`,Ǹ:`N`,ǹ:`n`,Ồ:`O`,ồ:`o`,Ṑ:`O`,ṑ:`o`,Ừ:`U`,ừ:`u`,Ẁ:`W`,ẁ:`w`,Ỳ:`Y`,ỳ:`y`,Ȁ:`A`,ȁ:`a`,Ȅ:`E`,ȅ:`e`,Ȉ:`I`,ȉ:`i`,Ȍ:`O`,ȍ:`o`,Ȑ:`R`,ȑ:`r`,Ȕ:`U`,ȕ:`u`,B̌:`B`,b̌:`b`,Č̣:`C`,č̣:`c`,Ê̌:`E`,ê̌:`e`,F̌:`F`,f̌:`f`,Ǧ:`G`,ǧ:`g`,Ȟ:`H`,ȟ:`h`,J̌:`J`,ǰ:`j`,Ǩ:`K`,ǩ:`k`,M̌:`M`,m̌:`m`,P̌:`P`,p̌:`p`,Q̌:`Q`,q̌:`q`,Ř̩:`R`,ř̩:`r`,Ṧ:`S`,ṧ:`s`,V̌:`V`,v̌:`v`,W̌:`W`,w̌:`w`,X̌:`X`,x̌:`x`,Y̌:`Y`,y̌:`y`,A̧:`A`,a̧:`a`,B̧:`B`,b̧:`b`,Ḑ:`D`,ḑ:`d`,Ȩ:`E`,ȩ:`e`,Ɛ̧:`E`,ɛ̧:`e`,Ḩ:`H`,ḩ:`h`,I̧:`I`,i̧:`i`,Ɨ̧:`I`,ɨ̧:`i`,M̧:`M`,m̧:`m`,O̧:`O`,o̧:`o`,Q̧:`Q`,q̧:`q`,U̧:`U`,u̧:`u`,X̧:`X`,x̧:`x`,Z̧:`Z`,z̧:`z`},Ro=Object.keys(Lo).join(`|`),zo=new RegExp(Ro,`g`);function Bo(e){return e.replace(zo,e=>Lo[e])}
|
|
2
|
+
const e=require("./utils-DJl-N7L2.cjs"),t=e=>e!=null,n=e=>e.filter(t);function r(e){return(...t)=>{for(let n of e)n&&n(...t)}}const i=e=>typeof e==`function`&&!e.length?e():e,a=e=>Array.isArray(e)?e:e?[e]:[];function o(e,...t){return typeof e==`function`?e(...t):e}const s=e.et;function c(e,t,n,r){let i=e.length,a=t.length,o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,c;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(c of e)t.includes(c)||n(c)}function l(e,t,n,r){return e.addEventListener(t,n,r),s(e.removeEventListener.bind(e,t,n,r))}function u(t,n,r,o){let s=()=>{a(i(t)).forEach(e=>{e&&a(i(n)).forEach(t=>l(e,t,r,o))})};typeof t==`function`?e.U(s):e.G(s)}const d=Symbol(`fallback`);function f(e){for(let t of e)t.dispose()}function p(t,n,r,i={}){let a=/* @__PURE__ */ new Map;return e.et(()=>f(a.values())),()=>{let r=t()||[];return r[e.N],e.rt(()=>{if(!r.length)return f(a.values()),a.clear(),i.fallback?[e.K(e=>(a.set(d,{dispose:e}),i.fallback()))]:[];let t=Array(r.length),s=a.get(d);if(!a.size||s){s?.dispose(),a.delete(d);for(let e=0;e<r.length;e++){let i=r[e],a=n(i,e);o(t,i,e,a)}return t}let c=new Set(a.keys());for(let e=0;e<r.length;e++){let i=r[e],s=n(i,e);c.delete(s);let l=a.get(s);l?(t[e]=l.mapped,l.setIndex?.(e),l.setItem(()=>i)):o(t,i,e,s)}for(let e of c)a.get(e)?.dispose(),a.delete(e);return t})};function o(t,n,i,o){e.K(s=>{let[c,l]=e.q(n),u={setItem:l,dispose:s};if(r.length>1){let[t,n]=e.q(i);u.setIndex=n,u.mapped=r(c,t)}else u.mapped=r(c);a.set(o,u),t[i]=u.mapped})}}function m(t){let{by:n}=t;return e.W(p(()=>t.each,typeof n==`function`?n:e=>e[n],t.children,`fallback`in t?{fallback:()=>t.fallback}:void 0))}const h=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function g(e){let t={},n;for(;n=h.exec(e);)t[n[1]]=n[2];return t}function _(e,t){if(typeof e==`string`){if(typeof t==`string`)return`${e};${t}`;e=g(e)}else typeof t==`string`&&(t=g(t));return{...e,...t}}function v(...e){return r(e)}const y=e=>e instanceof Element;function b(e,t){if(t(e))return e;if(typeof e==`function`&&!e.length)return b(e(),t);if(Array.isArray(e)){let n=[];for(let r of e){let e=b(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function x(t,n=y,r=y){let i=e.W(t),a=e.W(()=>b(i(),n));return a.toArray=()=>{let e=a();return Array.isArray(e)?e:e?[e]:[]},a}function S(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function C(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function w(e){return typeof e==`number`}function T(e){return Object.prototype.toString.call(e)===`[object String]`}function E(e){return typeof e==`function`}function D(e){return t=>`${e()}-${t}`}function O(e,t){return e?e===t||e.contains(t):!1}function k(e,t=!1){let{activeElement:n}=j(e);if(!n?.nodeName)return null;if(M(n)&&n.contentDocument)return k(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=j(n).getElementById(e);if(t)return t}}return n}function A(e){return j(e).defaultView||window}function j(e){return e?e.ownerDocument||e:document}function M(e){return e.tagName===`IFRAME`}var N=/* @__PURE__ */ (e=>(e.Escape=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`,e.Space=` `,e.ArrowDown=`ArrowDown`,e.ArrowLeft=`ArrowLeft`,e.ArrowRight=`ArrowRight`,e.ArrowUp=`ArrowUp`,e.End=`End`,e.Home=`Home`,e.PageDown=`PageDown`,e.PageUp=`PageUp`,e))(N||{});function P(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function F(){return P(/^Mac/i)}function ee(){return P(/^iPhone/i)}function I(){return P(/^iPad/i)||F()&&navigator.maxTouchPoints>1}function L(){return ee()||I()}function te(){return F()||L()}function R(e,t){return t&&(E(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function z(e){return t=>{for(let n of e)R(t,n)}}function ne(e){return F()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function B(e){if(e){if(re())e.focus({preventScroll:!0});else{let t=ie(e);e.focus(),ae(t)}}}var V=null;function re(){if(V==null){V=!1;try{document.createElement(`div`).focus({get preventScroll(){return V=!0,!0}})}catch{}}return V}function ie(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function ae(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var oe=[`input:not([type='hidden']):not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`[tabindex]`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable='false'])`],se=[...oe,`[tabindex]:not([tabindex="-1"]):not([disabled])`],ce=`${oe.join(`:not([hidden]),`)},[tabindex]:not([disabled]):not([hidden])`,le=se.join(`:not([hidden]):not([tabindex="-1"]),`);function ue(e,t){let n=Array.from(e.querySelectorAll(ce)).filter(de);return t&&de(e)&&n.unshift(e),n.forEach((e,t)=>{if(M(e)&&e.contentDocument){let r=e.contentDocument.body,i=ue(r,!1);n.splice(t,1,...i)}}),n}function de(e){return fe(e)&&!pe(e)}function fe(e){return e.matches(ce)&&me(e)}function pe(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function me(e,t){return e.nodeName!==`#comment`&&he(e)&&ge(e,t)&&(!e.parentElement||me(e.parentElement,e))}function he(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r=t!==`none`&&n!==`hidden`&&n!==`collapse`;if(r){if(!e.ownerDocument.defaultView)return r;let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:i}=t(e);r=n!==`none`&&i!==`hidden`&&i!==`collapse`}return r}function ge(e,t){return!e.hasAttribute(`hidden`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function _e(e,t){return t.some(t=>t.contains(e))}function ve(e,t,n){let r=t?.tabbable?le:ce,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(r)&&me(e)&&(!n||_e(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function ye(e){let t=e;for(;t&&!be(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function be(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function xe(){}function Se(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=a,o=0,s=e-1;o<e;s=o++){let[a,c]=t[o],[l,u]=t[s],[,d]=t[s===0?e-1:s-1]||[0,0],f=(c-u)*(n-a)-(a-l)*(r-c);if(u<c){if(r>=u&&r<c){if(f===0)return!0;f>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(c<u){if(r>c&&r<=u){if(f===0)return!0;f<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r===c&&(n>=l&&n<=a||n>=a&&n<=l))return!0}return i}function H(t,n){return e.Q(t,n)}var Ce=/* @__PURE__ */ new Map,we=/* @__PURE__ */ new Set;function Te(){if(typeof window>`u`||document.body===null)return;let e=e=>{if(!e.target)return;let n=Ce.get(e.target);n||(n=/* @__PURE__ */ new Set,Ce.set(e.target,n),e.target.addEventListener(`transitioncancel`,t)),n.add(e.propertyName)},t=e=>{if(!e.target)return;let n=Ce.get(e.target);if(n&&(n.delete(e.propertyName),n.size===0&&(e.target.removeEventListener(`transitioncancel`,t),Ce.delete(e.target)),Ce.size===0)){for(let e of we)e();we.clear()}};document.body.addEventListener(`transitionrun`,e),document.body.addEventListener(`transitionend`,t)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Te):Te());function Ee(e,t){let n=De(e,t,`left`),r=De(e,t,`top`),i=t.offsetWidth,a=t.offsetHeight,o=e.scrollLeft,s=e.scrollTop,c=o+e.offsetWidth,l=s+e.offsetHeight;n<=o?o=n:n+i>c&&(o+=n+i-c),r<=s?s=r:r+a>l&&(s+=r+a-l),e.scrollLeft=o,e.scrollTop=s}function De(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Oe(e,t){if(document.contains(e)){let n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow!==`hidden`){let{left:n,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(n-i)>1||Math.abs(r-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let t=ye(e);for(;e&&t&&e!==n&&t!==n;)Ee(t,e),e=t,t=ye(e)}}}var ke={border:`0`,clip:`rect(0 0 0 0)`,"clip-path":`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,"white-space":`nowrap`};function Ae(e){let t=e.startIndex??0,n=e.startLevel??0,r=[],i=t=>{if(t==null)return``;let n=e.getKey??`key`,r=T(n)?t[n]:n(t);return r==null?``:String(r)},a=t=>{if(t==null)return``;let n=e.getTextValue??`textValue`,r=T(n)?t[n]:n(t);return r==null?``:String(r)},o=t=>{if(t==null)return!1;let n=e.getDisabled??`disabled`;return(T(n)?t[n]:n(t))??!1},s=t=>{if(t!=null)return T(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(let c of e.dataSource)if(T(c)||w(c))r.push({type:`item`,rawValue:c,key:String(c),textValue:String(c),disabled:o(c),level:n,index:t}),t++;else if(s(c)!=null){r.push({type:`section`,rawValue:c,key:``,textValue:``,disabled:!1,level:n,index:t}),t++;let i=s(c)??[];if(i.length>0){let a=Ae({dataSource:i,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...a),t+=a.length}}else r.push({type:`item`,rawValue:c,key:i(c),textValue:a(c),disabled:o(c),level:n,index:t}),t++;return r}function je(t,n=[]){return e.W(()=>{let e=Ae({dataSource:i(t.dataSource),getKey:i(t.getKey),getTextValue:i(t.getTextValue),getDisabled:i(t.getDisabled),getSectionChildren:i(t.getSectionChildren)});for(let e=0;e<n.length;e++)n[e]();return t.factory(e)})}var Me=/* @__PURE__ */ new Set([`Avst`,`Arab`,`Armi`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Ne=/* @__PURE__ */ new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Pe(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script??``;return Me.has(t)}let t=e.split(`-`)[0];return Ne.has(t)}function Fe(e){return Pe(e)?`rtl`:`ltr`}function Ie(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;return{locale:e,direction:Fe(e)}}var Le=Ie(),Re=/* @__PURE__ */ new Set;function ze(){Le=Ie();for(let e of Re)e(Le)}function Be(){let[t,n]=e.q(Le),r=e.W(()=>t());return e.tt(()=>{Re.size===0&&window.addEventListener(`languagechange`,ze),Re.add(n),e.et(()=>{Re.delete(n),Re.size===0&&window.removeEventListener(`languagechange`,ze)})}),{locale:()=>r().locale,direction:()=>r().direction}}var Ve=e.H();function He(t){let n=Be();return e.B(Ve.Provider,{value:{locale:()=>t.locale??n.locale(),direction:()=>t.locale?Fe(t.locale):n.direction()},get children(){return t.children}})}function Ue(){let t=Be();return e.it(Ve)||t}var We=/* @__PURE__ */ new Map;function Ge(t){let{locale:n}=Ue(),r=e.W(()=>n()+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``));return e.W(()=>{let e=r(),i;return We.has(e)&&(i=We.get(e)),i||(i=new Intl.Collator(n(),t),We.set(e,i)),i})}function Ke(t){let[n,r]=e.q(t.defaultValue?.()),i=e.W(()=>t.value?.()!==void 0),a=e.W(()=>i()?t.value?.():n());return[a,n=>{e.rt(()=>{let e=o(n,a());return Object.is(e,a())||(i()||r(e),t.onChange?.(e)),e})}]}function qe(e){let[t,n]=Ke(e);return[()=>t()??!1,n]}function Je(e){let[t,n]=Ke(e);return[()=>t()??[],n]}var Ye=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function Xe(e){let[t,n]=Ke(e);return[()=>t()??new Ye,n]}function Ze(e){return te()?e.altKey:e.ctrlKey}function Qe(e){return F()?e.metaKey:e.ctrlKey}function $e(e){return new Ye(e)}function et(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function tt(t){let n=H({selectionMode:`none`,selectionBehavior:`toggle`},t),[r,a]=e.q(!1),[o,s]=e.q(),[c,l]=Xe({value:e.W(()=>{let e=i(n.selectedKeys);return e==null?e:$e(e)}),defaultValue:e.W(()=>{let e=i(n.defaultSelectedKeys);return e==null?new Ye:$e(e)}),onChange:e=>n.onSelectionChange?.(e)}),[u,d]=e.q(i(n.selectionBehavior));return e.U(()=>{let e=c();i(n.selectionBehavior)===`replace`&&u()===`toggle`&&typeof e==`object`&&e.size===0&&d(`replace`)}),e.U(()=>{d(i(n.selectionBehavior)??`toggle`)}),{selectionMode:()=>i(n.selectionMode),disallowEmptySelection:()=>i(n.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:r,setFocused:a,focusedKey:o,setFocusedKey:s,selectedKeys:c,setSelectedKeys:e=>{(i(n.allowDuplicateSelectionEvents)||!et(e,c()))&&l(e)}}}function nt(t){let[n,r]=e.q(``),[a,o]=e.q(-1);return{typeSelectHandlers:{onKeyDown:e=>{if(i(t.isDisabled))return;let s=i(t.keyboardDelegate),c=i(t.selectionManager);if(!s.getKeyForSearch)return;let l=rt(e.key);if(!l||e.ctrlKey||e.metaKey)return;l===` `&&n().trim().length>0&&(e.preventDefault(),e.stopPropagation());let u=r(e=>e+l),d=s.getKeyForSearch(u,c.focusedKey())??s.getKeyForSearch(u);d==null&&it(u)&&(u=u[0],d=s.getKeyForSearch(u,c.focusedKey())??s.getKeyForSearch(u)),d!=null&&(c.setFocusedKey(d),t.onTypeSelect?.(d)),clearTimeout(a()),o(window.setTimeout(()=>r(``),500))}}}}function rt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function it(e){return e.split(``).every(t=>t===e[0])}function at(t,n,r){let a=e.Q({selectOnFocus:()=>i(t.selectionManager).selectionBehavior()===`replace`},t),o=()=>r?.()??n(),{direction:s}=Ue(),c={top:0,left:0};u(()=>i(a.isVirtualized)?void 0:o(),`scroll`,()=>{let e=o();e&&(c={top:e.scrollTop,left:e.scrollLeft})});let{typeSelectHandlers:l}=nt({isDisabled:()=>i(a.disallowTypeAhead),keyboardDelegate:()=>i(a.keyboardDelegate),selectionManager:()=>i(a.selectionManager)}),d=()=>i(a.orientation)??`vertical`,f=e=>{R(e,l.onKeyDown),e.altKey&&e.key===`Tab`&&e.preventDefault();let t=n();if(!t?.contains(e.target))return;let r=i(a.selectionManager),o=i(a.selectOnFocus),c=t=>{t!=null&&(r.setFocusedKey(t),e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&!Ze(e)&&r.replaceSelection(t))},u=i(a.keyboardDelegate),f=i(a.shouldFocusWrap),p=r.focusedKey();switch(e.key){case d()===`vertical`?`ArrowDown`:`ArrowRight`:if(u.getKeyBelow){e.preventDefault();let t;t=p==null?u.getFirstKey?.():u.getKeyBelow(p),t==null&&f&&(t=u.getFirstKey?.(p)),c(t)}break;case d()===`vertical`?`ArrowUp`:`ArrowLeft`:if(u.getKeyAbove){e.preventDefault();let t;t=p==null?u.getLastKey?.():u.getKeyAbove(p),t==null&&f&&(t=u.getLastKey?.(p)),c(t)}break;case d()===`vertical`?`ArrowLeft`:`ArrowUp`:if(u.getKeyLeftOf){e.preventDefault();let t=s()===`rtl`,n;n=p==null?t?u.getFirstKey?.():u.getLastKey?.():u.getKeyLeftOf(p),c(n)}break;case d()===`vertical`?`ArrowRight`:`ArrowDown`:if(u.getKeyRightOf){e.preventDefault();let t=s()===`rtl`,n;n=p==null?t?u.getLastKey?.():u.getFirstKey?.():u.getKeyRightOf(p),c(n)}break;case`Home`:if(u.getFirstKey){e.preventDefault();let t=u.getFirstKey(p,Qe(e));t!=null&&(r.setFocusedKey(t),Qe(e)&&e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&r.replaceSelection(t))}break;case`End`:if(u.getLastKey){e.preventDefault();let t=u.getLastKey(p,Qe(e));t!=null&&(r.setFocusedKey(t),Qe(e)&&e.shiftKey&&r.selectionMode()===`multiple`?r.extendSelection(t):o&&r.replaceSelection(t))}break;case`PageDown`:u.getKeyPageBelow&&p!=null&&(e.preventDefault(),c(u.getKeyPageBelow(p)));break;case`PageUp`:u.getKeyPageAbove&&p!=null&&(e.preventDefault(),c(u.getKeyPageAbove(p)));break;case`a`:Qe(e)&&r.selectionMode()===`multiple`&&i(a.disallowSelectAll)!==!0&&(e.preventDefault(),r.selectAll());break;case`Escape`:!e.defaultPrevented&&!i(a.disallowEmptySelection)&&(e.preventDefault(),r.clearSelection());break;case`Tab`:if(!i(a.allowsTabNavigation)){if(e.shiftKey)t.focus();else{let e=ve(t,{tabbable:!0}),n,r;do r=e.lastChild(),r&&(n=r);while(r);n&&!n.contains(document.activeElement)&&B(n)}break}}},p=e=>{let t=i(a.selectionManager),n=i(a.keyboardDelegate),r=i(a.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target)){if(t.setFocused(!0),t.focusedKey()==null){let i=e=>{e!=null&&(t.setFocusedKey(e),r&&t.replaceSelection(e))},a=e.relatedTarget;a&&e.currentTarget.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?i(t.lastSelectedKey()??n.getLastKey?.()):i(t.firstSelectedKey()??n.getFirstKey?.())}else if(!i(a.isVirtualized)){let e=o();if(e){e.scrollTop=c.top,e.scrollLeft=c.left;let n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(B(n),Ee(e,n))}}}},m=e=>{let t=i(a.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)},h=e=>{o()===e.target&&e.preventDefault()},g=()=>{let e=i(a.autoFocus);if(!e)return;let t=i(a.selectionManager),r=i(a.keyboardDelegate),o;e===`first`&&(o=r.getFirstKey?.()),e===`last`&&(o=r.getLastKey?.());let s=t.selectedKeys();s.size&&(o=s.values().next().value),t.setFocused(!0),t.setFocusedKey(o);let c=n();c&&o==null&&!i(a.shouldUseVirtualFocus)&&B(c)};return e.tt(()=>{a.deferAutoFocus?setTimeout(g,0):g()}),e.U(e.$([o,()=>i(a.isVirtualized),()=>i(a.selectionManager).focusedKey()],e=>{let[t,n,r]=e;if(n)r&&a.scrollToKey?.(r);else if(r&&t){let e=t.querySelector(`[data-key="${r}"]`);e&&Ee(t,e)}})),{tabIndex:e.W(()=>{if(!i(a.shouldUseVirtualFocus))return i(a.selectionManager).focusedKey()==null?0:-1}),onKeyDown:f,onMouseDown:h,onFocusIn:p,onFocusOut:m}}function ot(t,n){let r=()=>i(t.selectionManager),a=()=>i(t.key),o=()=>i(t.shouldUseVirtualFocus),s=e=>{r().selectionMode()!==`none`&&(r().selectionMode()===`single`?r().isSelected(a())&&!r().disallowEmptySelection()?r().toggleSelection(a()):r().replaceSelection(a()):e?.shiftKey?r().extendSelection(a()):r().selectionBehavior()===`toggle`||Qe(e)||`pointerType`in e&&e.pointerType===`touch`?r().toggleSelection(a()):r().replaceSelection(a()))},c=()=>r().isSelected(a()),l=()=>i(t.disabled)||r().isDisabled(a()),u=()=>!l()&&r().canSelectItem(a()),d=null,f=e=>{u()&&(d=e.pointerType,e.pointerType===`mouse`&&e.button===0&&!i(t.shouldSelectOnPressUp)&&s(e))},p=e=>{u()&&e.pointerType===`mouse`&&e.button===0&&i(t.shouldSelectOnPressUp)&&i(t.allowsDifferentPressOrigin)&&s(e)},m=e=>{u()&&(i(t.shouldSelectOnPressUp)&&!i(t.allowsDifferentPressOrigin)||d!==`mouse`)&&s(e)},h=e=>{u()&&[`Enter`,` `].includes(e.key)&&(Ze(e)?r().toggleSelection(a()):s(e))},g=e=>{l()&&e.preventDefault()},_=e=>{let t=n();o()||l()||!t||e.target===t&&r().setFocusedKey(a())},v=e.W(()=>{if(!(o()||l()))return a()===r().focusedKey()?0:-1}),y=e.W(()=>i(t.virtualized)?void 0:a());return e.U(e.$([n,a,o,()=>r().focusedKey(),()=>r().isFocused()],([e,n,r,i,a])=>{e&&n===i&&a&&!r&&document.activeElement!==e&&(t.focus?t.focus():B(e))})),{isSelected:c,isDisabled:l,allowsSelection:u,tabIndex:v,dataKey:y,onPointerDown:f,onPointerUp:p,onClick:m,onKeyDown:h,onMouseDown:g,onFocus:_}}var st=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()===`none`)return!1;let t=this.getKey(e);return t!=null&&this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;let e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Ye(n,r,t);for(let e of this.getKeyRange(r,n.currentKey||t))i.delete(e);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&i.add(e);this.state.setSelectedKeys(i)}getKeyRange(e,t){let n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){let n=[],r=e;for(;r!=null;){let e=this.collection().getItem(r);if(e&&e.type===`item`&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){let t=this.collection().getItem(e);return t?!t||t.type!==`item`?null:t.key:e}toggleSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Ye(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&n.size===0||this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Ye([t],t,t):new Ye;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()===`none`)return;let t=new Ye;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode()===`single`))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()===`multiple`&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){let e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Ye)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!==`none`&&(this.selectionMode()===`single`?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()===`toggle`||t&&t.pointerType===`touch`?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;let t=this.selectedKeys();if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()===`none`)return!1;let t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){let t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){let e=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){let n=this.collection().getItem(t);if(!n)continue;n.type===`item`&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},ct=class{keyMap=/* @__PURE__ */ new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(let t of e)this.keyMap.set(t.key,t);if(this.keyMap.size===0)return;let t,n=0;for(let[e,r]of this.keyMap)t?(t.nextKey=e,r.prevKey=t.key):(this.firstKey=e,r.prevKey=void 0),r.type===`item`&&(r.index=n++),t=r,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}};function lt(t){let n=tt(t),r=je({dataSource:()=>i(t.dataSource),getKey:()=>i(t.getKey),getTextValue:()=>i(t.getTextValue),getDisabled:()=>i(t.getDisabled),getSectionChildren:()=>i(t.getSectionChildren),factory:e=>t.filter?new ct(t.filter(e)):new ct(e)},[()=>t.filter]),a=new st(r,n);return e.V(()=>{let e=n.focusedKey();e!=null&&!r().getItem(e)&&n.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>a}}var ut=e.H();function dt(){return e.it(ut)}function ft(){let e=dt();if(e===void 0)throw Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function pt(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function mt(e,t){let n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){let t=e[r]?.ref();if(t&&pt(t,n))return r+1}return 0}function ht(e){let t=e.map((e,t)=>[t,e]),n=!1;return t.sort(([e,t],[r,i])=>{let a=t.ref(),o=i.ref();return a===o||!a||!o?0:pt(a,o)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1)}),n?t.map(([e,t])=>t):e}function gt(e,t){let n=ht(e);e!==n&&t(n)}function _t(e){let t=e[0],n=e[e.length-1]?.ref(),r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return j(r).body}function vt(t,n){e.U(()=>{let r=setTimeout(()=>{gt(t(),n)});e.et(()=>clearTimeout(r))})}function yt(t,n){if(typeof IntersectionObserver!=`function`){vt(t,n);return}let r=[];e.U(()=>{let i=()=>{let e=!!r.length;r=t(),e&>(t(),n)},a=_t(t()),o=new IntersectionObserver(i,{root:a});for(let e of t()){let t=e.ref();t&&o.observe(t)}e.et(()=>o.disconnect())})}function bt(t={}){let[n,r]=Je({value:()=>i(t.items),onChange:e=>t.onItemsChange?.(e)});yt(n,r);let a=e=>(r(t=>S(t,e,mt(t,e))),()=>{r(t=>{let n=t.filter(t=>t.ref()!==e.ref());return t.length===n.length?t:n})});return{DomCollectionProvider:t=>e.B(ut.Provider,{value:{registerItem:a},get children(){return t.children}})}}function xt(t){let n=ft(),r=H({shouldRegisterItem:!0},t);e.U(()=>{if(!r.shouldRegisterItem)return;let t=n.registerItem(r.getItem());e.et(t)})}function U(t){let[n,r]=e.nt(t,[`as`]);if(!n.as)throw Error("[kobalte]: Polymorphic is missing the required `as` prop.");return e.B(e.v,e.Q(r,{get component(){return n.as}}))}var St=Object.defineProperty,Ct=(e,t)=>{for(var n in t)St(e,n,{get:t[n],enumerable:!0})},W=e=>typeof e==`function`?e():e,wt=t=>{let n=e.W(()=>{let e=W(t.element);if(e)return getComputedStyle(e)}),r=()=>n()?.animationName??`none`,[i,a]=e.q(W(t.show)?`present`:`hidden`),o=e=>{a(e),t.onStateChange?.(e)},s=`none`;return e.U(i=>{let a=W(t.show);return e.rt(()=>{if(i===a)return a;let e=s,t=r();a?o(`present`):t===`none`||n()?.display===`none`?o(`hidden`):o(i===!0&&e!==t?`hiding`:`hidden`)}),a},W(t.show)),e.U(()=>{let n=W(t.element);if(!n)return;let a=e=>{e.target===n&&(s=r())},c=e=>{let t=r().includes(e.animationName);e.target===n&&t&&i()===`hiding`&&o(`hidden`)};n.addEventListener(`animationstart`,a),n.addEventListener(`animationcancel`,c),n.addEventListener(`animationend`,c),e.et(()=>{n.removeEventListener(`animationstart`,a),n.removeEventListener(`animationcancel`,c),n.removeEventListener(`animationend`,c)})}),{present:()=>i()===`present`||i()===`hiding`,state:i}};function Tt(t,n){let r=new ResizeObserver(t);return e.et(r.disconnect.bind(r)),{observe:e=>r.observe(e,n),unobserve:r.unobserve.bind(r)}}function Et(t,r,o){let s=/* @__PURE__ */ new WeakMap,{observe:l,unobserve:u}=Tt(e=>{for(let t of e){let{contentRect:e,target:n}=t,i=Math.round(e.width),a=Math.round(e.height),o=s.get(n);o&&o.width===i&&o.height===a||(r(e,n,t),s.set(n,{width:i,height:a}))}},o);e.U(e=>{let r=n(a(i(t)));return c(r,e,l,u),r},[])}var Dt=`data-kb-top-layer`,Ot,kt=!1,At=[];function jt(e){return At.findIndex(t=>t.node===e)}function Mt(e){return At[jt(e)]}function Nt(e){return At.length>0&&At[At.length-1].node===e}function Pt(){return At.filter(e=>e.isPointerBlocking)}function Ft(){return[...Pt()].slice(-1)[0]}function It(){return Pt().length>0}function Lt(e){let t=jt(Ft()?.node);return jt(e)<t}function Rt(e){At.push(e)}function zt(e){let t=jt(e);t<0||At.splice(t,1)}function Bt(){for(let{node:e}of At)e.style.pointerEvents=Lt(e)?`none`:`auto`}function Vt(e){if(It()&&!kt){let t=j(e);Ot=document.body.style.pointerEvents,t.body.style.pointerEvents=`none`,kt=!0}}function Ht(e){if(It())return;let t=j(e);t.body.style.pointerEvents=Ot,t.body.style.length===0&&t.body.removeAttribute(`style`),kt=!1}var G={layers:At,isTopMostLayer:Nt,hasPointerBlockingLayer:It,isBelowPointerBlockingLayer:Lt,addLayer:Rt,removeLayer:zt,indexOf:jt,find:Mt,assignPointerEventToLayers:Bt,disableBodyPointerEvents:Vt,restoreBodyPointerEvents:Ht};function Ut(t,n){let[r,i]=e.q(Wt(n?.()));return e.U(()=>{i(t()?.tagName.toLowerCase()||Wt(n?.()))}),r}function Wt(e){return T(e)?e:void 0}Ct({},{Button:()=>Jt,Root:()=>qt});var Gt=[`button`,`color`,`file`,`image`,`reset`,`submit`];function Kt(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?Gt.indexOf(e.type)!==-1:!1}function qt(t){let n,r=H({type:`button`},t),[i,a]=e.nt(r,[`ref`,`type`,`disabled`]),o=Ut(()=>n,()=>`button`),s=e.W(()=>{let e=o();return e!=null&&Kt({tagName:e,type:i.type})}),c=e.W(()=>o()===`input`),l=e.W(()=>o()===`a`&&n?.getAttribute(`href`)!=null);return e.B(U,e.Q({as:`button`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)},get type(){return s()||c()?i.type:void 0},get role(){return!s()&&!l()?`button`:void 0},get tabIndex(){return!s()&&!l()&&!i.disabled?0:void 0},get disabled(){return s()||c()?i.disabled:void 0},get"aria-disabled"(){return!s()&&!c()&&i.disabled?!0:void 0},get"data-disabled"(){return i.disabled?``:void 0}},a))}var Jt=qt;function Yt(e){return t=>(e(t),()=>e(void 0))}const Xt=Symbol(`store-raw`),Zt=Symbol(`store-node`),Qt=Symbol(`store-has`),$t=Symbol(`store-self`);function en(t){let n=t[e.M];if(!n&&(Object.defineProperty(t,e.M,{value:n=new Proxy(t,ln)}),!Array.isArray(t))){let e=Object.keys(t),r=Object.getOwnPropertyDescriptors(t),i=Object.getPrototypeOf(t),a=i!==null&&typeof t==`object`&&!!t&&!Array.isArray(t)&&i!==Object.prototype;if(a){let t=Object.getOwnPropertyDescriptors(i);e.push(...Object.keys(t)),Object.assign(r,t)}for(let i=0,o=e.length;i<o;i++){let o=e[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(t,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(n)})}}return n}function tn(t){let n;return typeof t==`object`&&!!t&&(t[e.M]||!(n=Object.getPrototypeOf(t))||n===Object.prototype||Array.isArray(t))}function nn(e,t=/* @__PURE__ */ new Set){let n,r,i,a;if(n=e!=null&&e[Xt])return n;if(!tn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=nn(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],o[a].get||(i=e[a],(r=nn(i,t))!==i&&(e[a]=r))}return e}function rn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function an(t,n,r){if(t[n])return t[n];let[i,a]=e.q(r,{equals:!1,internal:!0});return i.$=a,t[n]=i}function on(t,n){let r=Reflect.getOwnPropertyDescriptor(t,n);return!r||r.get||!r.configurable||n===e.M||n===Zt||(delete r.value,delete r.writable,r.get=()=>t[e.M][n]),r}function sn(t){e.Y()&&an(rn(t,Zt),$t)()}function cn(e){return sn(e),Reflect.ownKeys(e)}const ln={get(t,n,r){if(n===Xt)return t;if(n===e.M)return r;if(n===e.N)return sn(t),r;let i=rn(t,Zt),a=i[n],o=a?a():t[n];if(n===Zt||n===Qt||n===`__proto__`)return o;if(!a){let r=Object.getOwnPropertyDescriptor(t,n);e.Y()&&(typeof o!=`function`||Object.prototype.hasOwnProperty.call(t,n))&&!(r&&r.get)&&(o=an(i,n,o)())}return tn(o)?en(o):o},has(t,n){return n===Xt||n===e.M||n===e.N||n===Zt||n===Qt||n===`__proto__`||(e.Y()&&an(rn(t,Qt),n)(),n in t)},set(){return!0},deleteProperty(){return!0},ownKeys:cn,getOwnPropertyDescriptor:on};function un(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[Qt]&&e[Qt][t]&&i!==void 0&&e[Qt][t].$()):(e[t]=n,e[Qt]&&e[Qt][t]&&i===void 0&&e[Qt][t].$());let o=rn(e,Zt),s;if((s=an(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=an(o,`length`,a))&&s.$(e.length)}(s=o[$t])&&s.$()}function dn(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];fn(i)||un(e,i,t[i])}}function fn(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function pn(e,t){if(typeof t==`function`&&(t=t(e)),t=nn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&un(e,n,r)}un(e,`length`,r)}else dn(e,t)}function mn(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&fn(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)mn(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&mn(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)mn(e,[r].concat(t),n);return}if(t.length>1){mn(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=nn(a),r===void 0||tn(i)&&tn(a)&&!Array.isArray(a)?dn(i,a):un(e,r,a))}function hn(...[t,n]){let r=nn(t||{}),i=Array.isArray(r),a=en(r);function o(...t){e.z(()=>{i&&t.length===1?pn(r,t[0]):mn(r,t)})}return[a,o]}const gn=Symbol(`store-root`);function _n(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function vn(e,t,n,r,i){if(_n(n))return;let a=t[n];if(e===a)return;let o=Array.isArray(e);if(n!==gn&&(!tn(e)||!tn(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){un(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let t,n,o,s,c,l,u,d;for(o=0,s=Math.min(a.length,e.length);o<s&&(a[o]===e[o]||i&&a[o]&&e[o]&&a[o][i]&&a[o][i]===e[o][i]);o++)vn(e[o],a,o,r,i);let f=Array(e.length),p=/* @__PURE__ */ new Map;for(s=a.length-1,c=e.length-1;s>=o&&c>=o&&(a[s]===e[c]||i&&a[s]&&e[c]&&a[s][i]&&a[s][i]===e[c][i]);s--,c--)f[c]=a[s];if(o>c||o>s){for(n=o;n<=c;n++)un(a,n,e[n]);for(;n<e.length;n++)un(a,n,f[n]),vn(e[n],a,n,r,i);a.length>e.length&&un(a,`length`,e.length);return}for(u=Array(c+1),n=c;n>=o;n--)l=e[n],d=i&&l?l[i]:l,t=p.get(d),u[n]=t===void 0?-1:t,p.set(d,n);for(t=o;t<=s;t++)l=a[t],d=i&&l?l[i]:l,n=p.get(d),n!==void 0&&n!==-1&&(f[n]=a[t],n=u[n],p.set(d,n));for(n=o;n<e.length;n++)n in f?(un(a,n,f[n]),vn(e[n],a,n,r,i)):un(a,n,e[n])}else for(let t=0,n=e.length;t<n;t++)vn(e[t],a,t,r,i);a.length>e.length&&un(a,`length`,e.length);return}let s=Object.keys(e);for(let t=0,n=s.length;t<n;t++)_n(s[t])||vn(e[s[t]],a,s[t],r,i);let c=Object.keys(a);for(let t=0,n=c.length;t<n;t++)e[c[t]]===void 0&&un(a,c[t],void 0)}function yn(e,t={}){let{merge:n,key:r=`id`}=t,i=nn(e);return e=>{if(!tn(e)||!tn(i))return i;let t=vn(i,{[gn]:e},gn,n,r);return t===void 0?e:t}}function bn(e={}){let[t,n]=qe({value:()=>i(e.isSelected),defaultValue:()=>!!i(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{!i(e.isReadOnly)&&!i(e.isDisabled)&&n(t)},toggle:()=>{!i(e.isReadOnly)&&!i(e.isDisabled)&&n(!t())}}}const xn=[`top`,`right`,`bottom`,`left`],Sn=Math.min,Cn=Math.max,wn=Math.round,Tn=Math.floor,En=e=>({x:e,y:e}),Dn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function On(e,t,n){return Cn(e,Sn(t,n))}function kn(e,t){return typeof e==`function`?e(t):e}function An(e){return e.split(`-`)[0]}function jn(e){return e.split(`-`)[1]}function Mn(e){return e===`x`?`y`:`x`}function Nn(e){return e===`y`?`height`:`width`}function Pn(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fn(e){return Mn(Pn(e))}function In(e,t,n){n===void 0&&(n=!1);let r=jn(e),i=Fn(e),a=Nn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Gn(o)),[o,Gn(o)]}function Ln(e){let t=Gn(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}const zn=[`left`,`right`],Bn=[`right`,`left`],Vn=[`top`,`bottom`],Hn=[`bottom`,`top`];function Un(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Bn:zn:t?zn:Bn;case`left`:case`right`:return t?Vn:Hn;default:return[]}}function Wn(e,t,n,r){let i=jn(e),a=Un(An(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Rn)))),a}function Gn(e){let t=An(e);return Dn[t]+e.slice(t.length)}function Kn(e){return{top:0,right:0,bottom:0,left:0,...e}}function qn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Kn(e)}function Jn(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 Yn(e,t,n){let{reference:r,floating:i}=e,a=Pn(t),o=Fn(t),s=Nn(o),c=An(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}}switch(jn(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Xn(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}=kn(t,e),p=qn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Jn(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=Jn(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}}const Zn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Yn(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<50&&(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}=Yn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qn=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}=kn(e,t)||{};if(l==null)return{};let d=qn(u),f={x:n,y:r},p=Fn(i),m=Nn(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Sn(d[_],T),D=Sn(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=On(O,A,k),M=!c.arrow&&jn(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),$n=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}=kn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=An(r),_=Pn(o),v=An(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Gn(o)]:Ln(o)),x=p!==`none`;!d&&x&&b.push(...Wn(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=In(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`||_===Pn(t)||T.every(e=>Pn(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=Pn(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function er(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tr(e){return xn.some(t=>e[t]>=0)}const nr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=kn(e,t);switch(i){case`referenceHidden`:{let e=er(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tr(e)}}}case`escaped`:{let e=er(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tr(e)}}}default:return{}}}}},rr=/*#__PURE__*/ new Set([`left`,`top`]);async function ir(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=An(n),s=jn(n),c=Pn(n)===`y`,l=rr.has(o)?-1:1,u=a&&c?-1:1,d=kn(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}}const ar=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 ir(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}}}}},or=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}=kn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Pn(An(i)),p=Mn(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=On(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=On(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},sr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=kn(e,t),u=await o.detectOverflow(t,l),d=An(i),f=jn(i),p=Pn(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Sn(h-u[g],v),x=Sn(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Cn(u.left,0),t=Cn(u.right,0),n=Cn(u.top,0),r=Cn(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Cn(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Cn(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<`u`}function lr(e){return fr(e)?(e.nodeName||``).toLowerCase():`#document`}function ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){return((fr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fr(e){return cr()?e instanceof Node||e instanceof ur(e).Node:!1}function pr(e){return cr()?e instanceof Element||e instanceof ur(e).Element:!1}function mr(e){return cr()?e instanceof HTMLElement||e instanceof ur(e).HTMLElement:!1}function hr(e){return!cr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot}function gr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _r(e){return/^(table|td|th)$/.test(lr(e))}function vr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}const yr=/transform|translate|scale|rotate|perspective|filter/,br=/paint|layout|strict|content/,xr=e=>!!e&&e!==`none`;let Sr;function Cr(e){let t=pr(e)?Dr(e):e;return xr(t.transform)||xr(t.translate)||xr(t.scale)||xr(t.rotate)||xr(t.perspective)||!Tr()&&(xr(t.backdropFilter)||xr(t.filter))||yr.test(t.willChange||``)||br.test(t.contain||``)}function wr(e){let t=kr(e);for(;mr(t)&&!Er(t);){if(Cr(t))return t;if(vr(t))return null;t=kr(t)}return null}function Tr(){return Sr??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sr}function Er(e){return/^(html|body|#document)$/.test(lr(e))}function Dr(e){return ur(e).getComputedStyle(e)}function Or(e){return pr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kr(e){if(lr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hr(e)&&e.host||dr(e);return hr(t)?t.host:t}function Ar(e){let t=kr(e);return Er(t)?e.ownerDocument?e.ownerDocument.body:e.body:mr(t)&&gr(t)?t:Ar(t)}function jr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ar(e),i=r===e.ownerDocument?.body,a=ur(r);if(i){let e=Mr(a);return t.concat(a,a.visualViewport||[],gr(r)?r:[],e&&n?jr(e):[])}return t.concat(r,jr(r,[],n))}function Mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nr(e){let t=Dr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wn(n)!==a||wn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pr(e){return pr(e)?e:e.contextElement}function Fr(e){let t=Pr(e);if(!mr(t))return En(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nr(t),o=(a?wn(n.width):n.width)/r,s=(a?wn(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const Ir=/*#__PURE__*/ En(0);function Lr(e){let t=ur(e);return!Tr()||!t.visualViewport?Ir:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ur(e)?!1:t}function zr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pr(e),o=En(1);t&&(r?pr(r)&&(o=Fr(r)):o=Fr(e));let s=Rr(a,n,r)?Lr(a):En(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){let e=ur(a),t=r&&pr(r)?ur(r):r,n=e,i=Mr(n);for(;i&&r&&t!==n;){let e=Fr(i),t=i.getBoundingClientRect(),r=Dr(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=ur(i),i=Mr(n)}}return Jn({width:u,height:d,x:c,y:l})}function Br(e,t){let n=Or(e).scrollLeft;return t?t.left+n:zr(dr(e)).left+n}function Vr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Br(e,n),y:n.top+t.scrollTop}}function Hr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=dr(r),s=t?vr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=En(1),u=En(0),d=mr(r);if((d||!d&&!a)&&((lr(r)!==`body`||gr(o))&&(c=Or(r)),d)){let e=zr(r);l=Fr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vr(o,c):En(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 Ur(e){return Array.from(e.getClientRects())}function Wr(e){let t=dr(e),n=Or(e),r=e.ownerDocument.body,i=Cn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Cn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Br(e),s=-n.scrollTop;return Dr(r).direction===`rtl`&&(o+=Cn(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Gr(e,t){let n=ur(e),r=dr(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Tr();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Br(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function Kr(e,t){let n=zr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mr(e)?Fr(e):En(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function qr(e,t,n){let r;if(t===`viewport`)r=Gr(e,n);else if(t===`document`)r=Wr(dr(e));else if(pr(t))r=Kr(t,n);else{let n=Lr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jn(r)}function Jr(e,t){let n=kr(e);return n===t||!pr(n)||Er(n)?!1:Dr(n).position===`fixed`||Jr(n,t)}function Yr(e,t){let n=t.get(e);if(n)return n;let r=jr(e,[],!1).filter(e=>pr(e)&&lr(e)!==`body`),i=null,a=Dr(e).position===`fixed`,o=a?kr(e):e;for(;pr(o)&&!Er(o);){let t=Dr(o),n=Cr(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||gr(o)&&!n&&Jr(e,o))?r=r.filter(e=>e!==o):i=t,o=kr(o)}return t.set(e,r),r}function Xr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vr(t)?[]:Yr(t,this._c):[].concat(n),r],o=qr(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=qr(t,a[e],i);s=Cn(n.top,s),c=Sn(n.right,c),l=Sn(n.bottom,l),u=Cn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zr(e){let{width:t,height:n}=Nr(e);return{width:t,height:n}}function Qr(e,t,n){let r=mr(t),i=dr(t),a=n===`fixed`,o=zr(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=En(0);function l(){c.x=Br(i)}if(r||!r&&!a){if((lr(t)!==`body`||gr(i))&&(s=Or(t)),r){let e=zr(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Vr(i,s):En(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function $r(e){return Dr(e).position===`static`}function ei(e,t){if(!mr(e)||Dr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return dr(e)===n&&(n=n.ownerDocument.body),n}function ti(e,t){let n=ur(e);if(vr(e))return n;if(!mr(e)){let t=kr(e);for(;t&&!Er(t);){if(pr(t)&&!$r(t))return t;t=kr(t)}return n}let r=ei(e,t);for(;r&&_r(r)&&$r(r);)r=ei(r,t);return r&&Er(r)&&$r(r)&&!Cr(r)?n:r||wr(e)||n}const ni=async function(e){let t=this.getOffsetParent||ti,n=this.getDimensions,r=await n(e.floating);return{reference:Qr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ri(e){return Dr(e).direction===`rtl`}const ii={convertOffsetParentRelativeRectToViewportRelativeRect:Hr,getDocumentElement:dr,getClippingRect:Xr,getOffsetParent:ti,getElementRects:ni,getClientRects:Ur,getDimensions:Zr,getScale:Fr,isElement:pr,isRTL:ri};function ai(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oi(e,t){let n=null,r,i=dr(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Tn(d),h=Tn(i.clientWidth-(u+f)),g=Tn(i.clientHeight-(d+p)),_=Tn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Cn(0,Sn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ai(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function si(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=Pr(e),u=i||a?[...l?jr(l):[],...t?jr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?oi(l,n):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?zr(e):null;c&&g();function g(){let t=zr(e);h&&!ai(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)}}const ci=ar,li=or,ui=$n,di=sr,fi=nr,pi=Qn,mi=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i={platform:ii,...n},a={...i.platform,_c:r};return Zn(e,t,{...i,platform:a})};var hi=e.H();function gi(){let t=e.it(hi);if(t===void 0)throw Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return t}var _i=/* @__PURE__ */ e.A(`<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">`),vi=30,yi=vi/2,bi={top:180,right:-90,bottom:0,left:90};function xi(t){let n=gi(),r=H({size:vi},t),[i,a]=e.nt(r,[`ref`,`style`,`size`]),o=()=>n.currentPlacement().split(`-`)[0],s=Si(n.contentRef),c=()=>s()?.getPropertyValue(`background-color`)||`none`,l=()=>s()?.getPropertyValue(`border-${o()}-color`)||`none`,u=()=>s()?.getPropertyValue(`border-${o()}-width`)||`0px`,d=()=>Number.parseInt(u())*2*(vi/i.size),f=()=>`rotate(${bi[o()]} ${yi} ${yi}) translate(0 2)`;return e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setArrowRef,i.ref);typeof t==`function`&&t(e)},"aria-hidden":`true`,get style(){return _({position:`absolute`,"font-size":`${i.size}px`,width:`1em`,height:`1em`,"pointer-events":`none`,fill:c(),stroke:l(),"stroke-width":d()},i.style)}},a,{get children(){let t=_i(),n=t.firstChild;return e.G(()=>e.D(n,`transform`,f())),t}}))}function Si(t){let[n,r]=e.q();return e.U(()=>{let e=t();e&&r(A(e).getComputedStyle(e))}),n}function Ci(t){let n=gi(),[r,i]=e.nt(t,[`ref`,`style`]);return e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setPositionerRef,r.ref);typeof t==`function`&&t(e)},"data-popper-positioner":``,get style(){return _({position:`absolute`,top:0,left:0,"min-width":`max-content`},r.style)}},i))}function wi(e){let{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect==`function`)return new DOMRect(t,n,r,i);let a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function Ti(e,t){return{contextElement:e,getBoundingClientRect:()=>{let n=t(e);return n?wi(n):e?e.getBoundingClientRect():wi()}}}function Ei(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Di={top:`bottom`,right:`left`,bottom:`top`,left:`right`};function Oi(e,t){let[n,r]=e.split(`-`),i=Di[n];return r?n===`left`||n===`right`?`${i} ${r===`start`?`top`:`bottom`}`:r===`start`?`${i} ${t===`rtl`?`right`:`left`}`:`${i} ${t===`rtl`?`left`:`right`}`:`${i} center`}function ki(t){let n=H({getAnchorRect:e=>e?.getBoundingClientRect(),placement:`bottom`,gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},t),[r,i]=e.q(),[a,o]=e.q(),[s,c]=e.q(n.placement),l=()=>Ti(n.anchorRef?.(),n.getAnchorRect),{direction:u}=Ue();async function d(){let e=l(),t=r(),i=a();if(!e||!t)return;let o=(i?.clientHeight||0)/2,s=typeof n.gutter==`number`?n.gutter+o:n.gutter??o;t.style.setProperty(`--kb-popper-content-overflow-padding`,`${n.overflowPadding}px`),e.getBoundingClientRect();let d=[ci(({placement:e})=>{let t=!!e.split(`-`)[1];return{mainAxis:s,crossAxis:t?void 0:n.shift,alignmentAxis:n.shift}})];if(n.flip!==!1){let e=typeof n.flip==`string`?n.flip.split(` `):void 0;if(e!==void 0&&!e.every(Ei))throw Error("`flip` expects a spaced-delimited list of placements");d.push(ui({padding:n.overflowPadding,fallbackPlacements:e}))}(n.slide||n.overlap)&&d.push(li({mainAxis:n.slide,crossAxis:n.overlap,padding:n.overflowPadding})),d.push(di({padding:n.overflowPadding,apply({availableWidth:e,availableHeight:r,rects:i}){let a=Math.round(i.reference.width);e=Math.floor(e),r=Math.floor(r),t.style.setProperty(`--kb-popper-anchor-width`,`${a}px`),t.style.setProperty(`--kb-popper-content-available-width`,`${e}px`),t.style.setProperty(`--kb-popper-content-available-height`,`${r}px`),n.sameWidth&&(t.style.width=`${a}px`),n.fitViewport&&(t.style.maxWidth=`${e}px`,t.style.maxHeight=`${r}px`)}})),n.hideWhenDetached&&d.push(fi({padding:n.detachedPadding})),i&&d.push(pi({element:i,padding:n.arrowPadding}));let f=await mi(e,t,{placement:n.placement,strategy:`absolute`,middleware:d,platform:{...ii,isRTL:()=>u()===`rtl`}});if(c(f.placement),n.onCurrentPlacementChange?.(f.placement),!t)return;t.style.setProperty(`--kb-popper-content-transform-origin`,Oi(f.placement,u()));let p=Math.round(f.x),m=Math.round(f.y),h;if(n.hideWhenDetached&&(h=f.middlewareData.hide?.referenceHidden?`hidden`:`visible`),Object.assign(t.style,{top:`0`,left:`0`,transform:`translate3d(${p}px, ${m}px, 0)`,visibility:h}),i&&f.middlewareData.arrow){let{x:e,y:t}=f.middlewareData.arrow,n=f.placement.split(`-`)[0];Object.assign(i.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`100%`})}}e.U(()=>{let t=l(),n=r();if(!t||!n)return;let i=si(t,n,d,{elementResize:typeof ResizeObserver==`function`});e.et(i)}),e.U(()=>{let e=r(),t=n.contentRef?.();e&&t&&queueMicrotask(()=>{e.style.zIndex=getComputedStyle(t).zIndex})});let f={currentPlacement:s,contentRef:()=>n.contentRef?.(),setPositionerRef:i,setArrowRef:o};return e.B(hi.Provider,{value:f,get children(){return n.children}})}var Ai=Object.assign(ki,{Arrow:xi,Context:hi,usePopperContext:gi,Positioner:Ci});function ji(t){let n=e=>{e.key===N.Escape&&t.onEscapeKeyDown?.(e)};e.U(()=>{if(i(t.isDisabled))return;let r=t.ownerDocument?.()??j();r.addEventListener(`keydown`,n),e.et(()=>{r.removeEventListener(`keydown`,n)})})}function Mi(e){let t=(typeof e.composedPath==`function`?e.composedPath():void 0)?.[0]??e.target;return t instanceof Element?t:null}function Ni(e,t){if(!e)return!1;let n=t;for(;n;){if(O(e,n))return!0;let t=n.getRootNode();n=t instanceof ShadowRoot?t.host:null}return!1}function Pi(e,t){let n=e;for(;n;){let e=n.closest(t);if(e)return e;let r=n.getRootNode();n=r instanceof ShadowRoot?r.host:null}return null}var Fi=`interactOutside.pointerDownOutside`,Ii=`interactOutside.focusOutside`;function Li(t,n){let r,a=xe,o=()=>j(n()),s=e=>t.onPointerDownOutside?.(e),c=e=>t.onFocusOutside?.(e),l=e=>t.onInteractOutside?.(e),u=e=>{let r=Mi(e);return!r||Pi(r,`[data-kb-top-layer]`)||!Ni(o(),r)||Ni(n(),r)?!1:!t.shouldExcludeElement?.(r)},d=e=>{function t(){let t=n(),r=Mi(e);if(!t||!r||!u(e))return;let i=z([s,l]);r.addEventListener(Fi,i,{once:!0});let a=new CustomEvent(Fi,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:e.button===2||ne(e)&&e.button===0}});r.dispatchEvent(a)}e.pointerType===`touch`?(o().removeEventListener(`click`,t),a=t,o().addEventListener(`click`,t,{once:!0})):t()},f=e=>{let t=n(),r=Mi(e);if(!t||!r||!u(e))return;let i=z([c,l]);r.addEventListener(Ii,i,{once:!0});let a=new CustomEvent(Ii,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(a)};e.U(()=>{i(t.isDisabled)||(r=window.setTimeout(()=>{o().addEventListener(`pointerdown`,d,!0)},0),o().addEventListener(`focusin`,f,!0),e.et(()=>{window.clearTimeout(r),o().removeEventListener(`click`,a),o().removeEventListener(`pointerdown`,d,!0),o().removeEventListener(`focusin`,f,!0)}))})}var Ri=e.H();function zi(){return e.it(Ri)}function Bi(t){let n,r=zi(),[i,a]=e.nt(t,[`ref`,`disableOutsidePointerEvents`,`excludedElements`,`onEscapeKeyDown`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onDismiss`,`bypassTopMostLayerCheck`]),o=/* @__PURE__ */ new Set([]),s=e=>{o.add(e);let t=r?.registerNestedLayer(e);return()=>{o.delete(e),t?.()}};Li({shouldExcludeElement:e=>n?i.excludedElements?.some(t=>O(t(),e))||[...o].some(t=>O(t,e)):!1,onPointerDownOutside:e=>{n&&!G.isBelowPointerBlockingLayer(n)&&(i.bypassTopMostLayerCheck||G.isTopMostLayer(n))&&(i.onPointerDownOutside?.(e),i.onInteractOutside?.(e),e.defaultPrevented||i.onDismiss?.())},onFocusOutside:e=>{i.onFocusOutside?.(e),i.onInteractOutside?.(e),e.defaultPrevented||i.onDismiss?.()}},()=>n),ji({ownerDocument:()=>j(n),onEscapeKeyDown:e=>{n&&G.isTopMostLayer(n)&&(i.onEscapeKeyDown?.(e),!e.defaultPrevented&&i.onDismiss&&(e.preventDefault(),i.onDismiss()))}}),e.tt(()=>{if(!n)return;G.addLayer({node:n,isPointerBlocking:i.disableOutsidePointerEvents,dismiss:i.onDismiss});let t=r?.registerNestedLayer(n);G.assignPointerEventToLayers(),G.disableBodyPointerEvents(n),e.et(()=>{n&&(G.removeLayer(n),t?.(),G.assignPointerEventToLayers(),G.restoreBodyPointerEvents(n))})}),e.U(e.$([()=>n,()=>i.disableOutsidePointerEvents],([t,n])=>{if(!t)return;let r=G.find(t);r&&r.isPointerBlocking!==n&&(r.isPointerBlocking=n,G.assignPointerEventToLayers()),n&&G.disableBodyPointerEvents(t),e.et(()=>{G.restoreBodyPointerEvents(t)})},{defer:!0}));let c={registerNestedLayer:s};return e.B(Ri.Provider,{value:c,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)}},a))}})}function Vi(e={}){let[t,n]=qe({value:()=>i(e.open),defaultValue:()=>!!i(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},a=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:a,toggle:()=>{t()?a():r()}}}var Hi=[`id`,`name`,`validationState`,`required`,`disabled`,`readOnly`];function Ui(t){let n=H({id:`form-control-${e.J()}`},t),[r,a]=e.q(),[o,s]=e.q(),[c,l]=e.q(),[u,d]=e.q();return{formControlContext:{name:()=>i(n.name)??i(n.id),dataset:e.W(()=>({"data-valid":i(n.validationState)===`valid`?``:void 0,"data-invalid":i(n.validationState)===`invalid`?``:void 0,"data-required":i(n.required)?``:void 0,"data-disabled":i(n.disabled)?``:void 0,"data-readonly":i(n.readOnly)?``:void 0})),validationState:()=>i(n.validationState),isRequired:()=>i(n.required),isDisabled:()=>i(n.disabled),isReadOnly:()=>i(n.readOnly),labelId:r,fieldId:o,descriptionId:c,errorMessageId:u,getAriaLabelledBy:(e,t,n)=>{let i=n!=null||r()!=null;return[n,r(),i&&t!=null?e:void 0].filter(Boolean).join(` `)||void 0},getAriaDescribedBy:e=>[c(),u(),e].filter(Boolean).join(` `)||void 0,generateId:D(()=>i(n.id)),registerLabel:Yt(a),registerField:Yt(s),registerDescription:Yt(l),registerErrorMessage:Yt(d)}}}var Wi=e.H();function Gi(){let t=e.it(Wi);if(t===void 0)throw Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return t}function Ki(t){let n=Gi(),r=H({id:n.generateId(`description`)},t);return e.U(()=>e.et(n.registerDescription(r.id))),e.B(U,e.Q({as:`div`},()=>n.dataset(),r))}var qi=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight),i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i==null?null:this.getItem(i);return i}getKeyPageBelow(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight),i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i==null?null:this.getItem(i);return i}getKeyForSearch(e,t){let n=this.collator?.();if(!n)return;let r=t==null?this.getFirstKey():this.getKeyBelow(t);for(;r!=null;){let t=this.collection().getItem(r);if(t){let i=t.textValue.slice(0,e.length);if(t.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function Ji(t,n,r){let a=Ge({usage:`search`,sensitivity:`base`});return at({selectionManager:()=>i(t.selectionManager),keyboardDelegate:e.W(()=>i(t.keyboardDelegate)||new qi(t.collection,n,a)),autoFocus:()=>i(t.autoFocus),deferAutoFocus:()=>i(t.deferAutoFocus),shouldFocusWrap:()=>i(t.shouldFocusWrap),disallowEmptySelection:()=>i(t.disallowEmptySelection),selectOnFocus:()=>i(t.selectOnFocus),disallowTypeAhead:()=>i(t.disallowTypeAhead),shouldUseVirtualFocus:()=>i(t.shouldUseVirtualFocus),allowsTabNavigation:()=>i(t.allowsTabNavigation),isVirtualized:()=>i(t.isVirtualized),scrollToKey:e=>i(t.scrollToKey)?.(e),orientation:()=>i(t.orientation)},n,r)}var Yi=`focusScope.autoFocusOnMount`,Xi=`focusScope.autoFocusOnUnmount`,Zi={bubbles:!1,cancelable:!0},Qi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=C(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=C(this.stack,e),this.active()?.resume()}};function $i(t,n){let[r,a]=e.q(!1),o={pause(){a(!0)},resume(){a(!1)}},s=null,c=e=>t.onMountAutoFocus?.(e),l=e=>t.onUnmountAutoFocus?.(e),u=()=>j(n()),d=()=>{let e=u().createElement(`span`);return e.setAttribute(`data-focus-trap`,``),e.tabIndex=0,Object.assign(e.style,ke),e},f=()=>{let e=n();return e?ue(e,!0).filter(e=>!e.hasAttribute(`data-focus-trap`)):[]},p=()=>{let e=f();return e.length>0?e[0]:null},m=()=>{let e=f();return e.length>0?e[e.length-1]:null},h=()=>{let e=n();if(!e)return!1;let t=k(e);return!t||O(e,t)?!1:fe(t)};e.U(()=>{let t=n();if(!t)return;Qi.add(o);let r=k(t);if(!O(t,r)){let e=new CustomEvent(Yi,Zi);t.addEventListener(Yi,c),t.dispatchEvent(e),e.defaultPrevented||setTimeout(()=>{B(p()),k(t)===r&&B(t)},0)}e.et(()=>{t.removeEventListener(Yi,c),setTimeout(()=>{let e=new CustomEvent(Xi,Zi);h()&&e.preventDefault(),t.addEventListener(Xi,l),t.dispatchEvent(e),e.defaultPrevented||B(r??u().body),t.removeEventListener(Xi,l),Qi.remove(o)},0)})}),e.U(()=>{let a=n();if(!a||!i(t.trapFocus)||r())return;let o=e=>{let t=e.target;t?.closest(`[data-kb-top-layer]`)||(O(a,t)?s=t:B(s))},c=e=>{let t=e.relatedTarget??k(a);t?.closest(`[data-kb-top-layer]`)||O(a,t)||B(s)};u().addEventListener(`focusin`,o),u().addEventListener(`focusout`,c),e.et(()=>{u().removeEventListener(`focusin`,o),u().removeEventListener(`focusout`,c)})}),e.U(()=>{let a=n();if(!a||!i(t.trapFocus)||r())return;let o=d();a.insertAdjacentElement(`afterbegin`,o);let s=d();a.insertAdjacentElement(`beforeend`,s);function c(e){let t=p(),n=m();e.relatedTarget===t?B(n):B(t)}o.addEventListener(`focusin`,c),s.addEventListener(`focusin`,c);let l=new MutationObserver(e=>{for(let t of e)t.previousSibling===s&&(s.remove(),a.insertAdjacentElement(`beforeend`,s)),t.nextSibling===o&&(o.remove(),a.insertAdjacentElement(`afterbegin`,o))});l.observe(a,{childList:!0,subtree:!1}),e.et(()=>{o.removeEventListener(`focusin`,c),s.removeEventListener(`focusin`,c),o.remove(),s.remove(),l.disconnect()})})}var ea=`data-live-announcer`;function ta(t){e.U(()=>{i(t.isDisabled)||e.et(ia(i(t.targets),i(t.root)))})}var na=/* @__PURE__ */ new WeakMap,ra=[];function ia(e,t=document.body){let n=new Set(e),r=/* @__PURE__ */ new Set,i=e=>{for(let t of e.querySelectorAll(`[${ea}], [${Dt}]`))n.add(t);let t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),o=t(e);if(o===NodeFilter.FILTER_ACCEPT&&a(e),o!==NodeFilter.FILTER_REJECT){let e=i.nextNode();for(;e!=null;)a(e),e=i.nextNode()}},a=e=>{let t=na.get(e)??0;(e.getAttribute(`aria-hidden`)!==`true`||t!==0)&&(t===0&&setTimeout(()=>requestAnimationFrame(()=>e.setAttribute(`aria-hidden`,`true`))),r.add(e),na.set(e,t+1))};ra.length&&ra[ra.length-1].disconnect(),i(t);let o=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`&&t.addedNodes.length!==0&&![...n,...r].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&(e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer===`true`)?n.add(e):e instanceof Element&&i(e)}});o.observe(t,{childList:!0,subtree:!0});let s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return ra.push(s),()=>{o.disconnect();for(let e of r){let t=na.get(e);if(t==null)return;t===1?setTimeout(()=>requestAnimationFrame(()=>{let t=na.get(e);t===1?(e.removeAttribute(`aria-hidden`),na.delete(e)):t!=null&&t>1&&na.set(e,t-1)})):na.set(e,t-1)}s===ra[ra.length-1]?(ra.pop(),ra.length&&ra[ra.length-1].observe()):ra.splice(ra.indexOf(s),1)}}function aa(t){let n,r=Gi(),i=H({id:r.generateId(`label`)},t),[a,o]=e.nt(i,[`ref`]),s=Ut(()=>n,()=>`label`);return e.U(()=>e.et(r.registerLabel(o.id))),e.B(U,e.Q({as:`label`,ref(e){let t=v(e=>n=e,a.ref);typeof t==`function`&&t(e)},get for(){return e.T(()=>s()===`label`)()?r.fieldId():void 0}},()=>r.dataset(),o))}function oa(t,n){e.U(e.$(t,t=>{if(t==null)return;let r=sa(t);r!=null&&(r.addEventListener(`reset`,n,{passive:!0}),e.et(()=>{r.removeEventListener(`reset`,n)}))}))}function sa(e){return ca(e)?e.form:e.closest(`form`)}function ca(e){return e.matches(`textarea, input, select, button`)}function la(t){let n=Gi(),r=H({id:n.generateId(`error-message`)},t),[i,a]=e.nt(r,[`forceMount`]),o=()=>n.validationState()===`invalid`;return e.U(()=>{o()&&e.et(n.registerErrorMessage(a.id))}),e.B(e.L,{get when(){return i.forceMount||o()},get children(){return e.B(U,e.Q({as:`div`},()=>n.dataset(),a))}})}var ua=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},da=/* @__PURE__ */ new Map,fa=t=>{e.U(()=>{let n=W(t.style)??{},r=W(t.properties)??[],i={};for(let e in n)i[e]=t.element.style[e];let a=da.get(t.key);a?a.activeCount++:da.set(t.key,{activeCount:1,originalStyles:i,properties:r.map(e=>e.key)}),Object.assign(t.element.style,t.style);for(let e of r)t.element.style.setProperty(e.key,e.value);e.et(()=>{let e=da.get(t.key);if(e){if(e.activeCount!==1)e.activeCount--;else{da.delete(t.key);for(let[n,r]of Object.entries(e.originalStyles))t.element.style[n]=r;for(let n of e.properties)t.element.style.removeProperty(n);t.element.style.length===0&&t.element.removeAttribute(`style`),t.cleanup?.()}}})})},pa=(e,t)=>{switch(t){case`x`:return[e.clientWidth,e.scrollLeft,e.scrollWidth];case`y`:return[e.clientHeight,e.scrollTop,e.scrollHeight]}},ma=(e,t)=>{let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return r===`auto`||r===`scroll`||e.tagName===`HTML`&&r===`visible`},ha=(e,t,n)=>{let r=t===`x`&&window.getComputedStyle(e).direction===`rtl`?-1:1,i=e,a=0,o=0,s=!1;do{let[e,c,l]=pa(i,t),u=l-e-r*c;(c!==0||u!==0)&&ma(i,t)&&(a+=u,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[ga,_a]=e.q([]),va=e=>ga().indexOf(e)===ga().length-1,ya=t=>{let n=e.Q({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:`padding`,restoreScrollPosition:!0,allowPinchZoom:!1},t),r=e.J(),i=[0,0],a=null,o=null;e.U(()=>{W(n.enabled)&&(_a(e=>[...e,r]),e.et(()=>{_a(e=>e.filter(e=>e!==r))}))}),e.U(()=>{if(!W(n.enabled)||!W(n.hideScrollbar))return;let{documentElement:e}=document,t=window.innerWidth-e.clientWidth;if(W(n.preventScrollbarShift)){let r={overflow:`hidden`},i=[];t>0&&(W(n.preventScrollbarShiftMode)===`padding`?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${t}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${t}px)`,i.push({key:`--scrollbar-width`,value:`${t}px`}));let a=window.scrollY,o=window.scrollX;fa({key:`prevent-scroll`,element:e,style:r,properties:i,cleanup:()=>{W(n.restoreScrollPosition)&&t>0&&window.scrollTo(o,a)}})}else fa({key:`prevent-scroll`,element:e,style:{overflow:`hidden`}})}),e.U(()=>{va(r)&&W(n.enabled)&&(document.addEventListener(`wheel`,c,{passive:!1}),document.addEventListener(`touchstart`,s,{passive:!1}),document.addEventListener(`touchmove`,l,{passive:!1}),e.et(()=>{document.removeEventListener(`wheel`,c),document.removeEventListener(`touchstart`,s),document.removeEventListener(`touchmove`,l)}))});let s=e=>{i=xa(e),a=null,o=null},c=e=>{let t=e.target,r=W(n.element),i=ba(e),a=Math.abs(i[0])>Math.abs(i[1])?`x`:`y`,o=Sa(t,a,a===`x`?i[0]:i[1],r),s;s=r&&ua(r,t)?!o:!0,s&&e.cancelable&&e.preventDefault()},l=e=>{let t=W(n.element),r=e.target,s;if(e.touches.length===2)s=!W(n.allowPinchZoom);else{if(a==null||o===null){let t=xa(e).map((e,t)=>i[t]-e),n=Math.abs(t[0])>Math.abs(t[1])?`x`:`y`;a=n,o=n===`x`?t[0]:t[1]}if(r.type===`range`)s=!1;else{let e=Sa(r,a,o,t);s=t&&ua(t,r)?!e:!0}}s&&e.cancelable&&e.preventDefault()}},ba=e=>[e.deltaX,e.deltaY],xa=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Sa=(e,t,n,r)=>{let[i,a]=ha(e,t,r!==null&&ua(r,e)?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(a)<1)},Ca=ya,wa={};Ct(wa,{Description:()=>Ki,ErrorMessage:()=>la,Item:()=>ka,ItemControl:()=>Aa,ItemDescription:()=>ja,ItemIndicator:()=>Ma,ItemInput:()=>Na,ItemLabel:()=>Pa,Label:()=>Fa,RadioGroup:()=>La,Root:()=>Ia,useRadioGroupContext:()=>Ea});var Ta=e.H();function Ea(){let t=e.it(Ta);if(t===void 0)throw Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return t}var Da=e.H();function Oa(){let t=e.it(Da);if(t===void 0)throw Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return t}function ka(t){let n=Gi(),r=Ea(),i=H({id:`${n.generateId(`item`)}-${e.J()}`},t),[a,o]=e.nt(i,[`value`,`disabled`,`onPointerDown`]),[s,c]=e.q(),[l,u]=e.q(),[d,f]=e.q(),[p,m]=e.q(),[h,g]=e.q(!1),_=e.W(()=>r.isDefaultValue(a.value)),v=e.W(()=>r.isSelectedValue(a.value)),y=e.W(()=>a.disabled||n.isDisabled()||!1),b=e=>{R(e,a.onPointerDown),h()&&e.preventDefault()},x=e.W(()=>({...n.dataset(),"data-disabled":y()?``:void 0,"data-checked":v()?``:void 0})),S={value:()=>a.value,dataset:x,isDefault:_,isSelected:v,isDisabled:y,inputId:s,labelId:l,descriptionId:d,inputRef:p,select:()=>r.setSelectedValue(a.value),generateId:D(()=>o.id),registerInput:Yt(c),registerLabel:Yt(u),registerDescription:Yt(f),setIsFocused:g,setInputRef:m};return e.B(Da.Provider,{value:S,get children(){return e.B(U,e.Q({as:`div`,role:`group`,onPointerDown:b},x,o))}})}function Aa(t){let n=Oa(),r=H({id:n.generateId(`control`)},t),[i,a]=e.nt(r,[`onClick`,`onKeyDown`]);return e.B(U,e.Q({as:`div`,onClick:e=>{R(e,i.onClick),n.select(),n.inputRef()?.focus({preventScroll:!0})},onKeyDown:e=>{R(e,i.onKeyDown),e.key===N.Space&&(n.select(),n.inputRef()?.focus({preventScroll:!0}))}},()=>n.dataset(),a))}function ja(t){let n=Oa(),r=H({id:n.generateId(`description`)},t);return e.U(()=>e.et(n.registerDescription(r.id))),e.B(U,e.Q({as:`div`},()=>n.dataset(),r))}function Ma(t){let n=Oa(),r=H({id:n.generateId(`indicator`)},t),[i,a]=e.nt(r,[`ref`,`forceMount`]),[o,s]=e.q(),{present:c}=wt({show:()=>i.forceMount||n.isSelected(),element:()=>o()??null});return e.B(e.L,{get when(){return c()},get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(s,i.ref);typeof t==`function`&&t(e)}},()=>n.dataset(),a))}})}function Na(t){let n=Gi(),r=Ea(),i=Oa(),a=H({id:i.generateId(`input`)},t),[o,s]=e.nt(a,[`ref`,`style`,`aria-labelledby`,`aria-describedby`,`onChange`,`onFocus`,`onBlur`]),c=()=>[o[`aria-labelledby`],i.labelId(),o[`aria-labelledby`]!=null&&s[`aria-label`]!=null?s.id:void 0].filter(Boolean).join(` `)||void 0,l=()=>[o[`aria-describedby`],i.descriptionId(),r.ariaDescribedBy()].filter(Boolean).join(` `)||void 0,[u,d]=e.q(!1);return e.U(e.$([()=>i.isSelected(),()=>i.value()],e=>{if(!e[0]&&e[1]===i.value())return;d(!0);let t=i.inputRef();t?.dispatchEvent(new Event(`input`,{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0}))},{defer:!0})),e.U(()=>e.et(i.registerInput(s.id))),e.B(U,e.Q({as:`input`,ref(e){let t=v(i.setInputRef,o.ref);typeof t==`function`&&t(e)},type:`radio`,get name(){return n.name()},get value(){return i.value()},get checked(){return i.isSelected()},get required(){return n.isRequired()},get disabled(){return i.isDisabled()},get readonly(){return n.isReadOnly()},get style(){return _({...ke},o.style)},get"aria-labelledby"(){return c()},get"aria-describedby"(){return l()},onChange:e=>{if(R(e,o.onChange),e.stopPropagation(),!u()){r.setSelectedValue(i.value());let t=e.target;t.checked=i.isSelected()}d(!1)},onFocus:e=>{R(e,o.onFocus),i.setIsFocused(!0)},onBlur:e=>{R(e,o.onBlur),i.setIsFocused(!1)}},()=>i.dataset(),s))}function Pa(t){let n=Oa(),r=H({id:n.generateId(`label`)},t);return e.U(()=>e.et(n.registerLabel(r.id))),e.B(U,e.Q({as:`label`,get for(){return n.inputId()}},()=>n.dataset(),r))}function Fa(t){return e.B(aa,e.Q({as:`span`},t))}function Ia(t){let n,r=H({id:`radiogroup-${e.J()}`,orientation:`vertical`},t),[a,o,s]=e.nt(r,[`ref`,`value`,`defaultValue`,`onChange`,`orientation`,`aria-labelledby`,`aria-describedby`],Hi),[c,l]=Ke({value:()=>a.value,defaultValue:()=>a.defaultValue,onChange:e=>a.onChange?.(e)}),{formControlContext:u}=Ui(o);oa(()=>n,()=>l(a.defaultValue??``));let d=()=>u.getAriaLabelledBy(i(o.id),s[`aria-label`],a[`aria-labelledby`]),f=()=>u.getAriaDescribedBy(a[`aria-describedby`]),p=e=>e===t.defaultValue,m=e=>e===c(),h={ariaDescribedBy:f,isDefaultValue:p,isSelectedValue:m,setSelectedValue:e=>{if(!(u.isReadOnly()||u.isDisabled())&&(l(e),n))for(let e of n.querySelectorAll(`[type='radio']`)){let t=e;t.checked=m(t.value)}}};return e.B(Wi.Provider,{value:u,get children(){return e.B(Ta.Provider,{value:h,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,a.ref);typeof t==`function`&&t(e)},role:`radiogroup`,get id(){return i(o.id)},get"aria-invalid"(){return u.validationState()===`invalid`||void 0},get"aria-required"(){return u.isRequired()||void 0},get"aria-disabled"(){return u.isDisabled()||void 0},get"aria-readonly"(){return u.isReadOnly()||void 0},get"aria-orientation"(){return a.orientation},get"aria-labelledby"(){return d()},get"aria-describedby"(){return f()}},()=>u.dataset(),s))}})}})}var La=Object.assign(Ia,{Description:Ki,ErrorMessage:la,Item:ka,ItemControl:Aa,ItemDescription:ja,ItemIndicator:Ma,ItemInput:Na,ItemLabel:Pa,Label:Fa}),Ra=e.H();function za(){return e.it(Ra)}var Ba=e.H();function Va(){return e.it(Ba)}var Ha=e.H();function Ua(){return e.it(Ha)}function Wa(){let e=Ua();if(e===void 0)throw Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Ga=e.H();function Ka(){let t=e.it(Ga);if(t===void 0)throw Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return t}function qa(e,t,n){let r=e.split(`-`)[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case`top`:a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case`right`:a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case`bottom`:a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case`left`:a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top])}return a}function Ja(e,t){return t?Se([e.clientX,e.clientY],t):!1}function Ya(t){let n=Ka(),r=dt(),i=Ua(),a=za(),o=Va(),s=H({placement:n.orientation()===`horizontal`?`bottom-start`:`right-start`},t),[c,l]=e.nt(s,[`open`,`defaultOpen`,`onOpenChange`]),u=0,d=null,f=`right`,[p,m]=e.q(),[h,g]=e.q(),[_,v]=e.q(),[y,b]=e.q(),[x,S]=e.q(!0),[w,T]=e.q(l.placement),[E,D]=e.q([]),[O,k]=e.q([]),{DomCollectionProvider:A}=bt({items:O,onItemsChange:k}),j=Vi({open:()=>c.open,defaultOpen:()=>c.defaultOpen,onOpenChange:e=>c.onOpenChange?.(e)}),{present:M}=wt({show:()=>n.forceMount()||j.isOpen(),element:()=>y()??null}),N=lt({selectionMode:`none`,dataSource:O}),P=e=>{S(e),j.open()},F=(e=!1)=>{j.close(),e&&i&&i.close(!0)},ee=e=>{S(e),j.toggle()},I=()=>{let e=y();e&&(B(e),N.selectionManager().setFocused(!0),N.selectionManager().setFocusedKey(void 0))},L=()=>{o==null?I():setTimeout(()=>I())},te=e=>{D(t=>[...t,e]);let t=i?.registerNestedMenu(e);return()=>{D(t=>C(t,e)),t?.()}},R=e=>f===d?.side&&Ja(e,d?.area),z=e=>{R(e)&&e.preventDefault()},ne=e=>{R(e)||L()},V=e=>{R(e)&&e.preventDefault()};ta({isDisabled:()=>!(i==null&&j.isOpen()&&n.isModal()),targets:()=>[y(),...E()].filter(Boolean)}),e.U(()=>{let t=y();if(!t||!i)return;let n=i.registerNestedMenu(t);e.et(()=>{n()})}),e.U(()=>{i===void 0&&a?.registerMenu(n.value(),[y(),...E()])}),e.U(()=>{i===void 0&&a!==void 0&&(a.value()===n.value()?(_()?.focus(),a.autoFocusMenu()&&P(!0)):F())}),e.U(()=>{i===void 0&&a!==void 0&&j.isOpen()&&a.setValue(n.value())}),e.et(()=>{i===void 0&&a?.unregisterMenu(n.value())});let re={dataset:e.W(()=>({"data-expanded":j.isOpen()?``:void 0,"data-closed":j.isOpen()?void 0:``})),isOpen:j.isOpen,contentPresent:M,nestedMenus:E,currentPlacement:w,pointerGraceTimeoutId:()=>u,autoFocus:x,listState:()=>N,parentMenuContext:()=>i,triggerRef:_,contentRef:y,triggerId:p,contentId:h,setTriggerRef:v,setContentRef:b,open:P,close:F,toggle:ee,focusContent:L,onItemEnter:z,onItemLeave:ne,onTriggerLeave:V,setPointerDir:e=>f=e,setPointerGraceTimeoutId:e=>u=e,setPointerGraceIntent:e=>d=e,registerNestedMenu:te,registerItemToParentDomCollection:r?.registerItem,registerTriggerId:Yt(m),registerContentId:Yt(g)};return e.B(A,{get children(){return e.B(Ha.Provider,{value:re,get children(){return e.B(e.L,{when:o===void 0,get fallback(){return l.children},get children(){return e.B(Ai,e.Q({anchorRef:_,contentRef:y,onCurrentPlacementChange:T},l))}})}})}})}var Xa=e.H();function Za(){let t=e.it(Xa);if(t===void 0)throw Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return t}function Qa(t){let n,r=Ka(),i=Wa(),a=H({id:r.generateId(`item-${e.J()}`)},t),[o,s]=e.nt(a,[`ref`,`textValue`,`disabled`,`closeOnSelect`,`checked`,`indeterminate`,`onSelect`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),[c,l]=e.q(),[u,d]=e.q(),[f,p]=e.q(),m=()=>i.listState().selectionManager(),h=()=>s.id,g=()=>m().focusedKey()===h(),_=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{i.close(!0)},1)};xt({getItem:()=>({ref:()=>n,type:`item`,key:h(),textValue:o.textValue??f()?.textContent??n?.textContent??``,disabled:o.disabled??!1})});let y=ot({key:h,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>n),b=e=>{R(e,o.onPointerMove),e.pointerType===`mouse`&&(o.disabled?i.onItemLeave(e):(i.onItemEnter(e),e.defaultPrevented||(B(e.currentTarget),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(h()))))},x=e=>{R(e,o.onPointerLeave),e.pointerType===`mouse`&&i.onItemLeave(e)},S=e=>{R(e,o.onPointerUp),!o.disabled&&e.button===0&&_()},C=e=>{if(R(e,o.onKeyDown),!e.repeat&&!o.disabled)switch(e.key){case`Enter`:case` `:_()}},w=e.W(()=>{if(o.indeterminate)return`mixed`;if(o.checked!=null)return o.checked}),T=e.W(()=>({"data-indeterminate":o.indeterminate?``:void 0,"data-checked":o.checked&&!o.indeterminate?``:void 0,"data-disabled":o.disabled?``:void 0,"data-highlighted":g()?``:void 0})),E={isChecked:()=>o.checked,dataset:T,setLabelRef:p,generateId:D(()=>s.id),registerLabel:Yt(l),registerDescription:Yt(d)};return e.B(Xa.Provider,{value:E,get children(){return e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>n=e,o.ref);typeof t==`function`&&t(e)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return c()},get"aria-describedby"(){return u()},get"data-key"(){return y.dataKey()},get onPointerDown(){return z([o.onPointerDown,y.onPointerDown])},get onPointerUp(){return z([S,y.onPointerUp])},get onClick(){return z([o.onClick,y.onClick])},get onKeyDown(){return z([C,y.onKeyDown])},get onMouseDown(){return z([o.onMouseDown,y.onMouseDown])},get onFocus(){return z([o.onFocus,y.onFocus])},onPointerMove:b,onPointerLeave:x},T,s))}})}function $a(t){let n=H({closeOnSelect:!1},t),[r,i]=e.nt(n,[`checked`,`defaultChecked`,`onChange`,`onSelect`]),a=bn({isSelected:()=>r.checked,defaultIsSelected:()=>r.defaultChecked,onSelectedChange:e=>r.onChange?.(e),isDisabled:()=>i.disabled});return e.B(Qa,e.Q({role:`menuitemcheckbox`,get checked(){return a.isSelected()},onSelect:()=>{r.onSelect?.(),a.toggle()}},i))}var eo={next:(e,t)=>e===`ltr`?t===`horizontal`?`ArrowRight`:`ArrowDown`:t===`horizontal`?`ArrowLeft`:`ArrowUp`,previous:(e,t)=>eo.next(e===`ltr`?`rtl`:`ltr`,t)},to={first:e=>e===`horizontal`?`ArrowDown`:`ArrowRight`,last:e=>e===`horizontal`?`ArrowUp`:`ArrowLeft`};function no(t){let n=Ka(),r=Wa(),i=za(),{direction:a}=Ue(),o=H({id:n.generateId(`trigger`)},t),[s,c]=e.nt(o,[`ref`,`id`,`disabled`,`onPointerDown`,`onClick`,`onKeyDown`,`onMouseOver`,`onFocus`]),l=()=>n.value();i!==void 0&&(l=()=>n.value()??s.id,i.lastValue()===void 0&&i.setLastValue(l));let u=Ut(()=>r.triggerRef(),()=>`button`),d=e.W(()=>u()===`a`&&r.triggerRef()?.getAttribute(`href`)!=null);e.U(e.$(()=>i?.value(),e=>{d()&&e===l()&&r.triggerRef()?.focus()}));let f=()=>{i===void 0?r.toggle(!0):r.isOpen()?i.value()===l()&&i.closeMenu():(i.autoFocusMenu()||i.setAutoFocusMenu(!0),r.open(!1))};return e.U(()=>e.et(r.registerTriggerId(s.id))),e.B(qt,e.Q({ref(e){let t=v(r.setTriggerRef,s.ref);typeof t==`function`&&t(e)},get"data-kb-menu-value-trigger"(){return n.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":`true`,get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return e.T(()=>!!r.isOpen())()?r.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&i?.value()===l()||void 0},get tabIndex(){return i===void 0?void 0:i.value()===l()||i.lastValue()===l()?0:-1},onPointerDown:e=>{R(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,!s.disabled&&e.pointerType!==`touch`&&e.button===0&&f()},onMouseOver:e=>{R(e,s.onMouseOver),r.triggerRef()?.dataset.pointerType!==`touch`&&!s.disabled&&i!==void 0&&i.value()!==void 0&&i.setValue(l)},onClick:e=>{R(e,s.onClick),s.disabled||e.currentTarget.dataset.pointerType===`touch`&&f()},onKeyDown:e=>{if(R(e,s.onKeyDown),!s.disabled){if(d())switch(e.key){case`Enter`:case` `:return}switch(e.key){case`Enter`:case` `:case to.first(n.orientation()):e.stopPropagation(),e.preventDefault(),Oe(e.currentTarget),r.open(`first`),i?.setAutoFocusMenu(!0),i?.setValue(l);break;case to.last(n.orientation()):e.stopPropagation(),e.preventDefault(),r.open(`last`);break;case eo.next(a(),n.orientation()):if(i===void 0)break;e.stopPropagation(),e.preventDefault(),i.nextMenu();break;case eo.previous(a(),n.orientation()):if(i===void 0)break;e.stopPropagation(),e.preventDefault(),i.previousMenu()}}},onFocus:e=>{R(e,s.onFocus),i!==void 0&&e.currentTarget.dataset.pointerType!==`touch`&&i.setValue(l)},role:i===void 0?void 0:`menuitem`},()=>r.dataset(),c))}function ro(t){let n,r=Ka(),i=Wa(),a=za(),o=Va(),{direction:s}=Ue(),c=H({id:r.generateId(`content-${e.J()}`)},t),[l,u]=e.nt(c,[`ref`,`id`,`style`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeyDown`,`onFocusOutside`,`onPointerEnter`,`onPointerMove`,`onKeyDown`,`onMouseDown`,`onFocusIn`,`onFocusOut`]),d=0,f=()=>i.parentMenuContext()==null&&a===void 0&&r.isModal(),p=Ji({selectionManager:i.listState().selectionManager,collection:i.listState().collection,autoFocus:i.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!i.listState().selectionManager().isFocused(),orientation:()=>r.orientation()===`horizontal`?`vertical`:`horizontal`},()=>n);$i({trapFocus:()=>f()&&i.isOpen(),onMountAutoFocus:e=>{a===void 0&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>n);let m=e=>{if(O(e.currentTarget,e.target)&&(e.key===`Tab`&&i.isOpen()&&e.preventDefault(),a!==void 0&&e.currentTarget.getAttribute(`aria-haspopup`)!==`true`))switch(e.key){case eo.next(s(),r.orientation()):e.stopPropagation(),e.preventDefault(),i.close(!0),a.setAutoFocusMenu(!0),a.nextMenu();break;case eo.previous(s(),r.orientation()):if(e.currentTarget.hasAttribute(`data-closed`))break;e.stopPropagation(),e.preventDefault(),i.close(!0),a.setAutoFocusMenu(!0),a.previousMenu()}},h=e=>{l.onEscapeKeyDown?.(e),a?.setAutoFocusMenu(!1),i.close(!0)},g=e=>{l.onFocusOutside?.(e),r.isModal()&&e.preventDefault()},y=e=>{R(e,l.onPointerEnter),i.isOpen()&&(i.parentMenuContext()?.listState().selectionManager().setFocused(!1),i.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=e=>{if(R(e,l.onPointerMove),e.pointerType!==`mouse`)return;let t=e.target,n=d!==e.clientX;O(e.currentTarget,t)&&n&&(i.setPointerDir(e.clientX>d?`right`:`left`),d=e.clientX)};e.U(()=>e.et(i.registerContentId(l.id))),e.et(()=>i.setContentRef(void 0));let x={ref:v(e=>{i.setContentRef(e),n=e},l.ref),role:`menu`,get id(){return l.id},get tabIndex(){return p.tabIndex()},get"aria-labelledby"(){return i.triggerId()},onKeyDown:z([l.onKeyDown,p.onKeyDown,m]),onMouseDown:z([l.onMouseDown,p.onMouseDown]),onFocusIn:z([l.onFocusIn,p.onFocusIn]),onFocusOut:z([l.onFocusOut,p.onFocusOut]),onPointerEnter:y,onPointerMove:b,get"data-orientation"(){return r.orientation()}};return e.B(e.L,{get when(){return i.contentPresent()},get children(){return e.B(e.L,{get when(){return o===void 0||i.parentMenuContext()!=null},get fallback(){return e.B(U,e.Q({as:`div`},()=>i.dataset(),x,u))},get children(){return e.B(Ai.Positioner,{get children(){return e.B(Bi,e.Q({get disableOutsidePointerEvents(){return e.T(()=>!!f())()&&i.isOpen()},get excludedElements(){return[i.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return _({"--kb-menu-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},l.style)},onEscapeKeyDown:h,onFocusOutside:g,get onDismiss(){return i.close}},()=>i.dataset(),x,u))}})}})}})}function io(t){let n,r=Ka(),i=Wa(),[a,o]=e.nt(t,[`ref`]);return Ca({element:()=>n??null,enabled:()=>i.contentPresent()&&r.preventScroll()}),e.B(ro,e.Q({ref(e){let t=v(e=>{n=e},a.ref);typeof t==`function`&&t(e)}},o))}var ao=e.H();function oo(){let t=e.it(ao);if(t===void 0)throw Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return t}function so(t){let n=H({id:Ka().generateId(`group-${e.J()}`)},t),[r,i]=e.q(),a={generateId:D(()=>n.id),registerLabelId:Yt(i)};return e.B(ao.Provider,{value:a,get children(){return e.B(U,e.Q({as:`div`,role:`group`,get"aria-labelledby"(){return r()}},n))}})}function co(t){let n=oo(),r=H({id:n.generateId(`label`)},t),[i,a]=e.nt(r,[`id`]);return e.U(()=>e.et(n.registerLabelId(i.id))),e.B(U,e.Q({as:`span`,get id(){return i.id},"aria-hidden":`true`},a))}function lo(t){let n=Wa(),r=H({children:`▼`},t);return e.B(U,e.Q({as:`span`,"aria-hidden":`true`},()=>n.dataset(),r))}function uo(t){return e.B(Qa,e.Q({role:`menuitem`,closeOnSelect:!0},t))}function fo(t){let n=Za(),r=H({id:n.generateId(`description`)},t),[i,a]=e.nt(r,[`id`]);return e.U(()=>e.et(n.registerDescription(i.id))),e.B(U,e.Q({as:`div`,get id(){return i.id}},()=>n.dataset(),a))}function po(t){let n=Za(),r=H({id:n.generateId(`indicator`)},t),[i,a]=e.nt(r,[`forceMount`]);return e.B(e.L,{get when(){return i.forceMount||n.isChecked()},get children(){return e.B(U,e.Q({as:`div`},()=>n.dataset(),a))}})}function mo(t){let n=Za(),r=H({id:n.generateId(`label`)},t),[i,a]=e.nt(r,[`ref`,`id`]);return e.U(()=>e.et(n.registerLabel(i.id))),e.B(U,e.Q({as:`div`,ref(e){let t=v(n.setLabelRef,i.ref);typeof t==`function`&&t(e)},get id(){return i.id}},()=>n.dataset(),a))}function ho(t){let n=Wa();return e.B(e.L,{get when(){return n.contentPresent()},get children(){return e.B(e.y,t)}})}var go=e.H();function _o(){let t=e.it(go);if(t===void 0)throw Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return t}function vo(t){let n=H({id:Ka().generateId(`radiogroup-${e.J()}`)},t),[r,i]=e.nt(n,[`value`,`defaultValue`,`onChange`,`disabled`]),[a,o]=Ke({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)});return e.B(go.Provider,{value:{isDisabled:()=>r.disabled,isSelectedValue:e=>e===a(),setSelectedValue:e=>o(e)},get children(){return e.B(so,i)}})}function yo(t){let n=_o(),r=H({closeOnSelect:!1},t),[i,a]=e.nt(r,[`value`,`onSelect`]);return e.B(Qa,e.Q({role:`menuitemradio`,get checked(){return n.isSelectedValue(i.value)},onSelect:()=>{i.onSelect?.(),n.setSelectedValue(i.value)}},a))}function bo(t){let n=za(),r=H({id:`menu-${e.J()}`,modal:!0},t),[i,a]=e.nt(r,[`id`,`modal`,`preventScroll`,`forceMount`,`open`,`defaultOpen`,`onOpenChange`,`value`,`orientation`]),o=Vi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:e=>i.onOpenChange?.(e)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:D(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??n?.orientation()??`horizontal`};return e.B(Ga.Provider,{value:s,get children(){return e.B(Ya,e.Q({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}function xo(t){let{direction:n}=Ue();return e.B(Ya,e.Q({get placement(){return n()===`rtl`?`left-start`:`right-start`},flip:!0},t))}var So={close:(e,t)=>e===`ltr`?[t===`horizontal`?`ArrowLeft`:`ArrowUp`]:[t===`horizontal`?`ArrowRight`:`ArrowDown`]};function Co(t){let n=Wa(),r=Ka(),[i,a]=e.nt(t,[`onFocusOutside`,`onKeyDown`]),{direction:o}=Ue();return e.B(ro,e.Q({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{i.onFocusOutside?.(e);let t=e.target;O(n.triggerRef(),t)||n.close()},onKeyDown:e=>{R(e,i.onKeyDown);let t=O(e.currentTarget,e.target),a=So.close(o(),r.orientation()).includes(e.key),s=n.parentMenuContext()!=null;t&&a&&s&&(n.close(),B(n.triggerRef()))}},a))}var wo=[`Enter`,` `],To={open:(e,t)=>e===`ltr`?[...wo,t===`horizontal`?`ArrowRight`:`ArrowDown`]:[...wo,t===`horizontal`?`ArrowLeft`:`ArrowUp`]};function Eo(t){let n,r=Ka(),i=Wa(),a=H({id:r.generateId(`sub-trigger-${e.J()}`)},t),[o,s]=e.nt(a,[`ref`,`id`,`textValue`,`disabled`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),c=null,l=()=>{c&&window.clearTimeout(c),c=null},{direction:u}=Ue(),d=()=>o.id,f=()=>{let e=i.parentMenuContext();if(e==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},p=()=>i.listState().collection(),m=()=>f().focusedKey()===d(),h=ot({key:d,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>n),g=e=>{R(e,o.onClick),!i.isOpen()&&!o.disabled&&i.open(!0)},_=e=>{if(R(e,o.onPointerMove),e.pointerType!==`mouse`)return;let t=i.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(o.disabled?t?.onItemLeave(e):(!i.isOpen()&&!c&&(i.parentMenuContext()?.setPointerGraceIntent(null),c=window.setTimeout(()=>{i.open(!1),l()},100)),t?.onItemEnter(e),e.defaultPrevented||(i.listState().selectionManager().isFocused()&&(i.listState().selectionManager().setFocused(!1),i.listState().selectionManager().setFocusedKey(void 0)),B(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(d()))))},y=e=>{if(R(e,o.onPointerLeave),e.pointerType!==`mouse`)return;l();let t=i.parentMenuContext(),n=i.contentRef();if(n){t?.setPointerGraceIntent({area:qa(i.currentPlacement(),e,n),side:i.currentPlacement().split(`-`)[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());let r=window.setTimeout(()=>{t?.setPointerGraceIntent(null)},300);t?.setPointerGraceTimeoutId(r)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)},b=e=>{R(e,o.onKeyDown),e.repeat||o.disabled||To.open(u(),r.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),f().setFocused(!1),f().setFocusedKey(void 0),i.isOpen()||i.open(`first`),i.focusContent(),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(p().getFirstKey()))};return e.U(()=>{if(i.registerItemToParentDomCollection==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");let t=i.registerItemToParentDomCollection({ref:()=>n,type:`item`,key:d(),textValue:o.textValue??n?.textContent??``,disabled:o.disabled??!1});e.et(t)}),e.U(e.$(()=>i.parentMenuContext()?.pointerGraceTimeoutId(),t=>{e.et(()=>{window.clearTimeout(t),i.parentMenuContext()?.setPointerGraceIntent(null)})})),e.U(()=>e.et(i.registerTriggerId(o.id))),e.et(()=>{l()}),e.B(U,e.Q({as:`div`,ref(e){let t=v(e=>{i.setTriggerRef(e),n=e},o.ref);typeof t==`function`&&t(e)},get id(){return o.id},role:`menuitem`,get tabIndex(){return h.tabIndex()},"aria-haspopup":`true`,get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return e.T(()=>!!i.isOpen())()?i.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return m()?``:void 0},get"data-disabled"(){return o.disabled?``:void 0},get onPointerDown(){return z([o.onPointerDown,h.onPointerDown])},get onPointerUp(){return z([o.onPointerUp,h.onPointerUp])},get onClick(){return z([g,h.onClick])},get onKeyDown(){return z([b,h.onKeyDown])},get onMouseDown(){return z([o.onMouseDown,h.onMouseDown])},get onFocus(){return z([o.onFocus,h.onFocus])},onPointerMove:_,onPointerLeave:y},()=>i.dataset(),s))}Ct({},{Root:()=>Do,Separator:()=>Oo});function Do(t){let n,r=H({orientation:`horizontal`},t),[i,a]=e.nt(r,[`ref`,`orientation`]),o=Ut(()=>n,()=>`hr`);return e.B(U,e.Q({as:`hr`,ref(e){let t=v(e=>n=e,i.ref);typeof t==`function`&&t(e)},get role(){return o()===`hr`?void 0:`separator`},get"aria-orientation"(){return i.orientation===`vertical`?`vertical`:void 0},get"data-orientation"(){return i.orientation}},a))}var Oo=Do,K={};Ct(K,{Arrow:()=>xi,CheckboxItem:()=>$a,Content:()=>ko,DropdownMenu:()=>jo,Group:()=>so,GroupLabel:()=>co,Icon:()=>lo,Item:()=>uo,ItemDescription:()=>fo,ItemIndicator:()=>po,ItemLabel:()=>mo,Portal:()=>ho,RadioGroup:()=>vo,RadioItem:()=>yo,Root:()=>Ao,Separator:()=>Do,Sub:()=>xo,SubContent:()=>Co,SubTrigger:()=>Eo,Trigger:()=>no});function ko(t){let n=Ka(),r=Wa(),[i,a]=e.nt(t,[`onCloseAutoFocus`,`onInteractOutside`]),o=!1;return e.B(io,e.Q({onCloseAutoFocus:e=>{i.onCloseAutoFocus?.(e),o||B(r.triggerRef()),o=!1,e.preventDefault()},onInteractOutside:e=>{i.onInteractOutside?.(e),(!n.isModal()||e.detail.isContextMenu)&&(o=!0)}},a))}function Ao(t){let n=H({id:`dropdownmenu-${e.J()}`},t);return e.B(bo,n)}var jo=Object.assign(Ao,{Arrow:xi,CheckboxItem:$a,Content:ko,Group:so,GroupLabel:co,Icon:lo,Item:uo,ItemDescription:fo,ItemIndicator:po,ItemLabel:mo,Portal:ho,RadioGroup:vo,RadioItem:yo,Separator:Do,Sub:xo,SubContent:Co,SubTrigger:Eo,Trigger:no});function Mo(t){let[n,r]=e.q(),i=t?.throw?(e,t)=>{throw r(e instanceof Error?e:Error(t)),e}:(e,t)=>{r(e instanceof Error?e:Error(t))},a=t?.api?Array.isArray(t.api)?t.api:[t.api]:[globalThis.localStorage].filter(Boolean),o=t?.prefix?`${t.prefix}.`:``,s=/* @__PURE__ */ new Map,c=new Proxy({},{get(n,r){let c=s.get(r);c||(c=e.q(void 0,{equals:!1}),s.set(r,c)),c[0]();let l=a.reduce((e,t)=>{if(e!==null||!t)return e;try{return t.getItem(`${o}${r}`)}catch(e){return i(e,`Error reading ${o}${r} from ${t.name}`),null}},null);return l!==null&&t?.deserializer?t.deserializer(l,r,t.options):l}});return t?.sync!==!1&&e.tt(()=>{let t=e=>{let t=!1;a.forEach(n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(t){i(t,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}}),t&&e.key&&s.get(e.key)?.[1]()};`addEventListener`in globalThis?(globalThis.addEventListener(`storage`,t),e.et(()=>globalThis.removeEventListener(`storage`,t))):(a.forEach(e=>e.addEventListener?.(`storage`,t)),e.et(()=>a.forEach(e=>e.removeEventListener?.(`storage`,t))))}),[c,(e,n,r)=>{let c=t?.serializer?t.serializer(n,e,r??t.options):n,l=`${o}${e}`;a.forEach(t=>{try{t.getItem(l)!==c&&t.setItem(l,c)}catch(n){i(n,`Error setting ${o}${e} to ${c} in ${t.name}`)}});let u=s.get(e);u&&u[1]()},{clear:()=>a.forEach(e=>{try{e.clear()}catch(t){i(t,`Error clearing ${e.name}`)}}),error:n,remove:e=>a.forEach(t=>{try{t.removeItem(`${o}${e}`)}catch(n){i(n,`Error removing ${o}${e} from ${t.name}`)}}),toJSON:()=>{let e={},n=(n,r)=>{if(!e.hasOwnProperty(n)){let i=r&&t?.deserializer?t.deserializer(r,n,t.options):r;i&&(e[n]=i)}};return a.forEach(t=>{if(typeof t.getAll==`function`){let e;try{e=t.getAll()}catch(e){i(e,`Error getting all values from in ${t.name}`)}for(let t of e)n(t,e[t])}else{let r=0,a;try{for(;a=t.key(r++);)e.hasOwnProperty(a)||n(a,t.getItem(a))}catch(e){i(e,`Error getting all values from ${t.name}`)}}}),e}}]}var No=Mo,Po=e=>(typeof e.clear==`function`||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),Fo=e=>{if(!e)return``;let t=``;for(let n in e){if(!e.hasOwnProperty(n))continue;let r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r==`boolean`?`; ${n}`:`; ${n}=${r}`}return t},Io=Po({_cookies:[globalThis.document,`cookie`],getItem:e=>Io._cookies[0][Io._cookies[1]].match(`(^|;)\\s*`+e+`\\s*=\\s*([^;]+)`)?.pop()??null,setItem:(e,t,n)=>{let r=Io.getItem(e);Io._cookies[0][Io._cookies[1]]=`${e}=${t}${Fo(n)}`;let i=Object.assign(new Event(`storage`),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:Io});window.dispatchEvent(i)},removeItem:e=>{Io._cookies[0][Io._cookies[1]]=`${e}=deleted${Fo({expires:/* @__PURE__ */ new Date(0)})}`},key:e=>{let t=null,n=0;return Io._cookies[0][Io._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),``)),t},get length(){let e=0;return Io._cookies[0][Io._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=+!!t,``)),e}});const Lo={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,Ấ:`A`,Ắ:`A`,Ẳ:`A`,Ẵ:`A`,Ặ:`A`,Æ:`AE`,Ầ:`A`,Ằ:`A`,Ȃ:`A`,Ç:`C`,Ḉ:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ế:`E`,Ḗ:`E`,Ề:`E`,Ḕ:`E`,Ḝ:`E`,Ȇ:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ḯ:`I`,Ȋ:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,Ố:`O`,Ṍ:`O`,Ṓ:`O`,Ȏ:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,Ý:`Y`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,ấ:`a`,ắ:`a`,ẳ:`a`,ẵ:`a`,ặ:`a`,æ:`ae`,ầ:`a`,ằ:`a`,ȃ:`a`,ç:`c`,ḉ:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ế:`e`,ḗ:`e`,ề:`e`,ḕ:`e`,ḝ:`e`,ȇ:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ḯ:`i`,ȋ:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,ố:`o`,ṍ:`o`,ṓ:`o`,ȏ:`o`,ù:`u`,ú:`u`,û:`u`,ü:`u`,ý:`y`,ÿ:`y`,Ā:`A`,ā:`a`,Ă:`A`,ă:`a`,Ą:`A`,ą:`a`,Ć:`C`,ć:`c`,Ĉ:`C`,ĉ:`c`,Ċ:`C`,ċ:`c`,Č:`C`,č:`c`,C̆:`C`,c̆:`c`,Ď:`D`,ď:`d`,Đ:`D`,đ:`d`,Ē:`E`,ē:`e`,Ĕ:`E`,ĕ:`e`,Ė:`E`,ė:`e`,Ę:`E`,ę:`e`,Ě:`E`,ě:`e`,Ĝ:`G`,Ǵ:`G`,ĝ:`g`,ǵ:`g`,Ğ:`G`,ğ:`g`,Ġ:`G`,ġ:`g`,Ģ:`G`,ģ:`g`,Ĥ:`H`,ĥ:`h`,Ħ:`H`,ħ:`h`,Ḫ:`H`,ḫ:`h`,Ĩ:`I`,ĩ:`i`,Ī:`I`,ī:`i`,Ĭ:`I`,ĭ:`i`,Į:`I`,į:`i`,İ:`I`,ı:`i`,IJ:`IJ`,ij:`ij`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,Ḱ:`K`,ḱ:`k`,K̆:`K`,k̆:`k`,Ĺ:`L`,ĺ:`l`,Ļ:`L`,ļ:`l`,Ľ:`L`,ľ:`l`,Ŀ:`L`,ŀ:`l`,Ł:`l`,ł:`l`,Ḿ:`M`,ḿ:`m`,M̆:`M`,m̆:`m`,Ń:`N`,ń:`n`,Ņ:`N`,ņ:`n`,Ň:`N`,ň:`n`,ʼn:`n`,N̆:`N`,n̆:`n`,Ō:`O`,ō:`o`,Ŏ:`O`,ŏ:`o`,Ő:`O`,ő:`o`,Œ:`OE`,œ:`oe`,P̆:`P`,p̆:`p`,Ŕ:`R`,ŕ:`r`,Ŗ:`R`,ŗ:`r`,Ř:`R`,ř:`r`,R̆:`R`,r̆:`r`,Ȓ:`R`,ȓ:`r`,Ś:`S`,ś:`s`,Ŝ:`S`,ŝ:`s`,Ş:`S`,Ș:`S`,ș:`s`,ş:`s`,Š:`S`,š:`s`,Ţ:`T`,ţ:`t`,ț:`t`,Ț:`T`,Ť:`T`,ť:`t`,Ŧ:`T`,ŧ:`t`,T̆:`T`,t̆:`t`,Ũ:`U`,ũ:`u`,Ū:`U`,ū:`u`,Ŭ:`U`,ŭ:`u`,Ů:`U`,ů:`u`,Ű:`U`,ű:`u`,Ų:`U`,ų:`u`,Ȗ:`U`,ȗ:`u`,V̆:`V`,v̆:`v`,Ŵ:`W`,ŵ:`w`,Ẃ:`W`,ẃ:`w`,X̆:`X`,x̆:`x`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Y̆:`Y`,y̆:`y`,Ź:`Z`,ź:`z`,Ż:`Z`,ż:`z`,Ž:`Z`,ž:`z`,ſ:`s`,ƒ:`f`,Ơ:`O`,ơ:`o`,Ư:`U`,ư:`u`,Ǎ:`A`,ǎ:`a`,Ǐ:`I`,ǐ:`i`,Ǒ:`O`,ǒ:`o`,Ǔ:`U`,ǔ:`u`,Ǖ:`U`,ǖ:`u`,Ǘ:`U`,ǘ:`u`,Ǚ:`U`,ǚ:`u`,Ǜ:`U`,ǜ:`u`,Ứ:`U`,ứ:`u`,Ṹ:`U`,ṹ:`u`,Ǻ:`A`,ǻ:`a`,Ǽ:`AE`,ǽ:`ae`,Ǿ:`O`,ǿ:`o`,Þ:`TH`,þ:`th`,Ṕ:`P`,ṕ:`p`,Ṥ:`S`,ṥ:`s`,X́:`X`,x́:`x`,Ѓ:`Г`,ѓ:`г`,Ќ:`К`,ќ:`к`,A̋:`A`,a̋:`a`,E̋:`E`,e̋:`e`,I̋:`I`,i̋:`i`,Ǹ:`N`,ǹ:`n`,Ồ:`O`,ồ:`o`,Ṑ:`O`,ṑ:`o`,Ừ:`U`,ừ:`u`,Ẁ:`W`,ẁ:`w`,Ỳ:`Y`,ỳ:`y`,Ȁ:`A`,ȁ:`a`,Ȅ:`E`,ȅ:`e`,Ȉ:`I`,ȉ:`i`,Ȍ:`O`,ȍ:`o`,Ȑ:`R`,ȑ:`r`,Ȕ:`U`,ȕ:`u`,B̌:`B`,b̌:`b`,Č̣:`C`,č̣:`c`,Ê̌:`E`,ê̌:`e`,F̌:`F`,f̌:`f`,Ǧ:`G`,ǧ:`g`,Ȟ:`H`,ȟ:`h`,J̌:`J`,ǰ:`j`,Ǩ:`K`,ǩ:`k`,M̌:`M`,m̌:`m`,P̌:`P`,p̌:`p`,Q̌:`Q`,q̌:`q`,Ř̩:`R`,ř̩:`r`,Ṧ:`S`,ṧ:`s`,V̌:`V`,v̌:`v`,W̌:`W`,w̌:`w`,X̌:`X`,x̌:`x`,Y̌:`Y`,y̌:`y`,A̧:`A`,a̧:`a`,B̧:`B`,b̧:`b`,Ḑ:`D`,ḑ:`d`,Ȩ:`E`,ȩ:`e`,Ɛ̧:`E`,ɛ̧:`e`,Ḩ:`H`,ḩ:`h`,I̧:`I`,i̧:`i`,Ɨ̧:`I`,ɨ̧:`i`,M̧:`M`,m̧:`m`,O̧:`O`,o̧:`o`,Q̧:`Q`,q̧:`q`,U̧:`U`,u̧:`u`,X̧:`X`,x̧:`x`,Z̧:`Z`,z̧:`z`},Ro=Object.keys(Lo).join(`|`),zo=new RegExp(Ro,`g`);function Bo(e){return e.replace(zo,e=>Lo[e])}
|
|
3
3
|
/**
|
|
4
4
|
* @name match-sorter
|
|
5
5
|
* @license MIT license.
|