@auersperg/flare 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist/cli/{chunk-x14smx1y.js → chunk-5s6zv1h9.js} +1 -1
- package/dist/cli/chunk-5tjevcsj.js +1174 -0
- package/dist/cli/{chunk-5cq8wgte.js → chunk-5yg1zj5n.js} +48 -29
- package/dist/cli/{chunk-786w6vrj.js → chunk-fv98dfg5.js} +21 -1
- package/dist/cli/flare.js +120 -4
- package/dist/platform/admin.js +790 -0
- package/dist/platform/dashboard/_astro/auth-view.CuxQ12Fa.js +1 -0
- package/dist/platform/dashboard/_astro/badge.DwKWvVfO.js +1 -0
- package/dist/platform/dashboard/_astro/card.Bdqmram9.js +1 -0
- package/dist/platform/dashboard/_astro/cli-approval.VKPc8wYS.js +1 -0
- package/dist/platform/dashboard/_astro/client.BUUZgEFj.js +1 -0
- package/dist/platform/dashboard/_astro/client.DYdPL2z4.js +9 -0
- package/dist/platform/dashboard/_astro/common.HrRZXwD9.js +1 -0
- package/dist/platform/dashboard/_astro/dashboard.CH594XTw.js +3 -0
- package/dist/platform/dashboard/_astro/data-view.CcyUYvId.js +1 -0
- package/dist/platform/dashboard/_astro/function-badge.MlTRYkqM.js +1 -0
- package/dist/platform/dashboard/_astro/functions-view.C8JWdNAh.js +1 -0
- package/dist/platform/dashboard/_astro/geist-cyrillic-ext-wght-normal.DjL33-gN.woff2 +0 -0
- package/dist/platform/dashboard/_astro/geist-cyrillic-wght-normal.BEAKL7Jp.woff2 +0 -0
- package/dist/platform/dashboard/_astro/geist-latin-ext-wght-normal.DC-KSUi6.woff2 +0 -0
- package/dist/platform/dashboard/_astro/geist-latin-wght-normal.BgDaEnEv.woff2 +0 -0
- package/dist/platform/dashboard/_astro/geist-vietnamese-wght-normal.6IgcOCM7.woff2 +0 -0
- package/dist/platform/dashboard/_astro/index.DiiMDa7R.css +2 -0
- package/dist/platform/dashboard/_astro/input-group.3twGpQ77.js +1 -0
- package/dist/platform/dashboard/_astro/react-dom.DwX89IcG.js +1 -0
- package/dist/platform/dashboard/_astro/refresh-cw.B0Cj85jJ.js +1 -0
- package/dist/platform/dashboard/_astro/sdk-view.CRFkbEyS.js +1 -0
- package/dist/platform/dashboard/_astro/services-view.B2suYnaG.js +1 -0
- package/dist/platform/dashboard/_astro/settings-view.BFP47ySK.js +3 -0
- package/dist/platform/dashboard/_astro/status-badge.BV1dzbX9.js +1 -0
- package/dist/platform/dashboard/_astro/table-guide.DzBDP6fC.js +2 -0
- package/dist/platform/dashboard/_astro/tabs.GRO5rCrK.js +1 -0
- package/dist/platform/dashboard/_headers +3 -0
- package/dist/platform/dashboard/bootstrap/action.js +263 -0
- package/dist/platform/dashboard/bootstrap/api.ts +5 -0
- package/dist/platform/dashboard/bootstrap/facet.js +914 -0
- package/dist/platform/dashboard/bootstrap/manifest.json +5 -0
- package/dist/platform/dashboard/bootstrap/openapi.json +18 -0
- package/dist/platform/dashboard/bootstrap/release.json +11 -0
- package/dist/platform/dashboard/bootstrap/schema.json +1 -0
- package/dist/platform/dashboard/index.html +1 -0
- package/dist/platform/manifest.json +230 -0
- package/dist/platform/migrations/0001.sql +8 -0
- package/dist/platform/migrations/0002_project_aliases.sql +6 -0
- package/dist/platform/migrations/0003_cli_login.sql +9 -0
- package/dist/platform/migrations/0004_retention.sql +4 -0
- package/dist/platform/migrations/0005_project_deletion.sql +11 -0
- package/dist/platform/migrations/0006_platform_installation.sql +8 -0
- package/dist/platform/runtime.js +9392 -0
- package/dist/sdk/client.js +10 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./react-dom.DwX89IcG.js";var i=e(t(),1),a=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function o(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:a(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var s=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),u={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function d(e){return e!=null}function f(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??u.width,a=e.size??e.height??u.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?l(...c):l(`lucide`,...s,...c),p=t.absoluteStrokeWidth?Number(t.strokeWidth??u[`stroke-width`])*Number(e.size??e.width??u.width)/Number(t.size??t.width??u.width):t.strokeWidth??u[`stroke-width`];return[`svg`,{...Object.entries(u).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&d(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&d(t.width)&&{[r(`width`)]:t.width},...`height`in t&&d(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function p(e,t={}){return f(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var m=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},h=(0,i.createContext)({}),g=()=>(0,i.useContext)(h),_=(0,i.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:s,className:c=``,children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=g()??{},w=!!u||m(h),[T,E,D=[]]=p(f,{color:e??S,width:n??t??v,height:r??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:s??x,className:l(C,c),hasA11yProp:w,attributes:h});return(0,i.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function v(e,t=[],n=[]){let r=typeof e==`string`?o(e,t,n):e,a=(0,i.forwardRef)(({className:e,...t},n)=>(0,i.createElement)(_,{ref:n,icon:r,className:e,...t}));return r.name&&(a.displayName=c(r.name)),a}var y={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};y.node;var b=v(y),x={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};x.node;var S=v(x),C={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};C.node;var w=v(C),T={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};T.node;var E=v(T);function D(){return typeof window<`u`}function O(e){return j(e)?(e.nodeName||``).toLowerCase():`#document`}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function A(e){return((j(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function j(e){return D()?e instanceof Node||e instanceof k(e).Node:!1}function M(e){return D()?e instanceof Element||e instanceof k(e).Element:!1}function N(e){return D()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function P(e){return!D()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}function F(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function I(e){return/^(table|td|th)$/.test(O(e))}function L(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var R=/transform|translate|scale|rotate|perspective|filter/,z=/paint|layout|strict|content/,B=e=>!!e&&e!==`none`,V;function ee(e){let t=M(e)?ne(e):e;return B(t.transform)||B(t.translate)||B(t.scale)||B(t.rotate)||B(t.perspective)||!U()&&(B(t.backdropFilter)||B(t.filter))||R.test(t.willChange||``)||z.test(t.contain||``)}function H(e){let t=W(e);for(;N(t)&&!te(t);){if(ee(t))return t;if(L(t))return null;t=W(t)}return null}function U(){return V??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),V}function te(e){return/^(html|body|#document)$/.test(O(e))}function ne(e){return k(e).getComputedStyle(e)}function re(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function W(e){if(O(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||P(e)&&e.host||A(e);return P(t)?t.host:t}function G(e){let t=W(e);return te(t)?(e.ownerDocument||e).body:N(t)&&F(t)?t:G(t)}function ie(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=G(e),i=r===e.ownerDocument?.body,a=k(r);if(i){let e=ae(a);return t.concat(a,a.visualViewport||[],F(r)?r:[],e&&n?ie(e):[])}return t.concat(r,ie(r,[],n))}function ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var oe={...i},se={};function ce(e,t){let n=i.useRef(se);return n.current===se&&(n.current=e(t)),n}var le=oe.useInsertionEffect,ue=le&&le!==oe.useLayoutEffect?le:e=>e();function K(e){let t=ce(de).current;return t.next=e,ue(t.effect),t.trampoline}function de(){let e={next:void 0,callback:fe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function fe(){}var q=typeof document<`u`?i.useLayoutEffect:()=>{};function J(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var pe={};function me(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ge(t);let a=ge(e);return t&&(a=_e(a,t)),n&&(a=_e(a,n)),r&&(a=_e(a,r)),i&&(a=_e(a,i)),a}function he(e){if(e.length===0)return pe;if(e.length===1)return ge(e[0]);let t=ge(e[0]);for(let n=1;n<e.length;n+=1)t=_e(t,e[n]);return t}function ge(e){return xe(e)?{...e(pe)}:ve(e)}function _e(e,t){return xe(t)?t(e):ye(e,t)}function ve(e){let t={...e};for(let e in t){let n=t[e];be(e,n)&&(t[e]=Ce(n))}return t}function ye(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=J(e.style,r);break;case`className`:e[n]=Te(e.className,r);break;default:e[n]=be(n,r)?Se(e[n],r):r}}return e}function be(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function xe(e){return typeof e==`function`}function Se(e,t){return t?e?(...n)=>{let r=n[0];if(Ee(r)){let i=r;we(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ce(t):e}function Ce(e){return e&&((...t)=>{let n=t[0];return Ee(n)&&we(n),e(...t)})}function we(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Te(e,t){return t?e?t+` `+e:t:e}function Ee(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function De(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Oe=De(`https://base-ui.com/production-error`,`Base UI`),ke=i.createContext(void 0);function Ae(e=!1){let t=i.useContext(ke);if(t===void 0&&!e)throw Error(Oe(16));return t}function je(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,s=r&&t!==!1,c=r&&t===!1;return{props:i.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,o,a])}}function Y(e){return e?.ownerDocument||document}function Me(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(k(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ne(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=i.useRef(null),c=Ae(!0),l=o??c!==void 0,{props:u}=je({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=i.useCallback(()=>{let e=s.current;Pe(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return q(d,[d]),{getButtonProps:i.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return me({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(we(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=Pe(r),s=!a&&Fe(r),c=n&&(a?i:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),Me(r,e))}else!c||a||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Me(r,e)))},onKeyUp(e){t||(we(e),i?.(e),e.target===e.currentTarget&&a&&l&&Pe(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Me(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},u,c)},[t,u,l,a]),buttonRef:K(e=>{s.current=e,d()})}}function Pe(e){return N(e)&&e.tagName===`BUTTON`}function Fe(e){return N(e)&&e.tagName===`A`&&!!e.href}function Ie(e,t,n,r){let i=ce(Re).current;return ze(i,e,t,n,r)&&Ve(i,[e,t,n,r]),i.callback}function Le(e){let t=ce(Re).current;return Be(t,e)&&Ve(t,e),t.callback}function Re(){return{callback:null,cleanup:null,refs:[]}}function ze(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Be(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ve(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var He=19;function Ue(e){return He>=e}function We(e){if(!i.isValidElement(e))return null;let t=e,n=t.props;return(Ue(19)?n?.ref:t.ref)??null}function X(){}var Ge=Object.freeze([]),Ke=Object.freeze({});function qe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Je(e,t){return typeof e==`function`?e(t):e}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=et(r));let i=Ze(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ke;return tt(e,r,i,a)}function Ze(e,t,n){let{className:r,style:i}=e,{state:a=Ke,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Je(r,a):void 0,d=l?Ye(i,a):void 0,f=l?qe(a,c):Ke,p=l&&s?Qe(s):void 0,m=l?J(f,p)??{}:Ke;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Le([m.ref,We(n),...o]):Ie(m.ref,We(n),o):Ie(null,null)),l?(u!==void 0&&(m.className=Te(m.className,u)),d!==void 0&&(m.style=J(m.style,d)),m):Ke}function Qe(e){return Array.isArray(e)?he(e):me(void 0,e)}var $e=Symbol.for(`react.lazy`);function et(e){if(e?.$$typeof!==$e)return e;let t=i.Children.toArray(e)[0];return i.isValidElement(t)?t:e}function tt(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=me(n,t.props);return e.ref=n.ref,i.cloneElement(t,e)}return nt(e,n)}function nt(e,t){return e===`button`?(0,i.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,i.createElement)(`img`,{alt:``,...t,key:t.key}):i.createElement(e,t)}var rt=i.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Ne({disabled:i,focusableWhenDisabled:a,native:o});return Xe(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function it(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=it(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function at(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=it(e))&&(r&&(r+=` `),r+=t);return r}var ot=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,st=at,ct=(e,t)=>n=>{if(t?.variants==null)return st(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ot(t)||ot(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return st(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},lt=48,ut=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-lt-t;return n},dt=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},ft=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-lt;n+=i>>>1^-(i&1),t[r]=n}return t},pt=384,mt=[],ht=dt(ut(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),gt=dt(ut(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),_t=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,vt=(()=>{let e=ht.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=ht[n];i<ht[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(ht[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=ht[i];a<ht[i+1];a++)n[r++]=e,e+=t[e]}return n})(),yt=ut(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),bt=dt(ut(`123333359346463635126536711576`)),xt=ut(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),St=ut(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Ct=ft(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),wt=(()=>{let e=new Int32Array(319).fill(-1),t=ft(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=ft(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Tt=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Et=ft(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Dt=ft(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Ot=ft(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),kt=new Int32Array(995),At=new Int32Array(995),jt=new Int32Array(995),Mt=``,Nt=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Et.length;r++)for(let i of Tt[Ot[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Nt[a*2]=Mt.length,Nt[a*2+1]=i.length,Mt+=i),kt[n]=Et[r],At[n]=Dt[r],jt[n]=a,n++}}var Pt=ft(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Ft=dt(ut(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),It=ft(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Lt=ut(`ij`),Rt=ut(``),zt=ut(`1`),Bt={GROUP_COUNT:pt,customValidatorNames:mt,edgeStart:ht,labelStart:gt,labelText:_t,edgeTarget:vt,nodeGroup:yt,nodeVlist:wt,vlistPat:bt,vlistOps:xt,vlistRef:St,vlistGroup:Ct,litAnchor:kt,litGroup:At,litPool:jt,poolOffsets:Nt,poolText:Mt,adjGid:Pt,adjStart:Ft,adjTgt:It,patGid:Lt,patTgt:Rt,postfixLookupGroups:zt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Vt=`line`in Error(),Ht=-1,Ut=-1,Wt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Gt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Kt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Wt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Wt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,H=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),U=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=0,G=-1,ie=-1,ae=-1,oe=-1,se=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ce=e=>/\s/.test(String.fromCharCode(e)),le=(e,t,n)=>{if(W=0,G=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)W=1;else if(r===40&&i===41)W=2;else return;ae=t+1,oe=n-1;let a=t+1;if(se(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!se(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(G=t+1,ie=a,ae=a+1)}},ue=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},K=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,de=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fe=e=>!!e&&!Number.isNaN(Number(e)),q=(e,t,n)=>{if(n-t<11||!ue(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ue(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ue(e,t+10,t+18,`-normal/`)},J=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return H[e-25](t.slice(n,r));let i=e-10;if(W!==J[i])return!1;if(G>=0){for(let e of pe[i])if(ue(t,G,ie,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ae,oe);return U.test(e)&&!te.test(e)}case 3:return fe(t.slice(ae,oe));case 4:return re.test(t.slice(ae,oe));default:return ne.test(t.slice(ae,oe))}}switch(e){case 0:return!0;case 1:return W===0;case 2:return W===1;case 3:return W===2;case 4:return K.test(t.slice(n,r));case 5:return fe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&fe(t.slice(n,r-1));case 8:return de.test(t.slice(n,r));default:return q(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=Wt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Y=new Int32Array(Oe),Me=new Uint8Array(Oe),Ne=0,Pe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Ne++&3))c=e|Ne>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Y[c]=o,Me[c]=s},Fe=()=>Ae.fill(null),Ie=256,Le=[new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie)],[Re,ze,Be,Ve]=Le,He=new Uint8Array(Ie),Ue=new Uint8Array(Ie),We=()=>{Ie*=2,Le=Le.map(e=>{let t=new Int32Array(Ie);return t.set(e),t}),[Re,ze,Be,Ve]=Le;let e=new Uint8Array(Ie);e.set(He),He=e,Ue=new Uint8Array(Ie)},X=64,Ge=new Int32Array(X),Ke=new Int32Array(X),qe=new Int32Array(r),Je=2048,Ye=21,Xe=new Float64Array(Je),Ze=new Int32Array(Je),Qe=0,$e=(e,t)=>{if(e===0&&t<r)return qe[t]===Qe?1:(qe[t]=Qe,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Ye;for(;Ze[i]===Qe;){if(Xe[i]===n)return 1;i=i+1&Je-1}return Xe[i]=n,Ze[i]=Qe,0},et=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Ht:_e(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ke[t];if(r>n)continue;let i=Ge[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;le(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return Ht},tt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||ve.size>xe)&&(ve=new Map,ye=new Map,be=2,Fe()),we>Te&&(Ce=new Map,we=r,Fe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ce(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ce(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ie&&We();let _=n++;Re[_]=p,ze[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Be[_]=je[t],Ve[_]=Y[t],He[_]=Me[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){Be[_]=Ht,Pe(y,e,p,h,v,Ht,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ge[0]=0,Ke[0]=M,R=1);let z=Ut,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Ut:P,B=R),P!==Ut){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Ut;else{let e=i[P],t=i[P+1],c=Ut;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===X){X*=2;let e=new Int32Array(X);e.set(Ge),Ge=e;let t=new Int32Array(X);t.set(Ke),Ke=t}Ge[R]=r,Ke[R]=t+2,R++}}A===D&&(z=F<I?Ut:P,B=R);let H=F<I?Ut:P,U,te=!1;if(A>=0){if(te=!0,U=et(e,E,A,z,B),U!==Ht&&U<r&&j[U]){let t=et(e,E,D,H,R);t!==Ht&&t!==U&&(U=t,te=!1)}else U===Ht&&(U=et(e,E,D,H,R),te=!1)}else U=et(e,E,D,H,R);let ne=0,re=0;U===Ht?Be[_]=Ht:(re=+!!te,ne=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>Se(e,O)),Be[_]=U,He[_]=re,Ve[_]=ne),Pe(y,e,p,h,v,U,ne,re)}if(n===0)return``;if(n===1)return Re[0]===0&&ze[0]===t?e:e.slice(Re[0],ze[0]);if(n*k>Je){for(;n*k>Je;)Je<<=1,Ye--;Xe=new Float64Array(Je),Ze=new Int32Array(Je)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);Qe=Qe+1|0,Qe===0&&(qe.fill(0),Ze.fill(0),Qe=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Be[e];if(t===Ht){Ue[e]=1;continue}let n=Ve[e];if($e(n,t)===1)Ue[e]=0,f=!0;else if(Ue[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)$e(n,x[e]);if(He[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&$e(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ue[m]){m++;continue}let t=Re[m],r=ze[m],i=m+1;for(;i<n&&Ue[i]&&Re[i]===r+1&&e.charCodeAt(r)===32;)r=ze[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},nt=16384,rt=new Int32Array(nt*2),it=0,at=1,ot=Object.create(null),st=Object.create(null),ct=new Map,lt=new Map,ut=0,dt=0,ft=()=>{it^=nt,at=at+1|0,dt=0},pt=e=>{let t=ot[e];if(t!==void 0)return t;let n=Gt(e,0,e.length),r=(n&16383)+it,i=rt[r]===(n^at)||rt[r^nt]===(n^at-1);return i&&(t=st[e],t!==void 0)?(ot[e]=t,t):(t=tt(e),i?(ot[e]=t,++ut>z&&(ut=0,st=ot,ot=Object.create(null),ft())):(rt[r]=n^at,++dt>nt&&ft()),t)},mt=e=>{let t=ct.get(e);if(t!==void 0)return t;let n=Gt(e,0,e.length),r=(n&16383)+it,i=rt[r]===(n^at)||rt[r^nt]===(n^at-1);return i&&(t=lt.get(e),t!==void 0)?(ct.set(e,t),t):(t=tt(e),i?(ct.set(e,t),++ut>z&&(ut=0,lt=ct,ct=new Map,ft())):(rt[r]=n^at,++dt>nt&&ft()),t)},ht=e=>{let t=Gt(e,0,e.length),n=(t&16383)+it;return rt[n]===(t^at)||rt[n^nt]===(t^at-1)||(rt[n]=t^at,++dt>nt&&ft(),!1)},gt=z===0?tt:Vt?e=>{let t=ct.get(e);return t===void 0?mt(e):t}:pt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?gt(arguments[0]):gt(Yt.apply(null,arguments))},mergeString:gt,seenBefore:z===0?()=>!1:ht,mergeUncached:tt}},qt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:qt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Jt=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:qt(i,t);a&&(n&&(n+=` `),n+=a)}return n},Yt=function(){return Jt(arguments,!1)},Xt=256,Zt=16,Qt=1024,$t=4096,en=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array($t).fill(``),l=Array($t).fill(``),u=Array($t).fill(``));let i=Gt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=qt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Zt&&(_.miss=Zt,_.skip=Qt,_.e.length=0,_.at=0);let u=_.e;u.length<Xt?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(qt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},tn=Kt(Bt),Z=en(tn.mergeString,tn);tn.merge;var nn=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),rn=n(((e,t)=>{t.exports=nn()})),Q=rn(),an=ct(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function on({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Q.jsx)(rt,{"data-slot":`button`,className:Z(an({variant:t,size:n,className:e})),...r})}var sn=`data-valid`,cn=`data-invalid`,ln={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},un={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},dn={valid(e){return e===null?null:e?{[sn]:``}:{[cn]:``}}},fn={invalid:void 0,name:void 0,validityData:{state:ln,errors:[],error:``,value:``,initialValue:null},setValidityData:X,disabled:void 0,setTouched:X,setDirty:X,setFilled:X,setFocused:X,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:un,registerFieldControl:X,validation:{getValidationProps:(e,t=Ke)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:X,getInputControl:()=>null,commit:async()=>{},change:X}},pn=i.createContext(fn);function mn(e=!0){let t=i.useContext(pn);if(t.setValidityData===X&&!e)throw Error(Oe(28));return t}var hn=i.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:X,validationMode:`onSubmit`,submitCountRef:{current:0}});function gn(){return i.useContext(hn)}function _n(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}var vn=0;function yn(e,t=`mui`){let n=i.useRef(void 0),r=_n(),a=e??n.current;return i.useEffect(()=>{n.current??(vn+=1,n.current=`${t}-${vn}`,e??r())},[e,t,r]),a}var bn=oe.useId;function xn(e,t){if(bn!==void 0){let n=bn();return e??(t?`${t}-${n}`:n)}return yn(e,t)}function Sn(e){return xn(e,`base-ui`)}var Cn=i.createContext({controlId:void 0,registerControlId:X,resetControlId:X,labelId:void 0,setLabelId:X,messageIds:[],setMessageIds:X,getDescriptionProps:e=>e});function wn(){return i.useContext(Cn)}function Tn(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:a,resetControlId:o}=wn(),s=Sn(),c=ce(()=>Symbol()),l=i.useRef(!1),u=i.useRef(!1),d=K(()=>{l.current&&a!==X&&(l.current=!1,a(c.current,void 0))});return q(()=>{if(!n||a===X){d();return}let e;if(t!==void 0)u.current=!0,e=t;else if(u.current)e=s;else{o();return}e===void 0?d():(l.current=!0,a(c.current,e))},[t,n,a,o,s,c,d]),q(()=>d,[d]),(n?r:void 0)??t??s}function En(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Dn,platform:On,maxTouchPoints:kn}=En(),An=Dn.toLowerCase(),jn=On.toLowerCase(),Mn=/^i(os$|p)/.test(jn)||jn===`macintel`&&kn>1,Nn=`android`,Pn=jn===Nn||An.includes(Nn),Fn=!Mn&&jn.startsWith(`mac`);jn.startsWith(`win`),!Pn&&/^(linux|chrome os)/.test(jn);var In=Fn||Mn,Ln=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ln&&An.includes(`firefox`),!Ln&&An.includes(`chrom`);var Rn=In,zn=/jsdom|happydom/.test(An);function Bn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&P(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Vn(e,t){let n=e;for(;n;){if(M(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(P(n)?n.host:null)}return null}function Hn(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Un=`data-base-ui-focusable`,Wn=`ArrowLeft`,Gn=`ArrowRight`,Kn=`ArrowUp`,qn=`ArrowDown`,Jn=`data-starting-style`,Yn=`data-ending-style`,Xn={[Jn]:``},Zn={[Yn]:``},Qn={transitionStatus(e){return e===`starting`?Xn:e===`ending`?Zn:null}},$n=`data-open`,er=`data-closed`,tr=`data-anchor-hidden`,nr=`data-popup-open`,rr=`data-pressed`,ir={[nr]:``},ar={[nr]:``,[rr]:``},or={[$n]:``},sr={[er]:``},cr={[tr]:``},lr={open(e){return e?ir:null}},ur={open(e){return e?ar:null}},dr={open(e){return e?or:sr},anchorHidden(e){return e?cr:null}},fr={...dr,...Qn};function pr(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function mr(e){return e.matches(`html,body`)}function hr(e){return N(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function gr(e){return e?e.getAttribute(`role`)===`combobox`&&hr(e):!1}function _r(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function vr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...vr(e,t.id,n)])}function yr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function br(e){e.preventDefault(),e.stopPropagation()}function xr(e){return`nativeEvent`in e}function Sr(e){return e.pointerType===``&&e.isTrusted?!0:Pn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Cr(e){return zn?!1:!Pn&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Pn||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function wr(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Tr(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Er=Math.min,Dr=Math.max,Or=Math.round,kr=Math.floor,Ar=e=>({x:e,y:e}),jr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Mr(e,t,n){return Dr(e,Er(t,n))}function Nr(e,t){return typeof e==`function`?e(t):e}function Pr(e){return e.split(`-`)[0]}function Fr(e){return e.split(`-`)[1]}function Ir(e){return e===`x`?`y`:`x`}function Lr(e){return e===`y`?`height`:`width`}function Rr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function zr(e){return Ir(Rr(e))}function Br(e,t,n){n===void 0&&(n=!1);let r=Fr(e),i=zr(e),a=Lr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Yr(o)),[o,Yr(o)]}function Vr(e){let t=Yr(e);return[Hr(e),t,Hr(t)]}function Hr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ur=[`left`,`right`],Wr=[`right`,`left`],Gr=[`top`,`bottom`],Kr=[`bottom`,`top`];function qr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Wr:Ur:t?Ur:Wr;case`left`:case`right`:return t?Gr:Kr;default:return[]}}function Jr(e,t,n,r){let i=Fr(e),a=qr(Pr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Hr)))),a}function Yr(e){let t=Pr(e);return jr[t]+e.slice(t.length)}function Xr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Zr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Xr(e)}function Qr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function $r(e,t){return t<0||t>=e.length}function ei(e,t){return ri(e.current,{disabledIndices:t})}function ti(e,t){return ri(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ni(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>ri(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:$r(e,u)?-1:u,wrapped:d}}function ri(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ii(e,a,r));return a}function ii(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!oi(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ai(e){return e.visibility===`hidden`||e.visibility===`collapse`}function oi(e,t=e?ne(e):null){return!e||!e.isConnected||!t||ai(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var si=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ci(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return P(n)?n.host:null}function li(e){for(let t of Array.from(e.children))if(O(t)===`summary`)return t;return null}function ui(e,t){let n=li(t);return!!n&&(e===n||$(n,e))}function di(e){let t=e?O(e):``;return e!=null&&e.matches(si)&&(t!==`summary`||e.parentElement!=null&&O(e.parentElement)===`details`&&li(e.parentElement)===e)&&(t!==`details`||li(e)==null)&&(t!==`input`||e.type!==`hidden`)}function fi(e){if(!di(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ci(t)){let n=t!==e,r=O(t)===`slot`;if(t.hasAttribute(`inert`)||n&&O(t)===`details`&&!t.open&&!ui(e,t)||t.hasAttribute(`hidden`)||!r&&!pi(t,n))return!1}return!0}function pi(e,t){let n=ne(e);return t?n.display!==`none`:oi(e,n)}function mi(e){let t=e.tabIndex;if(t<0){let t=O(e);if(t===`details`||t===`audio`||t===`video`||N(e)&&e.isContentEditable)return 0}return t}function hi(e){if(O(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function gi(e,t){let n=hi(e);if(!n)return!0;let r=t.find(e=>{let t=hi(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=hi(e);return t?.name===n.name&&t.form===n.form})===n}function _i(e){if(N(e)&&O(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return N(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function vi(e,t){_i(e).forEach(e=>{di(e)&&t.push(e),vi(e,t)})}function yi(e,t,n){_i(e).forEach(e=>{N(e)&&e.matches(t)&&n.push(e),yi(e,t,n)})}function bi(e){return fi(e)&&mi(e)>=0}function xi(e){let t=[];return vi(e,t),t.filter(fi)}function Si(e){let t=xi(e);return t.filter(e=>mi(e)>=0&&gi(e,t))}function Ci(e,t){let n=Si(e),r=n.length;if(r===0)return;let i=Bn(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function wi(e){return Ci(Y(e).body,1)||e}function Ti(e){return Ci(Y(e).body,-1)||e}function Ei(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function Di(e){Si(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Oi(e){let t=[];yi(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ki(e){i.useEffect(e,Ge)}var Ai=0,ji=class e{static create(){return new e}currentId=Ai;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ai,t()},e)}isStarted(){return this.currentId!==Ai}clear=()=>{this.currentId!==Ai&&(clearTimeout(this.currentId),this.currentId=Ai)};disposeEffect=()=>this.clear};function Mi(){let e=ce(ji.create).current;return ki(e.disposeEffect),e}var Ni=null;globalThis.requestAnimationFrame;var Pi=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Fi=class e{static create(){return new e}static request(e){return Pi.request(e)}static cancel(e){return Pi.cancel(e)}currentId=Ni;request(e){this.cancel(),this.currentId=Pi.request(()=>{this.currentId=Ni,e()})}cancel=()=>{this.currentId!==Ni&&(Pi.cancel(this.currentId),this.currentId=Ni)};disposeEffect=()=>this.cancel};function Ii(){let e=ce(Fi.create).current;return ki(e.disposeEffect),e}var Li=e(r(),1);function Ri(e){return e==null?e:`current`in e?e.current:e}function zi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Bi=null;function Vi(e){if(!Bi){let e=[];Bi=e,queueMicrotask(()=>{Bi=null,Li.flushSync(()=>{for(let t of e)t()})})}Bi.push(e)}function Hi(e,t=!1,n=!1){let r=Ii();return K((i,a=null)=>{r.cancel();let o=Ri(e);if(o==null)return;let s=o,c=()=>{n?Vi(()=>{a?.aborted||i()}):Li.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(zi(s).map(e=>e.finished.then(X))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(zi(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Jn;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ui(e){let{enabled:t=!0,open:n,ref:r,batch:a=!1,onComplete:o}=e,s=K(o),c=Hi(r,n,a);i.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}function Wi(e,t=!1,n=!1,r=!1){let[a,o]=i.useState(e&&t?`idle`:void 0),[s,c]=i.useState(e&&!r);return e&&!s&&(c(!0),o(`starting`)),!e&&s&&a!==`ending`&&!n&&o(`ending`),!e&&!s&&a===`ending`&&o(void 0),q(()=>{if(!e&&s&&a!==`ending`&&n){let e=Fi.request(()=>{o(`ending`)});return()=>{Fi.cancel(e)}}},[e,s,a,n]),q(()=>{if(!e||t||a===void 0)return;let n=Fi.request(()=>{o(void 0)});return()=>{Fi.cancel(n)}},[t,e,a]),q(()=>{if(!e||!t)return;e&&s&&a!==`idle`&&o(`starting`);let n=Fi.request(()=>{o(`idle`)});return()=>{Fi.cancel(n)}},[t,e,s,a]),{mounted:s,setMounted:c,transitionStatus:a}}function Gi(e,t,n){let{setFocused:r,focusOwnerRef:i}=mn(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Ki(e,t,n,r,i=!0,a){let{registerFieldControl:o}=mn(),s=ce(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function qi(e,t){let n=i.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ji(e,t,n,r){let i=!1,a=!1,o=r??Ke;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Yi=`none`,Xi=`trigger-press`,Zi=`outside-press`,Qi=`item-press`,$i=`close-press`,ea=`focus-out`,ta=`escape-key`,na=`list-navigation`,ra=`cancel-open`,ia=`disabled`,aa=`missing`,oa=`initial`,sa=`imperative-action`,ca=`window-resize`,la=i.forwardRef(function(e,t){let{render:n,className:r,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=mn(),{clearErrors:C,elementRef:w,submitCountRef:T}=gn(),E=g||c,D=h??o,O={...m,disabled:E},{labelId:k}=wn(),A=Tn({id:a}),j=s!==void 0,M=s==null?void 0:String(s),N=K(()=>S.inputRef.current?.value);Ki(S.inputRef,A,M,N,!E,o),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,u,S.inputRef,b]),qi(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=i.useRef(null),F=Gi(E,P),I=Mi();return Xe(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:d,...j?{value:s}:{defaultValue:u},onChange(e){let t=e.currentTarget.value,n=Ji(Yi,e.nativeEvent);l?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(_(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){_(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},p,e=>S.getValidationProps(E,e)],stateAttributesMapping:dn})}),ua=i.forwardRef(function(e,t){return(0,Q.jsx)(la,{ref:t,...e})});function da({className:e,type:t,...n}){return(0,Q.jsx)(ua,{type:t,"data-slot":`input`,className:Z(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function fa({controlled:e,default:t,name:n,state:r=`value`}){let{current:a}=i.useRef(e!==void 0),[o,s]=i.useState(()=>t);return[a&&e!==void 0?e:o,i.useCallback(e=>{a||s(e)},[])]}var pa=i.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ma(){return i.useContext(pa)}function ha(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=K(a),[,s]=i.useState(0),c=ce(_a).current,l=ce(ga).current,u=i.useRef(0),d=i.useRef(!0),f=i.useRef(null),p=i.useRef(null),m=K(()=>{d.current||(d.current=!0,s(e=>e+1))}),h=K((e,t)=>{l.set(e,t),m()}),g=K(e=>{l.delete(e),m()}),_=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),u.current=n.current.length,t});function v(e){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ba(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&xa(r,n)>0){t.disconnect(),m();return}r=n}});p.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ya(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=K(()=>{let[e,t]=va(l),n=_(e),r=f.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),f.current=e,d.current=!1,i&&(c.forEach(e=>e(n)),o(n))});q(()=>(!d.current&&f.current&&_(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,_]),q(()=>{d.current&&y()}),q(()=>()=>{p.current?.disconnect(),d.current=!0},[]);let b=K(e=>(c.add(e),()=>{c.delete(e)})),x=i.useMemo(()=>({register:h,unregister:g,subscribeMapChange:b,nextIndexRef:u}),[h,g,b,u]);return(0,Q.jsx)(pa.Provider,{value:x,children:t})}function ga(){return new Map}function _a(){return new Set}function va(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>xa(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function ya(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ba(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function xa(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Sa(e={}){let{guess:t,label:n,metadata:r,textRef:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,nextIndexRef:u}=ma(),d=i.useRef(-1),[f,p]=i.useState(o==null&&t?()=>{if(d.current===-1){let e=u.current;u.current+=1,d.current=e}return d.current}:-1),m=o??f,h=i.useRef(null),g=i.useCallback(e=>{let t=h.current;t&&c(t),h.current=e,e&&s(e,{metadata:r??null,index:o??null,label:n,textRef:a})},[o,s,c,r,n,a]);return q(()=>{if(o==null)return l(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&p(t)})},[o,l]),{ref:g,index:m}}var Ca=n((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),wa=n(((e,t)=>{t.exports=Ca()})),Ta=wa(),Ea=i.createContext(void 0),Da={disableStyleElements:!1};function Oa(){return i.useContext(Ea)??Da}function ka(e){return Ue(19)?e:e?`true`:void 0}function Aa(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var ja=`ArrowUp`,Ma=`ArrowDown`,Na=`ArrowLeft`,Pa=`ArrowRight`,Fa=`Home`,Ia=new Set([ja,Ma,Na,Pa,Fa,`End`]),La=[`Shift`,`Control`,`Alt`,`Meta`];function Ra(e){return N(e)&&e.tagName===`INPUT`}function za(e){return!!(Ra(e)&&e.selectionStart!=null||N(e)&&e.tagName===`TEXTAREA`)}function Ba(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Va(e,t,`left`),a=Ha(e),o=Ha(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Va(e,t,`top`),r=Ha(e),i=Ha(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Va(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Ha(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Ua=i.createContext(void 0);function Wa(){return i.useContext(Ua)?.direction??`ltr`}function Ga({className:e,...t}){return(0,Q.jsx)(`textarea`,{"data-slot":`textarea`,className:Z(`flex field-sizing-content min-h-16 w-full rounded-none border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function Ka({className:e,...t}){return(0,Q.jsx)(`label`,{"data-slot":`label`,className:Z(`flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function qa({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`field-group`,className:Z(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var Ja=ct(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Ya({className:e,orientation:t=`vertical`,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:Z(Ja({orientation:t}),e),...n})}function Xa({className:e,...t}){return(0,Q.jsx)(Ka,{"data-slot":`field-label`,className:Z(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-1 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function Za({className:e,...t}){return(0,Q.jsx)(`p`,{"data-slot":`field-description`,className:Z(`text-left text-xs/relaxed leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var Qa={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},$a={...Qa,position:`fixed`,margin:0,top:0,left:0},eo={...Qa,position:`absolute`};function to(e){let t=i.useRef(!0);t.current&&(t.current=!1,e())}function no(e){let[t,n]=i.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function ro(e){let t=ce(io,e).current;return t.next=e,q(t.effect),t}function io(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ao=n((e=>{var n=t(),r=wa();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),oo=n(((e,t)=>{t.exports=ao()}))(),so=[],co=void 0;function lo(){return co}function uo(e){so.push(e)}function fo(e){let t=(t,n)=>{let r=ce(mo).current,i;try{co=r;for(let e of so)e.before(r);i=e(t,n);for(let e of so)e.after(r);r.didInitialize=!0}finally{co=void 0}return i};return t.displayName=e.displayName||e.name,t}function po(e){return i.forwardRef(fo(e))}function mo(){return{didInitialize:!1}}var ho=Ue(19)?vo:yo;function go(e,t,n,r,i){return ho(e,t,n,r,i)}function _o(e,t,n,r,a){let o=i.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return(0,Ta.useSyncExternalStore)(e.subscribe,o,o)}uo({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Ta.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function vo(e,t,n,r,i){let a=lo();if(!a)return _o(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function yo(e,t,n,r,i){return(0,oo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var bo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return go(this,e,t,n,r)}},xo=class extends bo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){i.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){i.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return i.useDebugValue(e),go(this,this.selectors[e],t,n,r)}useContextCallback(e,t){i.useDebugValue(e);let n=K(t??X);this.context[e]=n}useStateSetter(e){let t=i.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function So(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Co(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var wo=i.forwardRef(function(e,t){let[n,r]=i.useState();q(()=>{Rn&&Ln&&r(`button`)},[]);let a={tabIndex:0,role:n};return(0,Q.jsx)(`span`,{...e,ref:t,style:$a,"aria-hidden":!n||void 0,...a,"data-base-ui-focus-guard":``})});function To(e){return`data-base-ui-${e}`}var Eo=0;function Do(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Eo);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),X;let o=requestAnimationFrame(a);return Eo=o,()=>{Eo===o&&(cancelAnimationFrame(o),Eo=0)}}var Oo=`data-base-ui-inert`,ko=new WeakMap,Ao=new WeakSet,jo=new WeakMap,Mo=0;function No(e){return e?P(e)?e.host:No(e.parentNode):null}var Po=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=No(t);return e.contains(n)?n:null}).filter(e=>e!=null),Fo=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Io=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{O(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Lo(e,t,n,{mark:r=!0}){let i=Po(t,e),a=r?Io(t,Fo(i),new Set(i)):[],o=[],s=[];if(n){let e=Po(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Io(t,Fo(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(ko.get(e)||0)+1;ko.set(e,r),o.push(e),r===1&&n&&Ao.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(jo.get(e)||0)+1;jo.set(e,t),s.push(e),t===1&&e.setAttribute(Oo,``)}),Mo+=1,()=>{o.forEach(e=>{let t=(ko.get(e)||0)-1;ko.set(e,t),t||(Ao.has(e)||e.removeAttribute(`aria-hidden`),Ao.delete(e))}),r&&s.forEach(e=>{let t=(jo.get(e)||0)-1;jo.set(e,t),t||e.removeAttribute(Oo)}),--Mo,Mo||(ko=new WeakMap,Ao=new WeakSet,jo=new WeakMap)}}function Ro(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Y(e[0]).body;return Lo(e,i,n,{mark:r})}var zo={style:{transition:`none`}},Bo=`data-base-ui-click-trigger`,Vo={fallbackAxisSide:`none`},Ho={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Uo=i.createContext(null),Wo=()=>i.useContext(Uo),Go=To(`portal`);function Ko(e={}){let{ref:t,container:n,componentProps:r=Ke,elementProps:a}=e,o=xn(),s=Wo()?.portalNode,[c,l]=i.useState(null),[u,d]=i.useState(null),f=K(e=>{e!==null&&d(e)}),p=i.useRef(null);q(()=>{if(n===null){p.current&&(p.current=null,d(null),l(null));return}let e=(n&&(j(n)?n:n.current))??s??document.body;e==null?p.current&&(p.current=null,d(null),l(null)):p.current!==e&&(p.current=e,d(null),l(e))},[n,s]);let m=Xe(`div`,r,{ref:[t,f],props:[{id:o,[Go]:``},a]}),h=c&&m?Li.createPortal(m,c):null;return{node:u,nodeId:i.isValidElement(m)?m.props.id:void 0,subtree:h}}var qo=i.forwardRef(function(e,t){let{render:n,className:r,style:a,children:o,container:s,portalOwnerRole:c,...l}=e,{node:u,nodeId:d,subtree:f}=Ko({container:s,ref:t,componentProps:e,elementProps:l}),p=i.useRef(null),m=i.useRef(null),h=i.useRef(null),g=i.useRef(null),[_,v]=i.useState(null),y=i.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!u;i.useEffect(()=>{if(!u||b)return;function e(e){u&&e.relatedTarget&&Ei(e)&&(e.type===`focusin`?y.current&&=(Oi(u),!1):(Di(u),y.current=!0))}return So(Co(u,`focusin`,e,!0),Co(u,`focusout`,e,!0))},[u,b]),q(()=>{u&&x===!0&&y.current&&(Oi(u),y.current=!1)},[x,u]);let C=i.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return(0,Q.jsxs)(i.Fragment,{children:[f,(0,Q.jsxs)(Uo.Provider,{value:C,children:[S&&u&&(0,Q.jsx)(wo,{"data-type":`outside`,ref:p,onFocus:e=>{Ei(e,u)?h.current?.focus():Ti(_?_.domReference:null)?.focus()}}),S&&u&&(0,Q.jsx)(`span`,{role:c,"aria-owns":d,style:Ho}),u&&Li.createPortal(o,u),S&&u&&(0,Q.jsx)(wo,{"data-type":`outside`,ref:m,onFocus:e=>{Ei(e,u)?g.current?.focus():(wi(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,Ji(`focus-out`,e.nativeEvent)))}})]})]})});function Jo(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Yo=i.createContext(null),Xo=i.createContext(null),Zo=()=>i.useContext(Yo)?.id||null,Qo=e=>{let t=i.useContext(Xo);return e??t};function $o(e,t){let n=k(Hn(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Sr(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var es=20,ts=[];function ns(){ts=ts.filter(e=>e.deref()?.isConnected)}function rs(e){ns(),e&&O(e)!==`body`&&(ts.push(new WeakRef(e)),ts.length>es&&(ts=ts.slice(-20)))}function is(){return ns(),ts[ts.length-1]?.deref()}function as(e){return e?bi(e)?e:Si(e)[0]||e:null}function os(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=xi(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return bi(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ss(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,explicitReturnFocus:s,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=K(()=>x.current.floatingContext?.nodeId),C=a===!1,w=gr(v)&&C,T=ro(a),E=ro(o),D=ro(s),k=ro(d),A=ro(_),j=Qo(h),M=Wo(),P=i.useRef(!1),F=i.useRef(!1),I=i.useRef(!1),L=i.useRef(null),R=i.useRef(``),z=i.useRef(``),B=i.useRef(null),V=i.useRef(null),ee=Ie(B,m,M?.beforeInsideRef),H=Ie(V,M?.afterInsideRef),U=Mi(),te=Mi(),ne=Ii(),re=M!=null,W=_r(y),G=K((e=W)=>e?Si(e):[]),ie=K(()=>g?.().filter(e=>e!=null)??[]);i.useEffect(()=>{if(r||!l)return;function e(e){e.key===`Tab`&&$(W,Bn(Y(W)))&&G().length===0&&!w&&br(e)}return Co(Y(W),`keydown`,e)},[r,W,l,w,G]),i.useEffect(()=>{if(r||!_)return;let e=Y(W);function t(){I.current=!1}function n(e){let t=Hn(e),n=ie(),r=$(y,t)||$(v,t)||$(M?.portalNode,t)||n.some(e=>e===t||$(e,t));I.current=!r,z.current=e.pointerType||`keyboard`,Vn(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,te.start(0,()=>{F.current=!1}))}function i(){z.current=`keyboard`}return So(Co(e,`pointerdown`,n,!0),Co(e,`pointerup`,t,!0),Co(e,`pointercancel`,t,!0),Co(e,`keydown`,i,!0),t)},[r,y,v,W,_,M,te,ie]),i.useEffect(()=>{if(r||!u)return;let e=Y(W);function n(){F.current=!0,te.start(0,()=>{F.current=!1})}function i(e){let t=Hn(e);bi(t)&&(L.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Hn(n);l&&r==null&&a!=null&&$(y,a)&&rs(a),queueMicrotask(()=>{let o=S(),s=t.context.triggerElements,u=ie(),d=r?.hasAttribute(To(`focus-guard`))&&[B.current,V.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Ri(p),Ri(f)].includes(r),m=!($(v,r)||$(y,r)||$(r,y)||$(M?.portalNode,r)||u.some(e=>e===r||$(e,r))||s.hasMatchingElement(e=>$(e,r))||d||j&&(vr(j.nodesRef.current,o).find(e=>$(e.context?.elements.floating,r)||$(e.context?.elements.domReference,r))||yr(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,_r(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&W&&os(W),c&&i!==v&&!oi(a)&&Bn(e)===e.body){if(N(W)&&(W.focus(),c===`popup`)){ne.request(()=>{W.focus()});return}let e=G(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;N(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!l)&&r&&m&&!F.current&&(w||r!==is())&&(P.current=!0,t.setOpen(!1,Ji(ea,n)))})}function o(){I.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let s=N(v)?v:null;if(y||s)return So(s&&Co(s,`focusout`,a),s&&Co(s,`pointerdown`,n),y&&Co(y,`focusin`,i),y&&Co(y,`focusout`,a),y&&M&&Co(y,`focusout`,o,!0))},[r,v,y,W,l,j,M,t,u,c,G,w,S,x,U,te,ne,f,p,ie]),i.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${To(`portal`)}]`)||[]),t=(j?yr(j.nodesRef.current,S()):[]).find(e=>gr(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ro([y,...e,B.current,V.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ie(),t,Ri(p),Ri(f),w?v:null].filter(e=>e!=null),{ariaHidden:l||w,mark:!1}),i=Ro([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,l,M,w,j,S,f,p,ie]),q(()=>{if(!_||r||!N(W))return;R.current=``,z.current=``;let e=Y(W),t=Bn(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Ri(r),o||=a();let s=$(W,Bn(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Sr(c);Do(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Bn(e);return!(t!==o&&$(W,t))}})})},[r,_,W,G,T,k,A,x]);let ae=i.useRef(null);q(()=>{if(r||!W){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=Y(W),t=Bn(e),n=k.current==null;rs(t);function i(e){if(e.open||(R.current=$o(e.nativeEvent,z.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(To(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(Sr(e.nativeEvent)||Cr(e.nativeEvent))P.current=!1;else{let e=!1;Y(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&O(t)!==`body`?t:null,s=n?o||a:a||o;return s||=is()||null,typeof i==`boolean`?s:Ri(i)||s||null}return()=>{b.off(`openchange`,i);let t=Bn(e),n=ie(),r=$(y,t)||n.some(e=>e===t||$(e,t))||j&&vr(j.nodesRef.current,S(),!1).some(e=>$(e.context?.elements.floating,t)),o=E.current,s=R.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=as(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!P.current&&N(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,y,W,E,D,k,b,j,v,S,ie]),q(()=>{if(!Ln||_||!y)return;let e=Bn(Y(y));N(e)&&hr(e)&&$(y,e)&&e.blur()},[_,y]),q(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:u,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,l,_,t,u,v]),q(()=>{if(!r&&W)return os(W),()=>{queueMicrotask(ns)}},[r,W]);let oe=!r&&(!l||!w)&&(re||l);return(0,Q.jsxs)(i.Fragment,{children:[oe&&(0,Q.jsx)(wo,{"data-type":`inside`,ref:ee,onFocus:e=>{if(l){let e=G();Do(e[e.length-1])}else M?.portalNode&&(P.current=!1,Ei(e,M.portalNode)?wi(v)?.focus():Ri(p??M.beforeOutsideRef)?.focus())}}),n,oe&&(0,Q.jsx)(wo,{"data-type":`inside`,ref:H,onFocus:e=>{l?Do(G()[0]):M?.portalNode&&(u&&(P.current=!0),Ei(e,M.portalNode)?Ti(v)?.focus():Ri(f??M.afterOutsideRef)?.focus())}})]})}function cs(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Xi}=t,u=e.context.dataRef,d=i.useRef(void 0),f=Ii(),p=Mi(),m=i.useMemo(()=>{function t(t,n,r,i){let a=Ji(l,n,r);t&&i===`touch`&&c>0?p.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let i=u.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!a?!0:i&&(typeof s==`function`?s():s)?!r(i.type):!1}return{onPointerDown(e){d.current=wr(e.pointerType,!0)&&Cr(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let a=d.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||wr(a,!0)&&o)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),u=Hn(s),p=hr(u);if(p||a===`virtual`){t(l,s,p?u:i.currentTarget,a);return}let m=i.currentTarget;f.request(()=>{t(l,s,m,a)})},onClick(i){if(r===`mousedown-only`)return;let a=d.current;r===`mousedown`&&a?d.current=void 0:wr(a,!0)&&o||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,a)},onKeyDown(){d.current=void 0}}},[u,r,o,l,e,s,a,f,p,c]);return i.useMemo(()=>n?{reference:m}:Ke,[n,m])}function ls(){return!1}function us(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ds(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:a=!0,outsidePressEvent:o=`sloppy`,referencePress:s=ls,bubbles:c,externalTree:l}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:f,events:p}=e.context,m=Qo(l),h=K(typeof a==`function`?a:()=>!1),g=typeof a==`function`?h:a,_=g!==!1,v=K(()=>o),{escapeKey:y,outsidePress:b}=us(c),x=i.useRef(!1),S=i.useRef(!1),C=i.useRef(!1),w=i.useRef(!1),T=i.useRef(!1),E=i.useRef(``),D=i.useRef(null),O=Mi(),k=Mi(),A=Mi(),j=K(()=>{k.clear(),f.current.insideReactTree=!1}),F=K(e=>{let t=f.current.floatingContext?.nodeId;return(m?vr(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=K(t=>pr(t,e.select(`floatingElement`))||pr(t,e.select(`domReferenceElement`))),L=K(t=>{s()&&e.setOpen(!1,Ji(Xi,t.nativeEvent))}),R=K(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=xr(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&F(`__escapeKeyBubbles`))return;let a=Ji(ta,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),z=K(()=>{f.current.insideReactTree=!0,k.start(0,j)}),B=K(t=>{if(!u||!n||t.button!==0)return;let r=Hn(t.nativeEvent);$(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),V=K(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});i.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),i.useEffect(()=>j,[j]),i.useEffect(()=>{if(!u||!n)return u||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let t=new ji,i=Y(d);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Ln?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function l(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=l();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=f.current.floatingContext?.nodeId,n=m&&vr(m.nodesRef.current,t).some(t=>pr(e,t.context?.elements.floating));return I(e)||n}function k(n){if(p(n)){n.type!==`click`&&!I(n)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let r=Hn(n),i=`[${To(`inert`)}]`,a=M(r)?r.getRootNode():null,o=Array.from((P(a)?a:Y(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>$(e,r))))return;let c=M(r)?r:null;for(;c&&!te(c);){let e=W(c);if(te(e)||!M(e))break;c=e}if(!(o.length&&M(r)&&!mr(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(N(r)&&!(`touches`in n)){let e=te(r),t=ne(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(l()===`intentional`){if(n.detail!==0&&!Sr(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(n))&&(F(`__outsidePressBubbles`)||(e.setOpen(!1,Ji(Zi,n)),j()))}}}function L(t){l()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!I(t)&&k(t)}function z(t){if(l()!==`sloppy`||!e.select(`open`)||!n||I(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function B(e,t){let n=Hn(e);if(!n)return;let r=Co(n,e.type,()=>{t(e),r()})}function V(e){E.current=`touch`,B(e,z)}function ee(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&B(e,e=>{e.type===`pointerdown`?L(e):k(e)})}function H(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),l()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function U(e){if(l()!==`sloppy`||!D.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function re(e){B(e,U)}function G(e){l()===`sloppy`&&D.current&&!I(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ie(e){B(e,G)}let ae=So(r&&So(Co(i,`keydown`,R),Co(i,`compositionstart`,a),Co(i,`compositionend`,o)),_&&So(Co(i,`click`,ee,!0),Co(i,`pointerdown`,ee,!0),Co(i,`pointerup`,H,!0),Co(i,`pointercancel`,H,!0),Co(i,`mousedown`,ee,!0),Co(i,`mouseup`,H,!0),Co(i,`touchstart`,V,{capture:!0,passive:!0}),Co(i,`touchmove`,re,{capture:!0,passive:!0}),Co(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{ae(),t.clear(),c(),C.current=!1}},[f,d,r,_,g,u,n,y,b,R,j,v,F,I,m,e,O,A]);let ee=i.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),H=i.useMemo(()=>({onKeyDown:R,onPointerDown:V,onMouseDown:V,onClickCapture:z,onMouseDownCapture(e){z(),B(e)},onPointerDownCapture(e){z(),B(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[R,z,B,V]);return i.useMemo(()=>n?{reference:ee,floating:H,trigger:ee}:{},[n,ee,H])}function fs(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};M(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function ps(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:a,onUnmount:o,animateInitialOpen:s}=e,c=K(a),{mounted:l,setMounted:u,transitionStatus:d}=Wi(t,!1,!1,s),f=!t&&r;q(()=>{t&&c(!1)},[t,c]);let p=i.useRef(l),m=i.useRef(!1),h=_n(),g=()=>{p.current=!1,u(!1),o()};q(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=K(()=>{p.current&&(t?(m.current=!0,h()):g())});return Ui({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var ms={tabIndex:-1,[Un]:``};function hs(e){return t=>t!==`touch`||e.current}function gs(e,t=!1){let n=xn(),r=Zo()!=null,i=ce(()=>e(n,r)).current;return fs({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function _s({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function vs(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function ys(e,t){let n=i.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),vs(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),vs(t))})}function bs(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function xs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ss(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ys(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Cs(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=i.useRef(null),a=e.useState(`open`);q(()=>{if(!a){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){i.activeTriggerId=t,i.activeTriggerElement=n,r.current=t;break}i.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n,r.current=e}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Ji(Yi);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[a,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ws(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ps({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return ce(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ts(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:Ke,inactiveTriggerProps:Ke,popupProps:Ke})},[e])}function Es(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ds=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Os={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},ks=class extends xo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Jo(),nested:n,triggerElements:i},Os),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Tr(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function As(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ks({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ke,inactiveTriggerProps:Ke,popupProps:Ke}}var js=e=>e.triggerIdProp??e.activeTriggerId,Ms=e=>e.openProp??e.open,Ns=e=>(e.popupElement?.id??e.floatingId)||void 0;function Ps(e,t){return t!==void 0&&Ms(e)&&js(e)===t}function Fs(e,t){return Ps(e,t)?!0:t!==void 0&&Ms(e)&&js(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Is={open:Ms,mounted:e=>e.mounted,transitionStatus:e=>Ms(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:js,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ns,isTriggerActive:(e,t)=>t!==void 0&&js(e)===t,isOpenedByTrigger:(e,t)=>Ps(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&js(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fs(e,t)?Ns(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ls(e){let t=i.useCallback(t=>e===void 0?X:e.subscribeStore(t),[e]),n=i.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ta.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Rs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xn(),a=Zo()!=null,o=ce(()=>new ks({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ds,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=M(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function zs(e){return Ln&&e.movementX===0&&e.movementY===0}function Bs(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Vs(e,t){return Bs(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Hs(e,t,n){return Bs(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Us(e,t,n){return Bs(t,n?e===Wn:e===Gn,e===qn)}function Ws(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Bs(t,n?e===Gn:e===Wn,e===Kn)}function Gs(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=_r(D),j=gr(O),M=ro(A),P=Zo(),F=Qo(S),I=i.useRef(p),L=i.useRef(s??-1),R=i.useRef(null),z=i.useRef(!0),B=K(e=>{a(L.current===-1?null:L.current,e)}),V=i.useRef(!!D),ee=i.useRef(E),H=i.useRef(!1),U=i.useRef(!1),te=i.useRef(null),ne=ro(g),re=ro(E),W=ro(s),G=ro(x),ie=Ii(),ae=Ii(),oe=K(()=>{ie.cancel();function e(e){f||(te.current=Do(e,{sync:H.current,preventScroll:!0}))}let t=n.current[L.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[L.current]||t;i&&(t||e(i),fe&&(r||!z.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=_},[k,_]),q(()=>{E||(R.current=null),(!E||p!==`auto`)&&(I.current=p)},[E,p]),q(()=>{o&&(E&&D?(L.current=s??-1,I.current&&s!=null&&(U.current=!0,B())):V.current&&(L.current=-1,B()))},[o,E,D,s,B]),q(()=>{if(o){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,W.current!=null)return;if(V.current&&(L.current=-1,oe()),(!ee.current||!V.current)&&I.current&&(R.current!=null||I.current===!0&&R.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(L.current=R.current==null||Hs(R.current,v,d)||u?ei(n):ti(n),R.current=null,B())};t()}}else $r(n.current,r)||(L.current=r,oe(),U.current=!1)}}},[o,E,D,r,W,u,n,v,d,B,oe,ae]),q(()=>{if(!o||D||!F||f||!V.current)return;let e=F.nodesRef.current,t=e.find(e=>e.id===P)?.context?.elements.floating,n=Bn(Y(O??t??null)),r=e.some(e=>e.context&&$(e.context.elements.floating,n));t&&!r&&z.current&&t.focus({preventScroll:!0})},[o,D,O,F,P,f]),q(()=>{ee.current=E,V.current=!!D});let se=r!=null,ce=K(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(L.current!==t||r!==t)&&(L.current=t,B(e))}),le=K(()=>y??F?.nodesRef.current.find(e=>e.id===P)?.context?.dataRef?.current.orientation),ue=K(()=>ei(n,ne.current)),de=K(t=>{if(z.current=!1,H.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(u&&Ws(t.key,_,d,T)){Vs(t.key,le())||br(t),e.setOpen(!1,Ji(na,t.nativeEvent));let n=C?.current??O;N(n)&&n.focus();return}r!=null&&r!==L.current&&!$r(n.current,r)&&(L.current=r);let i=L.current,a=ei(n,g),o=ti(n,g);if(j||(t.key===`Home`&&(br(t),L.current=a,B(t)),t.key===`End`&&(br(t),L.current=o,B(t))),w!=null){let e=w(t,L.current,n,_,l,d,g,a,o);if(e!=null&&e!==L.current&&(L.current=e,B(t)),_===`both`)return}if(Vs(t.key,_)){br(t);let e=Bn(t.currentTarget.ownerDocument);if(E&&!f&&$(t.currentTarget,e)&&!n.current.some(t=>t!=null&&$(t,e))){L.current=Hs(t.key,_,d)?a:o,B(t),r===L.current&&oe();return}let{index:s,wrapped:u}=ni(n.current,i,{decrement:!Hs(t.key,_,d),loopFocus:l,allowEscape:c,disabledIndices:g,minIndex:a,maxIndex:o});u&&(H.current=!1),L.current=s,B(t)}}),fe=i.useMemo(()=>({onFocus(e){H.current=!0,ce(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){zs(e)||(H.current=!0,U.current=!1,m&&ce(e))},onPointerLeave(e){if(!re.current||!z.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&G.current&&(te.current?.(),te.current=null,L.current=-1,B(e),!f)){let e=M.current,t=Bn(Y(e));e&&$(e,t)&&e.focus({preventScroll:!0})}}}),[ce,re,M,m,n,B,G,f]),J=i.useMemo(()=>f&&E&&se&&{"aria-activedescendant":`${b}-${r}`},[f,E,se,b,r]),pe=i.useMemo(()=>({...j?{}:J,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=Hn(t.nativeEvent);if(n&&!$(M.current,n))return;br(t);let r=Ji(ea,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&N(i)&&i.focus()}else de(t)},onPointerMove(e){zs(e)||(z.current=!0)}}),[J,de,M,j,e,E,f,O,C]),me=i.useMemo(()=>{function t(t){e.setOpen(!0,Ji(na,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&Sr(e.nativeEvent)&&(I.current=!f)}function r(e){I.current=p,p===`auto`&&Cr(e.nativeEvent)&&(I.current=!0)}return{onKeyDown(n){let r=e.select(`open`);z.current=!1;let i=n.key.startsWith(`Arrow`),a=Us(n.key,le(),d),o=Vs(n.key,r?_:v),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||hr(n.currentTarget)))return de(n);if(r||h||!i){if(s){let e=Vs(n.key,le());R.current=u&&e?null:n.key}u?a&&(br(n),r?(L.current=ue(),B(n),f&&M.current?.focus()):t(n)):o&&(W.current!=null&&(L.current=W.current),br(n),!r&&h?t(n):de(n),r&&B(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(L.current=-1,B(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,p,ue,u,B,e,h,_,v,le,d,W,f,M]),he=i.useMemo(()=>({...J,...me}),[J,me]);return i.useMemo(()=>o?{reference:he,floating:pe,item:fe,trigger:me}:{},[o,he,pe,me,fe])}function Ks(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=K(c),p=e.useState(`open`),m=Mi(),h=i.useRef(``),g=i.useRef(d??a??-1),_=i.useRef(null),v=K(e=>{function t(e){return r?.current[e]}function i(e){let n=t(e);return n&&!oi(n)||n?.matches(`:disabled`)?!1:s==null||!ii(Ge,e,s)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,a=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(a)&&i(n))return n}return-1}let l=n.current;if(h.current.length>0&&e.key===` `&&(br(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(l,h.current)===-1&&e.key!==` `&&f?.(!1),l==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(br(e),f?.(!0));let v=h.current===``;v&&(g.current=d??a??-1),l.every((e,t)=>e&&i(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let y=((v?d??a??-1:g.current)??0)+1,b=c(l,h.current,y);b===-1?e.key!==` `&&(h.current=``,f?.(!1)):(o?.(b,e),_.current=b)}),y=K(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);$(r,n)||$(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});q(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let b=i.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return i.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}function qs(e,t,n){let{reference:r,floating:i}=e,a=Rr(t),o=zr(t),s=Lr(o),c=Pr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Fr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Js(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Nr(t,e),p=Zr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Qr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Qr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ys=50,Xs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Js},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qs(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ys&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=qs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zs=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Nr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Pr(r),_=Rr(o),v=Pr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Yr(o)]:Vr(o)),x=p!==`none`;!d&&x&&b.push(...Jr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Br(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Rr(t)||T.every(e=>Rr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Rr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Qs=new Set([`left`,`top`]);async function $s(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Pr(n),s=Fr(n),c=Rr(n)===`y`,l=Qs.has(o)?-1:1,u=a&&c?-1:1,d=Nr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ec=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await $s(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Nr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Rr(i),p=Ir(f),m=u[p],h=u[f],g=(e,t)=>Mr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},nc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Nr(e,t),u={x:n,y:r},d=Rr(i),f=Ir(d),p=u[f],m=u[d],h=Nr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Qs.has(Pr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Nr(e,t),c=await i.detectOverflow(t,s),l=Pr(n),u=Fr(n),d=Rr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Er(p-c[m],g),y=Er(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Dr(c.left,c.right):S=p-2*Dr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ic(e){let t=ne(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=N(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Or(n)!==a||Or(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ac(e){return M(e)?e:e.contextElement}function oc(e){let t=ac(e);if(!N(t))return Ar(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ic(t),o=(a?Or(n.width):n.width)/r,s=(a?Or(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var sc=Ar(0);function cc(e){let t=k(e);return!U()||!t.visualViewport?sc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===k(e)}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ac(e),o=Ar(1);t&&(r?M(r)&&(o=oc(r)):o=oc(e));let s=lc(a,n,r)?cc(a):Ar(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=k(a),t=M(r)?k(r):r,n=e,i=ae(n);for(;i&&t!==n;){let e=oc(i),t=i.getBoundingClientRect(),r=ne(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=k(i),i=ae(n)}}return Qr({width:u,height:d,x:c,y:l})}function dc(e,t){let n=re(e).scrollLeft;return t?t.left+n:uc(A(e)).left+n}function fc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dc(e,n),y:n.top+t.scrollTop}}function pc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=A(r),s=t?L(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ar(1),u=Ar(0),d=N(r);if((d||!a)&&((O(r)!==`body`||F(o))&&(c=re(r)),d)){let e=uc(r);l=oc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fc(o,c):Ar(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function mc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function hc(e){let t=re(e),n=e.ownerDocument.body,r=Dr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Dr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+dc(e),o=-t.scrollTop;return ne(n).direction===`rtl`&&(a+=Dr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var gc=25;function _c(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=k(e),a=A(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!U()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(dc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=gc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function vc(e,t){let n=uc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=oc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=_c(e,n,t);else if(t===`document`)r=hc(A(e));else if(M(t))r=vc(t,n);else{let n=cc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qr(r)}function bc(e,t){let n=t.get(e);if(n)return n;let r=ie(e,[],!1).filter(e=>M(e)&&O(e)!==`body`),i=null,a=ne(e).position===`fixed`,o=a?W(e):e;for(;M(o)&&!te(o);){let e=ne(o),t=ee(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=W(o)}return t.set(e,r),r}function xc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?L(t)?[]:bc(t,this._c):[].concat(n),r],o=yc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=yc(t,a[e],i);s=Dr(n.top,s),c=Er(n.right,c),l=Er(n.bottom,l),u=Dr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Sc(e){let{width:t,height:n}=ic(e);return{width:t,height:n}}function Cc(e,t,n){let r=N(t),i=A(t),a=n===`fixed`,o=uc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ar(0);if((r||!a)&&((O(t)!==`body`||F(i))&&(s=re(t)),r)){let e=uc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=dc(i));let l=i&&!r&&!a?fc(i,s):Ar(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function wc(e){return ne(e).position===`static`}function Tc(e,t){if(!N(e)||ne(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return A(e)===n&&(n=n.ownerDocument.body),n}function Ec(e,t){let n=k(e);if(L(e))return n;if(!N(e)){let t=W(e);for(;t&&!te(t);){if(M(t)&&!wc(t))return t;t=W(t)}return n}let r=Tc(e,t);for(;r&&I(r)&&wc(r);)r=Tc(r,t);return r&&te(r)&&wc(r)&&!ee(r)?n:r||H(e)||n}var Dc=async function(e){let t=this.getOffsetParent||Ec,n=this.getDimensions,r=await n(e.floating);return{reference:Cc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Oc(e){return ne(e).direction===`rtl`}var kc={convertOffsetParentRelativeRectToViewportRelativeRect:pc,getDocumentElement:A,getClippingRect:xc,getOffsetParent:Ec,getElementRects:Dc,getClientRects:mc,getDimensions:Sc,getScale:oc,isElement:M,isRTL:Oc};function Ac(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jc(e,t,n){let r=null,i,a=A(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=kr(d),h=kr(a.clientWidth-(u+f)),g=kr(a.clientHeight-(d+p)),_=kr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Dr(0,Er(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ac(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=k(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Mc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ac(e),u=i||a?[...l?ie(l):[],...t?ie(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?jc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?uc(e):null;c&&g();function g(){let t=uc(e);h&&!Ac(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Nc=ec,Pc=tc,Fc=Zs,Ic=rc,Lc=nc,Rc=(e,t,n)=>{let r=new Map,i=n??{},a={...kc,...i.platform,_c:r};return Xs(e,t,{...i,platform:a})},zc=typeof document<`u`?i.useLayoutEffect:function(){};function Bc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Bc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hc(e,t){let n=Vc(e);return Math.round(t*n)/n}function Uc(e){let t=i.useRef(e);return zc(()=>{t.current=e}),t}function Wc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Bc(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),E=l!=null,D=Uc(l),O=Uc(a),k=Uc(u),A=i.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Rc(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Bc(T.current,t)&&(T.current=t,Li.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);zc(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=i.useRef(!1);zc(()=>(j.current=!0,()=>{j.current=!1}),[]),zc(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=i.useMemo(()=>({reference:x,floating:S}),[x,S]),P=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Hc(N.floating,d.x),r=Hc(N.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vc(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,N.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var Gc=(e,t)=>{let n=Nc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},qc=(e,t)=>({fn:Lc(e).fn,options:[e,t]}),Jc=(e,t)=>{let n=Fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yc=(e,t)=>{let n=Ic(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xc=i.createContext(void 0),Zc=i.createContext(void 0);function Qc(){let e=i.useContext(Xc);if(e===void 0)throw Error(Oe(60));return e}function $c(){let e=i.useContext(Zc);if(e===void 0)throw Error(Oe(61));return e}function el(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var tl=(e,t)=>Object.is(e,t);function nl(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function rl(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!el(e,t,(e,t)=>nl(e,t,n)):e!==t}function il(e,t,n){return e?e.some(e=>e!==void 0&&nl(t,e,n)):!1}function al(e,t,n){return e?e.findIndex(e=>e!==void 0&&nl(e,t,n)):-1}function ol(e,t){if(t!==tl)return n=>il(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function sl(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(ol(t,n)):al(e,t,n);return i===-1?null:i}function cl(e,t,n,r,i,a){return il(r,t,i)?a!=null&&e>a&&il(r,n[a],i)?a:e:e===a?sl(n,r,i,!0):a}function ll(e,t,n){return e.filter(e=>!nl(t,e,n))}function ul(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function dl(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function fl(e){return dl(e?.[0])}function pl(e){return fl(e)?e.flatMap(e=>e.items):e}function ml(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(fl(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function hl(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return ul(e)}function gl(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?ul(e.value):ul(e)}function _l(e,t,n){function r(){return hl(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=pl(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function vl(e,t,n){return e.reduce((e,r,a)=>(a>0&&e.push(`, `),e.push((0,Q.jsx)(i.Fragment,{children:_l(r,t,n)},a)),e),[])}var yl={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:gl(t,r)!==``},hasNullItemLabel:(e,t)=>t?ml(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>nl(t,e,n)):nl(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function bl(e){let t=i.useRef(``),n=i.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:i.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function xl(e,t){let{onClick:n,onPointerDown:r}=bl(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(Mn?`touch`:``))}));return i.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Sl(e){let[t,n]=i.useState(null),r=xl(e,n);return qi(e,t=>{t&&!e&&n(null)}),i.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Cl(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function wl(e,t){return Math.max(0,e-t)}function Tl(e,t){if(t<=0)return 0;let n=Cl(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function El(e){let{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,name:l,form:u,autoComplete:d,disabled:f=!1,readOnly:p=!1,required:m=!1,modal:h=!0,actionsRef:g,inputRef:_,onOpenChangeComplete:v,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=tl,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=gn(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=mn(),I=Tn({id:t}),L=N||f,R=M??l,[z,B]=fa({controlled:n,default:b?r??Ge:r,name:`Select`,state:`value`}),[V,ee]=fa({controlled:o,default:s,name:`Select`,state:`open`}),H=i.useRef([]),U=i.useRef([]),te=i.useRef(null),ne=i.useRef(null),re=i.useRef(0),W=i.useRef(null),G=i.useRef([]),ie=i.useRef(!1),ae=i.useRef(null),oe=i.useRef(null),se=i.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),le=i.useRef(!1),ue=i.useRef(z),{openMethod:de,triggerProps:fe}=Sl(V),J=ce(()=>new xo({id:I,labelId:void 0,modal:h,multiple:b,disabled:L,readOnly:p,required:m,highlightItemOnHover:w,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:z,open:V,mounted:V,transitionStatus:void 0,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Ke,triggerProps:Ke,itemRoot:{props:Ke,multiple:b,disabled:L,readOnly:p,isItemEqualToValue:C},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:X,setOpen:X,handleScrollArrowVisibility:X,onOpenChangeComplete:X,listRef:H,popupRef:te,scrollHandlerRef:ne,scrollArrowsMountedCountRef:re,valueRef:W,valuesRef:G,labelsRef:U,typingRef:ie,selectionRef:se,firstItemTextRef:ae,selectedItemTextRef:oe,alignItemWithTriggerActiveRef:le,initialValueRef:ue},yl)).current,[pe,he]=i.useState(!1),{mounted:ge,transitionStatus:_e,forceUnmount:ve}=ps({open:V,ref:te,preventUnmountOnClose:pe,setPreventUnmountOnClose:he,onUnmount(){J.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)}}),ye=J.useState(`activeIndex`),be=J.useState(`selectedIndex`),xe=J.useState(`triggerElement`),Se=J.useState(`positionerElement`),Ce=no(de),we=de??Ce,Te=i.useMemo(()=>b?``:gl(z,S),[b,z,S]),Ee=i.useMemo(()=>b&&Array.isArray(z)?z.map(e=>gl(e,S)):gl(z,S),[b,z,S]);Ki(ro(xe),I,z,K(()=>Ee),!L,l);let De=b?Array.isArray(z)&&z.length>0:z!=null&&Te!==``;q(()=>{j(De)},[De,j]),q(function(){let e=sl(G.current,z,C,b);e===null&&(oe.current=null),!V&&J.set(`selectedIndex`,e)},[b,V,z,C,J]),qi(z,()=>{E(R),D(rl(z,A.initialValue,C)),P.change(z)});let Oe=K((e,t)=>{let n=t,r=xs(n);c?.(e,n),!t.isCanceled&&(e||he(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))});i.useImperativeHandle(g,()=>({unmount:ve,close:()=>{J.state.open&&Oe(!1,Ji(sa))}}),[ve,Oe,J]);let ke=K((e,t)=>{a?.(e,t),!t.isCanceled&&B(e)}),Ae=K(e=>{let t=wl(e.scrollHeight,e.clientHeight),n=Tl(e.scrollTop,t),r=n>0,i=n<t;J.set(`scrollUpArrowVisible`,r),J.set(`scrollDownArrowVisible`,i)}),je=Rs({open:V,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),Y=cs(je,{enabled:!L,event:`mousedown`}),Me=ds(je),Ne=Gs(je,{enabled:!L,listRef:H,activeIndex:ye,selectedIndex:be,disabledIndices:Ge,onNavigate(e){(e!==null||V)&&J.set(`activeIndex`,e)},focusItemOnHover:w}),Pe=Ks(je,{enabled:!L&&(V||!p&&!b),listRef:U,activeIndex:ye,selectedIndex:be,disabledIndices:e=>Aa(H.current[e]),onMatch(e){V?J.set(`activeIndex`,e):ke(G.current[e],Ji(Yi))},onTyping(e){ie.current=e}}),Fe=i.useMemo(()=>me(Pe.reference,Ne.reference,Me.reference,Y.reference,fe),[Y.reference,Pe.reference,Ne.reference,Me.reference,fe]),Le=i.useMemo(()=>me(ms,Pe.floating,Ne.floating,Me.floating),[Pe.floating,Ne.floating,Me.floating]),Re=Ne.item??Ke,ze=i.useMemo(()=>({props:Re,multiple:b,disabled:L,readOnly:p,isItemEqualToValue:C}),[Re,b,L,p,C]);J.useContextCallback(`setValue`,ke),J.useContextCallback(`setOpen`,Oe),J.useContextCallback(`handleScrollArrowVisibility`,Ae),J.useContextCallback(`onOpenChangeComplete`,v),to(()=>{J.update({popupProps:Le,triggerProps:Fe,itemRoot:ze})}),J.useSyncedValues({id:I,modal:h,multiple:b,disabled:L,readOnly:p,required:m,highlightItemOnHover:w,value:z,open:V,mounted:ge,transitionStatus:_e,popupProps:Le,triggerProps:Fe,itemRoot:ze,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:we});let Be=Ie(_,P.inputRef),Ve=b?void 0:R,He=i.useMemo(()=>!b||!Array.isArray(z)||!R?null:z.map(e=>{let t=gl(e,S);return(0,Q.jsx)(`input`,{type:`hidden`,form:u,name:R,value:t,disabled:L},t)}),[b,z,u,R,S,L]);return(0,Q.jsxs)(Xc.Provider,{value:J,children:[(0,Q.jsx)(Zc.Provider,{value:je,children:T}),(0,Q.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){J.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||p)return;let t=e.currentTarget.value,n=Ji(Yi,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=G.current.findIndex(t=>gl(t,S).toLowerCase()===e||hl(t,x).toLowerCase()===e);r===-1&&(r=G.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=G.current[r];i!=null&&ke(i,n)}J.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ve==null?`${I}-hidden-input`:void 0,form:u,name:Ve,autoComplete:d,value:Te,disabled:L,required:m&&!(b&&De),readOnly:p,ref:Be,style:R?eo:$a,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}function Dl(e,t){return e??t}var Ol=5;function kl(e,t){let n=Al(t);return e.clientX>=n.left-Ol&&e.clientX<=n.right+Ol&&e.clientY>=n.top-Ol&&e.clientY<=n.bottom+Ol}function Al(e){let t=e.getBoundingClientRect(),n=k(e);if(zn)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var jl=`data-popup-side`,Ml=400,Nl={...ur,...dn,popupSide:e=>e?{[jl]:e}:null,value:()=>null},Pl=i.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,validationMode:d,validation:f,state:p,disabled:m}=mn(),{labelId:h}=wn(),g=Qc(),_=g.useState(`readOnly`),v=g.useState(`required`),y=g.useState(`disabled`),b=m||y||o,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=a??O,N=Dl(h,k);Tn({id:a});let P=ro(T),F=i.useRef(null),I=Gi(b,F),{getButtonProps:L,buttonRef:R}=Ne({disabled:b,native:s}),z=g.useStateSetter(`triggerElement`),B=Mi(),V=Mi(),ee=Mi();i.useEffect(()=>{if(x)return ee.start(Ml,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,g,V,ee]);let H=me(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??_r(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){I(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,Ji(Yi,e.nativeEvent)),B.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){$(T,e.relatedTarget)||(u(!0),I(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=Y(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;$(F.current,t)||$(P.current,t)||kl(e,F.current)||g.context.setOpen(!1,Ji(ra,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},l,L),U=f.getValidationProps(b,H);U.role=`combobox`;let te={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return Xe(`button`,e,{ref:[t,F,R,z],state:te,stateAttributesMapping:Nl,props:U})}),Fl={value:()=>null},Il=i.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Qc(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?vl(l,u,d):_l(l,u,d)),Xe(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:Fl})}),Ll=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Xe(`span`,e,{state:{open:Qc().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:lr})}),Rl=i.forwardRef(function(e,t){let n=Qc(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Q.jsx)(qo,{ref:t,...e}):null});function zl(e){let{nodeId:t,externalTree:n,rootContext:r}=e,a=r.useState(`referenceElement`),o=r.useState(`floatingElement`),s=r.useState(`domReferenceElement`),c=r.useState(`open`),l=r.useState(`floatingId`),[u,d]=i.useState(null),f=i.useRef(null),p=Qo(n),m=i.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),h=Wc({...e,elements:{...m,...u&&{reference:u}}}),g=i.useCallback(e=>{let t=M(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),h.refs.setReference(t)},[h.refs]),_=i.useMemo(()=>({...h.refs,setPositionReference:g,domReference:f}),[h.refs,g]),v=i.useMemo(()=>({...h.elements,domReference:s}),[h.elements,s]),y=i.useMemo(()=>({...h,dataRef:r.context.dataRef,open:c,onOpenChange:r.setOpen,events:r.context.events,floatingId:l,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,c,l]);return q(()=>{s&&(f.current=s)},[s]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),i.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var Bl=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Nr(e,t)||{};if(l==null)return{};let d=Zr(u),f={x:n,y:r},p=zr(i),m=Lr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Mr(D,k,O),j=!c.arrow&&Fr(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Vl=(e,t)=>{let{name:n,fn:r}=Bl(e);return{name:n,fn:r,options:[e,t]}},Hl={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Ul={sideX:`left`,sideY:`top`},Wl=`--available-width`,Gl=`--available-height`,Kl=`--anchor-width`,ql=`--anchor-height`,Jl=`--transform-origin`,Yl=Wl,Xl=Gl;function Zl(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Ql(e,t,n){let{rects:r,placement:i}=e;return{side:Zl(t,Pr(i),n),align:Fr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $l(e){return eu(e,zl)}function eu(e,t){let{anchor:n,positionMethod:r=`absolute`,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,A=typeof n==`function`?n:void 0,j=K(A),M=A?j:n,N=ro(n),P=ro(_),F=Wa()===`rtl`,[I,L]=i.useState(null);!_&&I!==null&&L(null);let R=S===`placement`,z=I?Pr(I):null,B=I&&R?Fr(I)||`center`:null,V=z||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[a],ee=B||s,H=ee===`center`?V:`${V}-${ee}`,U=u;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let te=+(a===`bottom`),ne=+(a===`top`),re=+(a===`right`),W=+(a===`left`),G={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:U},ie=i.useRef(null),ae=ro(o),oe=ro(c),se=typeof o==`function`?0:o,ce=typeof c==`function`?0:c,le=[];m&&le.push(m),le.push(Gc(e=>{let t=Ql(e,a,F),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,F,a]));let ue=T===`none`&&w!==`shift`,de=!ue&&(d||D||w===`shift`),fe=w===`none`?null:Jc({...G,padding:{top:U.top+1+te,right:U.right+1+W,bottom:U.bottom+1+ne,left:U.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),J=ue?null:Kc({...G,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:d||D?void 0:qc(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Rr(Pr(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[G,d,D,O,U,T]);w===`shift`||T===`shift`||ee===`center`?le.push(J,fe):le.push(fe,J),le.push(Yc({...G,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(Yl,`${t}px`),i.setProperty(Xl,`${n}px`);let a=k(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Kl,`${u}px`),i.setProperty(ql,`${d}px`)}}),Vl(e=>({element:ie.current||Y(e.elements.floating).createElement(`div`),padding:ie.current?f:0}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:i,rects:s,y:c}=e,l=Pr(r),u=Fr(r),d=Rr(l)===`y`,f=ie.current,p=typeof o==`function`?o(Ql(e,a,F)):o,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&i.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Jl,d?`${m} ${h}`:`${h} ${m}`),{}}},Hl,x),q(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=i.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:H,middleware:le,strategy:r,whileElementsMounted:h?void 0:(...e)=>Mc(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Ul,Ee=Se?r:`fixed`,De=i.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Yl]=`100vw`,e[Xl]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=i.useRef(null);q(()=>{if(!_)return;let e=N.current,t=typeof e==`function`?e():e,n=(tu(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,M,N]),i.useEffect(()=>{if(!_)return;let e=N.current;typeof e!=`function`&&tu(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,M,N]),i.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Mc(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Pr(be),Ae=Zl(a,ke,F),je=Fr(be)||`center`,Me=!!ve.hide?.referenceHidden;q(()=>{S&&_&&Se&&(ke!==V||R&&je!==ee)&&L(be)},[S,R,_,Se,be,ke,je,V,ee]);let Ne=i.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return i.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ie,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,ie,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function tu(e){return e!=null&&`current`in e}var nu=i.createContext(void 0);function ru(){let e=i.useContext(nu);if(!e)throw Error(Oe(59));return e}var iu=i.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function au(e,t){e&&Object.assign(e.style,t)}var ou={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function su(e){return e===`starting`?zo:Ke}function cu(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Xe(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},su(r),i],stateAttributesMapping:dr})}var lu={},uu={},du=``;function fu(e,t){return F(e)?e:t}function pu(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fu(t,n)).overflowY)}function mu(e){if(typeof document>`u`)return!1;let t=Y(e);return k(t).innerWidth-t.documentElement.clientWidth>0}function hu(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=fu(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function gu(e){let t=Y(e),n=t.documentElement,r=t.body,i=fu(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function _u(e){let t=Y(e),n=t.documentElement,r=t.body,i=k(n),a=0,o=0,s=!1,c=Fi.create();if(Ln&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,lu={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},du=n.style.scrollBehavior,uu={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=fu(n,r);s=hu(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,lu),Object.assign(r.style,uu),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=du)}function d(){u(),c.request(l)}l();let f=Co(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var vu=new class{lockCount=0;restore=null;timeoutLock=ji.create();timeoutUnlock=ji.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Y(e),n=t.documentElement,r=t.body,i=k(n);if(pu(i,n,r)){let t=new i.MutationObserver(()=>{pu(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Mn||!mu(e);this.restore=a?gu(e):_u(e)}};function yu(e=!0,t=null){q(()=>{if(e)return vu.acquire(t)},[e,t])}var bu=20;function xu(e,t,n,r){let[a,o]=i.useState(!1);q(()=>{if(!e||!t||n==null){o(!1);return}let r=Y(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-bu)},[e,t,n]),yu(e&&(!t||a),r)}var Su={position:`fixed`},Cu=i.forwardRef(function(e,t){let{anchor:n,className:r,render:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=Vo,style:v,...y}=e,b=Qc(),x=$c(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`modal`),T=b.useState(`value`),E=b.useState(`openMethod`),D=b.useState(`positionerElement`),O=b.useState(`triggerElement`),k=b.useState(`isItemEqualToValue`),A=b.useState(`transitionStatus`),j=i.useRef(null),M=i.useRef(null),[N,P]=i.useState(g),F=C&&N&&E!==`touch`;!C&&N!==g&&P(g),i.useImperativeHandle(b.context.alignItemWithTriggerActiveRef,()=>F),xu((F||w)&&S,E===`touch`,D,O);let I=$l({anchor:n,floatingRootContext:x,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h??F,collisionAvoidance:_,keepMounted:!0}),L=F?`none`:I.side,R=F?Su:I.positionerStyles,z={open:S,side:L,align:I.align,anchorHidden:I.anchorHidden};q(()=>{b.set(`popupSide`,I.side)},[b,I.side]);let B=cu(e,z,{styles:R,transitionStatus:A,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S}),V=i.useRef(0),ee=K(e=>{if(b.context.valuesRef.current.length===0)return;let t=V.current;V.current=e.size;let n=Ji(Yi);if(t!==0&&!b.state.multiple&&T!==null&&al(b.context.valuesRef.current,T,k)===-1){let e=b.context.initialValueRef.current,t=e!=null&&al(b.context.valuesRef.current,e,k)!==-1?e:null;b.context.setValue(t,n),t===null&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(T)){let e=T.filter(e=>al(b.context.valuesRef.current,e,k)!==-1);e.length!==T.length&&(b.context.setValue(e,n),e.length===0&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null))}if(S&&F){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};au(D,e),au(b.context.popupRef.current,e)}}),H=i.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,Q.jsx)(ha,{elementsRef:b.context.listRef,labelsRef:b.context.labelsRef,onMapChange:ee,children:(0,Q.jsxs)(nu.Provider,{value:H,children:[C&&w&&(0,Q.jsx)(iu,{inert:ka(!S),cutout:O}),B]})})}),wu=`base-ui-disable-scrollbar`,Tu={className:wu,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:wu,precedence:`base-ui:low`,children:`.${wu}{scrollbar-width:none}.${wu}::-webkit-scrollbar{display:none}`})}},Eu=i.createContext(void 0);function Du(e){let t=i.useContext(Eu);if(t===void 0&&!e)throw Error(Oe(69));return t}var Ou=`--transform-origin`,ku={...dr,...Qn},Au=i.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,c=Qc(),l=c.useState(`multiple`),u=c.useState(`readOnly`),d=c.useState(`highlightItemOnHover`),f=$c(),{side:p,align:m,alignItemWithTriggerActive:h,isPositioned:g,setControlledAlignItemWithTrigger:_}=ru(),v=Du(!0)!=null,y=Wa(),{nonce:b,disableStyleElements:x}=Oa(),S=c.useState(`id`),C=c.useState(`open`),w=c.useState(`openMethod`),T=c.useState(`mounted`),E=c.useState(`popupProps`),D=c.useState(`transitionStatus`),O=c.useState(`triggerElement`),A=c.useState(`positionerElement`),j=c.useState(`listElement`),M=i.useRef(!1),N=i.useRef(!1),P=i.useRef({}),F=Ii(),I=K(e=>{if(!A||!c.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!h||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=Nu(A),i=Pu(A.getBoundingClientRect().height,`y`,r),a=Y(A),o=k(A),s=o.getComputedStyle(A),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=ju(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=Mu(e),g=null,_=e=>{A.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=Cl(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(M.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=Cl(g,0,Mu(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),c.context.handleScrollArrowVisibility(e)});i.useImperativeHandle(c.context.scrollHandlerRef,()=>I,[I]),Ui({open:C,ref:c.context.popupRef,onComplete(){C&&c.context.onOpenChangeComplete(!0)}});let L={open:C,transitionStatus:D,side:p,align:m};q(()=>{A&&c.context.popupRef.current&&!Object.keys(P.current).length&&(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[c,A]),q(()=>{C||h||(N.current=!1,M.current=!1,au(A,P.current))},[C,h,A]),q(()=>{let e=c.context.popupRef.current;if(!C||!O||!A||!e||h&&!g||c.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(Ou),!h){F.request(()=>c.context.handleScrollArrowVisibility(j||e));return}let t=Lu(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=k(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=Y(O),s=Nu(O),l=Fu(O.getBoundingClientRect(),s),u=Fu(A.getBoundingClientRect(),s),f=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=ju(a),S=o.documentElement.clientHeight-g-v,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=y===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=Fu(n.getBoundingClientRect(),s);T=Fu(t.getBoundingClientRect(),s),E=u.left+(y===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let N=w+D+v+h,F=Math.min(S,N),I=S-g-v,L=N-F,R=C-5;A.style.left=`${Cl(E,5,R-u.width)}px`,A.style.height=`${F}px`,A.style.maxHeight=`none`,A.style.marginTop=`${g}px`,A.style.marginBottom=`${v}px`,e.style.height=`100%`;let z=Mu(p),B=L>=z-1;B&&(F=Math.min(S,u.height)-(L-z));let V=l.top<20||l.bottom>S-20||Math.ceil(F)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&Ln;if(V||ee){au(A,P.current),_(!1);return}let H=Math.max(b,F);if(B){let e=Math.max(0,S-N);A.style.top=u.height>=I?`0`:`${e}px`,A.style.height=`${F}px`,p.scrollTop=Mu(p)}else A.style.bottom=`0`,p.scrollTop=L;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=Cl(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Ou,`50% ${i}%`)}(H===S||F>=x)&&(M.current=!0),c.context.handleScrollArrowVisibility(p),d&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,C,A,O,h,_,F,j,d,y,g]),i.useEffect(()=>{if(!h||!A||!C)return;let e=k(A);function t(e){c.context.setOpen(!1,Ji(ca,e))}return Co(e,`resize`,t)},[c,h,A,C]);let R={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":l||void 0,"aria-readonly":u||void 0,id:`${S}-list`},onKeyDown(e){v&&Ia.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...h&&{style:j?{height:`100%`}:ou},className:!j&&h?Tu.className:void 0},z=Xe(`div`,e,{ref:[t,c.context.popupRef],state:L,stateAttributesMapping:ku,props:[E,R,su(D),s]});return(0,Q.jsxs)(i.Fragment,{children:[!x&&Tu.getElement(b),(0,Q.jsx)(ss,{context:f,modal:!1,disabled:!T,openInteractionType:w,returnFocus:o,restoreFocus:!0,children:z})]})});function ju(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Mu(e){return wl(e.scrollHeight,e.clientHeight)}function Nu(e){return kc.getScale(e)}function Pu(e,t,n){return e/n[t]}function Fu(e,t){return Qr({x:Pu(e.x,`x`,t),y:Pu(e.y,`y`,t),width:Pu(e.width,`x`,t),height:Pu(e.height,`y`,t)})}var Iu=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Lu(e){let{style:t}=e,n={};for(let[e,r]of Iu)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Iu){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Ru=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Qc(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=ru(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:ou},className:u&&d!==`touch`?Tu.className:void 0};return Xe(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),zu=i.createContext(void 0);function Bu(){let e=i.useContext(zu);if(!e)throw Error(Oe(57));return e}var Vu=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,value:o=null,label:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=i.useRef(null),f=Sa({guess:!0,label:s,textRef:d}),p=Qc(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||c,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,o),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=i.useRef(null);q(()=>{let e=p.context.valuesRef.current;return e[w]=o,()=>{delete e[w]}},[w,o,p]),q(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=cl(w,o,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&nl(o,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,o]);let E=i.useRef(`mouse`),D=i.useRef(!1),{getButtonProps:O,buttonRef:k}=Ne({disabled:y,focusableWhenDisabled:!0,native:l,composite:!0}),A={disabled:y,selected:S,highlighted:b};function j(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?ll(n,o,v):[...n,o];p.context.setValue(r,Ji(Qi,e))}else p.context.setValue(o,Ji(Qi,e)),p.context.setOpen(!1,Ji(Qi,e))}function M(){p.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Sr(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!D.current;D.current=!1,!(y||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),y||E.current===`touch`||D.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},P=Xe(`div`,e,{ref:[k,t,f.ref,T],state:A,props:[m,N,u,O]}),F=i.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,Q.jsx)(zu.Provider,{value:F,children:P})})),Hu=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,keepMounted:o,selected:s,...c}=e,l=i.useRef(null),{transitionStatus:u,setMounted:d}=Wi(s),f=Xe(`span`,e,{ref:[t,l],state:{selected:s,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},c],stateAttributesMapping:Qn});return Ui({batch:!0,enabled:!s,open:s,ref:l,onComplete(){s||d(!1)}}),f})),Uu=i.forwardRef(function(e,t){let{selected:n}=Bu();return e.keepMounted||n?(0,Q.jsx)(Hu,{...e,selected:n,ref:t}):null}),Wu=i.memo(i.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:a}=Bu(),o=Qc(),{render:s,className:c,style:l,...u}=e;return Xe(`div`,e,{ref:[i.useCallback(e=>{e&&(n===0&&(o.context.firstItemTextRef.current=e),a&&(o.context.selectedItemTextRef.current=e))},[o,n,a]),t,r],props:u})})),Gu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Qc(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=ru(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=Mi(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=Wi(g);q(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),Ui({open:g,ref:v,onComplete(){g||x(!1)}});let S=Xe(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=wl(e.scrollHeight,e.clientHeight),r=Tl(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=Ku(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:Qn});return y||o?S:null});function Ku(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Tl(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Tl(l.offsetTop+l.offsetHeight-r+i,a):a}var qu=i.forwardRef(function(e,t){return(0,Q.jsx)(Gu,{...e,ref:t,direction:`down`})}),Ju=i.forwardRef(function(e,t){return(0,Q.jsx)(Gu,{...e,ref:t,direction:`up`})}),Yu=El;function Xu({className:e,...t}){return(0,Q.jsx)(Il,{"data-slot":`select-value`,className:Z(`flex flex-1 text-left`,e),...t})}function Zu({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(Pl,{"data-slot":`select-trigger`,"data-size":t,className:Z(`flex w-fit items-center justify-between gap-1.5 rounded-none border border-input bg-transparent py-2 pr-2 pl-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Q.jsx)(Ll,{render:(0,Q.jsx)(S,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Qu({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(Rl,{children:(0,Q.jsx)(Cu,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(Au,{"data-slot":`select-content`,"data-align-trigger":o,className:Z(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(ed,{}),(0,Q.jsx)(Ru,{children:t}),(0,Q.jsx)(td,{})]})})})}function $u({className:e,children:t,...n}){return(0,Q.jsxs)(Vu,{"data-slot":`select-item`,className:Z(`relative flex w-full cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Wu,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(Uu,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Q.jsx)(b,{className:`pointer-events-none`})})]})}function ed({className:e,...t}){return(0,Q.jsx)(Ju,{"data-slot":`select-scroll-up-button`,className:Z(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(w,{})})}function td({className:e,...t}){return(0,Q.jsx)(qu,{"data-slot":`select-scroll-down-button`,className:Z(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(S,{})})}var nd=i.createContext(void 0);function rd(e){let t=i.useContext(nd);if(!e&&t===void 0)throw Error(Oe(27));return t}var id=i.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=rd(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Xe(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:fr,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),ad=i.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=rd(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ne({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Ji($i,e.nativeEvent))}return Xe(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),od=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rd(),c=Sn(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Xe(`p`,e,{ref:t,props:[{id:c},o]})}),sd=i.createContext(void 0);function cd(){let e=i.useContext(sd);if(e===void 0)throw Error(Oe(26));return e}var ld=`--nested-dialogs`,ud=`data-nested-dialog-open`,dd={...dr,...Qn,nestedDialogOpen(e){return e?{[ud]:``}:null}},fd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=rd(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);cd(),Ui({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?hs(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Xe(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ms,hidden:!m,onKeyDown(e){Ia.has(e.key)&&e.stopPropagation()},style:{[ld]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:dd});return(0,Q.jsx)(ss,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),pd=i.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=rd(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(sd.Provider,{value:n,children:(0,Q.jsxs)(qo,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(iu,{ref:i.context.internalBackdropRef,inert:ka(!s)}),e.children]})}):null});function md({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),a=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=i.useState(0),[f,p]=i.useState(0),m=u===0,h=ds(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Hn(t);if(m&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||$(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return yu(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),q(()=>{!r&&!a&&(d(0),p(0))},[r,a]),q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),Ts(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var hd={...Is,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},gd=class extends xo{constructor(e,t,n){let r=new Ds,i=_d(e,r,t,n);super(i,vd(r),hd)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(bs(this.state,e,t.trigger)))}};function _d(e,t,n,r=!1){return{...As(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function vd(e){return{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function yd(e,t){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=t,m=e===`drawer`,h=e===`alert-dialog`,g=h?!0:l,_=h||c,v=h?`alertdialog`:`dialog`,y=rd(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=gs((e,t)=>new gd({open:a,openProp:r,activeTriggerId:p,triggerIdProp:f,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,f),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,o),x.useContextCallback(`onOpenChangeComplete`,s);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);Es(x,S),Cs(x);let{forceUnmount:T}=ws(S,x);i.useImperativeHandle(u,()=>({unmount:T,close:()=>x.setOpen(!1,Ji(sa))}),[T,x]);let E=S||C||d!=null;return(0,Q.jsxs)(nd.Provider,{value:x,children:[d&&(0,Q.jsx)(_s,{handle:d,store:x}),E&&(0,Q.jsx)(md,{store:x,parentContext:y?.context,isDrawer:m}),typeof n==`function`?n({payload:w}):n]})}var bd=fo(function(e){return yd(`dialog`,e)}),xd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rd(),c=Sn(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Xe(`h2`,e,{ref:t,props:[{id:c},o]})}),Sd=po(function(e,t){let{render:n,className:r,style:a,disabled:o=!1,nativeButton:s=!0,id:c,payload:l,handle:u,...d}=e,f=rd(!0),p=Ls(u)??f;if(!p)throw Error(Oe(79));let m=Sn(c),h=p.useState(`floatingRootContext`),g=p.useState(`isOpenedByTrigger`,m),_=p.useState(`triggerPopupId`,m),v=i.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Ss(m,v,p,{payload:l}),{getButtonProps:x,buttonRef:S}=Ne({disabled:o,native:s}),C=cs(h),w=xl(()=>p.select(`open`),e=>{p.set(`openMethod`,e)}),T={disabled:o,open:g},E=p.useState(`triggerProps`,b);return Xe(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[Bo]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":_},d,x],stateAttributesMapping:lr})});function Cd({...e}){return(0,Q.jsx)(bd,{"data-slot":`dialog`,...e})}function wd({...e}){return(0,Q.jsx)(Sd,{"data-slot":`dialog-trigger`,...e})}function Td({...e}){return(0,Q.jsx)(pd,{"data-slot":`dialog-portal`,...e})}function Ed({className:e,...t}){return(0,Q.jsx)(id,{"data-slot":`dialog-overlay`,className:Z(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Dd({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Q.jsxs)(Td,{children:[(0,Q.jsx)(Ed,{}),(0,Q.jsxs)(fd,{"data-slot":`dialog-content`,className:Z(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Q.jsxs)(ad,{"data-slot":`dialog-close`,render:(0,Q.jsx)(on,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(E,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Od({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:Z(`flex flex-col gap-1 text-left`,e),...t})}function kd({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Z(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(ad,{render:(0,Q.jsx)(on,{variant:`outline`}),children:`Close`})]})}function Ad({className:e,...t}){return(0,Q.jsx)(xd,{"data-slot":`dialog-title`,className:Z(`font-heading text-sm font-medium`,e),...t})}function jd({className:e,...t}){return(0,Q.jsx)(od,{"data-slot":`dialog-description`,className:Z(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Md({className:e,containerClassName:t,...n}){return(0,Q.jsx)(`div`,{"data-slot":`table-container`,className:Z(`relative w-full overflow-x-auto`,t),children:(0,Q.jsx)(`table`,{"data-slot":`table`,className:Z(`w-full caption-bottom text-xs`,e),...n})})}function Nd({className:e,...t}){return(0,Q.jsx)(`thead`,{"data-slot":`table-header`,className:Z(`[&_tr]:border-b`,e),...t})}function Pd({className:e,...t}){return(0,Q.jsx)(`tbody`,{"data-slot":`table-body`,className:Z(`[&_tr:last-child]:border-0`,e),...t})}function Fd({className:e,...t}){return(0,Q.jsx)(`tr`,{"data-slot":`table-row`,className:Z(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Id({className:e,...t}){return(0,Q.jsx)(`th`,{"data-slot":`table-head`,className:Z(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function Ld({className:e,...t}){return(0,Q.jsx)(`td`,{"data-slot":`table-cell`,className:Z(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}var Rd=ct(`group/alert relative grid w-full gap-0.5 rounded-none border px-2.5 py-2 text-left text-xs has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function zd({className:e,variant:t,...n}){return(0,Q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Z(Rd({variant:t}),e),...n})}function Bd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-description`,className:Z(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-2`,e),...t})}function Vd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty`,className:Z(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-none border-dashed p-6 text-center text-balance`,e),...t})}function Hd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-header`,className:Z(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function Ud({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-title`,className:Z(`font-heading text-sm font-medium`,e),...t})}function Wd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-description`,className:Z(`text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}async function Gd(e,t,n){let r=await fetch(`/api/`+e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?{}:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),signal:n,redirect:`error`});if(!r.headers.get(`content-type`)?.includes(`application/json`))throw Error(`Session expired. Sign in again through Cloudflare Access.`);let i=await r.json();if(!r.ok)throw Error(i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:`HTTP ${r.status}`);return i}var Kd=(e,t)=>`projects/${e.id}/${t}`;function qd(e){return e instanceof Error?e.message:`Request failed`}function Jd(e){return e==null?`null`:Array.isArray(e)?`List · ${e.length}`:typeof e==`object`?`Object`:String(e).slice(0,2e3)}function Yd(e,t){let n={};return e.forEach((e,r)=>{let i=t(`m${r}`);if(![`value`,`omit`,`null`].includes(String(i)))throw Error(`Invalid value mode: ${e.name}`);if(i===`omit`){if(e.required&&!e.defaultMode)throw Error(`${e.name} is required`);return}if(i===`null`){if(!e.nullable)throw Error(`${e.name} cannot be null`);Object.defineProperty(n,e.name,{value:null,enumerable:!0,writable:!0,configurable:!0});return}let a=String(t(`v${r}`)??``),o=a;if(e.choices){let t=Number(a);if(!Number.isInteger(t)||t<0||t>=e.choices.length)throw Error(`Invalid ${e.name}`);o=e.choices[t]}else if(e.type===`number`||e.type===`integer`){let t=Number(a);if(!a.trim()||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)||e.minimum!==void 0&&t<e.minimum||e.maximum!==void 0&&t>e.maximum)throw Error(`Invalid number: ${e.name}`);o=t}else if(e.type===`boolean`){if(a!==`true`&&a!==`false`)throw Error(`Invalid boolean: ${e.name}`);o=a===`true`}else if([`object`,`array`,`json`].includes(e.type)&&(o=JSON.parse(a),e.type!==`json`&&(e.type===`array`?!Array.isArray(o):!o||typeof o!=`object`||Array.isArray(o))))throw Error(`Invalid ${e.type}: ${e.name}`);Object.defineProperty(n,e.name,{value:o,enumerable:!0,writable:!0,configurable:!0})}),n}function Xd(e){return Object.entries(e?.properties??{}).map(([t,n])=>{let r=n.anyOf??(Array.isArray(n.type)?n.type.map(e=>({type:e})):[n]),i={...n,...r.find(e=>e.type!==`null`)},a=r.some(e=>e.type===`null`||e.const===null),o=new Set(r.filter(e=>e.type!==`null`).map(e=>e.type)),s=n.enum??(r.every(e=>Object.hasOwn(e,`const`))?r.map(e=>e.const):i.enum);return{name:t,type:o.size===1&&typeof i.type==`string`?i.type:`json`,...a?{nullable:!0}:{},...typeof i.description==`string`?{description:i.description}:{},required:e.required?.includes(t),value:i.default,choices:s,minimum:i.minimum,maximum:i.maximum}})}function Zd(e){let[t,n]=(0,i.useState)({path:e,loading:!0}),[r,a]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let t=new AbortController;return n(t=>t.path===e&&t.data!==void 0?{...t,error:void 0,loading:!0}:{path:e,loading:!0}),Gd(e,void 0,t.signal).then(r=>{t.signal.aborted||n({path:e,data:r,loading:!1})}).catch(r=>{t.signal.aborted||n({path:e,error:qd(r),loading:!1})}),()=>t.abort()},[e,r]),(0,i.useEffect)(()=>{let e=0,t=()=>{let t=Date.now();document.visibilityState===`visible`&&t-e>500&&(e=t,a(e=>e+1))};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[]),{...t.path===e?t:{path:e,loading:!0},refresh:()=>a(e=>e+1)}}function Qd({children:e}){return(0,Q.jsx)(zd,{variant:`destructive`,children:(0,Q.jsx)(Bd,{children:e})})}function $d({loading:e,error:t}){return t?(0,Q.jsx)(Qd,{children:t}):e?(0,Q.jsx)(`p`,{role:`status`,className:`p-4 text-xs text-muted-foreground`,children:`Loading…`}):null}function ef({title:e,children:t}){return(0,Q.jsx)(Vd,{children:(0,Q.jsxs)(Hd,{children:[(0,Q.jsx)(Ud,{children:e}),t&&(0,Q.jsx)(Wd,{children:t})]})})}function tf({value:e,onChange:t,items:n,label:r,className:i,name:a,disabled:o,id:s}){return(0,Q.jsxs)(Yu,{name:a,disabled:o,value:e,onValueChange:e=>{e!==null&&t(e)},items:n,children:[(0,Q.jsx)(Zu,{id:s,"aria-label":r,className:i,children:(0,Q.jsx)(Xu,{})}),(0,Q.jsx)(Qu,{align:`start`,alignItemWithTrigger:!1,children:n.map(e=>(0,Q.jsx)($u,{value:e.value,children:e.label},e.value))})]})}function nf({rows:e,columns:t,labels:n={},renderCell:r}){return(0,Q.jsxs)(Md,{children:[(0,Q.jsx)(Nd,{children:(0,Q.jsx)(Fd,{children:t.map(e=>(0,Q.jsx)(Id,{children:n[e]??e},e))})}),(0,Q.jsx)(Pd,{children:e.slice(0,100).map((e,n)=>(0,Q.jsx)(Fd,{children:t.map(t=>(0,Q.jsx)(Ld,{className:`max-w-sm truncate`,children:r?r(t,e[t]):[`at`,`dueAt`].includes(t)&&typeof e[t]==`number`?new Date(e[t]).toLocaleString():Jd(e[t])},t))},n))})]})}function rf({value:e,depth:t=0}){if(t>4)return(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Nested value`});if(Array.isArray(e)){let n=e.slice(0,100);return n.length&&n.every(e=>e&&typeof e==`object`&&!Array.isArray(e))?(0,Q.jsx)(nf,{rows:n,columns:[...new Set(n.flatMap(e=>Object.keys(e)))].slice(0,40)}):e.length?(0,Q.jsx)(`ol`,{className:`list-inside list-decimal space-y-2`,children:n.map((e,n)=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(rf,{value:e,depth:t+1})},n))}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Empty list`})}return e&&typeof e==`object`?(0,Q.jsx)(`dl`,{className:`grid grid-cols-[minmax(80px,auto)_1fr] gap-4`,children:Object.entries(e).slice(0,40).map(([e,n])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`min-w-0 overflow-auto`,children:(0,Q.jsx)(rf,{value:n,depth:t+1})})]},e))}):(0,Q.jsx)(`span`,{className:`break-all`,children:Jd(e)})}function af({items:e}){return(0,Q.jsxs)(qa,{children:[!e.length&&(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`No arguments required.`}),e.map((e,t)=>(0,Q.jsx)(of,{field:e,index:t},e.name))]})}function of({field:e,index:t}){let n=e.value===null&&e.nullable?`null`:e.value===void 0&&(!e.required||e.defaultMode)?`omit`:`value`,[r,a]=(0,i.useState)(n),[o,s]=(0,i.useState)(e.choices?String(Math.max(0,e.choices.indexOf(e.value))):String(e.value===!0)),c=(0,i.useId)();return(0,Q.jsxs)(Ya,{children:[(0,Q.jsxs)(Xa,{htmlFor:c,children:[(0,Q.jsxs)(`span`,{children:[e.name,e.required?` *`:``]}),(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:e.type})]}),(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.choices||e.type===`boolean`?(0,Q.jsx)(tf,{id:c,name:`v${t}`,label:e.name,className:`w-full`,disabled:r!==`value`,value:o,onChange:s,items:e.choices?e.choices.map((e,t)=>({value:String(t),label:String(e)})):[{value:`false`,label:`false`},{value:`true`,label:`true`}]}):[`object`,`array`,`json`].includes(e.type)?(0,Q.jsx)(Ga,{id:c,name:`v${t}`,disabled:r!==`value`,defaultValue:e.value===void 0?``:JSON.stringify(e.value,null,2),placeholder:e.type===`json`?`JSON value`:e.type===`array`?`[]`:`{}`}):(0,Q.jsx)(da,{id:c,name:`v${t}`,type:e.type===`password`?`password`:[`number`,`integer`].includes(e.type)?`number`:`text`,autoComplete:e.type===`password`?`new-password`:void 0,minLength:e.type===`password`?6:void 0,maxLength:e.type===`password`?128:void 0,required:e.required&&r===`value`,step:e.type===`integer`?1:`any`,min:e.minimum,max:e.maximum,disabled:r!==`value`,defaultValue:e.value===null||e.value===void 0?``:String(e.value)})}),!e.required||e.defaultMode||e.nullable?(0,Q.jsx)(tf,{name:`m${t}`,className:`w-32 shrink-0`,label:`Value mode for ${e.name}`,value:r,onChange:a,items:[{value:`value`,label:`Value`},...!e.required||e.defaultMode?[{value:`omit`,label:e.defaultMode?`Default`:`Omit`}]:[],...e.nullable?[{value:`null`,label:`NULL`}]:[]]}):(0,Q.jsx)(`input`,{type:`hidden`,name:`m${t}`,value:`value`})]}),e.description&&(0,Q.jsx)(Za,{children:e.description})]})}function sf(e,t){let n=new FormData(e);return Yd(t,e=>n.get(e))}function cf({modal:e,onClose:t}){let[n,r]=(0,i.useState)(!1),[a,o]=(0,i.useState)(``);return(0,Q.jsx)(Cd,{open:!0,onOpenChange:e=>{!e&&!n&&t()},children:(0,Q.jsxs)(Dd,{className:`max-h-[85vh] overflow-auto`,showCloseButton:!n,children:[(0,Q.jsxs)(Od,{children:[(0,Q.jsx)(Ad,{children:e.title}),(0,Q.jsx)(jd,{children:e.description})]}),(0,Q.jsxs)(`form`,{className:`space-y-4`,onSubmit:async i=>{if(i.preventDefault(),!n){r(!0),o(``);try{let n=i.currentTarget;if(e.productionId&&new FormData(n).get(`confirm`)!==e.productionId)throw Error(`Project ID does not match`);await e.submit(n),t()}catch(e){o(qd(e))}finally{r(!1)}}},children:[e.fields&&(0,Q.jsx)(af,{items:e.fields}),` `,e.content,e.productionId&&(0,Q.jsxs)(Ya,{children:[(0,Q.jsx)(Xa,{htmlFor:`production-confirm`,children:`Production change: type project ID`}),(0,Q.jsx)(`code`,{className:`block select-all`,children:e.productionId}),(0,Q.jsx)(da,{id:`production-confirm`,name:`confirm`,required:!0,autoComplete:`off`})]}),a&&(0,Q.jsx)(Qd,{children:a}),(0,Q.jsxs)(kd,{children:[(0,Q.jsx)(on,{type:`button`,variant:`outline`,disabled:n,onClick:t,children:`Cancel`}),(0,Q.jsx)(on,{type:`submit`,variant:e.destructive?`destructive`:`default`,disabled:n,children:n?`Working…`:e.submitLabel??`Confirm`})]})]})]})})}export{Yi as $,Za as A,K as At,Fa as B,Cd as C,Ne as Ct,Ad as D,Oe as Dt,Od as E,Ae as Et,Ma as F,ka as G,za as H,Na as I,fa as J,Sa as K,Pa as L,Xa as M,Ga as N,wd as O,me as Ot,Wa as P,aa as Q,ja as R,Fd as S,Ie as St,jd as T,ke as Tt,Ba as U,La as V,Aa as W,ia as X,da as Y,oa as Z,Md as _,Z as _t,cf as a,ei as at,Id as b,Ge as bt,rf as c,Qn as ct,Xd as d,Bn as dt,Ji as et,Yd as f,$ as ft,Kd as g,rn as gt,Jd as h,on as ht,af as i,ti as it,qa as j,v as jt,Ya as k,q as kt,sf as l,Yn as lt,qd as m,Sn as mt,ef as n,Ui as nt,nf as o,$r as ot,Gd as p,Hn as pt,ha as q,Qd as r,ri as rt,$d as s,ii as st,tf as t,Wi as tt,Zd as u,Jn as ut,Pd as v,ct as vt,Dd as w,Y as wt,Nd as x,Ke as xt,Ld as y,Xe as yt,Ia as z};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/services-view.B2suYnaG.js","_astro/react-dom.DwX89IcG.js","_astro/common.HrRZXwD9.js","_astro/refresh-cw.B0Cj85jJ.js","_astro/tabs.GRO5rCrK.js","_astro/status-badge.BV1dzbX9.js","_astro/badge.DwKWvVfO.js","_astro/client.BUUZgEFj.js","_astro/data-view.CcyUYvId.js","_astro/table-guide.DzBDP6fC.js","_astro/input-group.3twGpQ77.js","_astro/functions-view.C8JWdNAh.js","_astro/function-badge.MlTRYkqM.js","_astro/auth-view.CuxQ12Fa.js","_astro/settings-view.BFP47ySK.js","_astro/card.Bdqmram9.js","_astro/sdk-view.CRFkbEyS.js","_astro/cli-approval.VKPc8wYS.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t}from"./react-dom.DwX89IcG.js";import{C as n,D as r,E as i,M as a,N as o,S as s,T as c,Y as l,_ as u,a as d,b as f,g as p,gt as m,h,ht as g,j as _,jt as v,k as y,m as ee,n as b,o as x,p as S,r as te,s as C,t as ne,u as w,v as T,w as E,x as D,y as O}from"./common.HrRZXwD9.js";import{n as k,t as A}from"./function-badge.MlTRYkqM.js";import{n as j,r as M,t as N}from"./table-guide.DzBDP6fC.js";import{t as P}from"./refresh-cw.B0Cj85jJ.js";import{i as re,r as ie,t as ae}from"./tabs.GRO5rCrK.js";import{t as F}from"./status-badge.BV1dzbX9.js";import{i as I,n as L,r as R,t as z}from"./card.Bdqmram9.js";var B={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};B.node;var V=v(B),H={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};H.node;var oe=v(H),U={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};U.node;var se=v(U),W={name:`logs`,size:24,node:[[`path`,{d:`M3 5h1`,key:`1mv5vm`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M3 19h1`,key:`w6f3n9`}],[`path`,{d:`M8 5h1`,key:`1nxr5w`}],[`path`,{d:`M8 12h1`,key:`1con00`}],[`path`,{d:`M8 19h1`,key:`k7p10e`}],[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}]]};W.node;var ce=v(W),G={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};G.node;var le=v(G),K={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};K.node;var ue=v(K),q={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};q.node;var de=v(q),J={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};J.node;var fe=v(J),Y={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};Y.node;var pe=v(Y),X=e(t(),1),Z=m();function me(e){return(0,Z.jsxs)(z,{children:[(0,Z.jsx)(R,{children:(0,Z.jsx)(I,{children:e.env===`dev`?`Development releases`:`Production releases`})}),(0,Z.jsx)(L,{children:(0,Z.jsx)(he,{...e})})]})}function he(e){let[t,n]=(0,X.useState)(),[r,i]=(0,X.useState)(),a=p(e.project,e.env),o=p(e.project,e.env),c=w(a+`/history`),l=w(a+`/health`),m=e.session.role!==`viewer`,h=async(t,n)=>{let r=n?p(e.project,`prod`):o,a=await S(r+`/health`);i({title:n?`Promote backend to production`:`Rollback backend`,description:`Activate this exact backend hash after native schema/job validation. Data, files and settings stay unchanged. Frontend is not published by this button; use the CLI release flow for that.`,productionId:n||e.env===`prod`?e.project.id:void 0,submit:async()=>{await S(r+(n?`/release-promote`:`/release-rollback`),{hash:t,expected:a.active,confirm:e.project.id}),c.refresh(),l.refresh(),e.refresh()}})},[_,v]=(0,X.useState)();return(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(C,{loading:c.loading||l.loading,error:_||c.error||l.error}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(D,{children:(0,Z.jsxs)(s,{children:[(0,Z.jsx)(f,{children:`First published`}),(0,Z.jsx)(f,{children:`Backend hash`}),(0,Z.jsx)(f,{children:`Actions`})]})}),(0,Z.jsx)(T,{children:c.data?.map(t=>(0,Z.jsxs)(s,{children:[(0,Z.jsx)(O,{children:new Date(t.at).toLocaleString()}),(0,Z.jsxs)(O,{children:[(0,Z.jsx)(`code`,{className:`text-xs`,children:t.hash.slice(0,12)}),l.data?.active===t.hash&&(0,Z.jsx)(F,{status:`Active`})]}),(0,Z.jsx)(O,{children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(g,{variant:`outline`,size:`sm`,onClick:()=>n(t.hash),children:`View contracts`}),m&&l.data?.active!==t.hash&&(0,Z.jsx)(g,{variant:`outline`,size:`sm`,onClick:()=>void h(t.hash,!1).catch(e=>v(e.message)),children:`Rollback backend`}),m&&e.env===`dev`&&(0,Z.jsx)(g,{variant:`outline`,size:`sm`,onClick:()=>void h(t.hash,!0).catch(e=>v(e.message)),children:`Promote backend`})]})})]},t.hash))})]}),t&&(0,Z.jsx)(ge,{path:a,hash:t,close:()=>n(void 0)}),r&&(0,Z.jsx)(d,{modal:r,onClose:()=>i(void 0)})]})}function ge({path:e,hash:t,close:a}){let o=w(e+`/release?hash=`+t);return(0,Z.jsx)(n,{open:!0,onOpenChange:e=>{e||a()},children:(0,Z.jsxs)(E,{className:`max-h-[80vh] overflow-auto`,children:[(0,Z.jsxs)(i,{children:[(0,Z.jsx)(r,{children:`Backend release`}),(0,Z.jsx)(c,{className:`break-all`,children:t})]}),(0,Z.jsx)(C,{...o}),o.data&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`h3`,{className:`font-medium`,children:`Tables`}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(D,{children:(0,Z.jsxs)(s,{children:[(0,Z.jsx)(f,{children:`Table`}),(0,Z.jsx)(f,{children:`Fields`})]})}),(0,Z.jsx)(T,{children:Object.entries(o.data.schema).map(([e,t])=>(0,Z.jsxs)(s,{children:[(0,Z.jsx)(O,{children:e}),(0,Z.jsx)(O,{children:Object.keys(t.document.properties??{}).join(`, `)||`No declared fields`})]},e))})]}),(0,Z.jsx)(`h3`,{className:`font-medium`,children:`Functions`}),(0,Z.jsxs)(u,{children:[(0,Z.jsx)(D,{children:(0,Z.jsxs)(s,{children:[(0,Z.jsx)(f,{children:`Function`}),(0,Z.jsx)(f,{children:`Kind`}),(0,Z.jsx)(f,{children:`Access`})]})}),(0,Z.jsx)(T,{children:Object.entries(o.data.manifest.functions).map(([e,t])=>(0,Z.jsxs)(s,{children:[(0,Z.jsx)(O,{children:e}),(0,Z.jsx)(O,{children:(0,Z.jsx)(A,{kind:t.kind})}),(0,Z.jsx)(O,{children:(0,Z.jsx)(F,{status:t.auth})})]},e))})]})]})]})})}function _e({project:e,env:t,session:n,connect:r}){let i=w(p(e,t)+`/health`),a=w(p(e,t)+`/settings`);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsx)(`h1`,{className:`page-title`,children:`Health`}),(0,Z.jsx)(C,{loading:i.loading||a.loading,error:i.error||a.error}),i.data&&a.data&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`h2`,{className:`section-title`,children:`Summary`}),(0,Z.jsx)(z,{children:(0,Z.jsxs)(L,{className:`grid gap-4 md:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{status:t===`dev`?`Development`:`Production`}),(0,Z.jsx)(`strong`,{children:e.name})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Cloudflare · Durable Objects · SQLite`}),(0,Z.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[`Release `,i.data.active?.slice(0,12)??`not deployed`]})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Cloud URL`}),(0,Z.jsx)(`code`,{className:`block select-all break-all text-xs`,children:a.data.url}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,Z.jsx)(F,{status:i.data.status}),i.data.connections,` connections · `,i.data.subscriptions,` `,`subscriptions`]})]})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(R,{children:(0,Z.jsx)(I,{children:`Live connections`})}),(0,Z.jsxs)(L,{className:`space-y-2`,children:[(0,Z.jsx)(`strong`,{className:`text-2xl font-semibold tabular-nums`,children:i.data.connections}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Hibernating WebSocket connections`})]})]}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(R,{children:(0,Z.jsx)(I,{children:`Subscriptions`})}),(0,Z.jsxs)(L,{className:`space-y-2`,children:[(0,Z.jsx)(`strong`,{className:`text-2xl font-semibold tabular-nums`,children:i.data.subscriptions}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Active live queries`})]})]})]}),(0,Z.jsx)(me,{project:e,env:t,session:n,refresh:i.refresh}),(0,Z.jsx)(`h2`,{className:`section-title`,children:`Insights`}),(0,Z.jsx)(z,{children:(0,Z.jsxs)(L,{className:`flex flex-col items-start gap-4`,children:[(0,Z.jsx)(V,{className:i.data.status===`ready`?`size-6 text-emerald-500`:`size-6 text-amber-500`}),(0,Z.jsxs)(`h2`,{className:`flex items-center gap-2 text-base font-medium`,children:[`Runtime `,(0,Z.jsx)(F,{status:i.data.status})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Historical analytics not configured.`}),(0,Z.jsx)(g,{variant:`outline`,onClick:r,children:`Connect SDK`})]})})]})]})}function ve({project:e,env:t,session:n}){let r=w(p(e,t)+`/schema`);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h1`,{className:`page-title`,children:`Schema`}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reload snapshot`,title:`Reload snapshot`,onClick:r.refresh,disabled:r.loading,children:(0,Z.jsx)(P,{})}),r.data&&(0,Z.jsx)(N,{tables:r.data.tables,env:t,role:n.role})]})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Defined in code; validated documents and indexes activate atomically. System tables are hidden.`}),(0,Z.jsx)(C,{...r}),r.data?.tables.map(e=>(0,Z.jsxs)(z,{children:[(0,Z.jsx)(R,{children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(I,{className:`font-mono`,children:e.name}),(0,Z.jsx)(N,{tables:r.data.tables,env:t,role:n.role,table:e.name})]})}),(0,Z.jsxs)(L,{className:`space-y-4`,children:[(0,Z.jsx)(x,{rows:e.columns.map(e=>({Field:e.name,Type:e.type,Required:!!e.notnull,Primary:!!e.pk,Default:e.dflt_value})),columns:[`Field`,`Type`,`Required`,`Primary`,`Default`]}),(0,Z.jsx)(x,{rows:Object.entries(e.indexes).map(([e,t])=>({Index:e,Fields:t.join(`, `)})),columns:[`Index`,`Fields`]}),(0,Z.jsxs)(`details`,{children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Document contract`}),(0,Z.jsx)(`pre`,{className:`code-block mt-3`,children:JSON.stringify(e.document,null,2)})]})]})]},e.name)),r.data&&!r.data.tables.length&&(0,Z.jsx)(b,{title:`No application tables`})]})}function ye({project:e,env:t}){let n=w(p(e,t)+`/logs`);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`h1`,{className:`page-title`,children:`Logs`}),(0,Z.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reload snapshot`,title:`Reload snapshot`,onClick:n.refresh,disabled:n.loading,children:(0,Z.jsx)(P,{})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Last 100 invocation summaries. Successful queries are held in memory and disappear on hibernation/restart; writes and failures are persisted. Not Cloudflare Tail logs or billing analytics.`}),(0,Z.jsx)(C,{...n}),n.data&&(n.data.length?(0,Z.jsx)(x,{rows:n.data,renderCell:(e,t)=>e===`kind`&&[`query`,`mutation`,`action`].includes(String(t))?(0,Z.jsx)(A,{kind:t}):e===`status`?(0,Z.jsx)(F,{status:t===`ok`?`ok`:`error`,children:h(t)}):e===`at`&&typeof t==`number`?new Date(t).toLocaleString():h(t),columns:[`at`,`path`,`kind`,`status`,`ms`],labels:{at:`Time`,path:`Function`,kind:`Type`,status:`Status`,ms:`Duration (ms)`}}):(0,Z.jsx)(b,{title:`No recent function calls`}))]})}var be=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),xe=function(e){return`/`+e},Se={},Ce=function(e){return e.pathname.endsWith(`.css`)},we=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)},a,o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{e=xe(e,n);let t=i(e),r=Ce(t);return we(Se,t.href,()=>{if(a===void 0){a={all:new Set,styles:new Set};let e=document.getElementsByTagName(`link`);for(let t=e.length-1;t>=0;t--){let n=e[t];a.all.add(n.href),n.rel===`stylesheet`&&a.styles.add(n.href)}}if((r?a.styles:a.all).has(t.href))return;let e=document.createElement(`link`);if(e.rel=r?`stylesheet`:be,r||(e.as=`script`),e.crossOrigin=``,e.href=t.href,s&&e.setAttribute(`nonce`,s),document.head.appendChild(e),r)return new Promise((n,r)=>{e.addEventListener(`load`,n),e.addEventListener(`error`,()=>r(Error(`Unable to preload CSS for ${t}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Te=(0,X.lazy)(()=>Q(()=>import(`./services-view.B2suYnaG.js`).then(e=>({default:e.FilesView})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Ee=(0,X.lazy)(()=>Q(()=>import(`./services-view.B2suYnaG.js`).then(e=>({default:e.SchedulesView})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),De=(0,X.lazy)(()=>Q(()=>import(`./data-view.CcyUYvId.js`),__vite__mapDeps([8,1,2,9,3,4,10,6]))),Oe=(0,X.lazy)(()=>Q(()=>import(`./functions-view.C8JWdNAh.js`),__vite__mapDeps([11,1,2,12,6,10,4,5,7]))),ke=(0,X.lazy)(()=>Q(()=>import(`./auth-view.CuxQ12Fa.js`),__vite__mapDeps([13,1,2,5,6]))),Ae=(0,X.lazy)(()=>Q(()=>import(`./settings-view.BFP47ySK.js`),__vite__mapDeps([14,1,2,5,6,15]))),je=(0,X.lazy)(()=>Q(()=>import(`./sdk-view.CRFkbEyS.js`),__vite__mapDeps([16,1,2,15]))),$=[{key:`health`,label:`Health`,icon:V},{key:`data`,label:`Data`,icon:M},{key:`schema`,label:`Schema`,icon:oe},{key:`functions`,label:`Functions`,icon:k},{key:`files`,label:`Files`,icon:se},{key:`schedules`,label:`Schedules`,icon:pe},{key:`auth`,label:`Auth`,icon:fe},{key:`logs`,label:`Logs`,icon:ce}],Me=(0,X.lazy)(()=>Q(()=>import(`./cli-approval.VKPc8wYS.js`),__vite__mapDeps([17,1,2])));function Ne(){return new URLSearchParams(location.search).has(`cli`)?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`p`,{children:`Loading…`}),children:(0,Z.jsx)(Me,{})}):(0,Z.jsx)(Pe,{})}function Pe(){let[e,t]=(0,X.useState)(),[n,r]=(0,X.useState)([]),[i,s]=(0,X.useState)(),[c,u]=(0,X.useState)(`dev`),[f,p]=(0,X.useState)(`health`),[m,h]=(0,X.useState)(``),[v,b]=(0,X.useState)(!0),[x,w]=(0,X.useState)(),[T,E]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=new AbortController;return E(localStorage.getItem(`flare.sidebar`)===`collapsed`),Promise.all([S(`session`,void 0,e.signal),S(`projects`,void 0,e.signal)]).then(([n,i])=>{e.signal.aborted||(t(n),r(i),s(i.find(e=>e.id===localStorage.getItem(`flare.project`))??i[0]),b(!1))}).catch(t=>{e.signal.aborted||(h(ee(t)),b(!1))}),()=>e.abort()},[]);let D=e=>{let t=n.find(t=>t.id===e);t&&(s(t),u(`dev`),p(`health`),w(void 0),localStorage.setItem(`flare.project`,e))},O=()=>w({title:`Create project`,description:`Creates separate development and production environments.`,content:(0,Z.jsxs)(_,{children:[(0,Z.jsxs)(y,{children:[(0,Z.jsx)(a,{htmlFor:`project-customer`,children:`Customer / workspace`}),(0,Z.jsx)(l,{id:`project-customer`,name:`customer`,required:!0,maxLength:100,placeholder:`Your team`})]}),(0,Z.jsxs)(y,{children:[(0,Z.jsx)(a,{htmlFor:`project-name`,children:`Project name`}),(0,Z.jsx)(l,{id:`project-name`,name:`name`,required:!0,maxLength:100,placeholder:`CRM`})]}),(0,Z.jsxs)(y,{children:[(0,Z.jsx)(a,{htmlFor:`project-alias`,children:`Short URL name (optional)`}),(0,Z.jsx)(l,{id:`project-alias`,name:`alias`,maxLength:48,pattern:`[a-z][a-z0-9]*(?:-[a-z0-9]+)*`,placeholder:`crm`})]}),(0,Z.jsxs)(y,{children:[(0,Z.jsx)(a,{htmlFor:`project-origins`,children:`Allowed frontend origins · one per line`}),(0,Z.jsx)(o,{id:`project-origins`,name:`origins`,placeholder:`http://127.0.0.1:5173`})]})]}),submit:async e=>{let t=new FormData(e),n=await S(`projects`,{name:t.get(`name`),customer:t.get(`customer`),alias:t.get(`alias`)||void 0,origins:[location.origin,...String(t.get(`origins`)).split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(Boolean)]}),i=await S(`projects`);r(i),s(i.find(e=>e.id===n.id)??i[0]),u(`dev`),p(`health`)}}),k=i&&e?{project:i,env:c,session:e}:null,A=()=>{let e=n.filter(e=>e.id!==i?.id);r(e),s(e[0]),u(`dev`),p(`health`),e[0]?localStorage.setItem(`flare.project`,e[0].id):localStorage.removeItem(`flare.project`)},M=e=>{w(void 0),p(e)};return(0,Z.jsxs)(`div`,{className:`flex h-dvh min-h-0 flex-col overflow-hidden text-sm`,children:[(0,Z.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-3 border-b bg-sidebar px-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsx)(ne,{label:`Select project`,value:i?.id??``,onChange:D,items:n.map(e=>({value:e.id,label:e.name})),className:`max-w-48`}),k&&(0,Z.jsx)(ae,{value:c,onValueChange:e=>{(e===`dev`||e===`prod`)&&(u(e),w(void 0))},"aria-label":`Select environment`,children:(0,Z.jsxs)(ie,{children:[(0,Z.jsx)(re,{value:`dev`,children:`Dev`}),(0,Z.jsx)(re,{value:`prod`,children:`Production`})]})})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e?.role!==`viewer`&&e&&(0,Z.jsx)(g,{"aria-label":`Create project`,size:`icon-sm`,variant:`ghost`,onClick:O,children:(0,Z.jsx)(j,{})}),k&&(0,Z.jsx)(g,{"aria-label":`Project settings`,size:`icon-sm`,variant:`ghost`,onClick:()=>M(`settings`),children:(0,Z.jsx)(de,{})}),e&&(0,Z.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full bg-muted text-xs font-medium`,title:e.email,"aria-label":`Signed in as ${e.email}`,children:e.email.slice(0,2).toUpperCase()})]})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Z.jsxs)(`aside`,{className:`flex shrink-0 flex-col border-r bg-sidebar px-2 py-3 ${T?`w-12`:`w-36`}`,children:[(0,Z.jsx)(`nav`,{"aria-label":`Deployment`,className:`flex flex-col gap-1`,children:$.map(({key:e,label:t,icon:n})=>(0,Z.jsxs)(g,{variant:`ghost`,disabled:!k,"aria-current":f===e?`page`:void 0,title:T?t:void 0,"aria-label":T?t:void 0,className:`w-full justify-start ${f===e?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground`}`,onClick:()=>M(e),children:[(0,Z.jsx)(n,{className:`size-4`}),!T&&t]},e))}),(0,Z.jsxs)(g,{"aria-label":T?`Expand sidebar`:`Collapse sidebar`,className:`mt-auto justify-start text-muted-foreground`,variant:`ghost`,onClick:()=>E(e=>(localStorage.setItem(`flare.sidebar`,e?`expanded`:`collapsed`),!e)),children:[T?(0,Z.jsx)(ue,{}):(0,Z.jsx)(le,{}),!T&&`Collapse`]})]}),(0,Z.jsxs)(`main`,{className:`min-h-0 min-w-0 flex-1 ${f===`data`?`overflow-hidden`:`overflow-auto`}`,"aria-label":`Deployment content`,children:[m&&(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(te,{children:m})}),v?(0,Z.jsx)(C,{loading:!0}):k?(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(C,{loading:!0}),children:(0,Z.jsx)(`div`,{className:f===`data`?`h-full min-h-0`:`min-h-full`,children:f===`health`?(0,Z.jsx)(_e,{...k,connect:()=>M(`sdk`)}):f===`data`?(0,Z.jsx)(De,{...k}):f===`schema`?(0,Z.jsx)(ve,{...k}):f===`functions`?(0,Z.jsx)(Oe,{...k}):f===`files`?(0,Z.jsx)(Te,{...k}):f===`schedules`?(0,Z.jsx)(Ee,{...k}):f===`auth`?(0,Z.jsx)(ke,{...k}):f===`logs`?(0,Z.jsx)(ye,{...k}):f===`settings`?(0,Z.jsx)(Ae,{...k,onDeleted:A}):(0,Z.jsx)(je,{...k})},`${i.id}/${c}/${f}`)}):m?null:(0,Z.jsxs)(`div`,{className:`p-4`,children:[(0,Z.jsx)(`h1`,{className:`page-title`,children:`Select a project`}),(0,Z.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Create a project to get started.`}),e?.role!==`viewer`&&(0,Z.jsxs)(g,{className:`mt-4`,onClick:O,children:[(0,Z.jsx)(j,{}),`New project`]})]})]})]}),x&&(0,Z.jsx)(d,{modal:x,onClose:()=>w(void 0)})]})}export{Ne as default,$ as sections};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./react-dom.DwX89IcG.js";import{S as n,_ as r,a as i,b as a,d as o,g as s,gt as c,h as l,ht as u,jt as d,l as f,n as p,p as m,s as h,u as g,v as _,x as v,y}from"./common.HrRZXwD9.js";import{n as b,r as x,t as S}from"./table-guide.DzBDP6fC.js";import{t as C}from"./refresh-cw.B0Cj85jJ.js";import{i as w,n as T,r as E,t as D}from"./input-group.3twGpQ77.js";import{t as O}from"./badge.DwKWvVfO.js";var k={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};k.node;var A=d(k),j=e(t(),1),M=c();function N(e,t){return e.filter(e=>e.name!==`_id`&&e.name!==`_creationTime`).map(e=>{let n=o({properties:{[e.name]:e.schema??{type:/INT|REAL/i.test(e.type)?`number`:`string`}},required:e.notnull?[e.name]:[]})[0];return{...n,defaultMode:!t&&e.dflt_value!==null,value:t?t[e.name]:n.value}})}function P(e){let t=s(e.project,e.env),n=g(t+`/schema`),[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),c=n.data?.tables??[],l=c.find(e=>e.name===r)?.name??c[0]?.name;return(0,M.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,M.jsxs)(`section`,{className:`explorer-sidebar overflow-y-auto`,"aria-label":`Application tables`,children:[(0,M.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`h1`,{className:`page-title`,children:`Data`}),(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[c.length,` tables`]})]}),(0,M.jsxs)(D,{children:[(0,M.jsx)(T,{children:(0,M.jsx)(w,{})}),(0,M.jsx)(E,{"aria-label":`Search tables`,placeholder:`Search tables…`,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsx)(S,{tables:c,env:e.env,role:e.session.role})]}),(0,M.jsx)(`div`,{className:`space-y-1 px-2`,children:c.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())).map(e=>(0,M.jsxs)(u,{variant:`ghost`,className:`w-full justify-start gap-2 ${l===e.name?`bg-accent`:``}`,onClick:()=>i(e.name),children:[(0,M.jsx)(x,{}),e.name]},e.name))}),(0,M.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`Tables are defined in code.`})]}),(0,M.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,M.jsx)(h,{...n}),l?(0,M.jsx)(F,{...e,table:l,tables:c},l):n.data?(0,M.jsx)(p,{title:`No application tables in this release`}):null]})]})}function F({project:e,env:t,session:o,table:c,tables:d}){let[x,w]=(0,j.useState)(void 0),[T,E]=(0,j.useState)(),D=s(e,t),k=g(D+`/data?table=`+encodeURIComponent(c)+(x===void 0?``:`&cursor=`+encodeURIComponent(x))),P=k.data,F=P?.columns.find(e=>e.pk===1)?.name,I=o.role!==`viewer`,L=(n,r)=>{if(!P)return;let i=n===`delete`?void 0:N(P.columns,r);E({title:n===`insert`?`Add row`:n===`update`?`Edit row`:`Delete row`,description:n===`delete`?`This deletes the selected row. The change is audited.`:`Primary keys are immutable. NULL and defaults are explicit. Changes are revision-checked and audited.`,fields:i,productionId:t===`prod`?e.id:void 0,submit:async e=>{await m(D+`/edit`,{operation:n,table:c,key:r&&F?r[F]:void 0,values:i?f(e,i):void 0,expectedRevision:P.revision,confirm:t===`prod`?new FormData(e).get(`confirm`):void 0}),k.refresh()}})};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`detail-header`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:c}),P&&(0,M.jsxs)(O,{variant:`secondary`,children:[P.rows.length,` rows`]})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reload snapshot`,title:`Reload snapshot`,disabled:k.loading,onClick:k.refresh,children:(0,M.jsx)(C,{})}),(0,M.jsx)(S,{tables:d,env:t,role:o.role,table:c}),I&&(0,M.jsxs)(u,{disabled:!P||k.loading,onClick:()=>L(`insert`),children:[(0,M.jsx)(b,{}),`Add row`]})]})]}),(0,M.jsxs)(`div`,{className:`flex justify-between border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,M.jsx)(`span`,{children:P?`${P.columns.length} columns · revision ${P.revision}`:`Loading table`}),(0,M.jsx)(`span`,{children:`Snapshot · updates after edits and when returning to this tab`})]}),(0,M.jsx)(h,{...k}),P&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,"aria-label":`Table rows`,role:`region`,tabIndex:0,children:[(0,M.jsxs)(r,{containerClassName:`overflow-visible`,children:[(0,M.jsx)(v,{className:`sticky top-0 z-10 bg-background`,children:(0,M.jsxs)(n,{children:[P.columns.map(e=>(0,M.jsxs)(a,{children:[(0,M.jsx)(`span`,{children:e.name}),(0,M.jsxs)(`small`,{className:`block font-normal text-muted-foreground`,children:[e.type.toLowerCase(),e.pk?` · primary`:``]})]},e.name)),I&&(0,M.jsx)(a,{children:`Actions`})]})}),(0,M.jsx)(_,{children:P.rows.map((e,t)=>(0,M.jsxs)(n,{children:[P.columns.map(t=>(0,M.jsx)(y,{className:`max-w-sm truncate font-mono`,title:l(e[t.name]),children:l(e[t.name])},t.name)),I&&(0,M.jsx)(y,{children:F?(0,M.jsxs)(`div`,{className:`flex gap-1`,children:[(0,M.jsx)(u,{size:`xs`,variant:`ghost`,onClick:()=>L(`update`,e),disabled:k.loading,children:`Edit`}),(0,M.jsx)(u,{size:`xs`,variant:`destructive`,onClick:()=>L(`delete`,e),disabled:k.loading,children:`Delete`})]}):`Read only`})]},F?String(e[F]):t))})]}),!P.rows.length&&(0,M.jsx)(p,{title:`No rows yet`,children:`Add a row or call a mutation from your app.`})]}),(0,M.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-4 border-t p-4`,children:[(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Up to 50 rows per page · changes are audited`}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsx)(u,{variant:`outline`,disabled:x===void 0||k.loading,onClick:()=>w(void 0),children:`First page`}),(0,M.jsxs)(u,{variant:`outline`,disabled:P.next===null||k.loading,onClick:()=>w(P.next??void 0),children:[`Next page`,(0,M.jsx)(A,{})]})]})]})]}),T&&(0,M.jsx)(i,{modal:T,onClose:()=>E(void 0)})]})}export{N as columnFields,P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gt as e,jt as t}from"./common.HrRZXwD9.js";import{t as n}from"./badge.DwKWvVfO.js";var r={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};r.node;var i=t(r),a=e(),o={query:`bg-yellow-100/50 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-200`,mutation:`bg-blue-100/50 text-blue-700 dark:bg-blue-900/50 dark:text-blue-200`,action:`bg-purple-100/50 text-purple-700 dark:bg-purple-900/50 dark:text-purple-200`};function s({kind:e}){return(0,a.jsx)(n,{variant:`secondary`,className:o[e],children:e})}export{i as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./react-dom.DwX89IcG.js";import{c as n,d as r,g as i,gt as a,ht as o,i as s,jt as c,l,m as u,n as d,p as f,r as p,s as m,u as h}from"./common.HrRZXwD9.js";import{n as g,t as _}from"./function-badge.MlTRYkqM.js";import{i as v,n as y,r as b,t as x}from"./input-group.3twGpQ77.js";import{i as S,n as C,r as w,t as T}from"./tabs.GRO5rCrK.js";import{t as E}from"./status-badge.BV1dzbX9.js";import{i as D,t as O}from"./client.BUUZgEFj.js";var k={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};k.node;var A=c(k),j={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};j.node;var M=c(j),N=e(t(),1),P=a();function F(e){let t=h(i(e.project,e.env)+`/functions`),[n,r]=(0,N.useState)(``),[a,s]=(0,N.useState)(``),c=Object.entries(t.data?.functions??{}),l=c.find(([e])=>e===a)??c[0],u=new Map;return c.filter(([e])=>e.toLowerCase().includes(n.toLowerCase())).forEach(e=>{let t=e[0].includes(`/`)?e[0].slice(0,e[0].lastIndexOf(`/`)):`Functions`,n=u.get(t)??[];n.push(e),u.set(t,n)}),(0,P.jsxs)(`div`,{className:`flex min-h-full`,children:[(0,P.jsxs)(`section`,{className:`explorer-sidebar`,"aria-label":`Deployed functions`,children:[(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Functions`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.length})]}),(0,P.jsxs)(x,{children:[(0,P.jsx)(y,{children:(0,P.jsx)(v,{})}),(0,P.jsx)(b,{"aria-label":`Search functions`,placeholder:`Search functions…`,value:n,onChange:e=>r(e.target.value)})]})]}),(0,P.jsx)(`div`,{className:`space-y-2 px-2`,children:[...u].map(([e,t])=>(0,P.jsxs)(`details`,{open:!0,children:[(0,P.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-2 py-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(A,{className:`size-4`}),e]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:t.map(([e,t])=>(0,P.jsxs)(o,{variant:`ghost`,onClick:()=>s(e),className:`w-full justify-between ${l?.[0]===e?`bg-accent`:``}`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()}),(0,P.jsx)(_,{kind:t.kind})]},e))})]},e))}),(0,P.jsxs)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:[`Active release · `,e.env]})]}),(0,P.jsxs)(`section`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(m,{...t}),l?(0,P.jsx)(L,{...e,path:l[0],fn:l[1]},l[0]+`:`+JSON.stringify(l[1])):t.data?(0,P.jsx)(d,{title:`No deployed functions`}):null]})]})}function I(e,t,n){return e===`dev`&&t!==`viewer`&&[`query`,`mutation`,`action`].includes(n)}function L({project:e,env:t,session:a,path:c,fn:m}){let h=r(m.input),v=I(t,a.role,m.kind)&&m.auth!==`internal`,[y,b]=(0,N.useState)(!1),[x,k]=(0,N.useState)(``),[A,j]=(0,N.useState)(),[F,L]=(0,N.useState)(!1),[R,z]=(0,N.useState)(),B=(0,N.useRef)(!0),V=(0,N.useRef)(void 0),H=(0,N.useRef)(void 0);return(0,N.useEffect)(()=>(B.current=!0,()=>{B.current=!1,H.current?.abort(),V.current?.dispose()}),[]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`detail-header`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,P.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:c}),(0,P.jsx)(_,{kind:m.kind}),(0,P.jsx)(E,{status:m.auth,children:m.auth===`required`?`Authentication required`:m.auth})]}),(0,P.jsxs)(o,{type:`submit`,form:`function-run`,disabled:!v||y,children:[(0,P.jsx)(M,{}),y?`Running…`:`Run Function`]})]}),(0,P.jsxs)(T,{defaultValue:`runner`,children:[(0,P.jsxs)(w,{variant:`line`,className:`mx-4 mt-4`,children:[(0,P.jsx)(S,{value:`runner`,children:`Function runner`}),(0,P.jsx)(S,{value:`contract`,children:`Contract`})]}),(0,P.jsx)(C,{value:`runner`,className:`mt-4`,children:(0,P.jsxs)(`div`,{className:`grid lg:grid-cols-2`,children:[(0,P.jsxs)(`section`,{className:`space-y-4 border-b p-4 lg:border-r lg:border-b-0`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Arguments`}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[h.length,` fields`]})]}),(0,P.jsx)(`form`,{id:`function-run`,onSubmit:async n=>{if(n.preventDefault(),!v||y||H.current)return;let r=new AbortController;H.current=r,b(!0),k(``),z(void 0),j(void 0),L(!1);try{let a=l(n.currentTarget,h),o=await f(i(e,t)+`/dev-token`,{},r.signal);if(!B.current||r.signal.aborted)return;V.current=O({url:o.url,getToken:()=>o.token});let s=performance.now(),u=await V.current[m.kind](D(c,m.kind),a);B.current&&!r.signal.aborted&&(j(u),L(!0),z(Math.round(performance.now()-s)))}catch(e){B.current&&!r.signal.aborted&&k(u(e))}finally{V.current?.dispose(),H.current===r&&(H.current=void 0),B.current&&b(!1)}},children:(0,P.jsx)(s,{items:h})}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Development execution only. Mutations and actions can change data. Live subscriptions use the SDK. Writes are not automatically retried. Internal functions are called only by server capabilities or scheduled jobs, not this HTTP runner.`})]}),(0,P.jsxs)(`section`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Result`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:y?`Running…`:x?`Failed`:R===void 0?`Not executed`:`Completed · ${R} ms round trip`})]}),x?(0,P.jsx)(p,{children:x}):F?(0,P.jsx)(n,{value:A}):(0,P.jsx)(d,{title:`Run this function to see its result`,children:(0,P.jsx)(g,{className:`mx-auto mt-3 size-7`})})]})]})}),(0,P.jsxs)(C,{value:`contract`,className:`space-y-4 p-4`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Input contract`}),(0,P.jsx)(n,{value:m.input})]}),(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Output contract`}),(0,P.jsx)(n,{value:m.output})]})]})]})]})}export{I as canRun,F as default};
|
|
Binary file
|