@nation-a/ui 0.16.28 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/ark-ui-D--_sKY0.js +7066 -0
  2. package/dist/ark-ui-D--_sKY0.js.map +1 -0
  3. package/dist/ark-ui-e4-hVrsF.cjs +2 -0
  4. package/dist/ark-ui-e4-hVrsF.cjs.map +1 -0
  5. package/dist/{index-BroabscA.cjs → index-B5IKaL0m.cjs} +2 -2
  6. package/dist/index-B5IKaL0m.cjs.map +1 -0
  7. package/dist/{index-B4n-XEbJ.js → index-FC3cETza.js} +2 -2
  8. package/dist/index-FC3cETza.js.map +1 -0
  9. package/dist/index.cjs +7 -7
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +5010 -4958
  12. package/dist/index.js.map +1 -1
  13. package/dist/react-hot-toast-BCKriZQY.js +404 -0
  14. package/dist/react-hot-toast-BCKriZQY.js.map +1 -0
  15. package/dist/react-hot-toast-CvGdrsnM.cjs +178 -0
  16. package/dist/react-hot-toast-CvGdrsnM.cjs.map +1 -0
  17. package/dist/{react-lottie-DygynGMG.js → react-lottie-BoWlnUa4.js} +257 -257
  18. package/dist/react-lottie-BoWlnUa4.js.map +1 -0
  19. package/dist/react-lottie-D3xAW5ky.cjs +29 -0
  20. package/dist/react-lottie-D3xAW5ky.cjs.map +1 -0
  21. package/dist/stats.html +1 -1
  22. package/dist/styled-system/css/conditions.mjs +1 -1
  23. package/dist/styled-system/css/css.mjs +1 -1
  24. package/dist/styled-system/css/sva.mjs +9 -4
  25. package/dist/styled-system/helpers.mjs +12 -20
  26. package/dist/styled-system/jsx/create-style-context.d.ts +54 -0
  27. package/dist/styled-system/jsx/create-style-context.mjs +98 -0
  28. package/dist/styled-system/jsx/factory.mjs +14 -5
  29. package/dist/styled-system/jsx/index.d.ts +1 -0
  30. package/dist/styled-system/jsx/index.mjs +1 -0
  31. package/dist/styled-system/patterns/aspect-ratio.d.ts +0 -1
  32. package/dist/styled-system/patterns/bleed.d.ts +0 -1
  33. package/dist/styled-system/patterns/box.d.ts +0 -1
  34. package/dist/styled-system/patterns/center.d.ts +0 -1
  35. package/dist/styled-system/patterns/circle.d.ts +0 -1
  36. package/dist/styled-system/patterns/container.d.ts +0 -1
  37. package/dist/styled-system/patterns/cq.d.ts +0 -1
  38. package/dist/styled-system/patterns/divider.d.ts +0 -1
  39. package/dist/styled-system/patterns/flex.d.ts +0 -1
  40. package/dist/styled-system/patterns/float.d.ts +0 -1
  41. package/dist/styled-system/patterns/grid-item.d.ts +0 -1
  42. package/dist/styled-system/patterns/grid.d.ts +0 -1
  43. package/dist/styled-system/patterns/grid.mjs +1 -1
  44. package/dist/styled-system/patterns/hstack.d.ts +0 -1
  45. package/dist/styled-system/patterns/hstack.mjs +1 -1
  46. package/dist/styled-system/patterns/link-overlay.d.ts +0 -1
  47. package/dist/styled-system/patterns/spacer.d.ts +0 -1
  48. package/dist/styled-system/patterns/square.d.ts +0 -1
  49. package/dist/styled-system/patterns/stack.d.ts +0 -1
  50. package/dist/styled-system/patterns/stack.mjs +1 -1
  51. package/dist/styled-system/patterns/visually-hidden.d.ts +0 -1
  52. package/dist/styled-system/patterns/vstack.d.ts +0 -1
  53. package/dist/styled-system/patterns/vstack.mjs +1 -1
  54. package/dist/styled-system/patterns/wrap.d.ts +0 -1
  55. package/dist/styled-system/patterns/wrap.mjs +1 -1
  56. package/dist/styled-system/styles.css +1003 -993
  57. package/dist/styled-system/tokens/tokens.d.ts +1 -1
  58. package/dist/styled-system/types/composition.d.ts +83 -23
  59. package/dist/styled-system/types/conditions.d.ts +13 -9
  60. package/dist/styled-system/types/jsx.d.ts +25 -10
  61. package/dist/styled-system/types/prop-type.d.ts +12 -1
  62. package/dist/styled-system/types/style-props.d.ts +17 -5
  63. package/dist/styled-system/types/system-types.d.ts +76 -0
  64. package/dist/types/components/BottomSheet/BottomSheet.stories.d.ts +322 -4
  65. package/dist/types/components/BottomSheet/index.d.ts +23 -21
  66. package/dist/types/components/BottomSheet/react-modal-sheet/SheetBackdrop.d.ts +6 -1
  67. package/dist/types/components/BottomSheet/react-modal-sheet/SheetContainer.d.ts +7 -5
  68. package/dist/types/components/BottomSheet/react-modal-sheet/SheetContent.d.ts +7 -6
  69. package/dist/types/components/BottomSheet/react-modal-sheet/SheetHeader.d.ts +7 -6
  70. package/dist/types/components/BottomSheet/react-modal-sheet/SheetScroller.d.ts +7 -3
  71. package/dist/types/components/BottomSheet/react-modal-sheet/constants.d.ts +3 -8
  72. package/dist/types/components/BottomSheet/react-modal-sheet/hooks.d.ts +1 -1
  73. package/dist/types/components/BottomSheet/react-modal-sheet/index.d.ts +1 -1
  74. package/dist/types/components/BottomSheet/react-modal-sheet/sheet.d.ts +7 -16
  75. package/dist/types/components/BottomSheet/react-modal-sheet/types.d.ts +5 -5
  76. package/dist/types/components/Button/Button.stories.d.ts +10 -3
  77. package/dist/types/components/Button/index.d.ts +8 -298
  78. package/dist/types/components/Checkbox/checkbox.stories.d.ts +15 -3
  79. package/dist/types/components/Checkbox/checkbox.styled.d.ts +29 -12
  80. package/dist/types/components/Checkbox/index.d.ts +4 -1
  81. package/dist/types/components/Dialog/Dialog.stories.d.ts +9 -3
  82. package/dist/types/components/Dialog/index.d.ts +15 -25
  83. package/dist/types/components/Fab/Fab.stories.d.ts +25 -3
  84. package/dist/types/components/Fab/index.d.ts +301 -2
  85. package/dist/types/components/IconButton/IconButton.stories.d.ts +43 -3
  86. package/dist/types/components/IconButton/index.d.ts +5 -6
  87. package/dist/types/components/Input/Input.stories.d.ts +1 -1
  88. package/dist/types/components/Input/index.d.ts +4 -1
  89. package/dist/types/components/Layout/index.d.ts +16 -16
  90. package/dist/types/components/List/List.stories.d.ts +64 -4
  91. package/dist/types/components/List/index.d.ts +82 -13
  92. package/dist/types/components/Navigation/Navigation.stories.d.ts +9 -4
  93. package/dist/types/components/Navigation/index.d.ts +6 -9
  94. package/dist/types/components/RadioGroup/Radio.stories.d.ts +8 -3
  95. package/dist/types/components/RadioGroup/index.d.ts +10 -9
  96. package/dist/types/components/RadioGroup/radio.recipe.d.ts +1 -1
  97. package/dist/types/components/Select/Select.stories.d.ts +1 -9
  98. package/dist/types/components/Select/index.d.ts +75 -28
  99. package/dist/types/components/Select/select.recipe.d.ts +1 -1
  100. package/dist/types/components/Spinner/Spinner.stories.d.ts +1 -1
  101. package/dist/types/components/Spinner/index.d.ts +4 -1
  102. package/dist/types/components/Switch/Switch.stories.d.ts +1 -1
  103. package/dist/types/components/Switch/index.d.ts +5 -2
  104. package/dist/types/components/Switch/switch.styled.d.ts +89 -15
  105. package/dist/types/components/Tabs/Tabs.stories.d.ts +8 -4
  106. package/dist/types/components/Tabs/index.d.ts +208 -29
  107. package/dist/types/components/Tag/Tag.stories.d.ts +9 -4
  108. package/dist/types/components/Tag/index.d.ts +5 -2
  109. package/dist/types/components/Text/Text.stories.d.ts +25 -3
  110. package/dist/types/components/Text/index.d.ts +4 -276
  111. package/dist/types/components/TextArea/TextArea.stories.d.ts +9 -4
  112. package/dist/types/components/TextArea/index.d.ts +4 -1
  113. package/dist/types/components/Toast/Toast.stories.d.ts +9 -4
  114. package/dist/types/components/Toast/index.d.ts +47 -24
  115. package/dist/types/index.d.ts +0 -1
  116. package/dist/types/utils/with-polymorphic-component.d.ts +5 -4
  117. package/package.json +35 -40
  118. package/dist/ark-ui-BakX7_HR.cjs +0 -2
  119. package/dist/ark-ui-BakX7_HR.cjs.map +0 -1
  120. package/dist/ark-ui-BitYUtmQ.js +0 -6713
  121. package/dist/ark-ui-BitYUtmQ.js.map +0 -1
  122. package/dist/index-B4n-XEbJ.js.map +0 -1
  123. package/dist/index-BroabscA.cjs.map +0 -1
  124. package/dist/react-hot-toast-BQTk3w2h.cjs +0 -178
  125. package/dist/react-hot-toast-BQTk3w2h.cjs.map +0 -1
  126. package/dist/react-hot-toast-CPO7pUT3.js +0 -389
  127. package/dist/react-hot-toast-CPO7pUT3.js.map +0 -1
  128. package/dist/react-lottie-DTf3gNPc.cjs +0 -29
  129. package/dist/react-lottie-DTf3gNPc.cjs.map +0 -1
  130. package/dist/react-lottie-DygynGMG.js.map +0 -1
  131. package/dist/types/utils/create-style-context.d.ts +0 -20
  132. package/dist/types/utils/index.d.ts +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const E=require("react"),P=require("react/jsx-runtime"),Gt=require("react-dom");function $i(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function X(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=E.createContext(s);a.displayName=t;function u(){var d;const c=E.useContext(a);if(!c&&n){const h=new Error(i!=null?i:$i(r,o));throw h.name="ContextError",(d=Error.captureStackTrace)==null||d.call(Error,h,u),h}return c}return[a.Provider,u,a]}function Mi(e){return e==null?[]:Array.isArray(e)?e:[e]}var Gi=e=>e[0],Bi=e=>e[e.length-1],Hi=(e,t)=>e.indexOf(t)!==-1,_i=(e,...t)=>e.concat(t),ji=(e,...t)=>e.filter(n=>!t.includes(n)),ar=(e,t)=>Hi(e,t)?ji(e,t):_i(e,t),cr=e=>(e==null?void 0:e.constructor.name)==="Array",Wi=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Bt(e[n],t[n]))return!1;return!0},Bt=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(cr(e)&&cr(t))return Wi(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t!=null?t:Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Bt(e[i],t[i]))return!1}return!0},Ki=e=>Array.isArray(e),Wr=e=>e!=null&&typeof e=="object",rn=e=>Wr(e)&&!Ki(e),ot=e=>typeof e=="string",Ge=e=>typeof e=="function",Ui=e=>e==null,Ot=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),qi=e=>Object.prototype.toString.call(e),Kr=Function.prototype.toString,Xi=Kr.call(Object),Yi=e=>{if(!Wr(e)||qi(e)!="[object Object]"||Zi(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Ot(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Kr.call(n)==Xi},zi=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Ji=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Zi=e=>zi(e)||Ji(e),Qi=e=>e(),es=()=>{},gn=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function Fn(e){if(!Yi(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=Fn(o))}return n}function pn(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Ur(e,t){if(e==null)throw new Error(t())}var ts=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),on=(...e)=>t=>e.reduce((n,r)=>r(n),t),Be=()=>{},Ht=e=>typeof e=="object"&&e!==null,O=e=>e?"":void 0,ns=e=>e?"true":void 0,rs=1,os=9,is=11,U=e=>Ht(e)&&e.nodeType===rs&&typeof e.nodeName=="string",_t=e=>Ht(e)&&e.nodeType===os,ss=e=>Ht(e)&&e===e.window,qr=e=>U(e)?e.localName||"":"#document";function as(e){return["html","body","#document"].includes(qr(e))}var cs=e=>Ht(e)&&e.nodeType!==void 0,Oe=e=>cs(e)&&e.nodeType===is&&"host"in e,ls=e=>U(e)&&e.localName==="input",us=e=>!!(e!=null&&e.matches("a[href]")),ds=e=>U(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function kt(e){if(!e)return!1;const t=e.getRootNode();return it(t)===e}var fs=/(textarea|select)/;function Xr(e){if(e==null||!U(e))return!1;try{return ls(e)&&e.selectionStart!=null||fs.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function Pe(e,t){var r;if(!e||!t||!U(e)||!U(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&Oe(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Q(e){var t;return _t(e)?e:ss(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function hs(e){return Q(e).documentElement}function q(e){var t,n,r;return Oe(e)?q(e.host):_t(e)?(t=e.defaultView)!=null?t:window:U(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function it(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function gs(e){if(qr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oe(e)&&e.host||hs(e);return Oe(t)?t.host:t}function Dn(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),_t(t)||Oe(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var sn=new WeakMap;function $n(e){return sn.has(e)||sn.set(e,q(e).getComputedStyle(e)),sn.get(e)}var Mn=new Set(["menu","listbox","dialog","grid","tree","region"]),ps=e=>Mn.has(e),Yr=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function zr(e,t){const n=new Set,r=Dn(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const u=Yr(a);for(const c of u){if(!c||n.has(c))continue;n.add(c);const d=r.getElementById(c);if(d){const h=d.getAttribute("role"),p=d.getAttribute("aria-modal")==="true";if(h&&ps(h)&&!p&&(d===t||d.contains(t)||o(d)))return!0}}}return!1};return o(e)}function Jr(e,t){const n=Dn(e),r=new Set,o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const u=Yr(a);for(const c of u){if(!c||r.has(c))continue;r.add(c);const d=n.getElementById(c);if(d){const h=d.getAttribute("role"),p=d.getAttribute("aria-modal")==="true";h&&Mn.has(h)&&!p&&(t(d),o(d))}}}};o(e)}function ms(e){const t=new Set;return Jr(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function vs(e){const t=e.getAttribute("role");return!!(t&&Mn.has(t))}function ys(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function bs(e){var t;return ys(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function Es(e){if(!e.id)return!1;const t=Dn(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&vs(e))}var jt=()=>typeof document!="undefined";function Cs(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}function ws(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Gn=e=>jt()&&e.test(Cs()),Zr=e=>jt()&&e.test(ws()),Is=e=>jt()&&e.test(navigator.vendor),lr=()=>jt()&&!!navigator.maxTouchPoints,Ts=()=>Gn(/^iPhone/i),xs=()=>Gn(/^iPad/i)||ut()&&navigator.maxTouchPoints>1,Qr=()=>Ts()||xs(),Os=()=>ut()||Qr(),ut=()=>Gn(/^Mac/i),Bn=()=>Os()&&Is(/apple/i),Ps=()=>Zr(/Firefox/i),Rs=()=>Zr(/Android/i);function Ss(e){var t,n,r,o;return(o=(t=e.composedPath)==null?void 0:t.call(e))!=null?o:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function K(e){var n;const t=Ss(e);return(n=t==null?void 0:t[0])!=null?n:e.target}function ks(e){const t=e.currentTarget;if(!t||!t.matches("a[href], button[type='submit'], input[type='submit']"))return!1;const r=e.button===1,o=As(e);return r||o}function Ns(e){return Ms(e).isComposing||e.keyCode===229}function As(e){return ut()?e.metaKey:e.ctrlKey}function Ls(e){return e.pointerType===""&&e.isTrusted?!0:Rs()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Vs=e=>e.button===0,Fs=e=>e.button===2||ut()&&e.ctrlKey&&e.button===0,Ds=e=>"touches"in e&&e.touches.length>0,$s={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},ur={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function mn(e,t={}){var s;const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=(s=$s[o])!=null?s:o,n==="rtl"&&r==="horizontal"&&o in ur&&(o=ur[o]),o}function Ms(e){var t;return(t=e.nativeEvent)!=null?t:e}function Gs(e,t="client"){const n=Ds(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var W=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o==null||o.addEventListener(t,n,r),()=>{o==null||o.removeEventListener(t,n,r)}};function Bs(e,t){var i;const{type:n="HTMLInputElement",property:r="value"}=t,o=q(e)[n].prototype;return(i=Object.getOwnPropertyDescriptor(o,r))!=null?i:{}}function Hn(e,t){var r;if(!e)return;(r=Bs(e,{type:"HTMLInputElement",property:"checked"}).set)==null||r.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked")}function _n(e,t){const{checked:n,bubbles:r=!0}=t;if(!e)return;const o=q(e);e instanceof o.HTMLInputElement&&(Hn(e,n),e.dispatchEvent(new o.Event("click",{bubbles:r})))}function Hs(e){return _s(e)?e.form:e.closest("form")}function _s(e){return e.matches("textarea, input, select, button")}function js(e,t){if(!e)return;const n=Hs(e),r=o=>{o.defaultPrevented||t()};return n==null||n.addEventListener("reset",r,{passive:!0}),()=>n==null?void 0:n.removeEventListener("reset",r)}function Ws(e,t){const n=e==null?void 0:e.closest("fieldset");if(!n)return;t(n.disabled);const r=q(n),o=new r.MutationObserver(()=>t(n.disabled));return o.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function Wt(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:r}=t,o=[js(e,r),Ws(e,n)];return()=>o.forEach(i=>i==null?void 0:i())}var eo=e=>U(e)&&e.tagName==="IFRAME",Ks=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),Us=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,jn="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Wn=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(jn));(t==!0||t=="if-empty"&&n.length===0)&&U(e)&&ye(e)&&n.unshift(e);const o=n.filter(ye);return o.forEach((i,s)=>{if(eo(i)&&i.contentDocument){const a=i.contentDocument.body;o.splice(s,1,...Wn(a))}}),o};function ye(e){return!e||e.closest("[inert]")?!1:e.matches(jn)&&ds(e)}function Kt(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll(jn)).filter(Ie);return r.forEach((o,i)=>{if(eo(o)&&o.contentDocument){const s=o.contentDocument.body,a=Kt(s);r.splice(i,1,...a)}}),r.length,r}function Ie(e){return e!=null&&e.tabIndex>0?!0:ye(e)&&!Us(e)}function qs(e,t){const n=Kt(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function Ye(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Xr(e))&&!Ks(e)?0:e.tabIndex}function Xs(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof n=="function"?n():n),i||(i=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!i){const s=Kt(t);i=r?s.filter(r)[0]:s[0]}return i||t||void 0}function Ys(e){const t=e.currentTarget;if(!t)return!1;const[n,r]=qs(t);return!(kt(n)&&e.shiftKey||kt(r)&&!e.shiftKey||!n&&!r)}function to(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function j(e){let t;const n=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(n),t==null||t()}}function zs(e,t,n){const r=j(()=>{e.removeEventListener(t,o,!0),n()}),o=()=>{r(),n()};return e.addEventListener(t,o,{once:!0,capture:!0}),r}function Js(e,t){if(!e)return;const{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&r(a)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Zs(e,t){const n=j,r=[];return r.push(n(()=>{const o=typeof e=="function"?e():e;r.push(Js(o,t))})),()=>{r.forEach(o=>o==null?void 0:o())}}function Qs(e){const t=()=>{const n=q(e);e.dispatchEvent(new n.MouseEvent("click"))};Ps()?zs(e,"keyup",t):queueMicrotask(t)}function vn(e){const t=gs(e);return as(t)?Q(t).body:U(t)&&no(t)?t:vn(t)}var ea=/auto|scroll|overlay|hidden|clip/,ta=new Set(["inline","contents"]);function no(e){const t=q(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return ea.test(n+o+r)&&!ta.has(i)}function na(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function ra(e,t){const{rootEl:n,...r}=t||{};!e||!n||!no(n)||!na(n)||e.scrollIntoView(r)}function ro(e){const{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:o,onPressEnd:i,isValidKey:s=y=>y.key==="Enter"}=e;if(!t)return Be;const a=q(t);let u=Be,c=Be,d=Be;const h=y=>({point:Gs(y),event:y});function p(y){o==null||o(h(y))}function l(y){i==null||i(h(y))}const g=W(t,"pointerdown",y=>{c();const w=W(a,"pointerup",S=>{const k=K(S);Pe(t,k)?r==null||r(h(S)):i==null||i(h(S))},{passive:!r,once:!0}),T=W(a,"pointercancel",l,{passive:!i,once:!0});c=on(w,T),kt(n)&&y.pointerType==="mouse"&&y.preventDefault(),p(y)},{passive:!o}),m=W(n,"focus",v);u=on(g,m);function v(){const y=S=>{if(!s(S))return;const k=b=>{if(!s(b))return;const I=new a.PointerEvent("pointerup"),A=h(I);r==null||r(A),i==null||i(A)};c(),c=W(n,"keyup",k);const $=new a.PointerEvent("pointerdown");p($)},C=()=>{const S=new a.PointerEvent("pointercancel");l(S)},w=W(n,"keydown",y),T=W(n,"blur",C);d=on(w,T)}return()=>{u(),c(),d()}}function oo(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}var Kn=e=>e.id;function io(e,t,n=Kn){return e.find(r=>n(r)===t)}function Un(e,t,n=Kn){const r=io(e,t,n);return r?e.indexOf(r):-1}function oa(e,t,n=!0){let r=Un(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function ia(e,t,n=!0){let r=Un(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function so(e,t){const{onEntry:n,measure:r,box:o="border-box"}=t,i=(Array.isArray(e)?e:[e]).filter(U),s=q(i[0]),a=c=>{const d=i.map(h=>r(h));n({rects:d,entries:c})};a([]);const u=new s.ResizeObserver(a);return i.forEach(c=>u.observe(c,{box:o})),()=>u.disconnect()}var sa=e=>e.split("").map(t=>{const n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),aa=e=>{var t,n,r;return sa((r=(n=(t=e.dataset)==null?void 0:t.valuetext)!=null?n:e.textContent)!=null?r:"")},ca=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function la(e,t,n,r=Kn){const o=n?Un(e,n,r):-1;let i=n?ts(e,o):e;return t.length===1&&(i=i.filter(a=>r(a)!==n)),i.find(a=>ca(aa(a),t))}function Nt(e,t){if(!e)return Be;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function ua(e,t,n){if(!e)return Be;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function da(e,t){const{state:n,activeId:r,key:o,timeout:i=350,itemToId:s}=t,a=n.keysSoFar+o,c=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a;let d=e.slice();const h=la(d,c,r,s);function p(){clearTimeout(n.timer),n.timer=-1}function l(f){n.keysSoFar=f,p(),f!==""&&(n.timer=+setTimeout(()=>{l(""),p()},i))}return l(a),h}var yn=Object.assign(da,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:fa});function fa(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Ut={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function ha(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const u=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(u),a(new Error("Promise aborted"))}),e.then(c=>{r.aborted||(clearTimeout(u),s(c))}).catch(c=>{r.aborted||(clearTimeout(u),a(c))})}),()=>t.abort()]}function ga(e,t){const{timeout:n,rootNode:r}=t,o=q(r),i=Q(r),s=new o.AbortController;return ha(new Promise(a=>{const u=e();if(u){a(u);return}const c=new o.MutationObserver(()=>{const d=e();d&&d.isConnected&&(c.disconnect(),a(d))});c.observe(i.body,{childList:!0,subtree:!0})}),s,n)}var pa=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),ma=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,dr=e=>{const t={};let n;for(;n=ma.exec(e);)t[n[1]]=n[2];return t},va=(e,t)=>{if(ot(e)){if(ot(t))return`${e};${t}`;e=dr(e)}else ot(t)&&(t=dr(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function V(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=gn(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=pa(t[o],n[o]);continue}if(o==="style"){t[o]=va(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function dt(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function ya(){return{guards:dt(),createMachine:e=>e,choose:e=>function({choose:n}){var r;return(r=n(e))==null?void 0:r.actions}}}var Me=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Me||{}),an="__init__";function ba(e){const t=()=>{var s,a;return(a=(s=e.getRootNode)==null?void 0:s.call(e))!=null?a:document},n=()=>Q(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>{var s;return(s=n().defaultView)!=null?s:window},getActiveElement:()=>it(t()),isActiveElement:kt,getById:s=>t().getElementById(s)}}function Ea(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var ee=()=>e=>Array.from(new Set(e)),ao=typeof globalThis.document!="undefined"?E.useLayoutEffect:E.useEffect;function At(e){var h,p;const t=(h=e().value)!=null?h:e().defaultValue,n=(p=e().isEqual)!=null?p:Object.is,[r]=E.useState(t),[o,i]=E.useState(r),s=e().value!==void 0,a=E.useRef(o);a.current=s?e().value:o;const u=E.useRef(a.current);ao(()=>{u.current=a.current},[o,e().value]);const c=l=>{var m,v;const f=u.current,g=Ge(l)?l(f):l;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:g,prev:f}),s||i(g),n(g,f)||(v=(m=e()).onChange)==null||v.call(m,g,f)};function d(){return s?e().value:o}return{initial:r,ref:a,get:d,set(l){(e().sync?Gt.flushSync:Qi)(()=>c(l))},invoke(l,f){var g,m;(m=(g=e()).onChange)==null||m.call(g,l,f)},hash(l){var f,g,m;return(m=(g=(f=e()).hash)==null?void 0:g.call(f,l))!=null?m:String(l)}}}At.cleanup=e=>{E.useEffect(()=>e,[])};At.ref=e=>{const t=E.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function Ca(e){const t=E.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var wa=(e,t)=>{const n=E.useRef(!1),r=E.useRef(!1);E.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(o=>typeof o=="function"?o():o)]),E.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function ke(e,t={}){var A,M,H,_,le,ne;const n=E.useMemo(()=>{const{id:R,ids:x,getRootNode:L}=t;return ba({id:R,ids:x,getRootNode:L})},[t]),r=(...R)=>{e.debug&&console.log(...R)},o=(M=(A=e.props)==null?void 0:A.call(e,{props:Fn(t),scope:n}))!=null?M:t,i=Ia(o),s=(H=e.context)==null?void 0:H.call(e,{prop:i,bindable:At,scope:n,flush:fr,getContext(){return u},getComputed(){return T},getRefs(){return g},getEvent(){return l()}}),a=co(s),u={get(R){var x;return(x=a.current)==null?void 0:x[R].ref.current},set(R,x){var L;(L=a.current)==null||L[R].set(x)},initial(R){var x;return(x=a.current)==null?void 0:x[R].initial},hash(R){var L,D;const x=(L=a.current)==null?void 0:L[R].get();return(D=a.current)==null?void 0:D[R].hash(x)}},c=E.useRef(new Map),d=E.useRef(null),h=E.useRef(null),p=E.useRef({type:""}),l=()=>({...p.current,current(){return p.current},previous(){return h.current}}),f=()=>({...S,matches(...R){return R.includes(S.ref.current)},hasTag(R){var x,L;return!!((L=(x=e.states[S.ref.current])==null?void 0:x.tags)!=null&&L.includes(R))}}),g=Ca((le=(_=e.refs)==null?void 0:_.call(e,{prop:i,context:u}))!=null?le:{}),m=()=>({state:f(),context:u,event:l(),prop:i,send:I,action:v,guard:y,track:wa,refs:g,computed:T,flush:fr,scope:n,choose:w}),v=R=>{const x=Ge(R)?R(m()):R;if(!x)return;const L=x.map(D=>{var z,se;const B=(se=(z=e.implementations)==null?void 0:z.actions)==null?void 0:se[D];return B||pn(`[zag-js] No implementation found for action "${JSON.stringify(D)}"`),B});for(const D of L)D==null||D(m())},y=R=>{var x,L;return Ge(R)?R(m()):(L=(x=e.implementations)==null?void 0:x.guards)==null?void 0:L[R](m())},C=R=>{const x=Ge(R)?R(m()):R;if(!x)return;const L=x.map(B=>{var se,re;const z=(re=(se=e.implementations)==null?void 0:se.effects)==null?void 0:re[B];return z||pn(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),z}),D=[];for(const B of L){const z=B==null?void 0:B(m());z&&D.push(z)}return()=>D.forEach(B=>B==null?void 0:B())},w=R=>Mi(R).find(x=>{let L=!x.guard;return ot(x.guard)?L=!!y(x.guard):Ge(x.guard)&&(L=x.guard(m())),L}),T=R=>{Ur(e.computed,()=>"[zag-js] No computed object found on machine");const x=e.computed[R];return x({context:u,event:l(),prop:i,refs:g,scope:n,computed:T})},S=At(()=>({defaultValue:e.initialState({prop:i}),onChange(R,x){var D,B,z,se;if(x){const re=c.current.get(x);re==null||re(),c.current.delete(x)}x&&v((D=e.states[x])==null?void 0:D.exit),v((B=d.current)==null?void 0:B.actions);const L=C((z=e.states[R])==null?void 0:z.effects);if(L&&c.current.set(R,L),x===an){v(e.entry);const re=C(e.effects);re&&c.current.set(an,re)}v((se=e.states[R])==null?void 0:se.entry)}})),k=E.useRef(void 0),$=E.useRef(Me.NotStarted);ao(()=>{queueMicrotask(()=>{var B;const L=$.current===Me.Started;$.current=Me.Started,r(L?"rehydrating...":"initializing...");const D=(B=k.current)!=null?B:S.initial;S.invoke(D,L?S.get():an)});const R=c.current,x=S.ref.current;return()=>{r("unmounting..."),k.current=x,$.current=Me.Stopped,R.forEach(L=>L==null?void 0:L()),c.current=new Map,d.current=null,queueMicrotask(()=>{v(e.exit)})}},[]);const b=()=>"ref"in S?S.ref.current:S.get(),I=R=>{queueMicrotask(()=>{var se,re,or,ir,sr;if($.current!==Me.Started)return;h.current=p.current,p.current=R;let x=b();const L=(or=(se=e.states[x].on)==null?void 0:se[R.type])!=null?or:(re=e.on)==null?void 0:re[R.type],D=w(L);if(!D)return;d.current=D;const B=(ir=D.target)!=null?ir:x;r("transition",R.type,D.target||x,`(${D.actions})`);const z=B!==x;z?Gt.flushSync(()=>S.set(B)):D.reenter&&!z?S.invoke(x,x):v((sr=D.actions)!=null?sr:[])})};return(ne=e.watch)==null||ne.call(e,m()),{state:f(),send:I,context:u,prop:i,scope:n,refs:g,computed:T,event:l(),getStatus:()=>$.current}}function co(e){const t=E.useRef(e);return t.current=e,t}function Ia(e){const t=co(e);return function(r){return t.current[r]}}function fr(e){queueMicrotask(()=>{Gt.flushSync(()=>e())})}var We=Ea(e=>e);function ft(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const o=r(t);typeof o=="function"&&n.push(o)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function Ta(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const cn=e=>{const t=E.memo(E.forwardRef((n,r)=>{const{asChild:o,children:i,...s}=n;if(!o)return E.createElement(e,{...s,ref:r},i);if(!E.isValidElement(i))return null;const a=E.Children.only(i),u=Ta(a);return E.cloneElement(a,{...V(s,a.props),ref:r?ft(r,u):u})}));return t.displayName=e.displayName||e.name,t},xa=()=>{const e=new Map;return new Proxy(cn,{apply(t,n,r){return cn(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,cn(r)),e.get(r)}})},F=xa(),te=()=>(e,t)=>t.reduce((n,r)=>{const[o,i]=n,s=r;return i[s]!==void 0&&(o[s]=i[s]),delete i[s],[o,i]},[{},{...e}]);var ue=(e,t=[])=>({parts:(...n)=>{if(Oa(t))return ue(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>ue(e,[...t,...n]),omit:(...n)=>ue(e,t.filter(r=>!n.includes(r))),rename:n=>ue(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Fe(e)}"][data-part="${Fe(r)}"]`,`& [data-scope="${Fe(e)}"][data-part="${Fe(r)}"]`].join(", "),attrs:{"data-scope":Fe(e),"data-part":Fe(r)}}}),{})}),Fe=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Oa=e=>e.length===0;const[ed,Ne]=X({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[td,Ke]=X({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),Pa=["top","right","bottom","left"],be=Math.min,J=Math.max,Lt=Math.round,vt=Math.floor,fe=e=>({x:e,y:e}),Ra={left:"right",right:"left",bottom:"top",top:"bottom"},Sa={start:"end",end:"start"};function bn(e,t,n){return J(e,be(t,n))}function me(e,t){return typeof e=="function"?e(t):e}function ve(e){return e.split("-")[0]}function Ue(e){return e.split("-")[1]}function qn(e){return e==="x"?"y":"x"}function Xn(e){return e==="y"?"height":"width"}const ka=new Set(["top","bottom"]);function de(e){return ka.has(ve(e))?"y":"x"}function Yn(e){return qn(de(e))}function Na(e,t,n){n===void 0&&(n=!1);const r=Ue(e),o=Yn(e),i=Xn(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Vt(s)),[s,Vt(s)]}function Aa(e){const t=Vt(e);return[En(e),t,En(t)]}function En(e){return e.replace(/start|end/g,t=>Sa[t])}const hr=["left","right"],gr=["right","left"],La=["top","bottom"],Va=["bottom","top"];function Fa(e,t,n){switch(e){case"top":case"bottom":return n?t?gr:hr:t?hr:gr;case"left":case"right":return t?La:Va;default:return[]}}function Da(e,t,n,r){const o=Ue(e);let i=Fa(ve(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(En)))),i}function Vt(e){return e.replace(/left|right|bottom|top/g,t=>Ra[t])}function $a(e){return{top:0,right:0,bottom:0,left:0,...e}}function lo(e){return typeof e!="number"?$a(e):{top:e,right:e,bottom:e,left:e}}function Ft(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function pr(e,t,n){let{reference:r,floating:o}=e;const i=de(t),s=Yn(t),a=Xn(s),u=ve(t),c=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let l;switch(u){case"top":l={x:d,y:r.y-o.height};break;case"bottom":l={x:d,y:r.y+r.height};break;case"right":l={x:r.x+r.width,y:h};break;case"left":l={x:r.x-o.width,y:h};break;default:l={x:r.x,y:r.y}}switch(Ue(t)){case"start":l[s]-=p*(n&&c?-1:1);break;case"end":l[s]+=p*(n&&c?-1:1);break}return l}const Ma=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=pr(c,r,u),p=r,l={},f=0;for(let g=0;g<a.length;g++){const{name:m,fn:v}=a[g],{x:y,y:C,data:w,reset:T}=await v({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:l,rects:c,platform:s,elements:{reference:e,floating:t}});d=y!=null?y:d,h=C!=null?C:h,l={...l,[m]:{...l[m],...w}},T&&f<=50&&(f++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:d,y:h}=pr(c,p,u)),g=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:l}};async function at(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:l=0}=me(t,e),f=lo(l),m=a[p?h==="floating"?"reference":"floating":h],v=Ft(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:u})),y=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=Ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:C,strategy:u}):y);return{top:(v.top-T.top+f.top)/w.y,bottom:(T.bottom-v.bottom+f.bottom)/w.y,left:(v.left-T.left+f.left)/w.x,right:(T.right-v.right+f.right)/w.x}}const Ga=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:d=0}=me(e,t)||{};if(c==null)return{};const h=lo(d),p={x:n,y:r},l=Yn(o),f=Xn(l),g=await s.getDimensions(c),m=l==="y",v=m?"top":"left",y=m?"bottom":"right",C=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[l]-p[l]-i.floating[f],T=p[l]-i.reference[l],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=S?S[C]:0;(!k||!await(s.isElement==null?void 0:s.isElement(S)))&&(k=a.floating[C]||i.floating[f]);const $=w/2-T/2,b=k/2-g[f]/2-1,I=be(h[v],b),A=be(h[y],b),M=I,H=k-g[f]-A,_=k/2-g[f]/2+$,le=bn(M,_,H),ne=!u.arrow&&Ue(o)!=null&&_!==le&&i.reference[f]/2-(_<M?I:A)-g[f]/2<0,R=ne?_<M?_-M:_-H:0;return{[l]:p[l]+R,data:{[l]:le,centerOffset:_-le-R,...ne&&{alignmentOffset:R}},reset:ne}}}),Ba=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=me(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=ve(o),y=de(a),C=ve(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=p||(C||!g?[Vt(a)]:Aa(a)),S=f!=="none";!p&&S&&T.push(...Da(a,g,f,w));const k=[a,...T],$=await at(t,m),b=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&b.push($[v]),h){const _=Na(o,s,w);b.push($[_[0]],$[_[1]])}if(I=[...I,{placement:o,overflows:b}],!b.every(_=>_<=0)){var A,M;const _=(((A=i.flip)==null?void 0:A.index)||0)+1,le=k[_];if(le&&(!(h==="alignment"?y!==de(le):!1)||I.every(x=>de(x.placement)===y?x.overflows[0]>0:!0)))return{data:{index:_,overflows:I},reset:{placement:le}};let ne=(M=I.filter(R=>R.overflows[0]<=0).sort((R,x)=>R.overflows[1]-x.overflows[1])[0])==null?void 0:M.placement;if(!ne)switch(l){case"bestFit":{var H;const R=(H=I.filter(x=>{if(S){const L=de(x.placement);return L===y||L==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(L=>L>0).reduce((L,D)=>L+D,0)]).sort((x,L)=>x[1]-L[1])[0])==null?void 0:H[0];R&&(ne=R);break}case"initialPlacement":ne=a;break}if(o!==ne)return{reset:{placement:ne}}}return{}}}};function mr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vr(e){return Pa.some(t=>e[t]>=0)}const Ha=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=me(e,t);switch(r){case"referenceHidden":{const i=await at(t,{...o,elementContext:"reference"}),s=mr(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vr(s)}}}case"escaped":{const i=await at(t,{...o,altBoundary:!0}),s=mr(i,n.floating);return{data:{escapedOffsets:s,escaped:vr(s)}}}default:return{}}}}},uo=new Set(["left","top"]);async function _a(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ve(n),a=Ue(n),u=de(n)==="y",c=uo.has(s)?-1:1,d=i&&u?-1:1,h=me(t,e);let{mainAxis:p,crossAxis:l,alignmentAxis:f}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof f=="number"&&(l=a==="end"?f*-1:f),u?{x:l*d,y:p*c}:{x:p*c,y:l*d}}const ja=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,u=await _a(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},Wa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...u}=me(e,t),c={x:n,y:r},d=await at(t,u),h=de(ve(o)),p=qn(h);let l=c[p],f=c[h];if(i){const m=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=l+d[m],C=l-d[v];l=bn(y,l,C)}if(s){const m=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=f+d[m],C=f-d[v];f=bn(y,f,C)}const g=a.fn({...t,[p]:l,[h]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[h]:s}}}}}},Ka=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=me(e,t),d={x:n,y:r},h=de(o),p=qn(h);let l=d[p],f=d[h];const g=me(a,t),m=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const C=p==="y"?"height":"width",w=i.reference[p]-i.floating[C]+m.mainAxis,T=i.reference[p]+i.reference[C]-m.mainAxis;l<w?l=w:l>T&&(l=T)}if(c){var v,y;const C=p==="y"?"width":"height",w=uo.has(ve(o)),T=i.reference[h]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[h])||0)+(w?0:m.crossAxis),S=i.reference[h]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[h])||0)-(w?m.crossAxis:0);f<T?f=T:f>S&&(f=S)}return{[p]:l,[h]:f}}}},Ua=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:u=()=>{},...c}=me(e,t),d=await at(t,c),h=ve(o),p=Ue(o),l=de(o)==="y",{width:f,height:g}=i.floating;let m,v;h==="top"||h==="bottom"?(m=h,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,m=p==="end"?"top":"bottom");const y=g-d.top-d.bottom,C=f-d.left-d.right,w=be(g-d[m],y),T=be(f-d[v],C),S=!t.middlewareData.shift;let k=w,$=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),S&&!p){const I=J(d.left,0),A=J(d.right,0),M=J(d.top,0),H=J(d.bottom,0);l?$=f-2*(I!==0||A!==0?I+A:J(d.left,d.right)):k=g-2*(M!==0||H!==0?M+H:J(d.top,d.bottom))}await u({...t,availableWidth:$,availableHeight:k});const b=await s.getDimensions(a.floating);return f!==b.width||g!==b.height?{reset:{rects:!0}}:{}}}};function qt(){return typeof window!="undefined"}function qe(e){return fo(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ge(e){var t;return(t=(fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fo(e){return qt()?e instanceof Node||e instanceof Z(e).Node:!1}function ae(e){return qt()?e instanceof Element||e instanceof Z(e).Element:!1}function he(e){return qt()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function yr(e){return!qt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}const qa=new Set(["inline","contents"]);function ht(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!qa.has(o)}const Xa=new Set(["table","td","th"]);function Ya(e){return Xa.has(qe(e))}const za=[":popover-open",":modal"];function Xt(e){return za.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const Ja=["transform","translate","scale","rotate","perspective"],Za=["transform","translate","scale","rotate","perspective","filter"],Qa=["paint","layout","strict","content"];function zn(e){const t=Jn(),n=ae(e)?ce(e):e;return Ja.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Za.some(r=>(n.willChange||"").includes(r))||Qa.some(r=>(n.contain||"").includes(r))}function ec(e){let t=Ee(e);for(;he(t)&&!je(t);){if(zn(t))return t;if(Xt(t))return null;t=Ee(t)}return null}function Jn(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tc=new Set(["html","body","#document"]);function je(e){return tc.has(qe(e))}function ce(e){return Z(e).getComputedStyle(e)}function Yt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if(qe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yr(e)&&e.host||ge(e);return yr(t)?t.host:t}function ho(e){const t=Ee(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:he(t)&&ht(t)?t:ho(t)}function ct(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ho(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Z(o);if(i){const a=Cn(s);return t.concat(s,s.visualViewport||[],ht(o)?o:[],a&&n?ct(a):[])}return t.concat(o,ct(o,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function go(e){const t=ce(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=he(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Lt(n)!==i||Lt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Zn(e){return ae(e)?e:e.contextElement}function _e(e){const t=Zn(e);if(!he(t))return fe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=go(t);let s=(i?Lt(n.width):n.width)/r,a=(i?Lt(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nc=fe(0);function po(e){const t=Z(e);return!Jn()||!t.visualViewport?nc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function Re(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Zn(e);let s=fe(1);t&&(r?ae(r)&&(s=_e(r)):s=_e(e));const a=rc(i,n,r)?po(i):fe(0);let u=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const p=Z(i),l=r&&ae(r)?Z(r):r;let f=p,g=Cn(f);for(;g&&r&&l!==f;){const m=_e(g),v=g.getBoundingClientRect(),y=ce(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*m.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*m.y;u*=m.x,c*=m.y,d*=m.x,h*=m.y,u+=C,c+=w,f=Z(g),g=Cn(f)}}return Ft({width:d,height:h,x:u,y:c})}function zt(e,t){const n=Yt(e).scrollLeft;return t?t.left+n:Re(ge(e)).left+n}function mo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function oc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ge(r),a=t?Xt(t.floating):!1;if(r===s||a&&i)return n;let u={scrollLeft:0,scrollTop:0},c=fe(1);const d=fe(0),h=he(r);if((h||!h&&!i)&&((qe(r)!=="body"||ht(s))&&(u=Yt(r)),he(r))){const l=Re(r);c=_e(r),d.x=l.x+r.clientLeft,d.y=l.y+r.clientTop}const p=s&&!h&&!i?mo(s,u):fe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-u.scrollTop*c.y+d.y+p.y}}function ic(e){return Array.from(e.getClientRects())}function sc(e){const t=ge(e),n=Yt(e),r=e.ownerDocument.body,o=J(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=J(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zt(e);const a=-n.scrollTop;return ce(r).direction==="rtl"&&(s+=J(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const br=25;function ac(e,t){const n=Z(e),r=ge(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,u=0;if(o){i=o.width,s=o.height;const d=Jn();(!d||d&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const c=zt(r);if(c<=0){const d=r.ownerDocument,h=d.body,p=getComputedStyle(h),l=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,f=Math.abs(r.clientWidth-h.clientWidth-l);f<=br&&(i-=f)}else c<=br&&(i+=c);return{width:i,height:s,x:a,y:u}}const cc=new Set(["absolute","fixed"]);function lc(e,t){const n=Re(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=he(e)?_e(e):fe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,u=o*i.x,c=r*i.y;return{width:s,height:a,x:u,y:c}}function Er(e,t,n){let r;if(t==="viewport")r=ac(e,n);else if(t==="document")r=sc(ge(e));else if(ae(t))r=lc(t,n);else{const o=po(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ft(r)}function vo(e,t){const n=Ee(e);return n===t||!ae(n)||je(n)?!1:ce(n).position==="fixed"||vo(n,t)}function uc(e,t){const n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(a=>ae(a)&&qe(a)!=="body"),o=null;const i=ce(e).position==="fixed";let s=i?Ee(e):e;for(;ae(s)&&!je(s);){const a=ce(s),u=zn(s);!u&&a.position==="fixed"&&(o=null),(i?!u&&!o:!u&&a.position==="static"&&!!o&&cc.has(o.position)||ht(s)&&!u&&vo(e,s))?r=r.filter(d=>d!==s):o=a,s=Ee(s)}return t.set(e,r),r}function dc(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Xt(t)?[]:uc(t,this._c):[].concat(n),r],a=s[0],u=s.reduce((c,d)=>{const h=Er(t,d,o);return c.top=J(h.top,c.top),c.right=be(h.right,c.right),c.bottom=be(h.bottom,c.bottom),c.left=J(h.left,c.left),c},Er(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function fc(e){const{width:t,height:n}=go(e);return{width:t,height:n}}function hc(e,t,n){const r=he(t),o=ge(t),i=n==="fixed",s=Re(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=fe(0);function c(){u.x=zt(o)}if(r||!r&&!i)if((qe(t)!=="body"||ht(o))&&(a=Yt(t)),r){const l=Re(t,!0,i,t);u.x=l.x+t.clientLeft,u.y=l.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=o&&!r&&!i?mo(o,a):fe(0),h=s.left+a.scrollLeft-u.x-d.x,p=s.top+a.scrollTop-u.y-d.y;return{x:h,y:p,width:s.width,height:s.height}}function ln(e){return ce(e).position==="static"}function Cr(e,t){if(!he(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ge(e)===n&&(n=n.ownerDocument.body),n}function yo(e,t){const n=Z(e);if(Xt(e))return n;if(!he(e)){let o=Ee(e);for(;o&&!je(o);){if(ae(o)&&!ln(o))return o;o=Ee(o)}return n}let r=Cr(e,t);for(;r&&Ya(r)&&ln(r);)r=Cr(r,t);return r&&je(r)&&ln(r)&&!zn(r)?n:r||ec(e)||n}const gc=async function(e){const t=this.getOffsetParent||yo,n=this.getDimensions,r=await n(e.floating);return{reference:hc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pc(e){return ce(e).direction==="rtl"}const mc={convertOffsetParentRelativeRectToViewportRelativeRect:oc,getDocumentElement:ge,getClippingRect:dc,getOffsetParent:yo,getElementRects:gc,getClientRects:ic,getDimensions:fc,getScale:_e,isElement:ae,isRTL:pc};function bo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t){let n=null,r;const o=ge(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:p,height:l}=c;if(a||t(),!p||!l)return;const f=vt(h),g=vt(o.clientWidth-(d+p)),m=vt(o.clientHeight-(h+l)),v=vt(d),C={rootMargin:-f+"px "+-g+"px "+-m+"px "+-v+"px",threshold:J(0,be(1,u))||1};let w=!0;function T(S){const k=S[0].intersectionRatio;if(k!==u){if(!w)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!bo(c,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch(S){n=new IntersectionObserver(T,C)}n.observe(e)}return s(!0),i}function yc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Zn(e),d=o||i?[...c?ct(c):[],...ct(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const h=c&&a?vc(c,n):null;let p=-1,l=null;s&&(l=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&l&&(l.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=l)==null||C.observe(t)})),n()}),c&&!u&&l.observe(c),l.observe(t));let f,g=u?Re(e):null;u&&m();function m(){const v=Re(e);g&&!bo(g,v)&&n(),g=v,f=requestAnimationFrame(m)}return n(),()=>{var v;d.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),h==null||h(),(v=l)==null||v.disconnect(),l=null,u&&cancelAnimationFrame(f)}}const bc=ja,Ec=Wa,Cc=Ba,wc=Ua,Ic=Ha,Tc=Ga,xc=Ka,Oc=(e,t,n)=>{const r=new Map,o={platform:mc,...n},i={...o.platform,_c:r};return Ma(e,t,{...o,platform:i})};function wr(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Pc(e){if(!e)return wr();const{x:t,y:n,width:r,height:o}=e;return wr(t,n,r,o)}function Rc(e,t){return{contextElement:U(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?Pc(r):n.getBoundingClientRect()}}}var ze=e=>({variable:e,reference:`var(${e})`}),pe={arrowSize:ze("--arrow-size"),arrowSizeHalf:ze("--arrow-size-half"),arrowBg:ze("--arrow-background"),transformOrigin:ze("--transform-origin"),arrowOffset:ze("--arrow-offset")},Sc=e=>e==="top"||e==="bottom"?"y":"x";function kc(e,t){return{name:"transformOrigin",fn(n){var b,I,A,M,H;const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,u=i.split("-")[0],c=Sc(u),d=((b=o.arrow)==null?void 0:b.x)||0,h=((I=o.arrow)==null?void 0:I.y)||0,p=(t==null?void 0:t.clientWidth)||0,l=(t==null?void 0:t.clientHeight)||0,f=d+p/2,g=h+l/2,m=Math.abs(((A=o.shift)==null?void 0:A.y)||0),v=s.reference.height/2,y=l/2,C=(H=(M=e.offset)==null?void 0:M.mainAxis)!=null?H:e.gutter,w=typeof C=="number"?C+y:C!=null?C:y,T=m>w,S={top:`${f}px calc(100% + ${w}px)`,bottom:`${f}px ${-w}px`,left:`calc(100% + ${w}px) ${g}px`,right:`${-w}px ${g}px`}[u],k=`${f}px ${s.reference.y+v-a}px`,$=!!e.overlap&&c==="y"&&T;return r.floating.style.setProperty(pe.transformOrigin.variable,$?k:S),{data:{transformOrigin:$?k:S}}}}}var Nc={name:"rects",fn({rects:e}){return{data:e}}},Ac=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${pe.arrowOffset.reference})`}),{}}}};function Lc(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var Vc={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Ir(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Qn(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function Fc(e,t,n){const r=e||t.createElement("div");return Tc({element:r,padding:n.arrowPadding})}function Dc(e,t){var n;if(!Ui((n=t.offset)!=null?n:t.gutter))return bc(({placement:r})=>{var d,h,p,l;const o=((e==null?void 0:e.clientHeight)||0)/2,i=(h=(d=t.offset)==null?void 0:d.mainAxis)!=null?h:t.gutter,s=typeof i=="number"?i+o:i!=null?i:o,{hasAlign:a}=Lc(r),u=a?void 0:t.shift,c=(l=(p=t.offset)==null?void 0:p.crossAxis)!=null?l:u;return Fn({crossAxis:c,mainAxis:s,alignmentAxis:t.shift})})}function $c(e){if(!e.flip)return;const t=Qn(e.boundary);return Cc({...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function Mc(e){if(!e.slide&&!e.overlap)return;const t=Qn(e.boundary);return Ec({...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:xc()})}function Gc(e){return wc({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:o}){const i=t.floating,s=Math.round(n.reference.width),a=Math.round(n.reference.height);o=Math.floor(o),r=Math.floor(r),i.style.setProperty("--reference-width",`${s}px`),i.style.setProperty("--reference-height",`${a}px`),i.style.setProperty("--available-width",`${o}px`),i.style.setProperty("--available-height",`${r}px`)}})}function Bc(e){var t;if(e.hideWhenDetached)return Ic({strategy:"referenceHidden",boundary:(t=Qn(e.boundary))!=null?t:"clippingAncestors"})}function Hc(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function _c(e,t,n={}){const r=Rc(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},Vc,n),i=t.querySelector("[data-part=arrow]"),s=[Dc(i,o),$c(o),Mc(o),Fc(i,t.ownerDocument,o),Ac(i),kc({gutter:o.gutter,offset:o.offset,overlap:o.overlap},i),Gc(o),Bc(o),Nc],{placement:a,strategy:u,onComplete:c,onPositioned:d}=o,h=async()=>{var w;if(!r||!t)return;const g=await Oc(r,t,{placement:a,middleware:s,strategy:u});c==null||c(g),d==null||d({placed:!0});const m=q(t),v=Ir(m,g.x),y=Ir(m,g.y);t.style.setProperty("--x",`${v}px`),t.style.setProperty("--y",`${y}px`),o.hideWhenDetached&&(((w=g.middlewareData.hide)==null?void 0:w.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const C=t.firstElementChild;if(C){const T=$n(C);t.style.setProperty("--z-index",T.zIndex)}},p=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:h,floatingElement:t}),d==null||d({placed:!0})):await h()},l=Hc(o.listeners),f=o.listeners?yc(r,t,p,l):es;return p(),()=>{f==null||f(),d==null||d({placed:!1})}}function Tr(e,t,n={}){const{defer:r,...o}=n,i=r?j:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,u=typeof t=="function"?t():t;s.push(_c(a,u,o))})),()=>{s.forEach(a=>a==null?void 0:a())}}var jc={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Wc(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:pe.arrowSize.reference,height:pe.arrowSize.reference,[pe.arrowSizeHalf.variable]:`calc(${pe.arrowSize.reference} / 2)`,[pe.arrowOffset.variable]:`calc(${pe.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?jc[t.split("-")[0]]:void 0,background:pe.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function Kc(e){const t={each(n){var r;for(let o=0;o<((r=e.frames)==null?void 0:r.length);o+=1){const i=e.frames[o];i&&n(i)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch(s){}}),()=>{try{t.removeEventListener(n,r,o)}catch(i){}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch(s){}})}};return t}function Uc(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t==null||t.addEventListener(n,r,o)}catch(i){}return()=>{try{t==null||t.removeEventListener(n,r,o)}catch(i){}}},removeEventListener:(n,r,o)=>{try{t==null||t.removeEventListener(n,r,o)}catch(i){}}}}var xr="pointerdown.outside",Or="focus.outside";function qc(e){for(const t of e)if(U(t)&&ye(t))return!0;return!1}var Eo=e=>"clientY"in e;function Xc(e,t){if(!Eo(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function Yc(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Pr(e,t){if(!t||!Eo(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return Yc(s,a)?r||i:!1}function zc(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const u=Q(e),c=q(e),d=Kc(c),h=Uc(c);function p(C,w){if(!U(w)||!w.isConnected||Pe(e,w)||Xc(e,C)||a&&zr(e,w))return!1;const T=u.querySelector(`[aria-controls="${e.id}"]`);if(T){const k=vn(T);if(Pr(C,k))return!1}const S=vn(e);return Pr(C,S)?!1:!(n!=null&&n(w))}const l=new Set,f=Oe(e==null?void 0:e.getRootNode());function g(C){function w(T){var b,I;const S=s&&!lr()?j:A=>A(),k=T!=null?T:C,$=(I=(b=k==null?void 0:k.composedPath)==null?void 0:b.call(k))!=null?I:[k==null?void 0:k.target];S(()=>{const A=f?$[0]:K(C);if(!(!e||!p(C,A))){if(o||i){const M=gn(o,i);e.addEventListener(xr,M,{once:!0})}Rr(e,xr,{bubbles:!1,cancelable:!0,detail:{originalEvent:k,contextmenu:Fs(k),focusable:qc($),target:A}})}})}C.pointerType==="touch"?(l.forEach(T=>T()),l.add(W(u,"click",w,{once:!0})),l.add(h.addEventListener("click",w,{once:!0})),l.add(d.addEventListener("click",w,{once:!0}))):w()}const m=new Set,v=setTimeout(()=>{m.add(W(u,"pointerdown",g,!0)),m.add(h.addEventListener("pointerdown",g,!0)),m.add(d.addEventListener("pointerdown",g,!0))},0);function y(C){(s?j:T=>T())(()=>{const T=K(C);if(!(!e||!p(C,T))){if(r||i){const S=gn(r,i);e.addEventListener(Or,S,{once:!0})}Rr(e,Or,{bubbles:!1,cancelable:!0,detail:{originalEvent:C,contextmenu:!1,focusable:ye(T),target:T}})}})}return lr()||(m.add(W(u,"focusin",y,!0)),m.add(h.addEventListener("focusin",y,!0)),m.add(d.addEventListener("focusin",y,!0))),()=>{clearTimeout(v),l.forEach(C=>C()),m.forEach(C=>C())}}function Jc(e,t){const{defer:n}=t,r=n?j:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(zc(i,t))})),()=>{o.forEach(i=>i==null?void 0:i())}}function Rr(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function Zc(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return W(Q(e),"keydown",n,{capture:!0})}var Sr="layer:request-dismiss",oe={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>Pe(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Pe(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>oe.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];el(e,Sr,o=>{var i;(i=r.requestDismiss)==null||i.call(r,o),o.defaultPrevented||r==null||r.dismiss()}),Qc(e,Sr,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Qc(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function el(e,t,n){e.addEventListener(t,n,{once:!0})}var kr;function Nr(){oe.layers.forEach(({node:e})=>{e.style.pointerEvents=oe.isBelowPointerBlockingLayer(e)?"none":"auto"})}function tl(e){e.style.pointerEvents=""}function nl(e,t){const n=Q(e),r=[];return oe.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(kr=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(o=>{const[i,s]=ga(()=>{const a=o();return U(a)?a:null},{timeout:1e3});i.then(a=>r.push(Nt(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{oe.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=kr,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(o=>o()))}}function rl(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){pn("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:u="dialog"}=t,c={dismiss:r,node:e,type:u,pointerBlocking:i,requestDismiss:o};oe.add(c),Nr();function d(g){var v,y;const m=K(g.detail.originalEvent);oe.isBelowPointerBlockingLayer(e)||oe.isInBranch(m)||((v=t.onPointerDownOutside)==null||v.call(t,g),(y=t.onInteractOutside)==null||y.call(t,g),!g.defaultPrevented&&(a&&console.log("onPointerDownOutside:",g.detail.originalEvent),r==null||r()))}function h(g){var v,y;const m=K(g.detail.originalEvent);oe.isInBranch(m)||((v=t.onFocusOutside)==null||v.call(t,g),(y=t.onInteractOutside)==null||y.call(t,g),!g.defaultPrevented&&(a&&console.log("onFocusOutside:",g.detail.originalEvent),r==null||r()))}function p(g){var m;oe.isTopMost(e)&&((m=t.onEscapeKeyDown)==null||m.call(t,g),!g.defaultPrevented&&r&&(g.preventDefault(),r()))}function l(g){var C;if(!e)return!1;const m=typeof s=="function"?s():s,v=Array.isArray(m)?m:[m],y=(C=t.persistentElements)==null?void 0:C.map(w=>w()).filter(U);return y&&v.push(...y),v.some(w=>Pe(w,g))||oe.isInNestedLayer(e,g)}const f=[i?nl(e,t.persistentElements):void 0,Zc(e,p),Jc(e,{exclude:l,onFocusOutside:h,onPointerDownOutside:d,defer:t.defer})];return()=>{oe.remove(e),Nr(),tl(e),f.forEach(g=>g==null?void 0:g())}}function Co(e,t){const{defer:n}=t,r=n?j:i=>i(),o=[];return o.push(r(()=>{const i=Ge(e)?e():e;o.push(rl(i,t))})),()=>{o.forEach(i=>i==null?void 0:i())}}const[wo,Io]=X({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),To=e=>te()(e,["lazyMount","unmountOnExit"]);function ol(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var il={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",$n(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&(i==null?void 0:i.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});j(()=>{var a,u;const s=yt(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||((a=t.get("styles"))==null?void 0:a.display)==="none"||((u=t.get("styles"))==null?void 0:u.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{j(()=>{e.set("prevAnimationName",yt(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=u=>{var d,h,p;((p=(h=(d=u.composedPath)==null?void 0:d.call(u))==null?void 0:h[0])!=null?p:u.target)===o&&e.set("prevAnimationName",yt(t.get("styles")))},s=u=>{const c=yt(t.get("styles"));K(u)===o&&c===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",s),o.addEventListener("animationend",s);const a=Nt(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",s),o.removeEventListener("animationend",s),to(()=>a())}}}}};function yt(e){return(e==null?void 0:e.animationName)||"none"}ee()(["onExitComplete","present","immediate"]);function xo(e,t={}){const{sync:n=!1}=t,r=sl(e);return E.useCallback((...o)=>{var i;return n?queueMicrotask(()=>{var s;return(s=r.current)==null?void 0:s.call(r,...o)}):(i=r.current)==null?void 0:i.call(r,...o)},[n,r])}function sl(e){const t=E.useRef(e);return t.current=e,t}const Jt=(e={})=>{const{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:o=!1,...i}=e,s=E.useRef(!1),a={...i,present:r,onExitComplete:xo(e.onExitComplete)},u=ke(il,a),c=ol(u);c.present&&(s.current=!0);const d=!c.present&&!s.current&&t||n&&!c.present&&s.current,h=()=>({"data-state":c.skip&&o?void 0:r?"open":"closed",hidden:!c.present});return{ref:c.setNode,getPresenceProps:h,present:c.present,unmounted:d}},[er,gt]=X({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Oo=e=>te()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);var De=new WeakMap,bt=new WeakMap,Et={},un=0,Po=e=>e&&(e.host||Po(e.parentNode)),al=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Po(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),cl=new Set(["script","output","status","next-route-announcer"]),ll=e=>cl.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),ul=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:o,followControlledElements:i=!0}=t,s=al(n,Array.isArray(e)?e:[e]);Et[r]||(Et[r]=new WeakMap);const a=Et[r],u=[],c=new Set,d=new Set(s),h=l=>{!l||c.has(l)||(c.add(l),h(l.parentNode))};s.forEach(l=>{h(l),i&&U(l)&&Jr(l,f=>{h(f)})});const p=l=>{!l||d.has(l)||Array.prototype.forEach.call(l.children,f=>{if(c.has(f))p(f);else try{if(ll(f))return;const m=f.getAttribute(o)==="true",v=(De.get(f)||0)+1,y=(a.get(f)||0)+1;De.set(f,v),a.set(f,y),u.push(f),v===1&&m&&bt.set(f,!0),y===1&&f.setAttribute(r,""),m||f.setAttribute(o,"true")}catch(g){console.error("[zag-js > ariaHidden] cannot operate on ",f,g)}})};return p(n),c.clear(),un++,()=>{u.forEach(l=>{const f=De.get(l)-1,g=a.get(l)-1;De.set(l,f),a.set(l,g),f||(bt.has(l)||l.removeAttribute(o),bt.delete(l)),g||l.removeAttribute(r)}),un--,un||(De=new WeakMap,De=new WeakMap,bt=new WeakMap,Et={})}},dl=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,fl=(e,t=dl(e),n="data-aria-hidden",r=!0)=>{if(t)return ul(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},hl=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function gl(e,t={}){const{defer:n=!0}=t,r=n?hl:i=>i(),o=[];return o.push(r(()=>{const s=(typeof e=="function"?e():e).filter(Boolean);s.length!==0&&o.push(fl(s))})),()=>{o.forEach(i=>i==null?void 0:i())}}var pl=Object.defineProperty,ml=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t,n)=>ml(e,typeof t!="symbol"?t+"":t,n),Ar={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},vl=[],yl=class{constructor(e,t){G(this,"trapStack"),G(this,"config"),G(this,"doc"),G(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),G(this,"portalContainers",new Set),G(this,"listenerCleanups",[]),G(this,"handleFocus",r=>{const o=K(r),i=this.findContainerIndex(o,r)>=0;if(i||_t(o))i&&(this.state.mostRecentlyFocusedNode=o);else{r.stopImmediatePropagation();let s,a=!0;if(this.state.mostRecentlyFocusedNode)if(Ye(this.state.mostRecentlyFocusedNode)>0){const u=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[u];if(c.length>0){const d=c.findIndex(h=>h===this.state.mostRecentlyFocusedNode);d>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?d+1<c.length&&(s=c[d+1],a=!1):d-1>=0&&(s=c[d-1],a=!1))}}else this.state.containerGroups.some(u=>u.tabbableNodes.some(c=>Ye(c)>0))||(a=!1);else a=!1;a&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),G(this,"handlePointerDown",r=>{const o=K(r);if(!(this.findContainerIndex(o,r)>=0)){if(Ze(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Ze(this.config.allowOutsideClick,r)||r.preventDefault()}}),G(this,"handleClick",r=>{const o=K(r);this.findContainerIndex(o,r)>=0||Ze(this.config.clickOutsideDeactivates,r)||Ze(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),G(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const o=this.config.isKeyBackward(r),i=this.findNextNavNode({event:r,isBackward:o});if(!i)return;Je(r)&&r.preventDefault(),this.tryFocus(i)}}),G(this,"handleEscapeKey",r=>{bl(r)&&Ze(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),G(this,"_mutationObserver"),G(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(o=>{o.some(a=>Array.from(a.removedNodes).some(c=>c===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),o.some(a=>a.type==="attributes"&&(a.attributeName==="aria-controls"||a.attributeName==="aria-expanded")?!0:a.type==="childList"&&a.addedNodes.length>0?Array.from(a.addedNodes).some(u=>{if(u.nodeType!==Node.ELEMENT_NODE)return!1;const c=u;return bs(c)?!0:c.id&&!this.state.containers.some(d=>d.contains(c))?Es(c):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),G(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(o=>{var i;(i=this._mutationObserver)==null||i.observe(o,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(o=>{this.observePortalContainer(o)}))}),G(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!ye(r)){const o=it(this.doc);if(o&&this.findContainerIndex(o)>=0)r=o;else{const i=this.state.tabbableGroups[0];r=i&&i.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),G(this,"tryFocus",r=>{if(r!==!1&&r!==it(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,El(r)&&r.select()}}),G(this,"deactivate",r=>{if(!this.state.active)return this;const o={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),Ar.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const i=this.getOption(o,"onDeactivate"),s=this.getOption(o,"onPostDeactivate"),a=this.getOption(o,"checkCanReturnFocus"),u=this.getOption(o,"returnFocus","returnFocusOnDeactivate");i==null||i();const c=()=>{Lr(()=>{if(u){const d=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(d)}s==null||s()})};if(u&&a){const d=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return a(d).then(c,c),this}return c(),this}),G(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onPause"),i=this.getOption(r,"onPostPause");return this.state.paused=!0,o==null||o(),this.removeListeners(),this.updateObservedNodes(),i==null||i(),this}),G(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const o=this.getOption(r,"onUnpause"),i=this.getOption(r,"onPostUnpause");return this.state.paused=!1,o==null||o(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),i==null||i(),this}),G(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),G(this,"getReturnFocusNode",r=>{const o=this.getNodeForOption("setReturnFocus",{params:[r]});return o||(o===!1?!1:r)}),G(this,"getOption",(r,o,i)=>r&&r[o]!==void 0?r[o]:this.config[i||o]),G(this,"getNodeForOption",(r,{hasFallback:o=!1,params:i=[]}={})=>{let s=this.config[r];if(typeof s=="function"&&(s=s(...i)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let a=s;if(typeof s=="string"){try{a=this.doc.querySelector(s)}catch(u){throw new Error(`\`${r}\` appears to be an invalid selector; error="${u.message}"`)}if(!a&&!o)throw new Error(`\`${r}\` as selector refers to no known node`)}return a}),G(this,"findNextNavNode",r=>{const{event:o,isBackward:i=!1}=r,s=r.target||K(o);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const u=this.findContainerIndex(s,o),c=u>=0?this.state.containerGroups[u]:void 0;if(u<0)i?a=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:a=this.state.tabbableGroups[0].firstTabbableNode;else if(i){let d=this.state.tabbableGroups.findIndex(({firstTabbableNode:h})=>s===h);if(d<0&&((c==null?void 0:c.container)===s||ye(s)&&!Ie(s)&&!(c!=null&&c.nextTabbableNode(s,!1)))&&(d=u),d>=0){const h=d===0?this.state.tabbableGroups.length-1:d-1,p=this.state.tabbableGroups[h];a=Ye(s)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else Je(o)||(a=c==null?void 0:c.nextTabbableNode(s,!1))}else{let d=this.state.tabbableGroups.findIndex(({lastTabbableNode:h})=>s===h);if(d<0&&((c==null?void 0:c.container)===s||ye(s)&&!Ie(s)&&!(c!=null&&c.nextTabbableNode(s)))&&(d=u),d>=0){const h=d===this.state.tabbableGroups.length-1?0:d+1,p=this.state.tabbableGroups[h];a=Ye(s)>=0?p.firstTabbableNode:p.firstDomTabbableNode}else Je(o)||(a=c==null?void 0:c.nextTabbableNode(s))}}else a=this.getNodeForOption("fallbackFocus");return a}),this.trapStack=t.trapStack||vl;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return Je(r)&&!r.shiftKey},isKeyBackward(r){return Je(r)&&r.shiftKey},...t};this.doc=n.document||Q(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{ms(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:o})=>r.contains(e)||(n==null?void 0:n.includes(r))||o.find(i=>i===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?zr(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=Kt(e),n=Wn(e),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,i=n.find(c=>Ie(c)),s=n.slice().reverse().find(c=>Ie(c)),a=!!t.find(c=>Ye(c)>0);function u(c,d=!0){const h=t.indexOf(c);return h<0?d?n.slice(n.indexOf(c)+1).find(p=>Ie(p)):n.slice(0,n.indexOf(c)).reverse().find(p=>Ie(p)):t[h+(d?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:a,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:i,lastDomTabbableNode:s,nextTabbableNode:u}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return Ar.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Lr(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(W(this.doc,"focusin",this.handleFocus,!0),W(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),W(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),W(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),W(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),W(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=it(this.doc),t==null||t();const o=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(o,o),this):(o(),this)}},Je=e=>e.key==="Tab",Ze=(e,...t)=>typeof e=="function"?e(...t):e,bl=e=>!e.isComposing&&e.key==="Escape",Lr=e=>setTimeout(e,0),El=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function Cl(e,t={}){let n;const r=j(()=>{const o=typeof e=="function"?e():e;if(o){n=new yl(o,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:o,...t,document:Q(o)});try{n.activate()}catch(i){}}});return function(){n==null||n.deactivate(),r()}}var dn="data-scroll-lock";function wl(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function Il(e){var p;const t=e!=null?e:document,n=(p=t.defaultView)!=null?p:window,{documentElement:r,body:o}=t;if(o.hasAttribute(dn))return;const s=n.innerWidth-r.clientWidth;o.setAttribute(dn,"");const a=()=>ua(r,"--scrollbar-width",`${s}px`),u=wl(r),c=()=>Nt(o,{overflow:"hidden",[u]:`${s}px`}),d=()=>{var C,w;const{scrollX:l,scrollY:f,visualViewport:g}=n,m=(C=g==null?void 0:g.offsetLeft)!=null?C:0,v=(w=g==null?void 0:g.offsetTop)!=null?w:0,y=Nt(o,{position:"fixed",overflow:"hidden",top:`${-(f-Math.floor(v))}px`,left:`${-(l-Math.floor(m))}px`,right:"0",[u]:`${s}px`});return()=>{y==null||y(),n.scrollTo({left:l,top:f,behavior:"instant"})}},h=[a(),Qr()?d():c()];return()=>{h.forEach(l=>l==null?void 0:l()),o.removeAttribute(dn)}}const[Ro,Zt]=X({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),So=E.forwardRef((e,t)=>{const n=Zt(),r=V(n.getControlProps(),e);return P.jsx(F.div,{...r,ref:t})});So.displayName="CheckboxControl";function Tl(e){return!(e.metaKey||!ut()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var xl=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ol(e,t,n){const r=n?K(n):null,o=q(r);return e=e||r instanceof o.HTMLInputElement&&!xl.has(r==null?void 0:r.type)||r instanceof o.HTMLTextAreaElement||r instanceof o.HTMLElement&&r.isContentEditable,!(e&&t==="keyboard"&&n instanceof o.KeyboardEvent&&!Reflect.has(Pl,n.key))}var Ae=null,wn=new Set,Dt=new Map,Se=!1,In=!1,Pl={Tab:!0,Escape:!0};function Qt(e,t){for(let n of wn)n(e,t)}function $t(e){Se=!0,Tl(e)&&(Ae="keyboard",Qt("keyboard",e))}function ie(e){Ae="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Se=!0,Qt("pointer",e))}function ko(e){Ls(e)&&(Se=!0,Ae="virtual")}function No(e){const t=K(e);t===q(t)||t===Q(t)||(!Se&&!In&&(Ae="virtual",Qt("virtual",e)),Se=!1,In=!1)}function Ao(){Se=!1,In=!0}function Rl(e){if(typeof window=="undefined"||Dt.get(q(e)))return;const t=q(e),n=Q(e);let r=t.HTMLElement.prototype.focus;function o(){Ae="virtual",Qt("virtual",null),Se=!0,r.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:o})}catch(i){}n.addEventListener("keydown",$t,!0),n.addEventListener("keyup",$t,!0),n.addEventListener("click",ko,!0),t.addEventListener("focus",No,!0),t.addEventListener("blur",Ao,!1),typeof t.PointerEvent!="undefined"?(n.addEventListener("pointerdown",ie,!0),n.addEventListener("pointermove",ie,!0),n.addEventListener("pointerup",ie,!0)):(n.addEventListener("mousedown",ie,!0),n.addEventListener("mousemove",ie,!0),n.addEventListener("mouseup",ie,!0)),t.addEventListener("beforeunload",()=>{Sl(e)},{once:!0}),Dt.set(t,{focus:r})}var Sl=(e,t)=>{const n=q(e),r=Q(e),o=Dt.get(n);if(o){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:o.focus})}catch(i){}r.removeEventListener("keydown",$t,!0),r.removeEventListener("keyup",$t,!0),r.removeEventListener("click",ko,!0),n.removeEventListener("focus",No,!0),n.removeEventListener("blur",Ao,!1),typeof n.PointerEvent!="undefined"?(r.removeEventListener("pointerdown",ie,!0),r.removeEventListener("pointermove",ie,!0),r.removeEventListener("pointerup",ie,!0)):(r.removeEventListener("mousedown",ie,!0),r.removeEventListener("mousemove",ie,!0),r.removeEventListener("mouseup",ie,!0)),Dt.delete(n)}};function lt(){return Ae==="keyboard"}function tr(e={}){const{isTextInput:t,autoFocus:n,onChange:r,root:o}=e;Rl(o),r==null||r({isFocusVisible:n||lt(),modality:Ae});const i=(s,a)=>{Ol(!!t,s,a)&&(r==null||r({isFocusVisible:lt(),modality:s}))};return wn.add(i),()=>{wn.delete(i)}}var Lo=ue("checkbox").parts("root","label","control","indicator"),Ct=Lo.build(),Vo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`checkbox:${e.id}`},Vr=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`checkbox:${e.id}:label`},kl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`checkbox:${e.id}:control`},Tn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenInput)!=null?n:`checkbox:${e.id}:input`},Nl=e=>e.getById(Vo(e)),rt=e=>e.getById(Tn(e));function Al(e,t){const{send:n,context:r,prop:o,computed:i,scope:s}=e,a=!!o("disabled"),u=!!o("readOnly"),c=!!o("required"),d=!!o("invalid"),h=!a&&r.get("focused"),p=!a&&r.get("focusVisible"),l=i("checked"),f=i("indeterminate"),g=r.get("checked"),m={"data-active":O(r.get("active")),"data-focus":O(h),"data-focus-visible":O(p),"data-readonly":O(u),"data-hover":O(r.get("hovered")),"data-disabled":O(a),"data-state":f?"indeterminate":l?"checked":"unchecked","data-invalid":O(d),"data-required":O(c)};return{checked:l,disabled:a,indeterminate:f,focused:h,checkedState:g,setChecked(v){n({type:"CHECKED.SET",checked:v,isTrusted:!1})},toggleChecked(){n({type:"CHECKED.TOGGLE",checked:l,isTrusted:!1})},getRootProps(){return t.label({...Ct.root.attrs,...m,dir:o("dir"),id:Vo(s),htmlFor:Tn(s),onPointerMove(){a||n({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||n({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(v){K(v)===rt(s)&&v.stopPropagation()}})},getLabelProps(){return t.element({...Ct.label.attrs,...m,dir:o("dir"),id:Vr(s)})},getControlProps(){return t.element({...Ct.control.attrs,...m,dir:o("dir"),id:kl(s),"aria-hidden":!0})},getIndicatorProps(){return t.element({...Ct.indicator.attrs,...m,dir:o("dir"),hidden:!f&&!l})},getHiddenInputProps(){return t.input({id:Tn(s),type:"checkbox",required:o("required"),defaultChecked:l,disabled:a,"aria-labelledby":Vr(s),"aria-invalid":d,name:o("name"),form:o("form"),value:o("value"),style:Ut,onFocus(){const v=lt();n({type:"CONTEXT.SET",context:{focused:!0,focusVisible:v}})},onBlur(){n({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(v){if(u){v.preventDefault();return}const y=v.currentTarget.checked;n({type:"CHECKED.SET",checked:y,isTrusted:!0})}})}}}var{not:Fr}=dt(),Ll={props({props:e}){var t;return{value:"on",...e,defaultChecked:(t=e.defaultChecked)!=null?t:!1}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var r;(r=e("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n("disabled")],()=>{r(["removeFocusIfNeeded"])}),e([()=>t.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:Fr("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Fr("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:e})=>Pt(e.get("checked")),checked:({context:e})=>Vl(e.get("checked")),disabled:({context:e,prop:t})=>!!t("disabled")||e.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t("disabled"))return ro({pointerNode:Nl(n),keyboardNode:rt(n),isValidKey:r=>r.key===" ",onPress:()=>e.set("active",!1),onPressStart:()=>e.set("active",!0),onPressEnd:()=>e.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){var n;if(!e("disabled"))return tr({root:(n=t.getRootNode)==null?void 0:n.call(t)})},trackFormControlState({context:e,scope:t}){return Wt(rt(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("checked",e.initial("checked"))}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){const r=rt(n);r&&(Hn(r,t("checked")),r.indeterminate=Pt(e.get("checked")))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.get("focused")&&(e.set("focused",!1),e.set("focusVisible",!1))},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e,computed:t}){const n=Pt(t("checked"))?!0:!t("checked");e.set("checked",n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{const n=rt(t);_n(n,{checked:e("checked")})})}}}};function Pt(e){return e==="indeterminate"}function Vl(e){return Pt(e)?!1:!!e}ee()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const Fo=Lo.extendWith("group");function Fl(e){const{value:t,onChange:n,defaultValue:r}=e,[o,i]=E.useState(r),s=t!==void 0,a=s?t:o,u=E.useCallback(c=>(s||i(c),n==null?void 0:n(c)),[s,n]);return[a,u]}function Dl(e={}){const{defaultValue:t,value:n,onValueChange:r,disabled:o,readOnly:i,name:s,invalid:a}=e,u=!(o||i),c=xo(r,{sync:!0}),[d,h]=Fl({value:n,defaultValue:t||[],onChange:c}),p=v=>d.some(y=>String(y)===String(v)),l=v=>{p(v)?g(v):f(v)},f=v=>{u&&(p(v)||h(d.concat(v)))},g=v=>{u&&h(d.filter(y=>String(y)!==String(v)))};return{isChecked:p,value:d,name:s,disabled:!!o,readOnly:!!i,invalid:!!a,setValue:h,addValue:f,toggleValue:l,getItemProps:v=>({checked:v.value!=null?p(v.value):void 0,onCheckedChange(){v.value!=null&&l(v.value)},name:s,disabled:o,readOnly:i,invalid:a})}}const[$l,Ml]=X({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),Do=E.forwardRef((e,t)=>{const[n,r]=te()(e,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),o=Dl(n);return P.jsx($l,{value:o,children:P.jsx(F.div,{ref:t,role:"group",...r,...Fo.build().group.attrs})})});Do.displayName="CheckboxGroup";const[nd,pt]=X({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),$o=E.forwardRef((e,t)=>{const n=Zt(),r=V(n.getHiddenInputProps(),e),o=pt();return P.jsx(F.input,{"aria-describedby":o==null?void 0:o.ariaDescribedby,...r,ref:t})});$o.displayName="CheckboxHiddenInput";const Mo=E.forwardRef((e,t)=>{const{indeterminate:n,...r}=e,o=Zt(),i=V(o.getIndicatorProps(),r),s=n?o.indeterminate:o.checked;return P.jsx(F.div,{...i,hidden:!s,ref:t})});Mo.displayName="CheckboxIndicator";const Go=E.forwardRef((e,t)=>{const n=Zt(),r=V(n.getLabelProps(),e);return P.jsx(F.span,{...r,ref:t})});Go.displayName="CheckboxLabel";const Gl=(e={})=>{const t=Ml(),n=pt(),r=E.useMemo(()=>{var c;return V(e,(c=t==null?void 0:t.getItemProps({value:e.value}))!=null?c:{})},[e,t]),o=E.useId(),{getRootNode:i}=Ne(),{dir:s}=Ke(),a={id:o,ids:{label:n==null?void 0:n.ids.label,hiddenInput:n==null?void 0:n.ids.control},dir:s,disabled:n==null?void 0:n.disabled,readOnly:n==null?void 0:n.readOnly,invalid:n==null?void 0:n.invalid,required:n==null?void 0:n.required,getRootNode:i,...r},u=ke(Ll,a);return Al(u,We)},Bo=E.forwardRef((e,t)=>{const[n,r]=te()(e,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),o=Gl(n),i=V(o.getRootProps(),r);return P.jsx(Ro,{value:o,children:P.jsx(F.label,{...i,ref:t})})});Bo.displayName="CheckboxRoot";const Ho=E.forwardRef((e,t)=>{const[{value:n},r]=te()(e,["value"]),o=V(n.getRootProps(),r);return P.jsx(Ro,{value:n,children:P.jsx(F.label,{...o,ref:t})})});Ho.displayName="CheckboxRootProvider";var Bl=Object.defineProperty,Hl=(e,t,n)=>t in e?Bl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N=(e,t,n)=>Hl(e,typeof t!="symbol"?t+"":t,n),Rt={itemToValue(e){return typeof e=="string"?e:rn(e)&&Ot(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:rn(e)&&Ot(e,"label")?e.label:Rt.itemToValue(e)},isItemDisabled(e){return rn(e)&&Ot(e,"disabled")?!!e.disabled:!1}},nr=class _o{constructor(t){this.options=t,N(this,"items"),N(this,"indexMap",null),N(this,"copy",n=>new _o({...this.options,items:n!=null?n:[...this.items]})),N(this,"isEqual",n=>Bt(this.items,n.items)),N(this,"setItems",n=>this.copy(n)),N(this,"getValues",(n=this.items)=>{const r=[];for(const o of n){const i=this.getItemValue(o);i!=null&&r.push(i)}return r}),N(this,"find",n=>{if(n==null)return null;const r=this.indexOf(n);return r!==-1?this.at(r):null}),N(this,"findMany",n=>{const r=[];for(const o of n){const i=this.find(o);i!=null&&r.push(i)}return r}),N(this,"at",n=>{var i;if(!this.options.groupBy&&!this.options.groupSort)return(i=this.items[n])!=null?i:null;let r=0;const o=this.group();for(const[,s]of o)for(const a of s){if(r===n)return a;r++}return null}),N(this,"sortFn",(n,r)=>{const o=this.indexOf(n),i=this.indexOf(r);return(o!=null?o:0)-(i!=null?i:0)}),N(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),N(this,"getItemValue",n=>{var r,o,i;return n==null?null:(i=(o=(r=this.options).itemToValue)==null?void 0:o.call(r,n))!=null?i:Rt.itemToValue(n)}),N(this,"getItemDisabled",n=>{var r,o,i;return n==null?!1:(i=(o=(r=this.options).isItemDisabled)==null?void 0:o.call(r,n))!=null?i:Rt.isItemDisabled(n)}),N(this,"stringifyItem",n=>{var r,o,i;return n==null?null:(i=(o=(r=this.options).itemToString)==null?void 0:o.call(r,n))!=null?i:Rt.itemToString(n)}),N(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),N(this,"stringifyItems",(n,r=", ")=>{const o=[];for(const i of n){const s=this.stringifyItem(i);s!=null&&o.push(s)}return o.join(r)}),N(this,"stringifyMany",(n,r)=>this.stringifyItems(this.findMany(n),r)),N(this,"has",n=>this.indexOf(n)!==-1),N(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),N(this,"group",()=>{const{groupBy:n,groupSort:r}=this.options;if(!n)return[["",[...this.items]]];const o=new Map;this.items.forEach((s,a)=>{const u=n(s,a);o.has(u)||o.set(u,[]),o.get(u).push(s)});let i=Array.from(o.entries());return r&&i.sort(([s],[a])=>{if(typeof r=="function")return r(s,a);if(Array.isArray(r)){const u=r.indexOf(s),c=r.indexOf(a);return u===-1?1:c===-1?-1:u-c}return r==="asc"?s.localeCompare(a):r==="desc"?a.localeCompare(s):0}),i}),N(this,"getNextValue",(n,r=1,o=!1)=>{let i=this.indexOf(n);if(i===-1)return null;for(i=o?Math.min(i+r,this.size-1):i+r;i<=this.size&&this.getItemDisabled(this.at(i));)i++;return this.getItemValue(this.at(i))}),N(this,"getPreviousValue",(n,r=1,o=!1)=>{let i=this.indexOf(n);if(i===-1)return null;for(i=o?Math.max(i-r,0):i-r;i>=0&&this.getItemDisabled(this.at(i));)i--;return this.getItemValue(this.at(i))}),N(this,"indexOf",n=>{var r;if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(o=>this.getItemValue(o)===n);if(!this.indexMap){this.indexMap=new Map;let o=0;const i=this.group();for(const[,s]of i)for(const a of s){const u=this.getItemValue(a);u!=null&&this.indexMap.set(u,o),o++}}return(r=this.indexMap.get(n))!=null?r:-1}),N(this,"getByText",(n,r)=>{const o=r!=null?this.indexOf(r):-1,i=n.length===1;for(let s=0;s<this.items.length;s++){const a=this.items[(o+s+1)%this.items.length];if(!(i&&this.getItemValue(a)===r)&&!this.getItemDisabled(a)&&_l(this.stringifyItem(a),n))return a}}),N(this,"search",(n,r)=>{const{state:o,currentValue:i,timeout:s=350}=r,a=o.keysSoFar+n,c=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,d=this.getByText(c,i),h=this.getItemValue(d);function p(){clearTimeout(o.timer),o.timer=-1}function l(f){o.keysSoFar=f,p(),f!==""&&(o.timer=+setTimeout(()=>{l(""),p()},s))}return l(a),h}),N(this,"update",(n,r)=>{let o=this.indexOf(n);return o===-1?this:this.copy([...this.items.slice(0,o),r,...this.items.slice(o+1)])}),N(this,"upsert",(n,r,o="append")=>{let i=this.indexOf(n);return i===-1?(o==="append"?this.append:this.prepend)(r):this.copy([...this.items.slice(0,i),r,...this.items.slice(i+1)])}),N(this,"insert",(n,...r)=>this.copy(Qe(this.items,n,...r))),N(this,"insertBefore",(n,...r)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Qe(this.items,o,...r))}),N(this,"insertAfter",(n,...r)=>{let o=this.indexOf(n);if(o===-1)if(this.items.length===0)o=0;else return this;return this.copy(Qe(this.items,o+1,...r))}),N(this,"prepend",(...n)=>this.copy(Qe(this.items,0,...n))),N(this,"append",(...n)=>this.copy(Qe(this.items,this.items.length,...n))),N(this,"filter",n=>{const r=this.items.filter((o,i)=>n(this.stringifyItem(o),i,o));return this.copy(r)}),N(this,"remove",(...n)=>{const r=n.map(o=>typeof o=="string"?o:this.getItemValue(o));return this.copy(this.items.filter(o=>{const i=this.getItemValue(o);return i==null?!1:!r.includes(i)}))}),N(this,"move",(n,r)=>{const o=this.indexOf(n);return o===-1?this:this.copy(wt(this.items,[o],r))}),N(this,"moveBefore",(n,...r)=>{let o=this.items.findIndex(s=>this.getItemValue(s)===n);if(o===-1)return this;let i=r.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(wt(this.items,i,o))}),N(this,"moveAfter",(n,...r)=>{let o=this.items.findIndex(s=>this.getItemValue(s)===n);if(o===-1)return this;let i=r.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(wt(this.items,i,o+1))}),N(this,"reorder",(n,r)=>this.copy(wt(this.items,[n],r))),N(this,"compareValue",(n,r)=>{const o=this.indexOf(n),i=this.indexOf(r);return o<i?-1:o>i?1:0}),N(this,"range",(n,r)=>{let o=[],i=n;for(;i!=null;){if(this.find(i)&&o.push(i),i===r)return o;i=this.getNextValue(i)}return[]}),N(this,"getValueRange",(n,r)=>n&&r?this.compareValue(n,r)<=0?this.range(n,r):this.range(r,n):[]),N(this,"toString",()=>{let n="";for(const r of this.items){const o=this.getItemValue(r),i=this.stringifyItem(r),s=this.getItemDisabled(r),a=[o,i,s].filter(Boolean).join(":");n+=a+","}return n}),N(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},_l=(e,t)=>!!(e!=null&&e.toLowerCase().startsWith(t.toLowerCase()));function Qe(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function wt(e,t,n){t=[...t].sort((o,i)=>o-i);const r=t.map(o=>e[o]);for(let o=t.length-1;o>=0;o--)e=[...e.slice(0,t[o]),...e.slice(t[o]+1)];return n=Math.max(0,n-t.filter(o=>o<n).length),[...e.slice(0,n),...r,...e.slice(n)]}const jl=e=>new nr(e),[Wl,Le]=X({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),jo=E.forwardRef((e,t)=>{const n=Le(),r=Io(),o=Jt({...r,present:n.open}),i=V(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:P.jsx(F.div,{...i,ref:ft(o.ref,t)})});jo.displayName="DialogBackdrop";const Wo=E.forwardRef((e,t)=>{const n=Le(),r=V(n.getCloseTriggerProps(),e);return P.jsx(F.button,{...r,ref:t})});Wo.displayName="DialogCloseTrigger";const Ko=E.forwardRef((e,t)=>{const n=Le(),r=gt(),o=V(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:P.jsx(F.div,{...o,ref:ft(r.ref,t)})});Ko.displayName="DialogContent";const Uo=E.forwardRef((e,t)=>{const n=Le(),r=V(n.getDescriptionProps(),e);return P.jsx(F.div,{...r,ref:t})});Uo.displayName="DialogDescription";const qo=E.forwardRef((e,t)=>{const n=Le(),r=V(n.getPositionerProps(),e);return gt().unmounted?null:P.jsx(F.div,{...r,ref:t})});qo.displayName="DialogPositioner";var Xo=ue("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Ce=Xo.build(),Yo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},zo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},xn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},Jo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},On=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},Pn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Zo=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},It=e=>e.getById(xn(e)),Kl=e=>e.getById(Yo(e)),Ul=e=>e.getById(zo(e)),ql=e=>e.getById(Jo(e)),Xl=e=>e.getById(On(e)),Yl=e=>e.getById(Pn(e)),zl=e=>e.getById(Zo(e));function Jl(e,t){const{state:n,send:r,context:o,prop:i,scope:s}=e,a=i("aria-label"),u=n.matches("open");return{open:u,setOpen(c){n.matches("open")!==c&&r({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...Ce.trigger.attrs,dir:i("dir"),id:Jo(s),"aria-haspopup":"dialog",type:"button","aria-expanded":u,"data-state":u?"open":"closed","aria-controls":xn(s),onClick(c){c.defaultPrevented||r({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...Ce.backdrop.attrs,dir:i("dir"),hidden:!u,id:zo(s),"data-state":u?"open":"closed"})},getPositionerProps(){return t.element({...Ce.positioner.attrs,dir:i("dir"),id:Yo(s),style:{pointerEvents:u?void 0:"none"}})},getContentProps(){const c=o.get("rendered");return t.element({...Ce.content.attrs,dir:i("dir"),role:i("role"),hidden:!u,id:xn(s),tabIndex:-1,"data-state":u?"open":"closed","aria-modal":!0,"aria-label":a||void 0,"aria-labelledby":a||!c.title?void 0:On(s),"aria-describedby":c.description?Pn(s):void 0})},getTitleProps(){return t.element({...Ce.title.attrs,dir:i("dir"),id:On(s)})},getDescriptionProps(){return t.element({...Ce.description.attrs,dir:i("dir"),id:Pn(s)})},getCloseTriggerProps(){return t.button({...Ce.closeTrigger.attrs,dir:i("dir"),id:Zo(s),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),r({type:"CLOSE"}))}})}}}var Zl={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>zl(t):void 0,o=typeof e.modal=="boolean"?e.modal:!0;return{role:"dialog",modal:o,trapFocus:o,preventScroll:o,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return Co(()=>It(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[ql(e)],onInteractOutside(o){var i;(i=n("onInteractOutside"))==null||i(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(o){var i;(i=n("onEscapeKeyDown"))==null||i(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return Il(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?Cl(()=>It(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,i;return(i=(o=t("finalFocusEl"))==null?void 0:o())!=null?i:r}}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?gl(()=>[It(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){j(()=>{e.set("rendered",{title:!!Xl(t),description:!!Yl(t)})})},syncZIndex({scope:e}){j(()=>{const t=It(e);if(!t)return;const n=$n(t);[Kl(e),Ul(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex),o==null||o.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};ee()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const Ql=e=>{const t=E.useId(),{getRootNode:n}=Ne(),{dir:r}=Ke(),o={id:t,getRootNode:n,dir:r,...e},i=ke(Zl,o);return Jl(i,We)},eu=e=>{const[t,{children:n,...r}]=Oo(e),[o]=To(t),i=Ql(r),s=Jt(V({present:i.open},t));return P.jsx(Wl,{value:i,children:P.jsx(wo,{value:o,children:P.jsx(er,{value:s,children:n})})})},Qo=E.forwardRef((e,t)=>{const n=Le(),r=V(n.getTitleProps(),e);return P.jsx(F.h2,{...r,ref:t})});Qo.displayName="DialogTitle";const ei=E.forwardRef((e,t)=>{const n=Le(),r=gt(),o=V({...n.getTriggerProps(),"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]},e);return P.jsx(F.button,{...o,ref:t})});ei.displayName="DialogTrigger";const tu=e=>{var u;const{children:t,disabled:n}=e,[r,o]=E.useState((u=e.container)==null?void 0:u.current),i=E.useSyncExternalStore(ru,()=>!1,()=>!0),{getRootNode:s}=Ne();if(E.useEffect(()=>{o(()=>{var c;return(c=e.container)==null?void 0:c.current})},[e.container]),i||n)return P.jsx(P.Fragment,{children:t});const a=r!=null?r:nu(s);return P.jsx(P.Fragment,{children:E.Children.map(t,c=>Gt.createPortal(c,a))})},nu=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return Oe(n)?n:Q(t).body},ru=()=>()=>{},[ou,Xe]=X({name:"RadioGroupContext",hookName:"useRadioGroupContext",providerName:"<RadioGroupProvider />"}),iu=e=>e.children(Xe()),[su]=X({name:"RadioGroupItemContext",hookName:"useRadioGroupItemContext",providerName:"<RadioGroupItemProvider />"}),[au,rr]=X({name:"RadioGroupItemPropsContext",hookName:"useRadioGroupItemPropsContext",providerName:"<RadioGroupItemPropsProvider />"}),ti=E.forwardRef((e,t)=>{const[n,r]=te()(e,["value","disabled","invalid"]),o=Xe(),i=V(o.getItemProps(n),r),s=o.getItemState(n);return P.jsx(su,{value:s,children:P.jsx(au,{value:n,children:P.jsx(F.label,{...i,ref:t})})})});ti.displayName="RadioGroupItem";const ni=E.forwardRef((e,t)=>{const n=Xe(),r=rr(),o=V(n.getItemControlProps(r),e);return P.jsx(F.div,{...o,ref:t})});ni.displayName="RadioGroupItemControl";const ri=E.forwardRef((e,t)=>{const n=Xe(),r=rr(),o=V(n.getItemHiddenInputProps(r),e);return P.jsx(F.input,{...o,ref:t})});ri.displayName="RadioGroupItemHiddenInput";const oi=E.forwardRef((e,t)=>{const n=Xe(),r=rr(),o=V(n.getItemTextProps(r),e);return P.jsx(F.span,{...o,ref:t})});oi.displayName="RadioGroupItemText";const ii=E.forwardRef((e,t)=>{const n=Xe(),r=V(n.getLabelProps(),e);return P.jsx(F.label,{...r,ref:t})});ii.displayName="RadioGroupLabel";var si=ue("radio-group").parts("root","label","item","itemText","itemControl","indicator"),$e=si.build(),Mt=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`radio-group:${e.id}`},Dr=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`radio-group:${e.id}:label`},ai=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:${t}`},Rn=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemHiddenInput)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:input:${t}`},cu=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemControl)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:control:${t}`},lu=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemLabel)==null?void 0:r.call(n,t))!=null?o:`radio-group:${e.id}:radio:label:${t}`},ci=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicator)!=null?n:`radio-group:${e.id}:indicator`},en=e=>e.getById(Mt(e)),uu=(e,t)=>e.getById(Rn(e,t)),du=e=>e.getById(ci(e)),fu=e=>{var t;return(t=en(e))==null?void 0:t.querySelector("input:not(:disabled)")},hu=e=>{var t;return(t=en(e))==null?void 0:t.querySelector("input:not(:disabled):checked")},$r=e=>{const n=`input[type=radio][data-ownedby='${CSS.escape(Mt(e))}']:not([disabled])`;return oo(en(e),n)},gu=(e,t)=>{if(t)return e.getById(ai(e,t))},pu=e=>{var r;if(!e)return{left:0,top:0,width:0,height:0};const t=e.getBoundingClientRect(),n=(r=e.offsetParent)==null?void 0:r.getBoundingClientRect();return{left:n?t.left-n.left:t.left,top:n?t.top-n.top:t.top,width:t.width,height:t.height}},mu=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function vu(e,t){const{context:n,send:r,computed:o,prop:i,scope:s,refs:a}=e,u=o("isDisabled"),c=i("readOnly");function d(l){return{value:l.value,invalid:!!l.invalid,disabled:!!l.disabled||u,checked:n.get("value")===l.value,focused:n.get("focusedValue")===l.value,focusVisible:a.get("focusVisibleValue")===l.value,hovered:n.get("hoveredValue")===l.value,active:n.get("activeValue")===l.value}}function h(l){const f=d(l);return{"data-focus":O(f.focused),"data-focus-visible":O(f.focusVisible),"data-disabled":O(f.disabled),"data-readonly":O(c),"data-state":f.checked?"checked":"unchecked","data-hover":O(f.hovered),"data-invalid":O(f.invalid),"data-orientation":i("orientation"),"data-ssr":O(n.get("ssr"))}}const p=()=>{var f;const l=(f=hu(s))!=null?f:fu(s);l==null||l.focus()};return{focus:p,value:n.get("value"),setValue(l){r({type:"SET_VALUE",value:l,isTrusted:!1})},clearValue(){r({type:"SET_VALUE",value:null,isTrusted:!1})},getRootProps(){return t.element({...$e.root.attrs,role:"radiogroup",id:Mt(s),"aria-labelledby":Dr(s),"data-orientation":i("orientation"),"data-disabled":O(u),"aria-orientation":i("orientation"),dir:i("dir"),style:{position:"relative"}})},getLabelProps(){return t.element({...$e.label.attrs,dir:i("dir"),"data-orientation":i("orientation"),"data-disabled":O(u),id:Dr(s),onClick:p})},getItemState:d,getItemProps(l){const f=d(l);return t.label({...$e.item.attrs,dir:i("dir"),id:ai(s,l.value),htmlFor:Rn(s,l.value),...h(l),onPointerMove(){f.disabled||f.hovered||r({type:"SET_HOVERED",value:l.value,hovered:!0})},onPointerLeave(){f.disabled||r({type:"SET_HOVERED",value:null})},onPointerDown(g){f.disabled||Vs(g)&&(f.focused&&g.pointerType==="mouse"&&g.preventDefault(),r({type:"SET_ACTIVE",value:l.value,active:!0}))},onPointerUp(){f.disabled||r({type:"SET_ACTIVE",value:null})},onClick(){var g;!f.disabled&&Bn()&&((g=uu(s,l.value))==null||g.focus())}})},getItemTextProps(l){return t.element({...$e.itemText.attrs,dir:i("dir"),id:lu(s,l.value),...h(l)})},getItemControlProps(l){const f=d(l);return t.element({...$e.itemControl.attrs,dir:i("dir"),id:cu(s,l.value),"data-active":O(f.active),"aria-hidden":!0,...h(l)})},getItemHiddenInputProps(l){const f=d(l);return t.input({"data-ownedby":Mt(s),id:Rn(s,l.value),type:"radio",name:i("name")||i("id"),form:i("form"),value:l.value,onClick(g){if(c){g.preventDefault();return}g.currentTarget.checked&&r({type:"SET_VALUE",value:l.value,isTrusted:!0})},onBlur(){r({type:"SET_FOCUSED",value:null,focused:!1})},onFocus(){const g=lt();r({type:"SET_FOCUSED",value:l.value,focused:!0,focusVisible:g})},onKeyDown(g){g.defaultPrevented||g.key===" "&&r({type:"SET_ACTIVE",value:l.value,active:!0})},onKeyUp(g){g.defaultPrevented||g.key===" "&&r({type:"SET_ACTIVE",value:null})},disabled:f.disabled||c,defaultChecked:f.checked,style:Ut})},getIndicatorProps(){const l=n.get("indicatorRect");return t.element({id:ci(s),...$e.indicator.attrs,dir:i("dir"),hidden:n.get("value")==null,"data-disabled":O(u),"data-orientation":i("orientation"),style:{"--transition-property":"left, top, width, height","--left":l==null?void 0:l.left,"--top":l==null?void 0:l.top,"--width":l==null?void 0:l.width,"--height":l==null?void 0:l.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:n.get("canIndicatorTransition")?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[i("orientation")==="horizontal"?"left":"top"]:i("orientation")==="horizontal"?"var(--left)":"var(--top)"}})}}}var{not:yu}=dt(),bu={props({props:e}){return{orientation:"vertical",...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var r;(r=e("onValueChange"))==null||r({value:n})}})),activeValue:t(()=>({defaultValue:null})),focusedValue:t(()=>({defaultValue:null})),hoveredValue:t(()=>({defaultValue:null})),indicatorRect:t(()=>({defaultValue:{}})),canIndicatorTransition:t(()=>({defaultValue:!1})),fieldsetDisabled:t(()=>({defaultValue:!1})),ssr:t(()=>({defaultValue:!0}))}},refs(){return{indicatorCleanup:null,focusVisibleValue:null}},computed:{isDisabled:({prop:e,context:t})=>!!e("disabled")||t.get("fieldsetDisabled")},entry:["syncIndicatorRect","syncSsr"],exit:["cleanupObserver"],effects:["trackFormControlState","trackFocusVisible"],watch({track:e,action:t,context:n}){e([()=>n.get("value")],()=>{t(["setIndicatorTransition","syncIndicatorRect","syncInputElements"])})},on:{SET_VALUE:[{guard:yu("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:["setHovered"]},SET_ACTIVE:{actions:["setActive"]},SET_FOCUSED:{actions:["setFocused"]}},states:{idle:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackFormControlState({context:e,scope:t}){return Wt(en(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){e.set("value",e.initial("value"))}})},trackFocusVisible({scope:e}){var t;return tr({root:(t=e.getRootNode)==null?void 0:t.call(e)})}},actions:{setValue({context:e,event:t}){e.set("value",t.value)},setHovered({context:e,event:t}){e.set("hoveredValue",t.value)},setActive({context:e,event:t}){e.set("activeValue",t.value)},setFocused({context:e,event:t,refs:n}){e.set("focusedValue",t.value),n.set("focusVisibleValue",t.focusVisible?t.value:null)},syncInputElements({context:e,scope:t}){$r(t).forEach(r=>{r.checked=r.value===e.get("value")})},setIndicatorTransition({context:e}){e.set("canIndicatorTransition",ot(e.get("value")))},cleanupObserver({refs:e}){var t;(t=e.get("indicatorCleanup"))==null||t()},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,scope:t,refs:n}){var s;if((s=n.get("indicatorCleanup"))==null||s(),!du(t))return;const r=e.get("value"),o=gu(t,r);if(r==null||!o){e.set("canIndicatorTransition",!1),e.set("indicatorRect",{});return}const i=so([o],{measure(a){return pu(a)},onEntry({rects:a}){e.set("indicatorRect",mu(a[0]))}});n.set("indicatorCleanup",i)},dispatchChangeEvent({context:e,scope:t}){$r(t).forEach(r=>{const o=r.value===e.get("value");o!==r.checked&&_n(r,{checked:o})})}}}};ee()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value","defaultValue"]);ee()(["value","disabled","invalid"]);const Eu=e=>{const t=E.useId(),{getRootNode:n}=Ne(),{dir:r}=Ke(),o={id:t,dir:r,getRootNode:n,...e},i=ke(bu,o);return vu(i,We)},li=E.forwardRef((e,t)=>{const[n,r]=te()(e,["defaultValue","disabled","form","id","ids","name","onValueChange","orientation","readOnly","value"]),o=Eu(n),i=V(o.getRootProps(),r);return P.jsx(ou,{value:o,children:P.jsx(F.div,{...i,ref:t})})});li.displayName="RadioGroupRoot";const[Cu,Ve]=X({name:"SelectContext",hookName:"useSelectContext",providerName:"<SelectProvider />"}),ui=E.forwardRef((e,t)=>{const n=Ve(),r=gt(),o=V(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:P.jsx(F.div,{...o,ref:ft(r.ref,t)})});ui.displayName="SelectContent";const di=E.forwardRef((e,t)=>{const n=Ve(),r=V(n.getControlProps(),e);return P.jsx(F.div,{...r,ref:t})});di.displayName="SelectControl";const[wu]=X({name:"SelectItemContext",hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),[Iu]=X({name:"SelectItemPropsContext",hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),fi=E.forwardRef((e,t)=>{const[n,r]=te()(e,["item","persistFocus"]),o=Ve(),i=V(o.getItemProps(n),r),s=o.getItemState(n);return P.jsx(Iu,{value:n,children:P.jsx(wu,{value:s,children:P.jsx(F.div,{...i,ref:t})})})});fi.displayName="SelectItem";const hi=E.forwardRef((e,t)=>{const n=Ve(),r=V(n.getLabelProps(),e);return P.jsx(F.label,{...r,ref:t})});hi.displayName="SelectLabel";const gi=E.forwardRef((e,t)=>{const n=Ve(),r=V(n.getPositionerProps(),e);return gt().unmounted?null:P.jsx(F.div,{...r,ref:t})});gi.displayName="SelectPositioner";var pi=ue("select").parts("label","positioner","trigger","indicator","clearTrigger","item","itemText","itemIndicator","itemGroup","itemGroupLabel","list","content","root","control","valueText"),Y=pi.build(),mi=e=>new nr(e);mi.empty=()=>new nr({items:[]});var Tu=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`select:${e.id}`},Sn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`select:${e.id}:content`},kn=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`select:${e.id}:trigger`},vi=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.clearTrigger)!=null?n:`select:${e.id}:clear-trigger`},Tt=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`select:${e.id}:label`},xu=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`select:${e.id}:control`},Nn=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:option:${t}`},An=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenSelect)!=null?n:`select:${e.id}:select`},yi=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`select:${e.id}:positioner`},Ou=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemGroup)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:optgroup:${t}`},Mr=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.itemGroupLabel)==null?void 0:r.call(n,t))!=null?o:`select:${e.id}:optgroup-label:${t}`},fn=e=>e.getById(An(e)),et=e=>e.getById(Sn(e)),Te=e=>e.getById(kn(e)),Pu=e=>e.getById(vi(e)),Gr=e=>e.getById(yi(e)),hn=(e,t)=>t==null?null:e.getById(Nn(e,t));function Ru(e,t){const{context:n,prop:r,scope:o,state:i,computed:s,send:a}=e,u=r("disabled")||n.get("fieldsetDisabled"),c=!!r("invalid"),d=!!r("required"),h=!!r("readOnly"),p=r("composite"),l=r("collection"),f=i.hasTag("open"),g=i.matches("focused"),m=n.get("highlightedValue"),v=n.get("highlightedItem"),y=n.get("selectedItems"),C=n.get("currentPlacement"),w=s("isTypingAhead"),T=s("isInteractive"),S=m?Nn(o,m):void 0;function k(b){const I=l.getItemDisabled(b.item),A=l.getItemValue(b.item);return Ur(A,()=>`[zag-js] No value found for item ${JSON.stringify(b.item)}`),{value:A,disabled:!!(u||I),highlighted:m===A,selected:n.get("value").includes(A)}}const $=Wc({...r("positioning"),placement:C});return{open:f,focused:g,empty:n.get("value").length===0,highlightedItem:v,highlightedValue:m,selectedItems:y,hasSelectedItems:s("hasSelectedItems"),value:n.get("value"),valueAsString:s("valueAsString"),collection:l,multiple:!!r("multiple"),disabled:!!u,reposition(b={}){a({type:"POSITIONING.SET",options:b})},focus(){var b;(b=Te(o))==null||b.focus({preventScroll:!0})},setOpen(b){i.hasTag("open")!==b&&a({type:b?"OPEN":"CLOSE"})},selectValue(b){a({type:"ITEM.SELECT",value:b})},setValue(b){a({type:"VALUE.SET",value:b})},selectAll(){a({type:"VALUE.SET",value:l.getValues()})},setHighlightValue(b){a({type:"HIGHLIGHTED_VALUE.SET",value:b})},clearHighlightValue(){a({type:"HIGHLIGHTED_VALUE.CLEAR"})},clearValue(b){a(b?{type:"ITEM.CLEAR",value:b}:{type:"VALUE.CLEAR"})},getItemState:k,getRootProps(){return t.element({...Y.root.attrs,dir:r("dir"),id:Tu(o),"data-invalid":O(c),"data-readonly":O(h)})},getLabelProps(){return t.label({dir:r("dir"),id:Tt(o),...Y.label.attrs,"data-disabled":O(u),"data-invalid":O(c),"data-readonly":O(h),"data-required":O(d),htmlFor:An(o),onClick(b){var I;b.defaultPrevented||u||(I=Te(o))==null||I.focus({preventScroll:!0})}})},getControlProps(){return t.element({...Y.control.attrs,dir:r("dir"),id:xu(o),"data-state":f?"open":"closed","data-focus":O(g),"data-disabled":O(u),"data-invalid":O(c)})},getValueTextProps(){return t.element({...Y.valueText.attrs,dir:r("dir"),"data-disabled":O(u),"data-invalid":O(c),"data-focus":O(g)})},getTriggerProps(){return t.button({id:kn(o),disabled:u,dir:r("dir"),type:"button",role:"combobox","aria-controls":Sn(o),"aria-expanded":f,"aria-haspopup":"listbox","data-state":f?"open":"closed","aria-invalid":c,"aria-required":d,"aria-labelledby":Tt(o),...Y.trigger.attrs,"data-disabled":O(u),"data-invalid":O(c),"data-readonly":O(h),"data-placement":C,"data-placeholder-shown":O(!s("hasSelectedItems")),onClick(b){T&&(b.defaultPrevented||a({type:"TRIGGER.CLICK"}))},onFocus(){a({type:"TRIGGER.FOCUS"})},onBlur(){a({type:"TRIGGER.BLUR"})},onKeyDown(b){if(b.defaultPrevented||!T)return;const A={ArrowUp(){a({type:"TRIGGER.ARROW_UP"})},ArrowDown(M){a({type:M.altKey?"OPEN":"TRIGGER.ARROW_DOWN"})},ArrowLeft(){a({type:"TRIGGER.ARROW_LEFT"})},ArrowRight(){a({type:"TRIGGER.ARROW_RIGHT"})},Home(){a({type:"TRIGGER.HOME"})},End(){a({type:"TRIGGER.END"})},Enter(){a({type:"TRIGGER.ENTER"})},Space(M){a(w?{type:"TRIGGER.TYPEAHEAD",key:M.key}:{type:"TRIGGER.ENTER"})}}[mn(b,{dir:r("dir"),orientation:"vertical"})];if(A){A(b),b.preventDefault();return}yn.isValidEvent(b)&&(a({type:"TRIGGER.TYPEAHEAD",key:b.key}),b.preventDefault())}})},getIndicatorProps(){return t.element({...Y.indicator.attrs,dir:r("dir"),"aria-hidden":!0,"data-state":f?"open":"closed","data-disabled":O(u),"data-invalid":O(c),"data-readonly":O(h)})},getItemProps(b){const I=k(b);return t.element({id:Nn(o,I.value),role:"option",...Y.item.attrs,dir:r("dir"),"data-value":I.value,"aria-selected":I.selected,"data-state":I.selected?"checked":"unchecked","data-highlighted":O(I.highlighted),"data-disabled":O(I.disabled),"aria-disabled":ns(I.disabled),onPointerMove(A){I.disabled||A.pointerType!=="mouse"||I.value!==m&&a({type:"ITEM.POINTER_MOVE",value:I.value})},onClick(A){A.defaultPrevented||I.disabled||a({type:"ITEM.CLICK",src:"pointerup",value:I.value})},onPointerLeave(A){var H;I.disabled||b.persistFocus||A.pointerType!=="mouse"||!((H=e.event.previous())!=null&&H.type.includes("POINTER"))||a({type:"ITEM.POINTER_LEAVE"})}})},getItemTextProps(b){const I=k(b);return t.element({...Y.itemText.attrs,"data-state":I.selected?"checked":"unchecked","data-disabled":O(I.disabled),"data-highlighted":O(I.highlighted)})},getItemIndicatorProps(b){const I=k(b);return t.element({"aria-hidden":!0,...Y.itemIndicator.attrs,"data-state":I.selected?"checked":"unchecked",hidden:!I.selected})},getItemGroupLabelProps(b){const{htmlFor:I}=b;return t.element({...Y.itemGroupLabel.attrs,id:Mr(o,I),dir:r("dir"),role:"presentation"})},getItemGroupProps(b){const{id:I}=b;return t.element({...Y.itemGroup.attrs,"data-disabled":O(u),id:Ou(o,I),"aria-labelledby":Mr(o,I),role:"group",dir:r("dir")})},getClearTriggerProps(){return t.button({...Y.clearTrigger.attrs,id:vi(o),type:"button","aria-label":"Clear value","data-invalid":O(c),disabled:u,hidden:!s("hasSelectedItems"),dir:r("dir"),onClick(b){b.defaultPrevented||a({type:"CLEAR.CLICK"})}})},getHiddenSelectProps(){const b=n.get("value"),I=r("multiple")?b:b==null?void 0:b[0];return t.select({name:r("name"),form:r("form"),disabled:u,multiple:r("multiple"),required:r("required"),"aria-hidden":!0,id:An(o),defaultValue:I,style:Ut,tabIndex:-1,onFocus(){var A;(A=Te(o))==null||A.focus({preventScroll:!0})},"aria-labelledby":Tt(o)})},getPositionerProps(){return t.element({...Y.positioner.attrs,dir:r("dir"),id:yi(o),style:$.floating})},getContentProps(){return t.element({hidden:!f,dir:r("dir"),id:Sn(o),role:p?"listbox":"dialog",...Y.content.attrs,"data-state":f?"open":"closed","data-placement":C,"data-activedescendant":S,"aria-activedescendant":p?S:void 0,"aria-multiselectable":r("multiple")&&p?!0:void 0,"aria-labelledby":Tt(o),tabIndex:0,onKeyDown(b){if(!T||!Pe(b.currentTarget,K(b)))return;if(b.key==="Tab"&&!Ys(b)){b.preventDefault();return}const I={ArrowUp(){a({type:"CONTENT.ARROW_UP"})},ArrowDown(){a({type:"CONTENT.ARROW_DOWN"})},Home(){a({type:"CONTENT.HOME"})},End(){a({type:"CONTENT.END"})},Enter(){a({type:"ITEM.CLICK",src:"keydown.enter"})},Space(H){var _;w?a({type:"CONTENT.TYPEAHEAD",key:H.key}):(_=I.Enter)==null||_.call(I,H)}},A=I[mn(b)];if(A){A(b),b.preventDefault();return}const M=K(b);Xr(M)||yn.isValidEvent(b)&&(a({type:"CONTENT.TYPEAHEAD",key:b.key}),b.preventDefault())}})},getListProps(){return t.element({...Y.list.attrs,tabIndex:0,role:p?void 0:"listbox","aria-labelledby":kn(o),"aria-activedescendant":p?void 0:S,"aria-multiselectable":!p&&r("multiple")?!0:void 0})}}}var{and:tt,not:we,or:Su}=dt(),ku={props({props:e}){var t;return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:(t=e.collection)!=null?t:mi.empty(),positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:Bt,onChange(n){var o;const r=e("collection").findMany(n);return(o=e("onValueChange"))==null?void 0:o({value:n,items:r})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(n){var r;(r=e("onHighlightChange"))==null||r({highlightedValue:n,highlightedItem:e("collection").find(n),highlightedIndex:e("collection").indexOf(n)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItems:t(()=>{var o,i;const n=(i=(o=e("value"))!=null?o:e("defaultValue"))!=null?i:[];return{defaultValue:e("collection").findMany(n)}})}},refs(){return{typeahead:{...yn.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get("value").length>0,isTypingAhead:({refs:e})=>e.get("typeahead").keysSoFar!=="",isDisabled:({prop:e,context:t})=>!!e("disabled")||!!t.get("fieldsetDisabled"),isInteractive:({prop:e})=>!(e("disabled")||e("readOnly")),valueAsString:({context:e,prop:t})=>t("collection").stringifyItems(e.get("selectedItems"))},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},entry:["syncSelectElement"],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get("value").toString()],()=>{r(["syncSelectedItems","syncSelectElement","dispatchChangeEvent"])}),n([()=>t("open")],()=>{r(["toggleVisibility"])}),n([()=>e.get("highlightedValue")],()=>{r(["syncHighlightedItem"])}),n([()=>t("collection").toString()],()=>{r(["syncCollection"])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedItem"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedItem"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setSelectedItems"]},"VALUE.CLEAR":{actions:["clearSelectedItems"]},"CLEAR.CLICK":{actions:["clearSelectedItems","focusTriggerEl"]}},effects:["trackFormControlState"],states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{target:"open",actions:["setInitialFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus","highlightFirstSelectedItem"]}],"TRIGGER.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{guard:"isTriggerArrowUpEvent",target:"open",actions:["setInitialFocus","highlightComputedLastItem"]},{guard:Su("isTriggerArrowDownEvent","isTriggerEnterEvent"),target:"open",actions:["setInitialFocus","highlightComputedFirstItem"]},{target:"open",actions:["setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}],"TRIGGER.BLUR":{target:"idle"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightFirstSelectedItem"]}],"TRIGGER.ENTER":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_UP":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedLastItem"]}],"TRIGGER.ARROW_DOWN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_LEFT":[{guard:tt(we("multiple"),"hasSelectedItems"),actions:["selectPreviousItem"]},{guard:we("multiple"),actions:["selectLastItem"]}],"TRIGGER.ARROW_RIGHT":[{guard:tt(we("multiple"),"hasSelectedItems"),actions:["selectNextItem"]},{guard:we("multiple"),actions:["selectFirstItem"]}],"TRIGGER.HOME":{guard:we("multiple"),actions:["selectFirstItem"]},"TRIGGER.END":{guard:we("multiple"),actions:["selectLastItem"]},"TRIGGER.TYPEAHEAD":{guard:we("multiple"),actions:["selectMatchingItem"]}}},open:{tags:["open"],exit:["scrollContentToTop"],effects:["trackDismissableElement","computePlacement","scrollToHighlightedItem"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["clearHighlightedItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{guard:"restoreFocus",target:"focused",actions:["invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["invokeOnClose","clearHighlightedItem"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","clearHighlightedItem"]}],"ITEM.CLICK":[{guard:tt("closeOnSelect","isOpenControlled"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{actions:["selectHighlightedItem"]}],"CONTENT.HOME":{actions:["highlightFirstItem"]},"CONTENT.END":{actions:["highlightLastItem"]},"CONTENT.ARROW_DOWN":[{guard:tt("hasHighlightedItem","loop","isLastItemHighlighted"),actions:["highlightFirstItem"]},{guard:"hasHighlightedItem",actions:["highlightNextItem"]},{actions:["highlightFirstItem"]}],"CONTENT.ARROW_UP":[{guard:tt("hasHighlightedItem","loop","isFirstItemHighlighted"),actions:["highlightLastItem"]},{guard:"hasHighlightedItem",actions:["highlightPreviousItem"]},{actions:["highlightLastItem"]}],"CONTENT.TYPEAHEAD":{actions:["highlightMatchingItem"]},"ITEM.POINTER_MOVE":{actions:["highlightItem"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedItem"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{loop:({prop:e})=>!!e("loopFocus"),multiple:({prop:e})=>!!e("multiple"),hasSelectedItems:({computed:e})=>!!e("hasSelectedItems"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").lastValue,closeOnSelect:({prop:e,event:t})=>{var n;return!!((n=t.closeOnSelect)!=null?n:e("closeOnSelect"))},restoreFocus:({event:e})=>Br(e),isOpenControlled:({prop:e})=>e("open")!==void 0,isTriggerClickEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.CLICK"},isTriggerEnterEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ENTER"},isTriggerArrowUpEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ARROW_UP"},isTriggerArrowDownEvent:({event:e})=>{var t;return((t=e.previousEvent)==null?void 0:t.type)==="TRIGGER.ARROW_DOWN"}},effects:{trackFormControlState({context:e,scope:t}){return Wt(fn(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){const n=e.initial("value");e.set("value",n)}})},trackDismissableElement({scope:e,send:t,prop:n}){const r=()=>et(e);let o=!0;return Co(r,{type:"listbox",defer:!0,exclude:[Te(e),Pu(e)],onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onInteractOutside(i){var s;(s=n("onInteractOutside"))==null||s(i),o=!(i.detail.focusable||i.detail.contextmenu)},onDismiss(){t({type:"CLOSE",src:"interact-outside",restoreFocus:o})}})},computePlacement({context:e,prop:t,scope:n}){const r=t("positioning");return e.set("currentPlacement",r.placement),Tr(()=>Te(n),()=>Gr(n),{defer:!0,...r,onComplete(s){e.set("currentPlacement",s.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n,event:r}){const o=s=>{const a=e.get("highlightedValue");if(a==null||r.current().type.includes("POINTER"))return;const u=et(n),c=t("scrollToIndexFn");if(c){const h=t("collection").indexOf(a);c==null||c({index:h,immediate:s,getElement:()=>hn(n,a)});return}const d=hn(n,a);ra(d,{rootEl:u,block:"nearest"})};return j(()=>o(!0)),Zs(()=>et(n),{attributes:["data-activedescendant"],callback(){o(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){const o=()=>Gr(n);Tr(Te(n),o,{...t("positioning"),...r.options,defer:!0,listeners:!1,onComplete(i){e.set("currentPlacement",i.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})},highlightPreviousItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const r=t("collection").getPreviousValue(n,1,t("loopFocus"));r!=null&&e.set("highlightedValue",r)},highlightNextItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const r=t("collection").getNextValue(n,1,t("loopFocus"));r!=null&&e.set("highlightedValue",r)},highlightFirstItem({context:e,prop:t}){const n=t("collection").firstValue;e.set("highlightedValue",n)},highlightLastItem({context:e,prop:t}){const n=t("collection").lastValue;e.set("highlightedValue",n)},setInitialFocus({scope:e}){j(()=>{const t=Xs({root:et(e)});t==null||t.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){Br(e)&&j(()=>{const n=Te(t);n==null||n.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){var i,s;let r=(i=n.value)!=null?i:e.get("highlightedValue");if(r==null||!t("collection").has(r))return;(s=t("onSelect"))==null||s({value:r}),r=t("deselectable")&&!t("multiple")&&e.get("value").includes(r)?null:r,e.set("value",a=>r==null?[]:t("multiple")?ar(a,r):[r])},highlightComputedFirstItem({context:e,prop:t,computed:n}){const r=t("collection"),o=n("hasSelectedItems")?r.sort(e.get("value"))[0]:r.firstValue;e.set("highlightedValue",o)},highlightComputedLastItem({context:e,prop:t,computed:n}){const r=t("collection"),o=n("hasSelectedItems")?r.sort(e.get("value"))[0]:r.lastValue;e.set("highlightedValue",o)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n("hasSelectedItems"))return;const r=t("collection").sort(e.get("value"))[0];e.set("highlightedValue",r)},highlightItem({context:e,event:t}){e.set("highlightedValue",t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){const o=t("collection").search(n.key,{state:r.get("typeahead"),currentValue:e.get("highlightedValue")});o!=null&&e.set("highlightedValue",o)},setHighlightedItem({context:e,event:t}){e.set("highlightedValue",t.value)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},selectItem({context:e,prop:t,event:n}){var i;(i=t("onSelect"))==null||i({value:n.value});const o=t("deselectable")&&!t("multiple")&&e.get("value").includes(n.value)?null:n.value;e.set("value",s=>o==null?[]:t("multiple")?ar(s,o):[o])},clearItem({context:e,event:t}){e.set("value",n=>n.filter(r=>r!==t.value))},setSelectedItems({context:e,event:t}){e.set("value",t.value)},clearSelectedItems({context:e}){e.set("value",[])},selectPreviousItem({context:e,prop:t}){const[n]=e.get("value"),r=t("collection").getPreviousValue(n);r&&e.set("value",[r])},selectNextItem({context:e,prop:t}){const[n]=e.get("value"),r=t("collection").getNextValue(n);r&&e.set("value",[r])},selectFirstItem({context:e,prop:t}){const n=t("collection").firstValue;n&&e.set("value",[n])},selectLastItem({context:e,prop:t}){const n=t("collection").lastValue;n&&e.set("value",[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){const o=t("collection").search(n.key,{state:r.get("typeahead"),currentValue:e.get("value")[0]});o!=null&&e.set("value",[o])},scrollContentToTop({prop:e,scope:t}){var n,r;if(e("scrollToIndexFn")){const o=e("collection").firstValue;(n=e("scrollToIndexFn"))==null||n({index:0,immediate:!0,getElement:()=>hn(t,o)})}else(r=et(t))==null||r.scrollTo(0,0)},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},syncSelectElement({context:e,prop:t,scope:n}){const r=fn(n);if(r){if(e.get("value").length===0&&!t("multiple")){r.selectedIndex=-1;return}for(const o of r.options)o.selected=e.get("value").includes(o.value)}},syncCollection({context:e,prop:t}){const n=t("collection"),r=n.find(e.get("highlightedValue"));r&&e.set("highlightedItem",r);const o=n.findMany(e.get("value"));e.set("selectedItems",o)},syncSelectedItems({context:e,prop:t}){const n=t("collection"),r=e.get("selectedItems"),i=e.get("value").map(s=>r.find(u=>n.getItemValue(u)===s)||n.find(s));e.set("selectedItems",i)},syncHighlightedItem({context:e,prop:t}){const n=t("collection"),r=e.get("highlightedValue"),o=r?n.find(r):null;e.set("highlightedItem",o)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{const t=fn(e);if(!t)return;const n=e.getWin(),r=new n.Event("change",{bubbles:!0,composed:!0});t.dispatchEvent(r)})}}}};function Br(e){var n,r;const t=(r=e.restoreFocus)!=null?r:(n=e.previousEvent)==null?void 0:n.restoreFocus;return t==null||!!t}ee()(["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","dir","disabled","form","getRootNode","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]);ee()(["item","persistFocus"]);ee()(["id"]);ee()(["htmlFor"]);const Nu=e=>{const t=E.useId(),{dir:n}=Ke(),{getRootNode:r}=Ne(),o=pt(),i={id:t,ids:{label:o==null?void 0:o.ids.label,hiddenSelect:o==null?void 0:o.ids.control},disabled:o==null?void 0:o.disabled,readOnly:o==null?void 0:o.readOnly,invalid:o==null?void 0:o.invalid,required:o==null?void 0:o.required,dir:n,getRootNode:r,...e},s=ke(ku,i);return Ru(s,We)},Au=(e,t)=>{const[n,r]=Oo(e),[o,i]=te()(r,["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","disabled","form","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),s=Nu(o),a=Jt(V({present:s.open},n)),u=V(s.getRootProps(),i);return P.jsx(Cu,{value:s,children:P.jsx(er,{value:a,children:P.jsx(F.div,{...u,ref:t})})})},Lu=E.forwardRef(Au),bi=E.forwardRef((e,t)=>{const n=Ve(),r=V(n.getTriggerProps(),e);return P.jsx(F.button,{...r,ref:t})});bi.displayName="SelectTrigger";const Ei=E.forwardRef((e,t)=>{const{children:n,placeholder:r,...o}=e,i=Ve(),s=V(i.getValueTextProps(),o);return P.jsx(F.span,{...s,ref:t,children:n||i.valueAsString||r})});Ei.displayName="SelectValueText";const[Vu,tn]=X({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),Ci=E.forwardRef((e,t)=>{const n=tn(),r=V(n.getControlProps(),e);return P.jsx(F.span,{...r,ref:t})});Ci.displayName="SwitchControl";const wi=E.forwardRef((e,t)=>{const n=tn(),r=V(n.getHiddenInputProps(),e),o=pt();return P.jsx(F.input,{"aria-describedby":o==null?void 0:o.ariaDescribedby,...r,ref:t})});wi.displayName="SwitchHiddenInput";const Ii=E.forwardRef((e,t)=>{const n=tn(),r=V(n.getLabelProps(),e);return P.jsx(F.span,{...r,ref:t})});Ii.displayName="SwitchLabel";var Ti=ue("switch").parts("root","label","control","thumb"),xt=Ti.build(),xi=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`switch:${e.id}`},Hr=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.label)!=null?n:`switch:${e.id}:label`},Fu=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.thumb)!=null?n:`switch:${e.id}:thumb`},Du=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.control)!=null?n:`switch:${e.id}:control`},Ln=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.hiddenInput)!=null?n:`switch:${e.id}:input`},$u=e=>e.getById(xi(e)),He=e=>e.getById(Ln(e));function Mu(e,t){const{context:n,send:r,prop:o,scope:i}=e,s=!!o("disabled"),a=!!o("readOnly"),u=!!o("required"),c=!!n.get("checked"),d=!s&&n.get("focused"),h=!s&&n.get("focusVisible"),p=!s&&n.get("active"),l={"data-active":O(p),"data-focus":O(d),"data-focus-visible":O(h),"data-readonly":O(a),"data-hover":O(n.get("hovered")),"data-disabled":O(s),"data-state":c?"checked":"unchecked","data-invalid":O(o("invalid")),"data-required":O(u)};return{checked:c,disabled:s,focused:d,setChecked(f){r({type:"CHECKED.SET",checked:f,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:c,isTrusted:!1})},getRootProps(){return t.label({...xt.root.attrs,...l,dir:o("dir"),id:xi(i),htmlFor:Ln(i),onPointerMove(){s||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){s||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(f){var m;if(s)return;K(f)===He(i)&&f.stopPropagation(),Bn()&&((m=He(i))==null||m.focus())}})},getLabelProps(){return t.element({...xt.label.attrs,...l,dir:o("dir"),id:Hr(i)})},getThumbProps(){return t.element({...xt.thumb.attrs,...l,dir:o("dir"),id:Fu(i),"aria-hidden":!0})},getControlProps(){return t.element({...xt.control.attrs,...l,dir:o("dir"),id:Du(i),"aria-hidden":!0})},getHiddenInputProps(){return t.input({id:Ln(i),type:"checkbox",required:o("required"),defaultChecked:c,disabled:s,"aria-labelledby":Hr(i),"aria-invalid":o("invalid"),name:o("name"),form:o("form"),value:o("value"),style:Ut,onFocus(){const f=lt();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:f}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(f){if(a){f.preventDefault();return}const g=f.currentTarget.checked;r({type:"CHECKED.SET",checked:g,isTrusted:!0})}})}}}var{not:_r}=dt(),Gu={props({props:e}){return{defaultChecked:!1,label:"switch",value:"on",...e}},initialState(){return"ready"},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e("defaultChecked"),value:e("checked"),onChange(n){var r;(r=e("onCheckedChange"))==null||r({checked:n})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:e,prop:t})=>t("disabled")||e.get("fieldsetDisabled")},watch({track:e,prop:t,context:n,action:r}){e([()=>t("disabled")],()=>{r(["removeFocusIfNeeded"])}),e([()=>n.get("checked")],()=>{r(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:_r("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:_r("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({computed:e,scope:t,context:n}){if(!e("isDisabled"))return ro({pointerNode:$u(t),keyboardNode:He(t),isValidKey:r=>r.key===" ",onPress:()=>n.set("active",!1),onPressStart:()=>n.set("active",!0),onPressEnd:()=>n.set("active",!1)})},trackFocusVisible({computed:e,scope:t}){if(!e("isDisabled"))return tr({root:t.getRootNode()})},trackFormControlState({context:e,send:t,scope:n}){return Wt(He(n),{onFieldsetDisabledChange(r){e.set("fieldsetDisabled",r)},onFormReset(){const r=e.initial("checked");t({type:"CHECKED.SET",checked:!!r,src:"form-reset"})}})}},actions:{setContext({context:e,event:t}){for(const n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,scope:t}){const n=He(t);n&&Hn(n,!!e.get("checked"))},removeFocusIfNeeded({context:e,prop:t}){t("disabled")&&e.set("focused",!1)},setChecked({context:e,event:t}){e.set("checked",t.checked)},toggleChecked({context:e}){e.set("checked",!e.get("checked"))},dispatchChangeEvent({context:e,scope:t}){const n=He(t);_n(n,{checked:e.get("checked")})}}}};ee()(["checked","defaultChecked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);const Bu=e=>{const t=E.useId(),{getRootNode:n}=Ne(),{dir:r}=Ke(),o=pt(),i={id:t,ids:{label:o==null?void 0:o.ids.label,hiddenInput:o==null?void 0:o.ids.control},dir:r,disabled:o==null?void 0:o.disabled,readOnly:o==null?void 0:o.readOnly,invalid:o==null?void 0:o.invalid,required:o==null?void 0:o.required,getRootNode:n,...e},s=ke(Gu,i);return Mu(s,We)},Oi=E.forwardRef((e,t)=>{const[n,r]=te()(e,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),o=Bu(n),i=V(o.getRootProps(),r);return P.jsx(Vu,{value:o,children:P.jsx(F.label,{...i,ref:t})})});Oi.displayName="SwitchRoot";const Pi=E.forwardRef((e,t)=>{const n=tn(),r=V(n.getThumbProps(),e);return P.jsx(F.span,{...r,ref:t})});Pi.displayName="SwitchThumb";const[Hu,nn]=X({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),Ri=E.forwardRef((e,t)=>{const[n,r]=te()(e,["value"]),o=nn(),i=Io(),s=Jt({...i,present:o.value===e.value,immediate:!0}),a=V(o.getContentProps(n),s.getPresenceProps(),r);return P.jsx(er,{value:s,children:s.unmounted?null:P.jsx(F.div,{...a,ref:ft(s.ref,t)})})});Ri.displayName="TabContent";const Si=E.forwardRef((e,t)=>{const n=nn(),r=V(n.getIndicatorProps(),e);return P.jsx(F.div,{...r,ref:t})});Si.displayName="TabIndicator";const ki=E.forwardRef((e,t)=>{const n=nn(),r=V(n.getListProps(),e);return P.jsx(F.div,{...r,ref:t})});ki.displayName="TabList";const Ni=E.forwardRef((e,t)=>{const[n,r]=te()(e,["disabled","value"]),o=nn(),i=V(o.getTriggerProps(n),r);return P.jsx(F.button,{...i,ref:t})});Ni.displayName="TabTrigger";var Ai=ue("tabs").parts("root","list","trigger","content","indicator"),nt=Ai.build(),_u=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`tabs:${e.id}`},st=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.list)!=null?n:`tabs:${e.id}:list`},Vn=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.content)==null?void 0:r.call(n,t))!=null?o:`tabs:${e.id}:content-${t}`},xe=(e,t)=>{var n,r,o;return(o=(r=(n=e.ids)==null?void 0:n.trigger)==null?void 0:r.call(n,t))!=null?o:`tabs:${e.id}:trigger-${t}`},Li=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicator)!=null?n:`tabs:${e.id}:indicator`},ju=e=>e.getById(st(e)),Wu=(e,t)=>e.getById(Vn(e,t)),St=(e,t)=>e.getById(xe(e,t)),jr=e=>e.getById(Li(e)),mt=e=>{const n=`[role=tab][data-ownedby='${CSS.escape(st(e))}']:not([disabled])`;return oo(ju(e),n)},Ku=e=>Gi(mt(e)),Uu=e=>Bi(mt(e)),qu=(e,t)=>oa(mt(e),xe(e,t.value),t.loopFocus),Xu=(e,t)=>ia(mt(e),xe(e,t.value),t.loopFocus),Vi=e=>{var r;if(!e)return{left:0,top:0,width:0,height:0};const t=e.getBoundingClientRect(),n=(r=e.offsetParent)==null?void 0:r.getBoundingClientRect();return{left:n?t.left-n.left:t.left,top:n?t.top-n.top:t.top,width:t.width,height:t.height}},Yu=(e,t)=>{const n=io(mt(e),xe(e,t));return Fi(Vi(n))},Fi=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function zu(e,t){const{state:n,send:r,context:o,prop:i,scope:s}=e,a=i("translations"),u=n.matches("focused"),c=i("orientation")==="vertical",d=i("orientation")==="horizontal",h=i("composite");function p(l){return{selected:o.get("value")===l.value,focused:o.get("focusedValue")===l.value,disabled:!!l.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(l){r({type:"SET_VALUE",value:l})},clearValue(){r({type:"CLEAR_VALUE"})},setIndicatorRect(l){const f=xe(s,l);r({type:"SET_INDICATOR_RECT",id:f})},syncTabIndex(){r({type:"SYNC_TAB_INDEX"})},selectNext(l){r({type:"TAB_FOCUS",value:l,src:"selectNext"}),r({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(l){r({type:"TAB_FOCUS",value:l,src:"selectPrev"}),r({type:"ARROW_PREV",src:"selectPrev"})},focus(){var f;const l=o.get("value");l&&((f=St(s,l))==null||f.focus())},getRootProps(){return t.element({...nt.root.attrs,id:_u(s),"data-orientation":i("orientation"),"data-focus":O(u),dir:i("dir")})},getListProps(){return t.element({...nt.list.attrs,id:st(s),role:"tablist",dir:i("dir"),"data-focus":O(u),"aria-orientation":i("orientation"),"data-orientation":i("orientation"),"aria-label":a==null?void 0:a.listLabel,onKeyDown(l){if(l.defaultPrevented||Ns(l)||!Pe(l.currentTarget,K(l)))return;const f={ArrowDown(){d||r({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){d||r({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){c||r({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){c||r({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){r({type:"HOME"})},End(){r({type:"END"})}};let g=mn(l,{dir:i("dir"),orientation:i("orientation")});const m=f[g];if(m){l.preventDefault(),m(l);return}}})},getTriggerState:p,getTriggerProps(l){const{value:f,disabled:g}=l,m=p(l);return t.button({...nt.trigger.attrs,role:"tab",type:"button",disabled:g,dir:i("dir"),"data-orientation":i("orientation"),"data-disabled":O(g),"aria-disabled":g,"data-value":f,"aria-selected":m.selected,"data-selected":O(m.selected),"data-focus":O(m.focused),"aria-controls":m.selected?Vn(s,f):void 0,"data-ownedby":st(s),"data-ssr":O(o.get("ssr")),id:xe(s,f),tabIndex:m.selected&&h?0:-1,onFocus(){r({type:"TAB_FOCUS",value:f})},onBlur(v){const y=v.relatedTarget;(y==null?void 0:y.getAttribute("role"))!=="tab"&&r({type:"TAB_BLUR"})},onClick(v){v.defaultPrevented||ks(v)||g||(Bn()&&v.currentTarget.focus(),r({type:"TAB_CLICK",value:f}))}})},getContentProps(l){const{value:f}=l,g=o.get("value")===f;return t.element({...nt.content.attrs,dir:i("dir"),id:Vn(s,f),tabIndex:h?0:-1,"aria-labelledby":xe(s,f),role:"tabpanel","data-ownedby":st(s),"data-selected":O(g),"data-orientation":i("orientation"),hidden:!g})},getIndicatorProps(){const l=o.get("indicatorRect"),f=o.get("indicatorTransition");return t.element({id:Li(s),...nt.indicator.attrs,dir:i("dir"),"data-orientation":i("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":l.left,"--top":l.top,"--width":l.width,"--height":l.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:f?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[d?"left":"top"]:d?"var(--left)":"var(--top)"}})}}}var{createMachine:Ju}=ya(),Zu=Ju({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){Qs(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(n){var r;(r=e("onValueChange"))==null||r({value:n})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(n){var r;(r=e("onFocusChange"))==null||r({focusedValue:n})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:n,action:r}){n([()=>e.get("value")],()=>{r(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),n([()=>t("dir"),()=>t("orientation")],()=>{r(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){j(()=>{const n=e.get("focusedValue");if(!n)return;const o=t("deselectable")&&e.get("value")===n?null:n;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:n}){t.value!=null&&n(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:n}){const r=n("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",r?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){j(()=>{var t;(t=Ku(e))==null||t.focus()})},focusLastTab({scope:e}){j(()=>{var t;(t=Uu(e))==null||t.focus()})},focusNextTab({context:e,prop:t,scope:n,event:r}){var s;const o=(s=r.value)!=null?s:e.get("focusedValue");if(!o)return;const i=qu(n,{value:o,loopFocus:t("loopFocus")});j(()=>{t("composite")?i==null||i.focus():(i==null?void 0:i.dataset.value)!=null&&e.set("focusedValue",i.dataset.value)})},focusPrevTab({context:e,prop:t,scope:n,event:r}){var s;const o=(s=r.value)!=null?s:e.get("focusedValue");if(!o)return;const i=Xu(n,{value:o,loopFocus:t("loopFocus")});j(()=>{t("composite")?i==null||i.focus():(i==null?void 0:i.dataset.value)!=null&&e.set("focusedValue",i.dataset.value)})},syncTabIndex({context:e,scope:t}){j(()=>{const n=e.get("value");if(!n)return;const r=Wu(t,n);if(!r)return;Wn(r).length>0?r.removeAttribute("tabindex"):r.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:n}){var s;const r=(s=t.id)!=null?s:e.get("value");if(!jr(n))return;if(!r){e.set("indicatorTransition",!1);return}St(n,r)&&(e.set("indicatorRect",Yu(n,r)),to(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:n}){const r=t.get("indicatorCleanup");r&&r();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const i=St(n,o),s=jr(n);if(!i||!s)return;const a=so([i],{measure(u){return Vi(u)},onEntry({rects:u}){const[c]=u;e.set("indicatorRect",Fi(c))}});t.set("indicatorCleanup",a)},navigateIfNeeded({context:e,prop:t,scope:n}){var i;const r=e.get("value");if(!r)return;const o=St(n,r);us(o)&&((i=t("navigate"))==null||i({value:r,node:o,href:o.href}))}}}});ee()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);ee()(["disabled","value"]);ee()(["value"]);const Qu=e=>{const t=E.useId(),{getRootNode:n}=Ne(),{dir:r}=Ke(),o={id:t,dir:r,getRootNode:n,...e},i=ke(Zu,o);return zu(i,We)},Di=E.forwardRef((e,t)=>{const[n,r]=To(e),[o,i]=te()(r,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),s=Qu(o),a=V(s.getRootProps(),i);return P.jsx(Hu,{value:s,children:P.jsx(wo,{value:n,children:P.jsx(F.div,{...a,ref:t})})})});Di.displayName="TabsRoot";exports.CheckboxControl=So;exports.CheckboxGroup=Do;exports.CheckboxHiddenInput=$o;exports.CheckboxIndicator=Mo;exports.CheckboxLabel=Go;exports.CheckboxRoot=Bo;exports.CheckboxRootProvider=Ho;exports.DialogBackdrop=jo;exports.DialogCloseTrigger=Wo;exports.DialogContent=Ko;exports.DialogDescription=Uo;exports.DialogPositioner=qo;exports.DialogRoot=eu;exports.DialogTitle=Qo;exports.DialogTrigger=ei;exports.Portal=tu;exports.RadioGroupContext=iu;exports.RadioGroupItem=ti;exports.RadioGroupItemControl=ni;exports.RadioGroupItemHiddenInput=ri;exports.RadioGroupItemText=oi;exports.RadioGroupLabel=ii;exports.RadioGroupRoot=li;exports.SelectContent=ui;exports.SelectControl=di;exports.SelectItem=fi;exports.SelectLabel=hi;exports.SelectPositioner=gi;exports.SelectRoot=Lu;exports.SelectTrigger=bi;exports.SelectValueText=Ei;exports.SwitchControl=Ci;exports.SwitchHiddenInput=wi;exports.SwitchLabel=Ii;exports.SwitchRoot=Oi;exports.SwitchThumb=Pi;exports.TabContent=Ri;exports.TabIndicator=Si;exports.TabList=ki;exports.TabTrigger=Ni;exports.TabsRoot=Di;exports.anatomy=Xo;exports.anatomy$1=Ai;exports.anatomy$2=pi;exports.anatomy$3=si;exports.anatomy$4=Ti;exports.ark=F;exports.checkboxAnatomy=Fo;exports.createListCollection=jl;
2
+ //# sourceMappingURL=ark-ui-e4-hVrsF.cjs.map