kaizen-agent 1.88.0 → 1.88.2
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/cli/activity.ts +2 -1
- package/cli/web.ts +6 -2
- package/cli/whats-new.json +12 -0
- package/package.json +1 -1
- package/web/dist/annotate.js +1 -1
- package/web/dist/board.css +1 -1
- package/web/dist/board.js +3 -3
- package/web/dist/boot.js +1 -1
- package/web/dist/notebook.css +1 -1
- package/web/dist/notebook.js +1 -1
- package/web/dist/popup.css +1 -1
- package/web/dist/popup.js +1 -1
- package/web/dist/term.js +1 -1
- package/web/dist/ui.css +1 -1
- package/web/dist/video.js +1 -1
- package/web/lib/settings/settings-actions.ts +4 -4
- package/web/lib/settings/settings.ts +1 -1
package/web/dist/board.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* kaizen board
|
|
1
|
+
/* kaizen board 06395d5fcc01b3fe -- generated by bun run build:web from web/pages/board/main.ts; do not edit */
|
|
2
2
|
(()=>{var eZ=Object.create;var{getPrototypeOf:tZ,defineProperty:FD,getOwnPropertyNames:nZ}=Object;var VD=Object.prototype.hasOwnProperty;function oZ(e){return this[e]}var rZ,aZ,h=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?rZ??=new WeakMap:aZ??=new WeakMap,a=r.get(e);if(a)return a}n=e!=null?eZ(tZ(e)):{};let i=t||!e||!e.__esModule||!VD.call(e,"default")?FD(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let s of nZ(e))if(!VD.call(i,s))FD(i,s,{get:oZ.bind(e,s),enumerable:!0})}if(o)r.set(e,i);return i};var zs=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ft=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var o4=zs(function(qe){var AC=Symbol.for("react.transitional.element"),iZ=Symbol.for("react.portal"),sZ=Symbol.for("react.fragment"),lZ=Symbol.for("react.strict_mode"),cZ=Symbol.for("react.profiler"),uZ=Symbol.for("react.consumer"),dZ=Symbol.for("react.context"),pZ=Symbol.for("react.forward_ref"),fZ=Symbol.for("react.suspense"),mZ=Symbol.for("react.memo"),WD=Symbol.for("react.lazy"),gZ=Symbol.for("react.activity"),hZ=Symbol.for("react.view_transition"),KD=Symbol.iterator;function bZ(e){if(e===null||typeof e!=="object")return null;return e=KD&&e[KD]||e["@@iterator"],typeof e==="function"?e:null}var XD={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},QD=Object.assign,ZD={};function Kf(e,t,n){this.props=e,this.context=t,this.refs=ZD,this.updater=n||XD}Kf.prototype.isReactComponent={};Kf.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Kf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JD(){}JD.prototype=Kf.prototype;function MC(e,t,n){this.props=e,this.context=t,this.refs=ZD,this.updater=n||XD}var DC=MC.prototype=new JD;DC.constructor=MC;QD(DC,Kf.prototype);DC.isPureReactComponent=!0;var qD=Array.isArray;function EC(){}var bn={H:null,A:null,T:null,S:null},e4=Object.prototype.hasOwnProperty;function PC(e,t,n){var o=n.ref;return{$$typeof:AC,type:e,key:t,ref:o!==void 0?o:null,props:n}}function vZ(e,t){return PC(e.type,t,e.props)}function OC(e){return typeof e==="object"&&e!==null&&e.$$typeof===AC}function xZ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $D=/\/+/g;function TC(e,t){return typeof e==="object"&&e!==null&&e.key!=null?xZ(""+e.key):t.toString(36)}function yZ(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status==="string"?e.then(EC,EC):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Vf(e,t,n,o,r){var a=typeof e;if(a==="undefined"||a==="boolean")e=null;var i=!1;if(e===null)i=!0;else switch(a){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case AC:case iZ:i=!0;break;case WD:return i=e._init,Vf(i(e._payload),t,n,o,r)}}if(i)return r=r(e),i=o===""?"."+TC(e,0):o,qD(r)?(n="",i!=null&&(n=i.replace($D,"$&/")+"/"),Vf(r,t,n,"",function(c){return c})):r!=null&&(OC(r)&&(r=vZ(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace($D,"$&/")+"/")+i)),t.push(r)),1;i=0;var s=o===""?".":o+":";if(qD(e))for(var l=0;l<e.length;l++)o=e[l],a=s+TC(o,l),i+=Vf(o,t,n,a,r);else if(l=bZ(e),typeof l==="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,a=s+TC(o,l++),i+=Vf(o,t,n,a,r);else if(a==="object"){if(typeof e.then==="function")return Vf(yZ(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function zx(e,t,n){if(e==null)return e;var o=[],r=0;return Vf(e,o,"","",function(a){return t.call(n,a,r++)}),o}function wZ(e){if(e._status===-1){var t=e._result,n=t();n.then(function(o){if(e._status===0||e._status===-1)e._status=1,e._result=o,n.status===void 0&&(n.status="fulfilled",n.value=o)},function(o){if(e._status===0||e._status===-1)e._status=2,e._result=o,n.status===void 0&&(n.status="rejected",n.reason=o)}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var YD=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)};function t4(e){var t=bn.T,n={};n.types=t!==null?t.types:null,bn.T=n;try{var o=e(),r=bn.S;r!==null&&r(n,o),typeof o==="object"&&o!==null&&typeof o.then==="function"&&o.then(EC,YD)}catch(a){YD(a)}finally{t!==null&&n.types!==null&&(t.types=n.types),bn.T=t}}function n4(e){var t=bn.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else t4(n4.bind(null,e))}var kZ={map:zx,forEach:function(e,t,n){zx(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zx(e,function(){t++}),t},toArray:function(e){return zx(e,function(t){return t})||[]},only:function(e){if(!OC(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};qe.Activity=gZ;qe.Children=kZ;qe.Component=Kf;qe.Fragment=sZ;qe.Profiler=cZ;qe.PureComponent=MC;qe.StrictMode=lZ;qe.Suspense=fZ;qe.ViewTransition=hZ;qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=bn;qe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return bn.H.useMemoCache(e)}};qe.addTransitionType=n4;qe.cache=function(e){return function(){return e.apply(null,arguments)}};qe.cacheSignal=function(){return null};qe.cloneElement=function(e,t,n){if(e===null||e===void 0)throw Error("The argument must be a React element, but you passed "+e+".");var o=QD({},e.props),r=e.key;if(t!=null)for(a in t.key!==void 0&&(r=""+t.key),t)!e4.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(o[a]=t[a]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var i=Array(a),s=0;s<a;s++)i[s]=arguments[s+2];o.children=i}return PC(e.type,r,o)};qe.createContext=function(e){return e={$$typeof:dZ,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:uZ,_context:e},e};qe.createElement=function(e,t,n){var o,r={},a=null;if(t!=null)for(o in t.key!==void 0&&(a=""+t.key),t)e4.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in i=e.defaultProps,i)r[o]===void 0&&(r[o]=i[o]);return PC(e,a,r)};qe.createRef=function(){return{current:null}};qe.forwardRef=function(e){return{$$typeof:pZ,render:e}};qe.isValidElement=OC;qe.lazy=function(e){return{$$typeof:WD,_payload:{_status:-1,_result:e},_init:wZ}};qe.memo=function(e,t){return{$$typeof:mZ,type:e,compare:t===void 0?null:t}};qe.startTransition=t4;qe.unstable_useCacheRefresh=function(){return bn.H.useCacheRefresh()};qe.use=function(e){return bn.H.use(e)};qe.useActionState=function(e,t,n){return bn.H.useActionState(e,t,n)};qe.useCallback=function(e,t){return bn.H.useCallback(e,t)};qe.useContext=function(e){return bn.H.useContext(e)};qe.useDebugValue=function(){};qe.useDeferredValue=function(e,t){return bn.H.useDeferredValue(e,t)};qe.useEffect=function(e,t){return bn.H.useEffect(e,t)};qe.useEffectEvent=function(e){return bn.H.useEffectEvent(e)};qe.useId=function(){return bn.H.useId()};qe.useImperativeHandle=function(e,t,n){return bn.H.useImperativeHandle(e,t,n)};qe.useInsertionEffect=function(e,t){return bn.H.useInsertionEffect(e,t)};qe.useLayoutEffect=function(e,t){return bn.H.useLayoutEffect(e,t)};qe.useMemo=function(e,t){return bn.H.useMemo(e,t)};qe.useOptimistic=function(e,t){return bn.H.useOptimistic(e,t)};qe.useReducer=function(e,t,n){return bn.H.useReducer(e,t,n)};qe.useRef=function(e){return bn.H.useRef(e)};qe.useState=function(e){return bn.H.useState(e)};qe.useSyncExternalStore=function(e,t,n){return bn.H.useSyncExternalStore(e,t,n)};qe.useTransition=function(){return bn.H.useTransition()};qe.version="19.3.1"});var I=zs(function(SZ,r4){r4.exports=o4()});var s4=zs(function(Ur){var CZ=I();function i4(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function $c(){}var oa={d:{f:$c,r:function(){throw Error(i4(522))},D:$c,C:$c,L:$c,m:$c,X:$c,S:$c,M:$c},p:0,findDOMNode:null},NZ=Symbol.for("react.portal"),RZ=Symbol.for("react.recoverable"),a4=Symbol.for("react.optimistic_key");function TZ(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:NZ,key:o==null?null:o===a4?a4:""+o,children:e,containerInfo:t,implementation:n}}var Nh=CZ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lx(e,t){if(e==="font")return"";if(typeof t==="string")return t==="use-credentials"?t:""}Ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=oa;Ur.browser=function(e){return{$$typeof:RZ,_reason:e}};Ur.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(i4(299));return TZ(e,t,null,n)};Ur.flushSync=function(e){var t=Nh.T,n=oa.p;try{if(Nh.T=null,oa.p=2,e)return e()}finally{Nh.T=t,oa.p=n,oa.d.f()}};Ur.preconnect=function(e,t){typeof e==="string"&&(t?(t=t.crossOrigin,t=typeof t==="string"?t==="use-credentials"?t:"":void 0):t=null,oa.d.C(e,t))};Ur.prefetchDNS=function(e){typeof e==="string"&&oa.d.D(e)};Ur.preinit=function(e,t){if(typeof e==="string"&&t&&typeof t.as==="string"){var n=t.as,o=Lx(n,t.crossOrigin),r=typeof t.integrity==="string"?t.integrity:void 0,a=typeof t.fetchPriority==="string"?t.fetchPriority:void 0;n==="style"?oa.d.S(e,typeof t.precedence==="string"?t.precedence:void 0,{crossOrigin:o,integrity:r,fetchPriority:a}):n==="script"&&oa.d.X(e,{crossOrigin:o,integrity:r,fetchPriority:a,nonce:typeof t.nonce==="string"?t.nonce:void 0})}};Ur.preinitModule=function(e,t){if(typeof e==="string")if(typeof t==="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Lx(t.as,t.crossOrigin);oa.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0})}}else t==null&&oa.d.M(e)};Ur.preload=function(e,t){if(typeof e==="string"&&typeof t==="object"&&t!==null&&typeof t.as==="string"){var n=t.as,o=Lx(n,t.crossOrigin);oa.d.L(e,n,{crossOrigin:o,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,type:typeof t.type==="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==="string"?t.imageSizes:void 0,media:typeof t.media==="string"?t.media:void 0})}};Ur.preloadModule=function(e,t){if(typeof e==="string")if(t){var n=Lx(t.as,t.crossOrigin);oa.d.m(e,{as:typeof t.as==="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==="string"?t.integrity:void 0,nonce:typeof t.nonce==="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==="string"?t.fetchPriority:void 0})}else oa.d.m(e)};Ur.requestFormReset=function(e){oa.d.r(e)};Ur.unstable_batchedUpdates=function(e,t){return e(t)};Ur.useFormState=function(e,t,n){return Nh.H.useFormState(e,t,n)};Ur.useFormStatus=function(){return Nh.H.useHostTransitionStatus()};Ur.version="19.3.1"});var fi=zs(function(EZ,c4){function l4(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l4)}catch(e){console.error(e)}}l4(),c4.exports=s4()});var h4=zs(function(On){function IC(e,t){var n=e.length;e.push(t);e:for(;0<n;){var o=n-1>>>1,r=e[o];if(0<Bx(r,t))e[o]=t,e[n]=r,n=o;else break e}}function Ls(e){return e.length===0?null:e[0]}function Gx(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var o=0,r=e.length,a=r>>>1;o<a;){var i=2*(o+1)-1,s=e[i],l=i+1,c=e[l];if(0>Bx(s,n))l<r&&0>Bx(c,s)?(e[o]=c,e[l]=n,o=l):(e[o]=s,e[i]=n,o=i);else if(l<r&&0>Bx(c,n))e[o]=c,e[l]=n,o=l;else break e}}return t}function Bx(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}On.unstable_now=void 0;if(typeof performance==="object"&&typeof performance.now==="function")zC=performance,On.unstable_now=function(){return zC.now()};else Hx=Date,LC=Hx.now(),On.unstable_now=function(){return Hx.now()-LC};var zC,Hx,LC,_l=[],Yc=[],AZ=1,mi=null,Gr=3,BC=!1,Rh=!1,Th=!1,jC=!1,d4=typeof setTimeout==="function"?setTimeout:null,p4=typeof clearTimeout==="function"?clearTimeout:null,u4=typeof setImmediate<"u"?setImmediate:null;function jx(e){for(var t=Ls(Yc);t!==null;){if(t.callback===null)Gx(Yc);else if(t.startTime<=e)Gx(Yc),t.sortIndex=t.expirationTime,IC(_l,t);else break;t=Ls(Yc)}}function UC(e){if(Th=!1,jx(e),!Rh)if(Ls(_l)!==null)Rh=!0,$f||($f=!0,qf());else{var t=Ls(Yc);t!==null&&GC(UC,t.startTime-e)}}var $f=!1,Eh=-1,f4=5,m4=-1;function g4(){return jC?!0:On.unstable_now()-m4<f4?!1:!0}function _C(){if(jC=!1,$f){var e=On.unstable_now();m4=e;var t=!0;try{e:{Rh=!1,Th&&(Th=!1,p4(Eh),Eh=-1),BC=!0;var n=Gr;try{t:{jx(e);for(mi=Ls(_l);mi!==null&&!(mi.expirationTime>e&&g4());){var o=mi.callback;if(typeof o==="function"){mi.callback=null,Gr=mi.priorityLevel;var r=o(mi.expirationTime<=e);if(e=On.unstable_now(),typeof r==="function"){mi.callback=r,jx(e),t=!0;break t}mi===Ls(_l)&&Gx(_l),jx(e)}else Gx(_l);mi=Ls(_l)}if(mi!==null)t=!0;else{var a=Ls(Yc);a!==null&&GC(UC,a.startTime-e),t=!1}}break e}finally{mi=null,Gr=n,BC=!1}t=void 0}}finally{t?qf():$f=!1}}}var qf;if(typeof u4==="function")qf=function(){u4(_C)};else if(typeof MessageChannel<"u")Ux=new MessageChannel,HC=Ux.port2,Ux.port1.onmessage=_C,qf=function(){HC.postMessage(null)};else qf=function(){d4(_C,0)};var Ux,HC;function GC(e,t){Eh=d4(function(){e(On.unstable_now())},t)}On.unstable_IdlePriority=5;On.unstable_ImmediatePriority=1;On.unstable_LowPriority=4;On.unstable_NormalPriority=3;On.unstable_Profiling=null;On.unstable_UserBlockingPriority=2;On.unstable_cancelCallback=function(e){e.callback=null};On.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):f4=0<e?Math.floor(1000/e):5};On.unstable_getCurrentPriorityLevel=function(){return Gr};On.unstable_next=function(e){switch(Gr){case 1:case 2:case 3:var t=3;break;default:t=Gr}var n=Gr;Gr=t;try{return e()}finally{Gr=n}};On.unstable_requestPaint=function(){jC=!0};On.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Gr;Gr=e;try{return t()}finally{Gr=n}};On.unstable_scheduleCallback=function(e,t,n){var o=On.unstable_now();switch(typeof n==="object"&&n!==null?(n=n.delay,n=typeof n==="number"&&0<n?o+n:o):n=o,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5000}return r=n+r,e={id:AZ++,callback:t,priorityLevel:e,startTime:n,expirationTime:r,sortIndex:-1},n>o?(e.sortIndex=n,IC(Yc,e),Ls(_l)===null&&e===Ls(Yc)&&(Th?(p4(Eh),Eh=-1):Th=!0,GC(UC,n-o))):(e.sortIndex=r,IC(_l,e),Rh||BC||(Rh=!0,$f||($f=!0,qf()))),e};On.unstable_shouldYield=g4;On.unstable_wrapCallback=function(e){var t=Gr;return function(){var n=Gr;Gr=t;try{return e.apply(this,arguments)}finally{Gr=n}}}});var v4=zs(function(MZ,b4){b4.exports=h4()});var n6=zs(function(yw){var Oo=v4(),t3=I(),DZ=fi();function j(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n3(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vb(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function o3(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function r3(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x4(e){if(vb(e)!==e)throw Error(j(188))}function PZ(e){var t=e.alternate;if(!t){if(t=vb(e),t===null)throw Error(j(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return x4(r),e;if(a===o)return x4(r),t;a=a.sibling}throw Error(j(188))}if(n.return!==o.return)n=r,o=a;else{for(var i=!1,s=r.child;s;){if(s===n){i=!0,n=r,o=a;break}if(s===o){i=!0,o=r,n=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===n){i=!0,n=a,o=r;break}if(s===o){i=!0,o=a,n=r;break}s=s.sibling}if(!i)throw Error(j(189))}}if(n.alternate!==o)throw Error(j(190))}if(n.tag!==3)throw Error(j(188));return n.stateNode.current===n?e:t}function a3(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=a3(e),t!==null)return t;e=e.sibling}return null}function Sa(e,t,n,o,r,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,o,r,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Sa(e.child,t,n,o,r,a))return!0;e=e.sibling}return!1}function ap(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function y4(e){var t=!1;for(e=e.return;e!==null;){if(e.tag===4&&(t=!0),e.tag===3||e.tag===5||e.tag===27)break;e=e.return}return t}function i3(e){var t=[null,null],n=ap(e);if(n===null)return t;return s3(t,e,n.child,{foundSelf:!1}),t}function s3(e,t,n,o){for(;n!==null;){if(n===t)o.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(o.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&s3(e,t,n.child,o))return!0;n=n.sibling}return!1}function Po(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(j(559))}}var em=null,xN=null;function OZ(e,t,n){return e===n?!0:e===t?(em=e,!0):!1}function _Z(e,t,n){return e===n?(xN=e,!1):e===t?(xN!==null&&(em=e),!0):!1}function w4(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e?e:null}function yN(e,t,n){for(var o=0,r=e;r;r=n(r))o++;r=0;for(var a=t;a;a=n(a))r++;for(;0<o-r;)e=n(e),o--;for(;0<r-o;)t=n(t),r--;for(;o--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var un=Object.assign,IZ=Symbol.for("react.element"),Fx=Symbol.for("react.transitional.element"),_h=Symbol.for("react.portal"),tm=Symbol.for("react.fragment"),l3=Symbol.for("react.strict_mode"),wN=Symbol.for("react.profiler"),c3=Symbol.for("react.consumer"),Fs=Symbol.for("react.context"),P2=Symbol.for("react.forward_ref"),kN=Symbol.for("react.suspense"),SN=Symbol.for("react.suspense_list"),O2=Symbol.for("react.memo"),Zc=Symbol.for("react.lazy"),CN=Symbol.for("react.activity"),zZ=Symbol.for("react.legacy_hidden"),LZ=Symbol.for("react.memo_cache_sentinel"),NN=Symbol.for("react.view_transition"),BZ=Symbol.for("react.recoverable"),k4=Symbol.iterator;function Ah(e){if(e===null||typeof e!=="object")return null;return e=k4&&e[k4]||e["@@iterator"],typeof e==="function"?e:null}var HZ=Symbol.for("react.client.reference");function RN(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===HZ?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case tm:return"Fragment";case wN:return"Profiler";case l3:return"StrictMode";case kN:return"Suspense";case SN:return"SuspenseList";case CN:return"Activity";case NN:return"ViewTransition"}if(typeof e==="object")switch(e.$$typeof){case _h:return"Portal";case Fs:return e.displayName||"Context";case c3:return(e._context.displayName||"Context")+".Consumer";case P2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O2:return t=e.displayName||null,t!==null?t:RN(e.type)||"Memo";case Zc:t=e._payload,e=e._init;try{return RN(e(t))}catch(n){}}return null}var Ih=Array.isArray,Ue=t3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ot=DZ.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qd={pending:!1,data:null,method:null,action:null},TN=[],nm=-1;function Xs(e){return{current:e}}function Cr(e){0>nm||(e.current=TN[nm],TN[nm]=null,nm--)}function yn(e,t){nm++,TN[nm]=e.current,e.current=t}var $s=Xs(null),nb=Xs(null),su=Xs(null),Ry=Xs(null);function Ty(e,t){switch(yn(su,t),yn(nb,e),yn($s,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?_P(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_P(t),e=D_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Cr($s),yn($s,e)}function km(){Cr($s),Cr(nb),Cr(su)}function EN(e){var t=e.memoizedState;t!==null&&(Pm._currentValue=t.memoizedState,yn(Ry,e)),t=$s.current;var n=D_(t,e.type);t!==n&&(yn(nb,e),yn($s,n))}function Ey(e){nb.current===e&&(Cr($s),Cr(nb)),Ry.current===e&&(Cr(Ry),Pm._currentValue=qd)}var FC,S4;function Xc(e){if(FC===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);FC=t&&t[1]||"",S4=-1<n.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+FC+e+S4}var VC=!1;function KC(e,t){if(!e||VC)return"";VC=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(g){var p=g}Reflect.construct(e,[],u)}else{try{u.call()}catch(g){p=g}u=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),u=!0,new e}finally{u&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(g){p=g}(u=e())&&typeof u.catch==="function"&&u.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack==="string")return[g.stack,p.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=o.DetermineComponentFrameRoot(),i=a[0],s=a[1];if(i&&s){var l=i.split(`
|
|
@@ -85,14 +85,14 @@ ${t.body}`).join(`
|
|
|
85
85
|
`)},x9=function(){var e=parseInt(document.body.getAttribute(xg)||"0",10);return isFinite(e)?e:0},kae=function(){yg.useEffect(function(){return document.body.setAttribute(xg,(x9()+1).toString()),function(){var e=x9()-1;if(e<=0)document.body.removeAttribute(xg);else document.body.setAttribute(xg,e.toString())}},[])},QE=function(e){var{noRelative:t,noImportant:n,gapMode:o}=e,r=o===void 0?"margin":o;kae();var a=yg.useMemo(function(){return XE(r)},[r]);return yg.createElement(yae,{styles:wae(a,!t,r,!n?"!important":"")})};var ZE=!1;if(typeof window<"u")try{wg=Object.defineProperty({},"passive",{get:function(){return ZE=!0,!0}}),window.addEventListener("test",wg,wg),window.removeEventListener("test",wg,wg)}catch(e){ZE=!1}var wg,_p=ZE?{passive:!1}:!1;var Sae=function(e){return e.tagName==="TEXTAREA"},y9=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Sae(e)&&n[t]==="visible")},Cae=function(e){return y9(e,"overflowY")},Nae=function(e){return y9(e,"overflowX")},JE=function(e,t){var n=t.ownerDocument,o=t;do{if(typeof ShadowRoot<"u"&&o instanceof ShadowRoot)o=o.host;var r=w9(e,o);if(r){var a=k9(e,o),i=a[1],s=a[2];if(i>s)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Rae=function(e){var{scrollTop:t,scrollHeight:n,clientHeight:o}=e;return[t,n,o]},Tae=function(e){var{scrollLeft:t,scrollWidth:n,clientWidth:o}=e;return[t,n,o]},w9=function(e,t){return e==="v"?Cae(t):Nae(t)},k9=function(e,t){return e==="v"?Rae(t):Tae(t)},Eae=function(e,t){return e==="h"&&t==="rtl"?-1:1},S9=function(e,t,n,o,r){var a=Eae(e,window.getComputedStyle(t).direction),i=a*o,s=n.target,l=t.contains(s),c=!1,d=i>0,u=0,p=0;do{if(!s)break;var f=k9(e,s),g=f[0],m=f[1],x=f[2],v=m-x-a*g;if(g||v){if(w9(e,s))u+=v,p+=g}var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));if(d&&(r&&Math.abs(u)<1||!r&&i>u))c=!0;else if(!d&&(r&&Math.abs(p)<1||!r&&-i>p))c=!0;return c};var x1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},C9=function(e){return[e.deltaX,e.deltaY]},N9=function(e){return e&&"current"in e?e.current:e},Aae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mae=function(e){return`
|
|
86
86
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
87
87
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
88
|
-
`)},Dae=0,kg=[];function R9(e){var t=En.useRef([]),n=En.useRef([0,0]),o=En.useRef(),r=En.useState(Dae++)[0],a=En.useState(wv)[0],i=En.useRef(e);En.useEffect(function(){i.current=e},[e]),En.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=c9([e.lockRef.current],(e.shards||[]).map(N9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var s=En.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var v=x1(m),y=n.current,b="deltaX"in m?m.deltaX:y[0]-v[0],k="deltaY"in m?m.deltaY:y[1]-v[1],S,C=m.target,R=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in m&&R==="h"&&C.type==="range")return!1;var M=window.getSelection(),D=M&&M.anchorNode,E=D?D===C||D.contains(C):!1;if(E)return!1;var z=JE(R,C);if(!z)return!0;if(z)S=R;else S=R==="v"?"h":"v",z=JE(R,C);if(!z)return!1;if(!o.current&&"changedTouches"in m&&(b||k))o.current=S;if(!S)return!0;var L=o.current||S;return S9(L,x,m,L==="h"?b:k,!0)},[]),l=En.useCallback(function(m){var x=m;if(!kg.length||kg[kg.length-1]!==a)return;var v="deltaY"in x?C9(x):x1(x),y=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&Aae(S.delta,v)})[0];if(y&&y.should){if(x.cancelable)x.preventDefault();return}if(!y){var b=(i.current.shards||[]).map(N9).filter(Boolean).filter(function(S){return S.contains(x.target)}),k=b.length>0?s(x,b[0]):!i.current.noIsolation;if(k){if(x.cancelable)x.preventDefault()}}},[]),c=En.useCallback(function(m,x,v,y){var b={name:m,delta:x,target:v,should:y,shadowParent:Pae(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(k){return k!==b})},1)},[]),d=En.useCallback(function(m){n.current=x1(m),o.current=void 0},[]),u=En.useCallback(function(m){c(m.type,C9(m),m.target,s(m,e.lockRef.current))},[]),p=En.useCallback(function(m){c(m.type,x1(m),m.target,s(m,e.lockRef.current))},[]);En.useEffect(function(){return kg.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,_p),document.addEventListener("touchmove",l,_p),document.addEventListener("touchstart",d,_p),function(){kg=kg.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,_p),document.removeEventListener("touchmove",l,_p),document.removeEventListener("touchstart",d,_p)}},[]);var{removeScrollBar:f,inert:g}=e;return En.createElement(En.Fragment,null,g?En.createElement(a,{styles:Mae(r)}):null,f?En.createElement(QE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pae(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var T9=KE(v1,R9);var E9=y1.forwardRef(function(e,t){return y1.createElement(yv,Ra({},e,{ref:t,sideCar:T9}))});E9.classNames=yv.classNames;var lc=E9;var Oae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Sg=new WeakMap,w1=new WeakMap,k1={},eA=0,A9=function(e){return e&&(e.host||A9(e.parentNode))},_ae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=A9(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},Iae=function(e,t,n,o){var r=_ae(t,Array.isArray(e)?e:[e]);if(!k1[n])k1[n]=new WeakMap;var a=k1[n],i=[],s=new Set,l=new Set(r),c=function(u){if(!u||s.has(u))return;s.add(u),c(u.parentNode)};r.forEach(c);var d=function(u){if(!u||l.has(u))return;Array.prototype.forEach.call(u.children,function(p){if(s.has(p))d(p);else try{var f=p.getAttribute(o),g=f!==null&&f!=="false",m=(Sg.get(p)||0)+1,x=(a.get(p)||0)+1;if(Sg.set(p,m),a.set(p,x),i.push(p),m===1&&g)w1.set(p,!0);if(x===1)p.setAttribute(n,"true");if(!g)p.setAttribute(o,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return d(t),s.clear(),eA++,function(){if(i.forEach(function(u){var p=Sg.get(u)-1,f=a.get(u)-1;if(Sg.set(u,p),a.set(u,f),!p){if(!w1.has(u))u.removeAttribute(o);w1.delete(u)}if(!f)u.removeAttribute(n)}),eA--,!eA)Sg=new WeakMap,Sg=new WeakMap,w1=new WeakMap,k1={}}},qu=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||Oae(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Iae(o,r,n,"aria-hidden")};var po=h(w(),1),zae=Object.defineProperty,Ta=(e,t)=>zae(e,"name",{value:t,configurable:!0}),nA="Dialog",[M9,oA]=en(nA),[Lae,fs]=M9(nA),Cg=Ta((e)=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,s=sn.useRef(null),l=sn.useRef(null),{nodes:c,registry:d}=Mp(),[u,p]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:nA}),[f,g]=sn.useState(0),[m,x]=sn.useState(0);return po.jsx(Lae,{scope:t,triggerRef:s,contentRef:l,contentId:rn(),titleId:rn(),descriptionId:rn(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:g,setDescriptionCount:x,open:u,onOpenChange:p,onOpenToggle:sn.useCallback(()=>p((v)=>!v),[p]),modal:i,branchNodes:c,branchRegistry:d,children:n})},"Dialog"),Bae="DialogTrigger",S1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(Bae,o),i=Ce(n,a.triggerRef);return po.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":R1(a.open),...r,ref:i,onClick:te(t.onClick,a.onOpenToggle)})},"DialogTrigger")),D9="DialogPortal",[Hae,P9]=M9(D9,{forceMount:void 0}),Ip=Ta((e)=>{let{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=fs(D9,t);return po.jsx(Hae,{scope:t,forceMount:n,children:sn.Children.map(o,(i)=>po.jsx(Pr,{present:n||a.open,children:po.jsx(cl,{asChild:!0,container:r,children:i})}))})},"DialogPortal"),tA="DialogOverlay",zp=sn.forwardRef(Ta(function(t,n){let o=P9(tA,t.__scopeDialog),{forceMount:r=o.forceMount,...a}=t,i=fs(tA,t.__scopeDialog);return i.modal?po.jsx(Pr,{present:r||i.open,children:po.jsx(Uae,{...a,ref:n})}):null},"DialogOverlay")),jae=lr("DialogOverlay.RemoveScroll"),Uae=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(tA,o),i=ME(),s=Ce(n,i);return po.jsx(lc,{as:jae,allowPinchZoom:!0,shards:sn.useMemo(()=>[a.contentRef,...a.branchNodes.map((l)=>({current:l}))],[a.contentRef,a.branchNodes]),children:po.jsx(be.div,{"data-state":R1(a.open),...r,ref:s,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),kv="DialogContent",Lp=sn.forwardRef(Ta(function(t,n){let o=P9(kv,t.__scopeDialog),{forceMount:r=o.forceMount,...a}=t,i=fs(kv,t.__scopeDialog);return po.jsx(Pr,{present:r||i.open,children:i.modal?po.jsx(Gae,{...a,ref:n}):po.jsx(Fae,{...a,ref:n})})},"DialogContent")),Gae=sn.forwardRef(Ta(function(t,n){let o=fs(kv,t.__scopeDialog),r=sn.useRef(null),a=Ce(n,o.contentRef,r);return sn.useEffect(()=>{let i=r.current;if(i)return qu(i)},[]),po.jsx(O9,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:te(t.onCloseAutoFocus,(i)=>{i.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:te(t.onPointerDownOutside,(i)=>{let s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;if(s.button===2||l)i.preventDefault()}),onFocusOutside:te(t.onFocusOutside,(i)=>i.preventDefault())})},"DialogContentModal")),Fae=sn.forwardRef(Ta(function(t,n){let o=fs(kv,t.__scopeDialog),r=sn.useRef(!1),a=sn.useRef(!1);return po.jsx(O9,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(i)=>{if(t.onCloseAutoFocus?.(i),!i.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();i.preventDefault()}r.current=!1,a.current=!1},onInteractOutside:(i)=>{if(t.onInteractOutside?.(i),!i.defaultPrevented){if(r.current=!0,i.detail.originalEvent.type==="pointerdown")a.current=!0}let s=i.target;if(o.triggerRef.current?.contains(s))i.preventDefault();if(i.detail.originalEvent.type==="focusin"&&a.current)i.preventDefault()}})},"DialogContentNonModal")),O9=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,"aria-describedby":s,children:l,...c}=t,d=fs(kv,o);return ul(),po.jsx(Ap,{registry:d.branchRegistry,children:po.jsx(Ku,{asChild:!0,loop:!0,trapped:r,branches:d.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:i,children:po.jsx(ll,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?_9(s,d.descriptionId):s,"data-state":R1(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:l})})})},"DialogContentImpl")),C1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs("DialogTitle",o),{setTitleCount:i}=a;return wt(()=>(i((s)=>s+1),()=>i((s)=>s-1)),[i]),po.jsx(be.h2,{id:a.titleId,...r,ref:n})},"DialogTitle")),N1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs("DialogDescription",o),{setDescriptionCount:i}=a;return wt(()=>(i((s)=>s+1),()=>i((s)=>s-1)),[i]),po.jsx(be.p,{id:a.descriptionId,...r,ref:n})},"DialogDescription")),Vae="DialogClose",Sv=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(Vae,o);return po.jsx(be.button,{type:"button",...r,ref:n,onClick:te(t.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function _9(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}Ta(_9,"concatAriaDescribedby");function R1(e){return e?"open":"closed"}Ta(R1,"getState");var gs=h(w(),1),Kae=Object.defineProperty,cc=(e,t)=>Kae(e,"name",{value:t,configurable:!0}),qae="AlertDialog",[$ae,Nke]=en(qae,[oA]),uc=oA(),Yae=cc((e)=>{let{__scopeAlertDialog:t,...n}=e,o=uc(t);return gs.jsx(Cg,{...o,...n,modal:!0})},"AlertDialog"),Rke=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(S1,{...a,...r,ref:n})},"AlertDialogTrigger")),Wae=cc((e)=>{let{__scopeAlertDialog:t,...n}=e,o=uc(t);return gs.jsx(Ip,{...o,...n})},"AlertDialogPortal"),Xae=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(zp,{...a,...r,ref:n})},"AlertDialogOverlay")),Qae="AlertDialogContent",[Zae,Jae]=$ae(Qae),eie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,children:r,...a}=t,i=uc(o),s=ms.useRef(null),l=Ce(n,s),c=ms.useRef(null);return gs.jsx(Zae,{scope:o,cancelRef:c,children:gs.jsx(Lp,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:te(a.onOpenAutoFocus,(d)=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:(d)=>d.preventDefault(),onInteractOutside:(d)=>d.preventDefault(),children:r})})},"AlertDialogContent")),tie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(C1,{...a,...r,ref:n})},"AlertDialogTitle")),nie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(N1,{...a,...r,ref:n})},"AlertDialogDescription")),oie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(Sv,{...a,...r,ref:n})},"AlertDialogAction")),rie="AlertDialogCancel",aie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,{cancelRef:a}=Jae(rie,o),i=uc(o),s=Ce(n,a);return gs.jsx(Sv,{...i,...r,ref:s})},"AlertDialogCancel"));var Bo=h(I(),1);var z9=h(I(),1);var iie=Object.defineProperty,sie=(e,t)=>iie(e,"name",{value:t,configurable:!0});function Bp(e){let[t,n]=z9.useState(void 0);return wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((a)=>{if(!Array.isArray(a))return;if(!a.length)return;let i=a[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let s,l;if("borderBoxSize"in i){let c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}sie(Bp,"useSize");var ti=h(w(),1),lie=Object.defineProperty,dc=(e,t)=>lie(e,"name",{value:t,configurable:!0}),rA="Checkbox",[cie,zke]=en(rA),[uie,aA]=cie(rA);function L9(e){let{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:u}=e,[p,f]=Jn({prop:n,defaultProp:r??!1,onChange:l,caller:rA}),[g,m]=Bo.useState(null),[x,v]=Bo.useState(null),[y,b]=Bo.useState(null),k=g?!!i||!!g.closest("form"):!0,S={checked:p,disabled:a,setChecked:f,control:g,setControl:m,name:s,form:i,value:d,userClick:y,onUserClick:b,required:c,defaultChecked:Ii(r)?!1:r,isFormControl:k,bubbleInput:x,setBubbleInput:v};return ti.jsx(uie,{scope:t,...S,children:B9(u)?u(S):o})}dc(L9,"CheckboxProvider");var die="CheckboxTrigger",pie=Bo.forwardRef(dc(function({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a){let{control:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,onUserClick:f,isFormControl:g,bubbleInput:m}=aA(die,t),x=Ce(a,u),v=Bo.useRef(c);return Bo.useEffect(()=>{let y=i?.form;if(y){let b=dc(()=>p(v.current),"reset");return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[i,p]),ti.jsx(be.button,{type:"button",role:"checkbox","aria-checked":Ii(c)?"mixed":c,"aria-required":d,"data-state":iA(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:x,onKeyDown:te(n,(y)=>{if(y.key==="Enter")y.preventDefault()}),onClick:te(o,(y)=>{let b=y.isPropagationStopped();if(f({requestedChecked:Ii(c)?!0:!c,hasConsumerStoppedPropagation:b}),p((k)=>Ii(k)?!0:!k),m&&g){if(!b)y.stopPropagation()}})})},"CheckboxTrigger")),fie=Bo.forwardRef(dc(function(t,n){let{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=t;return ti.jsx(L9,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>ti.jsxs(ti.Fragment,{children:[ti.jsx(pie,{...p,ref:n,__scopeCheckbox:o}),f&&ti.jsx(bie,{__scopeCheckbox:o})]})})},"Checkbox")),mie="CheckboxIndicator",gie=Bo.forwardRef(dc(function(t,n){let{__scopeCheckbox:o,forceMount:r,...a}=t,i=aA(mie,o);return ti.jsx(Pr,{present:r||Ii(i.checked)||i.checked===!0,children:ti.jsx(be.span,{"data-state":iA(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),hie="CheckboxBubbleInput",bie=Bo.forwardRef(dc(function({__scopeCheckbox:t,onClick:n,...o},r){let{control:a,userClick:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:g,setBubbleInput:m}=aA(hie,t),x=Ce(r,m),v=Bp(a),y=Bo.useRef(!1),b=Bo.useRef(s),k=Bo.useRef(i),S=Bo.useRef(null);Bo.useEffect(()=>{let R=g;if(!R)return;let M=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(M,"checked").set;if(!E)return;let z=b.current!==s;b.current=s;let L=i!==null&&i!==k.current;if(k.current=i,L){if(S.current=z?null:i,z)R.indeterminate=Ii(s),E.call(R,Ii(s)?!1:s);R.dispatchEvent(new Event("click",{bubbles:!i.hasConsumerStoppedPropagation}))}else if(z){let ee=S.current;S.current=null;let ne=ee?.requestedChecked===s;y.current=!0,R.indeterminate=Ii(s),E.call(R,Ii(s)?!1:s),R.dispatchEvent(new Event("click",{bubbles:!(ne&&ee.hasConsumerStoppedPropagation)})),y.current=!1}},[g,s,i]);let C=Bo.useRef(Ii(s)?!1:s);return ti.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:c,disabled:d,name:u,value:p,form:f,...o,tabIndex:-1,ref:x,onClick:te(n,(R)=>{if(y.current)R.stopPropagation()}),style:{...o.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function B9(e){return typeof e==="function"}dc(B9,"isFunction");function Ii(e){return e==="indeterminate"}dc(Ii,"isIndeterminate");function iA(e){return Ii(e)?"indeterminate":e?"checked":"unchecked"}dc(iA,"getState");var ni=h(I(),1);var He=h(I(),1);var hs=h(I(),1);var E1=h(w(),1),jo=h(I(),1);var $u=h(w(),1),vie=Object.defineProperty,Ho=(e,t)=>vie(e,"name",{value:t,configurable:!0});function Hp(e){let t=e+"CollectionProvider",[n,o]=en(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Ho((m)=>{let{scope:x,children:v}=m,y=hs.useRef(null),b=hs.useRef(new Map).current;return E1.jsx(r,{scope:x,itemMap:b,collectionRef:y,children:v})},"CollectionProvider");i.displayName=t;let s=e+"CollectionSlot",l=lr(s),c=hs.forwardRef((m,x)=>{let{scope:v,children:y}=m,b=a(s,v),k=Ce(x,b.collectionRef);return E1.jsx(l,{ref:k,children:y})});c.displayName=s;let d=e+"CollectionItemSlot",u="data-radix-collection-item",p=lr(d),f=hs.forwardRef((m,x)=>{let{scope:v,children:y,...b}=m,k=hs.useRef(null),S=Ce(x,k),C=a(d,v);return hs.useEffect(()=>(C.itemMap.set(k,{ref:k,...b}),()=>void C.itemMap.delete(k))),E1.jsx(p,{...{[u]:""},ref:S,children:y})});f.displayName=d;function g(m){let x=a(e+"CollectionConsumer",m);return hs.useCallback(()=>{let y=x.collectionRef.current;if(!y)return[];let b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((C,R)=>b.indexOf(C.ref.current)-b.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return Ho(g,"useCollection"),[{Provider:i,Slot:c,ItemSlot:f},g,o]}Ho(Hp,"createCollection");var j9=new WeakMap,T1=class e extends Map{static{Ho(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],j9.set(this,!0)}set(t,n){if(j9.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),a=r?this.size:this.size+1,i=sA(t),s=i>=0?Math.min(i,a-1):Math.max(a+i,0);if(r?this.#e.indexOf(n)===s:s===this.size)return this.set(n,o),this;let l=this.#e.filter((d)=>d!==n);l.splice(s,0,n);let c=l.map((d)=>[d,d===n?o:this.get(d)]);this.clear();for(let[d,u]of c)this.set(d,u);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let a=this.#e.indexOf(n),i=a!==-1&&a<r?r-1:r;return this.insert(i,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let a=this.#e.indexOf(n),i=a!==-1&&a<=r?r:r+1;return this.insert(i,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=A1(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=A1(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return A1(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let a of this){if(Reflect.apply(t,n,[a,r,this]))o.push(a);r++}return new e(o)}map(t,n){let o=[],r=0;for(let a of this)o.push([a[0],Reflect.apply(t,n,[a,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let a=0,i=o;for(let s of this){if(a===0&&!r)i=s;else i=Reflect.apply(n,this,[i,s,a,this]);a++}return i}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let a=o;for(let i=this.size-1;i>=0;i--){let s=this.entryAt(i);if(i===this.size-1&&!r)a=s;else a=Reflect.apply(n,this,[a,s,i,this])}return a}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function A1(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=U9(e,t);return n===-1?void 0:e[n]}Ho(A1,"at");function U9(e,t){let n=e.length,o=sA(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}Ho(U9,"toSafeIndex");function sA(e){return e!==e||e===0?0:Math.trunc(e)}Ho(sA,"toSafeInteger");function xie(e){let t=e+"CollectionProvider",[n,o]=en(t),[r,a]=n(t);r.displayName=e+"CollectionStableContextProvider";let[i,s]=n(t);i.displayName=e+"CollectionStatefulContextProvider";let l=Ho(({state:C,...R})=>C?$u.jsx(d,{...R,state:C}):$u.jsx(c,{...R}),"CollectionProvider");l.displayName=t;let c=Ho((C)=>{let R=y();return $u.jsx(d,{...C,state:R})},"CollectionInit");c.displayName=e+"CollectionInit";let d=Ho((C)=>{let{scope:R,children:M,state:D}=C,E=jo.useRef(null),[z,L]=jo.useState(null),ee=Ce(E,L),[ne,ke]=D,Y=jo.useRef(new T1),ye=jo.useCallback(()=>{let le=Y.current;if(!V9(le))le.sort(M1);return le},[]);return jo.useEffect(()=>{if(!z)return;let le=K9(()=>{ke((J)=>{let G=J.toSorted(M1);return G.some(([H],fe)=>J.keyAt(fe)!==H)?G:J})});return le.observe(z,{childList:!0,subtree:!0}),()=>{le.disconnect()}},[z,ke]),$u.jsx(r,{scope:R,collectionElementRef:ee,collectionElementRefObject:E,getCollection:ye,setCollection:ke,registryRef:Y,children:$u.jsx(i,{scope:R,collectionElement:z,collection:ne,children:M})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";let u=e+"CollectionSlot",p=lr(u),f=jo.forwardRef((C,R)=>{let{scope:M,children:D}=C,E=a(u,M),z=Ce(R,E.collectionElementRef);return $u.jsx(p,{ref:z,children:D})});f.displayName=u;let g=e+"CollectionItemSlot",m="data-radix-collection-item",x=lr(g),v=jo.forwardRef((C,R)=>{let{scope:M,children:D,...E}=C,z=jo.useRef(null),L=a(g,M),{setCollection:ee,registryRef:ne}=L,ke=jo.useRef(E);if(!G9(ke.current,E))ke.current=E;let Y=ke.current,ye=jo.useCallback((G)=>{let Fe=ne.current;if(G)Fe.set(G,{...ke.current,element:G});else if(z.current)Fe.delete(z.current)},[ne]),le=Ce(R,ye,z);wt(()=>{let G=z.current,Fe=ne.current;if(G&&Fe.has(G))Fe.set(G,{...Y,element:G})},[Y,ne]);let J=jo.useRef(null);return jo.useEffect(()=>{let G=z.current,Fe=J.current;if((Fe?.element??null)===G&&(!G||Fe?.itemData===Y))return;J.current=G?{element:G,itemData:Y}:null,ee((H)=>{let fe=new T1(H);if(Fe&&Fe.element!==G)fe.delete(Fe.element);if(G)fe.set(G,{...Y,element:G});return fe.sort(M1)})}),jo.useEffect(()=>()=>{let G=J.current;if(J.current=null,!G)return;ee((Fe)=>{if(!Fe.has(G.element))return Fe;let H=new T1(Fe);return H.delete(G.element),H})},[ee]),$u.jsx(x,{...{[m]:""},ref:le,children:D})});v.displayName=g;function y(){return jo.useState(new T1)}Ho(y,"useInitCollection");function b(C){let{collection:R}=s(e+"CollectionConsumer",C);return R}Ho(b,"useCollection");function k(C){let{getCollection:R}=a(e+"CollectionConsumer",C);return R}return Ho(k,"useGetCollection"),[{Provider:l,Slot:f,ItemSlot:v},{createCollectionScope:o,useCollection:b,useGetCollection:k,useInitCollection:y}]}Ho(xie,"createCollection");function G9(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}Ho(G9,"shallowEqual");function F9(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ho(F9,"isElementPreceding");function V9(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Ho(V9,"isInDocumentOrder");function M1(e,t){return!e[1].element||!t[1].element?0:F9(e[1].element,t[1].element)?-1:1}Ho(M1,"sortByDocumentPosition");function K9(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}Ho(K9,"getChildListObserver");var D1=h(I(),1),kie=h(w(),1),yie=Object.defineProperty,wie=(e,t)=>yie(e,"name",{value:t,configurable:!0}),Sie={LTR:"ltr",RTL:"rtl"},Cie=D1.createContext(void 0);function pc(e){let t=D1.useContext(Cie);return e||t||Sie.LTR}wie(pc,"useDirection");var $r=h(I(),1);var Y9=["top","right","bottom","left"];var{min:dl,max:bs,round:Rv,floor:Tv}=Math,pl=(e)=>({x:e,y:e}),Nie={left:"right",right:"left",bottom:"top",top:"bottom"};function lA(e,t,n){return bs(e,dl(t,n))}function fl(e,t){return typeof e==="function"?e(t):e}function fc(e){return e.split("-")[0]}function jp(e){return e.split("-")[1]}function O1(e){return e==="x"?"y":"x"}function _1(e){return e==="y"?"height":"width"}function vs(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function I1(e){return O1(vs(e))}function W9(e,t,n){if(n===void 0)n=!1;let o=jp(e),r=I1(e),a=_1(r),i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])i=Nv(i);return[i,Nv(i)]}function X9(e){let t=Nv(e);return[P1(e),t,P1(t)]}function P1(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var q9=["left","right"],$9=["right","left"],Rie=["top","bottom"],Tie=["bottom","top"];function Eie(e,t,n){switch(e){case"top":case"bottom":if(n)return t?$9:q9;return t?q9:$9;case"left":case"right":return t?Rie:Tie;default:return[]}}function Q9(e,t,n,o){let r=jp(e),a=Eie(fc(e),n==="start",o);if(r){if(a=a.map((i)=>i+"-"+r),t)a=a.concat(a.map(P1))}return a}function Nv(e){let t=fc(e);return Nie[t]+e.slice(t.length)}function Aie(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function cA(e){return typeof e!=="number"?Aie(e):{top:e,right:e,bottom:e,left:e}}function Up(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Z9(e,t,n){let{reference:o,floating:r}=e,a=vs(t),i=I1(t),s=_1(i),l=fc(t),c=a==="y",d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2,f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}let g=jp(t);if(g)f[i]+=p*(g==="end"?1:-1)*(n&&c?-1:1);return f}async function tj(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=fl(t,e),g=cA(f),x=s[p?u==="floating"?"reference":"floating":u],v=Up(await a.getClippingRect({element:((n=await(a.isElement==null?void 0:a.isElement(x)))!=null?n:!0)?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),k=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=Up(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(v.top-S.top+g.top)/k.y,bottom:(S.bottom-v.bottom+g.bottom)/k.y,left:(v.left-S.left+g.left)/k.x,right:(S.right-v.right+g.right)/k.x}}var Mie=50,nj=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:tj},l=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Z9(c,o,l),p=o,f=0,g={};for(let m=0;m<a.length;m++){let x=a[m];if(!x)continue;let{name:v,fn:y}=x,{x:b,y:k,data:S,reset:C}=await y({x:d,y:u,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=b!=null?b:d,u=k!=null?k:u,g[v]={...g[v],...S},C&&f<Mie){if(f++,typeof C==="object"){if(C.placement)p=C.placement;if(C.rects)c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects;({x:d,y:u}=Z9(c,p,l))}m=-1}}return{x:d,y:u,placement:p,strategy:r,middlewareData:g}},oj=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=fl(e,t)||{};if(c==null)return{};let u=cA(d),p={x:n,y:o},f=I1(r),g=_1(f),m=await i.getDimensions(c),x=f==="y",v=x?"top":"left",y=x?"bottom":"right",b=x?"clientHeight":"clientWidth",k=a.reference[g]+a.reference[f]-p[f]-a.floating[g],S=p[f]-a.reference[f],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c)),R=C?C[b]:0;if(!R||!await(i.isElement==null?void 0:i.isElement(C)))R=s.floating[b]||a.floating[g];let M=k/2-S/2,D=R/2-m[g]/2-1,E=dl(u[v],D),z=dl(u[y],D),L=R-m[g]-z,ee=R/2-m[g]/2+M,ne=lA(E,ee,L),ke=!l.arrow&&jp(r)!=null&&ee!==ne&&a.reference[g]/2-(ee<E?E:z)-m[g]/2<0,Y=ke?ee<E?ee-E:ee-L:0;return{[f]:p[f]+Y,data:{[f]:ne,centerOffset:ee-ne-Y,...ke&&{alignmentOffset:Y}},reset:ke}}});var rj=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=fl(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let v=fc(r),y=vs(s),b=fc(s)===s,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(b||!m?[Nv(s)]:X9(s)),C=g!=="none";if(!p&&C)S.push(...Q9(s,m,g,k));let R=[s,...S],M=await l.detectOverflow(t,x),D=[],E=((o=a.flip)==null?void 0:o.overflows)||[];if(d)D.push(M[v]);if(u){let ne=W9(r,i,k);D.push(M[ne[0]],M[ne[1]])}if(E=[...E,{placement:r,overflows:D}],!D.every((ne)=>ne<=0)){var z,L;let ne=(((z=a.flip)==null?void 0:z.index)||0)+1,ke=R[ne];if(ke){if(!(u==="alignment"?y!==vs(ke):!1)||E.every((le)=>vs(le.placement)===y?le.overflows[0]>0:!0))return{data:{index:ne,overflows:E},reset:{placement:ke}}}let Y=(L=E.filter((ye)=>ye.overflows[0]<=0).sort((ye,le)=>ye.overflows[1]-le.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(f){case"bestFit":{var ee;let ye=(ee=E.filter((le)=>{if(C){let J=vs(le.placement);return J===y||J==="y"}return!0}).map((le)=>[le.placement,le.overflows.filter((J)=>J>0).reduce((J,G)=>J+G,0)]).sort((le,J)=>le[1]-J[1])[0])==null?void 0:ee[0];if(ye)Y=ye;break}case"initialPlacement":Y=s;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function J9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ej(e){return Y9.some((t)=>e[t]>=0)}var aj=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...a}=fl(e,t);switch(r){case"referenceHidden":{let i=await o.detectOverflow(t,{...a,elementContext:"reference"}),s=J9(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ej(s)}}}case"escaped":{let i=await o.detectOverflow(t,{...a,altBoundary:!0}),s=J9(i,n.floating);return{data:{escapedOffsets:s,escaped:ej(s)}}}default:return{}}}}};var ij=new Set(["left","top"]);async function Die(e,t){let{placement:n,platform:o,elements:r}=e,a=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=fc(n),s=jp(n),l=vs(n)==="y",c=ij.has(i)?-1:1,d=a&&l?-1:1,u=fl(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof u==="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};if(s&&typeof g==="number")f=s==="end"?g*-1:g;return l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}var sj=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:a,placement:i,middlewareData:s}=t,l=await Die(t,e);if(i===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset)return{};return{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},lj=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:(y)=>{let{x:b,y:k}=y;return{x:b,y:k}}},...c}=fl(e,t),d={x:n,y:o},u=await a.detectOverflow(t,c),p=vs(r),f=O1(p),g=d[f],m=d[p],x=(y,b)=>lA(b+u[y==="y"?"top":"left"],b,b-u[y==="y"?"bottom":"right"]);if(i)g=x(f,g);if(s)m=x(p,m);let v=l.fn({...t,[f]:g,[p]:m});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[f]:i,[p]:s}}}}}},cj=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:a,placement:i,rects:s,middlewareData:l}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=fl(e,t),p={x:r,y:a},f=vs(i),g=O1(f),m=p[g],x=p[f],v=fl(c,t),y=typeof v==="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(o=v.crossAxis)!=null?o:0};if(d){let S=g==="y"?"height":"width",C=s.reference[g]-s.floating[S]+y.mainAxis,R=s.reference[g]+s.reference[S]-y.mainAxis;if(m<C)m=C;else if(m>R)m=R}if(u){var b,k;let S=g==="y"?"width":"height",C=ij.has(fc(i)),R=s.reference[f]-s.floating[S]+(C?((b=l.offset)==null?void 0:b[f])||0:0)+(C?0:y.crossAxis),M=s.reference[f]+s.reference[S]+(C?0:((k=l.offset)==null?void 0:k[f])||0)-(C?y.crossAxis:0);if(x<R)x=R;else if(x>M)x=M}return{[g]:m,[f]:x}}}},uj=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:a}=t,{apply:i=()=>{},...s}=fl(e,t),l=await r.detectOverflow(t,s),c=fc(n),d=jp(n),u=vs(n)==="y",{width:p,height:f}=o.floating,g,m;if(c==="top"||c==="bottom")g=c,m=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right";else m=c,g=d==="end"?"top":"bottom";let x=f-l.top-l.bottom,v=p-l.left-l.right,y=dl(f-l[g],x),b=dl(p-l[m],v),k=t.middlewareData.shift,S=!k,C=y,R=b;if(k!=null&&k.enabled.x)R=v;if(k!=null&&k.enabled.y)C=x;if(S&&!d)if(u)R=p-2*bs(l.left,l.right);else C=f-2*bs(l.top,l.bottom);await i({...t,availableWidth:R,availableHeight:C});let M=await r.getDimensions(a.floating);if(p!==M.width||f!==M.height)return{reset:{rects:!0}};return{}}}};function z1(){return typeof window<"u"}function Vp(e){if(pj(e))return(e.nodeName||"").toLowerCase();return"#document"}function ca(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ml(e){var t;return(t=(pj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pj(e){if(!z1())return!1;return e instanceof Node||e instanceof ca(e).Node}function xs(e){if(!z1())return!1;return e instanceof Element||e instanceof ca(e).Element}function mc(e){if(!z1())return!1;return e instanceof HTMLElement||e instanceof ca(e).HTMLElement}function dj(e){if(!z1()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof ca(e).ShadowRoot}function Ev(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function fj(e){return/^(table|td|th)$/.test(Vp(e))}function Av(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Pie=/transform|translate|scale|rotate|perspective|filter/,Oie=/paint|layout|strict|content/,Gp=(e)=>!!e&&e!=="none",uA;function L1(e){let t=xs(e)?ys(e):e;return Gp(t.transform)||Gp(t.translate)||Gp(t.scale)||Gp(t.rotate)||Gp(t.perspective)||!B1()&&(Gp(t.backdropFilter)||Gp(t.filter))||Pie.test(t.willChange||"")||Oie.test(t.contain||"")}function mj(e){let t=Yu(e);while(mc(t)&&!Ng(t)){if(L1(t))return t;else if(Av(t))return null;t=Yu(t)}return null}function B1(){if(uA==null)uA=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return uA}function Ng(e){return/^(html|body|#document)$/.test(Vp(e))}function ys(e){return ca(e).getComputedStyle(e)}function Mv(e){if(xs(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yu(e){if(Vp(e)==="html")return e;let t=e.assignedSlot||e.parentNode||dj(e)&&e.host||ml(e);return dj(t)?t.host:t}function gj(e){let t=Yu(e);if(Ng(t))return(e.ownerDocument||e).body;if(mc(t)&&Ev(t))return t;return gj(t)}function Fp(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=gj(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),i=ca(r);if(a){let s=H1(i);return t.concat(i,i.visualViewport||[],Ev(r)?r:[],s&&n?Fp(s):[])}else return t.concat(r,Fp(r,[],n))}function H1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vj(e){let t=ys(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=mc(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Rv(n)!==a||Rv(o)!==i;if(s)n=a,o=i;return{width:n,height:o,$:s}}function pA(e){return!xs(e)?e.contextElement:e}function Rg(e){let t=pA(e);if(!mc(t))return pl(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:a}=vj(t),i=(a?Rv(n.width):n.width)/o,s=(a?Rv(n.height):n.height)/r;if(!i||!Number.isFinite(i))i=1;if(!s||!Number.isFinite(s))s=1;return{x:i,y:s}}var _ie=pl(0);function xj(e){let t=ca(e);if(!B1()||!t.visualViewport)return _ie;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iie(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===ca(e)}function Kp(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),a=pA(e),i=pl(1);if(t)if(o){if(xs(o))i=Rg(o)}else i=Rg(e);let s=Iie(a,n,o)?xj(a):pl(0),l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(a&&o){let p=ca(a),f=xs(o)?ca(o):o,g=p,m=H1(g);while(m&&f!==g){let x=Rg(m),v=m.getBoundingClientRect(),y=ys(m),b=v.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,k=v.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=b,c+=k,g=ca(m),m=H1(g)}}return Up({width:d,height:u,x:l,y:c})}function j1(e,t){let n=Mv(e).scrollLeft;if(!t)return Kp(ml(e)).left+n;return t.left+n}function yj(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-j1(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function zie(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,a=r==="fixed",i=ml(o),s=t?Av(t.floating):!1;if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=pl(1),d=pl(0),u=mc(o);if(u||!a){if(Vp(o)!=="body"||Ev(i))l=Mv(o);if(u){let f=Kp(o);c=Rg(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}}let p=i&&!u&&!a?yj(i,l):pl(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function Lie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Bie(e){let t=Mv(e),n=e.ownerDocument.body,o=bs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=bs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+j1(e),i=-t.scrollTop;if(ys(n).direction==="rtl")a+=bs(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:a,y:i}}var Hie=25;function jie(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=ca(e),a=ml(e),i=r.visualViewport,{clientWidth:s,clientHeight:l}=a,c=0,d=0;if(i){let p=!B1()||t==="fixed";if(o){if(!p)c=-i.offsetLeft,d=-i.offsetTop}else if(s=i.width,l=i.height,p)c=i.offsetLeft,d=i.offsetTop}if(j1(a)<=0){let p=a.ownerDocument,f=p.body,g=getComputedStyle(f),m=p.compatMode==="CSS1Compat"?parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0:0,x=Math.abs(a.clientWidth-f.clientWidth-m),v=getComputedStyle(a).scrollbarGutter==="stable both-edges"?x/2:x;if(v<=Hie)s-=v}return{width:s,height:l,x:c,y:d}}function Uie(e,t){let n=Kp(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Rg(e),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=r*a.x,c=o*a.y;return{width:i,height:s,x:l,y:c}}function hj(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=jie(e,n,t);else if(t==="document")o=Bie(ml(e));else if(xs(t))o=Uie(t,n);else{let r=xj(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Up(o)}function Gie(e,t){let n=t.get(e);if(n)return n;let o=Fp(e,[],!1).filter((s)=>xs(s)&&Vp(s)!=="body"),r=null,a=ys(e).position==="fixed",i=a?Yu(e):e;while(xs(i)&&!Ng(i)){let s=ys(i),l=L1(i),c=r?r.position:a?"fixed":"";if(!l&&(c==="fixed"||c==="absolute"&&s.position==="static"))o=o.filter((u)=>u!==i);else r=s;i=Yu(i)}return t.set(e,o),o}function Fie(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,i=[...n==="clippingAncestors"?Av(t)?[]:Gie(t,this._c):[].concat(n),o],s=hj(t,i[0],r),{top:l,right:c,bottom:d,left:u}=s;for(let p=1;p<i.length;p++){let f=hj(t,i[p],r);l=bs(f.top,l),c=dl(f.right,c),d=dl(f.bottom,d),u=bs(f.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function Vie(e){let{width:t,height:n}=vj(e);return{width:t,height:n}}function Kie(e,t,n){let o=mc(t),r=ml(t),a=n==="fixed",i=Kp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=pl(0);if(o||!a){if(Vp(t)!=="body"||Ev(r))s=Mv(t);if(o){let p=Kp(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}}if(!o&&r)l.x=j1(r);let c=r&&!o&&!a?yj(r,s):pl(0),d=i.left+s.scrollLeft-l.x-c.x,u=i.top+s.scrollTop-l.y-c.y;return{x:d,y:u,width:i.width,height:i.height}}function dA(e){return ys(e).position==="static"}function bj(e,t){if(!mc(e)||ys(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(ml(e)===n)n=n.ownerDocument.body;return n}function wj(e,t){let n=ca(e);if(Av(e))return n;if(!mc(e)){let r=Yu(e);while(r&&!Ng(r)){if(xs(r)&&!dA(r))return r;r=Yu(r)}return n}let o=bj(e,t);while(o&&fj(o)&&dA(o))o=bj(o,t);if(o&&Ng(o)&&dA(o)&&!L1(o))return n;return o||mj(e)||n}var qie=async function(e){let t=this.getOffsetParent||wj,n=this.getDimensions,o=await n(e.floating);return{reference:Kie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function $ie(e){return ys(e).direction==="rtl"}var kj={convertOffsetParentRelativeRectToViewportRelativeRect:zie,getDocumentElement:ml,getClippingRect:Fie,getOffsetParent:wj,getElementRects:qie,getClientRects:Lie,getDimensions:Vie,getScale:Rg,isElement:xs,isRTL:$ie};function Sj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yie(e,t,n){let o=null,r,a=ml(e);function i(){var d;clearTimeout(r),(d=o)==null||d.disconnect(),o=null}function s(d,u){if(d===void 0)d=!1;if(u===void 0)u=1;i();let p=e.getBoundingClientRect(),{left:f,top:g,width:m,height:x}=p;if(!d)t();if(!m||!x)return;let v=Tv(g),y=Tv(a.clientWidth-(f+m)),b=Tv(a.clientHeight-(g+x)),k=Tv(f),C={rootMargin:-v+"px "+-y+"px "+-b+"px "+-k+"px",threshold:bs(0,dl(1,u))||1},R=!0;function M(D){let E=D[0].intersectionRatio;if(!Sj(p,e.getBoundingClientRect()))return s();if(E!==u){if(!R)return s();if(!E)r=setTimeout(()=>{s(!1,0.0000001)},1000);else s(!1,E)}R=!1}try{o=new IntersectionObserver(M,{...C,root:a.ownerDocument})}catch(D){o=new IntersectionObserver(M,C)}o.observe(e)}let l=ca(e),c=()=>s(n);return l.addEventListener("resize",c),s(!0),()=>{l.removeEventListener("resize",c),i()}}function fA(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver==="function",layoutShift:s=typeof IntersectionObserver==="function",animationFrame:l=!1}=o,c=pA(e),d=r||a?[...c?Fp(c):[],...t?Fp(t):[]]:[];d.forEach((v)=>{r&&v.addEventListener("scroll",n),a&&v.addEventListener("resize",n)});let u=c&&s?Yie(c,n,a):null,p=-1,f=null;if(i){if(f=new ResizeObserver((v)=>{let[y]=v;if(y&&y.target===c&&f&&t)f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)});n()}),c&&!l)f.observe(c);if(t)f.observe(t)}let g,m=l?Kp(e):null;if(l)x();function x(){let v=Kp(e);if(m&&!Sj(m,v))n();m=v,g=requestAnimationFrame(x)}return n(),()=>{var v;if(d.forEach((y)=>{r&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),u==null||u(),(v=f)==null||v.disconnect(),f=null,l)cancelAnimationFrame(g)}}var Cj=sj;var Nj=lj,Rj=rj,Tj=uj,Ej=aj,mA=oj;var Aj=cj,gA=(e,t,n)=>{let o=new Map,r=n!=null?n:{},a={...kj,...r.platform,_c:o};return nj(e,t,{...r,platform:a})};var To=h(I(),1),Dj=h(I(),1),Pj=h(fi(),1),Wie=typeof document<"u",Xie=function(){},U1=Wie?Dj.useLayoutEffect:Xie;function G1(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!G1(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let a=r[o];if(a==="_owner"&&e.$$typeof)continue;if(!G1(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Oj(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mj(e,t){let n=Oj(e);return Math.round(t*n)/n}function hA(e){let t=To.useRef(e);return U1(()=>{t.current=e}),t}function _j(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,u]=To.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=To.useState(o);if(!G1(p,o))f(o);let[g,m]=To.useState(null),[x,v]=To.useState(null),y=To.useCallback((le)=>{if(le!==C.current)C.current=le,m(le)},[]),b=To.useCallback((le)=>{if(le!==R.current)R.current=le,v(le)},[]),k=a||g,S=i||x,C=To.useRef(null),R=To.useRef(null),M=To.useRef(d),D=l!=null,E=hA(l),z=hA(r),L=hA(c),ee=To.useCallback(()=>{if(!C.current||!R.current)return;let le={placement:t,strategy:n,middleware:p};if(z.current)le.platform=z.current;gA(C.current,R.current,le).then((J)=>{let G={...J,isPositioned:L.current!==!1};if(ne.current&&!G1(M.current,G))M.current=G,Pj.flushSync(()=>{u(G)})})},[p,t,n,z,L]);U1(()=>{if(c===!1&&M.current.isPositioned)M.current.isPositioned=!1,u((le)=>({...le,isPositioned:!1}))},[c]);let ne=To.useRef(!1);U1(()=>(ne.current=!0,()=>{ne.current=!1}),[]),U1(()=>{if(k)C.current=k;if(S)R.current=S;if(k&&S){if(E.current)return E.current(k,S,ee);ee()}},[k,S,ee,E,D]);let ke=To.useMemo(()=>({reference:C,floating:R,setReference:y,setFloating:b}),[y,b]),Y=To.useMemo(()=>({reference:k,floating:S}),[k,S]),ye=To.useMemo(()=>{let le={position:n,left:0,top:0};if(!Y.floating)return le;let J=Mj(Y.floating,d.x),G=Mj(Y.floating,d.y);if(s)return{...le,transform:"translate("+J+"px, "+G+"px)",...Oj(Y.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:J,top:G}},[n,s,Y.floating,d.x,d.y]);return To.useMemo(()=>({...d,update:ee,refs:ke,elements:Y,floatingStyles:ye}),[d,ee,ke,Y,ye])}var Qie=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return mA({element:o.current,padding:r}).fn(n);return{}}if(o)return mA({element:o,padding:r}).fn(n);return{}}}},Ij=(e,t)=>{let n=Cj(e);return{name:n.name,fn:n.fn,options:[e,t]}},zj=(e,t)=>{let n=Nj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lj=(e,t)=>({fn:Aj(e).fn,options:[e,t]}),Bj=(e,t)=>{let n=Rj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hj=(e,t)=>{let n=Tj(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jj=(e,t)=>{let n=Ej(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Uj=(e,t)=>{let n=Qie(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Tg=h(w(),1),Zie=Object.defineProperty,Wu=(e,t)=>Zie(e,"name",{value:t,configurable:!0});var Gj={Partial:"partial",Always:"always"},Fj={Optimized:"optimized",Always:"always"},Vj="Popper",[Kj,zi]=en(Vj),[Jie,qj]=Kj(Vj),Xu=Wu((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=$r.useState(null),[a,i]=$r.useState(void 0);return Tg.jsx(Jie,{scope:t,anchor:o,onAnchorChange:r,placementState:a,setPlacementState:i,children:n})},"Popper"),ese="PopperAnchor",gc=$r.forwardRef(Wu(function(t,n){let{__scopePopper:o,virtualRef:r,...a}=t,i=qj(ese,o),s=$r.useRef(null),l=i.onAnchorChange,c=$r.useCallback((m)=>{if(s.current=m,m)l(m)},[l]),d=Ce(n,c),u=$r.useRef(null);$r.useEffect(()=>{if(!r)return;let m=u.current;if(u.current=r.current,m!==u.current)l(u.current)});let p=i.placementState&&F1(i.placementState),f=p?.[0],g=p?.[1];return r?null:Tg.jsx(be.div,{"data-radix-popper-side":f,"data-radix-popper-align":g,...a,ref:d})},"PopperAnchor")),$j="PopperContent",[tse,bSe]=Kj($j),Qu=$r.forwardRef(Wu(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p=Gj.Partial,hideWhenDetached:f=!1,updatePositionStrategy:g=Fj.Optimized,onPlaced:m,...x}=t,v=qj($j,o),[y,b]=$r.useState(null),k=Ce(n,b),[S,C]=$r.useState(null),R=Bp(S),M=R?.width??0,D=R?.height??0,E=r+(i!=="center"?"-"+i:""),z=typeof u==="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],ee=L.length>0,ne={padding:z,boundary:L.filter(Yj),altBoundary:ee},{refs:ke,floatingStyles:Y,placement:ye,isPositioned:le,middlewareData:J}=_j({strategy:"fixed",placement:E,whileElementsMounted:Wu((...ae)=>fA(...ae,{animationFrame:g===Fj.Always}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Ij({mainAxis:a+D,alignmentAxis:s}),c&&zj({mainAxis:!0,crossAxis:!1,...p===Gj.Partial?{limiter:Lj()}:{},...ne}),c&&Bj({...ne}),Hj({...ne,apply:Wu(({elements:ae,rects:xe,availableWidth:Dt,availableHeight:gt})=>{let{width:Le,height:$e}=xe.reference,st=ae.floating.style;st.setProperty("--radix-popper-available-width",`${Dt}px`),st.setProperty("--radix-popper-available-height",`${gt}px`),st.setProperty("--radix-popper-anchor-width",`${Le}px`),st.setProperty("--radix-popper-anchor-height",`${$e}px`)},"apply")}),S&&Uj({element:S,padding:l}),nse({arrowWidth:M,arrowHeight:D}),f&&jj(ee?{strategy:"referenceHidden",...ne}:{strategy:"referenceHidden",padding:ne.padding,altBoundary:ne.altBoundary})]}),G=v.setPlacementState;wt(()=>(G(ye),()=>{G(void 0)}),[ye,G]);let[Fe,H]=F1(ye),fe=Lo(m);wt(()=>{if(le)fe?.()},[le,fe]);let oe=J.arrow?.x,F=J.arrow?.y,B=J.arrow?.centerOffset!==0,[ve,We]=$r.useState();return wt(()=>{if(y)We(window.getComputedStyle(y).zIndex)},[y]),Tg.jsx("div",{ref:ke.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:le?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Tg.jsx(tse,{scope:o,placedSide:Fe,placedAlign:H,onArrowChange:C,arrowX:oe,arrowY:F,shouldHideArrow:B,children:Tg.jsx(be.div,{"data-side":Fe,"data-align":H,...x,ref:k,style:{...x.style,animation:!le?"none":x.style?.animation}})})})},"PopperContent"));function Yj(e){return e!==null}Wu(Yj,"isNotNull");var nse=Wu((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=F1(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(r.arrow?.x??0)+s/2,f=(r.arrow?.y??0)+l/2,g="",m="";if(c==="bottom")g=i?u:`${p}px`,m=`${-l}px`;else if(c==="top")g=i?u:`${p}px`,m=`${o.floating.height+l}px`;else if(c==="right")g=`${-l}px`,m=i?u:`${f}px`;else if(c==="left")g=`${o.floating.width+l}px`,m=i?u:`${f}px`;return{data:{x:g,y:m}}}}),"transformOrigin");function F1(e){let[t,n="center"]=e.split("-");return[t,n]}Wu(F1,"getSideAndAlignFromPlacement");var ur=h(I(),1);var rse=h(I(),1),K1=h(I(),1),ose=Object.defineProperty,vA=(e,t)=>ose(e,"name",{value:t,configurable:!0}),bA=!1;function Wj(){let[e,t]=K1.useState(bA);return K1.useEffect(()=>{if(!bA)bA=!0,t(!0)},[]),e}vA(Wj,"useIsHydrated");var Xj=rse[" useSyncExternalStore ".trim().toString()];function Qj(){return()=>{}}vA(Qj,"subscribe");function Zj(){return Xj(Qj,()=>!0,()=>!1)}vA(Zj,"useIsHydratedModern");var Jj=typeof Xj==="function"?Zj:Wj;var Zu=h(w(),1),ase=Object.defineProperty,qp=(e,t)=>ase(e,"name",{value:t,configurable:!0}),xA="rovingFocusGroup.onEntryFocus",ise={bubbles:!1,cancelable:!0},q1="RovingFocusGroup",[yA,tU,sse]=Hp(q1),[lse,Eg]=en(q1,[sse]),eU={Vertical:"vertical",Horizontal:"horizontal"},cse={LTR:"ltr",RTL:"rtl"},[use,dse]=lse(q1),$1=ur.forwardRef(qp(function(t,n){return Zu.jsx(yA.Provider,{scope:t.__scopeRovingFocusGroup,children:Zu.jsx(yA.Slot,{scope:t.__scopeRovingFocusGroup,children:Zu.jsx(pse,{...t,ref:n})})})},"RovingFocusGroup")),pse=ur.forwardRef(qp(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=ur.useRef(null),g=Ce(n,f),m=pc(i),[x,v]=Jn({prop:s,defaultProp:l??null,onChange:c,caller:q1}),[y,b]=ur.useState(!1),k=Lo(d),S=tU(o),C=ur.useRef(!1),[R,M]=ur.useState(0);return ur.useEffect(()=>{let D=f.current;if(D)return D.addEventListener(xA,k),()=>D.removeEventListener(xA,k)},[k]),Zu.jsx(use,{scope:o,orientation:r,dir:m,loop:a,currentTabStopId:x,onItemFocus:ur.useCallback((D)=>v(D),[v]),onItemShiftTab:ur.useCallback(()=>b(!0),[]),onFocusableItemAdd:ur.useCallback(()=>M((D)=>D+1),[]),onFocusableItemRemove:ur.useCallback(()=>M((D)=>D-1),[]),children:Zu.jsx(be.div,{tabIndex:y||R===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...t.style},onMouseDown:te(t.onMouseDown,()=>{C.current=!0}),onFocus:te(t.onFocus,(D)=>{let E=!C.current;if(D.target===D.currentTarget&&E&&!y){let z=new CustomEvent(xA,ise);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){let L=S().filter((ye)=>ye.focusable),ee=L.find((ye)=>ye.active),ne=L.find((ye)=>ye.id===x),Y=[ee,ne,...L].filter(Boolean).map((ye)=>ye.ref.current);wA(Y,u)}}C.current=!1}),onBlur:te(t.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),fse="RovingFocusGroupItem",Y1=ur.forwardRef(qp(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=rn(),d=i||c,u=dse(fse,o),p=u.currentTabStopId===d,f=tU(o),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:x}=u,v=Jj();return wt(()=>{if(!v||!r)return;return g(),()=>m()},[v,r,g,m]),ur.useEffect(()=>{if(v||!r)return;return g(),()=>m()},[v,r,g,m]),Zu.jsx(yA.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:Zu.jsx(be.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:te(t.onMouseDown,(y)=>{if(!r)y.preventDefault();else u.onItemFocus(d)}),onFocus:te(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:te(t.onKeyDown,(y)=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let b=oU(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=f().filter((C)=>C.focusable).map((C)=>C.ref.current);if(b==="last")S.reverse();else if(b==="prev"||b==="next"){if(b==="prev")S.reverse();let C=S.indexOf(y.currentTarget);S=u.loop?rU(S,C+1):S.slice(C+1)}setTimeout(()=>wA(S))}}),children:typeof s==="function"?s({isCurrentTabStop:p,hasTabStop:x!=null}):s})})},"RovingFocusGroupItem")),mse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nU(e,t){if(t!==cse.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}qp(nU,"getDirectionAwareKey");function oU(e,t,n){let o=nU(e.key,n);if(t===eU.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===eU.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return mse[o]}qp(oU,"getFocusIntent");function wA(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}qp(wA,"focusFirst");function rU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}qp(rU,"wrapArray");var St=h(w(),1),gse=Object.defineProperty,Kt=(e,t)=>gse(e,"name",{value:t,configurable:!0});var kA=["Enter"," "],hse=["ArrowDown","PageUp","Home"],sU=["ArrowUp","PageDown","End"],bse=[...hse,...sU],$Se={ltr:[...kA,"ArrowRight"],rtl:[...kA,"ArrowLeft"]};var X1="Menu",[SA,vse,xse]=Hp(X1),[$p,RA]=en(X1,[xse,zi,Eg]),TA=zi(),lU=Eg(),[yse,Dv]=$p(X1),[wse,EA]=$p(X1),cU=Kt((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,s=TA(t),[l,c]=He.useState(null),d=He.useRef(!1),u=Lo(a),p=pc(r);return He.useEffect(()=>{let f=Kt(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Kt(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),He.useEffect(()=>{if(!n)return;let f=Kt(()=>u(!1),"handleBlur");return window.addEventListener("blur",f),()=>window.removeEventListener("blur",f)},[n,u]),St.jsx(Xu,{...s,children:St.jsx(yse,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:St.jsx(wse,{scope:t,onClose:He.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:i,children:o})})})},"Menu"),uU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t,a=TA(o);return St.jsx(gc,{...a,...r,ref:n})},"MenuAnchor")),dU="MenuPortal",[kse,Sse]=$p(dU,{forceMount:void 0}),pU=Kt((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=Dv(dU,t);return St.jsx(kse,{scope:t,forceMount:n,children:St.jsx(Pr,{present:n||a.open,children:St.jsx(cl,{asChild:!0,container:r,children:o})})})},"MenuPortal"),Ju="MenuContent",[Cse,fU]=$p(Ju),mU=He.forwardRef(Kt(function(t,n){let o=Sse(Ju,t.__scopeMenu),{forceMount:r=o.forceMount,...a}=t,i=Dv(Ju,t.__scopeMenu),s=EA(Ju,t.__scopeMenu);return St.jsx(SA.Provider,{scope:t.__scopeMenu,children:St.jsx(Pr,{present:r||i.open,children:St.jsx(SA.Slot,{scope:t.__scopeMenu,children:s.modal?St.jsx(Nse,{...a,ref:n}):St.jsx(Rse,{...a,ref:n})})})})},"MenuContent")),Nse=He.forwardRef(Kt(function(t,n){let o=Dv(Ju,t.__scopeMenu),r=He.useRef(null),a=Ce(n,r);return He.useEffect(()=>{let i=r.current;if(i)return qu(i)},[]),St.jsx(gU,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:te(t.onFocusOutside,(i)=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),Rse=He.forwardRef(Kt(function(t,n){let o=Dv(Ju,t.__scopeMenu);return St.jsx(gU,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),Tse=lr("MenuContent.ScrollLock"),gU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:g,disableOutsideScroll:m,...x}=t,v=Dv(Ju,o),y=EA(Ju,o),b=TA(o),k=lU(o),S=vse(o),[C,R]=He.useState(null),M=He.useRef(null),[D,E]=He.useState(null);Dp(D);let{nodes:z,registry:L}=Mp(),ee=Boolean(a||m),ne=Ce(n,M,v.onContentChange,E),ke=He.useRef(0),Y=He.useRef(""),ye=He.useRef(0),le=He.useRef(null),J=He.useRef("right"),G=He.useRef(0),Fe=He.useMemo(()=>m?[M,...z.map((B)=>({current:B}))]:[],[M,z,m]),H=m?lc:He.Fragment,fe=m?{as:Tse,allowPinchZoom:!0,shards:Fe}:void 0,oe=Kt((B)=>{let ve=Y.current+B,We=S().filter((st)=>!st.disabled),ae=document.activeElement,xe=We.find((st)=>st.ref.current===ae)?.textValue,Dt=We.map((st)=>st.textValue),gt=RU(Dt,ve,xe),Le=We.find((st)=>st.textValue===gt)?.ref.current;function $e(st){if(Y.current=st,window.clearTimeout(ke.current),st!=="")ke.current=window.setTimeout(()=>$e(""),1000)}if(Kt($e,"updateSearch"),$e(ve),Le)setTimeout(()=>Le.focus())},"handleTypeaheadSearch");He.useEffect(()=>()=>window.clearTimeout(ke.current),[]),ul();let F=He.useCallback((B)=>J.current===le.current?.side&&EU(B,le.current?.area),[]);return St.jsx(Cse,{scope:o,searchRef:Y,onItemEnter:He.useCallback((B)=>{if(F(B))B.preventDefault()},[F]),onItemLeave:He.useCallback((B)=>{if(F(B))return;M.current?.focus(),R(null)},[F]),onTriggerLeave:He.useCallback((B)=>{if(F(B))B.preventDefault()},[F]),pointerGraceTimerRef:ye,onPointerGraceIntentChange:He.useCallback((B)=>{le.current=B},[]),children:St.jsx(Ap,{registry:ee?L:null,children:St.jsx(H,{...fe,children:St.jsx(Ku,{asChild:!0,trapped:a,branches:z,onMountAutoFocus:te(i,(B)=>{B.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:St.jsx(ll,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:g,children:St.jsx($1,{asChild:!0,...k,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:R,onEntryFocus:te(c,(B)=>{if(!y.isUsingKeyboardRef.current)B.preventDefault()}),preventScrollOnEntryFocus:!0,children:St.jsx(Qu,{role:"menu","aria-orientation":"vertical","data-state":wU(v.open),"data-radix-menu-content":"",dir:y.dir,...b,...x,ref:ne,style:{outline:"none",...x.style},onKeyDown:te(x.onKeyDown,(B)=>{let We=B.target.closest("[data-radix-menu-content]")===B.currentTarget,ae=B.ctrlKey||B.altKey||B.metaKey,xe=B.key.length===1;if(We){if(B.key==="Tab")B.preventDefault();if(!ae&&xe)oe(B.key)}let Dt=M.current;if(B.target!==Dt)return;if(!bse.includes(B.key))return;B.preventDefault();let Le=S().filter(($e)=>!$e.disabled).map(($e)=>$e.ref.current);if(sU.includes(B.key))Le.reverse();CU(Le)}),onBlur:te(t.onBlur,(B)=>{if(!B.currentTarget.contains(B.target))window.clearTimeout(ke.current),Y.current=""}),onPointerMove:te(t.onPointerMove,W1((B)=>{let ve=B.target,We=G.current!==B.clientX;if(B.currentTarget.contains(ve)&&We){let ae=B.clientX>G.current?"right":"left";J.current=ae,G.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),hU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{role:"group",...r,ref:n})},"MenuGroup")),bU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{...r,ref:n})},"MenuLabel")),CA="MenuItem",iU="menu.itemSelect",AA=He.forwardRef(Kt(function(t,n){let{disabled:o=!1,onSelect:r,...a}=t,i=He.useRef(null),s=EA(CA,t.__scopeMenu),l=fU(CA,t.__scopeMenu),c=Ce(n,i),d=He.useRef(!1),u=Kt(()=>{let p=i.current;if(!o&&p){let f=new CustomEvent(iU,{bubbles:!0,cancelable:!0});if(p.addEventListener(iU,(g)=>r?.(g),{once:!0}),vv(p,f),f.defaultPrevented)d.current=!1;else s.onClose()}},"handleSelect");return St.jsx(Ese,{...a,ref:c,disabled:o,onClick:te(t.onClick,u),onPointerDown:(p)=>{t.onPointerDown?.(p),d.current=!0},onPointerUp:te(t.onPointerUp,(p)=>{if(!d.current)p.currentTarget?.click()}),onKeyDown:te(t.onKeyDown,(p)=>{if(o||p.target!==p.currentTarget)return;if(l.searchRef.current!==""&&p.key===" ")return;if(kA.includes(p.key))p.currentTarget.click(),p.preventDefault()})})},"MenuItem")),Ese=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:a,...i}=t,s=fU(CA,o),l=lU(o),c=He.useRef(null),d=Ce(n,c),[u,p]=He.useState(!1),[f,g]=He.useState("");return He.useEffect(()=>{let m=c.current;if(m)g((m.textContent??"").trim())},[i.children]),St.jsx(SA.ItemSlot,{scope:o,disabled:r,textValue:a??f,children:St.jsx(Y1,{asChild:!0,...l,focusable:!r,children:St.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:te(t.onPointerMove,W1((m)=>{if(r)s.onItemLeave(m);else if(s.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:te(t.onPointerLeave,W1((m)=>s.onItemLeave(m))),onFocus:te(t.onFocus,()=>p(!0)),onBlur:te(t.onBlur,()=>p(!1))})})})},"MenuItemImpl"));var Ase="MenuRadioGroup",[Mse,Dse]=$p(Ase,{value:void 0,onValueChange:Kt(()=>{},"onValueChange")}),vU=He.forwardRef(Kt(function(t,n){let{value:o,onValueChange:r,...a}=t,i=Lo(r);return St.jsx(Mse,{scope:t.__scopeMenu,value:o,onValueChange:i,children:St.jsx(hU,{...a,ref:n})})},"MenuRadioGroup")),Pse="MenuRadioItem",xU=He.forwardRef(Kt(function(t,n){let{value:o,...r}=t,a=Dse(Pse,t.__scopeMenu),i=o===a.value;return St.jsx(_se,{scope:t.__scopeMenu,checked:i,children:St.jsx(AA,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":SU(i),onSelect:te(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Ose="MenuItemIndicator",[_se,YSe]=$p(Ose,{checked:!1});var yU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator"));var Ise="MenuSub",[WSe,XSe]=$p(Ise);function wU(e){return e?"open":"closed"}Kt(wU,"getOpenState");function kU(e){return e==="indeterminate"}Kt(kU,"isIndeterminate");function SU(e){return kU(e)?"indeterminate":e?"checked":"unchecked"}Kt(SU,"getCheckedState");function CU(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}Kt(CU,"focusFirst");function NU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}Kt(NU,"wrapArray");function RU(e,t,n){let r=t.length>1&&Array.from(t).every((c)=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1,i=NU(e,Math.max(a,0));if(r.length===1)i=i.filter((c)=>c!==n);let l=i.find((c)=>c.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}Kt(RU,"getNextMatch");function TU(e,t){let{x:n,y:o}=e,r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],{x:c,y:d}=s,{x:u,y:p}=l;if(d>o!==p>o&&n<(u-c)*(o-d)/(p-d)+c)r=!r}return r}Kt(TU,"isPointInPolygon");function EU(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return TU(n,t)}Kt(EU,"isPointerInGraceArea");function W1(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}Kt(W1,"whenMouse");var Li=h(w(),1),Lse=Object.defineProperty,hc=(e,t)=>Lse(e,"name",{value:t,configurable:!0}),MA="DropdownMenu",[Bse,uCe]=en(MA,[RA]),bc=RA(),[Hse,AU]=Bse(MA),jse=hc((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=bc(t),c=ni.useRef(null),[d,u]=Jn({prop:r,defaultProp:a??!1,onChange:i,caller:MA});return Li.jsx(Hse,{scope:t,triggerId:rn(),triggerRef:c,contentId:rn(),open:d,onOpenChange:u,onOpenToggle:ni.useCallback(()=>u((p)=>!p),[u]),modal:s,children:Li.jsx(cU,{...l,open:d,onOpenChange:u,dir:o,modal:s,children:n})})},"DropdownMenu"),Use="DropdownMenuTrigger",Gse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...a}=t,i=AU(Use,o),s=bc(o),l=Ce(n,i.triggerRef);return Li.jsx(uU,{asChild:!0,...s,children:Li.jsx(be.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:l,onPointerDown:te(t.onPointerDown,(c)=>{if(!r&&c.button===0&&c.ctrlKey===!1){if(i.onOpenToggle(),!i.open)c.preventDefault()}}),onKeyDown:te(t.onKeyDown,(c)=>{if(r)return;if(["Enter"," "].includes(c.key))i.onOpenToggle();if(c.key==="ArrowDown")i.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(c.key))c.preventDefault()})})})},"DropdownMenuTrigger")),Fse=hc((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=bc(t);return Li.jsx(pU,{...o,...n})},"DropdownMenuPortal"),Vse="DropdownMenuContent",Kse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=AU(Vse,o),i=bc(o),s=ni.useRef(!1);return Li.jsx(mU,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:n,onCloseAutoFocus:te(t.onCloseAutoFocus,(l)=>{if(!s.current)a.triggerRef.current?.focus();s.current=!1,l.preventDefault()}),onInteractOutside:te(t.onInteractOutside,(l)=>{let c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;if(!a.modal||u)s.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent"));var qse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(bU,{...a,...r,ref:n})},"DropdownMenuLabel")),$se=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(AA,{...a,...r,ref:n})},"DropdownMenuItem"));var Yse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(vU,{...a,...r,ref:n})},"DropdownMenuRadioGroup")),Wse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(xU,{...a,...r,ref:n})},"DropdownMenuRadioItem"));var Xse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(yU,{...a,...r,ref:n})},"DropdownMenuSeparator"));var DU=h(I(),1);var PU=h(w(),1),Qse=Object.defineProperty,Zse=(e,t)=>Qse(e,"name",{value:t,configurable:!0}),Jse=DU.forwardRef(Zse(function(t,n){return PU.jsx(be.label,{...t,ref:n,onMouseDown:(o)=>{if(o.target.closest("button, input, select, textarea"))return;if(t.onMouseDown?.(o),!o.defaultPrevented&&o.detail>1)o.preventDefault()}})},"Label"));var dn=h(I(),1);var Uo=h(w(),1),ele=Object.defineProperty,gl=(e,t)=>ele(e,"name",{value:t,configurable:!0}),DA="Popover",[_U,TCe]=en(DA,[zi]),Q1=zi(),[tle,Yp]=_U(DA),nle=gl((e)=>{let{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:i=!1}=e,s=Q1(t),l=dn.useRef(null),[c,d]=dn.useState(!1),[u,p]=dn.useState(0),[f,g]=dn.useState(0),[m,x]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:DA});return Uo.jsx(Xu,{...s,children:Uo.jsx(tle,{scope:t,contentId:rn(),titleId:rn(),descriptionId:rn(),titlePresent:u>0,descriptionPresent:f>0,setTitleCount:p,setDescriptionCount:g,triggerRef:l,open:m,onOpenChange:x,onOpenToggle:dn.useCallback(()=>x((v)=>!v),[x]),hasCustomAnchor:c,onCustomAnchorAdd:dn.useCallback(()=>d(!0),[]),onCustomAnchorRemove:dn.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),ole="PopoverAnchor",rle=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,...r}=t,a=Yp(ole,o),i=Q1(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return dn.useEffect(()=>(s(),()=>l()),[s,l]),Uo.jsx(gc,{...i,...r,ref:n})},"PopoverAnchor")),ale="PopoverTrigger",ile=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,...r}=t,a=Yp(ale,o),i=Q1(o),s=Ce(n,a.triggerRef),l=Uo.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":PA(a.open),...r,ref:s,onClick:te(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:Uo.jsx(gc,{asChild:!0,...i,children:l})},"PopoverTrigger")),IU="PopoverPortal",[sle,lle]=_U(IU,{forceMount:void 0}),cle=gl((e)=>{let{__scopePopover:t,forceMount:n,children:o,container:r}=e,a=Yp(IU,t);return Uo.jsx(sle,{scope:t,forceMount:n,children:Uo.jsx(Pr,{present:n||a.open,children:Uo.jsx(cl,{asChild:!0,container:r,children:o})})})},"PopoverPortal"),Pv="PopoverContent",ule=dn.forwardRef(gl(function(t,n){let o=lle(Pv,t.__scopePopover),{forceMount:r=o.forceMount,...a}=t,i=Yp(Pv,t.__scopePopover);return Uo.jsx(Pr,{present:r||i.open,children:i.modal?Uo.jsx(ple,{...a,ref:n}):Uo.jsx(fle,{...a,ref:n})})},"PopoverContent")),dle=lr("PopoverContent.RemoveScroll"),ple=dn.forwardRef(gl(function(t,n){let o=Yp(Pv,t.__scopePopover),r=dn.useRef(null),a=Ce(n,r),i=dn.useRef(!1),{nodes:s,registry:l}=Mp();return dn.useEffect(()=>{let c=r.current;if(c)return qu(c)},[]),Uo.jsx(lc,{as:dle,allowPinchZoom:!0,shards:dn.useMemo(()=>[r,...s.map((c)=>({current:c}))],[r,s]),children:Uo.jsx(zU,{...t,ref:a,branchNodes:s,branchRegistry:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(t.onCloseAutoFocus,(c)=>{if(c.preventDefault(),!i.current)o.triggerRef.current?.focus()}),onPointerDownOutside:te(t.onPointerDownOutside,(c)=>{let d=c.detail.originalEvent,u=d.button===0&&d.ctrlKey===!0,p=d.button===2||u;i.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:te(t.onFocusOutside,(c)=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),fle=dn.forwardRef(gl(function(t,n){let o=Yp(Pv,t.__scopePopover),r=dn.useRef(!1),a=dn.useRef(!1);return Uo.jsx(zU,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(i)=>{if(t.onCloseAutoFocus?.(i),!i.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();i.preventDefault()}r.current=!1,a.current=!1},onInteractOutside:(i)=>{if(t.onInteractOutside?.(i),!i.defaultPrevented){if(r.current=!0,i.detail.originalEvent.type==="pointerdown")a.current=!0}let s=i.target;if(o.triggerRef.current?.contains(s))i.preventDefault();if(i.detail.originalEvent.type==="focusin"&&a.current)i.preventDefault()}})},"PopoverContentNonModal")),zU=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,"aria-describedby":p,branchNodes:f,branchRegistry:g,...m}=t,x=Yp(Pv,o),v=Q1(o),[y,b]=dn.useState(null),k=Ce(n,b);return Dp(y),ul(),Uo.jsx(Ap,{registry:g,children:Uo.jsx(Ku,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:a,onUnmountAutoFocus:i,children:Uo.jsx(ll,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>x.onOpenChange(!1),deferPointerDownOutside:!0,children:Uo.jsx(Qu,{"data-state":PA(x.open),role:"dialog",id:x.contentId,"aria-labelledby":x.titlePresent?x.titleId:void 0,"aria-describedby":x.descriptionPresent?LU(p,x.descriptionId):p,...v,...m,ref:k,style:{...m.style,...{"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}})})})})},"PopoverContentImpl"));function PA(e){return e?"open":"closed"}gl(PA,"getState");function LU(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}gl(LU,"concatAriaDescribedby");var se=h(I(),1),IA=h(fi(),1);var mle=Object.defineProperty,gle=(e,t)=>mle(e,"name",{value:t,configurable:!0});function Z1(e,[t,n]){return Math.min(n,Math.max(t,e))}gle(Z1,"clamp");var HU=h(I(),1);var jU=h(w(),1),hle=Object.defineProperty,ble=(e,t)=>hle(e,"name",{value:t,configurable:!0}),OA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),UU=HU.forwardRef(ble(function(t,n){return jU.jsx(be.span,{...t,ref:n,style:{...OA,...t.style}})},"VisuallyHidden"));var Ge=h(w(),1),xle=Object.defineProperty,tn=(e,t)=>xle(e,"name",{value:t,configurable:!0}),GU={ItemAligned:"item-aligned",Popper:"popper"},yle={LTR:"ltr",RTL:"rtl"},wle=[" ","Enter","ArrowUp","ArrowDown"],kle=[" ","Enter"],Ag="Select",[ek,zA,Sle]=Hp(Ag),[Xp,QCe]=en(Ag,[Sle,zi]),LA=zi(),[Cle,ed]=Xp(Ag),[Nle,Rle]=Xp(Ag);function KU(e){let{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:p,required:f,form:g,internal_do_not_use_render:m}=e,x=LA(t),[v,y]=se.useState(null),[b,k]=se.useState(null),[S,C]=se.useState(!1),R=pc(c),[M,D]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:Ag}),[E,z]=Jn({prop:i,defaultProp:s,onChange:l,caller:Ag}),L=se.useRef(null),ee=se.useRef(!1),[ne,ke]=se.useState(null),Y=tn((B)=>{ke({value:B,hasConsumerStoppedPropagation:ee.current}),z(B)},"handleUserSelect"),ye=se.useRef(E);se.useEffect(()=>{let B=g?v?.ownerDocument.getElementById(g):v?.form;if(B instanceof HTMLFormElement){let ve=tn(()=>z(ye.current),"reset");return B.addEventListener("reset",ve),()=>B.removeEventListener("reset",ve)}},[g,v,z]);let le=v?!!g||!!v.closest("form"):!0,[J,G]=se.useState(new Set),Fe=rn(),H=Array.from(J).map((B)=>B.props.value).join(";"),fe=se.useCallback((B)=>{G((ve)=>new Set(ve).add(B))},[]),oe=se.useCallback((B)=>{G((ve)=>{let We=new Set(ve);return We.delete(B),We})},[]),F={required:f,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Fe,value:E,onValueChange:z,hasConsumerStoppedPropagationRef:ee,userSelection:ne,onUserSelect:Y,open:M,onOpenChange:D,dir:R,triggerPointerDownPosRef:L,disabled:p,name:d,autoComplete:u,form:g,nativeOptions:J,nativeSelectKey:H,isFormControl:le};return Ge.jsx(Xu,{...x,children:Ge.jsx(Cle,{scope:t,...F,children:Ge.jsx(ek.Provider,{scope:t,children:Ge.jsx(Nle,{scope:t,onNativeOptionAdd:fe,onNativeOptionRemove:oe,children:YU(m)?m(F):n})})})})}tn(KU,"SelectProvider");var Tle=tn((e)=>{let{__scopeSelect:t,children:n,...o}=e;return Ge.jsx(KU,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:r})=>Ge.jsxs(Ge.Fragment,{children:[n,r?Ge.jsx(Zle,{__scopeSelect:t}):null]})})},"Select"),Ele="SelectTrigger",Ale=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,disabled:r=!1,...a}=t,i=LA(o),s=ed(Ele,o),l=s.disabled||r,c=Ce(n,s.onTriggerChange),d=zA(o),u=se.useRef("touch"),[p,f,g]=BA((x)=>{let v=d().filter((k)=>!k.disabled),y=v.find((k)=>k.value===s.value),b=HA(v,x,y);if(b!==void 0)s.onUserSelect(b.value)}),m=tn((x)=>{if(!l)s.onOpenChange(!0),g();if(x)s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)}},"handleOpen");return Ge.jsx(gc,{asChild:!0,...i,children:Ge.jsx(be.button,{type:"button",role:"combobox","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ov(s.value)?"":void 0,...a,ref:c,onClick:te(a.onClick,(x)=>{if(x.currentTarget.focus(),u.current!=="mouse")m(x)}),onPointerDown:te(a.onPointerDown,(x)=>{u.current=x.pointerType;let v=x.target;if(v.hasPointerCapture(x.pointerId))v.releasePointerCapture(x.pointerId);if(x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse")m(x),x.preventDefault()}),onKeyDown:te(a.onKeyDown,(x)=>{let v=p.current!=="";if(!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1)s.hasConsumerStoppedPropagationRef.current=x.isPropagationStopped(),f(x.key);if(v&&x.key===" ")return;if(wle.includes(x.key))m(),x.preventDefault()})})})},"SelectTrigger")),Mle="SelectValue",Dle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=t,c=ed(Mle,o),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=Ce(n,c.onValueNodeChange);wt(()=>{d(u)},[d,u]);let f=Ov(c.value);return Ge.jsx(be.span,{...l,asChild:f?!1:l.asChild,ref:p,style:{pointerEvents:"none"},children:Ge.jsx(se.Fragment,{children:f?s:i},f?"placeholder":"value")})},"SelectValue")),Ple=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,children:r,...a}=t;return Ge.jsx(be.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})},"SelectIcon")),Ole="SelectPortal",[_le,Ile]=Xp(Ole,{forceMount:void 0}),zle=tn((e)=>{let{__scopeSelect:t,forceMount:n,...o}=e;return Ge.jsx(_le,{scope:e.__scopeSelect,forceMount:n,children:Ge.jsx(cl,{asChild:!0,...o})})},"SelectPortal"),Wp="SelectContent",Lle=se.forwardRef(tn(function(t,n){let o=Ile(Wp,t.__scopeSelect),{forceMount:r=o.forceMount,...a}=t,i=ed(Wp,t.__scopeSelect),[s,l]=se.useState();return wt(()=>{l(new DocumentFragment)},[]),Ge.jsx(Pr,{present:r||i.open,children:({present:c})=>c?Ge.jsx(jle,{...a,ref:n}):Ge.jsx(Ble,{...a,fragment:s})})},"SelectContent")),Ble=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,children:r,fragment:a}=t;if(!a)return null;return IA.createPortal(Ge.jsx(qU,{scope:o,children:Ge.jsx(ek.Slot,{scope:o,children:Ge.jsx("div",{ref:n,children:r})})}),a)},"SelectContentFragment")),ws=10,[qU,tk]=Xp(Wp),Hle=lr("SelectContent.RemoveScroll"),jle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o}=t,{position:r=GU.ItemAligned,onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:x,avoidCollisions:v,...y}=t,b=ed(Wp,o),[k,S]=se.useState(null),[C,R]=se.useState(null),M=Ce(n,S),[D,E]=se.useState(null),[z,L]=se.useState(null),ee=zA(o),[ne,ke]=se.useState(!1),Y=se.useRef(!1),ye=se.useRef(!1),le=se.useRef(!1);se.useEffect(()=>{if(k)return qu(k)},[k]),ul();let J=se.useCallback((xe)=>{let[Dt,...gt]=ee().map((st)=>st.ref.current),[Le]=gt.slice(-1),$e=document.activeElement;for(let st of xe){if(st===$e)return;if(st?.scrollIntoView({block:"nearest"}),st===Dt&&C)C.scrollTop=0;if(st===Le&&C)C.scrollTop=C.scrollHeight;if(st?.focus(),document.activeElement!==$e)return}},[ee,C]),G=se.useCallback(()=>J([D,k]),[J,D,k]);se.useEffect(()=>{if(ne)G()},[ne,G]);let{onOpenChange:Fe,triggerPointerDownPosRef:H}=b;se.useEffect(()=>{if(k){let xe={x:0,y:0},Dt=tn((Le)=>{xe={x:Math.abs(Math.round(Le.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(H.current?.y??0))}},"handlePointerMove"),gt=tn((Le)=>{if(xe.x<=10&&xe.y<=10)Le.preventDefault();else if(!Le.composedPath().includes(k))Fe(!1);document.removeEventListener("pointermove",Dt),H.current=null},"handlePointerUp");if(H.current!==null)document.addEventListener("pointermove",Dt),document.addEventListener("pointerup",gt,{capture:!0,once:!0});return()=>{document.removeEventListener("pointermove",Dt),document.removeEventListener("pointerup",gt,{capture:!0})}}},[k,Fe,H]),se.useEffect(()=>{let xe=tn(()=>Fe(!1),"close");return window.addEventListener("blur",xe),window.addEventListener("resize",xe),()=>{window.removeEventListener("blur",xe),window.removeEventListener("resize",xe)}},[Fe]);let[fe,oe]=BA((xe)=>{let Dt=ee().filter(($e)=>!$e.disabled),gt=Dt.find(($e)=>$e.ref.current===document.activeElement),Le=HA(Dt,xe,gt);if(Le)setTimeout(()=>Le.ref.current?.focus())}),F=se.useCallback((xe,Dt,gt)=>{let Le=!ye.current;if(Le)ye.current=!0;let $e=!Y.current&&!gt;if(b.value!==void 0&&b.value===Dt||$e){if(E(xe),$e)Y.current=!0}else if(Le)E(xe)},[b.value]),B=se.useCallback(()=>k?.focus(),[k]),ve=se.useCallback((xe,Dt,gt)=>{if(!xe)return;let Le=!le.current;if(Le)le.current=!0;let $e=!Y.current&&!gt;if(b.value!==void 0&&b.value===Dt||$e)L(xe);else if(Le)L(xe)},[b.value]),We=r===GU.Popper?FU:Ule,ae=We===FU?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:x,avoidCollisions:v}:{};return Ge.jsx(qU,{scope:o,content:k,viewport:C,onViewportChange:R,itemRefCallback:F,selectedItem:D,onItemLeave:B,itemTextRefCallback:ve,focusSelectedItem:G,selectedItemText:z,position:r,isPositioned:ne,searchRef:fe,children:Ge.jsx(lc,{as:Hle,allowPinchZoom:!0,children:Ge.jsx(Ku,{asChild:!0,trapped:b.open,onMountAutoFocus:(xe)=>{xe.preventDefault()},onUnmountAutoFocus:te(a,(xe)=>{b.trigger?.focus({preventScroll:!0}),xe.preventDefault()}),children:Ge.jsx(ll,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:(xe)=>xe.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:Ge.jsx(We,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:(xe)=>xe.preventDefault(),...y,...ae,onPlaced:()=>ke(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,(xe)=>{let Dt=xe.ctrlKey||xe.altKey||xe.metaKey;if(xe.key==="Tab")xe.preventDefault();if(!Dt&&xe.key.length===1)oe(xe.key);if(["ArrowUp","ArrowDown","Home","End"].includes(xe.key)){let Le=ee().filter(($e)=>!$e.disabled).map(($e)=>$e.ref.current);if(["ArrowUp","End"].includes(xe.key))Le=Le.slice().reverse();if(["ArrowUp","ArrowDown"].includes(xe.key)){let $e=xe.target,st=Le.indexOf($e);Le=Le.slice(st+1)}setTimeout(()=>J(Le)),xe.preventDefault()}})})})})})})},"SelectContentImpl")),Ule=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,onPlaced:r,...a}=t,i=ed(Wp,o),s=tk(Wp,o),[l,c]=se.useState(null),[d,u]=se.useState(null),p=Ce(n,u),f=zA(o),g=se.useRef(!1),m=se.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,k=se.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&x&&v&&y){let M=i.trigger.getBoundingClientRect(),D=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),z=y.getBoundingClientRect();if(i.dir!==yle.RTL){let gt=z.left-D.left,Le=E.left-gt,$e=M.left-Le,st=M.width+$e,Hf=Math.max(st,D.width),Pl=window.innerWidth-ws,jf=Z1(Le,[ws,Math.max(ws,Pl-Hf)]);l.style.minWidth=st+"px",l.style.left=jf+"px"}else{let gt=D.right-z.right,Le=window.innerWidth-E.right-gt,$e=window.innerWidth-M.right-Le,st=M.width+$e,Hf=Math.max(st,D.width),Pl=window.innerWidth-ws,jf=Z1(Le,[ws,Math.max(ws,Pl-Hf)]);l.style.minWidth=st+"px",l.style.right=jf+"px"}let L=f(),ee=window.innerHeight-ws*2,ne=x.scrollHeight,ke=window.getComputedStyle(d),Y=parseInt(ke.borderTopWidth,10),ye=parseInt(ke.paddingTop,10),le=parseInt(ke.borderBottomWidth,10),J=parseInt(ke.paddingBottom,10),G=Y+ye+ne+J+le,Fe=Math.min(v.offsetHeight*5,G),H=window.getComputedStyle(x),fe=parseInt(H.paddingTop,10),oe=parseInt(H.paddingBottom,10),F=M.top+M.height/2-ws,B=ee-F,ve=v.offsetHeight/2,We=v.offsetTop+ve,ae=Y+ye+We,xe=G-ae;if(ae<=F){let gt=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";let Le=d.clientHeight-x.offsetTop-x.offsetHeight,$e=Math.max(B,ve+(gt?oe:0)+Le+le),st=ae+$e;l.style.height=st+"px"}else{let gt=L.length>0&&v===L[0].ref.current;l.style.top="0px";let $e=Math.max(F,Y+x.offsetTop+(gt?fe:0)+ve)+xe;l.style.height=$e+"px",x.scrollTop=ae-F+x.offsetTop}l.style.margin=`${ws}px 0`,l.style.minHeight=Fe+"px",l.style.maxHeight=ee+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[f,i.trigger,i.valueNode,l,d,x,v,y,i.dir,r]);wt(()=>k(),[k]);let[S,C]=se.useState();wt(()=>{if(d)C(window.getComputedStyle(d).zIndex)},[d]);let R=se.useCallback((M)=>{if(M&&m.current===!0)k(),b?.(),m.current=!1},[k,b]);return Ge.jsx(Gle,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:R,children:Ge.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:Ge.jsx(be.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})},"SelectItemAlignedPosition")),FU=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,align:r="start",collisionPadding:a=ws,...i}=t,s=LA(o);return Ge.jsx(Qu,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,...{"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}})},"SelectPopperPosition")),[Gle,Fle]=Xp(Wp,{}),VU="SelectViewport",Vle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,nonce:r,...a}=t,i=tk(VU,o),s=Fle(VU,o),l=Ce(n,i.onViewportChange),c=se.useRef(0);return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),Ge.jsx(ek.Slot,{scope:o,children:Ge.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:te(a.onScroll,(d)=>{let u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=s;if(f?.current&&p){let g=Math.abs(c.current-u.scrollTop);if(g>0){let m=window.innerHeight-ws*2,x=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),y=Math.max(x,v);if(y<m){let b=y+g,k=Math.min(m,b),S=b-k;if(p.style.height=k+"px",p.style.bottom==="0px")u.scrollTop=S>0?S:0,p.style.justifyContent="flex-end"}}}c.current=u.scrollTop})})})]})},"SelectViewport")),Kle="SelectGroup",[ZCe,JCe]=Xp(Kle);var _A="SelectItem",[qle,$U]=Xp(_A),$le=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=ed(_A,o),c=tk(_A,o),d=l.value===r,[u,p]=se.useState(i??""),[f,g]=se.useState(!1),m=Lo((k)=>c.itemRefCallback?.(k,r,a)),x=Ce(n,m),v=rn(),y=se.useRef("touch");function b(k){l.hasConsumerStoppedPropagationRef.current=k.isPropagationStopped(),l.onUserSelect(r),l.onOpenChange(!1)}return tn(b,"handleSelect"),Ge.jsx(qle,{scope:o,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:se.useCallback((k)=>{p((S)=>S||(k?.textContent??"").trim())},[]),children:Ge.jsx(ek.ItemSlot,{scope:o,value:r,disabled:a,textValue:u,children:Ge.jsx(be.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:x,onFocus:te(s.onFocus,()=>g(!0)),onBlur:te(s.onBlur,()=>g(!1)),onClick:te(s.onClick,(k)=>{if(a)return;if(y.current!=="mouse")b(k)}),onPointerUp:te(s.onPointerUp,(k)=>{if(a)return;if(y.current==="mouse")b(k)}),onPointerDown:te(s.onPointerDown,(k)=>{y.current=k.pointerType}),onPointerMove:te(s.onPointerMove,(k)=>{if(y.current=k.pointerType,a)c.onItemLeave?.();else if(y.current==="mouse")k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,(k)=>{if(k.currentTarget===document.activeElement)c.onItemLeave?.()}),onKeyDown:te(s.onKeyDown,(k)=>{if(a||k.target!==k.currentTarget)return;if(c.searchRef?.current!==""&&k.key===" ")return;if(kle.includes(k.key))b(k);if(k.key===" ")k.preventDefault()})})})})},"SelectItem")),J1="SelectItemText",Yle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,className:r,style:a,...i}=t,s=ed(J1,o),l=tk(J1,o),c=$U(J1,o),d=Rle(J1,o),[u,p]=se.useState(null),f=Lo((b)=>l.itemTextRefCallback?.(b,c.value,c.disabled)),g=Ce(n,p,c.onItemTextChange,f),m=u?.textContent,x=se.useMemo(()=>Ge.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return wt(()=>(v(x),()=>y(x)),[v,y,x]),Ge.jsxs(Ge.Fragment,{children:[Ge.jsx(be.span,{id:c.textId,...i,ref:g}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Ov(s.value)?IA.createPortal(i.children,s.valueNode):null]})},"SelectItemText")),Wle="SelectItemIndicator",Xle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,...r}=t;return $U(Wle,o).isSelected?Ge.jsx(be.span,{"aria-hidden":!0,...r,ref:n}):null},"SelectItemIndicator"));var Qle="SelectBubbleInput",Zle=se.forwardRef(tn(function({__scopeSelect:t,...n},o){let r=ed(Qle,t),{value:a,onValueChange:i,required:s,disabled:l,name:c,autoComplete:d,form:u,userSelection:p}=r,{nativeOptions:f,nativeSelectKey:g}=r,m=se.useRef(null),x=Ce(o,m),v=a??"",y=se.useRef(v),b=se.useRef(p),k=se.useRef(!1),S=Array.from(f).some((C)=>(C.props.value??"")==="");return se.useEffect(()=>{let C=m.current;if(!C)return;let R=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(R,"value").set,E=p!==null&&p!==b.current;b.current=p;let z=y.current!==v;y.current=v;let L=E&&z;if(E&&!z&&p.value!==v&&!p.hasConsumerStoppedPropagation&&D){k.current=!0;try{D.call(C,p.value),C.dispatchEvent(new Event("change",{bubbles:!0}))}finally{k.current=!1,D.call(C,v)}return}let ee=L&&!p.hasConsumerStoppedPropagation;if(z&&D){let ne=new Event("change",{bubbles:ee});D.call(C,v),C.dispatchEvent(ne)}},[v,p]),Ge.jsxs(be.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:c,autoComplete:d,disabled:l,form:u,onChange:(C)=>{if(!k.current)i(C.target.value)},...n,style:{...OA,...n.style},ref:x,defaultValue:v,children:[Ov(a)&&!S?Ge.jsx("option",{value:""}):null,Array.from(f)]},g)},"SelectBubbleInput"));function YU(e){return typeof e==="function"}tn(YU,"isFunction");function Ov(e){return e===""||e===void 0}tn(Ov,"shouldShowPlaceholder");function BA(e){let t=Lo(e),n=se.useRef(""),o=se.useRef(0),r=se.useCallback((i)=>{let s=n.current+i;t(s);function l(c){if(n.current=c,window.clearTimeout(o.current),c!=="")o.current=window.setTimeout(()=>l(""),1000)}tn(l,"updateSearch"),l(s)},[t]),a=se.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return se.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}tn(BA,"useTypeaheadSearch");function HA(e,t,n){let r=t.length>1&&Array.from(t).every((c)=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1,i=WU(e,Math.max(a,0));if(r.length===1)i=i.filter((c)=>c!==n);let l=i.find((c)=>c.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}tn(HA,"findNextItem");function WU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}tn(WU,"wrapArray");var Go=h(I(),1);var Bi=h(w(),1),Jle=Object.defineProperty,td=(e,t)=>Jle(e,"name",{value:t,configurable:!0}),jA="Switch",[ece,iNe]=en(jA),[tce,UA]=ece(jA);function QU(e){let{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:u}=e,[p,f]=Jn({prop:n,defaultProp:r??!1,onChange:l,caller:jA}),[g,m]=Go.useState(null),[x,v]=Go.useState(null),[y,b]=Go.useState(null),k=g?!!i||!!g.closest("form"):!0,S={checked:p,setChecked:f,disabled:a,control:g,setControl:m,name:s,form:i,value:d,userClick:y,onUserClick:b,required:c,defaultChecked:r,isFormControl:k,bubbleInput:x,setBubbleInput:v};return Bi.jsx(tce,{scope:t,...S,children:ZU(u)?u(S):o})}td(QU,"SwitchProvider");var nce="SwitchTrigger",oce=Go.forwardRef(td(function({__scopeSwitch:t,onClick:n,...o},r){let{control:a,form:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,onUserClick:f,isFormControl:g,bubbleInput:m}=UA(nce,t),x=Ce(r,u),v=Go.useRef(c);return Go.useEffect(()=>{let y=i?a?.ownerDocument.getElementById(i):a?.form;if(y instanceof HTMLFormElement){let b=td(()=>p(v.current),"reset");return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[a,i,p]),Bi.jsx(be.button,{type:"button",role:"switch","aria-checked":c,"aria-required":d,"data-state":GA(c),"data-disabled":l?"":void 0,disabled:l,value:s,...o,ref:x,onClick:te(n,(y)=>{let b=y.isPropagationStopped();if(f({requestedChecked:!c,hasConsumerStoppedPropagation:b}),p((k)=>!k),m&&g){if(!b)y.stopPropagation()}})})},"SwitchTrigger")),rce=Go.forwardRef(td(function(t,n){let{__scopeSwitch:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=t;return Bi.jsx(QU,{__scopeSwitch:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>Bi.jsxs(Bi.Fragment,{children:[Bi.jsx(oce,{...p,ref:n,__scopeSwitch:o}),f&&Bi.jsx(lce,{__scopeSwitch:o})]})})},"Switch")),ace="SwitchThumb",ice=Go.forwardRef(td(function(t,n){let{__scopeSwitch:o,...r}=t,a=UA(ace,o);return Bi.jsx(be.span,{"data-state":GA(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),sce="SwitchBubbleInput",lce=Go.forwardRef(td(function({__scopeSwitch:t,onClick:n,...o},r){let{control:a,userClick:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:g,setBubbleInput:m}=UA(sce,t),x=Ce(r,m),v=Bp(a),y=Go.useRef(!1),b=Go.useRef(s),k=Go.useRef(i),S=Go.useRef(null);Go.useEffect(()=>{let R=g;if(!R)return;let M=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(M,"checked").set;if(!E)return;let z=b.current!==s;b.current=s;let L=i!==null&&i!==k.current;if(k.current=i,L){if(S.current=z?null:i,z)E.call(R,s);R.dispatchEvent(new Event("click",{bubbles:!i.hasConsumerStoppedPropagation}))}else if(z){let ee=S.current;S.current=null;let ne=ee?.requestedChecked===s;y.current=!0,E.call(R,s),R.dispatchEvent(new Event("click",{bubbles:!(ne&&ee.hasConsumerStoppedPropagation)})),y.current=!1}},[g,s,i]);let C=Go.useRef(s);return Bi.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:c,disabled:d,name:u,value:p,form:f,...o,tabIndex:-1,ref:x,onClick:te(n,(R)=>{if(y.current)R.stopPropagation()}),style:{...o.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function ZU(e){return typeof e==="function"}td(ZU,"isFunction");function GA(e){return e?"checked":"unchecked"}td(GA,"getState");var Mg=h(I(),1);var Qp=h(w(),1),cce=Object.defineProperty,_v=(e,t)=>cce(e,"name",{value:t,configurable:!0}),eG={Automatic:"automatic",Manual:"manual"},FA="Tabs",[uce,mNe]=en(FA,[Eg]),tG=Eg(),[dce,nG]=uce(FA),pce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c=eG.Automatic,...d}=t,u=pc(l),[p,f]=Jn({prop:r,onChange:a,defaultProp:i??"",caller:FA});return Qp.jsx(dce,{scope:o,baseId:rn(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:Qp.jsx(be.div,{dir:u,"data-orientation":s,...d,ref:n})})},"Tabs")),fce="TabsList",mce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,loop:r=!0,...a}=t,i=nG(fce,o),s=tG(o);return Qp.jsx($1,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:Qp.jsx(be.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})},"TabsList")),gce="TabsTrigger",hce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,value:r,disabled:a=!1,...i}=t,s=nG(gce,o),l=tG(o),c=oG(s.baseId,r),d=rG(s.baseId,r),u=r===s.value;return Qp.jsx(Y1,{asChild:!0,...l,focusable:!a,active:u,children:Qp.jsx(be.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:te(t.onMouseDown,(p)=>{if(!a&&p.button===0&&p.ctrlKey===!1)p.currentTarget.focus(),s.onValueChange(r);else p.preventDefault()}),onKeyDown:te(t.onKeyDown,(p)=>{if(a||p.target!==p.currentTarget)return;if([" ","Enter"].includes(p.key))s.onValueChange(r)}),onFocus:te(t.onFocus,()=>{let p=s.activationMode!==eG.Manual;if(!u&&!a&&p)s.onValueChange(r)})})})},"TabsTrigger"));function oG(e,t){return`${e}-trigger-${t}`}_v(oG,"makeTriggerId");function rG(e,t){return`${e}-content-${t}`}_v(rG,"makeContentId");var iG=h(I(),1);var sG=h(w(),1),bce=Object.defineProperty,vce=(e,t)=>bce(e,"name",{value:t,configurable:!0}),xce="Toggle",yce=iG.forwardRef(vce(function(t,n){let{pressed:o,defaultPressed:r,onPressedChange:a,...i}=t,[s,l]=Jn({prop:o,onChange:a,defaultProp:r??!1,caller:xce});return sG.jsx(be.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:n,onClick:te(t.onClick,()=>{if(!t.disabled)l(!s)})})},"Toggle"));var Xe=h(I(),1);var dr=h(w(),1),wce=Object.defineProperty,Fo=(e,t)=>wce(e,"name",{value:t,configurable:!0}),[qA,DNe]=en("Tooltip",[zi]),$A=zi(),kce="TooltipProvider",Sce=700,VA="tooltip.open",[Cce,YA]=qA(kce),Nce=Fo((e)=>{let{__scopeTooltip:t,delayDuration:n=Sce,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=Xe.useRef(!0),s=Xe.useRef(!1),l=Xe.useRef(0);return Xe.useEffect(()=>{let c=l.current;return()=>window.clearTimeout(c)},[]),dr.jsx(Cce,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:Xe.useCallback(()=>{if(o<=0)return;window.clearTimeout(l.current),i.current=!1},[o]),onClose:Xe.useCallback(()=>{if(o<=0)return;window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:s,onPointerInTransitChange:Xe.useCallback((c)=>{s.current=c},[]),disableHoverableContent:r,children:a})},"TooltipProvider"),KA="Tooltip",[Rce,zv]=qA(KA),Tce=Fo((e)=>{let{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=YA(KA,e.__scopeTooltip),c=$A(t),[d,u]=Xe.useState(null),[p,f]=Xe.useState(void 0),g=rn(),m=Xe.useRef(0),x=i??l.disableHoverableContent,v=s??l.delayDuration,y=Xe.useRef(!1),[b,k]=Jn({prop:o,defaultProp:r??!1,onChange:Fo((E)=>{if(E)l.onOpen(),document.dispatchEvent(new CustomEvent(VA));else l.onClose();a?.(E)},"onChange"),caller:KA}),S=Xe.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),C=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,k(!0)},[k]),R=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),M=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,k(!0),m.current=0},v)},[v,k]);return Xe.useEffect(()=>()=>{if(m.current)window.clearTimeout(m.current),m.current=0},[]),dr.jsx(Xu,{...c,children:dr.jsx(Rce,{scope:t,contentId:p??g,setContentId:f,open:b,stateAttribute:S,trigger:d,onTriggerChange:u,onTriggerEnter:Xe.useCallback(()=>{if(l.isOpenDelayedRef.current)M();else C()},[l.isOpenDelayedRef,M,C]),onTriggerLeave:Xe.useCallback(()=>{if(x)R();else window.clearTimeout(m.current),m.current=0},[R,x]),onOpen:C,onClose:R,disableHoverableContent:x,children:n})})},"Tooltip"),cG="TooltipTrigger",Ece=Xe.forwardRef(Fo(function(t,n){let{__scopeTooltip:o,"aria-describedby":r,...a}=t,i=zv(cG,o),s=YA(cG,o),l=$A(o),c=Xe.useRef(null),d=Ce(n,c,i.onTriggerChange),u=Xe.useRef(!1),p=Xe.useRef(!1),f=Xe.useCallback(()=>u.current=!1,[]);return Xe.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),dr.jsx(gc,{asChild:!0,...l,children:dr.jsx(be.button,{"aria-describedby":i.open?vG(r,i.contentId):r,"data-state":i.stateAttribute,...a,ref:d,onPointerMove:te(t.onPointerMove,(g)=>{if(g.pointerType==="touch")return;if(!p.current&&!s.isPointerInTransitRef.current)i.onTriggerEnter(),p.current=!0}),onPointerLeave:te(t.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:te(t.onPointerDown,()=>{if(i.open)i.onClose();u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:te(t.onFocus,()=>{if(!u.current)i.onOpen()}),onBlur:te(t.onBlur,i.onClose),onClick:te(t.onClick,i.onClose)})})},"TooltipTrigger")),uG="TooltipPortal",[Ace,Mce]=qA(uG,{forceMount:void 0}),Dce=Fo((e)=>{let{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=zv(uG,t);return dr.jsx(Ace,{scope:t,forceMount:n,children:dr.jsx(Pr,{present:n||a.open,children:dr.jsx(cl,{asChild:!0,container:r,children:o})})})},"TooltipPortal"),Iv="TooltipContent",Pce=Xe.forwardRef(Fo(function(t,n){let o=Mce(Iv,t.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=t,s=zv(Iv,t.__scopeTooltip);return dr.jsx(Pr,{present:r||s.open,children:s.disableHoverableContent?dr.jsx(dG,{side:a,...i,ref:n}):dr.jsx(Oce,{side:a,...i,ref:n})})},"TooltipContent")),Oce=Xe.forwardRef(Fo(function(t,n){let o=zv(Iv,t.__scopeTooltip),r=YA(Iv,t.__scopeTooltip),a=Xe.useRef(null),i=Ce(n,a),[s,l]=Xe.useState(null),{trigger:c,onClose:d}=o,u=a.current,{onPointerInTransitChange:p}=r,f=Xe.useCallback(()=>{l(null),p(!1)},[p]),g=Xe.useCallback((m,x)=>{let v=m.currentTarget,y={x:m.clientX,y:m.clientY},b=pG(y,v.getBoundingClientRect()),k=fG(y,b),S=mG(x.getBoundingClientRect()),C=hG([...k,...S]);l(C),p(!0)},[p]);return Xe.useEffect(()=>()=>f(),[f]),Xe.useEffect(()=>{if(c&&u){let m=Fo((v)=>g(v,u),"handleTriggerLeave"),x=Fo((v)=>g(v,c),"handleContentLeave");return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",x)}}},[c,u,g,f]),Xe.useEffect(()=>{if(s){let m=Fo((x)=>{let v=x.target,y={x:x.clientX,y:x.clientY},b=c?.contains(v)||u?.contains(v),k=!gG(y,s);if(b)f();else if(k)f(),d()},"handleTrackPointerGrace");return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,s,d,f]),dr.jsx(dG,{...t,ref:i})},"TooltipContentHoverable")),_ce=RE("TooltipContent"),dG=Xe.forwardRef(Fo(function(t,n){let{__scopeTooltip:o,children:r,"aria-label":a,id:i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,d=zv(Iv,o),u=$A(o),{onClose:p}=d,[f,g]=Xe.useState(null),m=Ce(n,g);Dp(f),Xe.useEffect(()=>(document.addEventListener(VA,p),()=>document.removeEventListener(VA,p)),[p]),Xe.useEffect(()=>{if(d.trigger){let v=Fo((y)=>{if(y.target instanceof Node&&y.target.contains(d.trigger))p()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[d.trigger,p]);let{setContentId:x}=d;return wt(()=>(x(i),()=>{x(void 0)}),[i,x]),dr.jsx(ll,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:(v)=>v.preventDefault(),onDismiss:p,children:dr.jsxs(Qu,{"data-state":d.stateAttribute,role:a?void 0:"tooltip",id:a?void 0:d.contentId,...u,...c,ref:m,style:{...c.style,...{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}},children:[dr.jsx(_ce,{children:r}),a?dr.jsx(UU,{id:d.contentId,role:"tooltip",children:a}):null]})})},"TooltipContentImpl"));function pG(e,t){let n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw Error("unreachable")}}Fo(pG,"getExitSideFromRect");function fG(e,t,n=5){let o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}Fo(fG,"getPaddedExitPoints");function mG(e){let{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}Fo(mG,"getPointsFromRect");function gG(e,t){let{x:n,y:o}=e,r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],{x:c,y:d}=s,{x:u,y:p}=l;if(d>o!==p>o&&n<(u-c)*(o-d)/(p-d)+c)r=!r}return r}Fo(gG,"isPointInPolygon");function hG(e){let t=e.slice();return t.sort((n,o)=>{if(n.x<o.x)return-1;else if(n.x>o.x)return 1;else if(n.y<o.y)return-1;else if(n.y>o.y)return 1;else return 0}),bG(t)}Fo(hG,"getHull");function bG(e){if(e.length<=1)return e.slice();let t=[];for(let o=0;o<e.length;o++){let r=e[o];while(t.length>=2){let a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let o=e.length-1;o>=0;o--){let r=e[o];while(n.length>=2){let a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}if(n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y)return t;else return t.concat(n)}Fo(bG,"getHullPresorted");function vG(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}Fo(vG,"concatAriaDescribedby");var yG=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,wG=Ew,nk=(e,t)=>(n)=>{var o;if((t===null||t===void 0?void 0:t.variants)==null)return wG(e,n===null||n===void 0?void 0:n.class,n===null||n===void 0?void 0:n.className);let{variants:r,defaultVariants:a}=t,i=Object.keys(r).map((c)=>{let d=n===null||n===void 0?void 0:n[c],u=a===null||a===void 0?void 0:a[c];if(d===null)return null;let p=yG(d)||yG(u);return r[c][p]}),s=n&&Object.entries(n).reduce((c,d)=>{let[u,p]=d;if(p===void 0)return c;return c[u]=p,c},{}),l=t===null||t===void 0?void 0:(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,d)=>{let{class:u,className:p,...f}=d;return Object.entries(f).every((g)=>{let[m,x]=g;return Array.isArray(x)?x.includes({...a,...s}[m]):{...a,...s}[m]===x})?[...c,u,p]:c},[]);return wG(e,i,l,n===null||n===void 0?void 0:n.class,n===null||n===void 0?void 0:n.className)};var kG=h(w(),1),ok=nk("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-sm border px-3 py-1 text-base font-medium shadow-sm transition-colors disabled:cursor-default disabled:opacity-50",{variants:{variant:{default:"border-border bg-card text-foreground hover:border-muted-foreground",primary:"border-primary bg-primary text-primary-foreground hover:bg-[color-mix(in_srgb,var(--accent)_88%,var(--ink))]",ghost:"border-transparent bg-transparent text-muted-foreground shadow-none hover:bg-muted hover:text-foreground",danger:"border-border bg-card text-danger hover:border-danger"},size:{md:"min-h-(--btn-s)",sm:"min-h-(--btn-xs) px-2 text-sm"}},defaultVariants:{variant:"default",size:"md"}});function A({className:e,variant:t,size:n,asChild:o,type:r="button",...a}){let i=o?jre:"button";return kG.jsx(i,{...o?{}:{type:r},className:N(ok({variant:t,size:n}),e),...a})}var vc=h(w(),1),rk=Yae,Lv=({className:e,...t})=>vc.jsx(tie,{className:N("text-lg font-semibold",e),...t}),Bv=({className:e,...t})=>vc.jsx(nie,{className:N("text-base text-muted-foreground",e),...t});function ak({className:e,...t}){return vc.jsxs(Wae,{container:rr(),children:[vc.jsx(Xae,{className:"fixed inset-0 z-50 bg-black/45"}),vc.jsx(eie,{className:N("fixed left-1/2 top-1/2 z-50 flex w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col gap-2.5 rounded-lg border border-border bg-background p-4 text-foreground outline-none",e),...t})]})}var ik=({className:e,...t})=>vc.jsx(aie,{className:N(ok({variant:"default"}),e),...t}),sk=({className:e,danger:t,...n})=>vc.jsx(oie,{className:N(ok({variant:t?"danger":"primary"}),e),...n});var CG=h(w(),1),Ice=nk("inline-flex items-center gap-1.5 text-sm",{variants:{tone:{neutral:"text-muted-foreground",warning:"text-warning",success:"text-success",danger:"text-danger",ink:"text-foreground"}},defaultVariants:{tone:"neutral"}}),SG=({className:e,tone:t,...n})=>CG.jsx("span",{className:N(Ice({tone:t}),e),...n});var WA=h(w(),1);function _({name:e,sprite:t="i",className:n,...o}){return WA.jsx("svg",{"aria-hidden":"true",className:N("size-[18px]",n),...o,children:WA.jsx("use",{href:`#${t}-${e}`})})}var lk=h(w(),1);function Or({className:e,...t}){return lk.jsx(fie,{className:N("grid size-4 place-items-center rounded-xs border border-border bg-card data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:lk.jsx(gie,{children:lk.jsx(_,{name:"check",className:"size-3"})})})}var NG=1,zce=0.9,Lce=0.8,Bce=0.17,XA=0.1,QA=0.999,Hce=0.9999,jce=0.99,Uce=/[\\\/_+.#"@\[\(\{&]/,Gce=/[\\\/_+.#"@\[\(\{&]/g,Fce=/[\s-]/,TG=/[\s-]/g;function ZA(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?NG:jce;var s=`${r},${a}`;if(i[s]!==void 0)return i[s];for(var l=o.charAt(a),c=n.indexOf(l,r),d=0,u,p,f,g;c>=0;)u=ZA(e,t,n,o,c+1,a+1,i),u>d&&(c===r?u*=NG:Uce.test(e.charAt(c-1))?(u*=Lce,f=e.slice(r,c-1).match(Gce),f&&r>0&&(u*=Math.pow(QA,f.length))):Fce.test(e.charAt(c-1))?(u*=zce,g=e.slice(r,c-1).match(TG),g&&r>0&&(u*=Math.pow(QA,g.length))):(u*=Bce,r>0&&(u*=Math.pow(QA,c-r))),e.charAt(c)!==t.charAt(a)&&(u*=Hce)),(u<XA&&n.charAt(c-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(c-1)!==o.charAt(a))&&(p=ZA(e,t,n,o,c+1,a+2,i),p*XA>u&&(u=p*XA)),u>d&&(d=u),c=n.indexOf(l,c+1);return i[s]=d,d}function RG(e){return e.toLowerCase().replace(TG," ")}function EG(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ZA(e,t,RG(e),RG(t),0,0,{})}var ue=h(I(),1);var Hv='[cmdk-group=""]',JA='[cmdk-group-items=""]',Vce='[cmdk-group-heading=""]',MG='[cmdk-item=""]',AG=`${MG}:not([aria-disabled="true"])`,eM="cmdk-item-select",Dg="data-value",Kce=(e,t,n)=>EG(e,t,n),DG=ue.createContext(void 0),jv=()=>ue.useContext(DG),PG=ue.createContext(void 0),tM=()=>ue.useContext(PG),OG=ue.createContext(void 0),_G=ue.forwardRef((e,t)=>{let n=Pg(()=>{var H,fe;return{search:"",value:(fe=(H=e.value)!=null?H:e.defaultValue)!=null?fe:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Pg(()=>new Set),r=Pg(()=>new Map),a=Pg(()=>new Map),i=Pg(()=>new Set),s=IG(e),{label:l,children:c,value:d,onValueChange:u,filter:p,shouldFilter:f,loop:g,disablePointerSelection:m=!1,vimBindings:x=!0,...v}=e,y=rn(),b=rn(),k=rn(),S=ue.useRef(null),C=nue();Zp(()=>{if(d!==void 0){let H=d.trim();n.current.value=H,R.emit()}},[d]),Zp(()=>{C(6,ee)},[]);let R=ue.useMemo(()=>({subscribe:(H)=>(i.current.add(H),()=>i.current.delete(H)),snapshot:()=>n.current,setState:(H,fe,oe)=>{var F,B,ve,We;if(!Object.is(n.current[H],fe)){if(n.current[H]=fe,H==="search")L(),E(),C(1,z);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(F=document.getElementById(y))==null||F.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=ne())==null?void 0:ae.id,R.emit()}),oe||C(5,ee),((B=s.current)==null?void 0:B.value)!==void 0){let ae=fe!=null?fe:"";(We=(ve=s.current).onValueChange)==null||We.call(ve,ae);return}}R.emit()}},emit:()=>{i.current.forEach((H)=>H())}}),[]),M=ue.useMemo(()=>({value:(H,fe,oe)=>{var F;fe!==((F=a.current.get(H))==null?void 0:F.value)&&(a.current.set(H,{value:fe,keywords:oe}),n.current.filtered.items.set(H,D(fe,oe)),C(2,()=>{E(),R.emit()}))},item:(H,fe)=>(o.current.add(H),fe&&(r.current.has(fe)?r.current.get(fe).add(H):r.current.set(fe,new Set([H]))),C(3,()=>{L(),E(),n.current.value||z(),R.emit()}),()=>{a.current.delete(H),o.current.delete(H),n.current.filtered.items.delete(H);let oe=ne();C(4,()=>{L(),(oe==null?void 0:oe.getAttribute("id"))===H&&z(),R.emit()})}),group:(H)=>(r.current.has(H)||r.current.set(H,new Set),()=>{a.current.delete(H),r.current.delete(H)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:k,labelId:b,listInnerRef:S}),[]);function D(H,fe){var oe,F;let B=(F=(oe=s.current)==null?void 0:oe.filter)!=null?F:Kce;return H?B(H,n.current.search,fe):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,fe=[];n.current.filtered.groups.forEach((F)=>{let B=r.current.get(F),ve=0;B.forEach((We)=>{let ae=H.get(We);ve=Math.max(ae,ve)}),fe.push([F,ve])});let oe=S.current;ke().sort((F,B)=>{var ve,We;let ae=F.getAttribute("id"),xe=B.getAttribute("id");return((ve=H.get(xe))!=null?ve:0)-((We=H.get(ae))!=null?We:0)}).forEach((F)=>{let B=F.closest(JA);B?B.appendChild(F.parentElement===B?F:F.closest(`${JA} > *`)):oe.appendChild(F.parentElement===oe?F:F.closest(`${JA} > *`))}),fe.sort((F,B)=>B[1]-F[1]).forEach((F)=>{var B;let ve=(B=S.current)==null?void 0:B.querySelector(`${Hv}[${Dg}="${encodeURIComponent(F[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function z(){let H=ke().find((oe)=>oe.getAttribute("aria-disabled")!=="true"),fe=H==null?void 0:H.getAttribute(Dg);R.setState("value",fe||void 0)}function L(){var H,fe,oe,F;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let ve of o.current){let We=(fe=(H=a.current.get(ve))==null?void 0:H.value)!=null?fe:"",ae=(F=(oe=a.current.get(ve))==null?void 0:oe.keywords)!=null?F:[],xe=D(We,ae);n.current.filtered.items.set(ve,xe),xe>0&&B++}for(let[ve,We]of r.current)for(let ae of We)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=B}function ee(){var H,fe,oe;let F=ne();F&&(((H=F.parentElement)==null?void 0:H.firstChild)===F&&((oe=(fe=F.closest(Hv))==null?void 0:fe.querySelector(Vce))==null||oe.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function ne(){var H;return(H=S.current)==null?void 0:H.querySelector(`${MG}[aria-selected="true"]`)}function ke(){var H;return Array.from(((H=S.current)==null?void 0:H.querySelectorAll(AG))||[])}function Y(H){let fe=ke()[H];fe&&R.setState("value",fe.getAttribute(Dg))}function ye(H){var fe;let oe=ne(),F=ke(),B=F.findIndex((We)=>We===oe),ve=F[B+H];(fe=s.current)!=null&&fe.loop&&(ve=B+H<0?F[F.length-1]:B+H===F.length?F[0]:F[B+H]),ve&&R.setState("value",ve.getAttribute(Dg))}function le(H){let fe=ne(),oe=fe==null?void 0:fe.closest(Hv),F;for(;oe&&!F;)oe=H>0?eue(oe,Hv):tue(oe,Hv),F=oe==null?void 0:oe.querySelector(AG);F?R.setState("value",F.getAttribute(Dg)):ye(H)}let J=()=>Y(ke().length-1),G=(H)=>{H.preventDefault(),H.metaKey?J():H.altKey?le(1):ye(1)},Fe=(H)=>{H.preventDefault(),H.metaKey?Y(0):H.altKey?le(-1):ye(-1)};return ue.createElement(be.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:(H)=>{var fe;(fe=v.onKeyDown)==null||fe.call(v,H);let oe=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||oe))switch(H.key){case"n":case"j":{x&&H.ctrlKey&&G(H);break}case"ArrowDown":{G(H);break}case"p":case"k":{x&&H.ctrlKey&&Fe(H);break}case"ArrowUp":{Fe(H);break}case"Home":{H.preventDefault(),Y(0);break}case"End":{H.preventDefault(),J();break}case"Enter":{H.preventDefault();let F=ne();if(F){let B=new Event(eM);F.dispatchEvent(B)}}}}},ue.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:rue},l),ck(e,(H)=>ue.createElement(PG.Provider,{value:R},ue.createElement(DG.Provider,{value:M},H))))}),qce=ue.forwardRef((e,t)=>{var n,o;let r=rn(),a=ue.useRef(null),i=ue.useContext(OG),s=jv(),l=IG(e),c=(o=(n=l.current)==null?void 0:n.forceMount)!=null?o:i==null?void 0:i.forceMount;Zp(()=>{if(!c)return s.item(r,i==null?void 0:i.id)},[c]);let d=zG(r,a,[e.value,e.children,a],e.keywords),u=tM(),p=nd((C)=>C.value&&C.value===d.current),f=nd((C)=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(r)>0:!0);ue.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(eM,g),()=>C.removeEventListener(eM,g)},[f,e.onSelect,e.disabled]);function g(){var C,R;m(),(R=(C=l.current).onSelect)==null||R.call(C,d.current)}function m(){u.setState("value",d.current,!0)}if(!f)return null;let{disabled:x,value:v,onSelect:y,forceMount:b,keywords:k,...S}=e;return ue.createElement(be.div,{ref:Vu(a,t),...S,id:r,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||s.getDisablePointerSelection()?void 0:m,onClick:x?void 0:g},e.children)}),$ce=ue.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:r,...a}=e,i=rn(),s=ue.useRef(null),l=ue.useRef(null),c=rn(),d=jv(),u=nd((f)=>r||d.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);Zp(()=>d.group(i),[]),zG(i,s,[e.value,e.heading,l]);let p=ue.useMemo(()=>({id:i,forceMount:r}),[r]);return ue.createElement(be.div,{ref:Vu(s,t),...a,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&ue.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),ck(e,(f)=>ue.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},ue.createElement(OG.Provider,{value:p},f))))}),Yce=ue.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,r=ue.useRef(null),a=nd((i)=>!i.search);return!n&&!a?null:ue.createElement(be.div,{ref:Vu(r,t),...o,"cmdk-separator":"",role:"separator"})}),Wce=ue.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,r=e.value!=null,a=tM(),i=nd((c)=>c.search),s=nd((c)=>c.selectedItemId),l=jv();return ue.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),ue.createElement(be.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:r?e.value:i,onChange:(c)=>{r||a.setState("search",c.target.value),n==null||n(c.target.value)}})}),Xce=ue.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...r}=e,a=ue.useRef(null),i=ue.useRef(null),s=nd((c)=>c.selectedItemId),l=jv();return ue.useEffect(()=>{if(i.current&&a.current){let c=i.current,d=a.current,u,p=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let f=c.offsetHeight;d.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return p.observe(c),()=>{cancelAnimationFrame(u),p.unobserve(c)}}},[]),ue.createElement(be.div,{ref:Vu(a,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":o,id:l.listId},ck(e,(c)=>ue.createElement("div",{ref:Vu(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Qce=ue.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:r,contentClassName:a,container:i,...s}=e;return ue.createElement(Cg,{open:n,onOpenChange:o},ue.createElement(Ip,{container:i},ue.createElement(zp,{"cmdk-overlay":"",className:r}),ue.createElement(Lp,{"aria-label":e.label,"cmdk-dialog":"",className:a},ue.createElement(_G,{ref:t,...s}))))}),Zce=ue.forwardRef((e,t)=>nd((n)=>n.filtered.count===0)?ue.createElement(be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jce=ue.forwardRef((e,t)=>{let{progress:n,children:o,label:r="Loading...",...a}=e;return ue.createElement(be.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},ck(e,(i)=>ue.createElement("div",{"aria-hidden":!0},i)))}),Jp=Object.assign(_G,{List:Xce,Item:qce,Input:Wce,Group:$ce,Separator:Yce,Dialog:Qce,Empty:Zce,Loading:Jce});function eue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function IG(e){let t=ue.useRef(e);return Zp(()=>{t.current=e}),t}var Zp=typeof window>"u"?ue.useEffect:ue.useLayoutEffect;function Pg(e){let t=ue.useRef();return t.current===void 0&&(t.current=e()),t}function nd(e){let t=tM(),n=()=>e(t.snapshot());return ue.useSyncExternalStore(t.subscribe,n,n)}function zG(e,t,n,o=[]){let r=ue.useRef(),a=jv();return Zp(()=>{var i;let s=(()=>{var c;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(c=d.current.textContent)==null?void 0:c.trim():r.current}})(),l=o.map((c)=>c.trim());a.value(e,s,l),(i=t.current)==null||i.setAttribute(Dg,s),r.current=s}),r}var nue=()=>{let[e,t]=ue.useState(),n=Pg(()=>new Map);return Zp(()=>{n.current.forEach((o)=>o()),n.current=new Map},[e]),(o,r)=>{n.current.set(o,r),t({})}};function oue(e){let t=e.type;return typeof t=="function"?t(e.props):("render"in t)?t.render(e.props):e}function ck({asChild:e,children:t},n){return e&&ue.isValidElement(t)?ue.cloneElement(oue(t),{ref:t.ref},n(t.props.children)):n(t)}var rue={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var ef=h(w(),1),Og=({className:e,...t})=>ef.jsx(Jp,{className:N("flex flex-col text-base",e),...t}),_g=({className:e,...t})=>ef.jsx(Jp.Input,{className:N("mb-1.5 h-8 w-full rounded-sm border border-border bg-card px-2.5 text-base text-foreground outline-none placeholder:text-muted-foreground focus-visible:border-muted-foreground",e),...t}),Ig=({className:e,...t})=>ef.jsx(Jp.List,{className:N("max-h-72 overflow-auto",e),...t}),uk=({className:e,...t})=>ef.jsx(Jp.Empty,{className:N("px-2 py-3 text-center text-muted-foreground",e),...t}),zg=({className:e,...t})=>ef.jsx(Jp.Item,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground data-[selected=true]:bg-muted data-[selected=true]:text-foreground",e),...t}),dk=({className:e,...t})=>ef.jsx(Jp.Group,{className:N("[&_[cmdk-group-heading]]:flex [&_[cmdk-group-heading]]:items-center [&_[cmdk-group-heading]]:gap-1.5 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground",e),...t});var tf=h(w(),1),ua=Cg,P2e=S1,O2e=Sv,Yr=({className:e,...t})=>tf.jsx(C1,{className:N("text-lg font-semibold",e),...t}),Uv=({className:e,...t})=>tf.jsx(N1,{className:N("text-base text-muted-foreground",e),...t});function da({className:e,...t}){return tf.jsxs(Ip,{container:rr(),children:[tf.jsx(zp,{className:"fixed inset-0 z-50 bg-black/45"}),tf.jsx(Lp,{className:N("fixed left-1/2 top-1/2 z-50 flex w-[min(480px,calc(100vw-32px))] max-h-[calc(100dvh-32px)] -translate-x-1/2 -translate-y-1/2 flex-col gap-2.5 rounded-lg border border-border bg-background p-4 text-foreground outline-none",e),...t})]})}var od=h(w(),1),kn=(e)=>od.jsx(jse,{modal:!1,...e}),Sn=Gse;function Cn({className:e,align:t="end",sideOffset:n=4,...o}){return od.jsx(Fse,{container:rr(),children:od.jsx(Kse,{align:t,sideOffset:n,className:N("z-50 flex min-w-40 max-w-[calc(100vw-32px)] flex-col rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md outline-none animate-fade-in",e),...o})})}var qt=({className:e,...t})=>od.jsx($se,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground outline-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted data-[highlighted]:text-foreground",e),...t}),Wr=({className:e,...t})=>od.jsx(Xse,{className:N("my-1 h-px bg-border",e),...t}),pk=({className:e,...t})=>od.jsx(qse,{className:N("px-2 py-1 text-sm text-muted-foreground",e),...t}),LG=Yse,nM=({className:e,...t})=>od.jsx(Wse,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-foreground outline-none data-[highlighted]:bg-muted data-[state=checked]:text-primary",e),...t});var BG=h(w(),1),Gv="h-(--btn-s) w-full rounded-sm border border-border bg-card px-2.5 py-1 text-base text-foreground placeholder:text-muted-foreground hover:border-muted-foreground focus-visible:border-muted-foreground aria-[invalid=true]:border-danger";function je({className:e,...t}){return BG.jsx("input",{className:N(Gv,e),...t})}var HG=h(w(),1);function xc({className:e,...t}){return HG.jsx(Jse,{className:N("block text-base font-medium text-foreground",e),...t})}var oM=h(w(),1),eo=nle,to=ile,jG=rle;function no({className:e,align:t="end",sideOffset:n=4,...o}){return oM.jsx(cle,{container:rr(),children:oM.jsx(ule,{align:t,sideOffset:n,className:N("z-50 max-w-[calc(100vw-32px)] rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md outline-none animate-fade-in",e),...o})})}var oi=h(w(),1),It=Tle,zt=Dle;function Lt({className:e,size:t="md",children:n,...o}){return oi.jsxs(Ale,{className:N("inline-flex max-w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-2.5 text-base text-foreground hover:border-muted-foreground data-[placeholder]:text-muted-foreground",t==="sm"?"h-7 text-sm":"h-(--btn-s)",e),...o,children:[oi.jsx("span",{className:"min-w-0 truncate",children:n}),oi.jsx(Ple,{asChild:!0,children:oi.jsx(_,{name:"chev",className:"size-3 shrink-0 text-muted-foreground"})})]})}function Bt({className:e,children:t,...n}){return oi.jsx(zle,{container:rr(),children:oi.jsx(Lle,{position:"popper",sideOffset:4,className:N("z-50 max-h-72 min-w-(--radix-select-trigger-width) max-w-[calc(100vw-32px)] overflow-hidden rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md animate-fade-in",e),...n,children:oi.jsx(Vle,{children:t})})})}var ft=({className:e,children:t,...n})=>oi.jsxs($le,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground outline-none data-[highlighted]:bg-muted data-[highlighted]:text-foreground data-[state=checked]:font-medium data-[state=checked]:text-foreground",e),...n,children:[oi.jsx(Yle,{children:t}),oi.jsx(Xle,{className:"ml-auto",children:oi.jsx(_,{name:"check",className:"size-3.5 text-primary"})})]});var yc=h(w(),1),nf=Cg,Z2e=S1,fk=Sv,rd=({className:e,...t})=>yc.jsx(C1,{className:N("text-[16px] font-semibold text-strong",e),...t}),of=N1;function mk({className:e,...t}){return yc.jsxs(Ip,{container:rr(),children:[yc.jsx(zp,{className:"fixed inset-0 z-50 bg-[color-mix(in_srgb,var(--bg)_60%,transparent)] backdrop-blur-[3px] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:animate-in data-[state=open]:fade-in"}),yc.jsx(Lp,{className:N("fixed inset-y-0 right-0 z-50 flex w-[520px] max-w-full flex-col border-l border-border bg-card text-foreground shadow-md outline-none data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:animate-in data-[state=open]:slide-in-from-right",e),...t})]})}function gk({className:e,...t}){return yc.jsxs(Ip,{container:rr(),children:[yc.jsx(zp,{className:"fixed inset-0 z-50 bg-black/45 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:animate-in data-[state=open]:fade-in"}),yc.jsx(Lp,{className:N("fixed inset-x-0 bottom-0 z-50 flex max-h-[85dvh] flex-col overflow-y-auto rounded-t-[16px] border-t border-border bg-card px-4 pb-[calc(20px+env(safe-area-inset-bottom))] pt-3 text-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",e),...t})]})}var UG=h(w(),1),pa=({className:e,...t})=>UG.jsx("span",{className:N("block rounded-sm bg-muted motion-safe:animate-pulse",e),...t});var FG=h(w(),1),GG=({theme:e="system"})=>FG.jsx(p6,{theme:e,position:"bottom-left",offset:{left:28,bottom:56},mobileOffset:{left:16,bottom:68},style:{"--normal-bg":"var(--bg-2)","--normal-text":"var(--ink)","--normal-border":"var(--line)",fontFamily:"var(--font)"},toastOptions:{className:"toast",style:{fontSize:"var(--fs)",borderRadius:"var(--r)",boxShadow:"var(--shadow-2)"}}});var KG=h(w(),1),VG=({className:e})=>KG.jsx("span",{"aria-hidden":"true",className:N("block size-[22px] rounded-full border-2 border-border border-t-foreground motion-safe:animate-spin",e)});var rM=h(w(),1);function pr({className:e,...t}){return rM.jsx(rce,{className:N("inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted p-0.5 transition-colors data-[state=checked]:border-primary data-[state=checked]:bg-primary",e),...t,children:rM.jsx(ice,{className:"block size-3.5 rounded-full bg-card shadow-sm transition-transform data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary-foreground"})})}var iM=h(w(),1),qG=pce,$G=({className:e,...t})=>iM.jsx(mce,{className:N("flex items-center gap-0.5",e),...t}),aM=({className:e,...t})=>iM.jsx(hce,{className:N("inline-flex min-h-[26px] items-center gap-1.5 rounded-full px-2 text-sm text-muted-foreground data-[state=active]:bg-[color-mix(in_srgb,var(--dim)_14%,transparent)] data-[state=active]:font-medium data-[state=active]:text-foreground",e),...t});var YG=h(w(),1);function An({className:e,...t}){return YG.jsx("textarea",{className:N("w-full resize-none bg-transparent text-base leading-normal text-foreground outline-none placeholder:text-muted-foreground",e),...t})}var WG=h(w(),1),Lg=({className:e,...t})=>WG.jsx(yce,{className:N(e),...t});var hk=h(w(),1),XG=(e)=>hk.jsx(Nce,{delayDuration:400,...e}),bk=Tce,vk=Ece,xk=({className:e,sideOffset:t=6,...n})=>hk.jsx(Dce,{container:rr(),children:hk.jsx(Pce,{sideOffset:t,className:N("z-50 max-w-72 rounded-sm border border-border bg-card px-2 py-1 text-sm text-foreground shadow-md animate-fade-in",e),...n})});var Hi={claude:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAG1BMVEXZdlbabEjacU/aZ0H+9/X67ejil4Hruavy0som81XtAAAD70lEQVRYhe1W2ZIbIQzUwQD//8XR0RKMvZWqVN5SYe0xYNRqtWSxRP/HPzvkL83nmjeE/CEer/GMzb2ce/4WQT4+aT4+Dh2D+71HcdsDIwlQFHTbYsnn6QhL2rMI5V+MJylInFSbjinH+Is6AavXvANgcUI7ADzwnDgpbfa14SeTAiep4VMgj7EVjA+CrRxfDj9eT/G2lwOof6/bpmPlwTBqj60NcwTOSUFDUs+puRVdA+Ke4NNt8+G1V5KZAxRiOkyOsk89RcCAkJGEivyRe7DcmV2osMYwI2BCGbgUgbjYEIRu7tiPh2GUpZ9zQHtNRA3hqP98ZAUlYRM8KMRETZXR6NSBl/yFplkAY8PjMCx9PHWeAN9YWsI1/9bD1woOz1SjHhQ0zFwIm1g9FPMmfjPoGnLX7AzM1jWcATaeo9mVChG5ZpTZMgOaDvA4AI2YugCgXihtJg1HFkbGO4NCwORYepy9AXoVE46Ia+yePWnPzKrKN/FbiphoOv8YM0yZ5trPnnSJ9z30RQJU7Pcwd8jjvwh9aeCfHEPA7ZvE3r6T5ezF9smA51rT+oX9pNRj9Nr5Gk+oa71mHrYOYH55AhoMt8H9gDCevSalhlwAOdH11Bg/SejGaYsw82GVkWv2fmdRrLVtgMtLghmhxeCTRDAotIgdjy8RPDKLzYJbU5ODm1I/Cick4Z9q4UFPMKQ+CAYsHUkWI30q6PVz0midkTuEsM9nArFymq8bxfRTWvsBhkZRc7EP2+Ru75U/fnmXo/UIFyfKcYG1IAuIws2jBp/uIvMDIQiqKNyFfmFWLFQ2upq67bJWsFzN7T1tKZcjBGuv+zcQ2mfv1OhIj6NMvxkGAYErTQzNqCHdf5bjNiLRRr0/GVh0VI1/OzQPyvmgCoDbv7mPe8hMvZimUtyJ6nfFRhkerxcDoxO3uqudN6L1ZKPB0ScNaD6JwDcNugOyHJHGZ6TaZmbo1DL1Vl5RQm3QWbi2YsQN41DO2qWPi3FZFawXB4Twac5+LOtmJZEw9GBCJn4N+rSW1NIzFkzCoSIIm9F82Qvx54jbCWa7GYcqYavv4y8AKQEq36AiiGbqRRVYHYLWnh2F/YkFbL7pAkD5PO0o1QxesYqG+B624YdVTmR6IwWAkwK3eEqeVsRMZ8V6shF7UU9ysauTKkdK6k14iJ4KfJ2LaukPwcGD5AwUW3p0BOP8BjYdQ3tKm2BQ6OlKy+IDNtp9ByK4IghIuAtaqiIGK22sWtUWgUudOPeKd776IrHO9/XBYHB0w0KOa+1ItF3VuhggAG5w1ZJaLyB9vzEhPfMGLrlBUy/fxwlkI7jk17365qL3Ny8SNn4BI7siq1gJmlgAAAAASUVORK5CYII=",agy:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAEAAQAMBEQACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQcCBAYDAf/EADEQAAEEAgADBQQLAAAAAAAAAAEAAgMEBREGITESQVFxoRMUYbEHIiMzUmJygZHB4f/EABoBAQADAQEBAAAAAAAAAAAAAAACAwUEAQb/xAAqEQACAgIBAgQFBQAAAAAAAAAAAQIDBBESBUETITFRFCOBsfEyYXGR0f/aAAwDAQACEQMRAD8AvFAEAQBAEAQBAEAQBAEBo5HK1McB7w89o9GtGyue7Kqp8pvzLaqZ2vUTDF5ujlC5tWXcjesbhp2vHXgp1XQtW4snfi20a5ryJFWnOEAQBAEB52ZWwQSTPOmxtLj5BeN6R42ktsq7J5F9qeSWR23POys+OFK6TnL1ZCnN4sj6l6WhehuQH7SJ29eI7x+4V3wsqZKSPo6ciGTU659y4K0zLFeOeM7ZI0PafEEbC6zBacXpnqh4EAQBAc5xxd91w3sw7Tp3hg8hzPy9VbVV4stHHm2cKte5WcspcVv0YiSMfxHsxbzXt2GmjTxcxwZZ/Atv3jAxxk/WrvMZ8uo9CsHIq8KejTlYrHyR0SoIhAEAQFa/SJkPb5ZlSM7bWZzA/E7n8tLe6XR8vm+5idRs5WqK7E/w3wjUq1GS5OtHYsyDbmyt7TY/ho8t/FcmV1Gyc+NT1Fe3c7MfChGO7FtnziXhOpPUfPjK7ILMY2GRN02QeGum17h9QsjPja9xfv2JX4kXHcFpoiPo8viLIS1HHQsM7Tf1N/zf8Lq6rR8tWLsVYV25cWWGsE0ggCAjOIMvDhse+zLpz+kUe+b3eC6MbHlkWKEfr/BRkXxphyf0OO4Nws+TyBzWRBMYkMjO0PvX9d+QPqtfqGTGmv4ev1+yM3Cx3ZPxp+n3LDHRYBsg9EBXfFmJnwuTbmMeNQmQSHQ5Rv33/lP9lfQYGRHIq+Hs9df2v9MjKqlTPxYeh2mCy1fMUG2YDo9JGE82O7wsbJx5Y9nCX5NGm6N0eSJFUFwQGpexlLIBgvVo5xGdtEg3pWVXWVb4S1shOqFn61s2WtDGhrQAANADuVf7k9aMkAQGL2Ne0teA5rhogjYIRPT2jxrZrUcdTx7XtpV44A93acGDWyrLLrLWnOWyMK4V+UFo21WTCAIAgCAIAgCAID//2Q==",codex:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAYFBMVEX///8AAADz8/O/v7+qqqq4uLj4+Pjo6Oh+fn7h4eHExMSwsLDKysrZ2dmioqImJiYrKytpaWmNjY3T09NMTExCQkJUVFR2dnYbGxszMzOHh4cODg5cXFwhISGUlJQ5OTkNyEhkAAADGElEQVRYhe1X2XbqMAzMQuw4KxBCCKHl///y2pJl5AVKOee+VS/E4JloGckmy/7sP5rqqnJSn6L765aj1f0HcHnLmR2K3+LLPLAuE7LrpneJKnxvq6RU1RkXSPS1TG/gO4jcvU2dPWdO8ie8MNsaFs8YxLP7gaCGmMn6E4Dmoen7bofO1C/xhd5xdYsFEHvnkIJkHF8RDHpDwZ61Dfz3Nvc8jE0rYMGnDoOvhb8BGJ7CO+NzaZ4kxnsmLUuX/Tp0isHvADJbCz94qWNfrCumTPsk/mrrVJCj7j3fXgGP+jHVZIecEezYpupCv9whe0o/VTEeKnbdMQL8Xs2AXVfXWCaG7wgPDVTCByewSshb/Aqha0pMG5Y3IEAlbPg+UcPq0swJgsEKzCNobBvsqQcfjRWFMFqXOQGbKjdSAXE2AV5R0TgBeF92WAOn/yGWd4ZlVwmC4QExeQQrDnxlTWvokkUE1AYCJbZSKmBk+VKqSZ2cgG1R6MTBpsLsmkOCMSLgG4Ls17ntOTIt700QgUwT4GzaGlp7LpQ8iVuZJGgLrKu0b8z5eJVUKAl7TkUbE+henEy/V5QUL4aZANMXUiQJYEwAgdiC0WgqY2fpQAlLEAgiyPZhP6wPfVIHBmX0PIgJeq7wHmebLySf4MKmPxoMsYUmehVL2SNITaWgS45+MwUEQyRm3am4b0+nhnRDEjvbI9CfXwGeRi9r/mlvOZuwjMc8cTZofd9t6LbCw8VF5ROYG8AW4g3B6vzQu5oLK4VHYAdwIgTTUDgv8hl752zDYQQDyCRxxlfUH9NM2VgpoSQkQb8sMd5tMlybKxwmw6zajI7MZzeEEZKAdmTneoPFeJy59ydXrYG/VJAm6ZyH6IxWlufXC7MxILen0WhBenV7Crfno6dwPt1tBC8vadB1BzeqbPCuw2CWijTUGk6C29D1fXlE+Olx2WZT56m5hrA2MsG1SQGHpk4ewcn1rADv3rn7TwuewCPGc257felucBE3QNqE6vrCXru5vXNX94zGK9rv/3hoU7Vrn0/++iBH2Zbdx+g/e8f+AUjCHMA9oP1SAAAAAElFTkSuQmCC",opencode:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAG1BMVEUTEBD///9aWFgAAABHREQGAABeXFxLSUkvLCzJjnlJAAAAVUlEQVRYhe3WMQrAMAhAUduaJvc/cWYLxUgIJfb/UfBNDooQ5exycvcPJ08AyAU8DygOjM0B1gLFFAfqbaphQE+TAgAAfAU0NbUw8BbAL4DpR5No0zpjhghz2AXH2AAAAABJRU5ErkJggg==",gemini:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABp1BMVEVHcEwks4M2ltktu2/sxyHkVmPkbFyGymJeieuhzlE7if00kO3qXVo7ifxKkez0uhzzqh4St3FLwWsxhv9Fhvj3vBj2R0gxhv8zh//KyTsrvWf6RUMUuWj0VkjxqCTwXU7zXEbsT1f4vRfb0THC1UOtcqnuZE3CaZH1nCCb1FnxSlAxhv+a01klrpoxhv85oc/wgjL4RkWDgdT2SEn6Q0FtyWW91UUxhv8yhv8yh/82h/43ivo+iPw5jfY6kPBHifg8nNNSifI8lOnsUVc8oMf2vhhLr5wUuWeTfMBqhuRJqqo7mNzyS053x2pDpblpw3KEgc1VtY/4RkXWYHZhvns0pLszqKutdKU7luPdW2y10EbCao7MZYOieLHYyi9fuYQetnbqkTLooitgk93nfka4bpmS0Fzysxx3hNlTnsxEunsqr5LTuDJLwG6Ku2aovU9kpLA/tIsxrJ29wT/Tf2q2hY+aiLBMl+GMlq1xmsLRcXjRjVuUrXPlvSW/eY6CjMfPnEvK0TrIrENxjdewqV6skouzm3GQn5R2uHZ2rotqqpoAshpHcEw3yyA9AAAAjXRSTlMA/hL+/v7+/v7+vlT91P0v/S1JLUaB3N7yEtwqgRJMvVNB3dpVSdTa2sV9fdPaha+w8rCFhbCv/////////////////////////////////////////////////////////////////////////////////////////////////////////////////wC9sE0CAAADIElEQVRYhc2V+1vSUBjHj1GghTM1byipaaV2v8LGRUVj3hCdSmVFJmaCoCKi4B0UsP7q3nO24eaVnT1PT9/fP5993/dsZwj972lu1skLgj7DW0F4o0tQLwj1enirIIyNWXUIekAw0KND8AoKDNyi59sJ/7mdWlBP+KnH1AWAx4KvD6kLiPwXygptMv/zI12FU/7bEA3fquAnXmvn2xT80MTSPa28Vc0PD9/QKDCbzVNKvrxcG//oLN/fX6mFbzUbjdvbKr6/97aG5xsxv7+P9y/xvZCSDRfzTqeztCmsxoWFjY2N/WRyc3PiYAnWJ/NOrrGEs2hbIHwS8wcHRxJPcJw71/Evgd/Z2UnmcoQ/KvKcGPvVi7j/AwJ8PpdLpVLAh9S8HefyElVdmD88PMznc4VUKp0OhcoZBW8XY2uovfjpXfM4wB/n84UC4UMM0+sivJ3jWLtssFWe+zSsdXdJ5uez2ezx8W6hsJZOh0NbDONykefbWZaVcZzGJ4oDqap78EtMNBol/O7vP2tr4fDWFuN2ORwceboosJ2m4bk0StUHKXt7YEhkV4GXBR4scMgC29nUqgR7kGgisbq6snICgvFwuA8LXJLAxrKXCPAIN0mCwWBRMDIyHu4b9ZAKHF4ACNSG4gg4TXUEDyYyouD7pHdkfLBv9BOpwJ03qJYoHWNHMJjJJGYrKkySABs87mIFWAHLipLzxyiO0pHJzIJgxXcyrazgkCrIiobLL8hOIjCZfNMXVJDfg6u/p/dgWDT5/NPqLYgG7Lj2VukEwaLP58cCpUFSXPs5w4FUKCsMikeJDbCJUi4UyNNFYpj0FoeQDCVfzN2nFWYUBg3XcreigmRwuzTwMIVcIQAVsMHj1vRjQcjkwxXi3oBsYLTxqAlXiMS964EZ0aD154pqiCC+LhlKOP+zeeePRSLx5fUANrzQziPkj8Wggmig4VENCCJly9hAMQCOJRYxlGHDMzoeKhgMc9hQTSlAFhCAgbYAVMCCubIaagEy8DwI6HnUwoOhRYfgBgh4zS+xMhaet+jh8Qx6JkComuepXwLJoJP/B/kLRT9a7+Axo0UAAAAASUVORK5CYII=",cursor:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAS1BMVEVHcEz39/QmJR7///3Ly8fOzcrn5uXT0s7My8jMy8j5+fbNzMkEAwAYFg0iIRqDg38uLSXW1tLm5uPw8O1SUUyxsa2cm5dwb2tHcEw+d/dAAAAAGXRSTlMA////5bgHQY/M//////////////////8A0IbxkwAAAmRJREFUWIWtl1migyAMRRVsRSYF1O5/p49BW1CC08uv5EgSQi5V9bN3S0jXNKxgTdMR0r6rnLUdU1obUxfNGK0V69qMu9I1pWXvYHaVVlsEYfqU8xeiGYn9X6q+5G8JtXrF/hfdPeJHIHf8HWGJomWFRRgX4CxksoPzh/U8awzSdec3AAVAKZ0F52IGq0tV6zcAfMVs4BIhyQcGxeG28M5ngGI1Ondnko8aQLA3EAE2/eoeEL3JpcLFQDIppHRCAiUm0JRLhSYWsN89G+Pff+PIpMICum37Yf3Zu/tN8M+upKarmhSA656LnHtA9HWKME3VJO50kqC7R8gpjaOp4ipmg8+kInJhMcB8uJCHZlNh8gDc8+GM2UOBIYDN0bEpGCBEoXPi/4CAYucEo4qLAsCnWYE3gFs1yjIA7pywaOLoCGCPi5igOCiSJwBwKvDM0RmAtUznuFuQo7MAKcQ+FfgjTgPcwmGTCltCdAXgSxoRKB3lNYBDRFG4El4FoBhgBvkIgOfl+01AKOEDQCjhfQBl6wbuAkb5CLCW8DbAIPkIkHy7AVia4BDAIQAek04HANRkpqoHRCV07fExNAvIjrYAGOTPPZ3yLB2utJ6E2AH8PbaELzY6o9mN91TbOAA14iuWtpeUHe9bgRGrqwD4Xff7iWEFxl7i4EXfLYClhPmL2mukjMiq5zUVHGPfBHZqZgQ9tQBA5q1CifsmkNlLPsi8A6HJ8SB98KDQLEjdaRD22NpgwEGnXyWxbQWZTYUV23Vu92sE/yD3nz847j55akX+69H1/Nn3/OH5/On7/PHt7Nbz/w/BUDv4oMpttwAAAABJRU5ErkJggg=="};var aue={kind:"daily",time:"09:00",day:"mon",grace_minutes:"720",precheck_timeout:"60"},QG=()=>{let e=document.documentElement.dataset,t=!0;try{t=localStorage.getItem("kz-haptic")!=="off"}catch{}return{theme:e.theme||"system",color:e.color||"monochrome",motion:e.motion||"system",font:P.font.read(),notify:P.notices.on(),haptic:t,sound:P.notices.sound()}},Ae=me()(()=>({data:null,scope:"all",page:null,q:"",back:!1,prefs:QG(),local:{},openAgents:[],draft:{...aue},editing:"",busy:"",typed:{},startQ:"",startBack:!1,pageGen:0})),ZG=(e,t)=>ut((n)=>({typed:{...n.typed,[e]:t}})),{getState:fr,setState:ut}=Ae;var sM=0;var ad=(e,t)=>fetch(e,t).then((n)=>n.ok?n.json():null).catch(()=>null);async function id(e=!1,t){let n=++sM;if(e)ut({data:null});let{scope:o}=fr(),r={headers:P.dirHeader()},[a,i,s,l,c,d,u,p]=await Promise.all([ad("/settings?scope="+encodeURIComponent(o)),ad("/google"),ad("/research-key"),ad("/agent-prefs"),ad("/accounts"),ad("/skills"),ad("/automations",r),ad("/cleanup",r)]);if(!a&&o!=="all"){if(n!==sM||t?.())return;return ut({scope:"all"}),id(!1,t)}if(n!==sM||t?.())return;ut({data:{cfg:a,google:i??{},research:s,agents:l,accounts:c,skills:d,automations:u,cleanup:p},prefs:QG(),local:{}})}var Bg={el:null};var Vo=()=>id();async function yk(e,t){let n=fr().data?.cfg;ut((r)=>({local:{...r.local,[e]:t}}));let o=await K("/settings",{key:e,value:t,scope:n?.scope});O(o.ok?"Saved":o.error||"Could not save"),await Vo()}async function JG(e){let t=await K("/settings",{key:e,scope:fr().data?.cfg?.scope,reset:!0});O(t.ok?"Reset to All projects":t.error||"Could not reset"),await Vo()}async function eF(e){let t=await K("/pick-folder",{});if(t.path)await yk(e,t.path),P.reload()}async function lM(e){let t=await K("/settings",{key:"agent.default",value:e,scope:fr().data?.cfg?.scope??null});O(t.ok?"Saved":t.error||"Could not save"),await Vo()}async function rf(e){let t=await K("/agent-prefs",e);O(t.error?t.error:"Saved"),await Vo()}async function cM(e,t,n){if(e==="bypass"){if(!await wn({title:"Turn on bypass?",description:t?"This agent will run commands without asking.":"Agents will run commands without asking, in every project.",confirmLabel:"Turn on bypass",danger:!0}))return Vo()}return rf(t?{agent:t,agentPermissions:e}:{permissions:e})}var tF=(e)=>ut((t)=>({openAgents:t.openAgents.includes(e)?t.openAgents.filter((n)=>n!==e):[...t.openAgents,e]}));async function Fv(e){let t=await K("/accounts",e);O(t.error?t.error:"Saved"),await Vo()}async function wk(e,t){let n=P.currentDir();if(!n)return O("Open a project first, or run the line shown here in a terminal");let o=await K("/shell",{dir:n,agent:t,account:e,login:!0});if(o.error||!o.key)return O(o.error||"Could not open a terminal. Run the line shown here");let r=P.open.term({dir:n,ws:o.ws,key:o.key});O(r?"Sign in, then close the terminal":"Terminal started. Open it from the side menu")}async function nF(e){let t=await K("/accounts",{op:"add",tool:e});if(t.error||!t.added)return O(t.error||"Could not add the account");await wk(t.added,e),await Vo()}async function oF(e,t){if(!await wn({title:`Remove ${t}?`,description:"Runs started on it won't start until you pick another.",confirmLabel:"Remove",danger:!0}))return;let o=await wn({title:"Also delete its folder?",description:"Its login and conversations are in it. Cancel keeps them.",confirmLabel:"Delete folder",danger:!0});return Fv({op:"remove",id:e,deleteFolder:o})}async function rF(e,t){if(fr().busy===e)return;ut({busy:e}),await id(),ut({busy:""}),O(t)}var iue={"kaizen-computer":"They see the window text of the apps they open and can click, set values and type in them, as you. A password manager is blocked by its name only, so one inside a browser or under another name is not. Any other open app is in reach.","lemo-opuscar":"The first time an agent uses it, it downloads the Lemo-Opuscar style library from github.com/lemomo-ai/lemo-opuscar (MIT) into ~/lemo-opuscar and installs its Node and Python packages there. It needs git, Node, Python and ffmpeg, and it runs that project's code on your computer."},sue={"kaizen-computer":"Let agents read and operate the apps on your desktop?","lemo-opuscar":"Add film styles from Lemo-Opuscar?"},uM=()=>fr().data?.skills?.token??"";async function dM(e,t,n){if(e==="rea")return pM(t,!1);let o=t&&n;if(o&&!await wn({title:sue[e]??"Turn this skill on?",description:iue[e],confirmLabel:"Turn on"}))return;let r=await K("/skills",{id:e,on:t,...o?{confirm:!0,token:uM()}:{}});O(r.error?r.error:"Saved. Applies to new sessions"),await Vo()}async function aF(e,t){if(t&&!await wn({title:"Replace your own copy?",description:"For at least one agent, a folder or link of the same name is in the way. It is deleted and kaizen's skill is linked in its place. Go ahead?",confirmLabel:"Replace",danger:!0}))return;let n=await K("/skills",{id:e,repair:!0,...t?{replace:!0,token:uM()}:{}});O(n.error?n.error:"Repaired. Applies to new sessions"),await Vo()}async function pM(e,t){if(!e){if(!await wn({title:"Turn REA off?",description:"This runs REA's own uninstall: it removes REA's MCP registration and skill from every agent, also a REA you set up yourself outside kaizen. Ghidra, Java and REA's data stay.",confirmLabel:"Turn off",danger:!0}))return;O("Removing REA…");let s=await K("/rea",{step:"off"});if(!s.error)O(s.hint?`REA removed. Claude still has one: run ${s.hint}`:"REA removed. Restart your agents");return Vo()}O(t?"Checking the newest REA…":"Asking REA what it would change… (first time downloads REA)");let n=await K("/rea",{step:"plan",update:t});if(n.error)return Vo();let o=n.files?.length?n.files.map((i)=>" "+i).join(`
|
|
88
|
+
`)},Dae=0,kg=[];function R9(e){var t=En.useRef([]),n=En.useRef([0,0]),o=En.useRef(),r=En.useState(Dae++)[0],a=En.useState(wv)[0],i=En.useRef(e);En.useEffect(function(){i.current=e},[e]),En.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=c9([e.lockRef.current],(e.shards||[]).map(N9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(r))})}}return},[e.inert,e.lockRef.current,e.shards]);var s=En.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var v=x1(m),y=n.current,b="deltaX"in m?m.deltaX:y[0]-v[0],k="deltaY"in m?m.deltaY:y[1]-v[1],S,C=m.target,R=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in m&&R==="h"&&C.type==="range")return!1;var M=window.getSelection(),D=M&&M.anchorNode,E=D?D===C||D.contains(C):!1;if(E)return!1;var z=JE(R,C);if(!z)return!0;if(z)S=R;else S=R==="v"?"h":"v",z=JE(R,C);if(!z)return!1;if(!o.current&&"changedTouches"in m&&(b||k))o.current=S;if(!S)return!0;var L=o.current||S;return S9(L,x,m,L==="h"?b:k,!0)},[]),l=En.useCallback(function(m){var x=m;if(!kg.length||kg[kg.length-1]!==a)return;var v="deltaY"in x?C9(x):x1(x),y=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&Aae(S.delta,v)})[0];if(y&&y.should){if(x.cancelable)x.preventDefault();return}if(!y){var b=(i.current.shards||[]).map(N9).filter(Boolean).filter(function(S){return S.contains(x.target)}),k=b.length>0?s(x,b[0]):!i.current.noIsolation;if(k){if(x.cancelable)x.preventDefault()}}},[]),c=En.useCallback(function(m,x,v,y){var b={name:m,delta:x,target:v,should:y,shadowParent:Pae(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(k){return k!==b})},1)},[]),d=En.useCallback(function(m){n.current=x1(m),o.current=void 0},[]),u=En.useCallback(function(m){c(m.type,C9(m),m.target,s(m,e.lockRef.current))},[]),p=En.useCallback(function(m){c(m.type,x1(m),m.target,s(m,e.lockRef.current))},[]);En.useEffect(function(){return kg.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,_p),document.addEventListener("touchmove",l,_p),document.addEventListener("touchstart",d,_p),function(){kg=kg.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,_p),document.removeEventListener("touchmove",l,_p),document.removeEventListener("touchstart",d,_p)}},[]);var{removeScrollBar:f,inert:g}=e;return En.createElement(En.Fragment,null,g?En.createElement(a,{styles:Mae(r)}):null,f?En.createElement(QE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pae(e){var t=null;while(e!==null){if(e instanceof ShadowRoot)t=e.host,e=e.host;e=e.parentNode}return t}var T9=KE(v1,R9);var E9=y1.forwardRef(function(e,t){return y1.createElement(yv,Ra({},e,{ref:t,sideCar:T9}))});E9.classNames=yv.classNames;var lc=E9;var Oae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Sg=new WeakMap,w1=new WeakMap,k1={},eA=0,A9=function(e){return e&&(e.host||A9(e.parentNode))},_ae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=A9(n);if(o&&e.contains(o))return o;return console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null}).filter(function(n){return Boolean(n)})},Iae=function(e,t,n,o){var r=_ae(t,Array.isArray(e)?e:[e]);if(!k1[n])k1[n]=new WeakMap;var a=k1[n],i=[],s=new Set,l=new Set(r),c=function(u){if(!u||s.has(u))return;s.add(u),c(u.parentNode)};r.forEach(c);var d=function(u){if(!u||l.has(u))return;Array.prototype.forEach.call(u.children,function(p){if(s.has(p))d(p);else try{var f=p.getAttribute(o),g=f!==null&&f!=="false",m=(Sg.get(p)||0)+1,x=(a.get(p)||0)+1;if(Sg.set(p,m),a.set(p,x),i.push(p),m===1&&g)w1.set(p,!0);if(x===1)p.setAttribute(n,"true");if(!g)p.setAttribute(o,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return d(t),s.clear(),eA++,function(){if(i.forEach(function(u){var p=Sg.get(u)-1,f=a.get(u)-1;if(Sg.set(u,p),a.set(u,f),!p){if(!w1.has(u))u.removeAttribute(o);w1.delete(u)}if(!f)u.removeAttribute(n)}),eA--,!eA)Sg=new WeakMap,Sg=new WeakMap,w1=new WeakMap,k1={}}},qu=function(e,t,n){if(n===void 0)n="data-aria-hidden";var o=Array.from(Array.isArray(e)?e:[e]),r=t||Oae(e);if(!r)return function(){return null};return o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Iae(o,r,n,"aria-hidden")};var po=h(w(),1),zae=Object.defineProperty,Ta=(e,t)=>zae(e,"name",{value:t,configurable:!0}),nA="Dialog",[M9,oA]=en(nA),[Lae,fs]=M9(nA),Cg=Ta((e)=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,s=sn.useRef(null),l=sn.useRef(null),{nodes:c,registry:d}=Mp(),[u,p]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:nA}),[f,g]=sn.useState(0),[m,x]=sn.useState(0);return po.jsx(Lae,{scope:t,triggerRef:s,contentRef:l,contentId:rn(),titleId:rn(),descriptionId:rn(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:g,setDescriptionCount:x,open:u,onOpenChange:p,onOpenToggle:sn.useCallback(()=>p((v)=>!v),[p]),modal:i,branchNodes:c,branchRegistry:d,children:n})},"Dialog"),Bae="DialogTrigger",S1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(Bae,o),i=Ce(n,a.triggerRef);return po.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":R1(a.open),...r,ref:i,onClick:te(t.onClick,a.onOpenToggle)})},"DialogTrigger")),D9="DialogPortal",[Hae,P9]=M9(D9,{forceMount:void 0}),Ip=Ta((e)=>{let{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=fs(D9,t);return po.jsx(Hae,{scope:t,forceMount:n,children:sn.Children.map(o,(i)=>po.jsx(Pr,{present:n||a.open,children:po.jsx(cl,{asChild:!0,container:r,children:i})}))})},"DialogPortal"),tA="DialogOverlay",zp=sn.forwardRef(Ta(function(t,n){let o=P9(tA,t.__scopeDialog),{forceMount:r=o.forceMount,...a}=t,i=fs(tA,t.__scopeDialog);return i.modal?po.jsx(Pr,{present:r||i.open,children:po.jsx(Uae,{...a,ref:n})}):null},"DialogOverlay")),jae=lr("DialogOverlay.RemoveScroll"),Uae=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(tA,o),i=ME(),s=Ce(n,i);return po.jsx(lc,{as:jae,allowPinchZoom:!0,shards:sn.useMemo(()=>[a.contentRef,...a.branchNodes.map((l)=>({current:l}))],[a.contentRef,a.branchNodes]),children:po.jsx(be.div,{"data-state":R1(a.open),...r,ref:s,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),kv="DialogContent",Lp=sn.forwardRef(Ta(function(t,n){let o=P9(kv,t.__scopeDialog),{forceMount:r=o.forceMount,...a}=t,i=fs(kv,t.__scopeDialog);return po.jsx(Pr,{present:r||i.open,children:i.modal?po.jsx(Gae,{...a,ref:n}):po.jsx(Fae,{...a,ref:n})})},"DialogContent")),Gae=sn.forwardRef(Ta(function(t,n){let o=fs(kv,t.__scopeDialog),r=sn.useRef(null),a=Ce(n,o.contentRef,r);return sn.useEffect(()=>{let i=r.current;if(i)return qu(i)},[]),po.jsx(O9,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:te(t.onCloseAutoFocus,(i)=>{i.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:te(t.onPointerDownOutside,(i)=>{let s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;if(s.button===2||l)i.preventDefault()}),onFocusOutside:te(t.onFocusOutside,(i)=>i.preventDefault())})},"DialogContentModal")),Fae=sn.forwardRef(Ta(function(t,n){let o=fs(kv,t.__scopeDialog),r=sn.useRef(!1),a=sn.useRef(!1);return po.jsx(O9,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(i)=>{if(t.onCloseAutoFocus?.(i),!i.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();i.preventDefault()}r.current=!1,a.current=!1},onInteractOutside:(i)=>{if(t.onInteractOutside?.(i),!i.defaultPrevented){if(r.current=!0,i.detail.originalEvent.type==="pointerdown")a.current=!0}let s=i.target;if(o.triggerRef.current?.contains(s))i.preventDefault();if(i.detail.originalEvent.type==="focusin"&&a.current)i.preventDefault()}})},"DialogContentNonModal")),O9=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,"aria-describedby":s,children:l,...c}=t,d=fs(kv,o);return ul(),po.jsx(Ap,{registry:d.branchRegistry,children:po.jsx(Ku,{asChild:!0,loop:!0,trapped:r,branches:d.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:i,children:po.jsx(ll,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?_9(s,d.descriptionId):s,"data-state":R1(d.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:l})})})},"DialogContentImpl")),C1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs("DialogTitle",o),{setTitleCount:i}=a;return wt(()=>(i((s)=>s+1),()=>i((s)=>s-1)),[i]),po.jsx(be.h2,{id:a.titleId,...r,ref:n})},"DialogTitle")),N1=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs("DialogDescription",o),{setDescriptionCount:i}=a;return wt(()=>(i((s)=>s+1),()=>i((s)=>s-1)),[i]),po.jsx(be.p,{id:a.descriptionId,...r,ref:n})},"DialogDescription")),Vae="DialogClose",Sv=sn.forwardRef(Ta(function(t,n){let{__scopeDialog:o,...r}=t,a=fs(Vae,o);return po.jsx(be.button,{type:"button",...r,ref:n,onClick:te(t.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function _9(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}Ta(_9,"concatAriaDescribedby");function R1(e){return e?"open":"closed"}Ta(R1,"getState");var gs=h(w(),1),Kae=Object.defineProperty,cc=(e,t)=>Kae(e,"name",{value:t,configurable:!0}),qae="AlertDialog",[$ae,Nke]=en(qae,[oA]),uc=oA(),Yae=cc((e)=>{let{__scopeAlertDialog:t,...n}=e,o=uc(t);return gs.jsx(Cg,{...o,...n,modal:!0})},"AlertDialog"),Rke=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(S1,{...a,...r,ref:n})},"AlertDialogTrigger")),Wae=cc((e)=>{let{__scopeAlertDialog:t,...n}=e,o=uc(t);return gs.jsx(Ip,{...o,...n})},"AlertDialogPortal"),Xae=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(zp,{...a,...r,ref:n})},"AlertDialogOverlay")),Qae="AlertDialogContent",[Zae,Jae]=$ae(Qae),eie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,children:r,...a}=t,i=uc(o),s=ms.useRef(null),l=Ce(n,s),c=ms.useRef(null);return gs.jsx(Zae,{scope:o,cancelRef:c,children:gs.jsx(Lp,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:te(a.onOpenAutoFocus,(d)=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:(d)=>d.preventDefault(),onInteractOutside:(d)=>d.preventDefault(),children:r})})},"AlertDialogContent")),tie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(C1,{...a,...r,ref:n})},"AlertDialogTitle")),nie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(N1,{...a,...r,ref:n})},"AlertDialogDescription")),oie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,a=uc(o);return gs.jsx(Sv,{...a,...r,ref:n})},"AlertDialogAction")),rie="AlertDialogCancel",aie=ms.forwardRef(cc(function(t,n){let{__scopeAlertDialog:o,...r}=t,{cancelRef:a}=Jae(rie,o),i=uc(o),s=Ce(n,a);return gs.jsx(Sv,{...i,...r,ref:s})},"AlertDialogCancel"));var Bo=h(I(),1);var z9=h(I(),1);var iie=Object.defineProperty,sie=(e,t)=>iie(e,"name",{value:t,configurable:!0});function Bp(e){let[t,n]=z9.useState(void 0);return wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let o=0,r=new ResizeObserver((a)=>{if(!Array.isArray(a))return;if(!a.length)return;let i=a[0];window.cancelAnimationFrame(o),o=window.requestAnimationFrame(()=>{let s,l;if("borderBoxSize"in i){let c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}else n(void 0)},[e]),t}sie(Bp,"useSize");var ti=h(w(),1),lie=Object.defineProperty,dc=(e,t)=>lie(e,"name",{value:t,configurable:!0}),rA="Checkbox",[cie,zke]=en(rA),[uie,aA]=cie(rA);function L9(e){let{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:u}=e,[p,f]=Jn({prop:n,defaultProp:r??!1,onChange:l,caller:rA}),[g,m]=Bo.useState(null),[x,v]=Bo.useState(null),[y,b]=Bo.useState(null),k=g?!!i||!!g.closest("form"):!0,S={checked:p,disabled:a,setChecked:f,control:g,setControl:m,name:s,form:i,value:d,userClick:y,onUserClick:b,required:c,defaultChecked:Ii(r)?!1:r,isFormControl:k,bubbleInput:x,setBubbleInput:v};return ti.jsx(uie,{scope:t,...S,children:B9(u)?u(S):o})}dc(L9,"CheckboxProvider");var die="CheckboxTrigger",pie=Bo.forwardRef(dc(function({__scopeCheckbox:t,onKeyDown:n,onClick:o,...r},a){let{control:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,onUserClick:f,isFormControl:g,bubbleInput:m}=aA(die,t),x=Ce(a,u),v=Bo.useRef(c);return Bo.useEffect(()=>{let y=i?.form;if(y){let b=dc(()=>p(v.current),"reset");return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[i,p]),ti.jsx(be.button,{type:"button",role:"checkbox","aria-checked":Ii(c)?"mixed":c,"aria-required":d,"data-state":iA(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:x,onKeyDown:te(n,(y)=>{if(y.key==="Enter")y.preventDefault()}),onClick:te(o,(y)=>{let b=y.isPropagationStopped();if(f({requestedChecked:Ii(c)?!0:!c,hasConsumerStoppedPropagation:b}),p((k)=>Ii(k)?!0:!k),m&&g){if(!b)y.stopPropagation()}})})},"CheckboxTrigger")),fie=Bo.forwardRef(dc(function(t,n){let{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=t;return ti.jsx(L9,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>ti.jsxs(ti.Fragment,{children:[ti.jsx(pie,{...p,ref:n,__scopeCheckbox:o}),f&&ti.jsx(bie,{__scopeCheckbox:o})]})})},"Checkbox")),mie="CheckboxIndicator",gie=Bo.forwardRef(dc(function(t,n){let{__scopeCheckbox:o,forceMount:r,...a}=t,i=aA(mie,o);return ti.jsx(Pr,{present:r||Ii(i.checked)||i.checked===!0,children:ti.jsx(be.span,{"data-state":iA(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),hie="CheckboxBubbleInput",bie=Bo.forwardRef(dc(function({__scopeCheckbox:t,onClick:n,...o},r){let{control:a,userClick:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:g,setBubbleInput:m}=aA(hie,t),x=Ce(r,m),v=Bp(a),y=Bo.useRef(!1),b=Bo.useRef(s),k=Bo.useRef(i),S=Bo.useRef(null);Bo.useEffect(()=>{let R=g;if(!R)return;let M=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(M,"checked").set;if(!E)return;let z=b.current!==s;b.current=s;let L=i!==null&&i!==k.current;if(k.current=i,L){if(S.current=z?null:i,z)R.indeterminate=Ii(s),E.call(R,Ii(s)?!1:s);R.dispatchEvent(new Event("click",{bubbles:!i.hasConsumerStoppedPropagation}))}else if(z){let ee=S.current;S.current=null;let ne=ee?.requestedChecked===s;y.current=!0,R.indeterminate=Ii(s),E.call(R,Ii(s)?!1:s),R.dispatchEvent(new Event("click",{bubbles:!(ne&&ee.hasConsumerStoppedPropagation)})),y.current=!1}},[g,s,i]);let C=Bo.useRef(Ii(s)?!1:s);return ti.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:c,disabled:d,name:u,value:p,form:f,...o,tabIndex:-1,ref:x,onClick:te(n,(R)=>{if(y.current)R.stopPropagation()}),style:{...o.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function B9(e){return typeof e==="function"}dc(B9,"isFunction");function Ii(e){return e==="indeterminate"}dc(Ii,"isIndeterminate");function iA(e){return Ii(e)?"indeterminate":e?"checked":"unchecked"}dc(iA,"getState");var ni=h(I(),1);var He=h(I(),1);var hs=h(I(),1);var E1=h(w(),1),jo=h(I(),1);var $u=h(w(),1),vie=Object.defineProperty,Ho=(e,t)=>vie(e,"name",{value:t,configurable:!0});function Hp(e){let t=e+"CollectionProvider",[n,o]=en(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Ho((m)=>{let{scope:x,children:v}=m,y=hs.useRef(null),b=hs.useRef(new Map).current;return E1.jsx(r,{scope:x,itemMap:b,collectionRef:y,children:v})},"CollectionProvider");i.displayName=t;let s=e+"CollectionSlot",l=lr(s),c=hs.forwardRef((m,x)=>{let{scope:v,children:y}=m,b=a(s,v),k=Ce(x,b.collectionRef);return E1.jsx(l,{ref:k,children:y})});c.displayName=s;let d=e+"CollectionItemSlot",u="data-radix-collection-item",p=lr(d),f=hs.forwardRef((m,x)=>{let{scope:v,children:y,...b}=m,k=hs.useRef(null),S=Ce(x,k),C=a(d,v);return hs.useEffect(()=>(C.itemMap.set(k,{ref:k,...b}),()=>void C.itemMap.delete(k))),E1.jsx(p,{...{[u]:""},ref:S,children:y})});f.displayName=d;function g(m){let x=a(e+"CollectionConsumer",m);return hs.useCallback(()=>{let y=x.collectionRef.current;if(!y)return[];let b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((C,R)=>b.indexOf(C.ref.current)-b.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return Ho(g,"useCollection"),[{Provider:i,Slot:c,ItemSlot:f},g,o]}Ho(Hp,"createCollection");var j9=new WeakMap,T1=class e extends Map{static{Ho(this,"OrderedDict")}#e;constructor(t){super(t);this.#e=[...super.keys()],j9.set(this,!0)}set(t,n){if(j9.get(this)&&!this.has(t))this.#e.push(t);return super.set(t,n),this}insert(t,n,o){let r=this.has(n),a=r?this.size:this.size+1,i=sA(t),s=i>=0?Math.min(i,a-1):Math.max(a+i,0);if(r?this.#e.indexOf(n)===s:s===this.size)return this.set(n,o),this;let l=this.#e.filter((d)=>d!==n);l.splice(s,0,n);let c=l.map((d)=>[d,d===n?o:this.get(d)]);this.clear();for(let[d,u]of c)this.set(d,u);return this}with(t,n,o){let r=new e(this);return r.insert(t,n,o),r}before(t){let n=this.#e.indexOf(t)-1;if(n<0)return;return this.entryAt(n)}setBefore(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let a=this.#e.indexOf(n),i=a!==-1&&a<r?r-1:r;return this.insert(i,n,o)}after(t){let n=this.#e.indexOf(t);if(n=n===-1||n===this.size-1?-1:n+1,n===-1)return;return this.entryAt(n)}setAfter(t,n,o){let r=this.#e.indexOf(t);if(r===-1)return this;let a=this.#e.indexOf(n),i=a!==-1&&a<=r?r:r+1;return this.insert(i,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let n=super.delete(t);if(n)this.#e.splice(this.#e.indexOf(t),1);return n}deleteAt(t){let n=this.keyAt(t);if(n!==void 0)return this.delete(n);return!1}at(t){let n=A1(this.#e,t);if(n!==void 0)return this.get(n)}entryAt(t){let n=A1(this.#e,t);if(n!==void 0)return[n,this.get(n)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return A1(this.#e,t)}from(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.at(r)}keyFrom(t,n){let o=this.indexOf(t);if(o===-1)return;let r=o+n;if(r<0)r=0;if(r>=this.size)r=this.size-1;return this.keyAt(r)}find(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return r;o++}return}findIndex(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return o;o++}return-1}filter(t,n){let o=[],r=0;for(let a of this){if(Reflect.apply(t,n,[a,r,this]))o.push(a);r++}return new e(o)}map(t,n){let o=[],r=0;for(let a of this)o.push([a[0],Reflect.apply(t,n,[a,r,this])]),r++;return new e(o)}reduce(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let a=0,i=o;for(let s of this){if(a===0&&!r)i=s;else i=Reflect.apply(n,this,[i,s,a,this]);a++}return i}reduceRight(...t){let[n,o]=t,r=t.length>1;if(!r&&this.size===0)throw TypeError("Reduce of empty OrderedDict with no initial value");let a=o;for(let i=this.size-1;i>=0;i--){let s=this.entryAt(i);if(i===this.size-1&&!r)a=s;else a=Reflect.apply(n,this,[a,s,i,this])}return a}sort(t){if(typeof t!=="function")throw TypeError("OrderedDict.sort requires a compare function");let n=[...this.entries()].sort(t);this.clear();for(let[o,r]of n)this.set(o,r);return this}toSorted(t){if(typeof t!=="function")throw TypeError("OrderedDict.toSorted requires a compare function");let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let n=this.size-1;n>=0;n--){let o=this.keyAt(n),r=this.get(o);t.set(o,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let o=new e;for(let r of this.#e.slice(t,n))o.set(r,this.get(r));return o}every(t,n){let o=0;for(let r of this){if(!Reflect.apply(t,n,[r,o,this]))return!1;o++}return!0}some(t,n){let o=0;for(let r of this){if(Reflect.apply(t,n,[r,o,this]))return!0;o++}return!1}};function A1(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=U9(e,t);return n===-1?void 0:e[n]}Ho(A1,"at");function U9(e,t){let n=e.length,o=sA(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}Ho(U9,"toSafeIndex");function sA(e){return e!==e||e===0?0:Math.trunc(e)}Ho(sA,"toSafeInteger");function xie(e){let t=e+"CollectionProvider",[n,o]=en(t),[r,a]=n(t);r.displayName=e+"CollectionStableContextProvider";let[i,s]=n(t);i.displayName=e+"CollectionStatefulContextProvider";let l=Ho(({state:C,...R})=>C?$u.jsx(d,{...R,state:C}):$u.jsx(c,{...R}),"CollectionProvider");l.displayName=t;let c=Ho((C)=>{let R=y();return $u.jsx(d,{...C,state:R})},"CollectionInit");c.displayName=e+"CollectionInit";let d=Ho((C)=>{let{scope:R,children:M,state:D}=C,E=jo.useRef(null),[z,L]=jo.useState(null),ee=Ce(E,L),[ne,ke]=D,Y=jo.useRef(new T1),ye=jo.useCallback(()=>{let le=Y.current;if(!V9(le))le.sort(M1);return le},[]);return jo.useEffect(()=>{if(!z)return;let le=K9(()=>{ke((J)=>{let G=J.toSorted(M1);return G.some(([H],fe)=>J.keyAt(fe)!==H)?G:J})});return le.observe(z,{childList:!0,subtree:!0}),()=>{le.disconnect()}},[z,ke]),$u.jsx(r,{scope:R,collectionElementRef:ee,collectionElementRefObject:E,getCollection:ye,setCollection:ke,registryRef:Y,children:$u.jsx(i,{scope:R,collectionElement:z,collection:ne,children:M})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";let u=e+"CollectionSlot",p=lr(u),f=jo.forwardRef((C,R)=>{let{scope:M,children:D}=C,E=a(u,M),z=Ce(R,E.collectionElementRef);return $u.jsx(p,{ref:z,children:D})});f.displayName=u;let g=e+"CollectionItemSlot",m="data-radix-collection-item",x=lr(g),v=jo.forwardRef((C,R)=>{let{scope:M,children:D,...E}=C,z=jo.useRef(null),L=a(g,M),{setCollection:ee,registryRef:ne}=L,ke=jo.useRef(E);if(!G9(ke.current,E))ke.current=E;let Y=ke.current,ye=jo.useCallback((G)=>{let Fe=ne.current;if(G)Fe.set(G,{...ke.current,element:G});else if(z.current)Fe.delete(z.current)},[ne]),le=Ce(R,ye,z);wt(()=>{let G=z.current,Fe=ne.current;if(G&&Fe.has(G))Fe.set(G,{...Y,element:G})},[Y,ne]);let J=jo.useRef(null);return jo.useEffect(()=>{let G=z.current,Fe=J.current;if((Fe?.element??null)===G&&(!G||Fe?.itemData===Y))return;J.current=G?{element:G,itemData:Y}:null,ee((H)=>{let fe=new T1(H);if(Fe&&Fe.element!==G)fe.delete(Fe.element);if(G)fe.set(G,{...Y,element:G});return fe.sort(M1)})}),jo.useEffect(()=>()=>{let G=J.current;if(J.current=null,!G)return;ee((Fe)=>{if(!Fe.has(G.element))return Fe;let H=new T1(Fe);return H.delete(G.element),H})},[ee]),$u.jsx(x,{...{[m]:""},ref:le,children:D})});v.displayName=g;function y(){return jo.useState(new T1)}Ho(y,"useInitCollection");function b(C){let{collection:R}=s(e+"CollectionConsumer",C);return R}Ho(b,"useCollection");function k(C){let{getCollection:R}=a(e+"CollectionConsumer",C);return R}return Ho(k,"useGetCollection"),[{Provider:l,Slot:f,ItemSlot:v},{createCollectionScope:o,useCollection:b,useGetCollection:k,useInitCollection:y}]}Ho(xie,"createCollection");function G9(e,t){if(e===t)return!0;if(typeof e!=="object"||typeof t!=="object")return!1;if(e==null||t==null)return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(e[r]!==t[r])return!1}return!0}Ho(G9,"shallowEqual");function F9(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ho(F9,"isElementPreceding");function V9(e){let t;for(let n of e.keys()){if(t){let o=t.compareDocumentPosition(n);if(!(o&Node.DOCUMENT_POSITION_DISCONNECTED)&&o&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Ho(V9,"isInDocumentOrder");function M1(e,t){return!e[1].element||!t[1].element?0:F9(e[1].element,t[1].element)?-1:1}Ho(M1,"sortByDocumentPosition");function K9(e){return new MutationObserver((n)=>{for(let o of n)if(o.type==="childList"){e();return}})}Ho(K9,"getChildListObserver");var D1=h(I(),1),kie=h(w(),1),yie=Object.defineProperty,wie=(e,t)=>yie(e,"name",{value:t,configurable:!0}),Sie={LTR:"ltr",RTL:"rtl"},Cie=D1.createContext(void 0);function pc(e){let t=D1.useContext(Cie);return e||t||Sie.LTR}wie(pc,"useDirection");var $r=h(I(),1);var Y9=["top","right","bottom","left"];var{min:dl,max:bs,round:Rv,floor:Tv}=Math,pl=(e)=>({x:e,y:e}),Nie={left:"right",right:"left",bottom:"top",top:"bottom"};function lA(e,t,n){return bs(e,dl(t,n))}function fl(e,t){return typeof e==="function"?e(t):e}function fc(e){return e.split("-")[0]}function jp(e){return e.split("-")[1]}function O1(e){return e==="x"?"y":"x"}function _1(e){return e==="y"?"height":"width"}function vs(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function I1(e){return O1(vs(e))}function W9(e,t,n){if(n===void 0)n=!1;let o=jp(e),r=I1(e),a=_1(r),i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";if(t.reference[a]>t.floating[a])i=Nv(i);return[i,Nv(i)]}function X9(e){let t=Nv(e);return[P1(e),t,P1(t)]}function P1(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var q9=["left","right"],$9=["right","left"],Rie=["top","bottom"],Tie=["bottom","top"];function Eie(e,t,n){switch(e){case"top":case"bottom":if(n)return t?$9:q9;return t?q9:$9;case"left":case"right":return t?Rie:Tie;default:return[]}}function Q9(e,t,n,o){let r=jp(e),a=Eie(fc(e),n==="start",o);if(r){if(a=a.map((i)=>i+"-"+r),t)a=a.concat(a.map(P1))}return a}function Nv(e){let t=fc(e);return Nie[t]+e.slice(t.length)}function Aie(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function cA(e){return typeof e!=="number"?Aie(e):{top:e,right:e,bottom:e,left:e}}function Up(e){let{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Z9(e,t,n){let{reference:o,floating:r}=e,a=vs(t),i=I1(t),s=_1(i),l=fc(t),c=a==="y",d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2,f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}let g=jp(t);if(g)f[i]+=p*(g==="end"?1:-1)*(n&&c?-1:1);return f}async function tj(e,t){var n;if(t===void 0)t={};let{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=fl(t,e),g=cA(f),x=s[p?u==="floating"?"reference":"floating":u],v=Up(await a.getClippingRect({element:((n=await(a.isElement==null?void 0:a.isElement(x)))!=null?n:!0)?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),k=await(a.isElement==null?void 0:a.isElement(b))&&await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=Up(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(v.top-S.top+g.top)/k.y,bottom:(S.bottom-v.bottom+g.bottom)/k.y,left:(v.left-S.left+g.left)/k.x,right:(S.right-v.right+g.right)/k.x}}var Mie=50,nj=async(e,t,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:tj},l=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Z9(c,o,l),p=o,f=0,g={};for(let m=0;m<a.length;m++){let x=a[m];if(!x)continue;let{name:v,fn:y}=x,{x:b,y:k,data:S,reset:C}=await y({x:d,y:u,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=b!=null?b:d,u=k!=null?k:u,g[v]={...g[v],...S},C&&f<Mie){if(f++,typeof C==="object"){if(C.placement)p=C.placement;if(C.rects)c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects;({x:d,y:u}=Z9(c,p,l))}m=-1}}return{x:d,y:u,placement:p,strategy:r,middlewareData:g}},oj=(e)=>({name:"arrow",options:e,async fn(t){let{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=fl(e,t)||{};if(c==null)return{};let u=cA(d),p={x:n,y:o},f=I1(r),g=_1(f),m=await i.getDimensions(c),x=f==="y",v=x?"top":"left",y=x?"bottom":"right",b=x?"clientHeight":"clientWidth",k=a.reference[g]+a.reference[f]-p[f]-a.floating[g],S=p[f]-a.reference[f],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c)),R=C?C[b]:0;if(!R||!await(i.isElement==null?void 0:i.isElement(C)))R=s.floating[b]||a.floating[g];let M=k/2-S/2,D=R/2-m[g]/2-1,E=dl(u[v],D),z=dl(u[y],D),L=R-m[g]-z,ee=R/2-m[g]/2+M,ne=lA(E,ee,L),ke=!l.arrow&&jp(r)!=null&&ee!==ne&&a.reference[g]/2-(ee<E?E:z)-m[g]/2<0,Y=ke?ee<E?ee-E:ee-L:0;return{[f]:p[f]+Y,data:{[f]:ne,centerOffset:ee-ne-Y,...ke&&{alignmentOffset:Y}},reset:ke}}});var rj=function(e){if(e===void 0)e={};return{name:"flip",options:e,async fn(t){var n,o;let{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=fl(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let v=fc(r),y=vs(s),b=fc(s)===s,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(b||!m?[Nv(s)]:X9(s)),C=g!=="none";if(!p&&C)S.push(...Q9(s,m,g,k));let R=[s,...S],M=await l.detectOverflow(t,x),D=[],E=((o=a.flip)==null?void 0:o.overflows)||[];if(d)D.push(M[v]);if(u){let ne=W9(r,i,k);D.push(M[ne[0]],M[ne[1]])}if(E=[...E,{placement:r,overflows:D}],!D.every((ne)=>ne<=0)){var z,L;let ne=(((z=a.flip)==null?void 0:z.index)||0)+1,ke=R[ne];if(ke){if(!(u==="alignment"?y!==vs(ke):!1)||E.every((le)=>vs(le.placement)===y?le.overflows[0]>0:!0))return{data:{index:ne,overflows:E},reset:{placement:ke}}}let Y=(L=E.filter((ye)=>ye.overflows[0]<=0).sort((ye,le)=>ye.overflows[1]-le.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(f){case"bestFit":{var ee;let ye=(ee=E.filter((le)=>{if(C){let J=vs(le.placement);return J===y||J==="y"}return!0}).map((le)=>[le.placement,le.overflows.filter((J)=>J>0).reduce((J,G)=>J+G,0)]).sort((le,J)=>le[1]-J[1])[0])==null?void 0:ee[0];if(ye)Y=ye;break}case"initialPlacement":Y=s;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function J9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ej(e){return Y9.some((t)=>e[t]>=0)}var aj=function(e){if(e===void 0)e={};return{name:"hide",options:e,async fn(t){let{rects:n,platform:o}=t,{strategy:r="referenceHidden",...a}=fl(e,t);switch(r){case"referenceHidden":{let i=await o.detectOverflow(t,{...a,elementContext:"reference"}),s=J9(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ej(s)}}}case"escaped":{let i=await o.detectOverflow(t,{...a,altBoundary:!0}),s=J9(i,n.floating);return{data:{escapedOffsets:s,escaped:ej(s)}}}default:return{}}}}};var ij=new Set(["left","top"]);async function Die(e,t){let{placement:n,platform:o,elements:r}=e,a=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=fc(n),s=jp(n),l=vs(n)==="y",c=ij.has(i)?-1:1,d=a&&l?-1:1,u=fl(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof u==="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};if(s&&typeof g==="number")f=s==="end"?g*-1:g;return l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}var sj=function(e){if(e===void 0)e=0;return{name:"offset",options:e,async fn(t){var n,o;let{x:r,y:a,placement:i,middlewareData:s}=t,l=await Die(t,e);if(i===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset)return{};return{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},lj=function(e){if(e===void 0)e={};return{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:r,platform:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:(y)=>{let{x:b,y:k}=y;return{x:b,y:k}}},...c}=fl(e,t),d={x:n,y:o},u=await a.detectOverflow(t,c),p=vs(r),f=O1(p),g=d[f],m=d[p],x=(y,b)=>lA(b+u[y==="y"?"top":"left"],b,b-u[y==="y"?"bottom":"right"]);if(i)g=x(f,g);if(s)m=x(p,m);let v=l.fn({...t,[f]:g,[p]:m});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[f]:i,[p]:s}}}}}},cj=function(e){if(e===void 0)e={};return{options:e,fn(t){var n,o;let{x:r,y:a,placement:i,rects:s,middlewareData:l}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=fl(e,t),p={x:r,y:a},f=vs(i),g=O1(f),m=p[g],x=p[f],v=fl(c,t),y=typeof v==="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(o=v.crossAxis)!=null?o:0};if(d){let S=g==="y"?"height":"width",C=s.reference[g]-s.floating[S]+y.mainAxis,R=s.reference[g]+s.reference[S]-y.mainAxis;if(m<C)m=C;else if(m>R)m=R}if(u){var b,k;let S=g==="y"?"width":"height",C=ij.has(fc(i)),R=s.reference[f]-s.floating[S]+(C?((b=l.offset)==null?void 0:b[f])||0:0)+(C?0:y.crossAxis),M=s.reference[f]+s.reference[S]+(C?0:((k=l.offset)==null?void 0:k[f])||0)-(C?y.crossAxis:0);if(x<R)x=R;else if(x>M)x=M}return{[g]:m,[f]:x}}}},uj=function(e){if(e===void 0)e={};return{name:"size",options:e,async fn(t){let{placement:n,rects:o,platform:r,elements:a}=t,{apply:i=()=>{},...s}=fl(e,t),l=await r.detectOverflow(t,s),c=fc(n),d=jp(n),u=vs(n)==="y",{width:p,height:f}=o.floating,g,m;if(c==="top"||c==="bottom")g=c,m=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right";else m=c,g=d==="end"?"top":"bottom";let x=f-l.top-l.bottom,v=p-l.left-l.right,y=dl(f-l[g],x),b=dl(p-l[m],v),k=t.middlewareData.shift,S=!k,C=y,R=b;if(k!=null&&k.enabled.x)R=v;if(k!=null&&k.enabled.y)C=x;if(S&&!d)if(u)R=p-2*bs(l.left,l.right);else C=f-2*bs(l.top,l.bottom);await i({...t,availableWidth:R,availableHeight:C});let M=await r.getDimensions(a.floating);if(p!==M.width||f!==M.height)return{reset:{rects:!0}};return{}}}};function z1(){return typeof window<"u"}function Vp(e){if(pj(e))return(e.nodeName||"").toLowerCase();return"#document"}function ca(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ml(e){var t;return(t=(pj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pj(e){if(!z1())return!1;return e instanceof Node||e instanceof ca(e).Node}function xs(e){if(!z1())return!1;return e instanceof Element||e instanceof ca(e).Element}function mc(e){if(!z1())return!1;return e instanceof HTMLElement||e instanceof ca(e).HTMLElement}function dj(e){if(!z1()||typeof ShadowRoot>"u")return!1;return e instanceof ShadowRoot||e instanceof ca(e).ShadowRoot}function Ev(e){let{overflow:t,overflowX:n,overflowY:o,display:r}=ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function fj(e){return/^(table|td|th)$/.test(Vp(e))}function Av(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Pie=/transform|translate|scale|rotate|perspective|filter/,Oie=/paint|layout|strict|content/,Gp=(e)=>!!e&&e!=="none",uA;function L1(e){let t=xs(e)?ys(e):e;return Gp(t.transform)||Gp(t.translate)||Gp(t.scale)||Gp(t.rotate)||Gp(t.perspective)||!B1()&&(Gp(t.backdropFilter)||Gp(t.filter))||Pie.test(t.willChange||"")||Oie.test(t.contain||"")}function mj(e){let t=Yu(e);while(mc(t)&&!Ng(t)){if(L1(t))return t;else if(Av(t))return null;t=Yu(t)}return null}function B1(){if(uA==null)uA=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none");return uA}function Ng(e){return/^(html|body|#document)$/.test(Vp(e))}function ys(e){return ca(e).getComputedStyle(e)}function Mv(e){if(xs(e))return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop};return{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yu(e){if(Vp(e)==="html")return e;let t=e.assignedSlot||e.parentNode||dj(e)&&e.host||ml(e);return dj(t)?t.host:t}function gj(e){let t=Yu(e);if(Ng(t))return(e.ownerDocument||e).body;if(mc(t)&&Ev(t))return t;return gj(t)}function Fp(e,t,n){var o;if(t===void 0)t=[];if(n===void 0)n=!0;let r=gj(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),i=ca(r);if(a){let s=H1(i);return t.concat(i,i.visualViewport||[],Ev(r)?r:[],s&&n?Fp(s):[])}else return t.concat(r,Fp(r,[],n))}function H1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vj(e){let t=ys(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=mc(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=Rv(n)!==a||Rv(o)!==i;if(s)n=a,o=i;return{width:n,height:o,$:s}}function pA(e){return!xs(e)?e.contextElement:e}function Rg(e){let t=pA(e);if(!mc(t))return pl(1);let n=t.getBoundingClientRect(),{width:o,height:r,$:a}=vj(t),i=(a?Rv(n.width):n.width)/o,s=(a?Rv(n.height):n.height)/r;if(!i||!Number.isFinite(i))i=1;if(!s||!Number.isFinite(s))s=1;return{x:i,y:s}}var _ie=pl(0);function xj(e){let t=ca(e);if(!B1()||!t.visualViewport)return _ie;return{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iie(e,t,n){if(t===void 0)t=!1;return!!n&&t&&n===ca(e)}function Kp(e,t,n,o){if(t===void 0)t=!1;if(n===void 0)n=!1;let r=e.getBoundingClientRect(),a=pA(e),i=pl(1);if(t)if(o){if(xs(o))i=Rg(o)}else i=Rg(e);let s=Iie(a,n,o)?xj(a):pl(0),l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(a&&o){let p=ca(a),f=xs(o)?ca(o):o,g=p,m=H1(g);while(m&&f!==g){let x=Rg(m),v=m.getBoundingClientRect(),y=ys(m),b=v.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,k=v.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,u*=x.y,l+=b,c+=k,g=ca(m),m=H1(g)}}return Up({width:d,height:u,x:l,y:c})}function j1(e,t){let n=Mv(e).scrollLeft;if(!t)return Kp(ml(e)).left+n;return t.left+n}function yj(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-j1(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function zie(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e,a=r==="fixed",i=ml(o),s=t?Av(t.floating):!1;if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=pl(1),d=pl(0),u=mc(o);if(u||!a){if(Vp(o)!=="body"||Ev(i))l=Mv(o);if(u){let f=Kp(o);c=Rg(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}}let p=i&&!u&&!a?yj(i,l):pl(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function Lie(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Bie(e){let t=Mv(e),n=e.ownerDocument.body,o=bs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=bs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+j1(e),i=-t.scrollTop;if(ys(n).direction==="rtl")a+=bs(e.clientWidth,n.clientWidth)-o;return{width:o,height:r,x:a,y:i}}var Hie=25;function jie(e,t,n){if(n===void 0)n="viewport";let o=n==="layoutViewport",r=ca(e),a=ml(e),i=r.visualViewport,{clientWidth:s,clientHeight:l}=a,c=0,d=0;if(i){let p=!B1()||t==="fixed";if(o){if(!p)c=-i.offsetLeft,d=-i.offsetTop}else if(s=i.width,l=i.height,p)c=i.offsetLeft,d=i.offsetTop}if(j1(a)<=0){let p=a.ownerDocument,f=p.body,g=getComputedStyle(f),m=p.compatMode==="CSS1Compat"?parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0:0,x=Math.abs(a.clientWidth-f.clientWidth-m),v=getComputedStyle(a).scrollbarGutter==="stable both-edges"?x/2:x;if(v<=Hie)s-=v}return{width:s,height:l,x:c,y:d}}function Uie(e,t){let n=Kp(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Rg(e),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=r*a.x,c=o*a.y;return{width:i,height:s,x:l,y:c}}function hj(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=jie(e,n,t);else if(t==="document")o=Bie(ml(e));else if(xs(t))o=Uie(t,n);else{let r=xj(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Up(o)}function Gie(e,t){let n=t.get(e);if(n)return n;let o=Fp(e,[],!1).filter((s)=>xs(s)&&Vp(s)!=="body"),r=null,a=ys(e).position==="fixed",i=a?Yu(e):e;while(xs(i)&&!Ng(i)){let s=ys(i),l=L1(i),c=r?r.position:a?"fixed":"";if(!l&&(c==="fixed"||c==="absolute"&&s.position==="static"))o=o.filter((u)=>u!==i);else r=s;i=Yu(i)}return t.set(e,o),o}function Fie(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e,i=[...n==="clippingAncestors"?Av(t)?[]:Gie(t,this._c):[].concat(n),o],s=hj(t,i[0],r),{top:l,right:c,bottom:d,left:u}=s;for(let p=1;p<i.length;p++){let f=hj(t,i[p],r);l=bs(f.top,l),c=dl(f.right,c),d=dl(f.bottom,d),u=bs(f.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function Vie(e){let{width:t,height:n}=vj(e);return{width:t,height:n}}function Kie(e,t,n){let o=mc(t),r=ml(t),a=n==="fixed",i=Kp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=pl(0);if(o||!a){if(Vp(t)!=="body"||Ev(r))s=Mv(t);if(o){let p=Kp(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}}if(!o&&r)l.x=j1(r);let c=r&&!o&&!a?yj(r,s):pl(0),d=i.left+s.scrollLeft-l.x-c.x,u=i.top+s.scrollTop-l.y-c.y;return{x:d,y:u,width:i.width,height:i.height}}function dA(e){return ys(e).position==="static"}function bj(e,t){if(!mc(e)||ys(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;if(ml(e)===n)n=n.ownerDocument.body;return n}function wj(e,t){let n=ca(e);if(Av(e))return n;if(!mc(e)){let r=Yu(e);while(r&&!Ng(r)){if(xs(r)&&!dA(r))return r;r=Yu(r)}return n}let o=bj(e,t);while(o&&fj(o)&&dA(o))o=bj(o,t);if(o&&Ng(o)&&dA(o)&&!L1(o))return n;return o||mj(e)||n}var qie=async function(e){let t=this.getOffsetParent||wj,n=this.getDimensions,o=await n(e.floating);return{reference:Kie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function $ie(e){return ys(e).direction==="rtl"}var kj={convertOffsetParentRelativeRectToViewportRelativeRect:zie,getDocumentElement:ml,getClippingRect:Fie,getOffsetParent:wj,getElementRects:qie,getClientRects:Lie,getDimensions:Vie,getScale:Rg,isElement:xs,isRTL:$ie};function Sj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yie(e,t,n){let o=null,r,a=ml(e);function i(){var d;clearTimeout(r),(d=o)==null||d.disconnect(),o=null}function s(d,u){if(d===void 0)d=!1;if(u===void 0)u=1;i();let p=e.getBoundingClientRect(),{left:f,top:g,width:m,height:x}=p;if(!d)t();if(!m||!x)return;let v=Tv(g),y=Tv(a.clientWidth-(f+m)),b=Tv(a.clientHeight-(g+x)),k=Tv(f),C={rootMargin:-v+"px "+-y+"px "+-b+"px "+-k+"px",threshold:bs(0,dl(1,u))||1},R=!0;function M(D){let E=D[0].intersectionRatio;if(!Sj(p,e.getBoundingClientRect()))return s();if(E!==u){if(!R)return s();if(!E)r=setTimeout(()=>{s(!1,0.0000001)},1000);else s(!1,E)}R=!1}try{o=new IntersectionObserver(M,{...C,root:a.ownerDocument})}catch(D){o=new IntersectionObserver(M,C)}o.observe(e)}let l=ca(e),c=()=>s(n);return l.addEventListener("resize",c),s(!0),()=>{l.removeEventListener("resize",c),i()}}function fA(e,t,n,o){if(o===void 0)o={};let{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver==="function",layoutShift:s=typeof IntersectionObserver==="function",animationFrame:l=!1}=o,c=pA(e),d=r||a?[...c?Fp(c):[],...t?Fp(t):[]]:[];d.forEach((v)=>{r&&v.addEventListener("scroll",n),a&&v.addEventListener("resize",n)});let u=c&&s?Yie(c,n,a):null,p=-1,f=null;if(i){if(f=new ResizeObserver((v)=>{let[y]=v;if(y&&y.target===c&&f&&t)f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(t)});n()}),c&&!l)f.observe(c);if(t)f.observe(t)}let g,m=l?Kp(e):null;if(l)x();function x(){let v=Kp(e);if(m&&!Sj(m,v))n();m=v,g=requestAnimationFrame(x)}return n(),()=>{var v;if(d.forEach((y)=>{r&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),u==null||u(),(v=f)==null||v.disconnect(),f=null,l)cancelAnimationFrame(g)}}var Cj=sj;var Nj=lj,Rj=rj,Tj=uj,Ej=aj,mA=oj;var Aj=cj,gA=(e,t,n)=>{let o=new Map,r=n!=null?n:{},a={...kj,...r.platform,_c:o};return nj(e,t,{...r,platform:a})};var To=h(I(),1),Dj=h(I(),1),Pj=h(fi(),1),Wie=typeof document<"u",Xie=function(){},U1=Wie?Dj.useLayoutEffect:Xie;function G1(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(typeof e==="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e==="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!G1(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){let a=r[o];if(a==="_owner"&&e.$$typeof)continue;if(!G1(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Oj(e){if(typeof window>"u")return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mj(e,t){let n=Oj(e);return Math.round(t*n)/n}function hA(e){let t=To.useRef(e);return U1(()=>{t.current=e}),t}function _j(e){if(e===void 0)e={};let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,u]=To.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=To.useState(o);if(!G1(p,o))f(o);let[g,m]=To.useState(null),[x,v]=To.useState(null),y=To.useCallback((le)=>{if(le!==C.current)C.current=le,m(le)},[]),b=To.useCallback((le)=>{if(le!==R.current)R.current=le,v(le)},[]),k=a||g,S=i||x,C=To.useRef(null),R=To.useRef(null),M=To.useRef(d),D=l!=null,E=hA(l),z=hA(r),L=hA(c),ee=To.useCallback(()=>{if(!C.current||!R.current)return;let le={placement:t,strategy:n,middleware:p};if(z.current)le.platform=z.current;gA(C.current,R.current,le).then((J)=>{let G={...J,isPositioned:L.current!==!1};if(ne.current&&!G1(M.current,G))M.current=G,Pj.flushSync(()=>{u(G)})})},[p,t,n,z,L]);U1(()=>{if(c===!1&&M.current.isPositioned)M.current.isPositioned=!1,u((le)=>({...le,isPositioned:!1}))},[c]);let ne=To.useRef(!1);U1(()=>(ne.current=!0,()=>{ne.current=!1}),[]),U1(()=>{if(k)C.current=k;if(S)R.current=S;if(k&&S){if(E.current)return E.current(k,S,ee);ee()}},[k,S,ee,E,D]);let ke=To.useMemo(()=>({reference:C,floating:R,setReference:y,setFloating:b}),[y,b]),Y=To.useMemo(()=>({reference:k,floating:S}),[k,S]),ye=To.useMemo(()=>{let le={position:n,left:0,top:0};if(!Y.floating)return le;let J=Mj(Y.floating,d.x),G=Mj(Y.floating,d.y);if(s)return{...le,transform:"translate("+J+"px, "+G+"px)",...Oj(Y.floating)>=1.5&&{willChange:"transform"}};return{position:n,left:J,top:G}},[n,s,Y.floating,d.x,d.y]);return To.useMemo(()=>({...d,update:ee,refs:ke,elements:Y,floatingStyles:ye}),[d,ee,ke,Y,ye])}var Qie=(e)=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){let{element:o,padding:r}=typeof e==="function"?e(n):e;if(o&&t(o)){if(o.current!=null)return mA({element:o.current,padding:r}).fn(n);return{}}if(o)return mA({element:o,padding:r}).fn(n);return{}}}},Ij=(e,t)=>{let n=Cj(e);return{name:n.name,fn:n.fn,options:[e,t]}},zj=(e,t)=>{let n=Nj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lj=(e,t)=>({fn:Aj(e).fn,options:[e,t]}),Bj=(e,t)=>{let n=Rj(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hj=(e,t)=>{let n=Tj(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jj=(e,t)=>{let n=Ej(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Uj=(e,t)=>{let n=Qie(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Tg=h(w(),1),Zie=Object.defineProperty,Wu=(e,t)=>Zie(e,"name",{value:t,configurable:!0});var Gj={Partial:"partial",Always:"always"},Fj={Optimized:"optimized",Always:"always"},Vj="Popper",[Kj,zi]=en(Vj),[Jie,qj]=Kj(Vj),Xu=Wu((e)=>{let{__scopePopper:t,children:n}=e,[o,r]=$r.useState(null),[a,i]=$r.useState(void 0);return Tg.jsx(Jie,{scope:t,anchor:o,onAnchorChange:r,placementState:a,setPlacementState:i,children:n})},"Popper"),ese="PopperAnchor",gc=$r.forwardRef(Wu(function(t,n){let{__scopePopper:o,virtualRef:r,...a}=t,i=qj(ese,o),s=$r.useRef(null),l=i.onAnchorChange,c=$r.useCallback((m)=>{if(s.current=m,m)l(m)},[l]),d=Ce(n,c),u=$r.useRef(null);$r.useEffect(()=>{if(!r)return;let m=u.current;if(u.current=r.current,m!==u.current)l(u.current)});let p=i.placementState&&F1(i.placementState),f=p?.[0],g=p?.[1];return r?null:Tg.jsx(be.div,{"data-radix-popper-side":f,"data-radix-popper-align":g,...a,ref:d})},"PopperAnchor")),$j="PopperContent",[tse,bSe]=Kj($j),Qu=$r.forwardRef(Wu(function(t,n){let{__scopePopper:o,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p=Gj.Partial,hideWhenDetached:f=!1,updatePositionStrategy:g=Fj.Optimized,onPlaced:m,...x}=t,v=qj($j,o),[y,b]=$r.useState(null),k=Ce(n,b),[S,C]=$r.useState(null),R=Bp(S),M=R?.width??0,D=R?.height??0,E=r+(i!=="center"?"-"+i:""),z=typeof u==="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],ee=L.length>0,ne={padding:z,boundary:L.filter(Yj),altBoundary:ee},{refs:ke,floatingStyles:Y,placement:ye,isPositioned:le,middlewareData:J}=_j({strategy:"fixed",placement:E,whileElementsMounted:Wu((...ae)=>fA(...ae,{animationFrame:g===Fj.Always}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Ij({mainAxis:a+D,alignmentAxis:s}),c&&zj({mainAxis:!0,crossAxis:!1,...p===Gj.Partial?{limiter:Lj()}:{},...ne}),c&&Bj({...ne}),Hj({...ne,apply:Wu(({elements:ae,rects:xe,availableWidth:Dt,availableHeight:gt})=>{let{width:Le,height:$e}=xe.reference,st=ae.floating.style;st.setProperty("--radix-popper-available-width",`${Dt}px`),st.setProperty("--radix-popper-available-height",`${gt}px`),st.setProperty("--radix-popper-anchor-width",`${Le}px`),st.setProperty("--radix-popper-anchor-height",`${$e}px`)},"apply")}),S&&Uj({element:S,padding:l}),nse({arrowWidth:M,arrowHeight:D}),f&&jj(ee?{strategy:"referenceHidden",...ne}:{strategy:"referenceHidden",padding:ne.padding,altBoundary:ne.altBoundary})]}),G=v.setPlacementState;wt(()=>(G(ye),()=>{G(void 0)}),[ye,G]);let[Fe,H]=F1(ye),fe=Lo(m);wt(()=>{if(le)fe?.()},[le,fe]);let oe=J.arrow?.x,F=J.arrow?.y,B=J.arrow?.centerOffset!==0,[ve,We]=$r.useState();return wt(()=>{if(y)We(window.getComputedStyle(y).zIndex)},[y]),Tg.jsx("div",{ref:ke.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:le?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:Tg.jsx(tse,{scope:o,placedSide:Fe,placedAlign:H,onArrowChange:C,arrowX:oe,arrowY:F,shouldHideArrow:B,children:Tg.jsx(be.div,{"data-side":Fe,"data-align":H,...x,ref:k,style:{...x.style,animation:!le?"none":x.style?.animation}})})})},"PopperContent"));function Yj(e){return e!==null}Wu(Yj,"isNotNull");var nse=Wu((e)=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=F1(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(r.arrow?.x??0)+s/2,f=(r.arrow?.y??0)+l/2,g="",m="";if(c==="bottom")g=i?u:`${p}px`,m=`${-l}px`;else if(c==="top")g=i?u:`${p}px`,m=`${o.floating.height+l}px`;else if(c==="right")g=`${-l}px`,m=i?u:`${f}px`;else if(c==="left")g=`${o.floating.width+l}px`,m=i?u:`${f}px`;return{data:{x:g,y:m}}}}),"transformOrigin");function F1(e){let[t,n="center"]=e.split("-");return[t,n]}Wu(F1,"getSideAndAlignFromPlacement");var ur=h(I(),1);var rse=h(I(),1),K1=h(I(),1),ose=Object.defineProperty,vA=(e,t)=>ose(e,"name",{value:t,configurable:!0}),bA=!1;function Wj(){let[e,t]=K1.useState(bA);return K1.useEffect(()=>{if(!bA)bA=!0,t(!0)},[]),e}vA(Wj,"useIsHydrated");var Xj=rse[" useSyncExternalStore ".trim().toString()];function Qj(){return()=>{}}vA(Qj,"subscribe");function Zj(){return Xj(Qj,()=>!0,()=>!1)}vA(Zj,"useIsHydratedModern");var Jj=typeof Xj==="function"?Zj:Wj;var Zu=h(w(),1),ase=Object.defineProperty,qp=(e,t)=>ase(e,"name",{value:t,configurable:!0}),xA="rovingFocusGroup.onEntryFocus",ise={bubbles:!1,cancelable:!0},q1="RovingFocusGroup",[yA,tU,sse]=Hp(q1),[lse,Eg]=en(q1,[sse]),eU={Vertical:"vertical",Horizontal:"horizontal"},cse={LTR:"ltr",RTL:"rtl"},[use,dse]=lse(q1),$1=ur.forwardRef(qp(function(t,n){return Zu.jsx(yA.Provider,{scope:t.__scopeRovingFocusGroup,children:Zu.jsx(yA.Slot,{scope:t.__scopeRovingFocusGroup,children:Zu.jsx(pse,{...t,ref:n})})})},"RovingFocusGroup")),pse=ur.forwardRef(qp(function(t,n){let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=t,f=ur.useRef(null),g=Ce(n,f),m=pc(i),[x,v]=Jn({prop:s,defaultProp:l??null,onChange:c,caller:q1}),[y,b]=ur.useState(!1),k=Lo(d),S=tU(o),C=ur.useRef(!1),[R,M]=ur.useState(0);return ur.useEffect(()=>{let D=f.current;if(D)return D.addEventListener(xA,k),()=>D.removeEventListener(xA,k)},[k]),Zu.jsx(use,{scope:o,orientation:r,dir:m,loop:a,currentTabStopId:x,onItemFocus:ur.useCallback((D)=>v(D),[v]),onItemShiftTab:ur.useCallback(()=>b(!0),[]),onFocusableItemAdd:ur.useCallback(()=>M((D)=>D+1),[]),onFocusableItemRemove:ur.useCallback(()=>M((D)=>D-1),[]),children:Zu.jsx(be.div,{tabIndex:y||R===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...t.style},onMouseDown:te(t.onMouseDown,()=>{C.current=!0}),onFocus:te(t.onFocus,(D)=>{let E=!C.current;if(D.target===D.currentTarget&&E&&!y){let z=new CustomEvent(xA,ise);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){let L=S().filter((ye)=>ye.focusable),ee=L.find((ye)=>ye.active),ne=L.find((ye)=>ye.id===x),Y=[ee,ne,...L].filter(Boolean).map((ye)=>ye.ref.current);wA(Y,u)}}C.current=!1}),onBlur:te(t.onBlur,()=>b(!1))})})},"RovingFocusGroupImpl")),fse="RovingFocusGroupItem",Y1=ur.forwardRef(qp(function(t,n){let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...l}=t,c=rn(),d=i||c,u=dse(fse,o),p=u.currentTabStopId===d,f=tU(o),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:x}=u,v=Jj();return wt(()=>{if(!v||!r)return;return g(),()=>m()},[v,r,g,m]),ur.useEffect(()=>{if(v||!r)return;return g(),()=>m()},[v,r,g,m]),Zu.jsx(yA.ItemSlot,{scope:o,id:d,focusable:r,active:a,children:Zu.jsx(be.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:n,onMouseDown:te(t.onMouseDown,(y)=>{if(!r)y.preventDefault();else u.onItemFocus(d)}),onFocus:te(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:te(t.onKeyDown,(y)=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let b=oU(y,u.orientation,u.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=f().filter((C)=>C.focusable).map((C)=>C.ref.current);if(b==="last")S.reverse();else if(b==="prev"||b==="next"){if(b==="prev")S.reverse();let C=S.indexOf(y.currentTarget);S=u.loop?rU(S,C+1):S.slice(C+1)}setTimeout(()=>wA(S))}}),children:typeof s==="function"?s({isCurrentTabStop:p,hasTabStop:x!=null}):s})})},"RovingFocusGroupItem")),mse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nU(e,t){if(t!==cse.RTL)return e;return e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}qp(nU,"getDirectionAwareKey");function oU(e,t,n){let o=nU(e.key,n);if(t===eU.Vertical&&["ArrowLeft","ArrowRight"].includes(o))return;if(t===eU.Horizontal&&["ArrowUp","ArrowDown"].includes(o))return;return mse[o]}qp(oU,"getFocusIntent");function wA(e,t=!1){let n=document.activeElement;for(let o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}qp(wA,"focusFirst");function rU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}qp(rU,"wrapArray");var St=h(w(),1),gse=Object.defineProperty,Kt=(e,t)=>gse(e,"name",{value:t,configurable:!0});var kA=["Enter"," "],hse=["ArrowDown","PageUp","Home"],sU=["ArrowUp","PageDown","End"],bse=[...hse,...sU],$Se={ltr:[...kA,"ArrowRight"],rtl:[...kA,"ArrowLeft"]};var X1="Menu",[SA,vse,xse]=Hp(X1),[$p,RA]=en(X1,[xse,zi,Eg]),TA=zi(),lU=Eg(),[yse,Dv]=$p(X1),[wse,EA]=$p(X1),cU=Kt((e)=>{let{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,s=TA(t),[l,c]=He.useState(null),d=He.useRef(!1),u=Lo(a),p=pc(r);return He.useEffect(()=>{let f=Kt(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Kt(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),He.useEffect(()=>{if(!n)return;let f=Kt(()=>u(!1),"handleBlur");return window.addEventListener("blur",f),()=>window.removeEventListener("blur",f)},[n,u]),St.jsx(Xu,{...s,children:St.jsx(yse,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:St.jsx(wse,{scope:t,onClose:He.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:i,children:o})})})},"Menu"),uU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t,a=TA(o);return St.jsx(gc,{...a,...r,ref:n})},"MenuAnchor")),dU="MenuPortal",[kse,Sse]=$p(dU,{forceMount:void 0}),pU=Kt((e)=>{let{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=Dv(dU,t);return St.jsx(kse,{scope:t,forceMount:n,children:St.jsx(Pr,{present:n||a.open,children:St.jsx(cl,{asChild:!0,container:r,children:o})})})},"MenuPortal"),Ju="MenuContent",[Cse,fU]=$p(Ju),mU=He.forwardRef(Kt(function(t,n){let o=Sse(Ju,t.__scopeMenu),{forceMount:r=o.forceMount,...a}=t,i=Dv(Ju,t.__scopeMenu),s=EA(Ju,t.__scopeMenu);return St.jsx(SA.Provider,{scope:t.__scopeMenu,children:St.jsx(Pr,{present:r||i.open,children:St.jsx(SA.Slot,{scope:t.__scopeMenu,children:s.modal?St.jsx(Nse,{...a,ref:n}):St.jsx(Rse,{...a,ref:n})})})})},"MenuContent")),Nse=He.forwardRef(Kt(function(t,n){let o=Dv(Ju,t.__scopeMenu),r=He.useRef(null),a=Ce(n,r);return He.useEffect(()=>{let i=r.current;if(i)return qu(i)},[]),St.jsx(gU,{...t,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:te(t.onFocusOutside,(i)=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),Rse=He.forwardRef(Kt(function(t,n){let o=Dv(Ju,t.__scopeMenu);return St.jsx(gU,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),Tse=lr("MenuContent.ScrollLock"),gU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:g,disableOutsideScroll:m,...x}=t,v=Dv(Ju,o),y=EA(Ju,o),b=TA(o),k=lU(o),S=vse(o),[C,R]=He.useState(null),M=He.useRef(null),[D,E]=He.useState(null);Dp(D);let{nodes:z,registry:L}=Mp(),ee=Boolean(a||m),ne=Ce(n,M,v.onContentChange,E),ke=He.useRef(0),Y=He.useRef(""),ye=He.useRef(0),le=He.useRef(null),J=He.useRef("right"),G=He.useRef(0),Fe=He.useMemo(()=>m?[M,...z.map((B)=>({current:B}))]:[],[M,z,m]),H=m?lc:He.Fragment,fe=m?{as:Tse,allowPinchZoom:!0,shards:Fe}:void 0,oe=Kt((B)=>{let ve=Y.current+B,We=S().filter((st)=>!st.disabled),ae=document.activeElement,xe=We.find((st)=>st.ref.current===ae)?.textValue,Dt=We.map((st)=>st.textValue),gt=RU(Dt,ve,xe),Le=We.find((st)=>st.textValue===gt)?.ref.current;function $e(st){if(Y.current=st,window.clearTimeout(ke.current),st!=="")ke.current=window.setTimeout(()=>$e(""),1000)}if(Kt($e,"updateSearch"),$e(ve),Le)setTimeout(()=>Le.focus())},"handleTypeaheadSearch");He.useEffect(()=>()=>window.clearTimeout(ke.current),[]),ul();let F=He.useCallback((B)=>J.current===le.current?.side&&EU(B,le.current?.area),[]);return St.jsx(Cse,{scope:o,searchRef:Y,onItemEnter:He.useCallback((B)=>{if(F(B))B.preventDefault()},[F]),onItemLeave:He.useCallback((B)=>{if(F(B))return;M.current?.focus(),R(null)},[F]),onTriggerLeave:He.useCallback((B)=>{if(F(B))B.preventDefault()},[F]),pointerGraceTimerRef:ye,onPointerGraceIntentChange:He.useCallback((B)=>{le.current=B},[]),children:St.jsx(Ap,{registry:ee?L:null,children:St.jsx(H,{...fe,children:St.jsx(Ku,{asChild:!0,trapped:a,branches:z,onMountAutoFocus:te(i,(B)=>{B.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:St.jsx(ll,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,onDismiss:g,children:St.jsx($1,{asChild:!0,...k,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:R,onEntryFocus:te(c,(B)=>{if(!y.isUsingKeyboardRef.current)B.preventDefault()}),preventScrollOnEntryFocus:!0,children:St.jsx(Qu,{role:"menu","aria-orientation":"vertical","data-state":wU(v.open),"data-radix-menu-content":"",dir:y.dir,...b,...x,ref:ne,style:{outline:"none",...x.style},onKeyDown:te(x.onKeyDown,(B)=>{let We=B.target.closest("[data-radix-menu-content]")===B.currentTarget,ae=B.ctrlKey||B.altKey||B.metaKey,xe=B.key.length===1;if(We){if(B.key==="Tab")B.preventDefault();if(!ae&&xe)oe(B.key)}let Dt=M.current;if(B.target!==Dt)return;if(!bse.includes(B.key))return;B.preventDefault();let Le=S().filter(($e)=>!$e.disabled).map(($e)=>$e.ref.current);if(sU.includes(B.key))Le.reverse();CU(Le)}),onBlur:te(t.onBlur,(B)=>{if(!B.currentTarget.contains(B.target))window.clearTimeout(ke.current),Y.current=""}),onPointerMove:te(t.onPointerMove,W1((B)=>{let ve=B.target,We=G.current!==B.clientX;if(B.currentTarget.contains(ve)&&We){let ae=B.clientX>G.current?"right":"left";J.current=ae,G.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),hU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{role:"group",...r,ref:n})},"MenuGroup")),bU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{...r,ref:n})},"MenuLabel")),CA="MenuItem",iU="menu.itemSelect",AA=He.forwardRef(Kt(function(t,n){let{disabled:o=!1,onSelect:r,...a}=t,i=He.useRef(null),s=EA(CA,t.__scopeMenu),l=fU(CA,t.__scopeMenu),c=Ce(n,i),d=He.useRef(!1),u=Kt(()=>{let p=i.current;if(!o&&p){let f=new CustomEvent(iU,{bubbles:!0,cancelable:!0});if(p.addEventListener(iU,(g)=>r?.(g),{once:!0}),vv(p,f),f.defaultPrevented)d.current=!1;else s.onClose()}},"handleSelect");return St.jsx(Ese,{...a,ref:c,disabled:o,onClick:te(t.onClick,u),onPointerDown:(p)=>{t.onPointerDown?.(p),d.current=!0},onPointerUp:te(t.onPointerUp,(p)=>{if(!d.current)p.currentTarget?.click()}),onKeyDown:te(t.onKeyDown,(p)=>{if(o||p.target!==p.currentTarget)return;if(l.searchRef.current!==""&&p.key===" ")return;if(kA.includes(p.key))p.currentTarget.click(),p.preventDefault()})})},"MenuItem")),Ese=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,disabled:r=!1,textValue:a,...i}=t,s=fU(CA,o),l=lU(o),c=He.useRef(null),d=Ce(n,c),[u,p]=He.useState(!1),[f,g]=He.useState("");return He.useEffect(()=>{let m=c.current;if(m)g((m.textContent??"").trim())},[i.children]),St.jsx(SA.ItemSlot,{scope:o,disabled:r,textValue:a??f,children:St.jsx(Y1,{asChild:!0,...l,focusable:!r,children:St.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:te(t.onPointerMove,W1((m)=>{if(r)s.onItemLeave(m);else if(s.onItemEnter(m),!m.defaultPrevented)m.currentTarget.focus({preventScroll:!0})})),onPointerLeave:te(t.onPointerLeave,W1((m)=>s.onItemLeave(m))),onFocus:te(t.onFocus,()=>p(!0)),onBlur:te(t.onBlur,()=>p(!1))})})})},"MenuItemImpl"));var Ase="MenuRadioGroup",[Mse,Dse]=$p(Ase,{value:void 0,onValueChange:Kt(()=>{},"onValueChange")}),vU=He.forwardRef(Kt(function(t,n){let{value:o,onValueChange:r,...a}=t,i=Lo(r);return St.jsx(Mse,{scope:t.__scopeMenu,value:o,onValueChange:i,children:St.jsx(hU,{...a,ref:n})})},"MenuRadioGroup")),Pse="MenuRadioItem",xU=He.forwardRef(Kt(function(t,n){let{value:o,...r}=t,a=Dse(Pse,t.__scopeMenu),i=o===a.value;return St.jsx(_se,{scope:t.__scopeMenu,checked:i,children:St.jsx(AA,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":SU(i),onSelect:te(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Ose="MenuItemIndicator",[_se,YSe]=$p(Ose,{checked:!1});var yU=He.forwardRef(Kt(function(t,n){let{__scopeMenu:o,...r}=t;return St.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator"));var Ise="MenuSub",[WSe,XSe]=$p(Ise);function wU(e){return e?"open":"closed"}Kt(wU,"getOpenState");function kU(e){return e==="indeterminate"}Kt(kU,"isIndeterminate");function SU(e){return kU(e)?"indeterminate":e?"checked":"unchecked"}Kt(SU,"getCheckedState");function CU(e){let t=document.activeElement;for(let n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}Kt(CU,"focusFirst");function NU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}Kt(NU,"wrapArray");function RU(e,t,n){let r=t.length>1&&Array.from(t).every((c)=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1,i=NU(e,Math.max(a,0));if(r.length===1)i=i.filter((c)=>c!==n);let l=i.find((c)=>c.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}Kt(RU,"getNextMatch");function TU(e,t){let{x:n,y:o}=e,r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],{x:c,y:d}=s,{x:u,y:p}=l;if(d>o!==p>o&&n<(u-c)*(o-d)/(p-d)+c)r=!r}return r}Kt(TU,"isPointInPolygon");function EU(e,t){if(!t)return!1;let n={x:e.clientX,y:e.clientY};return TU(n,t)}Kt(EU,"isPointerInGraceArea");function W1(e){return(t)=>t.pointerType==="mouse"?e(t):void 0}Kt(W1,"whenMouse");var Li=h(w(),1),Lse=Object.defineProperty,hc=(e,t)=>Lse(e,"name",{value:t,configurable:!0}),MA="DropdownMenu",[Bse,uCe]=en(MA,[RA]),bc=RA(),[Hse,AU]=Bse(MA),jse=hc((e)=>{let{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=bc(t),c=ni.useRef(null),[d,u]=Jn({prop:r,defaultProp:a??!1,onChange:i,caller:MA});return Li.jsx(Hse,{scope:t,triggerId:rn(),triggerRef:c,contentId:rn(),open:d,onOpenChange:u,onOpenToggle:ni.useCallback(()=>u((p)=>!p),[u]),modal:s,children:Li.jsx(cU,{...l,open:d,onOpenChange:u,dir:o,modal:s,children:n})})},"DropdownMenu"),Use="DropdownMenuTrigger",Gse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,disabled:r=!1,...a}=t,i=AU(Use,o),s=bc(o),l=Ce(n,i.triggerRef);return Li.jsx(uU,{asChild:!0,...s,children:Li.jsx(be.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:l,onPointerDown:te(t.onPointerDown,(c)=>{if(!r&&c.button===0&&c.ctrlKey===!1){if(i.onOpenToggle(),!i.open)c.preventDefault()}}),onKeyDown:te(t.onKeyDown,(c)=>{if(r)return;if(["Enter"," "].includes(c.key))i.onOpenToggle();if(c.key==="ArrowDown")i.onOpenChange(!0);if(["Enter"," ","ArrowDown"].includes(c.key))c.preventDefault()})})})},"DropdownMenuTrigger")),Fse=hc((e)=>{let{__scopeDropdownMenu:t,...n}=e,o=bc(t);return Li.jsx(pU,{...o,...n})},"DropdownMenuPortal"),Vse="DropdownMenuContent",Kse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=AU(Vse,o),i=bc(o),s=ni.useRef(!1);return Li.jsx(mU,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:n,onCloseAutoFocus:te(t.onCloseAutoFocus,(l)=>{if(!s.current)a.triggerRef.current?.focus();s.current=!1,l.preventDefault()}),onInteractOutside:te(t.onInteractOutside,(l)=>{let c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;if(!a.modal||u)s.current=!0}),style:{...t.style,...{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}})},"DropdownMenuContent"));var qse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(bU,{...a,...r,ref:n})},"DropdownMenuLabel")),$se=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(AA,{...a,...r,ref:n})},"DropdownMenuItem"));var Yse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(vU,{...a,...r,ref:n})},"DropdownMenuRadioGroup")),Wse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(xU,{...a,...r,ref:n})},"DropdownMenuRadioItem"));var Xse=ni.forwardRef(hc(function(t,n){let{__scopeDropdownMenu:o,...r}=t,a=bc(o);return Li.jsx(yU,{...a,...r,ref:n})},"DropdownMenuSeparator"));var DU=h(I(),1);var PU=h(w(),1),Qse=Object.defineProperty,Zse=(e,t)=>Qse(e,"name",{value:t,configurable:!0}),Jse=DU.forwardRef(Zse(function(t,n){return PU.jsx(be.label,{...t,ref:n,onMouseDown:(o)=>{if(o.target.closest("button, input, select, textarea"))return;if(t.onMouseDown?.(o),!o.defaultPrevented&&o.detail>1)o.preventDefault()}})},"Label"));var dn=h(I(),1);var Uo=h(w(),1),ele=Object.defineProperty,gl=(e,t)=>ele(e,"name",{value:t,configurable:!0}),DA="Popover",[_U,TCe]=en(DA,[zi]),Q1=zi(),[tle,Yp]=_U(DA),nle=gl((e)=>{let{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:i=!1}=e,s=Q1(t),l=dn.useRef(null),[c,d]=dn.useState(!1),[u,p]=dn.useState(0),[f,g]=dn.useState(0),[m,x]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:DA});return Uo.jsx(Xu,{...s,children:Uo.jsx(tle,{scope:t,contentId:rn(),titleId:rn(),descriptionId:rn(),titlePresent:u>0,descriptionPresent:f>0,setTitleCount:p,setDescriptionCount:g,triggerRef:l,open:m,onOpenChange:x,onOpenToggle:dn.useCallback(()=>x((v)=>!v),[x]),hasCustomAnchor:c,onCustomAnchorAdd:dn.useCallback(()=>d(!0),[]),onCustomAnchorRemove:dn.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),ole="PopoverAnchor",rle=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,...r}=t,a=Yp(ole,o),i=Q1(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return dn.useEffect(()=>(s(),()=>l()),[s,l]),Uo.jsx(gc,{...i,...r,ref:n})},"PopoverAnchor")),ale="PopoverTrigger",ile=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,...r}=t,a=Yp(ale,o),i=Q1(o),s=Ce(n,a.triggerRef),l=Uo.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":PA(a.open),...r,ref:s,onClick:te(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:Uo.jsx(gc,{asChild:!0,...i,children:l})},"PopoverTrigger")),IU="PopoverPortal",[sle,lle]=_U(IU,{forceMount:void 0}),cle=gl((e)=>{let{__scopePopover:t,forceMount:n,children:o,container:r}=e,a=Yp(IU,t);return Uo.jsx(sle,{scope:t,forceMount:n,children:Uo.jsx(Pr,{present:n||a.open,children:Uo.jsx(cl,{asChild:!0,container:r,children:o})})})},"PopoverPortal"),Pv="PopoverContent",ule=dn.forwardRef(gl(function(t,n){let o=lle(Pv,t.__scopePopover),{forceMount:r=o.forceMount,...a}=t,i=Yp(Pv,t.__scopePopover);return Uo.jsx(Pr,{present:r||i.open,children:i.modal?Uo.jsx(ple,{...a,ref:n}):Uo.jsx(fle,{...a,ref:n})})},"PopoverContent")),dle=lr("PopoverContent.RemoveScroll"),ple=dn.forwardRef(gl(function(t,n){let o=Yp(Pv,t.__scopePopover),r=dn.useRef(null),a=Ce(n,r),i=dn.useRef(!1),{nodes:s,registry:l}=Mp();return dn.useEffect(()=>{let c=r.current;if(c)return qu(c)},[]),Uo.jsx(lc,{as:dle,allowPinchZoom:!0,shards:dn.useMemo(()=>[r,...s.map((c)=>({current:c}))],[r,s]),children:Uo.jsx(zU,{...t,ref:a,branchNodes:s,branchRegistry:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(t.onCloseAutoFocus,(c)=>{if(c.preventDefault(),!i.current)o.triggerRef.current?.focus()}),onPointerDownOutside:te(t.onPointerDownOutside,(c)=>{let d=c.detail.originalEvent,u=d.button===0&&d.ctrlKey===!0,p=d.button===2||u;i.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:te(t.onFocusOutside,(c)=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),fle=dn.forwardRef(gl(function(t,n){let o=Yp(Pv,t.__scopePopover),r=dn.useRef(!1),a=dn.useRef(!1);return Uo.jsx(zU,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:(i)=>{if(t.onCloseAutoFocus?.(i),!i.defaultPrevented){if(!r.current)o.triggerRef.current?.focus();i.preventDefault()}r.current=!1,a.current=!1},onInteractOutside:(i)=>{if(t.onInteractOutside?.(i),!i.defaultPrevented){if(r.current=!0,i.detail.originalEvent.type==="pointerdown")a.current=!0}let s=i.target;if(o.triggerRef.current?.contains(s))i.preventDefault();if(i.detail.originalEvent.type==="focusin"&&a.current)i.preventDefault()}})},"PopoverContentNonModal")),zU=dn.forwardRef(gl(function(t,n){let{__scopePopover:o,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,"aria-describedby":p,branchNodes:f,branchRegistry:g,...m}=t,x=Yp(Pv,o),v=Q1(o),[y,b]=dn.useState(null),k=Ce(n,b);return Dp(y),ul(),Uo.jsx(Ap,{registry:g,children:Uo.jsx(Ku,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:a,onUnmountAutoFocus:i,children:Uo.jsx(ll,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>x.onOpenChange(!1),deferPointerDownOutside:!0,children:Uo.jsx(Qu,{"data-state":PA(x.open),role:"dialog",id:x.contentId,"aria-labelledby":x.titlePresent?x.titleId:void 0,"aria-describedby":x.descriptionPresent?LU(p,x.descriptionId):p,...v,...m,ref:k,style:{...m.style,...{"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}})})})})},"PopoverContentImpl"));function PA(e){return e?"open":"closed"}gl(PA,"getState");function LU(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}gl(LU,"concatAriaDescribedby");var se=h(I(),1),IA=h(fi(),1);var mle=Object.defineProperty,gle=(e,t)=>mle(e,"name",{value:t,configurable:!0});function Z1(e,[t,n]){return Math.min(n,Math.max(t,e))}gle(Z1,"clamp");var HU=h(I(),1);var jU=h(w(),1),hle=Object.defineProperty,ble=(e,t)=>hle(e,"name",{value:t,configurable:!0}),OA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),UU=HU.forwardRef(ble(function(t,n){return jU.jsx(be.span,{...t,ref:n,style:{...OA,...t.style}})},"VisuallyHidden"));var Ge=h(w(),1),xle=Object.defineProperty,tn=(e,t)=>xle(e,"name",{value:t,configurable:!0}),GU={ItemAligned:"item-aligned",Popper:"popper"},yle={LTR:"ltr",RTL:"rtl"},wle=[" ","Enter","ArrowUp","ArrowDown"],kle=[" ","Enter"],Ag="Select",[ek,zA,Sle]=Hp(Ag),[Xp,QCe]=en(Ag,[Sle,zi]),LA=zi(),[Cle,ed]=Xp(Ag),[Nle,Rle]=Xp(Ag);function KU(e){let{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:p,required:f,form:g,internal_do_not_use_render:m}=e,x=LA(t),[v,y]=se.useState(null),[b,k]=se.useState(null),[S,C]=se.useState(!1),R=pc(c),[M,D]=Jn({prop:o,defaultProp:r??!1,onChange:a,caller:Ag}),[E,z]=Jn({prop:i,defaultProp:s,onChange:l,caller:Ag}),L=se.useRef(null),ee=se.useRef(!1),[ne,ke]=se.useState(null),Y=tn((B)=>{ke({value:B,hasConsumerStoppedPropagation:ee.current}),z(B)},"handleUserSelect"),ye=se.useRef(E);se.useEffect(()=>{let B=g?v?.ownerDocument.getElementById(g):v?.form;if(B instanceof HTMLFormElement){let ve=tn(()=>z(ye.current),"reset");return B.addEventListener("reset",ve),()=>B.removeEventListener("reset",ve)}},[g,v,z]);let le=v?!!g||!!v.closest("form"):!0,[J,G]=se.useState(new Set),Fe=rn(),H=Array.from(J).map((B)=>B.props.value).join(";"),fe=se.useCallback((B)=>{G((ve)=>new Set(ve).add(B))},[]),oe=se.useCallback((B)=>{G((ve)=>{let We=new Set(ve);return We.delete(B),We})},[]),F={required:f,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Fe,value:E,onValueChange:z,hasConsumerStoppedPropagationRef:ee,userSelection:ne,onUserSelect:Y,open:M,onOpenChange:D,dir:R,triggerPointerDownPosRef:L,disabled:p,name:d,autoComplete:u,form:g,nativeOptions:J,nativeSelectKey:H,isFormControl:le};return Ge.jsx(Xu,{...x,children:Ge.jsx(Cle,{scope:t,...F,children:Ge.jsx(ek.Provider,{scope:t,children:Ge.jsx(Nle,{scope:t,onNativeOptionAdd:fe,onNativeOptionRemove:oe,children:YU(m)?m(F):n})})})})}tn(KU,"SelectProvider");var Tle=tn((e)=>{let{__scopeSelect:t,children:n,...o}=e;return Ge.jsx(KU,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:r})=>Ge.jsxs(Ge.Fragment,{children:[n,r?Ge.jsx(Zle,{__scopeSelect:t}):null]})})},"Select"),Ele="SelectTrigger",Ale=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,disabled:r=!1,...a}=t,i=LA(o),s=ed(Ele,o),l=s.disabled||r,c=Ce(n,s.onTriggerChange),d=zA(o),u=se.useRef("touch"),[p,f,g]=BA((x)=>{let v=d().filter((k)=>!k.disabled),y=v.find((k)=>k.value===s.value),b=HA(v,x,y);if(b!==void 0)s.onUserSelect(b.value)}),m=tn((x)=>{if(!l)s.onOpenChange(!0),g();if(x)s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)}},"handleOpen");return Ge.jsx(gc,{asChild:!0,...i,children:Ge.jsx(be.button,{type:"button",role:"combobox","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ov(s.value)?"":void 0,...a,ref:c,onClick:te(a.onClick,(x)=>{if(x.currentTarget.focus(),u.current!=="mouse")m(x)}),onPointerDown:te(a.onPointerDown,(x)=>{u.current=x.pointerType;let v=x.target;if(v.hasPointerCapture(x.pointerId))v.releasePointerCapture(x.pointerId);if(x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse")m(x),x.preventDefault()}),onKeyDown:te(a.onKeyDown,(x)=>{let v=p.current!=="";if(!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1)s.hasConsumerStoppedPropagationRef.current=x.isPropagationStopped(),f(x.key);if(v&&x.key===" ")return;if(wle.includes(x.key))m(),x.preventDefault()})})})},"SelectTrigger")),Mle="SelectValue",Dle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=t,c=ed(Mle,o),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=Ce(n,c.onValueNodeChange);wt(()=>{d(u)},[d,u]);let f=Ov(c.value);return Ge.jsx(be.span,{...l,asChild:f?!1:l.asChild,ref:p,style:{pointerEvents:"none"},children:Ge.jsx(se.Fragment,{children:f?s:i},f?"placeholder":"value")})},"SelectValue")),Ple=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,children:r,...a}=t;return Ge.jsx(be.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})},"SelectIcon")),Ole="SelectPortal",[_le,Ile]=Xp(Ole,{forceMount:void 0}),zle=tn((e)=>{let{__scopeSelect:t,forceMount:n,...o}=e;return Ge.jsx(_le,{scope:e.__scopeSelect,forceMount:n,children:Ge.jsx(cl,{asChild:!0,...o})})},"SelectPortal"),Wp="SelectContent",Lle=se.forwardRef(tn(function(t,n){let o=Ile(Wp,t.__scopeSelect),{forceMount:r=o.forceMount,...a}=t,i=ed(Wp,t.__scopeSelect),[s,l]=se.useState();return wt(()=>{l(new DocumentFragment)},[]),Ge.jsx(Pr,{present:r||i.open,children:({present:c})=>c?Ge.jsx(jle,{...a,ref:n}):Ge.jsx(Ble,{...a,fragment:s})})},"SelectContent")),Ble=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,children:r,fragment:a}=t;if(!a)return null;return IA.createPortal(Ge.jsx(qU,{scope:o,children:Ge.jsx(ek.Slot,{scope:o,children:Ge.jsx("div",{ref:n,children:r})})}),a)},"SelectContentFragment")),ws=10,[qU,tk]=Xp(Wp),Hle=lr("SelectContent.RemoveScroll"),jle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o}=t,{position:r=GU.ItemAligned,onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:x,avoidCollisions:v,...y}=t,b=ed(Wp,o),[k,S]=se.useState(null),[C,R]=se.useState(null),M=Ce(n,S),[D,E]=se.useState(null),[z,L]=se.useState(null),ee=zA(o),[ne,ke]=se.useState(!1),Y=se.useRef(!1),ye=se.useRef(!1),le=se.useRef(!1);se.useEffect(()=>{if(k)return qu(k)},[k]),ul();let J=se.useCallback((xe)=>{let[Dt,...gt]=ee().map((st)=>st.ref.current),[Le]=gt.slice(-1),$e=document.activeElement;for(let st of xe){if(st===$e)return;if(st?.scrollIntoView({block:"nearest"}),st===Dt&&C)C.scrollTop=0;if(st===Le&&C)C.scrollTop=C.scrollHeight;if(st?.focus(),document.activeElement!==$e)return}},[ee,C]),G=se.useCallback(()=>J([D,k]),[J,D,k]);se.useEffect(()=>{if(ne)G()},[ne,G]);let{onOpenChange:Fe,triggerPointerDownPosRef:H}=b;se.useEffect(()=>{if(k){let xe={x:0,y:0},Dt=tn((Le)=>{xe={x:Math.abs(Math.round(Le.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(H.current?.y??0))}},"handlePointerMove"),gt=tn((Le)=>{if(xe.x<=10&&xe.y<=10)Le.preventDefault();else if(!Le.composedPath().includes(k))Fe(!1);document.removeEventListener("pointermove",Dt),H.current=null},"handlePointerUp");if(H.current!==null)document.addEventListener("pointermove",Dt),document.addEventListener("pointerup",gt,{capture:!0,once:!0});return()=>{document.removeEventListener("pointermove",Dt),document.removeEventListener("pointerup",gt,{capture:!0})}}},[k,Fe,H]),se.useEffect(()=>{let xe=tn(()=>Fe(!1),"close");return window.addEventListener("blur",xe),window.addEventListener("resize",xe),()=>{window.removeEventListener("blur",xe),window.removeEventListener("resize",xe)}},[Fe]);let[fe,oe]=BA((xe)=>{let Dt=ee().filter(($e)=>!$e.disabled),gt=Dt.find(($e)=>$e.ref.current===document.activeElement),Le=HA(Dt,xe,gt);if(Le)setTimeout(()=>Le.ref.current?.focus())}),F=se.useCallback((xe,Dt,gt)=>{let Le=!ye.current;if(Le)ye.current=!0;let $e=!Y.current&&!gt;if(b.value!==void 0&&b.value===Dt||$e){if(E(xe),$e)Y.current=!0}else if(Le)E(xe)},[b.value]),B=se.useCallback(()=>k?.focus(),[k]),ve=se.useCallback((xe,Dt,gt)=>{if(!xe)return;let Le=!le.current;if(Le)le.current=!0;let $e=!Y.current&&!gt;if(b.value!==void 0&&b.value===Dt||$e)L(xe);else if(Le)L(xe)},[b.value]),We=r===GU.Popper?FU:Ule,ae=We===FU?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:m,hideWhenDetached:x,avoidCollisions:v}:{};return Ge.jsx(qU,{scope:o,content:k,viewport:C,onViewportChange:R,itemRefCallback:F,selectedItem:D,onItemLeave:B,itemTextRefCallback:ve,focusSelectedItem:G,selectedItemText:z,position:r,isPositioned:ne,searchRef:fe,children:Ge.jsx(lc,{as:Hle,allowPinchZoom:!0,children:Ge.jsx(Ku,{asChild:!0,trapped:b.open,onMountAutoFocus:(xe)=>{xe.preventDefault()},onUnmountAutoFocus:te(a,(xe)=>{b.trigger?.focus({preventScroll:!0}),xe.preventDefault()}),children:Ge.jsx(ll,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:(xe)=>xe.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:Ge.jsx(We,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:(xe)=>xe.preventDefault(),...y,...ae,onPlaced:()=>ke(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,(xe)=>{let Dt=xe.ctrlKey||xe.altKey||xe.metaKey;if(xe.key==="Tab")xe.preventDefault();if(!Dt&&xe.key.length===1)oe(xe.key);if(["ArrowUp","ArrowDown","Home","End"].includes(xe.key)){let Le=ee().filter(($e)=>!$e.disabled).map(($e)=>$e.ref.current);if(["ArrowUp","End"].includes(xe.key))Le=Le.slice().reverse();if(["ArrowUp","ArrowDown"].includes(xe.key)){let $e=xe.target,st=Le.indexOf($e);Le=Le.slice(st+1)}setTimeout(()=>J(Le)),xe.preventDefault()}})})})})})})},"SelectContentImpl")),Ule=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,onPlaced:r,...a}=t,i=ed(Wp,o),s=tk(Wp,o),[l,c]=se.useState(null),[d,u]=se.useState(null),p=Ce(n,u),f=zA(o),g=se.useRef(!1),m=se.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,k=se.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&x&&v&&y){let M=i.trigger.getBoundingClientRect(),D=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),z=y.getBoundingClientRect();if(i.dir!==yle.RTL){let gt=z.left-D.left,Le=E.left-gt,$e=M.left-Le,st=M.width+$e,Hf=Math.max(st,D.width),Pl=window.innerWidth-ws,jf=Z1(Le,[ws,Math.max(ws,Pl-Hf)]);l.style.minWidth=st+"px",l.style.left=jf+"px"}else{let gt=D.right-z.right,Le=window.innerWidth-E.right-gt,$e=window.innerWidth-M.right-Le,st=M.width+$e,Hf=Math.max(st,D.width),Pl=window.innerWidth-ws,jf=Z1(Le,[ws,Math.max(ws,Pl-Hf)]);l.style.minWidth=st+"px",l.style.right=jf+"px"}let L=f(),ee=window.innerHeight-ws*2,ne=x.scrollHeight,ke=window.getComputedStyle(d),Y=parseInt(ke.borderTopWidth,10),ye=parseInt(ke.paddingTop,10),le=parseInt(ke.borderBottomWidth,10),J=parseInt(ke.paddingBottom,10),G=Y+ye+ne+J+le,Fe=Math.min(v.offsetHeight*5,G),H=window.getComputedStyle(x),fe=parseInt(H.paddingTop,10),oe=parseInt(H.paddingBottom,10),F=M.top+M.height/2-ws,B=ee-F,ve=v.offsetHeight/2,We=v.offsetTop+ve,ae=Y+ye+We,xe=G-ae;if(ae<=F){let gt=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";let Le=d.clientHeight-x.offsetTop-x.offsetHeight,$e=Math.max(B,ve+(gt?oe:0)+Le+le),st=ae+$e;l.style.height=st+"px"}else{let gt=L.length>0&&v===L[0].ref.current;l.style.top="0px";let $e=Math.max(F,Y+x.offsetTop+(gt?fe:0)+ve)+xe;l.style.height=$e+"px",x.scrollTop=ae-F+x.offsetTop}l.style.margin=`${ws}px 0`,l.style.minHeight=Fe+"px",l.style.maxHeight=ee+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[f,i.trigger,i.valueNode,l,d,x,v,y,i.dir,r]);wt(()=>k(),[k]);let[S,C]=se.useState();wt(()=>{if(d)C(window.getComputedStyle(d).zIndex)},[d]);let R=se.useCallback((M)=>{if(M&&m.current===!0)k(),b?.(),m.current=!1},[k,b]);return Ge.jsx(Gle,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:R,children:Ge.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:Ge.jsx(be.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})},"SelectItemAlignedPosition")),FU=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,align:r="start",collisionPadding:a=ws,...i}=t,s=LA(o);return Ge.jsx(Qu,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,...{"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}})},"SelectPopperPosition")),[Gle,Fle]=Xp(Wp,{}),VU="SelectViewport",Vle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,nonce:r,...a}=t,i=tk(VU,o),s=Fle(VU,o),l=Ce(n,i.onViewportChange),c=se.useRef(0);return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),Ge.jsx(ek.Slot,{scope:o,children:Ge.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:te(a.onScroll,(d)=>{let u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=s;if(f?.current&&p){let g=Math.abs(c.current-u.scrollTop);if(g>0){let m=window.innerHeight-ws*2,x=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),y=Math.max(x,v);if(y<m){let b=y+g,k=Math.min(m,b),S=b-k;if(p.style.height=k+"px",p.style.bottom==="0px")u.scrollTop=S>0?S:0,p.style.justifyContent="flex-end"}}}c.current=u.scrollTop})})})]})},"SelectViewport")),Kle="SelectGroup",[ZCe,JCe]=Xp(Kle);var _A="SelectItem",[qle,$U]=Xp(_A),$le=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,value:r,disabled:a=!1,textValue:i,...s}=t,l=ed(_A,o),c=tk(_A,o),d=l.value===r,[u,p]=se.useState(i??""),[f,g]=se.useState(!1),m=Lo((k)=>c.itemRefCallback?.(k,r,a)),x=Ce(n,m),v=rn(),y=se.useRef("touch");function b(k){l.hasConsumerStoppedPropagationRef.current=k.isPropagationStopped(),l.onUserSelect(r),l.onOpenChange(!1)}return tn(b,"handleSelect"),Ge.jsx(qle,{scope:o,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:se.useCallback((k)=>{p((S)=>S||(k?.textContent??"").trim())},[]),children:Ge.jsx(ek.ItemSlot,{scope:o,value:r,disabled:a,textValue:u,children:Ge.jsx(be.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:x,onFocus:te(s.onFocus,()=>g(!0)),onBlur:te(s.onBlur,()=>g(!1)),onClick:te(s.onClick,(k)=>{if(a)return;if(y.current!=="mouse")b(k)}),onPointerUp:te(s.onPointerUp,(k)=>{if(a)return;if(y.current==="mouse")b(k)}),onPointerDown:te(s.onPointerDown,(k)=>{y.current=k.pointerType}),onPointerMove:te(s.onPointerMove,(k)=>{if(y.current=k.pointerType,a)c.onItemLeave?.();else if(y.current==="mouse")k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,(k)=>{if(k.currentTarget===document.activeElement)c.onItemLeave?.()}),onKeyDown:te(s.onKeyDown,(k)=>{if(a||k.target!==k.currentTarget)return;if(c.searchRef?.current!==""&&k.key===" ")return;if(kle.includes(k.key))b(k);if(k.key===" ")k.preventDefault()})})})})},"SelectItem")),J1="SelectItemText",Yle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,className:r,style:a,...i}=t,s=ed(J1,o),l=tk(J1,o),c=$U(J1,o),d=Rle(J1,o),[u,p]=se.useState(null),f=Lo((b)=>l.itemTextRefCallback?.(b,c.value,c.disabled)),g=Ce(n,p,c.onItemTextChange,f),m=u?.textContent,x=se.useMemo(()=>Ge.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return wt(()=>(v(x),()=>y(x)),[v,y,x]),Ge.jsxs(Ge.Fragment,{children:[Ge.jsx(be.span,{id:c.textId,...i,ref:g}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Ov(s.value)?IA.createPortal(i.children,s.valueNode):null]})},"SelectItemText")),Wle="SelectItemIndicator",Xle=se.forwardRef(tn(function(t,n){let{__scopeSelect:o,...r}=t;return $U(Wle,o).isSelected?Ge.jsx(be.span,{"aria-hidden":!0,...r,ref:n}):null},"SelectItemIndicator"));var Qle="SelectBubbleInput",Zle=se.forwardRef(tn(function({__scopeSelect:t,...n},o){let r=ed(Qle,t),{value:a,onValueChange:i,required:s,disabled:l,name:c,autoComplete:d,form:u,userSelection:p}=r,{nativeOptions:f,nativeSelectKey:g}=r,m=se.useRef(null),x=Ce(o,m),v=a??"",y=se.useRef(v),b=se.useRef(p),k=se.useRef(!1),S=Array.from(f).some((C)=>(C.props.value??"")==="");return se.useEffect(()=>{let C=m.current;if(!C)return;let R=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(R,"value").set,E=p!==null&&p!==b.current;b.current=p;let z=y.current!==v;y.current=v;let L=E&&z;if(E&&!z&&p.value!==v&&!p.hasConsumerStoppedPropagation&&D){k.current=!0;try{D.call(C,p.value),C.dispatchEvent(new Event("change",{bubbles:!0}))}finally{k.current=!1,D.call(C,v)}return}let ee=L&&!p.hasConsumerStoppedPropagation;if(z&&D){let ne=new Event("change",{bubbles:ee});D.call(C,v),C.dispatchEvent(ne)}},[v,p]),Ge.jsxs(be.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:c,autoComplete:d,disabled:l,form:u,onChange:(C)=>{if(!k.current)i(C.target.value)},...n,style:{...OA,...n.style},ref:x,defaultValue:v,children:[Ov(a)&&!S?Ge.jsx("option",{value:""}):null,Array.from(f)]},g)},"SelectBubbleInput"));function YU(e){return typeof e==="function"}tn(YU,"isFunction");function Ov(e){return e===""||e===void 0}tn(Ov,"shouldShowPlaceholder");function BA(e){let t=Lo(e),n=se.useRef(""),o=se.useRef(0),r=se.useCallback((i)=>{let s=n.current+i;t(s);function l(c){if(n.current=c,window.clearTimeout(o.current),c!=="")o.current=window.setTimeout(()=>l(""),1000)}tn(l,"updateSearch"),l(s)},[t]),a=se.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return se.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}tn(BA,"useTypeaheadSearch");function HA(e,t,n){let r=t.length>1&&Array.from(t).every((c)=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1,i=WU(e,Math.max(a,0));if(r.length===1)i=i.filter((c)=>c!==n);let l=i.find((c)=>c.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}tn(HA,"findNextItem");function WU(e,t){return e.map((n,o)=>e[(t+o)%e.length])}tn(WU,"wrapArray");var Go=h(I(),1);var Bi=h(w(),1),Jle=Object.defineProperty,td=(e,t)=>Jle(e,"name",{value:t,configurable:!0}),jA="Switch",[ece,iNe]=en(jA),[tce,UA]=ece(jA);function QU(e){let{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:a,form:i,name:s,onCheckedChange:l,required:c,value:d="on",internal_do_not_use_render:u}=e,[p,f]=Jn({prop:n,defaultProp:r??!1,onChange:l,caller:jA}),[g,m]=Go.useState(null),[x,v]=Go.useState(null),[y,b]=Go.useState(null),k=g?!!i||!!g.closest("form"):!0,S={checked:p,setChecked:f,disabled:a,control:g,setControl:m,name:s,form:i,value:d,userClick:y,onUserClick:b,required:c,defaultChecked:r,isFormControl:k,bubbleInput:x,setBubbleInput:v};return Bi.jsx(tce,{scope:t,...S,children:ZU(u)?u(S):o})}td(QU,"SwitchProvider");var nce="SwitchTrigger",oce=Go.forwardRef(td(function({__scopeSwitch:t,onClick:n,...o},r){let{control:a,form:i,value:s,disabled:l,checked:c,required:d,setControl:u,setChecked:p,onUserClick:f,isFormControl:g,bubbleInput:m}=UA(nce,t),x=Ce(r,u),v=Go.useRef(c);return Go.useEffect(()=>{let y=i?a?.ownerDocument.getElementById(i):a?.form;if(y instanceof HTMLFormElement){let b=td(()=>p(v.current),"reset");return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[a,i,p]),Bi.jsx(be.button,{type:"button",role:"switch","aria-checked":c,"aria-required":d,"data-state":GA(c),"data-disabled":l?"":void 0,disabled:l,value:s,...o,ref:x,onClick:te(n,(y)=>{let b=y.isPropagationStopped();if(f({requestedChecked:!c,hasConsumerStoppedPropagation:b}),p((k)=>!k),m&&g){if(!b)y.stopPropagation()}})})},"SwitchTrigger")),rce=Go.forwardRef(td(function(t,n){let{__scopeSwitch:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=t;return Bi.jsx(QU,{__scopeSwitch:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>Bi.jsxs(Bi.Fragment,{children:[Bi.jsx(oce,{...p,ref:n,__scopeSwitch:o}),f&&Bi.jsx(lce,{__scopeSwitch:o})]})})},"Switch")),ace="SwitchThumb",ice=Go.forwardRef(td(function(t,n){let{__scopeSwitch:o,...r}=t,a=UA(ace,o);return Bi.jsx(be.span,{"data-state":GA(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),sce="SwitchBubbleInput",lce=Go.forwardRef(td(function({__scopeSwitch:t,onClick:n,...o},r){let{control:a,userClick:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:g,setBubbleInput:m}=UA(sce,t),x=Ce(r,m),v=Bp(a),y=Go.useRef(!1),b=Go.useRef(s),k=Go.useRef(i),S=Go.useRef(null);Go.useEffect(()=>{let R=g;if(!R)return;let M=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(M,"checked").set;if(!E)return;let z=b.current!==s;b.current=s;let L=i!==null&&i!==k.current;if(k.current=i,L){if(S.current=z?null:i,z)E.call(R,s);R.dispatchEvent(new Event("click",{bubbles:!i.hasConsumerStoppedPropagation}))}else if(z){let ee=S.current;S.current=null;let ne=ee?.requestedChecked===s;y.current=!0,E.call(R,s),R.dispatchEvent(new Event("click",{bubbles:!(ne&&ee.hasConsumerStoppedPropagation)})),y.current=!1}},[g,s,i]);let C=Go.useRef(s);return Bi.jsx(be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??C.current,required:c,disabled:d,name:u,value:p,form:f,...o,tabIndex:-1,ref:x,onClick:te(n,(R)=>{if(y.current)R.stopPropagation()}),style:{...o.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function ZU(e){return typeof e==="function"}td(ZU,"isFunction");function GA(e){return e?"checked":"unchecked"}td(GA,"getState");var Mg=h(I(),1);var Qp=h(w(),1),cce=Object.defineProperty,_v=(e,t)=>cce(e,"name",{value:t,configurable:!0}),eG={Automatic:"automatic",Manual:"manual"},FA="Tabs",[uce,mNe]=en(FA,[Eg]),tG=Eg(),[dce,nG]=uce(FA),pce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c=eG.Automatic,...d}=t,u=pc(l),[p,f]=Jn({prop:r,onChange:a,defaultProp:i??"",caller:FA});return Qp.jsx(dce,{scope:o,baseId:rn(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:Qp.jsx(be.div,{dir:u,"data-orientation":s,...d,ref:n})})},"Tabs")),fce="TabsList",mce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,loop:r=!0,...a}=t,i=nG(fce,o),s=tG(o);return Qp.jsx($1,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:Qp.jsx(be.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})},"TabsList")),gce="TabsTrigger",hce=Mg.forwardRef(_v(function(t,n){let{__scopeTabs:o,value:r,disabled:a=!1,...i}=t,s=nG(gce,o),l=tG(o),c=oG(s.baseId,r),d=rG(s.baseId,r),u=r===s.value;return Qp.jsx(Y1,{asChild:!0,...l,focusable:!a,active:u,children:Qp.jsx(be.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:te(t.onMouseDown,(p)=>{if(!a&&p.button===0&&p.ctrlKey===!1)p.currentTarget.focus(),s.onValueChange(r);else p.preventDefault()}),onKeyDown:te(t.onKeyDown,(p)=>{if(a||p.target!==p.currentTarget)return;if([" ","Enter"].includes(p.key))s.onValueChange(r)}),onFocus:te(t.onFocus,()=>{let p=s.activationMode!==eG.Manual;if(!u&&!a&&p)s.onValueChange(r)})})})},"TabsTrigger"));function oG(e,t){return`${e}-trigger-${t}`}_v(oG,"makeTriggerId");function rG(e,t){return`${e}-content-${t}`}_v(rG,"makeContentId");var iG=h(I(),1);var sG=h(w(),1),bce=Object.defineProperty,vce=(e,t)=>bce(e,"name",{value:t,configurable:!0}),xce="Toggle",yce=iG.forwardRef(vce(function(t,n){let{pressed:o,defaultPressed:r,onPressedChange:a,...i}=t,[s,l]=Jn({prop:o,onChange:a,defaultProp:r??!1,caller:xce});return sG.jsx(be.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:n,onClick:te(t.onClick,()=>{if(!t.disabled)l(!s)})})},"Toggle"));var Xe=h(I(),1);var dr=h(w(),1),wce=Object.defineProperty,Fo=(e,t)=>wce(e,"name",{value:t,configurable:!0}),[qA,DNe]=en("Tooltip",[zi]),$A=zi(),kce="TooltipProvider",Sce=700,VA="tooltip.open",[Cce,YA]=qA(kce),Nce=Fo((e)=>{let{__scopeTooltip:t,delayDuration:n=Sce,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=Xe.useRef(!0),s=Xe.useRef(!1),l=Xe.useRef(0);return Xe.useEffect(()=>{let c=l.current;return()=>window.clearTimeout(c)},[]),dr.jsx(Cce,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:Xe.useCallback(()=>{if(o<=0)return;window.clearTimeout(l.current),i.current=!1},[o]),onClose:Xe.useCallback(()=>{if(o<=0)return;window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:s,onPointerInTransitChange:Xe.useCallback((c)=>{s.current=c},[]),disableHoverableContent:r,children:a})},"TooltipProvider"),KA="Tooltip",[Rce,zv]=qA(KA),Tce=Fo((e)=>{let{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=YA(KA,e.__scopeTooltip),c=$A(t),[d,u]=Xe.useState(null),[p,f]=Xe.useState(void 0),g=rn(),m=Xe.useRef(0),x=i??l.disableHoverableContent,v=s??l.delayDuration,y=Xe.useRef(!1),[b,k]=Jn({prop:o,defaultProp:r??!1,onChange:Fo((E)=>{if(E)l.onOpen(),document.dispatchEvent(new CustomEvent(VA));else l.onClose();a?.(E)},"onChange"),caller:KA}),S=Xe.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),C=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,k(!0)},[k]),R=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),M=Xe.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,k(!0),m.current=0},v)},[v,k]);return Xe.useEffect(()=>()=>{if(m.current)window.clearTimeout(m.current),m.current=0},[]),dr.jsx(Xu,{...c,children:dr.jsx(Rce,{scope:t,contentId:p??g,setContentId:f,open:b,stateAttribute:S,trigger:d,onTriggerChange:u,onTriggerEnter:Xe.useCallback(()=>{if(l.isOpenDelayedRef.current)M();else C()},[l.isOpenDelayedRef,M,C]),onTriggerLeave:Xe.useCallback(()=>{if(x)R();else window.clearTimeout(m.current),m.current=0},[R,x]),onOpen:C,onClose:R,disableHoverableContent:x,children:n})})},"Tooltip"),cG="TooltipTrigger",Ece=Xe.forwardRef(Fo(function(t,n){let{__scopeTooltip:o,"aria-describedby":r,...a}=t,i=zv(cG,o),s=YA(cG,o),l=$A(o),c=Xe.useRef(null),d=Ce(n,c,i.onTriggerChange),u=Xe.useRef(!1),p=Xe.useRef(!1),f=Xe.useCallback(()=>u.current=!1,[]);return Xe.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),dr.jsx(gc,{asChild:!0,...l,children:dr.jsx(be.button,{"aria-describedby":i.open?vG(r,i.contentId):r,"data-state":i.stateAttribute,...a,ref:d,onPointerMove:te(t.onPointerMove,(g)=>{if(g.pointerType==="touch")return;if(!p.current&&!s.isPointerInTransitRef.current)i.onTriggerEnter(),p.current=!0}),onPointerLeave:te(t.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:te(t.onPointerDown,()=>{if(i.open)i.onClose();u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:te(t.onFocus,()=>{if(!u.current)i.onOpen()}),onBlur:te(t.onBlur,i.onClose),onClick:te(t.onClick,i.onClose)})})},"TooltipTrigger")),uG="TooltipPortal",[Ace,Mce]=qA(uG,{forceMount:void 0}),Dce=Fo((e)=>{let{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=zv(uG,t);return dr.jsx(Ace,{scope:t,forceMount:n,children:dr.jsx(Pr,{present:n||a.open,children:dr.jsx(cl,{asChild:!0,container:r,children:o})})})},"TooltipPortal"),Iv="TooltipContent",Pce=Xe.forwardRef(Fo(function(t,n){let o=Mce(Iv,t.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=t,s=zv(Iv,t.__scopeTooltip);return dr.jsx(Pr,{present:r||s.open,children:s.disableHoverableContent?dr.jsx(dG,{side:a,...i,ref:n}):dr.jsx(Oce,{side:a,...i,ref:n})})},"TooltipContent")),Oce=Xe.forwardRef(Fo(function(t,n){let o=zv(Iv,t.__scopeTooltip),r=YA(Iv,t.__scopeTooltip),a=Xe.useRef(null),i=Ce(n,a),[s,l]=Xe.useState(null),{trigger:c,onClose:d}=o,u=a.current,{onPointerInTransitChange:p}=r,f=Xe.useCallback(()=>{l(null),p(!1)},[p]),g=Xe.useCallback((m,x)=>{let v=m.currentTarget,y={x:m.clientX,y:m.clientY},b=pG(y,v.getBoundingClientRect()),k=fG(y,b),S=mG(x.getBoundingClientRect()),C=hG([...k,...S]);l(C),p(!0)},[p]);return Xe.useEffect(()=>()=>f(),[f]),Xe.useEffect(()=>{if(c&&u){let m=Fo((v)=>g(v,u),"handleTriggerLeave"),x=Fo((v)=>g(v,c),"handleContentLeave");return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",x)}}},[c,u,g,f]),Xe.useEffect(()=>{if(s){let m=Fo((x)=>{let v=x.target,y={x:x.clientX,y:x.clientY},b=c?.contains(v)||u?.contains(v),k=!gG(y,s);if(b)f();else if(k)f(),d()},"handleTrackPointerGrace");return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,s,d,f]),dr.jsx(dG,{...t,ref:i})},"TooltipContentHoverable")),_ce=RE("TooltipContent"),dG=Xe.forwardRef(Fo(function(t,n){let{__scopeTooltip:o,children:r,"aria-label":a,id:i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,d=zv(Iv,o),u=$A(o),{onClose:p}=d,[f,g]=Xe.useState(null),m=Ce(n,g);Dp(f),Xe.useEffect(()=>(document.addEventListener(VA,p),()=>document.removeEventListener(VA,p)),[p]),Xe.useEffect(()=>{if(d.trigger){let v=Fo((y)=>{if(y.target instanceof Node&&y.target.contains(d.trigger))p()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[d.trigger,p]);let{setContentId:x}=d;return wt(()=>(x(i),()=>{x(void 0)}),[i,x]),dr.jsx(ll,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:(v)=>v.preventDefault(),onDismiss:p,children:dr.jsxs(Qu,{"data-state":d.stateAttribute,role:a?void 0:"tooltip",id:a?void 0:d.contentId,...u,...c,ref:m,style:{...c.style,...{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}},children:[dr.jsx(_ce,{children:r}),a?dr.jsx(UU,{id:d.contentId,role:"tooltip",children:a}):null]})})},"TooltipContentImpl"));function pG(e,t){let n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw Error("unreachable")}}Fo(pG,"getExitSideFromRect");function fG(e,t,n=5){let o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}Fo(fG,"getPaddedExitPoints");function mG(e){let{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}Fo(mG,"getPointsFromRect");function gG(e,t){let{x:n,y:o}=e,r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){let s=t[a],l=t[i],{x:c,y:d}=s,{x:u,y:p}=l;if(d>o!==p>o&&n<(u-c)*(o-d)/(p-d)+c)r=!r}return r}Fo(gG,"isPointInPolygon");function hG(e){let t=e.slice();return t.sort((n,o)=>{if(n.x<o.x)return-1;else if(n.x>o.x)return 1;else if(n.y<o.y)return-1;else if(n.y>o.y)return 1;else return 0}),bG(t)}Fo(hG,"getHull");function bG(e){if(e.length<=1)return e.slice();let t=[];for(let o=0;o<e.length;o++){let r=e[o];while(t.length>=2){let a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let o=e.length-1;o>=0;o--){let r=e[o];while(n.length>=2){let a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}if(n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y)return t;else return t.concat(n)}Fo(bG,"getHullPresorted");function vG(...e){let t=new Set;for(let n of e){if(typeof n!=="string")continue;for(let o of String(n).trim().split(/\s+/))if(o)t.add(o)}return t.size>0?Array.from(t).join(" "):void 0}Fo(vG,"concatAriaDescribedby");var yG=(e)=>typeof e==="boolean"?`${e}`:e===0?"0":e,wG=Ew,nk=(e,t)=>(n)=>{var o;if((t===null||t===void 0?void 0:t.variants)==null)return wG(e,n===null||n===void 0?void 0:n.class,n===null||n===void 0?void 0:n.className);let{variants:r,defaultVariants:a}=t,i=Object.keys(r).map((c)=>{let d=n===null||n===void 0?void 0:n[c],u=a===null||a===void 0?void 0:a[c];if(d===null)return null;let p=yG(d)||yG(u);return r[c][p]}),s=n&&Object.entries(n).reduce((c,d)=>{let[u,p]=d;if(p===void 0)return c;return c[u]=p,c},{}),l=t===null||t===void 0?void 0:(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,d)=>{let{class:u,className:p,...f}=d;return Object.entries(f).every((g)=>{let[m,x]=g;return Array.isArray(x)?x.includes({...a,...s}[m]):{...a,...s}[m]===x})?[...c,u,p]:c},[]);return wG(e,i,l,n===null||n===void 0?void 0:n.class,n===null||n===void 0?void 0:n.className)};var kG=h(w(),1),ok=nk("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-sm border px-3 py-1 text-base font-medium shadow-sm transition-colors disabled:cursor-default disabled:opacity-50",{variants:{variant:{default:"border-border bg-card text-foreground hover:border-muted-foreground",primary:"border-primary bg-primary text-primary-foreground hover:bg-[color-mix(in_srgb,var(--accent)_88%,var(--ink))]",ghost:"border-transparent bg-transparent text-muted-foreground shadow-none hover:bg-muted hover:text-foreground",danger:"border-border bg-card text-danger hover:border-danger"},size:{md:"min-h-(--btn-s)",sm:"min-h-(--btn-xs) px-2 text-sm"}},defaultVariants:{variant:"default",size:"md"}});function A({className:e,variant:t,size:n,asChild:o,type:r="button",...a}){let i=o?jre:"button";return kG.jsx(i,{...o?{}:{type:r},className:N(ok({variant:t,size:n}),e),...a})}var vc=h(w(),1),rk=Yae,Lv=({className:e,...t})=>vc.jsx(tie,{className:N("text-lg font-semibold",e),...t}),Bv=({className:e,...t})=>vc.jsx(nie,{className:N("text-base text-muted-foreground",e),...t});function ak({className:e,...t}){return vc.jsxs(Wae,{container:rr(),children:[vc.jsx(Xae,{className:"fixed inset-0 z-50 bg-black/45"}),vc.jsx(eie,{className:N("fixed left-1/2 top-1/2 z-50 flex w-[min(420px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col gap-2.5 rounded-lg border border-border bg-background p-4 text-foreground outline-none",e),...t})]})}var ik=({className:e,...t})=>vc.jsx(aie,{className:N(ok({variant:"default"}),e),...t}),sk=({className:e,danger:t,...n})=>vc.jsx(oie,{className:N(ok({variant:t?"danger":"primary"}),e),...n});var CG=h(w(),1),Ice=nk("inline-flex items-center gap-1.5 text-sm",{variants:{tone:{neutral:"text-muted-foreground",warning:"text-warning",success:"text-success",danger:"text-danger",ink:"text-foreground"}},defaultVariants:{tone:"neutral"}}),SG=({className:e,tone:t,...n})=>CG.jsx("span",{className:N(Ice({tone:t}),e),...n});var WA=h(w(),1);function _({name:e,sprite:t="i",className:n,...o}){return WA.jsx("svg",{"aria-hidden":"true",className:N("size-[18px]",n),...o,children:WA.jsx("use",{href:`#${t}-${e}`})})}var lk=h(w(),1);function Or({className:e,...t}){return lk.jsx(fie,{className:N("grid size-4 place-items-center rounded-xs border border-border bg-card data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:lk.jsx(gie,{children:lk.jsx(_,{name:"check",className:"size-3"})})})}var NG=1,zce=0.9,Lce=0.8,Bce=0.17,XA=0.1,QA=0.999,Hce=0.9999,jce=0.99,Uce=/[\\\/_+.#"@\[\(\{&]/,Gce=/[\\\/_+.#"@\[\(\{&]/g,Fce=/[\s-]/,TG=/[\s-]/g;function ZA(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?NG:jce;var s=`${r},${a}`;if(i[s]!==void 0)return i[s];for(var l=o.charAt(a),c=n.indexOf(l,r),d=0,u,p,f,g;c>=0;)u=ZA(e,t,n,o,c+1,a+1,i),u>d&&(c===r?u*=NG:Uce.test(e.charAt(c-1))?(u*=Lce,f=e.slice(r,c-1).match(Gce),f&&r>0&&(u*=Math.pow(QA,f.length))):Fce.test(e.charAt(c-1))?(u*=zce,g=e.slice(r,c-1).match(TG),g&&r>0&&(u*=Math.pow(QA,g.length))):(u*=Bce,r>0&&(u*=Math.pow(QA,c-r))),e.charAt(c)!==t.charAt(a)&&(u*=Hce)),(u<XA&&n.charAt(c-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(c-1)!==o.charAt(a))&&(p=ZA(e,t,n,o,c+1,a+2,i),p*XA>u&&(u=p*XA)),u>d&&(d=u),c=n.indexOf(l,c+1);return i[s]=d,d}function RG(e){return e.toLowerCase().replace(TG," ")}function EG(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ZA(e,t,RG(e),RG(t),0,0,{})}var ue=h(I(),1);var Hv='[cmdk-group=""]',JA='[cmdk-group-items=""]',Vce='[cmdk-group-heading=""]',MG='[cmdk-item=""]',AG=`${MG}:not([aria-disabled="true"])`,eM="cmdk-item-select",Dg="data-value",Kce=(e,t,n)=>EG(e,t,n),DG=ue.createContext(void 0),jv=()=>ue.useContext(DG),PG=ue.createContext(void 0),tM=()=>ue.useContext(PG),OG=ue.createContext(void 0),_G=ue.forwardRef((e,t)=>{let n=Pg(()=>{var H,fe;return{search:"",value:(fe=(H=e.value)!=null?H:e.defaultValue)!=null?fe:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Pg(()=>new Set),r=Pg(()=>new Map),a=Pg(()=>new Map),i=Pg(()=>new Set),s=IG(e),{label:l,children:c,value:d,onValueChange:u,filter:p,shouldFilter:f,loop:g,disablePointerSelection:m=!1,vimBindings:x=!0,...v}=e,y=rn(),b=rn(),k=rn(),S=ue.useRef(null),C=nue();Zp(()=>{if(d!==void 0){let H=d.trim();n.current.value=H,R.emit()}},[d]),Zp(()=>{C(6,ee)},[]);let R=ue.useMemo(()=>({subscribe:(H)=>(i.current.add(H),()=>i.current.delete(H)),snapshot:()=>n.current,setState:(H,fe,oe)=>{var F,B,ve,We;if(!Object.is(n.current[H],fe)){if(n.current[H]=fe,H==="search")L(),E(),C(1,z);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(F=document.getElementById(y))==null||F.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=ne())==null?void 0:ae.id,R.emit()}),oe||C(5,ee),((B=s.current)==null?void 0:B.value)!==void 0){let ae=fe!=null?fe:"";(We=(ve=s.current).onValueChange)==null||We.call(ve,ae);return}}R.emit()}},emit:()=>{i.current.forEach((H)=>H())}}),[]),M=ue.useMemo(()=>({value:(H,fe,oe)=>{var F;fe!==((F=a.current.get(H))==null?void 0:F.value)&&(a.current.set(H,{value:fe,keywords:oe}),n.current.filtered.items.set(H,D(fe,oe)),C(2,()=>{E(),R.emit()}))},item:(H,fe)=>(o.current.add(H),fe&&(r.current.has(fe)?r.current.get(fe).add(H):r.current.set(fe,new Set([H]))),C(3,()=>{L(),E(),n.current.value||z(),R.emit()}),()=>{a.current.delete(H),o.current.delete(H),n.current.filtered.items.delete(H);let oe=ne();C(4,()=>{L(),(oe==null?void 0:oe.getAttribute("id"))===H&&z(),R.emit()})}),group:(H)=>(r.current.has(H)||r.current.set(H,new Set),()=>{a.current.delete(H),r.current.delete(H)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:k,labelId:b,listInnerRef:S}),[]);function D(H,fe){var oe,F;let B=(F=(oe=s.current)==null?void 0:oe.filter)!=null?F:Kce;return H?B(H,n.current.search,fe):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,fe=[];n.current.filtered.groups.forEach((F)=>{let B=r.current.get(F),ve=0;B.forEach((We)=>{let ae=H.get(We);ve=Math.max(ae,ve)}),fe.push([F,ve])});let oe=S.current;ke().sort((F,B)=>{var ve,We;let ae=F.getAttribute("id"),xe=B.getAttribute("id");return((ve=H.get(xe))!=null?ve:0)-((We=H.get(ae))!=null?We:0)}).forEach((F)=>{let B=F.closest(JA);B?B.appendChild(F.parentElement===B?F:F.closest(`${JA} > *`)):oe.appendChild(F.parentElement===oe?F:F.closest(`${JA} > *`))}),fe.sort((F,B)=>B[1]-F[1]).forEach((F)=>{var B;let ve=(B=S.current)==null?void 0:B.querySelector(`${Hv}[${Dg}="${encodeURIComponent(F[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function z(){let H=ke().find((oe)=>oe.getAttribute("aria-disabled")!=="true"),fe=H==null?void 0:H.getAttribute(Dg);R.setState("value",fe||void 0)}function L(){var H,fe,oe,F;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let B=0;for(let ve of o.current){let We=(fe=(H=a.current.get(ve))==null?void 0:H.value)!=null?fe:"",ae=(F=(oe=a.current.get(ve))==null?void 0:oe.keywords)!=null?F:[],xe=D(We,ae);n.current.filtered.items.set(ve,xe),xe>0&&B++}for(let[ve,We]of r.current)for(let ae of We)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=B}function ee(){var H,fe,oe;let F=ne();F&&(((H=F.parentElement)==null?void 0:H.firstChild)===F&&((oe=(fe=F.closest(Hv))==null?void 0:fe.querySelector(Vce))==null||oe.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function ne(){var H;return(H=S.current)==null?void 0:H.querySelector(`${MG}[aria-selected="true"]`)}function ke(){var H;return Array.from(((H=S.current)==null?void 0:H.querySelectorAll(AG))||[])}function Y(H){let fe=ke()[H];fe&&R.setState("value",fe.getAttribute(Dg))}function ye(H){var fe;let oe=ne(),F=ke(),B=F.findIndex((We)=>We===oe),ve=F[B+H];(fe=s.current)!=null&&fe.loop&&(ve=B+H<0?F[F.length-1]:B+H===F.length?F[0]:F[B+H]),ve&&R.setState("value",ve.getAttribute(Dg))}function le(H){let fe=ne(),oe=fe==null?void 0:fe.closest(Hv),F;for(;oe&&!F;)oe=H>0?eue(oe,Hv):tue(oe,Hv),F=oe==null?void 0:oe.querySelector(AG);F?R.setState("value",F.getAttribute(Dg)):ye(H)}let J=()=>Y(ke().length-1),G=(H)=>{H.preventDefault(),H.metaKey?J():H.altKey?le(1):ye(1)},Fe=(H)=>{H.preventDefault(),H.metaKey?Y(0):H.altKey?le(-1):ye(-1)};return ue.createElement(be.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:(H)=>{var fe;(fe=v.onKeyDown)==null||fe.call(v,H);let oe=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||oe))switch(H.key){case"n":case"j":{x&&H.ctrlKey&&G(H);break}case"ArrowDown":{G(H);break}case"p":case"k":{x&&H.ctrlKey&&Fe(H);break}case"ArrowUp":{Fe(H);break}case"Home":{H.preventDefault(),Y(0);break}case"End":{H.preventDefault(),J();break}case"Enter":{H.preventDefault();let F=ne();if(F){let B=new Event(eM);F.dispatchEvent(B)}}}}},ue.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:rue},l),ck(e,(H)=>ue.createElement(PG.Provider,{value:R},ue.createElement(DG.Provider,{value:M},H))))}),qce=ue.forwardRef((e,t)=>{var n,o;let r=rn(),a=ue.useRef(null),i=ue.useContext(OG),s=jv(),l=IG(e),c=(o=(n=l.current)==null?void 0:n.forceMount)!=null?o:i==null?void 0:i.forceMount;Zp(()=>{if(!c)return s.item(r,i==null?void 0:i.id)},[c]);let d=zG(r,a,[e.value,e.children,a],e.keywords),u=tM(),p=nd((C)=>C.value&&C.value===d.current),f=nd((C)=>c||s.filter()===!1?!0:C.search?C.filtered.items.get(r)>0:!0);ue.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(eM,g),()=>C.removeEventListener(eM,g)},[f,e.onSelect,e.disabled]);function g(){var C,R;m(),(R=(C=l.current).onSelect)==null||R.call(C,d.current)}function m(){u.setState("value",d.current,!0)}if(!f)return null;let{disabled:x,value:v,onSelect:y,forceMount:b,keywords:k,...S}=e;return ue.createElement(be.div,{ref:Vu(a,t),...S,id:r,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||s.getDisablePointerSelection()?void 0:m,onClick:x?void 0:g},e.children)}),$ce=ue.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:r,...a}=e,i=rn(),s=ue.useRef(null),l=ue.useRef(null),c=rn(),d=jv(),u=nd((f)=>r||d.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);Zp(()=>d.group(i),[]),zG(i,s,[e.value,e.heading,l]);let p=ue.useMemo(()=>({id:i,forceMount:r}),[r]);return ue.createElement(be.div,{ref:Vu(s,t),...a,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&ue.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),ck(e,(f)=>ue.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},ue.createElement(OG.Provider,{value:p},f))))}),Yce=ue.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,r=ue.useRef(null),a=nd((i)=>!i.search);return!n&&!a?null:ue.createElement(be.div,{ref:Vu(r,t),...o,"cmdk-separator":"",role:"separator"})}),Wce=ue.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,r=e.value!=null,a=tM(),i=nd((c)=>c.search),s=nd((c)=>c.selectedItemId),l=jv();return ue.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),ue.createElement(be.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:r?e.value:i,onChange:(c)=>{r||a.setState("search",c.target.value),n==null||n(c.target.value)}})}),Xce=ue.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...r}=e,a=ue.useRef(null),i=ue.useRef(null),s=nd((c)=>c.selectedItemId),l=jv();return ue.useEffect(()=>{if(i.current&&a.current){let c=i.current,d=a.current,u,p=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let f=c.offsetHeight;d.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return p.observe(c),()=>{cancelAnimationFrame(u),p.unobserve(c)}}},[]),ue.createElement(be.div,{ref:Vu(a,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":o,id:l.listId},ck(e,(c)=>ue.createElement("div",{ref:Vu(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Qce=ue.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:r,contentClassName:a,container:i,...s}=e;return ue.createElement(Cg,{open:n,onOpenChange:o},ue.createElement(Ip,{container:i},ue.createElement(zp,{"cmdk-overlay":"",className:r}),ue.createElement(Lp,{"aria-label":e.label,"cmdk-dialog":"",className:a},ue.createElement(_G,{ref:t,...s}))))}),Zce=ue.forwardRef((e,t)=>nd((n)=>n.filtered.count===0)?ue.createElement(be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jce=ue.forwardRef((e,t)=>{let{progress:n,children:o,label:r="Loading...",...a}=e;return ue.createElement(be.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},ck(e,(i)=>ue.createElement("div",{"aria-hidden":!0},i)))}),Jp=Object.assign(_G,{List:Xce,Item:qce,Input:Wce,Group:$ce,Separator:Yce,Dialog:Qce,Empty:Zce,Loading:Jce});function eue(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function IG(e){let t=ue.useRef(e);return Zp(()=>{t.current=e}),t}var Zp=typeof window>"u"?ue.useEffect:ue.useLayoutEffect;function Pg(e){let t=ue.useRef();return t.current===void 0&&(t.current=e()),t}function nd(e){let t=tM(),n=()=>e(t.snapshot());return ue.useSyncExternalStore(t.subscribe,n,n)}function zG(e,t,n,o=[]){let r=ue.useRef(),a=jv();return Zp(()=>{var i;let s=(()=>{var c;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(c=d.current.textContent)==null?void 0:c.trim():r.current}})(),l=o.map((c)=>c.trim());a.value(e,s,l),(i=t.current)==null||i.setAttribute(Dg,s),r.current=s}),r}var nue=()=>{let[e,t]=ue.useState(),n=Pg(()=>new Map);return Zp(()=>{n.current.forEach((o)=>o()),n.current=new Map},[e]),(o,r)=>{n.current.set(o,r),t({})}};function oue(e){let t=e.type;return typeof t=="function"?t(e.props):("render"in t)?t.render(e.props):e}function ck({asChild:e,children:t},n){return e&&ue.isValidElement(t)?ue.cloneElement(oue(t),{ref:t.ref},n(t.props.children)):n(t)}var rue={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};var ef=h(w(),1),Og=({className:e,...t})=>ef.jsx(Jp,{className:N("flex flex-col text-base",e),...t}),_g=({className:e,...t})=>ef.jsx(Jp.Input,{className:N("mb-1.5 h-8 w-full rounded-sm border border-border bg-card px-2.5 text-base text-foreground outline-none placeholder:text-muted-foreground focus-visible:border-muted-foreground",e),...t}),Ig=({className:e,...t})=>ef.jsx(Jp.List,{className:N("max-h-72 overflow-auto",e),...t}),uk=({className:e,...t})=>ef.jsx(Jp.Empty,{className:N("px-2 py-3 text-center text-muted-foreground",e),...t}),zg=({className:e,...t})=>ef.jsx(Jp.Item,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground data-[selected=true]:bg-muted data-[selected=true]:text-foreground",e),...t}),dk=({className:e,...t})=>ef.jsx(Jp.Group,{className:N("[&_[cmdk-group-heading]]:flex [&_[cmdk-group-heading]]:items-center [&_[cmdk-group-heading]]:gap-1.5 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-foreground",e),...t});var tf=h(w(),1),ua=Cg,P2e=S1,O2e=Sv,Yr=({className:e,...t})=>tf.jsx(C1,{className:N("text-lg font-semibold",e),...t}),Uv=({className:e,...t})=>tf.jsx(N1,{className:N("text-base text-muted-foreground",e),...t});function da({className:e,...t}){return tf.jsxs(Ip,{container:rr(),children:[tf.jsx(zp,{className:"fixed inset-0 z-50 bg-black/45"}),tf.jsx(Lp,{className:N("fixed left-1/2 top-1/2 z-50 flex w-[min(480px,calc(100vw-32px))] max-h-[calc(100dvh-32px)] -translate-x-1/2 -translate-y-1/2 flex-col gap-2.5 rounded-lg border border-border bg-background p-4 text-foreground outline-none",e),...t})]})}var od=h(w(),1),kn=(e)=>od.jsx(jse,{modal:!1,...e}),Sn=Gse;function Cn({className:e,align:t="end",sideOffset:n=4,...o}){return od.jsx(Fse,{container:rr(),children:od.jsx(Kse,{align:t,sideOffset:n,className:N("z-50 flex min-w-40 max-w-[calc(100vw-32px)] flex-col rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md outline-none animate-fade-in",e),...o})})}var qt=({className:e,...t})=>od.jsx($se,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground outline-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted data-[highlighted]:text-foreground",e),...t}),Wr=({className:e,...t})=>od.jsx(Xse,{className:N("my-1 h-px bg-border",e),...t}),pk=({className:e,...t})=>od.jsx(qse,{className:N("px-2 py-1 text-sm text-muted-foreground",e),...t}),LG=Yse,nM=({className:e,...t})=>od.jsx(Wse,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-foreground outline-none data-[highlighted]:bg-muted data-[state=checked]:text-primary",e),...t});var BG=h(w(),1),Gv="h-(--btn-s) w-full rounded-sm border border-border bg-card px-2.5 py-1 text-base text-foreground placeholder:text-muted-foreground hover:border-muted-foreground focus-visible:border-muted-foreground aria-[invalid=true]:border-danger";function je({className:e,...t}){return BG.jsx("input",{className:N(Gv,e),...t})}var HG=h(w(),1);function xc({className:e,...t}){return HG.jsx(Jse,{className:N("block text-base font-medium text-foreground",e),...t})}var oM=h(w(),1),eo=nle,to=ile,jG=rle;function no({className:e,align:t="end",sideOffset:n=4,...o}){return oM.jsx(cle,{container:rr(),children:oM.jsx(ule,{align:t,sideOffset:n,className:N("z-50 max-w-[calc(100vw-32px)] rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md outline-none animate-fade-in",e),...o})})}var oi=h(w(),1),It=Tle,zt=Dle;function Lt({className:e,size:t="md",children:n,...o}){return oi.jsxs(Ale,{className:N("inline-flex max-w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-2.5 text-base text-foreground hover:border-muted-foreground data-[placeholder]:text-muted-foreground",t==="sm"?"h-7 text-sm":"h-(--btn-s)",e),...o,children:[oi.jsx("span",{className:"min-w-0 truncate",children:n}),oi.jsx(Ple,{asChild:!0,children:oi.jsx(_,{name:"chev",className:"size-3 shrink-0 text-muted-foreground"})})]})}function Bt({className:e,children:t,...n}){return oi.jsx(zle,{container:rr(),children:oi.jsx(Lle,{position:"popper",sideOffset:4,className:N("z-50 max-h-72 min-w-(--radix-select-trigger-width) max-w-[calc(100vw-32px)] overflow-hidden rounded-md border border-border bg-card p-1.5 text-base text-foreground shadow-md animate-fade-in",e),...n,children:oi.jsx(Vle,{children:t})})})}var ft=({className:e,children:t,...n})=>oi.jsxs($le,{className:N("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-muted-foreground outline-none data-[highlighted]:bg-muted data-[highlighted]:text-foreground data-[state=checked]:font-medium data-[state=checked]:text-foreground",e),...n,children:[oi.jsx(Yle,{children:t}),oi.jsx(Xle,{className:"ml-auto",children:oi.jsx(_,{name:"check",className:"size-3.5 text-primary"})})]});var yc=h(w(),1),nf=Cg,Z2e=S1,fk=Sv,rd=({className:e,...t})=>yc.jsx(C1,{className:N("text-[16px] font-semibold text-strong",e),...t}),of=N1;function mk({className:e,...t}){return yc.jsxs(Ip,{container:rr(),children:[yc.jsx(zp,{className:"fixed inset-0 z-50 bg-[color-mix(in_srgb,var(--bg)_60%,transparent)] backdrop-blur-[3px] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:animate-in data-[state=open]:fade-in"}),yc.jsx(Lp,{className:N("fixed inset-y-0 right-0 z-50 flex w-[520px] max-w-full flex-col border-l border-border bg-card text-foreground shadow-md outline-none data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:animate-in data-[state=open]:slide-in-from-right",e),...t})]})}function gk({className:e,...t}){return yc.jsxs(Ip,{container:rr(),children:[yc.jsx(zp,{className:"fixed inset-0 z-50 bg-black/45 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:animate-in data-[state=open]:fade-in"}),yc.jsx(Lp,{className:N("fixed inset-x-0 bottom-0 z-50 flex max-h-[85dvh] flex-col overflow-y-auto rounded-t-[16px] border-t border-border bg-card px-4 pb-[calc(20px+env(safe-area-inset-bottom))] pt-3 text-foreground outline-none data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",e),...t})]})}var UG=h(w(),1),pa=({className:e,...t})=>UG.jsx("span",{className:N("block rounded-sm bg-muted motion-safe:animate-pulse",e),...t});var FG=h(w(),1),GG=({theme:e="system"})=>FG.jsx(p6,{theme:e,position:"bottom-left",offset:{left:28,bottom:56},mobileOffset:{left:16,bottom:68},style:{"--normal-bg":"var(--bg-2)","--normal-text":"var(--ink)","--normal-border":"var(--line)",fontFamily:"var(--font)"},toastOptions:{className:"toast",style:{fontSize:"var(--fs)",borderRadius:"var(--r)",boxShadow:"var(--shadow-2)"}}});var KG=h(w(),1),VG=({className:e})=>KG.jsx("span",{"aria-hidden":"true",className:N("block size-[22px] rounded-full border-2 border-border border-t-foreground motion-safe:animate-spin",e)});var rM=h(w(),1);function pr({className:e,...t}){return rM.jsx(rce,{className:N("inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted p-0.5 transition-colors data-[state=checked]:border-primary data-[state=checked]:bg-primary",e),...t,children:rM.jsx(ice,{className:"block size-3.5 rounded-full bg-card shadow-sm transition-transform data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary-foreground"})})}var iM=h(w(),1),qG=pce,$G=({className:e,...t})=>iM.jsx(mce,{className:N("flex items-center gap-0.5",e),...t}),aM=({className:e,...t})=>iM.jsx(hce,{className:N("inline-flex min-h-[26px] items-center gap-1.5 rounded-full px-2 text-sm text-muted-foreground data-[state=active]:bg-[color-mix(in_srgb,var(--dim)_14%,transparent)] data-[state=active]:font-medium data-[state=active]:text-foreground",e),...t});var YG=h(w(),1);function An({className:e,...t}){return YG.jsx("textarea",{className:N("w-full resize-none bg-transparent text-base leading-normal text-foreground outline-none placeholder:text-muted-foreground",e),...t})}var WG=h(w(),1),Lg=({className:e,...t})=>WG.jsx(yce,{className:N(e),...t});var hk=h(w(),1),XG=(e)=>hk.jsx(Nce,{delayDuration:400,...e}),bk=Tce,vk=Ece,xk=({className:e,sideOffset:t=6,...n})=>hk.jsx(Dce,{container:rr(),children:hk.jsx(Pce,{sideOffset:t,className:N("z-50 max-w-72 rounded-sm border border-border bg-card px-2 py-1 text-sm text-foreground shadow-md animate-fade-in",e),...n})});var Hi={claude:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAG1BMVEXZdlbabEjacU/aZ0H+9/X67ejil4Hruavy0som81XtAAAD70lEQVRYhe1W2ZIbIQzUwQD//8XR0RKMvZWqVN5SYe0xYNRqtWSxRP/HPzvkL83nmjeE/CEer/GMzb2ce/4WQT4+aT4+Dh2D+71HcdsDIwlQFHTbYsnn6QhL2rMI5V+MJylInFSbjinH+Is6AavXvANgcUI7ADzwnDgpbfa14SeTAiep4VMgj7EVjA+CrRxfDj9eT/G2lwOof6/bpmPlwTBqj60NcwTOSUFDUs+puRVdA+Ke4NNt8+G1V5KZAxRiOkyOsk89RcCAkJGEivyRe7DcmV2osMYwI2BCGbgUgbjYEIRu7tiPh2GUpZ9zQHtNRA3hqP98ZAUlYRM8KMRETZXR6NSBl/yFplkAY8PjMCx9PHWeAN9YWsI1/9bD1woOz1SjHhQ0zFwIm1g9FPMmfjPoGnLX7AzM1jWcATaeo9mVChG5ZpTZMgOaDvA4AI2YugCgXihtJg1HFkbGO4NCwORYepy9AXoVE46Ia+yePWnPzKrKN/FbiphoOv8YM0yZ5trPnnSJ9z30RQJU7Pcwd8jjvwh9aeCfHEPA7ZvE3r6T5ezF9smA51rT+oX9pNRj9Nr5Gk+oa71mHrYOYH55AhoMt8H9gDCevSalhlwAOdH11Bg/SejGaYsw82GVkWv2fmdRrLVtgMtLghmhxeCTRDAotIgdjy8RPDKLzYJbU5ODm1I/Cick4Z9q4UFPMKQ+CAYsHUkWI30q6PVz0midkTuEsM9nArFymq8bxfRTWvsBhkZRc7EP2+Ru75U/fnmXo/UIFyfKcYG1IAuIws2jBp/uIvMDIQiqKNyFfmFWLFQ2upq67bJWsFzN7T1tKZcjBGuv+zcQ2mfv1OhIj6NMvxkGAYErTQzNqCHdf5bjNiLRRr0/GVh0VI1/OzQPyvmgCoDbv7mPe8hMvZimUtyJ6nfFRhkerxcDoxO3uqudN6L1ZKPB0ScNaD6JwDcNugOyHJHGZ6TaZmbo1DL1Vl5RQm3QWbi2YsQN41DO2qWPi3FZFawXB4Twac5+LOtmJZEw9GBCJn4N+rSW1NIzFkzCoSIIm9F82Qvx54jbCWa7GYcqYavv4y8AKQEq36AiiGbqRRVYHYLWnh2F/YkFbL7pAkD5PO0o1QxesYqG+B624YdVTmR6IwWAkwK3eEqeVsRMZ8V6shF7UU9ysauTKkdK6k14iJ4KfJ2LaukPwcGD5AwUW3p0BOP8BjYdQ3tKm2BQ6OlKy+IDNtp9ByK4IghIuAtaqiIGK22sWtUWgUudOPeKd776IrHO9/XBYHB0w0KOa+1ItF3VuhggAG5w1ZJaLyB9vzEhPfMGLrlBUy/fxwlkI7jk17365qL3Ny8SNn4BI7siq1gJmlgAAAAASUVORK5CYII=",agy:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAEAAQAMBEQACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQcCBAYDAf/EADEQAAEEAgADBQQLAAAAAAAAAAEAAgMEBREGITESQVFxoRMUYbEHIiMzUmJygZHB4f/EABoBAQADAQEBAAAAAAAAAAAAAAACAwUEAQb/xAAqEQACAgIBAgQFBQAAAAAAAAAAAQIDBBESBUETITFRFCOBsfEyYXGR0f/aAAwDAQACEQMRAD8AvFAEAQBAEAQBAEAQBAEBo5HK1McB7w89o9GtGyue7Kqp8pvzLaqZ2vUTDF5ujlC5tWXcjesbhp2vHXgp1XQtW4snfi20a5ryJFWnOEAQBAEB52ZWwQSTPOmxtLj5BeN6R42ktsq7J5F9qeSWR23POys+OFK6TnL1ZCnN4sj6l6WhehuQH7SJ29eI7x+4V3wsqZKSPo6ciGTU659y4K0zLFeOeM7ZI0PafEEbC6zBacXpnqh4EAQBAc5xxd91w3sw7Tp3hg8hzPy9VbVV4stHHm2cKte5WcspcVv0YiSMfxHsxbzXt2GmjTxcxwZZ/Atv3jAxxk/WrvMZ8uo9CsHIq8KejTlYrHyR0SoIhAEAQFa/SJkPb5ZlSM7bWZzA/E7n8tLe6XR8vm+5idRs5WqK7E/w3wjUq1GS5OtHYsyDbmyt7TY/ho8t/FcmV1Gyc+NT1Fe3c7MfChGO7FtnziXhOpPUfPjK7ILMY2GRN02QeGum17h9QsjPja9xfv2JX4kXHcFpoiPo8viLIS1HHQsM7Tf1N/zf8Lq6rR8tWLsVYV25cWWGsE0ggCAjOIMvDhse+zLpz+kUe+b3eC6MbHlkWKEfr/BRkXxphyf0OO4Nws+TyBzWRBMYkMjO0PvX9d+QPqtfqGTGmv4ev1+yM3Cx3ZPxp+n3LDHRYBsg9EBXfFmJnwuTbmMeNQmQSHQ5Rv33/lP9lfQYGRHIq+Hs9df2v9MjKqlTPxYeh2mCy1fMUG2YDo9JGE82O7wsbJx5Y9nCX5NGm6N0eSJFUFwQGpexlLIBgvVo5xGdtEg3pWVXWVb4S1shOqFn61s2WtDGhrQAANADuVf7k9aMkAQGL2Ne0teA5rhogjYIRPT2jxrZrUcdTx7XtpV44A93acGDWyrLLrLWnOWyMK4V+UFo21WTCAIAgCAIAgCAID//2Q==",codex:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAYFBMVEX///8AAADz8/O/v7+qqqq4uLj4+Pjo6Oh+fn7h4eHExMSwsLDKysrZ2dmioqImJiYrKytpaWmNjY3T09NMTExCQkJUVFR2dnYbGxszMzOHh4cODg5cXFwhISGUlJQ5OTkNyEhkAAADGElEQVRYhe1X2XbqMAzMQuw4KxBCCKHl///y2pJl5AVKOee+VS/E4JloGckmy/7sP5rqqnJSn6L765aj1f0HcHnLmR2K3+LLPLAuE7LrpneJKnxvq6RU1RkXSPS1TG/gO4jcvU2dPWdO8ie8MNsaFs8YxLP7gaCGmMn6E4Dmoen7bofO1C/xhd5xdYsFEHvnkIJkHF8RDHpDwZ61Dfz3Nvc8jE0rYMGnDoOvhb8BGJ7CO+NzaZ4kxnsmLUuX/Tp0isHvADJbCz94qWNfrCumTPsk/mrrVJCj7j3fXgGP+jHVZIecEezYpupCv9whe0o/VTEeKnbdMQL8Xs2AXVfXWCaG7wgPDVTCByewSshb/Aqha0pMG5Y3IEAlbPg+UcPq0swJgsEKzCNobBvsqQcfjRWFMFqXOQGbKjdSAXE2AV5R0TgBeF92WAOn/yGWd4ZlVwmC4QExeQQrDnxlTWvokkUE1AYCJbZSKmBk+VKqSZ2cgG1R6MTBpsLsmkOCMSLgG4Ls17ntOTIt700QgUwT4GzaGlp7LpQ8iVuZJGgLrKu0b8z5eJVUKAl7TkUbE+henEy/V5QUL4aZANMXUiQJYEwAgdiC0WgqY2fpQAlLEAgiyPZhP6wPfVIHBmX0PIgJeq7wHmebLySf4MKmPxoMsYUmehVL2SNITaWgS45+MwUEQyRm3am4b0+nhnRDEjvbI9CfXwGeRi9r/mlvOZuwjMc8cTZofd9t6LbCw8VF5ROYG8AW4g3B6vzQu5oLK4VHYAdwIgTTUDgv8hl752zDYQQDyCRxxlfUH9NM2VgpoSQkQb8sMd5tMlybKxwmw6zajI7MZzeEEZKAdmTneoPFeJy59ydXrYG/VJAm6ZyH6IxWlufXC7MxILen0WhBenV7Crfno6dwPt1tBC8vadB1BzeqbPCuw2CWijTUGk6C29D1fXlE+Olx2WZT56m5hrA2MsG1SQGHpk4ewcn1rADv3rn7TwuewCPGc257felucBE3QNqE6vrCXru5vXNX94zGK9rv/3hoU7Vrn0/++iBH2Zbdx+g/e8f+AUjCHMA9oP1SAAAAAElFTkSuQmCC",opencode:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAG1BMVEUTEBD///9aWFgAAABHREQGAABeXFxLSUkvLCzJjnlJAAAAVUlEQVRYhe3WMQrAMAhAUduaJvc/cWYLxUgIJfb/UfBNDooQ5exycvcPJ08AyAU8DygOjM0B1gLFFAfqbaphQE+TAgAAfAU0NbUw8BbAL4DpR5No0zpjhghz2AXH2AAAAABJRU5ErkJggg==",gemini:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABp1BMVEVHcEwks4M2ltktu2/sxyHkVmPkbFyGymJeieuhzlE7if00kO3qXVo7ifxKkez0uhzzqh4St3FLwWsxhv9Fhvj3vBj2R0gxhv8zh//KyTsrvWf6RUMUuWj0VkjxqCTwXU7zXEbsT1f4vRfb0THC1UOtcqnuZE3CaZH1nCCb1FnxSlAxhv+a01klrpoxhv85oc/wgjL4RkWDgdT2SEn6Q0FtyWW91UUxhv8yhv8yh/82h/43ivo+iPw5jfY6kPBHifg8nNNSifI8lOnsUVc8oMf2vhhLr5wUuWeTfMBqhuRJqqo7mNzyS053x2pDpblpw3KEgc1VtY/4RkXWYHZhvns0pLszqKutdKU7luPdW2y10EbCao7MZYOieLHYyi9fuYQetnbqkTLooitgk93nfka4bpmS0Fzysxx3hNlTnsxEunsqr5LTuDJLwG6Ku2aovU9kpLA/tIsxrJ29wT/Tf2q2hY+aiLBMl+GMlq1xmsLRcXjRjVuUrXPlvSW/eY6CjMfPnEvK0TrIrENxjdewqV6skouzm3GQn5R2uHZ2rotqqpoAshpHcEw3yyA9AAAAjXRSTlMA/hL+/v7+/v7+vlT91P0v/S1JLUaB3N7yEtwqgRJMvVNB3dpVSdTa2sV9fdPaha+w8rCFhbCv/////////////////////////////////////////////////////////////////////////////////////////////////////////////////wC9sE0CAAADIElEQVRYhc2V+1vSUBjHj1GghTM1byipaaV2v8LGRUVj3hCdSmVFJmaCoCKi4B0UsP7q3nO24eaVnT1PT9/fP5993/dsZwj972lu1skLgj7DW0F4o0tQLwj1enirIIyNWXUIekAw0KND8AoKDNyi59sJ/7mdWlBP+KnH1AWAx4KvD6kLiPwXygptMv/zI12FU/7bEA3fquAnXmvn2xT80MTSPa28Vc0PD9/QKDCbzVNKvrxcG//oLN/fX6mFbzUbjdvbKr6/97aG5xsxv7+P9y/xvZCSDRfzTqeztCmsxoWFjY2N/WRyc3PiYAnWJ/NOrrGEs2hbIHwS8wcHRxJPcJw71/Evgd/Z2UnmcoQ/KvKcGPvVi7j/AwJ8PpdLpVLAh9S8HefyElVdmD88PMznc4VUKp0OhcoZBW8XY2uovfjpXfM4wB/n84UC4UMM0+sivJ3jWLtssFWe+zSsdXdJ5uez2ezx8W6hsJZOh0NbDONykefbWZaVcZzGJ4oDqap78EtMNBol/O7vP2tr4fDWFuN2ORwceboosJ2m4bk0StUHKXt7YEhkV4GXBR4scMgC29nUqgR7kGgisbq6snICgvFwuA8LXJLAxrKXCPAIN0mCwWBRMDIyHu4b9ZAKHF4ACNSG4gg4TXUEDyYyouD7pHdkfLBv9BOpwJ03qJYoHWNHMJjJJGYrKkySABs87mIFWAHLipLzxyiO0pHJzIJgxXcyrazgkCrIiobLL8hOIjCZfNMXVJDfg6u/p/dgWDT5/NPqLYgG7Lj2VukEwaLP58cCpUFSXPs5w4FUKCsMikeJDbCJUi4UyNNFYpj0FoeQDCVfzN2nFWYUBg3XcreigmRwuzTwMIVcIQAVsMHj1vRjQcjkwxXi3oBsYLTxqAlXiMS964EZ0aD154pqiCC+LhlKOP+zeeePRSLx5fUANrzQziPkj8Wggmig4VENCCJly9hAMQCOJRYxlGHDMzoeKhgMc9hQTSlAFhCAgbYAVMCCubIaagEy8DwI6HnUwoOhRYfgBgh4zS+xMhaet+jh8Qx6JkComuepXwLJoJP/B/kLRT9a7+Axo0UAAAAASUVORK5CYII=",cursor:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAS1BMVEVHcEz39/QmJR7///3Ly8fOzcrn5uXT0s7My8jMy8j5+fbNzMkEAwAYFg0iIRqDg38uLSXW1tLm5uPw8O1SUUyxsa2cm5dwb2tHcEw+d/dAAAAAGXRSTlMA////5bgHQY/M//////////////////8A0IbxkwAAAmRJREFUWIWtl1migyAMRRVsRSYF1O5/p49BW1CC08uv5EgSQi5V9bN3S0jXNKxgTdMR0r6rnLUdU1obUxfNGK0V69qMu9I1pWXvYHaVVlsEYfqU8xeiGYn9X6q+5G8JtXrF/hfdPeJHIHf8HWGJomWFRRgX4CxksoPzh/U8awzSdec3AAVAKZ0F52IGq0tV6zcAfMVs4BIhyQcGxeG28M5ngGI1Ondnko8aQLA3EAE2/eoeEL3JpcLFQDIppHRCAiUm0JRLhSYWsN89G+Pff+PIpMICum37Yf3Zu/tN8M+upKarmhSA656LnHtA9HWKME3VJO50kqC7R8gpjaOp4ipmg8+kInJhMcB8uJCHZlNh8gDc8+GM2UOBIYDN0bEpGCBEoXPi/4CAYucEo4qLAsCnWYE3gFs1yjIA7pywaOLoCGCPi5igOCiSJwBwKvDM0RmAtUznuFuQo7MAKcQ+FfgjTgPcwmGTCltCdAXgSxoRKB3lNYBDRFG4El4FoBhgBvkIgOfl+01AKOEDQCjhfQBl6wbuAkb5CLCW8DbAIPkIkHy7AVia4BDAIQAek04HANRkpqoHRCV07fExNAvIjrYAGOTPPZ3yLB2utJ6E2AH8PbaELzY6o9mN91TbOAA14iuWtpeUHe9bgRGrqwD4Xff7iWEFxl7i4EXfLYClhPmL2mukjMiq5zUVHGPfBHZqZgQ9tQBA5q1CifsmkNlLPsi8A6HJ8SB98KDQLEjdaRD22NpgwEGnXyWxbQWZTYUV23Vu92sE/yD3nz847j55akX+69H1/Nn3/OH5/On7/PHt7Nbz/w/BUDv4oMpttwAAAABJRU5ErkJggg=="};var aue={kind:"daily",time:"09:00",day:"mon",grace_minutes:"720",precheck_timeout:"60"},QG=()=>{let e=document.documentElement.dataset,t=!0;try{t=localStorage.getItem("kz-haptic")!=="off"}catch{}return{theme:e.theme||"system",color:e.color||"monochrome",motion:e.motion||"system",font:P.font.read(),notify:P.notices.on(),haptic:t,sound:P.notices.sound()}},Ae=me()(()=>({data:null,scope:"all",page:null,q:"",back:!1,prefs:QG(),local:{},openAgents:[],draft:{...aue},editing:"",busy:"",typed:{},startQ:"",startBack:!1,pageGen:0})),ZG=(e,t)=>ut((n)=>({typed:{...n.typed,[e]:t}})),{getState:fr,setState:ut}=Ae;var sM=0;var ad=(e,t)=>fetch(e,t).then((n)=>n.ok?n.json():null).catch(()=>null);async function id(e=!1,t){let n=++sM;if(e)ut({data:null});let{scope:o}=fr(),r={headers:P.dirHeader()},[a,i,s,l,c,d,u,p]=await Promise.all([ad("/settings?scope="+encodeURIComponent(o)),ad("/google"),ad("/research-key"),ad("/agent-prefs"),ad("/accounts"),ad("/skills"),ad("/automations",r),ad("/cleanup",r)]);if(!a&&o!=="all"){if(n!==sM||t?.())return;return ut({scope:"all"}),id(!1,t)}if(n!==sM||t?.())return;ut({data:{cfg:a,google:i??{},research:s,agents:l,accounts:c,skills:d,automations:u,cleanup:p},prefs:QG(),local:{}})}var Bg={el:null};var Vo=()=>id();async function yk(e,t){let n=fr().data?.cfg;ut((r)=>({local:{...r.local,[e]:t}}));let o=await K("/settings",{key:e,value:t,scope:n?.scope});O(o.ok?"Saved":o.error||"Could not save"),await Vo()}async function JG(e){let t=await K("/settings",{key:e,scope:fr().data?.cfg?.scope,reset:!0});O(t.ok?"Reset to All projects":t.error||"Could not reset"),await Vo()}async function eF(e){let t=await K("/pick-folder",{});if(t.path)await yk(e,t.path),P.reload()}async function lM(e){let t=await K("/settings",{key:"agent.default",value:e,scope:fr().data?.cfg?.scope??null});O(t.ok?"Saved":t.error||"Could not save"),await Vo()}async function rf(e){let t=await K("/agent-prefs",e);O(t.error?t.error:"Saved"),await Vo()}async function cM(e,t,n){if(e==="bypass"){if(!await wn({title:"Turn on bypass?",description:t?"This agent will run commands without asking.":"Agents will run commands without asking, in every project.",confirmLabel:"Turn on bypass",danger:!0}))return Vo()}return rf(t?{agent:t,agentPermissions:e}:{permissions:e})}var tF=(e)=>ut((t)=>({openAgents:t.openAgents.includes(e)?t.openAgents.filter((n)=>n!==e):[...t.openAgents,e]}));async function Fv(e){let t=await K("/accounts",e);O(t.error?t.error:"Saved"),await Vo()}async function wk(e,t){let n=await K("/shell",{home:!0,agent:t,account:e,login:!0});if(n.error||!n.key)return O(n.error||"Could not open a terminal. Run the line shown here");let o=P.open.term({dir:n.dir,ws:n.ws,key:n.key});O(o?"Sign in, then close the terminal":"Terminal started. Open it from the side menu")}async function nF(e){let t=await K("/accounts",{op:"add",tool:e});if(t.error||!t.added)return O(t.error||"Could not add the account");await wk(t.added,e),await Vo()}async function oF(e,t){if(!await wn({title:`Remove ${t}?`,description:"Runs started on it won't start until you pick another.",confirmLabel:"Remove",danger:!0}))return;let o=await wn({title:"Also delete its folder?",description:"Its login and conversations are in it. Cancel keeps them.",confirmLabel:"Delete folder",danger:!0});return Fv({op:"remove",id:e,deleteFolder:o})}async function rF(e,t){if(fr().busy===e)return;ut({busy:e}),await id(),ut({busy:""}),O(t)}var iue={"kaizen-computer":"They see the window text of the apps they open and can click, set values and type in them, as you. A password manager is blocked by its name only, so one inside a browser or under another name is not. Any other open app is in reach.","lemo-opuscar":"The first time an agent uses it, it downloads the Lemo-Opuscar style library from github.com/lemomo-ai/lemo-opuscar (MIT) into ~/lemo-opuscar and installs its Node and Python packages there. It needs git, Node, Python and ffmpeg, and it runs that project's code on your computer."},sue={"kaizen-computer":"Let agents read and operate the apps on your desktop?","lemo-opuscar":"Add film styles from Lemo-Opuscar?"},uM=()=>fr().data?.skills?.token??"";async function dM(e,t,n){if(e==="rea")return pM(t,!1);let o=t&&n;if(o&&!await wn({title:sue[e]??"Turn this skill on?",description:iue[e],confirmLabel:"Turn on"}))return;let r=await K("/skills",{id:e,on:t,...o?{confirm:!0,token:uM()}:{}});O(r.error?r.error:"Saved. Applies to new sessions"),await Vo()}async function aF(e,t){if(t&&!await wn({title:"Replace your own copy?",description:"For at least one agent, a folder or link of the same name is in the way. It is deleted and kaizen's skill is linked in its place. Go ahead?",confirmLabel:"Replace",danger:!0}))return;let n=await K("/skills",{id:e,repair:!0,...t?{replace:!0,token:uM()}:{}});O(n.error?n.error:"Repaired. Applies to new sessions"),await Vo()}async function pM(e,t){if(!e){if(!await wn({title:"Turn REA off?",description:"This runs REA's own uninstall: it removes REA's MCP registration and skill from every agent, also a REA you set up yourself outside kaizen. Ghidra, Java and REA's data stay.",confirmLabel:"Turn off",danger:!0}))return;O("Removing REA…");let s=await K("/rea",{step:"off"});if(!s.error)O(s.hint?`REA removed. Claude still has one: run ${s.hint}`:"REA removed. Restart your agents");return Vo()}O(t?"Checking the newest REA…":"Asking REA what it would change… (first time downloads REA)");let n=await K("/rea",{step:"plan",update:t});if(n.error)return Vo();let o=n.files?.length?n.files.map((i)=>" "+i).join(`
|
|
89
89
|
`):" (REA did not list files)";if(!await wn({title:`${t?"Update":"Set up"} REA ${n.version} for: ${n.clients.join(", ")}`,description:`REA's setup will change:
|
|
90
90
|
${o}
|
|
91
91
|
|
|
92
92
|
It backs each file up first. Agents can then run REA's reverse-engineering tools on files you point them at. Go ahead?`,confirmLabel:t?"Update":"Set up"}))return;O(t?"Updating REA…":"Setting up REA…");let a=await K("/rea",{step:"apply",confirm:!0,token:n.token});if(!a.error)O(`REA ${a.version} is set up. Restart your agents to load its tools`);return Vo()}async function iF(e,t){let n=e==="missing"?"Install":"Update";if(!await wn({title:`${n} Node.js?`,description:`REA needs it. kaizen will run:
|
|
93
93
|
${t}
|
|
94
94
|
|
|
95
|
-
This installs Node.js for the whole computer, so other apps that use Node.js get it too. Your system may ask for permission. Go ahead?`,confirmLabel:n}))return;if(ut({busy:"rea-node"}),O(`${n==="Install"?"Installing":"Updating"} Node.js… this can take a few minutes`),!(await K("/rea",{step:"node",confirm:!0,token:uM()})).error)O("Node.js is ready. Restart any agents that are open so REA's tools load");ut({busy:""}),await Vo()}async function af(e,t=""){let{draft:n,editing:o,data:r}=fr(),a=r?.automations;if(e==="edit"){let s=a.rules.find((l)=>l.id===t);ut({editing:t,draft:{...n,name:s.name,text:s.text,kind:s.kind,cron:s.cron,agent:s.agent??"",precheck:s.precheck??"",precheck_timeout:String(s.precheck_timeout),grace_minutes:String(s.grace_minutes),time:"09:00",day:"mon"}});return}if(e==="cancel")return ut({editing:""});if(e==="delete"&&!await wn({title:"Delete this automation and its history?",confirmLabel:"Delete",danger:!0}))return;let i=await K("/automations",e==="save"?{op:o?"update":"create",id:o,...n}:{op:e,id:t});if(i.error)return O(i.error);if(e==="save"){let s={...n};for(let l of["name","text","cron","agent","precheck"])delete s[l];ut({editing:"",draft:s}),O("Saved")}else if(e==="run")O(i.ok?"Started":(i.status??"not started").replace(/_/g," ")+(i.why?": "+i.why:""));await Vo()}var Hg=(e,t)=>ut((n)=>({draft:{...n.draft,[e]:t}}));async function sF(e){let t=fr().data?.cleanup;if(!t)return;let n=t.project?` in ${t.project}`:"",o=t.records.abandoned+t.records.unowned+t.records.gone;if(!await wn(e==="records"?{title:`Delete ${o} launch records${n}?`,confirmLabel:"Delete",danger:!0}:{title:`Permanently delete ${t.runs} finished runs${n}?`,description:"Their plans, reviews and reports go, and this cannot be undone.",confirmLabel:"Delete",danger:!0}))return;let a=await K("/cleanup",{what:e});O(a.error??`Removed ${a.removed}`),await Vo()}async function lF(e,t){let n=await K("/google",{op:"client",id:e,secret:t});O(n.ok?"Saved":n.error||"Enter both the client id and the secret"),ut((o)=>({typed:{...o.typed,"gg-id":"","gg-secret":""}})),await Vo()}async function cF(e){if(e)return await K("/google",{op:"disconnect"}),Vo();let t=window.open("","_blank"),n=await K("/google",{op:"connect"});if(n.ok&&t)t.location=n.url;else t?.close(),O(n.error||"Could not start Google sign-in")}async function uF(e){if(!e.trim())return O("Paste your Firecrawl API key first");if((await K("/research-key",{op:"save",key:e.trim()})).set)O("Saved. kaizen search now uses Firecrawl");ut((n)=>({typed:{...n.typed,"fc-key":""}})),await Vo()}async function dF(){ut({busy:"fc-test"});let e=await K("/research-key",{op:"test"});if(ut({busy:""}),e.tested)O("Firecrawl answered. The key works");else if(e.error)O(e.error)}async function pF(){if(!await wn({title:"Remove the saved Firecrawl key?",description:"Agents fall back to their own web tools.",confirmLabel:"Remove",danger:!0}))return;await K("/research-key",{op:"remove"}),await Vo()}var fM=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};function fF(e,t){ut((n)=>({prefs:{...n.prefs,[e]:t}})),{theme:Db,color:wI,motion:kI}[e](t)}function mF(e){P.font.set(e),ut((t)=>({prefs:{...t.prefs,font:e}}))}function gF(e){if(fM("kz-notify",e?"on":"off"),e)P.notify();ut((t)=>({prefs:{...t.prefs,notify:e}})),setTimeout(()=>void id(),300)}function hF(e){fM("kz-haptic",e?"on":"off"),ut((t)=>({prefs:{...t.prefs,haptic:e}}))}function bF(e){fM("kz-sound",e),P.notices.play(e),ut((t)=>({prefs:{...t.prefs,sound:e}}))}function kk(e){ut({page:e}),history.replaceState(null,"","?view=settings"+(e?"&page="+e:""))}function vF(e){if(e===fr().scope)return;ut({scope:e}),id()}var mM=[["App",[{id:"general",title:"General",desc:"About kaizen, storage, folders and how the app opens.",ico:"gear"},{id:"appearance",title:"Appearance",desc:"Theme, color and motion in this browser.",ico:"sun"},{id:"notifications",title:"Notifications",desc:"Notices and sounds in this browser.",ico:"inbox"},{id:"keyboard",title:"Keyboard & Dictation",desc:"Shortcuts, and speech-to-text dictation run in the browser.",ico:"kbd"},{id:"terminal",title:"Terminal",desc:"Board terminals and the terminal dashboard.",ico:"term"}]],["Agents",[{id:"agents",title:"Agents",desc:"Manage AI agents, set a default, and customize commands.",ico:"ai"},{id:"models",title:"Models",desc:"The model each agent runs its stages and handoff sessions on.",ico:"mem"},{id:"accounts",title:"AI Accounts",desc:"Who is signed in to each AI tool kaizen runs. Add accounts only to switch between more than one.",ico:"link"},{id:"skills",title:"Skills",desc:"What your agents can do. Changes apply to new sessions.",ico:"note"}]],["Workflow",[{id:"runs",title:"Runs",desc:"How a run is carried out: who builds, who reviews, and what it remembers.",ico:"play"},{id:"approvals",title:"Approvals",desc:"Where a run stops and waits for you.",ico:"check"},{id:"autofix",title:"Auto-fix",desc:"What happens to review findings.",ico:"bug"},{id:"orchestration",title:"Orchestration",desc:"Split a run into workers, each in its own terminal. Off by default.",ico:"lgrid"},{id:"automations",title:"Automations",desc:"Schedules that start a run in this project.",ico:"clock"},{id:"git",title:"Git",desc:"Branches and commits for each run.",ico:"pen"}]],["Connections",[{id:"integrations",title:"Integrations",desc:"Icebox sources and ChatGPT, your Google account, and web research.",ico:"ext"},{id:"mobile",title:"Phone",desc:"Open kaizen from your phone, and send files to WhatsApp.",ico:"phone"}]]],Vv=mM.flatMap(([,e])=>e),lue={voice:"keyboard",shortcuts:"keyboard"},xF=(e)=>lue[e]??e,cue={general:["Updates","Storage","Folders","App"],keyboard:["Shortcuts","Dictation"]},uue=[[/^(preset|runner|explore\.|build\.|review\.executor)/,"runs","Workflow"],[/^review\.(write_memory|memory_max_lines)$/,"runs","Memory"],[/^(subagents\.|agent\.model\.claude$)/,"models","Claude Code"],[/^agent\.model\./,"models","Models"],[/^agent\.handoff_model\./,"models","Handoff session"],[/^agent\.default$/,"agents","Default agent"],[/^agent\./,"agents","Running agents"],[/^orchestration\./,"orchestration","Workers"],[/^dictation\./,"keyboard","Dictation"],[/^sources\./,"integrations","Icebox"],[/^(mode|approvals\.|auto_accept)/,"approvals","Approvals"],[/^auto_fix\./,"autofix","Auto-fix"],[/^auto_guard\./,"autofix","Auto mode guard"],[/^git\./,"git","Git"],[/^ui\./,"terminal","Terminal"],[/^board\.chat_hotkey$/,"keyboard","Shortcuts"],[/^board\.auto_update$/,"general","Updates"],[/^board\.(projects_dir|video_dir)$/,"general","Folders"],[/^board\./,"general","App"],[/^state\./,"general","Storage"]],due=(e)=>{let t=uue.find(([n])=>n.test(e));return t?[t[1],t[2]]:["general","Other"]},pue=(e)=>/^(orchestration\.worker_model|agent\.model|agent\.handoff_model)\./.test(e);function yF(e){if(e.text)return pue(e.key)?"model":e.folder?"folder":"text";let t=e.values;if(e.key==="preset")return"preset";if(t.length===2&&t.includes("true")&&t.includes("false"))return"switch";if(t.every((n)=>/^\d+$/.test(n))||t.length<=5&&t.every((n)=>n)&&t.join("").length<=32)return"segments";return"stepper"}var wF=(e,t)=>e.labels?.[t]??t,gM=(e)=>"s-"+e.replace(/\./g,"-"),hM=(e)=>e.split(".").pop(),kF=(e)=>e.replace(/^(Worker|Handoff) model: /,""),SF=(e)=>[e.help,e.idle].filter(Boolean).join(" · ");function Sk(e,t){if(!t)return"Off in this browser";if(e==="granted")return"";if(e==="denied")return"Pop-ups blocked by this browser; the sound still plays";return e?"Pop-ups wait for the browser to ask; the sound still plays":"Pop-ups not supported here; the sound still plays"}var CF=(e,t,n,o)=>Math.round(Math.min(o,Math.max(n,+e||t))),fue=(e)=>e.toLowerCase(),nn=(e,t,n,o,r)=>({id:e,kind:t,q:fue(n),ref:o,off:r});function mue(e,t){if(!e)return[];return e.rows.filter((n)=>!(n.key==="agent.default"&&t)).filter((n)=>!t||!/^agent\.(model|handoff_model)\./.test(n.key)||t.agents.some((o)=>o.installed&&n.key.endsWith("."+o.cmd)))}function bM(e,t){let n=new Map(Vv.map((r)=>[r.id,new Map((cue[r.id]??[]).map((a)=>[a,[]]))])),o=(r,a,i)=>{let s=n.get(r);if(!s.has(a))s.set(a,[]);s.get(a).push(i)};for(let r of mue(e.cfg,e.agents)){let[a,i]=due(r.key);o(a,i+(t.scoped&&r.group==="Board"?" · all projects":""),nn(gM(r.key),"row",[r.label,r.help,r.key,r.group,...r.values].join(" "),r.key,!!r.idle))}if(e.cleanup)o("general","Storage",nn("s-clean-records","cleanup","cleanup clean launch records sessions prune","records")),o("general","Storage",nn("s-clean-runs","cleanup","cleanup delete old runs prune history","runs"));if(o("keyboard","Dictation",nn("v-mic","mic","microphone input device mic dictation shortcut")),o("mobile","Phone",nn("phset","phone","phone mobile tailscale qr connect address setup")),o("mobile","Phone",nn("waset","whatsapp","whatsapp phone mobile qr message send")),o("integrations","Google",nn("gg-id","google-id","google oauth client id sheets write back")),o("integrations","Google",nn("gg-secret","google-secret","google oauth client secret")),e.research)o("integrations","Research",nn("fc-key","fc-key","firecrawl api key research web search scrape explore internet")),o("integrations","Research",nn("fc-test","fc-test","firecrawl status test remove research web search"));return o("integrations","Google",nn("gg-conn","google-conn","google account connect sheets write back")),o("appearance","Browser",nn("th","theme","theme light dark system browser")),o("appearance","Browser",nn("co","color","color colour palette monochrome blue theme browser")),o("appearance","Browser",nn("mo","motion","motion animation reduce reduced browser")),o("terminal","Browser",nn("tf","font","terminal font size text zoom browser")),o("notifications","Browser",nn("nt","notify","notifications "+t.notifyHelp+" browser")),o("notifications","Browser",nn("hp","haptic","haptic feedback vibrate vibration touch tap phone browser")),o("notifications","Browser",nn("ns","sound","notification sound audio browser",void 0,!t.notifyOn)),n}var NF=["claude","codex","gemini","agy"],vM={claude:"Claude",codex:"Codex",gemini:"Gemini CLI",agy:"Antigravity"},gue=[["core","Core"],["media","Media"],["optional","Optional"]],hue=(e)=>NF.filter((t)=>e.accounts.some((n)=>n.tool===t)||(e.normal??[]).some((n)=>n.tool===t)),RF=(e)=>NF.filter((t)=>t!=="agy").filter((t)=>t!=="gemini"||(e.normal??[]).some((n)=>n.tool===t)||e.accounts.some((n)=>n.tool===t));function TF(e,t,n,o=bM(t,n)){let r=[];if(e==="agents"&&t.agents){let a=t.agents,i=a.agents.filter((s)=>s.enabled&&s.installed);r.push({title:"Default agent",items:[nn("ag-def","agent-default","default agent auto tool launches "+i.map((s)=>s.name).join(" "))]}),r.push({title:"Permissions",items:[nn("ag-perm","agent-perm","permissions bypass yolo all agents without asking")]}),r.push({title:`Installed · ${n.agentCount} detected`,extra:"refresh",items:a.agents.map((s)=>nn("ag-"+s.cmd,"agent",[s.name,s.cmd,"agent installed command arguments environment permissions"].join(" "),s.cmd))})}if(e==="accounts"&&t.accounts){let a=t.accounts;for(let i of hue(a))r.push({title:vM[i],items:[...(a.normal??[]).filter((s)=>s.tool===i).map((s)=>nn("ac-normal-"+i,"account-normal",`account login normal default ${i} ${s.who??""}`,i)),...a.accounts.filter((s)=>s.tool===i).map((s)=>nn("ac-"+s.id,"account",`account ${s.name} ${s.tool}`,s.id))]});r.push({title:"Add an account",items:[nn("ac-add","account-add","add account sign in claude codex gemini provider")]})}if(e==="orchestration"&&t.cfg)r.push({title:"",items:[nn("orch","orchestration","orchestration workers flow plan merge review")]});if(e==="skills"&&t.skills)gue.filter(([a])=>t.skills.skills.some((i)=>i.group===a)).forEach(([a,i],s)=>r.push({title:i,extra:s?void 0:"recheck",items:t.skills.skills.filter((l)=>l.group===a).map((l)=>nn("sk-"+l.id,"skill",[l.title,l.id,l.description,l.group,"skill"].join(" "),l.id))}));if(e==="automations"){let a=t.automations;r.push({title:"Automations",items:a?[...a.rules.map((i)=>nn("au-"+i.id,"automation",["automation",i.name,i.text,i.cron].join(" "),i.id)),nn("au-form","automation-form","automation new create add schedule")]:[nn("au-none","automation-none","automation")]})}for(let[a,i]of o.get(e)??[])if(i.length)r.push({title:a,items:i});return r}function EF(e,t){let n=t.trim().toLowerCase();if(!n)return e;return e.map((o)=>o.title?{...o,items:o.items.filter((r)=>r.q.includes(n))}:o).filter((o)=>!o.title||o.items.length)}var AF=(e)=>e.some((t)=>t.title&&t.items.length);function MF(e){let t=!!e.query.trim();if(e.narrow&&t&&e.typing)return null;if(e.picked&&e.hits.includes(e.picked))return e.picked;return t||!e.narrow?e.hits[0]??null:null}var DF=(e)=>e.signedIn&&(e.who||e.via||e.plan)?[e.who??(e.via?`via ${e.via}`:""),e.plan].filter(Boolean).join(" · "):"";function PF(e,t,n=!0){if(!e)return{text:t?n?"Signed in · no usage yet":"Signed in":"Not signed in",bad:!t};if(e.expired)return{text:"Sign-in expired. Sign in again",bad:!0};if(e.error)return{text:"Usage unavailable",bad:!0};return{text:`${e.five?`${e.five.pct}% of 5 hours`:""}${e.five&&e.week?" · ":""}${e.week?`${e.week.pct}% of the week`:""}`,bad:!1}}var ri=(e)=>["path",{d:e}],bue=[ri("M10 4a2 2 0 1 1 4 0v2h5v5h-2a2 2 0 1 0 0 4h2v5H5v-5h2a2 2 0 1 0 0-4H5V6h5Z")],vue={kaizen:[ri("M4 7h11M4 12h7M4 17h11"),ri("m16 11 2 2 3-4")],"kaizen-help":[["circle",{cx:12,cy:12,r:9}],ri("M9.5 9.5a2.5 2.5 0 1 1 3.8 2.1c-.9.6-1.3 1.1-1.3 2.1"),ri("M12 17h.01")],"kaizen-book":[ri("M12 6c-2-1.5-5-2-8-2v15c3 0 6 .5 8 2 2-1.5 5-2 8-2V4c-3 0-6 .5-8 2Z"),ri("M12 6v15")],"kaizen-deck":[["rect",{x:3,y:4,width:18,height:12,rx:1}],ri("M12 16v4M8 20h8M8 12l3-3 2 2 3-3")],"kaizen-computer":[["rect",{x:3,y:4,width:18,height:12,rx:1}],ri("M8 20h8M12 16v4M9 8l5 3-2 .8-.8 2Z")],"kaizen-game":[["rect",{x:2,y:7,width:20,height:11,rx:5}],ri("M7 10.5v4M5 12.5h4"),["circle",{cx:16,cy:11.5,r:0.6}],["circle",{cx:18,cy:13.5,r:0.6}]],"kaizen-video":[["rect",{x:3,y:6,width:13,height:12,rx:2}],ri("m16 10 5-3v10l-5-3")],rea:[["circle",{cx:10.5,cy:10.5,r:6}],ri("m15 15 6 6"),ri("M8.5 9 7 10.5 8.5 12M12.5 9l1.5 1.5-1.5 1.5")]},OF=(e)=>vue[e]??bue;var Ck=()=>globalThis.kaizenDesktop,Kv=()=>Ck()?"Kaizen":"kaizen",sd=me()(()=>({ver:null,later:(()=>{try{return localStorage.getItem("kz-upd-later")}catch{return null}})()})),xM=(e)=>`${Kv()} ${e.latest} is available. You are running ${e.version}. Update it from the desktop app on your computer.`,_F=(e)=>e.behind?xM(e):`${Kv()} ${e.version} is up to date.`,yM=(e)=>!!e?.update,wM=(e)=>Ck()?Ck().check():fetch(e?"/version?fresh=1":"/version").then((t)=>t.json()),kM=(e)=>sd.setState({ver:e}),SM=()=>wM(!1).then(kM,()=>{});function IF(e){try{localStorage.setItem("kz-upd-later",e)}catch{}sd.setState({later:e})}async function zF(e){let t=Ck(),n=t?{title:`Install Kaizen ${e.latest}?`,description:"The app restarts, and agents it runs stop.",confirmLabel:"Install"}:{title:`Update kaizen to ${e.latest}?`,description:"kaizen restarts, and agents it runs stop.",confirmLabel:"Update"};if(!await wn(n))return"no";if(t){let o=await t.install().catch((r)=>({ok:!1,opened:!1,error:String(r)}));if(o&&!o.ok)O(`Could not install the update: ${o.error}`);return o&&o.opened?"opened":o&&o.ok?"restarting":"no"}if(!(await K("/upgrade",{})).ok)return"no";return setTimeout(()=>location.reload(),20000),"restarting"}async function CM(){if(Ze().view!=="settings")return;let e=fr().pageGen+1;ut({pageGen:e}),la(!0);let t=!Ee().open||Ee().title!=="Settings";if(_u(),_e({openKey:null,card:null,runDoc:null}),_e({open:!0,title:"Settings",titleTip:"",head:null,tabs:[],footer:null,body:"settings"}),t)ut({typed:{},scope:"all",q:fr().startQ,back:fr().startBack,page:fr().page??xF(new URLSearchParams(location.search).get("page")??"")});id(t,()=>e!==fr().pageGen)}var Nk=h(I(),1),LF=new Map,xue=(e)=>{let t=LF.get(e);if(!t)t=fetch("/models?agent="+encodeURIComponent(e)).then((n)=>n.ok?n.json():{models:[]}).then((n)=>Array.isArray(n.models)?n.models:[]).catch(()=>[]),LF.set(e,t);return t};function BF(e,t){let[n,o]=Nk.useState([]);return Nk.useEffect(()=>{if(!t)return;let r=!0;return xue(e).then((a)=>r&&o(a)),()=>{r=!1}},[e,t]),n}var ai=me()(()=>({data:null,open:null})),HF=()=>fetch("/whats-new").then((e)=>e.ok?e.json():null).then((e)=>e&&ai.setState({data:e})).catch(()=>{}),qv=(e)=>!!e.data?.entry&&(e.open??e.data.unseen),jF=()=>{let e=ai.getState();if(qv(e))return void Rk();ai.setState({open:!0})};async function Rk(){ai.setState({open:!1});let e=ai.getState();if(!e.data?.unseen)return;if((await K("/whats-new",{})).ok)ai.setState({data:{...e.data,unseen:!1}})}var Ht=h(w(),1),yue=["claude","codex","gemini"],NM=({a:e})=>Ht.jsx("svg",{"aria-hidden":"true",children:Ht.jsx("use",{href:`#i-${yue.includes(e.agent??"")?e.agent:"ai"}`})}),RM=({st:e})=>Ht.jsx("i",{className:`si ${xp[e]}`}),UF=(e,t)=>!e?"":t-e<60000?"now":xo(e,t);function GF({rows:e,now:t,open:n,dir:o,ws:r}){if(!e.length)return null;let a=(s,l)=>(s.preventDefault(),nB(o,r,l));if(e.length===1){let s=e[0];return Ht.jsx("div",{className:"wag",children:Ht.jsxs("button",{type:"button",className:"aone",title:`${s.a.name}: open its terminal`,onClick:(l)=>a(l,s.a.key),children:[Ht.jsx(RM,{st:s.st}),Ht.jsx(NM,{a:s.a}),Ht.jsxs("span",{className:"atx",children:[ec[s.st]," - ",s.a.name]}),Ht.jsx("small",{children:UF(s.a.at,t)})]})})}let i=Ht.jsx("button",{type:"button",className:`wchev${n?" on":""}`,"aria-expanded":n,"aria-label":`${e.length} agents: ${n?"hide":"show"} the list`,onClick:(s)=>(s.preventDefault(),Z8(o,r)),children:Ht.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:Ht.jsx("path",{d:"M6 9l6 6 6-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});if(n)return Ht.jsxs(Ht.Fragment,{children:[Ht.jsxs("div",{className:"wag",children:[Ht.jsxs("span",{className:"aht",children:[e.length," agents"]}),i]}),Ht.jsx("div",{className:"alist",children:e.map((s)=>Ht.jsxs("button",{type:"button",className:"arow",title:PT(s),onClick:(l)=>a(l,s.a.key),children:[Ht.jsx(RM,{st:s.st}),Ht.jsx(NM,{a:s.a}),Ht.jsx("span",{className:"atx",children:PT(s)}),Ht.jsx("small",{children:UF(s.a.at,t)})]},s.a.key))})]});return Ht.jsxs("div",{className:"wag",children:[Ht.jsx("span",{className:"chips",children:JL(e).map((s)=>Ht.jsxs("span",{className:"chip",children:[Ht.jsx(RM,{st:s.st}),s.rs.map((l)=>Ht.jsx("button",{type:"button",className:"amark",title:`${l.a.name} - ${ec[s.st]}: open its terminal`,"aria-label":`${l.a.name} - ${ec[s.st]}: open its terminal`,onClick:(c)=>a(c,l.a.key),children:Ht.jsx(NM,{a:l.a})},l.a.key))]},s.st))}),i]})}var oK=h(I(),1);var FF=h(I(),1);var ld=h(w(),1);function de({icon:e,label:t,active:n,size:o="md",href:r,className:a,children:i,...s}){return ld.jsxs(bk,{children:[ld.jsx(vk,{asChild:!0,children:ld.jsxs(r?"a":"button",{...r?{href:r}:{type:"button"},"aria-label":n?`${t} (on)`:t,className:N("relative grid shrink-0 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",o==="sm"?"size-(--btn-xs) max-[640px]:size-8 [&_svg]:size-(--ico)":"size-(--btn-s)",n&&"text-foreground",a),...s,children:[typeof e==="string"?ld.jsx(_,{name:e}):e,n&&ld.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1.5 size-[7px] rounded-full bg-primary shadow-[0_0_0_2px_var(--bg)]"}),i]})}),ld.jsx(xk,{children:t})]})}var _r=h(w(),1);function cd({label:e,icon:t="more",items:n,children:o,footer:r,className:a,triggerClassName:i,size:s}){return _r.jsxs(kn,{children:[_r.jsx(Sn,{asChild:!0,children:_r.jsx(de,{icon:t,label:e,className:N(s==="sm"&&"size-(--btn-xs) [&_svg]:size-4",i),onClick:(l)=>l.stopPropagation()})}),_r.jsxs(Cn,{className:N("w-[340px] max-w-[80vw] text-sm",a),onClick:(l)=>l.stopPropagation(),onKeyDown:(l)=>l.stopPropagation(),children:[o,o&&n.length>0&&_r.jsx(Wr,{}),n.map((l)=>l.href?_r.jsx(qt,{asChild:!0,children:_r.jsx("a",{href:l.href,children:_r.jsxs("span",{className:"flex min-w-0 flex-col",children:[l.label,l.hint&&_r.jsx("small",{className:"truncate font-mono text-xs text-muted-foreground",children:l.hint})]})})},l.id):_r.jsxs(FF.Fragment,{children:[l.before&&_r.jsx(Wr,{}),_r.jsxs(qt,{onSelect:l.onSelect,className:l.danger?"text-danger data-[highlighted]:text-danger":void 0,children:[l.icon&&_r.jsx(_,{name:l.icon,className:"size-[15px] shrink-0"}),l.label,l.count!=null&&_r.jsx("i",{className:"ml-auto text-xs not-italic text-muted-foreground",children:l.count})]})]},l.id)),r&&(n.length>0||o)&&_r.jsx(Wr,{}),r]})]})}var wc=h(w(),1);function jg({open:e,title:t,description:n,confirmLabel:o,danger:r,onConfirm:a,onCancel:i}){return wc.jsx(rk,{open:e,onOpenChange:(s)=>!s&&i(),children:wc.jsxs(ak,{children:[wc.jsx(Lv,{children:t}),n&&wc.jsx(Bv,{className:"whitespace-pre-line",children:n}),wc.jsxs("div",{className:"mt-1 flex justify-end gap-1.5",children:[wc.jsx(ik,{children:"Cancel"}),wc.jsx(sk,{danger:r,onClick:a,children:o})]})]})})}var KF=h(w(),1);function VF(){let e=Fm((t)=>t.open);return KF.jsx(jg,{open:!!e,title:e?.title??"",description:e?.description,confirmLabel:e?.confirmLabel??"OK",danger:e?.danger,onConfirm:()=>LR(!0),onCancel:()=>LR(!1)})}var qF=h(I(),1);var sf=h(w(),1);function ud({onFiles:e,className:t}){let n=qF.useRef(null);return sf.jsxs(sf.Fragment,{children:[sf.jsx(de,{icon:"clip",label:"Attach files",className:t,onClick:()=>n.current?.click()}),sf.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,onChange:(o)=>{let r=[...o.target.files??[]];o.target.value="",e(r)}})]})}var Tk=h(w(),1);function kc({count:e,className:t,children:n,...o}){return Tk.jsxs(Lg,{className:N("inline-flex h-[26px] items-center gap-1.5 whitespace-nowrap rounded-sm border border-border bg-card px-2.5 text-sm text-foreground hover:bg-muted data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",t),...o,children:[n,e!=null&&Tk.jsx("i",{className:"text-xs not-italic tabular-nums opacity-75",children:e})]})}var $v=h(w(),1);function Ug(){return $v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"size-[13px] shrink-0",children:[$v.jsx("circle",{cx:"8",cy:"5.2",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),$v.jsx("path",{d:"M3 13.6c.7-2.5 2.6-3.8 5-3.8s4.3 1.3 5 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var lf=h(w(),1);function Ea({icon:e,title:t,help:n,children:o,busy:r}){return lf.jsxs("div",{role:r?"status":void 0,className:"flex flex-col items-center gap-1 px-6 py-14 text-center text-lg text-muted-foreground",children:[e&&lf.jsx(_,{name:e,className:"mb-3 size-8 opacity-60"}),lf.jsx("p",{className:"text-[16px] font-medium text-foreground",children:t}),n&&lf.jsx("span",{children:n}),o&&lf.jsx("div",{className:"mt-2",children:o})]})}var $F=h(I(),1);var Sc=h(w(),1);function Ne({id:e,label:t,help:n,error:o,inline:r,row:a,dim:i,children:s}){let l=$F.useId(),c=e??l,d=`${c}-help`,u=`${c}-err`,p=[n&&d,o&&u].filter(Boolean).join(" ")||void 0,f=s({id:c,"aria-describedby":p,"aria-invalid":o?!0:void 0},`${c}-l`),g=n&&Sc.jsx("p",{id:d,className:N("text-sm text-muted-foreground",a&&"col-start-1 text-xs leading-normal"),children:n}),m=o&&Sc.jsx("p",{id:u,role:"alert",className:"text-sm text-danger",children:o});if(a)return Sc.jsxs("div",{className:"grid min-h-11 grid-cols-[minmax(0,1fr)_auto] gap-x-6 gap-y-0.5 px-3.5 py-2.5 @max-[520px]:grid-cols-1",children:[Sc.jsx(xc,{id:`${c}-l`,htmlFor:c,className:N("self-center text-sm font-normal text-strong",i&&"opacity-50"),children:t}),Sc.jsx("div",{className:N("col-start-2 self-center justify-self-end @max-[520px]:col-start-1 @max-[520px]:row-auto @max-[520px]:mt-1.5 @max-[520px]:max-w-full @max-[520px]:justify-self-start",(n||o)&&"row-span-2",i&&"opacity-50"),children:f}),g,m]});return Sc.jsxs("div",{className:r?"flex min-w-0 items-center gap-1.5":"flex flex-col gap-1.5",children:[Sc.jsx(xc,{id:`${c}-l`,htmlFor:c,className:r?"shrink-0 text-xs text-muted-foreground":void 0,children:t}),f,g,m]})}var YF=h(I(),1);var Gg=h(w(),1);function WF({label:e,active:t,children:n,className:o}){let[r,a]=YF.useState(!1);return Gg.jsxs(eo,{open:r,onOpenChange:a,children:[Gg.jsx(to,{asChild:!0,children:Gg.jsx(de,{icon:"filter",label:e,active:t})}),Gg.jsx(no,{className:o??"flex flex-col gap-1.5 p-2",children:typeof n==="function"?n(()=>a(!1)):n})]})}var XF=h(w(),1);function Xr({inline:e,children:t,label:n}){return XF.jsx("form",{"aria-label":n,onSubmit:(o)=>o.preventDefault(),className:N("flex min-w-0 flex-col gap-2 whitespace-normal text-base [overflow-wrap:anywhere]",e&&"rounded-sm border border-primary bg-card p-3 shadow-md"),children:t})}var cf=h(I(),1);var dd=h(w(),1),wue=[0.5,0.9,1.3,0.8,0.45],kue=()=>dd.jsx("span",{"aria-hidden":"true",className:"inline-flex h-full items-center gap-0.5",children:wue.map((e,t)=>dd.jsx("i",{style:{"--w":e},className:"w-0.5 rounded-[1px] bg-current transition-[height] duration-[80ms] h-[calc(3px+12px*min(1,var(--lvl,0)*var(--w)))]"},t))});function Cc({field:e,also:t=[],className:n}){let o=cf.useId(),r=cf.useRef(null),a=cf.useRef(null),i=g0((s)=>s.st[o]??zT);if(cf.useEffect(()=>{if(!nv())return;let s=[e,...t].map((c)=>c.current).filter((c)=>!!c);a.current=s[0]??null;let l=s.map((c)=>{let d=()=>a.current=c;return c.addEventListener("focus",d),()=>c.removeEventListener("focus",d)});return()=>{if(l.forEach((c)=>c()),v0(o))la(!0)}},[]),!nv())return null;return dd.jsx("span",{ref:r,className:N("inline-flex",n),children:dd.jsx(de,{icon:i.on?dd.jsx(kue,{}):i.loading&&i.pct!=null?dd.jsxs("i",{className:"text-[10px] not-italic tabular-nums",children:[i.pct,"%"]}):"mic",label:"Dictate",className:N("size-[26px] [&_svg]:size-[15px]",(i.on||i.busy)&&"text-primary"),onClick:(s)=>{if(s.preventDefault(),s.stopPropagation(),a.current)x0({id:o,el:r.current,target:()=>a.current})}})})}var ji=h(w(),1);function Yv({at:e,size:t,total:n,onAt:o,onSize:r}){if(n<=Xw[0])return null;let a=e*t+1,i=Math.min(n,a+t-1);return ji.jsxs("div",{className:"sticky bottom-0 z-[1] flex items-center justify-end gap-2.5 border-t border-border bg-background px-3 py-2 text-sm text-muted-foreground",children:[ji.jsxs("label",{className:"mr-auto flex items-center gap-1.5",children:["Rows",ji.jsxs(It,{value:String(t),onValueChange:(s)=>r(Number(s)),children:[ji.jsx(Lt,{"aria-label":"Rows per page",size:"sm",className:"w-auto",children:ji.jsx(zt,{})}),ji.jsx(Bt,{children:Xw.map((s)=>ji.jsx(ft,{value:String(s),children:s},s))})]})]}),ji.jsxs("span",{children:[a,"–",i," of ",n]}),ji.jsx(A,{size:"sm",disabled:!e,onClick:()=>o(e-1),children:"Prev"}),ji.jsx(A,{size:"sm",disabled:i>=n,onClick:()=>o(e+1),children:"Next"})]})}var QF=h(I(),1);var oo=h(w(),1);function Ui({options:e,value:t,onChange:n,placeholder:o="Choose",label:r,className:a,groupIcons:i,open:s,onOpenChange:l,onRemove:c}){let[d,u]=QF.useState(!1),p=s??d,f=(v)=>(u(v),l?.(v)),g=e.find((v)=>v.value===t),m=(v)=>oo.jsxs(zg,{value:`${e.indexOf(v)}:${v.value}`,keywords:[v.label,v.group??"",v.search??""],onSelect:()=>{n(v.value),f(!1)},children:[v.icon,oo.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.label}),v.count!=null&&oo.jsx("i",{className:"text-xs not-italic tabular-nums text-muted-foreground",children:v.count}),v.value===t&&oo.jsx(_,{name:"check",className:"size-3.5 text-primary"}),v.removable&&c&&oo.jsx("button",{type:"button","aria-label":`Remove ${v.label}`,title:`Remove ${v.label}`,onPointerDown:(y)=>y.stopPropagation(),onClick:(y)=>{y.stopPropagation(),f(!1),c(v.value)},className:"-mr-1 grid size-5 place-items-center rounded-xs text-muted-foreground opacity-60 hover:bg-muted hover:text-foreground hover:opacity-100",children:oo.jsx(_,{name:"x",className:"size-3"})})]},v.value),x=[...new Set(e.map((v)=>v.group).filter((v)=>!!v))];return oo.jsxs(eo,{open:p,onOpenChange:f,children:[oo.jsx(to,{asChild:!0,children:oo.jsxs("button",{type:"button","aria-label":g?`${r}: ${g.label}`:r,className:N("inline-flex h-(--btn-s) max-w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-2.5 text-base hover:border-muted-foreground",!g&&"text-muted-foreground",a),children:[g?.icon,oo.jsx("span",{className:"min-w-0 truncate",children:g?.label??o}),oo.jsx(_,{name:"chev",className:"size-3 shrink-0 text-muted-foreground"})]})}),oo.jsx(no,{align:"start",className:"w-[320px]",children:oo.jsxs(Og,{filter:(v,y,b)=>b?.join(" ").toLowerCase().includes(y.trim().toLowerCase())?1:0,children:[oo.jsx(_g,{placeholder:"Search…","aria-label":`Search ${r}`}),oo.jsxs(Ig,{children:[oo.jsx(uk,{children:"Nothing matches"}),e.filter((v)=>!v.group).map(m),x.map((v)=>oo.jsx(dk,{heading:i?.[v]?oo.jsxs(oo.Fragment,{children:[i[v],v]}):v,children:e.filter((y)=>y.group===v).map(m)},v))]})]})})]})}var ZV=h(I(),1);var Nc={x:"X",tiktok:"TikTok",instagram:"Instagram",threads:"Threads"},df={client:"Client",finding:"Finding",people:"People say"},eV={casual:"Casual",fun:"Fun",helpful:"Helpful",promo:"Promo"},pd=(e)=>/^https?:\/\//i.test(String(e))?e:"#",ks=(e)=>{try{return new URL(e).hostname}catch{return e}},Aa=(e,t)=>String(e||"").toLowerCase()===String(t||"").toLowerCase(),Me=(e)=>e.dir+" "+e.id,ZF=(e)=>e.dir+" "+e.source,Ek=(e)=>[...e].reduce((t,n)=>(t*31+n.charCodeAt(0))%360,7),Ir=(e,t=Date.now())=>{let n=Math.round((t-Date.parse(e))/60000);return n<1?"just now":n<60?n+" min ago":n<1440?Math.round(n/60)+" h ago":Math.round(n/1440)+" d ago"},Sue=(e,t=new Date)=>{let n=new Date(t);if(e==="1d")n.setDate(n.getDate()+1);else if(e==="1w")n.setDate(n.getDate()+7);else if(e==="1m")n.setMonth(n.getMonth()+1);else return new Date(e+"T00:00:00");return n},tV=(e)=>e.toLocaleDateString("sv"),nV=(e,t)=>`${e>1?e+" snoozed":"Snoozed"} until ${Sue(t).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}`,oV=(e)=>{if(e.social)return"social";let t=e.url;if(t.includes("docs.google.com/spreadsheets")||t.endsWith(".csv")||t.endsWith(".tsv"))return"sheet";if(t.includes("docs.google.com/document"))return"doc";return"link"},Ak=(e)=>e?.social&&Nc[e.social]||(e?ks(e.url).replace(/^www\./,""):"")||"Other",Ss=(e,t)=>e.find((n)=>n.dir===t.dir&&n.url===t.source),ii=(e,t)=>{let n=Ss(e,t);return n?n.label||ks(n.url):ks(t.source)},TM=(e,t)=>t.status==="dismissed"?"Dismissed":t.status==="done"?"Done":t.status==="promoted"?"Promoted":t.category||Ss(e,t)?.category||Ak(Ss(e,t)||{url:t.source}),Wv=(e)=>!["promoted","dismissed","done"].includes(e.status),fa=(e)=>e.status==="new",rV=(e)=>e==="Dismissed"||e==="Done"||e==="Promoted",Mk=(e)=>(e.images||[]).filter((t)=>/^https:\/\//.test(t));function aV(e){let t="";try{let n=new URL(e);if(/^https?:$/.test(n.protocol))t=n.origin}catch{}return!t?"":e.includes("docs.google.com/spreadsheets")?"https://ssl.gstatic.com/docs/spreadsheets/favicon3.ico":e.includes("docs.google.com/document")?"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico":t+"/favicon.ico"}function iV(e){if(e.image&&/^https:\/\//i.test(e.image))return e.image;let t=/^https:\/\/(?:(?:www|old|new|m)\.)?reddit\.com\/r\/[\w-]+\/comments\/([a-z0-9]+)/i.exec(e.url);return t?`https://share.redd.it/preview/post/${t[1].toLowerCase()}`:""}var Cue=(e)=>[e.text,e.notes,e.link?.url,e.link?.title,e.link?.summary,...(e.tags??[]).map((t)=>"#"+t),e.board,e.project].filter(Boolean).join(`
|
|
95
|
+
This installs Node.js for the whole computer, so other apps that use Node.js get it too. Your system may ask for permission. Go ahead?`,confirmLabel:n}))return;if(ut({busy:"rea-node"}),O(`${n==="Install"?"Installing":"Updating"} Node.js… this can take a few minutes`),!(await K("/rea",{step:"node",confirm:!0,token:uM()})).error)O("Node.js is ready. Restart any agents that are open so REA's tools load");ut({busy:""}),await Vo()}async function af(e,t=""){let{draft:n,editing:o,data:r}=fr(),a=r?.automations;if(e==="edit"){let s=a.rules.find((l)=>l.id===t);ut({editing:t,draft:{...n,name:s.name,text:s.text,kind:s.kind,cron:s.cron,agent:s.agent??"",precheck:s.precheck??"",precheck_timeout:String(s.precheck_timeout),grace_minutes:String(s.grace_minutes),time:"09:00",day:"mon"}});return}if(e==="cancel")return ut({editing:""});if(e==="delete"&&!await wn({title:"Delete this automation and its history?",confirmLabel:"Delete",danger:!0}))return;let i=await K("/automations",e==="save"?{op:o?"update":"create",id:o,...n}:{op:e,id:t});if(i.error)return O(i.error);if(e==="save"){let s={...n};for(let l of["name","text","cron","agent","precheck"])delete s[l];ut({editing:"",draft:s}),O("Saved")}else if(e==="run")O(i.ok?"Started":(i.status??"not started").replace(/_/g," ")+(i.why?": "+i.why:""));await Vo()}var Hg=(e,t)=>ut((n)=>({draft:{...n.draft,[e]:t}}));async function sF(e){let t=fr().data?.cleanup;if(!t)return;let n=t.project?` in ${t.project}`:"",o=t.records.abandoned+t.records.unowned+t.records.gone;if(!await wn(e==="records"?{title:`Delete ${o} launch records${n}?`,confirmLabel:"Delete",danger:!0}:{title:`Permanently delete ${t.runs} finished runs${n}?`,description:"Their plans, reviews and reports go, and this cannot be undone.",confirmLabel:"Delete",danger:!0}))return;let a=await K("/cleanup",{what:e});O(a.error??`Removed ${a.removed}`),await Vo()}async function lF(e,t){let n=await K("/google",{op:"client",id:e,secret:t});O(n.ok?"Saved":n.error||"Enter both the client id and the secret"),ut((o)=>({typed:{...o.typed,"gg-id":"","gg-secret":""}})),await Vo()}async function cF(e){if(e)return await K("/google",{op:"disconnect"}),Vo();let t=window.open("","_blank"),n=await K("/google",{op:"connect"});if(n.ok&&t)t.location=n.url;else t?.close(),O(n.error||"Could not start Google sign-in")}async function uF(e){if(!e.trim())return O("Paste your Firecrawl API key first");if((await K("/research-key",{op:"save",key:e.trim()})).set)O("Saved. kaizen search now uses Firecrawl");ut((n)=>({typed:{...n.typed,"fc-key":""}})),await Vo()}async function dF(){ut({busy:"fc-test"});let e=await K("/research-key",{op:"test"});if(ut({busy:""}),e.tested)O("Firecrawl answered. The key works");else if(e.error)O(e.error)}async function pF(){if(!await wn({title:"Remove the saved Firecrawl key?",description:"Agents fall back to their own web tools.",confirmLabel:"Remove",danger:!0}))return;await K("/research-key",{op:"remove"}),await Vo()}var fM=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};function fF(e,t){ut((n)=>({prefs:{...n.prefs,[e]:t}})),{theme:Db,color:wI,motion:kI}[e](t)}function mF(e){P.font.set(e),ut((t)=>({prefs:{...t.prefs,font:e}}))}function gF(e){if(fM("kz-notify",e?"on":"off"),e)P.notify();ut((t)=>({prefs:{...t.prefs,notify:e}})),setTimeout(()=>void id(),300)}function hF(e){fM("kz-haptic",e?"on":"off"),ut((t)=>({prefs:{...t.prefs,haptic:e}}))}function bF(e){fM("kz-sound",e),P.notices.play(e),ut((t)=>({prefs:{...t.prefs,sound:e}}))}function kk(e){ut({page:e}),history.replaceState(null,"","?view=settings"+(e?"&page="+e:""))}function vF(e){if(e===fr().scope)return;ut({scope:e}),id()}var mM=[["App",[{id:"general",title:"General",desc:"About kaizen, storage, folders and how the app opens.",ico:"gear"},{id:"appearance",title:"Appearance",desc:"Theme, color and motion in this browser.",ico:"sun"},{id:"notifications",title:"Notifications",desc:"Notices and sounds in this browser.",ico:"inbox"},{id:"keyboard",title:"Keyboard & Dictation",desc:"Shortcuts, and speech-to-text dictation run in the browser.",ico:"kbd"},{id:"terminal",title:"Terminal",desc:"Board terminals and the terminal dashboard.",ico:"term"}]],["Agents",[{id:"agents",title:"Agents",desc:"Manage AI agents, set a default, and customize commands.",ico:"ai"},{id:"models",title:"Models",desc:"The model each agent runs its stages and handoff sessions on.",ico:"mem"},{id:"accounts",title:"AI Accounts",desc:"Who is signed in to each AI tool kaizen runs. Add accounts only to switch between more than one.",ico:"link"},{id:"skills",title:"Skills",desc:"What your agents can do. Changes apply to new sessions.",ico:"note"}]],["Workflow",[{id:"runs",title:"Runs",desc:"How a run is carried out: who builds, who reviews, and what it remembers.",ico:"play"},{id:"approvals",title:"Approvals",desc:"Where a run stops and waits for you.",ico:"check"},{id:"autofix",title:"Auto-fix",desc:"What happens to review findings.",ico:"bug"},{id:"orchestration",title:"Orchestration",desc:"Split a run into workers, each in its own terminal. Off by default.",ico:"lgrid"},{id:"automations",title:"Automations",desc:"Schedules that start a run in this project.",ico:"clock"},{id:"git",title:"Git",desc:"Branches and commits for each run.",ico:"pen"}]],["Connections",[{id:"integrations",title:"Integrations",desc:"Icebox sources and ChatGPT, your Google account, and web research.",ico:"ext"},{id:"mobile",title:"Phone",desc:"Open kaizen from your phone, and send files to WhatsApp.",ico:"phone"}]]],Vv=mM.flatMap(([,e])=>e),lue={voice:"keyboard",shortcuts:"keyboard"},xF=(e)=>lue[e]??e,cue={general:["Updates","Storage","Folders","App"],keyboard:["Shortcuts","Dictation"]},uue=[[/^(preset|runner|explore\.|build\.|review\.executor)/,"runs","Workflow"],[/^review\.(write_memory|memory_max_lines)$/,"runs","Memory"],[/^(subagents\.|agent\.model\.claude$)/,"models","Claude Code"],[/^agent\.model\./,"models","Models"],[/^agent\.handoff_model\./,"models","Handoff session"],[/^agent\.default$/,"agents","Default agent"],[/^agent\./,"agents","Running agents"],[/^orchestration\./,"orchestration","Workers"],[/^dictation\./,"keyboard","Dictation"],[/^sources\./,"integrations","Icebox"],[/^(mode|approvals\.|auto_accept)/,"approvals","Approvals"],[/^auto_fix\./,"autofix","Auto-fix"],[/^auto_guard\./,"autofix","Auto mode guard"],[/^git\./,"git","Git"],[/^ui\./,"terminal","Terminal"],[/^board\.chat_hotkey$/,"keyboard","Shortcuts"],[/^board\.auto_update$/,"general","Updates"],[/^board\.(projects_dir|video_dir)$/,"general","Folders"],[/^board\./,"general","App"],[/^state\./,"general","Storage"]],due=(e)=>{let t=uue.find(([n])=>n.test(e));return t?[t[1],t[2]]:["general","Other"]},pue=(e)=>/^(orchestration\.worker_model|agent\.model|agent\.handoff_model)\./.test(e);function yF(e){if(e.text)return pue(e.key)?"model":e.folder?"folder":"text";let t=e.values;if(e.key==="preset")return"preset";if(t.length===2&&t.includes("true")&&t.includes("false"))return"switch";if(t.every((n)=>/^\d+$/.test(n))||t.length<=5&&t.every((n)=>n)&&t.join("").length<=32)return"segments";return"stepper"}var wF=(e,t)=>e.labels?.[t]??t,gM=(e)=>"s-"+e.replace(/\./g,"-"),hM=(e)=>e.split(".").pop(),kF=(e)=>e.replace(/^(Worker|Handoff) model: /,""),SF=(e)=>[e.help,e.idle].filter(Boolean).join(" · ");function Sk(e,t){if(!t)return"Off in this browser";if(e==="granted")return"";if(e==="denied")return"Pop-ups blocked by this browser; the sound still plays";return e?"Pop-ups wait for the browser to ask; the sound still plays":"Pop-ups not supported here; the sound still plays"}var CF=(e,t,n,o)=>Math.round(Math.min(o,Math.max(n,+e||t))),fue=(e)=>e.toLowerCase(),nn=(e,t,n,o,r)=>({id:e,kind:t,q:fue(n),ref:o,off:r});function mue(e,t){if(!e)return[];return e.rows.filter((n)=>!(n.key==="agent.default"&&t)).filter((n)=>!t||!/^agent\.(model|handoff_model)\./.test(n.key)||t.agents.some((o)=>o.installed&&n.key.endsWith("."+o.cmd)))}function bM(e,t){let n=new Map(Vv.map((r)=>[r.id,new Map((cue[r.id]??[]).map((a)=>[a,[]]))])),o=(r,a,i)=>{let s=n.get(r);if(!s.has(a))s.set(a,[]);s.get(a).push(i)};for(let r of mue(e.cfg,e.agents)){let[a,i]=due(r.key);o(a,i+(t.scoped&&r.group==="Board"?" · all projects":""),nn(gM(r.key),"row",[r.label,r.help,r.key,r.group,...r.values].join(" "),r.key,!!r.idle))}if(e.cleanup)o("general","Storage",nn("s-clean-records","cleanup","cleanup clean launch records sessions prune","records")),o("general","Storage",nn("s-clean-runs","cleanup","cleanup delete old runs prune history","runs"));if(o("keyboard","Dictation",nn("v-mic","mic","microphone input device mic dictation shortcut")),o("mobile","Phone",nn("phset","phone","phone mobile tailscale qr connect address setup")),o("mobile","Phone",nn("waset","whatsapp","whatsapp phone mobile qr message send")),o("integrations","Google",nn("gg-id","google-id","google oauth client id sheets write back")),o("integrations","Google",nn("gg-secret","google-secret","google oauth client secret")),e.research)o("integrations","Research",nn("fc-key","fc-key","firecrawl api key research web search scrape explore internet")),o("integrations","Research",nn("fc-test","fc-test","firecrawl status test remove research web search"));return o("integrations","Google",nn("gg-conn","google-conn","google account connect sheets write back")),o("appearance","Browser",nn("th","theme","theme light dark system browser")),o("appearance","Browser",nn("co","color","color colour palette monochrome blue theme browser")),o("appearance","Browser",nn("mo","motion","motion animation reduce reduced browser")),o("terminal","Browser",nn("tf","font","terminal font size text zoom browser")),o("notifications","Browser",nn("nt","notify","notifications "+t.notifyHelp+" browser")),o("notifications","Browser",nn("hp","haptic","haptic feedback vibrate vibration touch tap phone browser")),o("notifications","Browser",nn("ns","sound","notification sound audio browser",void 0,!t.notifyOn)),n}var NF=["claude","codex","gemini","agy"],vM={claude:"Claude",codex:"Codex",gemini:"Gemini CLI",agy:"Antigravity"},gue=[["core","Core"],["media","Media"],["optional","Optional"]],hue=(e)=>NF.filter((t)=>e.accounts.some((n)=>n.tool===t)||(e.normal??[]).some((n)=>n.tool===t)),RF=(e)=>NF.filter((t)=>t!=="agy").filter((t)=>t!=="gemini"||(e.normal??[]).some((n)=>n.tool===t)||e.accounts.some((n)=>n.tool===t));function TF(e,t,n,o=bM(t,n)){let r=[];if(e==="agents"&&t.agents){let a=t.agents,i=a.agents.filter((s)=>s.enabled&&s.installed);r.push({title:"Default agent",items:[nn("ag-def","agent-default","default agent auto tool launches "+i.map((s)=>s.name).join(" "))]}),r.push({title:"Permissions",items:[nn("ag-perm","agent-perm","permissions bypass yolo all agents without asking")]}),r.push({title:`Installed · ${n.agentCount} detected`,extra:"refresh",items:a.agents.map((s)=>nn("ag-"+s.cmd,"agent",[s.name,s.cmd,"agent installed command arguments environment permissions"].join(" "),s.cmd))})}if(e==="accounts"&&t.accounts){let a=t.accounts;for(let i of hue(a))r.push({title:vM[i],items:[...(a.normal??[]).filter((s)=>s.tool===i).map((s)=>nn("ac-normal-"+i,"account-normal",`account login normal default ${i} ${s.who??""}`,i)),...a.accounts.filter((s)=>s.tool===i).map((s)=>nn("ac-"+s.id,"account",`account ${s.name} ${s.tool}`,s.id))]});r.push({title:"Add an account",items:[nn("ac-add","account-add","add account sign in claude codex gemini provider")]})}if(e==="orchestration"&&t.cfg)r.push({title:"",items:[nn("orch","orchestration","orchestration workers flow plan merge review")]});if(e==="skills"&&t.skills)gue.filter(([a])=>t.skills.skills.some((i)=>i.group===a)).forEach(([a,i],s)=>r.push({title:i,extra:s?void 0:"recheck",items:t.skills.skills.filter((l)=>l.group===a).map((l)=>nn("sk-"+l.id,"skill",[l.title,l.id,l.description,l.group,"skill"].join(" "),l.id))}));if(e==="automations"){let a=t.automations;r.push({title:"Automations",items:a?[...a.rules.map((i)=>nn("au-"+i.id,"automation",["automation",i.name,i.text,i.cron].join(" "),i.id)),nn("au-form","automation-form","automation new create add schedule")]:[nn("au-none","automation-none","automation")]})}for(let[a,i]of o.get(e)??[])if(i.length)r.push({title:a,items:i});return r}function EF(e,t){let n=t.trim().toLowerCase();if(!n)return e;return e.map((o)=>o.title?{...o,items:o.items.filter((r)=>r.q.includes(n))}:o).filter((o)=>!o.title||o.items.length)}var AF=(e)=>e.some((t)=>t.title&&t.items.length);function MF(e){let t=!!e.query.trim();if(e.narrow&&t&&e.typing)return null;if(e.picked&&e.hits.includes(e.picked))return e.picked;return t||!e.narrow?e.hits[0]??null:null}var DF=(e)=>e.signedIn&&(e.who||e.via||e.plan)?[e.who??(e.via?`via ${e.via}`:""),e.plan].filter(Boolean).join(" · "):"";function PF(e,t,n=!0){if(!e)return{text:t?n?"Signed in · no usage yet":"Signed in":"Not signed in",bad:!t};if(e.expired)return{text:"Sign-in expired. Sign in again",bad:!0};if(e.error)return{text:`Usage unavailable (${e.error})`,bad:!0};return{text:`${e.five?`${e.five.pct}% of 5 hours`:""}${e.five&&e.week?" · ":""}${e.week?`${e.week.pct}% of the week`:""}`,bad:!1}}var ri=(e)=>["path",{d:e}],bue=[ri("M10 4a2 2 0 1 1 4 0v2h5v5h-2a2 2 0 1 0 0 4h2v5H5v-5h2a2 2 0 1 0 0-4H5V6h5Z")],vue={kaizen:[ri("M4 7h11M4 12h7M4 17h11"),ri("m16 11 2 2 3-4")],"kaizen-help":[["circle",{cx:12,cy:12,r:9}],ri("M9.5 9.5a2.5 2.5 0 1 1 3.8 2.1c-.9.6-1.3 1.1-1.3 2.1"),ri("M12 17h.01")],"kaizen-book":[ri("M12 6c-2-1.5-5-2-8-2v15c3 0 6 .5 8 2 2-1.5 5-2 8-2V4c-3 0-6 .5-8 2Z"),ri("M12 6v15")],"kaizen-deck":[["rect",{x:3,y:4,width:18,height:12,rx:1}],ri("M12 16v4M8 20h8M8 12l3-3 2 2 3-3")],"kaizen-computer":[["rect",{x:3,y:4,width:18,height:12,rx:1}],ri("M8 20h8M12 16v4M9 8l5 3-2 .8-.8 2Z")],"kaizen-game":[["rect",{x:2,y:7,width:20,height:11,rx:5}],ri("M7 10.5v4M5 12.5h4"),["circle",{cx:16,cy:11.5,r:0.6}],["circle",{cx:18,cy:13.5,r:0.6}]],"kaizen-video":[["rect",{x:3,y:6,width:13,height:12,rx:2}],ri("m16 10 5-3v10l-5-3")],rea:[["circle",{cx:10.5,cy:10.5,r:6}],ri("m15 15 6 6"),ri("M8.5 9 7 10.5 8.5 12M12.5 9l1.5 1.5-1.5 1.5")]},OF=(e)=>vue[e]??bue;var Ck=()=>globalThis.kaizenDesktop,Kv=()=>Ck()?"Kaizen":"kaizen",sd=me()(()=>({ver:null,later:(()=>{try{return localStorage.getItem("kz-upd-later")}catch{return null}})()})),xM=(e)=>`${Kv()} ${e.latest} is available. You are running ${e.version}. Update it from the desktop app on your computer.`,_F=(e)=>e.behind?xM(e):`${Kv()} ${e.version} is up to date.`,yM=(e)=>!!e?.update,wM=(e)=>Ck()?Ck().check():fetch(e?"/version?fresh=1":"/version").then((t)=>t.json()),kM=(e)=>sd.setState({ver:e}),SM=()=>wM(!1).then(kM,()=>{});function IF(e){try{localStorage.setItem("kz-upd-later",e)}catch{}sd.setState({later:e})}async function zF(e){let t=Ck(),n=t?{title:`Install Kaizen ${e.latest}?`,description:"The app restarts, and agents it runs stop.",confirmLabel:"Install"}:{title:`Update kaizen to ${e.latest}?`,description:"kaizen restarts, and agents it runs stop.",confirmLabel:"Update"};if(!await wn(n))return"no";if(t){let o=await t.install().catch((r)=>({ok:!1,opened:!1,error:String(r)}));if(o&&!o.ok)O(`Could not install the update: ${o.error}`);return o&&o.opened?"opened":o&&o.ok?"restarting":"no"}if(!(await K("/upgrade",{})).ok)return"no";return setTimeout(()=>location.reload(),20000),"restarting"}async function CM(){if(Ze().view!=="settings")return;let e=fr().pageGen+1;ut({pageGen:e}),la(!0);let t=!Ee().open||Ee().title!=="Settings";if(_u(),_e({openKey:null,card:null,runDoc:null}),_e({open:!0,title:"Settings",titleTip:"",head:null,tabs:[],footer:null,body:"settings"}),t)ut({typed:{},scope:"all",q:fr().startQ,back:fr().startBack,page:fr().page??xF(new URLSearchParams(location.search).get("page")??"")});id(t,()=>e!==fr().pageGen)}var Nk=h(I(),1),LF=new Map,xue=(e)=>{let t=LF.get(e);if(!t)t=fetch("/models?agent="+encodeURIComponent(e)).then((n)=>n.ok?n.json():{models:[]}).then((n)=>Array.isArray(n.models)?n.models:[]).catch(()=>[]),LF.set(e,t);return t};function BF(e,t){let[n,o]=Nk.useState([]);return Nk.useEffect(()=>{if(!t)return;let r=!0;return xue(e).then((a)=>r&&o(a)),()=>{r=!1}},[e,t]),n}var ai=me()(()=>({data:null,open:null})),HF=()=>fetch("/whats-new").then((e)=>e.ok?e.json():null).then((e)=>e&&ai.setState({data:e})).catch(()=>{}),qv=(e)=>!!e.data?.entry&&(e.open??e.data.unseen),jF=()=>{let e=ai.getState();if(qv(e))return void Rk();ai.setState({open:!0})};async function Rk(){ai.setState({open:!1});let e=ai.getState();if(!e.data?.unseen)return;if((await K("/whats-new",{})).ok)ai.setState({data:{...e.data,unseen:!1}})}var Ht=h(w(),1),yue=["claude","codex","gemini"],NM=({a:e})=>Ht.jsx("svg",{"aria-hidden":"true",children:Ht.jsx("use",{href:`#i-${yue.includes(e.agent??"")?e.agent:"ai"}`})}),RM=({st:e})=>Ht.jsx("i",{className:`si ${xp[e]}`}),UF=(e,t)=>!e?"":t-e<60000?"now":xo(e,t);function GF({rows:e,now:t,open:n,dir:o,ws:r}){if(!e.length)return null;let a=(s,l)=>(s.preventDefault(),nB(o,r,l));if(e.length===1){let s=e[0];return Ht.jsx("div",{className:"wag",children:Ht.jsxs("button",{type:"button",className:"aone",title:`${s.a.name}: open its terminal`,onClick:(l)=>a(l,s.a.key),children:[Ht.jsx(RM,{st:s.st}),Ht.jsx(NM,{a:s.a}),Ht.jsxs("span",{className:"atx",children:[ec[s.st]," - ",s.a.name]}),Ht.jsx("small",{children:UF(s.a.at,t)})]})})}let i=Ht.jsx("button",{type:"button",className:`wchev${n?" on":""}`,"aria-expanded":n,"aria-label":`${e.length} agents: ${n?"hide":"show"} the list`,onClick:(s)=>(s.preventDefault(),Z8(o,r)),children:Ht.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:Ht.jsx("path",{d:"M6 9l6 6 6-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})});if(n)return Ht.jsxs(Ht.Fragment,{children:[Ht.jsxs("div",{className:"wag",children:[Ht.jsxs("span",{className:"aht",children:[e.length," agents"]}),i]}),Ht.jsx("div",{className:"alist",children:e.map((s)=>Ht.jsxs("button",{type:"button",className:"arow",title:PT(s),onClick:(l)=>a(l,s.a.key),children:[Ht.jsx(RM,{st:s.st}),Ht.jsx(NM,{a:s.a}),Ht.jsx("span",{className:"atx",children:PT(s)}),Ht.jsx("small",{children:UF(s.a.at,t)})]},s.a.key))})]});return Ht.jsxs("div",{className:"wag",children:[Ht.jsx("span",{className:"chips",children:JL(e).map((s)=>Ht.jsxs("span",{className:"chip",children:[Ht.jsx(RM,{st:s.st}),s.rs.map((l)=>Ht.jsx("button",{type:"button",className:"amark",title:`${l.a.name} - ${ec[s.st]}: open its terminal`,"aria-label":`${l.a.name} - ${ec[s.st]}: open its terminal`,onClick:(c)=>a(c,l.a.key),children:Ht.jsx(NM,{a:l.a})},l.a.key))]},s.st))}),i]})}var oK=h(I(),1);var FF=h(I(),1);var ld=h(w(),1);function de({icon:e,label:t,active:n,size:o="md",href:r,className:a,children:i,...s}){return ld.jsxs(bk,{children:[ld.jsx(vk,{asChild:!0,children:ld.jsxs(r?"a":"button",{...r?{href:r}:{type:"button"},"aria-label":n?`${t} (on)`:t,className:N("relative grid shrink-0 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",o==="sm"?"size-(--btn-xs) max-[640px]:size-8 [&_svg]:size-(--ico)":"size-(--btn-s)",n&&"text-foreground",a),...s,children:[typeof e==="string"?ld.jsx(_,{name:e}):e,n&&ld.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1.5 size-[7px] rounded-full bg-primary shadow-[0_0_0_2px_var(--bg)]"}),i]})}),ld.jsx(xk,{children:t})]})}var _r=h(w(),1);function cd({label:e,icon:t="more",items:n,children:o,footer:r,className:a,triggerClassName:i,size:s}){return _r.jsxs(kn,{children:[_r.jsx(Sn,{asChild:!0,children:_r.jsx(de,{icon:t,label:e,className:N(s==="sm"&&"size-(--btn-xs) [&_svg]:size-4",i),onClick:(l)=>l.stopPropagation()})}),_r.jsxs(Cn,{className:N("w-[340px] max-w-[80vw] text-sm",a),onClick:(l)=>l.stopPropagation(),onKeyDown:(l)=>l.stopPropagation(),children:[o,o&&n.length>0&&_r.jsx(Wr,{}),n.map((l)=>l.href?_r.jsx(qt,{asChild:!0,children:_r.jsx("a",{href:l.href,children:_r.jsxs("span",{className:"flex min-w-0 flex-col",children:[l.label,l.hint&&_r.jsx("small",{className:"truncate font-mono text-xs text-muted-foreground",children:l.hint})]})})},l.id):_r.jsxs(FF.Fragment,{children:[l.before&&_r.jsx(Wr,{}),_r.jsxs(qt,{onSelect:l.onSelect,className:l.danger?"text-danger data-[highlighted]:text-danger":void 0,children:[l.icon&&_r.jsx(_,{name:l.icon,className:"size-[15px] shrink-0"}),l.label,l.count!=null&&_r.jsx("i",{className:"ml-auto text-xs not-italic text-muted-foreground",children:l.count})]})]},l.id)),r&&(n.length>0||o)&&_r.jsx(Wr,{}),r]})]})}var wc=h(w(),1);function jg({open:e,title:t,description:n,confirmLabel:o,danger:r,onConfirm:a,onCancel:i}){return wc.jsx(rk,{open:e,onOpenChange:(s)=>!s&&i(),children:wc.jsxs(ak,{children:[wc.jsx(Lv,{children:t}),n&&wc.jsx(Bv,{className:"whitespace-pre-line",children:n}),wc.jsxs("div",{className:"mt-1 flex justify-end gap-1.5",children:[wc.jsx(ik,{children:"Cancel"}),wc.jsx(sk,{danger:r,onClick:a,children:o})]})]})})}var KF=h(w(),1);function VF(){let e=Fm((t)=>t.open);return KF.jsx(jg,{open:!!e,title:e?.title??"",description:e?.description,confirmLabel:e?.confirmLabel??"OK",danger:e?.danger,onConfirm:()=>LR(!0),onCancel:()=>LR(!1)})}var qF=h(I(),1);var sf=h(w(),1);function ud({onFiles:e,className:t}){let n=qF.useRef(null);return sf.jsxs(sf.Fragment,{children:[sf.jsx(de,{icon:"clip",label:"Attach files",className:t,onClick:()=>n.current?.click()}),sf.jsx("input",{ref:n,type:"file",multiple:!0,hidden:!0,onChange:(o)=>{let r=[...o.target.files??[]];o.target.value="",e(r)}})]})}var Tk=h(w(),1);function kc({count:e,className:t,children:n,...o}){return Tk.jsxs(Lg,{className:N("inline-flex h-[26px] items-center gap-1.5 whitespace-nowrap rounded-sm border border-border bg-card px-2.5 text-sm text-foreground hover:bg-muted data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",t),...o,children:[n,e!=null&&Tk.jsx("i",{className:"text-xs not-italic tabular-nums opacity-75",children:e})]})}var $v=h(w(),1);function Ug(){return $v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"size-[13px] shrink-0",children:[$v.jsx("circle",{cx:"8",cy:"5.2",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),$v.jsx("path",{d:"M3 13.6c.7-2.5 2.6-3.8 5-3.8s4.3 1.3 5 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var lf=h(w(),1);function Ea({icon:e,title:t,help:n,children:o,busy:r}){return lf.jsxs("div",{role:r?"status":void 0,className:"flex flex-col items-center gap-1 px-6 py-14 text-center text-lg text-muted-foreground",children:[e&&lf.jsx(_,{name:e,className:"mb-3 size-8 opacity-60"}),lf.jsx("p",{className:"text-[16px] font-medium text-foreground",children:t}),n&&lf.jsx("span",{children:n}),o&&lf.jsx("div",{className:"mt-2",children:o})]})}var $F=h(I(),1);var Sc=h(w(),1);function Ne({id:e,label:t,help:n,error:o,inline:r,row:a,dim:i,children:s}){let l=$F.useId(),c=e??l,d=`${c}-help`,u=`${c}-err`,p=[n&&d,o&&u].filter(Boolean).join(" ")||void 0,f=s({id:c,"aria-describedby":p,"aria-invalid":o?!0:void 0},`${c}-l`),g=n&&Sc.jsx("p",{id:d,className:N("text-sm text-muted-foreground",a&&"col-start-1 text-xs leading-normal"),children:n}),m=o&&Sc.jsx("p",{id:u,role:"alert",className:"text-sm text-danger",children:o});if(a)return Sc.jsxs("div",{className:"grid min-h-11 grid-cols-[minmax(0,1fr)_auto] gap-x-6 gap-y-0.5 px-3.5 py-2.5 @max-[520px]:grid-cols-1",children:[Sc.jsx(xc,{id:`${c}-l`,htmlFor:c,className:N("self-center text-sm font-normal text-strong",i&&"opacity-50"),children:t}),Sc.jsx("div",{className:N("col-start-2 self-center justify-self-end @max-[520px]:col-start-1 @max-[520px]:row-auto @max-[520px]:mt-1.5 @max-[520px]:max-w-full @max-[520px]:justify-self-start",(n||o)&&"row-span-2",i&&"opacity-50"),children:f}),g,m]});return Sc.jsxs("div",{className:r?"flex min-w-0 items-center gap-1.5":"flex flex-col gap-1.5",children:[Sc.jsx(xc,{id:`${c}-l`,htmlFor:c,className:r?"shrink-0 text-xs text-muted-foreground":void 0,children:t}),f,g,m]})}var YF=h(I(),1);var Gg=h(w(),1);function WF({label:e,active:t,children:n,className:o}){let[r,a]=YF.useState(!1);return Gg.jsxs(eo,{open:r,onOpenChange:a,children:[Gg.jsx(to,{asChild:!0,children:Gg.jsx(de,{icon:"filter",label:e,active:t})}),Gg.jsx(no,{className:o??"flex flex-col gap-1.5 p-2",children:typeof n==="function"?n(()=>a(!1)):n})]})}var XF=h(w(),1);function Xr({inline:e,children:t,label:n}){return XF.jsx("form",{"aria-label":n,onSubmit:(o)=>o.preventDefault(),className:N("flex min-w-0 flex-col gap-2 whitespace-normal text-base [overflow-wrap:anywhere]",e&&"rounded-sm border border-primary bg-card p-3 shadow-md"),children:t})}var cf=h(I(),1);var dd=h(w(),1),wue=[0.5,0.9,1.3,0.8,0.45],kue=()=>dd.jsx("span",{"aria-hidden":"true",className:"inline-flex h-full items-center gap-0.5",children:wue.map((e,t)=>dd.jsx("i",{style:{"--w":e},className:"w-0.5 rounded-[1px] bg-current transition-[height] duration-[80ms] h-[calc(3px+12px*min(1,var(--lvl,0)*var(--w)))]"},t))});function Cc({field:e,also:t=[],className:n}){let o=cf.useId(),r=cf.useRef(null),a=cf.useRef(null),i=g0((s)=>s.st[o]??zT);if(cf.useEffect(()=>{if(!nv())return;let s=[e,...t].map((c)=>c.current).filter((c)=>!!c);a.current=s[0]??null;let l=s.map((c)=>{let d=()=>a.current=c;return c.addEventListener("focus",d),()=>c.removeEventListener("focus",d)});return()=>{if(l.forEach((c)=>c()),v0(o))la(!0)}},[]),!nv())return null;return dd.jsx("span",{ref:r,className:N("inline-flex",n),children:dd.jsx(de,{icon:i.on?dd.jsx(kue,{}):i.loading&&i.pct!=null?dd.jsxs("i",{className:"text-[10px] not-italic tabular-nums",children:[i.pct,"%"]}):"mic",label:"Dictate",className:N("size-[26px] [&_svg]:size-[15px]",(i.on||i.busy)&&"text-primary"),onClick:(s)=>{if(s.preventDefault(),s.stopPropagation(),a.current)x0({id:o,el:r.current,target:()=>a.current})}})})}var ji=h(w(),1);function Yv({at:e,size:t,total:n,onAt:o,onSize:r}){if(n<=Xw[0])return null;let a=e*t+1,i=Math.min(n,a+t-1);return ji.jsxs("div",{className:"sticky bottom-0 z-[1] flex items-center justify-end gap-2.5 border-t border-border bg-background px-3 py-2 text-sm text-muted-foreground",children:[ji.jsxs("label",{className:"mr-auto flex items-center gap-1.5",children:["Rows",ji.jsxs(It,{value:String(t),onValueChange:(s)=>r(Number(s)),children:[ji.jsx(Lt,{"aria-label":"Rows per page",size:"sm",className:"w-auto",children:ji.jsx(zt,{})}),ji.jsx(Bt,{children:Xw.map((s)=>ji.jsx(ft,{value:String(s),children:s},s))})]})]}),ji.jsxs("span",{children:[a,"–",i," of ",n]}),ji.jsx(A,{size:"sm",disabled:!e,onClick:()=>o(e-1),children:"Prev"}),ji.jsx(A,{size:"sm",disabled:i>=n,onClick:()=>o(e+1),children:"Next"})]})}var QF=h(I(),1);var oo=h(w(),1);function Ui({options:e,value:t,onChange:n,placeholder:o="Choose",label:r,className:a,groupIcons:i,open:s,onOpenChange:l,onRemove:c}){let[d,u]=QF.useState(!1),p=s??d,f=(v)=>(u(v),l?.(v)),g=e.find((v)=>v.value===t),m=(v)=>oo.jsxs(zg,{value:`${e.indexOf(v)}:${v.value}`,keywords:[v.label,v.group??"",v.search??""],onSelect:()=>{n(v.value),f(!1)},children:[v.icon,oo.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.label}),v.count!=null&&oo.jsx("i",{className:"text-xs not-italic tabular-nums text-muted-foreground",children:v.count}),v.value===t&&oo.jsx(_,{name:"check",className:"size-3.5 text-primary"}),v.removable&&c&&oo.jsx("button",{type:"button","aria-label":`Remove ${v.label}`,title:`Remove ${v.label}`,onPointerDown:(y)=>y.stopPropagation(),onClick:(y)=>{y.stopPropagation(),f(!1),c(v.value)},className:"-mr-1 grid size-5 place-items-center rounded-xs text-muted-foreground opacity-60 hover:bg-muted hover:text-foreground hover:opacity-100",children:oo.jsx(_,{name:"x",className:"size-3"})})]},v.value),x=[...new Set(e.map((v)=>v.group).filter((v)=>!!v))];return oo.jsxs(eo,{open:p,onOpenChange:f,children:[oo.jsx(to,{asChild:!0,children:oo.jsxs("button",{type:"button","aria-label":g?`${r}: ${g.label}`:r,className:N("inline-flex h-(--btn-s) max-w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-2.5 text-base hover:border-muted-foreground",!g&&"text-muted-foreground",a),children:[g?.icon,oo.jsx("span",{className:"min-w-0 truncate",children:g?.label??o}),oo.jsx(_,{name:"chev",className:"size-3 shrink-0 text-muted-foreground"})]})}),oo.jsx(no,{align:"start",className:"w-[320px]",children:oo.jsxs(Og,{filter:(v,y,b)=>b?.join(" ").toLowerCase().includes(y.trim().toLowerCase())?1:0,children:[oo.jsx(_g,{placeholder:"Search…","aria-label":`Search ${r}`}),oo.jsxs(Ig,{children:[oo.jsx(uk,{children:"Nothing matches"}),e.filter((v)=>!v.group).map(m),x.map((v)=>oo.jsx(dk,{heading:i?.[v]?oo.jsxs(oo.Fragment,{children:[i[v],v]}):v,children:e.filter((y)=>y.group===v).map(m)},v))]})]})})]})}var ZV=h(I(),1);var Nc={x:"X",tiktok:"TikTok",instagram:"Instagram",threads:"Threads"},df={client:"Client",finding:"Finding",people:"People say"},eV={casual:"Casual",fun:"Fun",helpful:"Helpful",promo:"Promo"},pd=(e)=>/^https?:\/\//i.test(String(e))?e:"#",ks=(e)=>{try{return new URL(e).hostname}catch{return e}},Aa=(e,t)=>String(e||"").toLowerCase()===String(t||"").toLowerCase(),Me=(e)=>e.dir+" "+e.id,ZF=(e)=>e.dir+" "+e.source,Ek=(e)=>[...e].reduce((t,n)=>(t*31+n.charCodeAt(0))%360,7),Ir=(e,t=Date.now())=>{let n=Math.round((t-Date.parse(e))/60000);return n<1?"just now":n<60?n+" min ago":n<1440?Math.round(n/60)+" h ago":Math.round(n/1440)+" d ago"},Sue=(e,t=new Date)=>{let n=new Date(t);if(e==="1d")n.setDate(n.getDate()+1);else if(e==="1w")n.setDate(n.getDate()+7);else if(e==="1m")n.setMonth(n.getMonth()+1);else return new Date(e+"T00:00:00");return n},tV=(e)=>e.toLocaleDateString("sv"),nV=(e,t)=>`${e>1?e+" snoozed":"Snoozed"} until ${Sue(t).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}`,oV=(e)=>{if(e.social)return"social";let t=e.url;if(t.includes("docs.google.com/spreadsheets")||t.endsWith(".csv")||t.endsWith(".tsv"))return"sheet";if(t.includes("docs.google.com/document"))return"doc";return"link"},Ak=(e)=>e?.social&&Nc[e.social]||(e?ks(e.url).replace(/^www\./,""):"")||"Other",Ss=(e,t)=>e.find((n)=>n.dir===t.dir&&n.url===t.source),ii=(e,t)=>{let n=Ss(e,t);return n?n.label||ks(n.url):ks(t.source)},TM=(e,t)=>t.status==="dismissed"?"Dismissed":t.status==="done"?"Done":t.status==="promoted"?"Promoted":t.category||Ss(e,t)?.category||Ak(Ss(e,t)||{url:t.source}),Wv=(e)=>!["promoted","dismissed","done"].includes(e.status),fa=(e)=>e.status==="new",rV=(e)=>e==="Dismissed"||e==="Done"||e==="Promoted",Mk=(e)=>(e.images||[]).filter((t)=>/^https:\/\//.test(t));function aV(e){let t="";try{let n=new URL(e);if(/^https?:$/.test(n.protocol))t=n.origin}catch{}return!t?"":e.includes("docs.google.com/spreadsheets")?"https://ssl.gstatic.com/docs/spreadsheets/favicon3.ico":e.includes("docs.google.com/document")?"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico":t+"/favicon.ico"}function iV(e){if(e.image&&/^https:\/\//i.test(e.image))return e.image;let t=/^https:\/\/(?:(?:www|old|new|m)\.)?reddit\.com\/r\/[\w-]+\/comments\/([a-z0-9]+)/i.exec(e.url);return t?`https://share.redd.it/preview/post/${t[1].toLowerCase()}`:""}var Cue=(e)=>[e.text,e.notes,e.link?.url,e.link?.title,e.link?.summary,...(e.tags??[]).map((t)=>"#"+t),e.board,e.project].filter(Boolean).join(`
|
|
96
96
|
`).toLowerCase(),uf=`
|
|
97
97
|
inbox`,JF=(e,t)=>{let n=new Map;return e.forEach((o)=>{let r=t(o);n.set(r,{it:o,n:(n.get(r)?.n||0)+1})}),n};function sV(e,t,n){let o=e.sources||[],r=(e.icebox||[]).filter((R)=>!R.asleep),a=[...r,...e.dismissed||[]],i=r.filter((R)=>R.status==="new").length,s=new Set(n.dir?[]:a.map((R)=>R.dir));if(!n.dir){for(let R of n.shown)if(n.showable.some((M)=>M.dir===R))s.add(R)}let l=(R)=>!!n.dir||!n.shown.size||n.shown.has(R.dir),c=a.filter(l),d=[...new Map((e.boards||[]).filter(l).map((R)=>[R.name.toLowerCase(),R])).values()],u=t.board===uf||t.board&&d.some((R)=>Aa(R.name,t.board))?t.board:"",p=(R)=>!u||(u===uf?!R.board:Aa(R.board,u)),f=(R)=>!t.kinds.length||t.kinds.includes(R.kind||""),g=c.filter((R)=>p(R)&&f(R)),m=JF(g,(R)=>TM(o,R)),x=t.cat&&m.has(t.cat)?t.cat:"",v=g.filter((R)=>!x||TM(o,R)===x),y=JF(v,ZF),b=t.src&&y.has(t.src)?t.src:"",k=(t.q??"").toLowerCase().split(/\s+/).filter(Boolean),S=(R)=>!k.length||k.every((M)=>Cue(R).includes(M)),C=a.filter((R)=>l(R)&&S(R)&&p(R)&&f(R)&&(x?TM(o,R)===x:R.status==="new")&&(!b||ZF(R)===b)).sort((R,M)=>(Date.parse(M.at)||0)-(Date.parse(R.at)||0));return{list:o,ice:a,waiting:i,many:s.size>1,boards:d,byCat:m,bySrc:y,filtered:C,board:u,cat:x,src:b,inProj:l,nOn:(R)=>c.filter((M)=>Wv(M)&&Aa(M.board,R.name)).length,nInbox:c.filter((R)=>Wv(R)&&!R.board).length}}function lV(e,t){let n=new Map;for(let[o,{it:r}]of t){let a=Ak(Ss(e,r)||{url:r.source});n.has(a)||n.set(a,[]),n.get(a).push([o,r])}return n}var cV=(e,t)=>e.toLowerCase().startsWith(t.toLowerCase()+":")?e.slice(t.length+1).trim():e;function uV(e,t,n){let o=e.findIndex((i)=>Me(i)===t);if(o<0||!t||!n.has(t))return t;let r=(i)=>!n.has(Me(i)),a=e.slice(o+1).find(r)??e.slice(0,o).reverse().find(r);return a?Me(a):null}function dV(e,t){let n=(i)=>t.some((s)=>s.url===i.url&&s.social),o=e.reduce((i,s)=>i+s.added,0),r=e.filter((i)=>!i.ok&&!n(i)).length,a=e.filter(n).length;return(o?`${o} new in the icebox`:"Nothing new")+(r?`, ${r} source${r===1?"":"s"} could not be read`:"")+(a?`; ${a} social for /kaizen gather`:"")}var EM=0.35;function pV(e,t){return e.filter(Wv).sort((n,o)=>(t.get(Me(n))||0)-(t.get(Me(o))||0))}var zr=(e)=>e.split(/[\\/]/).pop()||e,fV=(e,t)=>e.project||t.find((n)=>n.dir===e.dir)?.label||"";var Nue=(e)=>{try{return localStorage.getItem(e)}catch{return null}},zn=me()(()=>({data:null,loaded:!1,view:Nue("kz-ice-view")==="sort"?"sort":"cards",board:"",kinds:[],q:"",cat:"",src:"",sel:[],cur:null,open:null,armed:null,form:null,task:null,reply:null,styles:{},cap:{text:"",files:[],board:"",boardDir:null,dir:null,busy:!1},srcShow:!1,srcAdd:!1,srcKind:"link",draft:{url:"",q:"",plat:"x",label:"",cat:"",to:""},swipe:null,busy:!1,order:[],deck:[],ask:null,tick:0})),pn=zn.getState,Ma={swCard:null,srcTog:null,search:null},W=zn.setState,Lr=(e)=>W((t)=>({cap:{...t.cap,...e}})),fd=(e)=>W((t)=>({draft:{...t.draft,...e}}));var mV=h(I(),1);var DM=0,AM=!1,MM=!1;async function Cs(){if(Ze().page!=="icebox")return;if(AM){MM=!0;return}AM=!0;do{MM=!1;let e=++DM,t=await x6(P.scopeDir());if(e!==DM||Ze().page!=="icebox")continue;W({data:t,loaded:!0})}while(MM);AM=!1}function gV(){mV.useEffect(()=>{let e=()=>void Cs();e();let t=[Vr(e),Ri((n)=>n.changed,e),Zl.subscribe((n,o)=>n.shown!==o.shown&&e())];return()=>{t.forEach((n)=>n()),DM++}},[])}var hl=async()=>{P.reload(),await Cs(),requestAnimationFrame(()=>{if(!document.activeElement||document.activeElement===document.body)document.querySelector("[data-cur] [data-title]")?.focus()})},Dk=(e)=>{let t=pn();W({cur:uV(t.order,t.cur,new Set(e.map(Me)))})},PM=(e)=>[...new Set(e.map((t)=>t.dir))].map((t)=>[t,e.filter((n)=>n.dir===t)]),hV=(e)=>new Promise((t)=>W({ask:e((n)=>{W({ask:null}),t(n)})})),OM=(e="")=>hV((t)=>({kind:"collection",where:e,done:t})),Pk=(e,t,n,o=!1)=>hV((r)=>({kind:"confirm",title:e,description:t,label:n,danger:o,done:r}));async function Rc(e,t,n,o={}){if(Dk([t]),(await K("/icebox",{op:e,dir:t.dir,ids:[t.id],...o})).ok){if(e==="promote"&&pn().open===Me(t))W({open:null,armed:null,form:null});O(n)}await hl()}async function Tc(e,t){if(!e.length)return;Dk(e),W({busy:!0});let n=[];try{for(let[o,r]of PM(e))if((await K("/icebox",{op:"snooze",dir:o,ids:r.map((a)=>a.id),until:t})).ok)n.push(...r)}finally{W({busy:!1})}if(n.length){let o=new Set(n.map(Me));W((r)=>({sel:r.sel.filter((a)=>!o.has(a))})),_R(nV(n.length,t),async()=>{let r=0;for(let[a,i]of PM(n))if((await K("/icebox",{op:"unsnooze",dir:a,ids:i.map((s)=>s.id)})).ok)r++;if(r)W({cur:Me(n[0])}),O("Back in the icebox");await hl()})}await hl()}async function _M(e,t,n){if((await K("/icebox",{dir:e.dir,ids:[e.id],...t})).ok)O(n);await hl()}async function bV(e,t){if(t===`
|
|
98
98
|
`){let n=await OM();if(!n)return;if(n.client)await K("/icebox",{op:"boards",act:"add",dir:e.dir,name:n.name,client:!0});t=n.name}return _M(e,{op:"board",board:t},t?`Moved to ${t}`:"Moved to the Inbox")}async function Fg(e){let t=new Set(pn().sel),n=pn().order.filter((r)=>t.has(Me(r)));if(!n.length)return;Dk(n),W({busy:!0});let o=0;try{if(e==="dismiss")for(let[r,a]of PM(n)){let i=a.map((s)=>s.id);if((await K("/icebox",{op:e,dir:r,ids:i})).ok)o+=i.length}else for(let r of n)if((await K("/icebox",{op:e,dir:r.dir,ids:[r.id]})).ok)o++}finally{W({busy:!1})}if(W({sel:[]}),o)O(`${o} ${e==="promote"?"promoted to Tasks":"dismissed"}${o<n.length?`, ${n.length-o} not`:""}`);await hl()}async function vV(e,t){if(P.motion())await new Promise((o)=>setTimeout(o,180));P.pop(),Dk([e]);let n=await K("/icebox",{op:t,dir:e.dir,ids:[e.id]});if(n.ok)if(t==="dismiss")_R("Dismissed",async()=>{if((await K("/icebox",{op:"restore",dir:e.dir,ids:[e.id]})).ok)W({cur:Me(e)}),O("Back in the icebox");await hl()});else O("Made a task");else O(`Could not ${t}: ${n.error||"kaizen did not answer"}`);return await hl(),!!n.ok}function pf(e){let t=Me(e),n=pn();if(W({cur:t,open:t,armed:t,view:"sort",form:n.form?.k===t?n.form:{k:t,title:e.text,details:""}}),n.data?.gatherer?.connected&&n.task?.k!==t)IM(e)}async function IM(e){let t=Me(e),n=pn().form,o={title:n?.k===t?n.title:e.text,details:n?.k===t?n.details:""},r=pn().task;W({task:{k:t,wait:!0,title:r?.k===t?r.title:"",details:r?.k===t?r.details:""}});let a=await fetch("/icebox",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({op:"task-draft",dir:e.dir,ids:[e.id]})}).then((s)=>s.json()).catch(()=>({error:"kaizen did not answer"}));if(pn().task?.k!==t)return;let i=pn().form;if(a.ok&&a.title){let s=i?.k!==t||i.title===o.title&&i.details===o.details;if(i?.k===t&&s)W({task:{k:t,wait:!1,title:a.title,details:a.details||""},form:{k:t,title:a.title,details:a.details||""}});else if(i?.k===t)W({task:{k:t,wait:!1,title:i.title,details:i.details,kept:!0}});else W({task:{k:t,wait:!1,title:a.title,details:a.details||""}})}else W({task:{k:t,wait:!1,title:"",details:"",note:a.error||a.note||"ChatGPT did not answer"}})}var Ok=()=>W({armed:null});function xV(e){let t=pn().form,n=t?.k===Me(e)?t.title.trim():"";if(!n)return!1;return Rc("promote",e,"Promoted to Tasks",{text:n,details:t.details}),!0}var _k=(e)=>{let t=pn().styles;if(!t[e])try{t[e]=localStorage.getItem("kz-reply-style:"+e)||""}catch{}return t[e]||"casual"};function yV(e,t){W((n)=>({styles:{...n.styles,[e]:t}}));try{localStorage.setItem("kz-reply-style:"+e,t)}catch{}}async function wV(e){let t=Me(e);W({reply:{k:t,text:"",wait:!0}});let n=await K("/reply",{op:"draft",dir:e.dir,id:e.id,style:_k(e.dir)});if(pn().reply?.k!==t)return;W({reply:{k:t,text:n.text||"",note:n.ok?n.note||"":"",wait:!1}})}async function kV(e){let t=pn().reply;if(!t)return;W({reply:{...t,again:!0}});let n=await K("/reply",{op:"draft",dir:e.dir,id:e.id,style:_k(e.dir),avoid:t.text}),o=pn().reply;if(!o||o.k!==t.k)return;W({reply:{...o,again:!1,text:n.text||o.text,note:n.ok?n.note||"":""}})}var SV=(e)=>W((t)=>t.reply?{reply:{...t.reply,text:e}}:{}),zM=()=>W({reply:null});async function CV(e){let t=pn().reply;if(!t)return;W({reply:{...t,busy:!0}});let n=await K("/reply",{op:"send",dir:e.dir,id:e.id,text:t.text});if(n.ok)W({reply:null}),O("Reply posted");else if(n.sent)W({reply:null});else W((o)=>o.reply?{reply:{...o.reply,busy:!1}}:{});await hl()}var NV=()=>W({swipe:{n:0,pro:0,dis:0,t0:Date.now(),last:null,skip:new Map,busy:!1,pop:!1}}),Xv=()=>W({swipe:null});async function Ec(e,t){let n=pn().swipe,o=pn().deck[0];if(!n||n.busy||!o)return;let r=Me(o);if(e==="skip"){if(pn().deck.length<2)return;let l=Math.max(...pn().deck.map((c)=>n.skip.get(Me(c))||0));W({swipe:{...n,skip:new Map(n.skip).set(r,l+1)}});return}W({swipe:{...n,busy:!0}});let a=await t?.(e==="promote"?1:-1);P.pop();let i=await K("/icebox",{op:e,dir:o.dir,ids:[o.id]}),s=pn().swipe;if(s)if(i.ok)W({swipe:{...s,busy:!1,n:s.n+1,pro:s.pro+(e==="promote"?1:0),dis:s.dis+(e==="dismiss"?1:0),last:e==="dismiss"?o:null,pop:!0}});else W({swipe:{...s,busy:!1}}),a?.(),O(`Could not ${e}: ${i.error||"kaizen did not answer"}`);await hl()}async function Ik(){let e=pn().swipe,t=e?.last;if(!e||!t||e.busy)return;W({swipe:{...e,busy:!0}});let n=await K("/icebox",{op:"restore",dir:t.dir,ids:[t.id]}),o=pn().swipe;if(o)if(n.ok)W({swipe:{...o,busy:!1,n:o.n-1,dis:o.dis-1,last:null,skip:new Map(o.skip).set(Me(t),-1)}}),O("Restored");else W({swipe:{...o,busy:!1}});await hl()}function RV(e){let t="kz-ice-streak:"+(e||"all"),n=(a)=>new Date(a).toLocaleDateString("sv"),o=n(Date.now()),r={last:"",days:0};try{r=JSON.parse(localStorage.getItem(t)||"")||r}catch{}if(r.last!==o)r={last:o,days:r.last===n(Date.now()-86400000)?r.days+1:1};try{localStorage.setItem(t,JSON.stringify(r))}catch{}return r.days}async function TV(e,t){let n=pn().cap,o=n.text.trim();if(n.busy)return;if(!o){if(n.files.length)O("Write a line about it first");return t()}if(!e)return O("Pick a project first");Lr({busy:!0});let r={ok:!1};try{r=await K("/icebox",{op:"add",dir:e,text:o,board:n.board||void 0,files:await P.dataUrls(n.files)})}finally{Lr({busy:!1})}if(r.ok)Lr({text:"",files:[]}),W({cur:null}),O(`Added to the icebox${n.board?" · "+n.board:""}`),P.reload();await Cs(),t()}async function LM(e,t){if(!e)return O("Pick a project first");let n=await OM(t);if(!n)return;if((await K("/icebox",{op:"boards",act:"add",dir:e,name:n.name,client:n.client})).ok)O(`Collection ${n.name} made`),P.reload();await Cs()}async function EV(e,t){if(e===`
|