opencami 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -31
- package/dist/client/assets/{CSPContext-Bq8j4nl9.js → CSPContext-a-MQmQQt.js} +1 -1
- package/dist/client/assets/{DirectionContext-BdX86BHP.js → DirectionContext-DRcND-Cm.js} +1 -1
- package/dist/client/assets/_sessionKey-BAmpzUOP.js +23 -0
- package/dist/client/assets/agents-BkeWu_3a.js +2 -0
- package/dist/client/assets/{agents-screen-DwIY8hze.js → agents-screen-Cb76bcxn.js} +1 -1
- package/dist/client/assets/bots-CyJwr-JU.js +2 -0
- package/dist/client/assets/{bots-screen-c78I920d.js → bots-screen-CzNjLsQH.js} +1 -1
- package/dist/client/assets/{button-Dg7VFQQn.js → button-DNC5N25i.js} +1 -1
- package/dist/client/assets/{composite-DBl8R3ae.js → composite-Bliqcmg4.js} +1 -1
- package/dist/client/assets/{connect-NYvOqiBJ.js → connect-BX1MWO82.js} +1 -1
- package/dist/client/assets/{file-explorer-screen-BSMbs0vi.js → file-explorer-screen-CpY1O_ag.js} +1 -1
- package/dist/client/assets/files-HiN5rXWq.js +2 -0
- package/dist/client/assets/{index-CMATW8VA.js → index-BlC2sH55.js} +1 -1
- package/dist/client/assets/{index-rOIRO-8E.js → index-Dg0mbvtv.js} +1 -1
- package/dist/client/assets/{keyboard-shortcuts-dialog-BTGWdJMl.js → keyboard-shortcuts-dialog-C2Hq19LN.js} +1 -1
- package/dist/client/assets/{main-B_dlfHME.js → main-CEuT8-Qi.js} +14 -5
- package/dist/client/assets/{markdown-BVzT7z4x.js → markdown-DKD6ZLRJ.js} +1 -1
- package/dist/client/assets/memory-lhzf-8Q4.js +2 -0
- package/dist/client/assets/{memory-screen-C-Z9o31m.js → memory-screen-Zq9qfnJK.js} +1 -1
- package/dist/client/assets/{menu-DHNgWk_8.js → menu-47ooFeSm.js} +1 -1
- package/dist/client/assets/{opencami-logo-BQQETnJG.js → opencami-logo-DA69yVKc.js} +1 -1
- package/dist/client/assets/{owner-CpRnf1fI.js → owner-CFRNz_Tp.js} +1 -1
- package/dist/client/assets/{popupStateMapping-BRPDXnjv.js → popupStateMapping-D5k-jOeY.js} +1 -1
- package/dist/client/assets/{proxy-BcUh9kMA.js → proxy-Cawf6X0W.js} +1 -1
- package/dist/client/assets/{react-irH8OzhB.js → react-K9goXsVv.js} +1 -1
- package/dist/client/assets/{search-dialog-B96zx_ng.js → search-dialog-C5Yae9rb.js} +1 -1
- package/dist/client/assets/{session-export-dialog-DPuHnhgv.js → session-export-dialog-CBeTfbll.js} +1 -1
- package/dist/client/assets/settings-dialog-CoeG9M1b.js +1 -0
- package/dist/client/assets/skills-BEkw619A.js +2 -0
- package/dist/client/assets/{skills-panel-WDUfIwnI.js → skills-panel-DFL-3BRH.js} +1 -1
- package/dist/client/assets/styles-D4EBtWYc.css +1 -0
- package/dist/client/assets/{switch-DPocNFRG.js → switch-DAFvLxNX.js} +1 -1
- package/dist/client/assets/{tabs-B0cro1hL.js → tabs-B2Y_7MvG.js} +1 -1
- package/dist/client/assets/{tooltip-Dg9fy-vT.js → tooltip-D57Pal0B.js} +1 -1
- package/dist/client/assets/{use-file-explorer-state-DzT0bksg.js → use-file-explorer-state-DppKEjcl.js} +1 -1
- package/dist/client/assets/{useButton-Cbl_9oFG.js → useButton-DVAfkehQ.js} +1 -1
- package/dist/client/assets/{useCompositeItem-BDAzTxVe.js → useCompositeItem-CzdGhGcj.js} +1 -1
- package/dist/client/assets/{useControlled-Dscz_s4f.js → useControlled-Cl9XA2_f.js} +1 -1
- package/dist/client/assets/{useMutation-B1FlDsNN.js → useMutation-C5bTdeC1.js} +1 -1
- package/dist/client/assets/{visuallyHidden-ONmQ-0U2.js → visuallyHidden-CO3ZD5AQ.js} +1 -1
- package/dist/server/assets/{_sessionKey-B0ZlLAjH.js → _sessionKey-BBG3ZUlo.js} +279 -27
- package/dist/server/assets/{_tanstack-start-manifest_v-D5UVTs1o.js → _tanstack-start-manifest_v-DmMFarHb.js} +1 -1
- package/dist/server/assets/{index-CiUjUD0t.js → index-BgMPaOsU.js} +1 -1
- package/dist/server/assets/{router-Uuagl6O7.js → router-Bl2uabfY.js} +38 -9
- package/dist/server/assets/{search-dialog-DZTS5SEi.js → search-dialog-BtSQW9SR.js} +2 -2
- package/dist/server/assets/{settings-dialog-CSYDj2qm.js → settings-dialog-D3fOAswX.js} +11 -4
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_sessionKey-DsjnpErt.js +0 -14
- package/dist/client/assets/agents-DwxKcpP6.js +0 -2
- package/dist/client/assets/bots-CRlm-3-d.js +0 -2
- package/dist/client/assets/files-BJbMx0_w.js +0 -2
- package/dist/client/assets/memory-S3Yws6a5.js +0 -2
- package/dist/client/assets/settings-dialog-DZcRCaPj.js +0 -1
- package/dist/client/assets/skills-YZe3I63y.js +0 -2
- package/dist/client/assets/styles-Bwo-K6Y4.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-BX1MWO82.js","assets/index-BlC2sH55.js","assets/button-DNC5N25i.js","assets/react-K9goXsVv.js","assets/_sessionKey-BAmpzUOP.js","assets/visuallyHidden-CO3ZD5AQ.js","assets/tooltip-D57Pal0B.js","assets/popupStateMapping-D5k-jOeY.js","assets/useButton-DVAfkehQ.js","assets/owner-CFRNz_Tp.js","assets/DirectionContext-DRcND-Cm.js","assets/use-file-explorer-state-DppKEjcl.js","assets/composite-Bliqcmg4.js","assets/useControlled-Cl9XA2_f.js","assets/CSPContext-a-MQmQQt.js","assets/menu-47ooFeSm.js","assets/useCompositeItem-CzdGhGcj.js","assets/useMutation-C5bTdeC1.js","assets/opencami-logo-DA69yVKc.js","assets/proxy-Cawf6X0W.js","assets/markdown-DKD6ZLRJ.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function C0(a,i){for(var s=0;s<i.length;s++){const r=i[s];if(typeof r!="string"&&!Array.isArray(r)){for(const c in r)if(c!=="default"&&!(c in a)){const f=Object.getOwnPropertyDescriptor(r,c);f&&Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function z0(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var sc={exports:{}},Ui={};var Wm;function D0(){if(Wm)return Ui;Wm=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(r,c,f){var m=null;if(f!==void 0&&(m=""+f),c.key!==void 0&&(m=""+c.key),"key"in c){f={};for(var h in c)h!=="key"&&(f[h]=c[h])}else f=c;return c=f.ref,{$$typeof:a,type:r,key:m,ref:c!==void 0?c:null,props:f}}return Ui.Fragment=i,Ui.jsx=s,Ui.jsxs=s,Ui}var ty;function L0(){return ty||(ty=1,sc.exports=D0()),sc.exports}var Z=L0(),uc={exports:{}},ot={};var ey;function U0(){if(ey)return ot;ey=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),_=Symbol.iterator;function O(A){return A===null||typeof A!="object"?null:(A=_&&A[_]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,x={};function B(A,Y,k){this.props=A,this.context=Y,this.refs=x,this.updater=k||C}B.prototype.isReactComponent={},B.prototype.setState=function(A,Y){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,Y,"setState")},B.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function K(){}K.prototype=B.prototype;function Q(A,Y,k){this.props=A,this.context=Y,this.refs=x,this.updater=k||C}var G=Q.prototype=new K;G.constructor=Q,R(G,B.prototype),G.isPureReactComponent=!0;var $=Array.isArray;function I(){}var X={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function F(A,Y,k){var J=k.ref;return{$$typeof:a,type:A,key:Y,ref:J!==void 0?J:null,props:k}}function ct(A,Y){return F(A.type,Y,A.props)}function st(A){return typeof A=="object"&&A!==null&&A.$$typeof===a}function it(A){var Y={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(k){return Y[k]})}var St=/\/+/g;function rt(A,Y){return typeof A=="object"&&A!==null&&A.key!=null?it(""+A.key):Y.toString(36)}function Vt(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(I,I):(A.status="pending",A.then(function(Y){A.status==="pending"&&(A.status="fulfilled",A.value=Y)},function(Y){A.status==="pending"&&(A.status="rejected",A.reason=Y)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function N(A,Y,k,J,ut){var ht=typeof A;(ht==="undefined"||ht==="boolean")&&(A=null);var pt=!1;if(A===null)pt=!0;else switch(ht){case"bigint":case"string":case"number":pt=!0;break;case"object":switch(A.$$typeof){case a:case i:pt=!0;break;case S:return pt=A._init,N(pt(A._payload),Y,k,J,ut)}}if(pt)return ut=ut(A),pt=J===""?"."+rt(A,0):J,$(ut)?(k="",pt!=null&&(k=pt.replace(St,"$&/")+"/"),N(ut,Y,k,"",function(Je){return Je})):ut!=null&&(st(ut)&&(ut=ct(ut,k+(ut.key==null||A&&A.key===ut.key?"":(""+ut.key).replace(St,"$&/")+"/")+pt)),Y.push(ut)),1;pt=0;var Xt=J===""?".":J+":";if($(A))for(var Ut=0;Ut<A.length;Ut++)J=A[Ut],ht=Xt+rt(J,Ut),pt+=N(J,Y,k,ht,ut);else if(Ut=O(A),typeof Ut=="function")for(A=Ut.call(A),Ut=0;!(J=A.next()).done;)J=J.value,ht=Xt+rt(J,Ut++),pt+=N(J,Y,k,ht,ut);else if(ht==="object"){if(typeof A.then=="function")return N(Vt(A),Y,k,J,ut);throw Y=String(A),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return pt}function P(A,Y,k){if(A==null)return A;var J=[],ut=0;return N(A,J,"","",function(ht){return Y.call(k,ht,ut++)}),J}function lt(A){if(A._status===-1){var Y=A._result;Y=Y(),Y.then(function(k){(A._status===0||A._status===-1)&&(A._status=1,A._result=k)},function(k){(A._status===0||A._status===-1)&&(A._status=2,A._result=k)}),A._status===-1&&(A._status=0,A._result=Y)}if(A._status===1)return A._result.default;throw A._result}var Tt=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},At={map:P,forEach:function(A,Y,k){P(A,function(){Y.apply(this,arguments)},k)},count:function(A){var Y=0;return P(A,function(){Y++}),Y},toArray:function(A){return P(A,function(Y){return Y})||[]},only:function(A){if(!st(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ot.Activity=v,ot.Children=At,ot.Component=B,ot.Fragment=s,ot.Profiler=c,ot.PureComponent=Q,ot.StrictMode=r,ot.Suspense=y,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,ot.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.H.useMemoCache(A)}},ot.cache=function(A){return function(){return A.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(A,Y,k){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var J=R({},A.props),ut=A.key;if(Y!=null)for(ht in Y.key!==void 0&&(ut=""+Y.key),Y)!V.call(Y,ht)||ht==="key"||ht==="__self"||ht==="__source"||ht==="ref"&&Y.ref===void 0||(J[ht]=Y[ht]);var ht=arguments.length-2;if(ht===1)J.children=k;else if(1<ht){for(var pt=Array(ht),Xt=0;Xt<ht;Xt++)pt[Xt]=arguments[Xt+2];J.children=pt}return F(A.type,ut,J)},ot.createContext=function(A){return A={$$typeof:m,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:f,_context:A},A},ot.createElement=function(A,Y,k){var J,ut={},ht=null;if(Y!=null)for(J in Y.key!==void 0&&(ht=""+Y.key),Y)V.call(Y,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ut[J]=Y[J]);var pt=arguments.length-2;if(pt===1)ut.children=k;else if(1<pt){for(var Xt=Array(pt),Ut=0;Ut<pt;Ut++)Xt[Ut]=arguments[Ut+2];ut.children=Xt}if(A&&A.defaultProps)for(J in pt=A.defaultProps,pt)ut[J]===void 0&&(ut[J]=pt[J]);return F(A,ht,ut)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(A){return{$$typeof:h,render:A}},ot.isValidElement=st,ot.lazy=function(A){return{$$typeof:S,_payload:{_status:-1,_result:A},_init:lt}},ot.memo=function(A,Y){return{$$typeof:p,type:A,compare:Y===void 0?null:Y}},ot.startTransition=function(A){var Y=X.T,k={};X.T=k;try{var J=A(),ut=X.S;ut!==null&&ut(k,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(I,Tt)}catch(ht){Tt(ht)}finally{Y!==null&&k.types!==null&&(Y.types=k.types),X.T=Y}},ot.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},ot.use=function(A){return X.H.use(A)},ot.useActionState=function(A,Y,k){return X.H.useActionState(A,Y,k)},ot.useCallback=function(A,Y){return X.H.useCallback(A,Y)},ot.useContext=function(A){return X.H.useContext(A)},ot.useDebugValue=function(){},ot.useDeferredValue=function(A,Y){return X.H.useDeferredValue(A,Y)},ot.useEffect=function(A,Y){return X.H.useEffect(A,Y)},ot.useEffectEvent=function(A){return X.H.useEffectEvent(A)},ot.useId=function(){return X.H.useId()},ot.useImperativeHandle=function(A,Y,k){return X.H.useImperativeHandle(A,Y,k)},ot.useInsertionEffect=function(A,Y){return X.H.useInsertionEffect(A,Y)},ot.useLayoutEffect=function(A,Y){return X.H.useLayoutEffect(A,Y)},ot.useMemo=function(A,Y){return X.H.useMemo(A,Y)},ot.useOptimistic=function(A,Y){return X.H.useOptimistic(A,Y)},ot.useReducer=function(A,Y,k){return X.H.useReducer(A,Y,k)},ot.useRef=function(A){return X.H.useRef(A)},ot.useState=function(A){return X.H.useState(A)},ot.useSyncExternalStore=function(A,Y,k){return X.H.useSyncExternalStore(A,Y,k)},ot.useTransition=function(){return X.H.useTransition()},ot.version="19.2.4",ot}var ny;function Fi(){return ny||(ny=1,uc.exports=U0()),uc.exports}var nt=Fi();const Bl=z0(nt),N0=C0({__proto__:null,default:Bl},[nt]);var rc={exports:{}},Ni={},oc={exports:{}},cc={};var ay;function j0(){return ay||(ay=1,(function(a){function i(N,P){var lt=N.length;N.push(P);t:for(;0<lt;){var Tt=lt-1>>>1,At=N[Tt];if(0<c(At,P))N[Tt]=P,N[lt]=At,lt=Tt;else break t}}function s(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var P=N[0],lt=N.pop();if(lt!==P){N[0]=lt;t:for(var Tt=0,At=N.length,A=At>>>1;Tt<A;){var Y=2*(Tt+1)-1,k=N[Y],J=Y+1,ut=N[J];if(0>c(k,lt))J<At&&0>c(ut,k)?(N[Tt]=ut,N[J]=lt,Tt=J):(N[Tt]=k,N[Y]=lt,Tt=Y);else if(J<At&&0>c(ut,lt))N[Tt]=ut,N[J]=lt,Tt=J;else break t}}return P}function c(N,P){var lt=N.sortIndex-P.sortIndex;return lt!==0?lt:N.id-P.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,h=m.now();a.unstable_now=function(){return m.now()-h}}var y=[],p=[],S=1,v=null,_=3,O=!1,C=!1,R=!1,x=!1,B=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function G(N){for(var P=s(p);P!==null;){if(P.callback===null)r(p);else if(P.startTime<=N)r(p),P.sortIndex=P.expirationTime,i(y,P);else break;P=s(p)}}function $(N){if(R=!1,G(N),!C)if(s(y)!==null)C=!0,I||(I=!0,it());else{var P=s(p);P!==null&&Vt($,P.startTime-N)}}var I=!1,X=-1,V=5,F=-1;function ct(){return x?!0:!(a.unstable_now()-F<V)}function st(){if(x=!1,I){var N=a.unstable_now();F=N;var P=!0;try{t:{C=!1,R&&(R=!1,K(X),X=-1),O=!0;var lt=_;try{e:{for(G(N),v=s(y);v!==null&&!(v.expirationTime>N&&ct());){var Tt=v.callback;if(typeof Tt=="function"){v.callback=null,_=v.priorityLevel;var At=Tt(v.expirationTime<=N);if(N=a.unstable_now(),typeof At=="function"){v.callback=At,G(N),P=!0;break e}v===s(y)&&r(y),G(N)}else r(y);v=s(y)}if(v!==null)P=!0;else{var A=s(p);A!==null&&Vt($,A.startTime-N),P=!1}}break t}finally{v=null,_=lt,O=!1}P=void 0}}finally{P?it():I=!1}}}var it;if(typeof Q=="function")it=function(){Q(st)};else if(typeof MessageChannel<"u"){var St=new MessageChannel,rt=St.port2;St.port1.onmessage=st,it=function(){rt.postMessage(null)}}else it=function(){B(st,0)};function Vt(N,P){X=B(function(){N(a.unstable_now())},P)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(N){N.callback=null},a.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<N?Math.floor(1e3/N):5},a.unstable_getCurrentPriorityLevel=function(){return _},a.unstable_next=function(N){switch(_){case 1:case 2:case 3:var P=3;break;default:P=_}var lt=_;_=P;try{return N()}finally{_=lt}},a.unstable_requestPaint=function(){x=!0},a.unstable_runWithPriority=function(N,P){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var lt=_;_=N;try{return P()}finally{_=lt}},a.unstable_scheduleCallback=function(N,P,lt){var Tt=a.unstable_now();switch(typeof lt=="object"&<!==null?(lt=lt.delay,lt=typeof lt=="number"&&0<lt?Tt+lt:Tt):lt=Tt,N){case 1:var At=-1;break;case 2:At=250;break;case 5:At=1073741823;break;case 4:At=1e4;break;default:At=5e3}return At=lt+At,N={id:S++,callback:P,priorityLevel:N,startTime:lt,expirationTime:At,sortIndex:-1},lt>Tt?(N.sortIndex=lt,i(p,N),s(y)===null&&N===s(p)&&(R?(K(X),X=-1):R=!0,Vt($,lt-Tt))):(N.sortIndex=At,i(y,N),C||O||(C=!0,I||(I=!0,it()))),N},a.unstable_shouldYield=ct,a.unstable_wrapCallback=function(N){var P=_;return function(){var lt=_;_=P;try{return N.apply(this,arguments)}finally{_=lt}}}})(cc)),cc}var ly;function B0(){return ly||(ly=1,oc.exports=j0()),oc.exports}var fc={exports:{}},re={};var iy;function H0(){if(iy)return re;iy=1;var a=Fi();function i(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)p+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(y,p,S){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:y,containerInfo:p,implementation:S}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return re.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,re.createPortal=function(y,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(i(299));return f(y,p,null,S)},re.flushSync=function(y){var p=m.T,S=r.p;try{if(m.T=null,r.p=2,y)return y()}finally{m.T=p,r.p=S,r.d.f()}},re.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(y,p))},re.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},re.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var S=p.as,v=h(S,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,O=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;S==="style"?r.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:_,fetchPriority:O}):S==="script"&&r.d.X(y,{crossOrigin:v,integrity:_,fetchPriority:O,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},re.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var S=h(p.as,p.crossOrigin);r.d.M(y,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(y)},re.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var S=p.as,v=h(S,p.crossOrigin);r.d.L(y,S,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},re.preloadModule=function(y,p){if(typeof y=="string")if(p){var S=h(p.as,p.crossOrigin);r.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(y)},re.requestFormReset=function(y){r.d.r(y)},re.unstable_batchedUpdates=function(y,p){return y(p)},re.useFormState=function(y,p,S){return m.H.useFormState(y,p,S)},re.useFormStatus=function(){return m.H.useHostTransitionStatus()},re.version="19.2.4",re}var sy;function $y(){if(sy)return fc.exports;sy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),fc.exports=H0(),fc.exports}var uy;function q0(){if(uy)return Ni;uy=1;var a=B0(),i=Fi(),s=$y();function r(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function m(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function h(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function y(t){if(f(t)!==t)throw Error(r(188))}function p(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(r(188));return e!==t?null:t}for(var n=t,l=e;;){var u=n.return;if(u===null)break;var o=u.alternate;if(o===null){if(l=u.return,l!==null){n=l;continue}break}if(u.child===o.child){for(o=u.child;o;){if(o===n)return y(u),t;if(o===l)return y(u),e;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=u,l=o;else{for(var d=!1,g=u.child;g;){if(g===n){d=!0,n=u,l=o;break}if(g===l){d=!0,l=u,n=o;break}g=g.sibling}if(!d){for(g=o.child;g;){if(g===n){d=!0,n=o,l=u;break}if(g===l){d=!0,l=o,n=u;break}g=g.sibling}if(!d)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?t:e}function S(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=S(t),e!==null)return e;t=t.sibling}return null}var v=Object.assign,_=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),ct=Symbol.for("react.memo_cache_sentinel"),st=Symbol.iterator;function it(t){return t===null||typeof t!="object"?null:(t=st&&t[st]||t["@@iterator"],typeof t=="function"?t:null)}var St=Symbol.for("react.client.reference");function rt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===St?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case B:return"Profiler";case x:return"StrictMode";case $:return"Suspense";case I:return"SuspenseList";case F:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case Q:return t.displayName||"Context";case K:return(t._context.displayName||"Context")+".Consumer";case G:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return e=t.displayName||null,e!==null?e:rt(t.type)||"Memo";case V:e=t._payload,t=t._init;try{return rt(t(e))}catch{}}return null}var Vt=Array.isArray,N=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt={pending:!1,data:null,method:null,action:null},Tt=[],At=-1;function A(t){return{current:t}}function Y(t){0>At||(t.current=Tt[At],Tt[At]=null,At--)}function k(t,e){At++,Tt[At]=t.current,t.current=e}var J=A(null),ut=A(null),ht=A(null),pt=A(null);function Xt(t,e){switch(k(ht,e),k(ut,t),k(J,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Em(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Em(e),t=Rm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(J),k(J,t)}function Ut(){Y(J),Y(ut),Y(ht)}function Je(t){t.memoizedState!==null&&k(pt,t);var e=J.current,n=Rm(e,t.type);e!==n&&(k(ut,t),k(J,n))}function ln(t){ut.current===t&&(Y(J),Y(ut)),pt.current===t&&(Y(pt),Ci._currentValue=lt)}var Ya,ql;function sn(t){if(Ya===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Ya=e&&e[1]||"",ql=-1<n.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Ya+t+ql}var Qa=!1;function Ga(t,e){if(!t||Qa)return"";Qa=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(e){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(U){var L=U}Reflect.construct(t,[],q)}else{try{q.call()}catch(U){L=U}t.call(q.prototype)}}else{try{throw Error()}catch(U){L=U}(q=t())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(U){if(U&&L&&typeof U.stack=="string")return[U.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),d=o[0],g=o[1];if(d&&g){var E=d.split(`
|
|
@@ -15,7 +15,7 @@ Error generating stack: `+l.message+`
|
|
|
15
15
|
`)}else{const p=c.indexOf(`
|
|
16
16
|
`);if(p>=0){const S=c.slice(0,p).trim();c=c.slice(p+1),S.length>0&&(m=JSON.parse(S),f=!0)}}}return(async()=>{try{for(;;){const{value:h,done:y}=await r.read();h&&(c+=h);const p=c.lastIndexOf(`
|
|
17
17
|
`);if(p>=0){const S=c.slice(0,p);c=c.slice(p+1);const v=S.split(`
|
|
18
|
-
`).filter(Boolean);for(const _ of v)try{i(JSON.parse(_))}catch(O){s?.(`Invalid JSON line: ${_}`,O)}}if(y)break}}catch(h){s?.("Stream processing error:",h)}})(),i(m)}async function JE({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const m=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:y}=await r.read();if(y)break;if(h)try{i(JSON.parse(h))}catch(p){s?.(`Invalid JSON: ${h}`,p)}}}catch(h){s?.("Stream processing error:",h)}})(),i(m)}function $E(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=eg()?.serverFns?.fetch;return ZE(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[Lc]:!0})}const IE={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(Lc in a)?!1:!!a[Lc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>$E(a)};var Vu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},WE={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},tR=class{#t=WE;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Uc=new tR;function eR(a){setTimeout(a,0)}var Xu=typeof window>"u"||"Deno"in globalThis;function ke(){}function nR(a,i){return typeof a=="function"?a(i):a}function aR(a){return typeof a=="number"&&a>=0&&a!==1/0}function lR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Nc(a,i){return typeof a=="function"?a(i):a}function iR(a,i){return typeof a=="function"?a(i):a}function Gy(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:m,stale:h}=a;if(m){if(r){if(i.queryHash!==Wc(m,i.options))return!1}else if(!ki(i.queryKey,m))return!1}if(s!=="all"){const y=i.isActive();if(s==="active"&&!y||s==="inactive"&&y)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Vy(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Pi(i.options.mutationKey)!==Pi(f))return!1}else if(!ki(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function Wc(a,i){return(i?.queryKeyHashFn||Pi)(a)}function Pi(a){return JSON.stringify(a,(i,s)=>jc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function ki(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>ki(a[s],i[s])):!1}var sR=Object.prototype.hasOwnProperty;function ig(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Xy(a)&&Xy(i);if(!r&&!(jc(a)&&jc(i)))return i;const f=(r?a:Object.keys(a)).length,m=r?i:Object.keys(i),h=m.length,y=r?new Array(h):{};let p=0;for(let S=0;S<h;S++){const v=r?S:m[S],_=a[v],O=i[v];if(_===O){y[v]=_,(r?S<f:sR.call(a,v))&&p++;continue}if(_===null||O===null||typeof _!="object"||typeof O!="object"){y[v]=O;continue}const C=ig(_,O,s+1);y[v]=C,C===_&&p++}return f===h&&p===f?a:y}function O2(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Xy(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function jc(a){if(!Ky(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!Ky(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function Ky(a){return Object.prototype.toString.call(a)==="[object Object]"}function uR(a){return new Promise(i=>{Uc.setTimeout(i,a)})}function rR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?ig(a,i):i}function oR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function cR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var tf=Symbol();function sg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===tf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function M2(a,i){return typeof a=="function"?a(...i):!!a}function fR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var dR=class extends Vu{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Xu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ug=new dR;function hR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var mR=eR;function yR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=mR;const f=h=>{i?a.push(h):c(()=>{s(h)})},m=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(y=>{s(y)})})})};return{batch:h=>{let y;i++;try{y=h()}finally{i--,i||m()}return y},batchCalls:h=>(...y)=>{f(()=>{h(...y)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var de=yR(),pR=class extends Vu{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Xu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},Uu=new pR;function gR(a){return Math.min(1e3*2**a,3e4)}function rg(a){return(a??"online")==="online"?Uu.isOnline():!0}var Bc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function og(a){let i=!1,s=0,r;const c=hR(),f=()=>c.status!=="pending",m=R=>{if(!f()){const x=new Bc(R);_(x),a.onCancel?.(x)}},h=()=>{i=!0},y=()=>{i=!1},p=()=>ug.isFocused()&&(a.networkMode==="always"||Uu.isOnline())&&a.canRun(),S=()=>rg(a.networkMode)&&a.canRun(),v=R=>{f()||(r?.(),c.resolve(R))},_=R=>{f()||(r?.(),c.reject(R))},O=()=>new Promise(R=>{r=x=>{(f()||p())&&R(x)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),C=()=>{if(f())return;let R;const x=s===0?a.initialPromise:void 0;try{R=x??a.fn()}catch(B){R=Promise.reject(B)}Promise.resolve(R).then(v).catch(B=>{if(f())return;const K=a.retry??(Xu?0:3),Q=a.retryDelay??gR,G=typeof Q=="function"?Q(s,B):Q,$=K===!0||typeof K=="number"&&s<K||typeof K=="function"&&K(s,B);if(i||!$){_(B);return}s++,a.onFail?.(s,B),uR(G).then(()=>p()?void 0:O()).then(()=>{i?_(B):C()})})};return{promise:c,status:()=>c.status,cancel:m,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:y,canStart:S,start:()=>(S()?C():O().then(C),c)}}var cg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),aR(this.gcTime)&&(this.#t=Uc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Xu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Uc.clearTimeout(this.#t),this.#t=void 0)}},vR=class extends cg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=Py(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Py(this.options);i.data!==void 0&&(this.setState(Zy(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=rR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(ke).catch(ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>iR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Nc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!lR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=sg(this.options,i),p=(()=>{const S={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(S),S})();return this.#u=!1,this.options.persister?this.options.persister(h,p,this):h(p)},m=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(m,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#i({type:"fetch",meta:m.fetchOptions?.meta}),this.#a=og({initialPromise:i?.initialPromise,fn:m.fetchFn,onCancel:h=>{h instanceof Bc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,y)=>{this.#i({type:"failed",failureCount:h,error:y})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Bc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...SR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...Zy(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),de.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function SR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function Zy(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Py(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ky(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],m=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},y=0;const p=async()=>{let S=!1;const v=C=>{fR(C,()=>i.signal,()=>S=!0)},_=sg(i.options,i.fetchOptions),O=async(C,R,x)=>{if(S)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const K=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:R,direction:x?"backward":"forward",meta:i.options.meta};return v(I),I})(),Q=await _(K),{maxPages:G}=i.options,$=x?cR:oR;return{pages:$(C.pages,Q,G),pageParams:$(C.pageParams,R,G)}};if(c&&f.length){const C=c==="backward",R=C?bR:Fy,x={pages:f,pageParams:m},B=R(r,x);h=await O(x,B,C)}else{const C=a??f.length;do{const R=y===0?m[0]??r.initialPageParam:Fy(r,h);if(y>0&&R==null)break;h=await O(h,R),y++}while(y<C)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(p,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=p}}}function Fy(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function bR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var _R=class extends cg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||ER(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=og({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const m=await this.options.onMutate?.(a,s);m!==this.state.context&&this.#a({type:"pending",context:m,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(m){Promise.reject(m)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(m){Promise.reject(m)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),de.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function ER(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var RR=class extends Vu{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new _R({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Su(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Su(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Su(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Su(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){de.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Vy(i,s))}findAll(a={}){return this.getAll().filter(i=>Vy(a,i))}notify(a){de.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return de.batch(()=>Promise.all(a.map(i=>i.continue().catch(ke))))}};function Su(a){return a.options.scope?.id}var TR=class extends Vu{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??Wc(r,i);let f=this.get(c);return f||(f=new vR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){de.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Gy(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>Gy(a,s)):i}notify(a){de.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){de.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){de.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},wR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new TR,this.#n=a.mutationCache||new RR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=ug.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=Uu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Nc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,m=nR(i,f);if(m!==void 0)return this.#t.build(this,r).setData(m,{...s,manual:!0})}setQueriesData(a,i,s){return de.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;de.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return de.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=de.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(ke).catch(ke)}invalidateQueries(a,i={}){return de.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=de.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(ke)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(ke)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Nc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(ke).catch(ke)}fetchInfiniteQuery(a){return a.behavior=ky(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(ke).catch(ke)}ensureInfiniteQueryData(a){return a.behavior=ky(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return Uu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Pi(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{ki(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Pi(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{ki(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=Wc(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===tf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},fg=nt.createContext(void 0),x2=a=>{const i=nt.useContext(fg);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},AR=({client:a,children:i})=>(nt.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(fg.Provider,{value:a,children:i}));const OR="/assets/styles-Bwo-K6Y4.css",MR=`
|
|
18
|
+
`).filter(Boolean);for(const _ of v)try{i(JSON.parse(_))}catch(O){s?.(`Invalid JSON line: ${_}`,O)}}if(y)break}}catch(h){s?.("Stream processing error:",h)}})(),i(m)}async function JE({jsonStream:a,onMessage:i,onError:s}){const r=a.getReader(),{value:c,done:f}=await r.read();if(f||!c)throw new Error("Stream ended before first object");const m=JSON.parse(c);return(async()=>{try{for(;;){const{value:h,done:y}=await r.read();if(y)break;if(h)try{i(JSON.parse(h))}catch(p){s?.(`Invalid JSON: ${h}`,p)}}}catch(h){s?.("Stream processing error:",h)}})(),i(m)}function $E(a){const i="/_serverFn/"+a;return Object.assign((...c)=>{const f=eg()?.serverFns?.fetch;return ZE(i,c,f??fetch)},{url:i,serverFnMeta:{id:a},[Lc]:!0})}const IE={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(Lc in a)?!1:!!a[Lc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>$E(a)};var Vu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},WE={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},tR=class{#t=WE;#n=!1;setTimeoutProvider(a){this.#t=a}setTimeout(a,i){return this.#t.setTimeout(a,i)}clearTimeout(a){this.#t.clearTimeout(a)}setInterval(a,i){return this.#t.setInterval(a,i)}clearInterval(a){this.#t.clearInterval(a)}},Uc=new tR;function eR(a){setTimeout(a,0)}var Xu=typeof window>"u"||"Deno"in globalThis;function ke(){}function nR(a,i){return typeof a=="function"?a(i):a}function aR(a){return typeof a=="number"&&a>=0&&a!==1/0}function lR(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Nc(a,i){return typeof a=="function"?a(i):a}function iR(a,i){return typeof a=="function"?a(i):a}function Gy(a,i){const{type:s="all",exact:r,fetchStatus:c,predicate:f,queryKey:m,stale:h}=a;if(m){if(r){if(i.queryHash!==Wc(m,i.options))return!1}else if(!ki(i.queryKey,m))return!1}if(s!=="all"){const y=i.isActive();if(s==="active"&&!y||s==="inactive"&&y)return!1}return!(typeof h=="boolean"&&i.isStale()!==h||c&&c!==i.state.fetchStatus||f&&!f(i))}function Vy(a,i){const{exact:s,status:r,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(s){if(Pi(i.options.mutationKey)!==Pi(f))return!1}else if(!ki(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||c&&!c(i))}function Wc(a,i){return(i?.queryKeyHashFn||Pi)(a)}function Pi(a){return JSON.stringify(a,(i,s)=>jc(s)?Object.keys(s).sort().reduce((r,c)=>(r[c]=s[c],r),{}):s)}function ki(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>ki(a[s],i[s])):!1}var sR=Object.prototype.hasOwnProperty;function ig(a,i,s=0){if(a===i)return a;if(s>500)return i;const r=Xy(a)&&Xy(i);if(!r&&!(jc(a)&&jc(i)))return i;const f=(r?a:Object.keys(a)).length,m=r?i:Object.keys(i),h=m.length,y=r?new Array(h):{};let p=0;for(let S=0;S<h;S++){const v=r?S:m[S],_=a[v],O=i[v];if(_===O){y[v]=_,(r?S<f:sR.call(a,v))&&p++;continue}if(_===null||O===null||typeof _!="object"||typeof O!="object"){y[v]=O;continue}const C=ig(_,O,s+1);y[v]=C,C===_&&p++}return f===h&&p===f?a:y}function O2(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function Xy(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function jc(a){if(!Ky(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!Ky(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function Ky(a){return Object.prototype.toString.call(a)==="[object Object]"}function uR(a){return new Promise(i=>{Uc.setTimeout(i,a)})}function rR(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?ig(a,i):i}function oR(a,i,s=0){const r=[...a,i];return s&&r.length>s?r.slice(1):r}function cR(a,i,s=0){const r=[i,...a];return s&&r.length>s?r.slice(0,-1):r}var tf=Symbol();function sg(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===tf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function M2(a,i){return typeof a=="function"?a(...i):!!a}function fR(a,i,s){let r=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),r||(r=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),a}var dR=class extends Vu{#t;#n;#e;constructor(){super(),this.#e=a=>{if(!Xu&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#t!==a&&(this.#t=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ug=new dR;function hR(){let a,i;const s=new Promise((c,f)=>{a=c,i=f});s.status="pending",s.catch(()=>{});function r(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{r({status:"fulfilled",value:c}),a(c)},s.reject=c=>{r({status:"rejected",reason:c}),i(c)},s}var mR=eR;function yR(){let a=[],i=0,s=h=>{h()},r=h=>{h()},c=mR;const f=h=>{i?a.push(h):c(()=>{s(h)})},m=()=>{const h=a;a=[],h.length&&c(()=>{r(()=>{h.forEach(y=>{s(y)})})})};return{batch:h=>{let y;i++;try{y=h()}finally{i--,i||m()}return y},batchCalls:h=>(...y)=>{f(()=>{h(...y)})},schedule:f,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{c=h}}}var de=yR(),pR=class extends Vu{#t=!0;#n;#e;constructor(){super(),this.#e=a=>{if(!Xu&&window.addEventListener){const i=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#n||this.setEventListener(this.#e)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(a){this.#e=a,this.#n?.(),this.#n=a(this.setOnline.bind(this))}setOnline(a){this.#t!==a&&(this.#t=a,this.listeners.forEach(s=>{s(a)}))}isOnline(){return this.#t}},Uu=new pR;function gR(a){return Math.min(1e3*2**a,3e4)}function rg(a){return(a??"online")==="online"?Uu.isOnline():!0}var Bc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function og(a){let i=!1,s=0,r;const c=hR(),f=()=>c.status!=="pending",m=R=>{if(!f()){const x=new Bc(R);_(x),a.onCancel?.(x)}},h=()=>{i=!0},y=()=>{i=!1},p=()=>ug.isFocused()&&(a.networkMode==="always"||Uu.isOnline())&&a.canRun(),S=()=>rg(a.networkMode)&&a.canRun(),v=R=>{f()||(r?.(),c.resolve(R))},_=R=>{f()||(r?.(),c.reject(R))},O=()=>new Promise(R=>{r=x=>{(f()||p())&&R(x)},a.onPause?.()}).then(()=>{r=void 0,f()||a.onContinue?.()}),C=()=>{if(f())return;let R;const x=s===0?a.initialPromise:void 0;try{R=x??a.fn()}catch(B){R=Promise.reject(B)}Promise.resolve(R).then(v).catch(B=>{if(f())return;const K=a.retry??(Xu?0:3),Q=a.retryDelay??gR,G=typeof Q=="function"?Q(s,B):Q,$=K===!0||typeof K=="number"&&s<K||typeof K=="function"&&K(s,B);if(i||!$){_(B);return}s++,a.onFail?.(s,B),uR(G).then(()=>p()?void 0:O()).then(()=>{i?_(B):C()})})};return{promise:c,status:()=>c.status,cancel:m,continue:()=>(r?.(),c),cancelRetry:h,continueRetry:y,canStart:S,start:()=>(S()?C():O().then(C),c)}}var cg=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),aR(this.gcTime)&&(this.#t=Uc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Xu?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Uc.clearTimeout(this.#t),this.#t=void 0)}},vR=class extends cg{#t;#n;#e;#l;#a;#s;#u;constructor(a){super(),this.#u=!1,this.#s=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#l=a.client,this.#e=this.#l.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#t=Py(this.options),this.state=a.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#s,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Py(this.options);i.data!==void 0&&(this.setState(Zy(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#e.remove(this)}setData(a,i){const s=rR(this.state.data,a,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(a,i){this.#i({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(ke).catch(ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(a=>iR(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Nc(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!lR(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#u?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#u=!0,s.signal)})},c=()=>{const h=sg(this.options,i),p=(()=>{const S={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(S),S})();return this.#u=!1,this.options.persister?this.options.persister(h,p,this):h(p)},m=(()=>{const h={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:c};return r(h),h})();this.options.behavior?.onFetch(m,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#i({type:"fetch",meta:m.fetchOptions?.meta}),this.#a=og({initialPromise:i?.initialPromise,fn:m.fetchFn,onCancel:h=>{h instanceof Bc&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(h,y)=>{this.#i({type:"failed",failureCount:h,error:y})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#e.config.onSuccess?.(h,this),this.#e.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Bc){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#e.config.onError?.(h,this),this.#e.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(a){const i=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...SR(s.data,this.options),fetchMeta:a.meta??null};case"success":const r={...s,...Zy(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=a.manual?r:void 0,r;case"error":const c=a.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=i(this.state),de.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:a})})}};function SR(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rg(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function Zy(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Py(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,r=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ky(a){return{onFetch:(i,s)=>{const r=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],m=i.state.data?.pageParams||[];let h={pages:[],pageParams:[]},y=0;const p=async()=>{let S=!1;const v=C=>{fR(C,()=>i.signal,()=>S=!0)},_=sg(i.options,i.fetchOptions),O=async(C,R,x)=>{if(S)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const K=(()=>{const I={client:i.client,queryKey:i.queryKey,pageParam:R,direction:x?"backward":"forward",meta:i.options.meta};return v(I),I})(),Q=await _(K),{maxPages:G}=i.options,$=x?cR:oR;return{pages:$(C.pages,Q,G),pageParams:$(C.pageParams,R,G)}};if(c&&f.length){const C=c==="backward",R=C?bR:Fy,x={pages:f,pageParams:m},B=R(r,x);h=await O(x,B,C)}else{const C=a??f.length;do{const R=y===0?m[0]??r.initialPageParam:Fy(r,h);if(y>0&&R==null)break;h=await O(h,R),y++}while(y<C)}return h};i.options.persister?i.fetchFn=()=>i.options.persister?.(p,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=p}}}function Fy(a,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?a.getNextPageParam(i[r],i,s[r],s):void 0}function bR(a,{pages:i,pageParams:s}){return i.length>0?a.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var _R=class extends cg{#t;#n;#e;#l;constructor(a){super(),this.#t=a.client,this.mutationId=a.mutationId,this.#e=a.mutationCache,this.#n=[],this.state=a.state||ER(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#n.includes(a)||(this.#n.push(a),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#n=this.#n.filter(i=>i!==a),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=og({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",c=!this.#l.canStart();try{if(r)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#e.config.onMutate&&await this.#e.config.onMutate(a,this,s);const m=await this.options.onMutate?.(a,s);m!==this.state.context&&this.#a({type:"pending",context:m,variables:a,isPaused:c})}const f=await this.#l.start();return await this.#e.config.onSuccess?.(f,a,this.state.context,this,s),await this.options.onSuccess?.(f,a,this.state.context,s),await this.#e.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,a,this.state.context,s),this.#a({type:"success",data:f}),f}catch(f){try{await this.#e.config.onError?.(f,a,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onError?.(f,a,this.state.context,s)}catch(m){Promise.reject(m)}try{await this.#e.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,s)}catch(m){Promise.reject(m)}throw this.#a({type:"error",error:f}),f}finally{this.#e.runNext(this)}}#a(a){const i=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),de.batch(()=>{this.#n.forEach(s=>{s.onMutationUpdate(a)}),this.#e.notify({mutation:this,type:"updated",action:a})})}};function ER(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var RR=class extends Vu{constructor(a={}){super(),this.config=a,this.#t=new Set,this.#n=new Map,this.#e=0}#t;#n;#e;build(a,i,s){const r=new _R({client:a,mutationCache:this,mutationId:++this.#e,options:a.defaultMutationOptions(i),state:s});return this.add(r),r}add(a){this.#t.add(a);const i=Su(a);if(typeof i=="string"){const s=this.#n.get(i);s?s.push(a):this.#n.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#t.delete(a)){const i=Su(a);if(typeof i=="string"){const s=this.#n.get(i);if(s)if(s.length>1){const r=s.indexOf(a);r!==-1&&s.splice(r,1)}else s[0]===a&&this.#n.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Su(a);if(typeof i=="string"){const r=this.#n.get(i)?.find(c=>c.state.status==="pending");return!r||r===a}else return!0}runNext(a){const i=Su(a);return typeof i=="string"?this.#n.get(i)?.find(r=>r!==a&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){de.batch(()=>{this.#t.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#t.clear(),this.#n.clear()})}getAll(){return Array.from(this.#t)}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Vy(i,s))}findAll(a={}){return this.getAll().filter(i=>Vy(a,i))}notify(a){de.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return de.batch(()=>Promise.all(a.map(i=>i.continue().catch(ke))))}};function Su(a){return a.options.scope?.id}var TR=class extends Vu{constructor(a={}){super(),this.config=a,this.#t=new Map}#t;build(a,i,s){const r=i.queryKey,c=i.queryHash??Wc(r,i);let f=this.get(c);return f||(f=new vR({client:a,queryKey:r,queryHash:c,options:a.defaultQueryOptions(i),state:s,defaultOptions:a.getQueryDefaults(r)}),this.add(f)),f}add(a){this.#t.has(a.queryHash)||(this.#t.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#t.get(a.queryHash);i&&(a.destroy(),i===a&&this.#t.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){de.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#t.get(a)}getAll(){return[...this.#t.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(s=>Gy(i,s))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(s=>Gy(a,s)):i}notify(a){de.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){de.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){de.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},wR=class{#t;#n;#e;#l;#a;#s;#u;#i;constructor(a={}){this.#t=a.queryCache||new TR,this.#n=a.mutationCache||new RR,this.#e=a.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#u=ug.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=Uu.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(a){return this.#t.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#n.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=this.#t.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(Nc(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(a){return this.#t.findAll(a).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(a,i,s){const r=this.defaultQueryOptions({queryKey:a}),f=this.#t.get(r.queryHash)?.state.data,m=nR(i,f);if(m!==void 0)return this.#t.build(this,r).setData(m,{...s,manual:!0})}setQueriesData(a,i,s){return de.batch(()=>this.#t.findAll(a).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#t.get(i.queryHash)?.state}removeQueries(a){const i=this.#t;de.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=this.#t;return de.batch(()=>(s.findAll(a).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},r=de.batch(()=>this.#t.findAll(a).map(c=>c.cancel(s)));return Promise.all(r).then(ke).catch(ke)}invalidateQueries(a,i={}){return de.batch(()=>(this.#t.findAll(a).forEach(s=>{s.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=de.batch(()=>this.#t.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,s);return s.throwOnError||(f=f.catch(ke)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(ke)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=this.#t.build(this,i);return s.isStaleByTime(Nc(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(ke).catch(ke)}fetchInfiniteQuery(a){return a.behavior=ky(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(ke).catch(ke)}ensureInfiniteQueryData(a){return a.behavior=ky(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return Uu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#n}getDefaultOptions(){return this.#e}setDefaultOptions(a){this.#e=a}setQueryDefaults(a,i){this.#l.set(Pi(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#l.values()],s={};return i.forEach(r=>{ki(a,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(a,i){this.#a.set(Pi(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],s={};return i.forEach(r=>{ki(a,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#e.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=Wc(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===tf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#e.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#t.clear(),this.#n.clear()}},fg=nt.createContext(void 0),x2=a=>{const i=nt.useContext(fg);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},AR=({client:a,children:i})=>(nt.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),Z.jsx(fg.Provider,{value:a,children:i}));const OR="/assets/styles-D4EBtWYc.css",MR=`
|
|
19
19
|
(() => {
|
|
20
20
|
// Skip PWA service worker inside Capacitor native shell — they conflict
|
|
21
21
|
// with the native networking layer and caching.
|
|
@@ -58,16 +58,25 @@ Error generating stack: `+l.message+`
|
|
|
58
58
|
const media = window.matchMedia('(prefers-color-scheme: dark)')
|
|
59
59
|
const apply = () => {
|
|
60
60
|
root.classList.remove('light', 'dark', 'system', 'chameleon', 'frost', 'frost-light', 'frost-dark')
|
|
61
|
+
root.style.colorScheme = ''
|
|
61
62
|
root.classList.add(theme)
|
|
62
|
-
|
|
63
|
+
|
|
64
|
+
const isFrostLight = theme === 'frost-light'
|
|
65
|
+
const isFrostDark = theme === 'frost-dark'
|
|
66
|
+
|
|
67
|
+
if (isFrostLight || isFrostDark) {
|
|
63
68
|
root.classList.add('frost')
|
|
64
69
|
}
|
|
65
|
-
if (
|
|
70
|
+
if (isFrostDark) {
|
|
66
71
|
root.classList.add('dark')
|
|
67
72
|
}
|
|
68
73
|
if (theme === 'system' && media.matches) {
|
|
69
74
|
root.classList.add('dark')
|
|
70
75
|
}
|
|
76
|
+
if (isFrostLight) {
|
|
77
|
+
root.classList.remove('dark')
|
|
78
|
+
root.style.colorScheme = 'light'
|
|
79
|
+
}
|
|
71
80
|
}
|
|
72
81
|
apply()
|
|
73
82
|
media.addEventListener('change', () => {
|
|
@@ -190,4 +199,4 @@ Error generating stack: `+l.message+`
|
|
|
190
199
|
document.documentElement.setAttribute('data-opencami-bubble-style', value)
|
|
191
200
|
} catch {}
|
|
192
201
|
})()
|
|
193
|
-
`;function HR(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const an=gE({notFoundComponent:HR,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:OR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:QR,component:YR}),qR=new wR;function YR(){return Z.jsx(AR,{client:qR,children:Z.jsx(Ip,{})})}function QR({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:CR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:zR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:DR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:LR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:UR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:NR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:jR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:BR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:xR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:MR}}),Z.jsx(DE,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(LE,{})]})]})}const GR="modulepreload",VR=function(a){return"/"+a},Jy={},zn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let y=function(p){return Promise.all(p.map(S=>Promise.resolve(S).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");c=y(s.map(p=>{if(p=VR(p),p in Jy)return;Jy[p]=!0;const S=p.endsWith(".css"),v=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const _=document.createElement("link");if(_.rel=S?"stylesheet":GR,S||(_.as="script"),_.crossOrigin="",_.href=p,h&&_.setAttribute("nonce",h),document.head.appendChild(_),S)return new Promise((O,C)=>{_.addEventListener("load",O),_.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${p}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return c.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},XR=()=>zn(()=>import("./skills-
|
|
202
|
+
`;function HR(){return typeof window<"u"&&(window.location.href="/chat/main"),null}const an=gE({notFoundComponent:HR,head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"},{title:"OpenCami"},{name:"description",content:"a fast web client for OpenClaw"},{property:"og:image",content:"/cover.webp"},{property:"og:image:type",content:"image/webp"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:image",content:"/cover.webp"},{name:"theme-color",content:"#0a0a0a"},{name:"apple-mobile-web-app-capable",content:"yes"},{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"},{name:"apple-mobile-web-app-title",content:"OpenCami"},{name:"mobile-web-app-capable",content:"yes"}],links:[{rel:"stylesheet",href:OR},{rel:"icon",type:"image/svg+xml",href:"/favicon.svg"},{rel:"apple-touch-icon",href:"/apple-touch-icon-180x180.png"},{rel:"manifest",href:"/manifest.json"}]}),shellComponent:QR,component:YR}),qR=new wR;function YR(){return Z.jsx(AR,{client:qR,children:Z.jsx(Ip,{})})}function QR({children:a}){return Z.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[Z.jsxs("head",{children:[Z.jsx("script",{dangerouslySetInnerHTML:{__html:CR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:zR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:DR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:LR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:UR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:NR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:jR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:BR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:xR}}),Z.jsx("script",{dangerouslySetInnerHTML:{__html:MR}}),Z.jsx(DE,{})]}),Z.jsxs("body",{children:[Z.jsx("div",{className:"root",children:a}),Z.jsx(LE,{})]})]})}const GR="modulepreload",VR=function(a){return"/"+a},Jy={},zn=function(i,s,r){let c=Promise.resolve();if(s&&s.length>0){let y=function(p){return Promise.all(p.map(S=>Promise.resolve(S).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");c=y(s.map(p=>{if(p=VR(p),p in Jy)return;Jy[p]=!0;const S=p.endsWith(".css"),v=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const _=document.createElement("link");if(_.rel=S?"stylesheet":GR,S||(_.as="script"),_.crossOrigin="",_.href=p,h&&_.setAttribute("nonce",h),document.head.appendChild(_),S)return new Promise((O,C)=>{_.addEventListener("load",O),_.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${p}`)))})}))}function f(m){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=m,window.dispatchEvent(h),!h.defaultPrevented)throw m}return c.then(m=>{for(const h of m||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},XR=()=>zn(()=>import("./skills-BEkw619A.js"),[]),KR=Fe("/skills")({component:Cn(XR,"component")}),ZR=()=>zn(()=>import("./new-DLlBm66g.js"),[]),PR=Fe("/new")({beforeLoad:function(){throw Gc({to:"/chat/$sessionKey",params:{sessionKey:"new"},replace:!0})},component:Cn(ZR,"component")}),kR=()=>zn(()=>import("./memory-lhzf-8Q4.js"),[]),FR=Fe("/memory")({component:Cn(kR,"component")}),JR=()=>zn(()=>import("./files-HiN5rXWq.js"),[]),$R=Fe("/files")({component:Cn(JR,"component")}),IR=()=>zn(()=>import("./connect-BX1MWO82.js"),__vite__mapDeps([0,1,2,3])),WR=Fe("/connect")({component:Cn(IR,"component")}),t2=()=>zn(()=>import("./bots-CyJwr-JU.js"),[]),e2=Fe("/bots")({component:Cn(t2,"component")}),n2=()=>zn(()=>import("./agents-BkeWu_3a.js"),[]),a2=Fe("/agents")({component:Cn(n2,"component")}),l2=()=>zn(()=>import("./index-Dg0mbvtv.js"),[]),i2=Fe("/")({component:Cn(l2,"component")}),s2=()=>zn(()=>import("./_sessionKey-BAmpzUOP.js").then(a=>a.$),__vite__mapDeps([4,5,6,2,7,8,9,10,11,12,3,13,14,15,16,17,18,19,20,1,21])),u2=Fe("/chat/$sessionKey")({component:Cn(s2,"component")}),r2=KR.update({id:"/skills",path:"/skills",getParentRoute:()=>an}),o2=PR.update({id:"/new",path:"/new",getParentRoute:()=>an}),c2=FR.update({id:"/memory",path:"/memory",getParentRoute:()=>an}),f2=$R.update({id:"/files",path:"/files",getParentRoute:()=>an}),d2=WR.update({id:"/connect",path:"/connect",getParentRoute:()=>an}),h2=e2.update({id:"/bots",path:"/bots",getParentRoute:()=>an}),m2=a2.update({id:"/agents",path:"/agents",getParentRoute:()=>an}),y2=i2.update({id:"/",path:"/",getParentRoute:()=>an}),p2=u2.update({id:"/chat/$sessionKey",path:"/chat/$sessionKey",getParentRoute:()=>an}),g2={IndexRoute:y2,AgentsRoute:m2,BotsRoute:h2,ConnectRoute:d2,FilesRoute:f2,MemoryRoute:c2,NewRoute:o2,SkillsRoute:r2,ChatSessionKeyRoute:p2},v2=an._addFileChildren(g2),S2=()=>wE({routeTree:v2,context:{},scrollRestoration:!0,defaultPreloadStaleTime:0});async function b2(){const a=await S2();let i;return i=[],window.__TSS_START_OPTIONS__={serializationAdapters:i},i.push(IE),a.options.serializationAdapters&&i.push(...a.options.serializationAdapters),a.update({basepath:"",serializationAdapters:i}),a.state.matches.length||await NE(a),a}async function _2(){const a=await b2();return window.$_TSR?.h(),a}let Mc;function E2(){return Mc||(Mc=_2()),Z.jsx(K_,{promise:Mc,children:a=>Z.jsx(ME,{router:a})})}nt.startTransition(()=>{Q0.hydrateRoot(document,Z.jsx(nt.StrictMode,{children:Z.jsx(E2,{})}))});export{z0 as A,Fp as L,i2 as R,Vu as S,zn as _,Bl as a,ke as b,M2 as c,Ic as d,iR as e,Nc as f,ER as g,Pi as h,Xu as i,Z as j,aR as k,Uc as l,ug as m,de as n,SR as o,hR as p,rR as q,nt as r,O2 as s,lR as t,x2 as u,N0 as v,lE as w,$_ as x,tE as y,u2 as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Ir,j as P,r as ce,d as Gi,L as Pn}from"./main-
|
|
1
|
+
import{A as Ir,j as P,r as ce,d as Gi,L as Pn}from"./main-CEuT8-Qi.js";import{r as Xi,C as Jt}from"./index-BlC2sH55.js";import{u as Ct,D as Yi,a as Ji,b as Ki,d as el}from"./use-file-explorer-state-DppKEjcl.js";import{c as tl,B as Fn}from"./button-DNC5N25i.js";import{s as Kt,h as nl,w as rl,f as il,a as ll,b as sl,c as Ln}from"./index-T4TOjvD0.js";function en(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ae=en();function Tr(e){Ae=e}var We={exec:()=>null};function j(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(J.caret,"$1"),n=n.replace(i,l),r},getRegex:()=>new RegExp(n,t)};return r}var al=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},ol=/^(?:[ \t]*(?:\n|$))+/,ul=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Je=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tn=/(?:[*+-]|\d{1,9}[.)])/,Ar=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zr=j(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fl=j(Ar).replace(/bull/g,tn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pl=/^[^\n]+/,rn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ml=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gl=j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tn).getRegex(),dt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ln=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dl=j("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ln).replace("tag",dt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rr=j(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),kl=j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rr).getRegex(),sn={blockquote:kl,code:ul,def:ml,fences:cl,heading:hl,hr:Je,html:dl,lheading:zr,list:gl,newline:ol,paragraph:Rr,table:We,text:pl},vn=j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),xl={...sn,lheading:fl,table:vn,paragraph:j(nn).replace("hr",Je).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex()},yl={...sn,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ln).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:We,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(nn).replace("hr",Je).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",zr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_r=/^( {2,}|\\)\n(?!\s*$)/,Sl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kt=/[\p{P}\p{S}]/u,an=/[\s\p{P}\p{S}]/u,Pr=/[^\s\p{P}\p{S}]/u,Cl=j(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,an).getRegex(),Fr=/(?!~)[\p{P}\p{S}]/u,El=/(?!~)[\s\p{P}\p{S}]/u,Il=/(?:[^\s\p{P}\p{S}]|~)/u,Tl=j(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",al?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Lr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Al=j(Lr,"u").replace(/punct/g,kt).getRegex(),zl=j(Lr,"u").replace(/punct/g,Fr).getRegex(),vr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rl=j(vr,"gu").replace(/notPunctSpace/g,Pr).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),_l=j(vr,"gu").replace(/notPunctSpace/g,Il).replace(/punctSpace/g,El).replace(/punct/g,Fr).getRegex(),Pl=j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pr).replace(/punctSpace/g,an).replace(/punct/g,kt).getRegex(),Fl=j(/\\(punct)/,"gu").replace(/punct/g,kt).getRegex(),Ll=j(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vl=j(ln).replace("(?:-->|$)","-->").getRegex(),Dl=j("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",vl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ot=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Nl=j(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ot).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Dr=j(/^!?\[(label)\]\[(ref)\]/).replace("label",ot).replace("ref",rn).getRegex(),Nr=j(/^!?\[(ref)\](?:\[\])?/).replace("ref",rn).getRegex(),Ol=j("reflink|nolink(?!\\()","g").replace("reflink",Dr).replace("nolink",Nr).getRegex(),Dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,on={_backpedal:We,anyPunctuation:Fl,autolink:Ll,blockSkip:Tl,br:_r,code:wl,del:We,emStrongLDelim:Al,emStrongRDelimAst:Rl,emStrongRDelimUnd:Pl,escape:bl,link:Nl,nolink:Nr,punctuation:Cl,reflink:Dr,reflinkSearch:Ol,tag:Dl,text:Sl,url:We},$l={...on,link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",ot).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ot).getRegex()},Mt={...on,emStrongRDelimAst:_l,emStrongLDelim:zl,url:j(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Dn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:j(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Dn).getRegex()},Bl={...Mt,br:j(_r).replace("{2,}","*").getRegex(),text:j(Mt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nt={normal:sn,gfm:xl,pedantic:yl},Be={normal:on,gfm:Mt,breaks:Bl,pedantic:$l},jl={"&":"&","<":"<",">":">",'"':""","'":"'"},Nn=e=>jl[e];function ke(e,t){if(t){if(J.escapeTest.test(e))return e.replace(J.escapeReplace,Nn)}else if(J.escapeTestNoEncode.test(e))return e.replace(J.escapeReplaceNoEncode,Nn);return e}function On(e){try{e=encodeURI(e).replace(J.percentDecode,"%")}catch{return null}return e}function $n(e,t){let n=e.replace(J.findPipe,(s,l,a)=>{let o=!1,u=l;for(;--u>=0&&a[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(J.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(J.slashPipe,"|");return r}function je(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Ml(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Bn(e,t,n,r,i){let s=t.href,l=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,o}function ql(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
3
|
`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[a]=l;return a.length>=i.length?s.slice(i.length):s}).join(`
|
|
4
4
|
`)}var ut=class{options;rules;lexer;constructor(e){this.options=e||Ae}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:je(n,`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/memory-screen-Zq9qfnJK.js","assets/main-CEuT8-Qi.js","assets/visuallyHidden-CO3ZD5AQ.js","assets/useMutation-C5bTdeC1.js","assets/button-DNC5N25i.js","assets/markdown-DKD6ZLRJ.js","assets/index-BlC2sH55.js","assets/react-K9goXsVv.js","assets/use-file-explorer-state-DppKEjcl.js","assets/useButton-DVAfkehQ.js","assets/owner-CFRNz_Tp.js","assets/popupStateMapping-D5k-jOeY.js","assets/composite-Bliqcmg4.js","assets/index-T4TOjvD0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r,_ as s}from"./main-CEuT8-Qi.js";const n=r.lazy(()=>s(()=>import("./memory-screen-Zq9qfnJK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.MemoryScreen})));function a(){return e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex h-screen items-center justify-center text-primary-500 text-sm",children:"Loading…"}),children:e.jsx(n,{})})}export{a as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as h,u as N,L as R}from"./main-
|
|
1
|
+
import{j as e,r as h,u as N,L as R}from"./main-CEuT8-Qi.js";import{u as g}from"./visuallyHidden-CO3ZD5AQ.js";import{u as S}from"./useMutation-C5bTdeC1.js";import{c as M,B as f,b as k}from"./button-DNC5N25i.js";import{M as C}from"./markdown-DKD6ZLRJ.js";import"./index-BlC2sH55.js";import"./react-K9goXsVv.js";import"./use-file-explorer-state-DppKEjcl.js";import"./useButton-DVAfkehQ.js";import"./owner-CFRNz_Tp.js";import"./popupStateMapping-D5k-jOeY.js";import"./composite-Bliqcmg4.js";import"./index-T4TOjvD0.js";const w=/\/(\d{4}-\d{2}-\d{2})/;function j({path:r,label:n,selected:o,onSelect:m}){return e.jsx("button",{type:"button",onClick:()=>m(r),className:M("w-full text-left px-2.5 py-1.5 rounded-md text-sm transition-colors",o?"text-primary-900":"text-primary-600 hover:text-primary-900 hover:bg-primary-50"),style:o?{backgroundColor:"var(--opencami-accent-light)"}:void 0,children:n})}function b(r){return r==="/MEMORY.md"?"📋 MEMORY.md":r.match(w)?`📅 ${r.replace(/^\/?memory\//,"")}`:`📄 ${r.replace(/^\/?memory\//,"")}`}function F({files:r,selectedPath:n,onSelect:o,loading:m}){const i=r.filter(t=>t==="/MEMORY.md"),s=r.filter(t=>t!=="/MEMORY.md"&&w.test(t)),l=r.filter(t=>t!=="/MEMORY.md"&&!w.test(t));return e.jsxs("aside",{className:"border-r border-primary-200 bg-primary-100 md:w-72 w-full md:h-full h-auto overflow-y-auto",children:[e.jsx("div",{className:"px-4 py-3 border-b border-primary-200",children:e.jsx("h2",{className:"text-sm font-semibold text-primary-800",children:"Memory Files"})}),e.jsx("div",{className:"p-2 space-y-0.5",children:m?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"Loading files…"}):r.length===0?e.jsx("div",{className:"px-2 py-2 text-sm text-primary-500",children:"No memory files found."}):e.jsxs(e.Fragment,{children:[i.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t)),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Daily"}),s.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 pt-3 pb-1 text-xs font-medium text-primary-400 uppercase tracking-wider",children:"Notes"}),l.map(t=>e.jsx(j,{path:t,label:b(t),selected:n===t,onSelect:o},t))]})]})})]})}function O({filePath:r,content:n,isLoading:o,onSave:m,onBack:i}){const[s,l]=h.useState(!1),[t,x]=h.useState(n),[u,p]=h.useState(!1);h.useEffect(()=>{x(n),l(!1)},[r,n]);const a=async()=>{p(!0);try{await m(t),l(!1)}finally{p(!1)}};return e.jsxs("section",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("header",{className:"border-b border-primary-100 px-4 py-3 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i?e.jsx(f,{size:"sm",variant:"ghost",onClick:i,children:"Back"}):null,e.jsx("h1",{className:"text-sm font-semibold text-primary-800 truncate",children:r})]}),!o&&e.jsx("div",{className:"flex items-center gap-2",children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(f,{size:"sm",onClick:()=>{a()},disabled:u,children:u?"Saving…":"Save"})]}):e.jsx(f,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Edit"})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-4",children:o?e.jsx("div",{className:"text-sm text-primary-500",children:"Loading content…"}):s?e.jsx("textarea",{value:t,onChange:c=>x(c.target.value),className:"w-full min-h-[60vh] rounded-md border border-primary-200 bg-surface px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}):e.jsx(C,{className:"prose prose-invert max-w-none",children:n||"_Empty file_"})})]})}const Y=/\/(\d{4}-\d{2}-\d{2})/;function z(r){const n=r.includes("/MEMORY.md")?["/MEMORY.md"]:[],o=r.filter(s=>s!=="/MEMORY.md"&&(s.startsWith("memory/")||s.startsWith("/memory/"))&&s.endsWith(".md")),m=[],i=[];for(const s of o)Y.test(s)?m.push(s):i.push(s);return m.sort((s,l)=>l.localeCompare(s)),i.sort((s,l)=>s.localeCompare(l)),[...n,...m,...i]}function V(){const r=N(),[n,o]=h.useState("/MEMORY.md"),m=g({queryKey:["memory","files"],queryFn:async({signal:a})=>{const[c,d]=await Promise.all([fetch("/api/files/read?path=/MEMORY.md",{signal:a}),fetch("/api/files/list?path=/memory",{signal:a})]),y=[];if(c.ok&&y.push("/MEMORY.md"),d.ok){const E=await d.json();for(const v of E.items)!v.isDir&&v.path.endsWith(".md")&&y.push(v.path)}return z(y)},staleTime:3e4}),i=n??m.data?.[0]??null,s=g({queryKey:["memory","content",i],queryFn:async({signal:a})=>{const c=i.startsWith("/")?i:`/${i}`,d=await fetch(`/api/files/read?path=${encodeURIComponent(c)}`,{signal:a});if(!d.ok)throw new Error("Failed to read memory file");return d.json()},enabled:!!i}),l=S({mutationFn:async a=>{const c=a.path.startsWith("/")?a.path:`/${a.path}`,d=await fetch("/api/files/save",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...a,path:c})});if(!d.ok)throw new Error("Failed to save memory file");return d.json()},onSuccess:async(a,c)=>{await r.invalidateQueries({queryKey:["memory","content",c.path]}),await r.invalidateQueries({queryKey:["memory","files"]})}}),[t,x]=h.useState(()=>typeof window<"u"?window.innerWidth<768:!1);h.useEffect(()=>{if(typeof window>"u")return;const a=()=>x(window.innerWidth<768);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const u=t&&!i,p=h.useCallback(a=>{o(a)},[]);return e.jsxs("div",{className:"h-screen bg-surface text-primary-900",children:[e.jsxs("div",{className:"h-12 border-b border-primary-100 px-3 flex items-center justify-between",children:[e.jsx("h1",{className:"text-sm font-semibold",children:"Memory Viewer"}),e.jsx(R,{to:"/chat/$sessionKey",params:{sessionKey:"main"},className:M(k({variant:"ghost",size:"sm"})),children:"Back to Chat"})]}),e.jsxs("div",{className:"h-[calc(100vh-48px)] md:grid md:grid-cols-[18rem_1fr]",children:[(!t||u)&&e.jsx(F,{files:m.data??[],selectedPath:i,onSelect:p,loading:m.isLoading}),i&&(!t||!u)?e.jsx(O,{filePath:i,content:s.data?.content??"",isLoading:s.isLoading,onBack:t?()=>o(null):void 0,onSave:async a=>{await l.mutateAsync({path:i,content:a})}}):e.jsx("div",{className:"p-4 text-sm text-primary-500",children:"Select a file to view."})]}),(m.isError||s.isError||l.isError)&&e.jsxs("div",{className:"fixed bottom-4 right-4 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["Something went wrong. ",e.jsx(f,{size:"sm",variant:"ghost",onClick:()=>{m.refetch()},children:"Retry"})]})]})}export{V as MemoryScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as V,w as Qe}from"./main-B_dlfHME.js";import{ab as Fe,ah as Ge,ac as Ne,ad as Ze,t as Nt,ag as Ae,u as At,c as nt}from"./button-Dg7VFQQn.js";import{u as mt,a as Ee,b as Te,c as ot,d as xt,e as Dt,p as ht,t as Lt,F as Ht,D as Kt,P as Ut,f as jt,R as Bt,g as Vt,h as _t,i as X,j as yt,k as Gt,l as bt,m as Wt,n as zt,o as qt,q as Yt,r as Rt,s as $t,T as Xt,v as Jt,w as Qt,x as Zt,y as en,z as tn,A as ut,B as ct,C as nn}from"./popupStateMapping-BRPDXnjv.js";import{g as re,t as Ve,u as fe,a as xe,l as _e,i as et,j as We,f as vt,k as It,d as Ct,o as on,m as we,s as Se,p as rn,q as lt,r as sn,v as an,w as un,x as cn,b as ln,y as fn}from"./useButton-Cbl_9oFG.js";import{e as dn,F as pn,I as gn,i as mn,f as xn,g as hn,h as yn}from"./use-file-explorer-state-DzT0bksg.js";import{u as bn}from"./DirectionContext-BdX86BHP.js";import{i as ft,f as Rn,g as vn,h as In,j as Cn,d as dt,k as Mn,e as ke,s as me,a as ze,b as De,c as Le,l as Tn,m as En,n as Pn,A as Mt,o as tt}from"./owner-CpRnf1fI.js";import{h as pt,g as $e,a as gt,c as On,i as Xe,b as Sn,d as wn,e as kn,f as Ue,j as Fn,C as Nn,u as An}from"./useCompositeItem-BDAzTxVe.js";import{u as Dn,e as Ln,f as Hn,h as Kn,i as Un,j as jn}from"./tooltip-Dg9fy-vT.js";import{C as Bn}from"./composite-DBl8R3ae.js";function Vn(e,o={}){const r="rootStore"in e?e.rootStore:e,u=r.context.dataRef,{enabled:d=!0,event:x="click",toggle:N=!0,ignoreMouse:s=!1,stickIfOpen:I=!0,touchOpenDelay:E=0}=o,h=n.useRef(void 0),T=mt(),S=Ee(),K=n.useMemo(()=>({onPointerDown(b){h.current=b.pointerType},onMouseDown(b){const i=h.current,l=b.nativeEvent,g=r.select("open");if(b.button!==0||x==="click"||ft(i,!0)&&s)return;const a=u.current.openEvent,y=a?.type,M=r.select("domReferenceElement")!==b.currentTarget,t=g&&M||!(g&&N&&(!(a&&I)||y==="click"||y==="mousedown"));if(vn(l.target)){const v=re(Ve,l,l.target);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v);return}const R=b.currentTarget;T.request(()=>{const v=re(Ve,l,R);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v)})},onClick(b){if(x==="mousedown-only")return;const i=h.current;if(x==="mousedown"&&i){h.current=void 0;return}if(ft(i,!0)&&s)return;const l=r.select("open"),g=u.current.openEvent,a=r.select("domReferenceElement")!==b.currentTarget,y=l&&a||!(l&&N&&(!(g&&I)||Rn(g))),M=re(Ve,b.nativeEvent,b.currentTarget);y&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,M)}):r.setOpen(y,M)},onKeyDown(){h.current=void 0}}),[u,x,s,r,I,N,T,S,E]);return n.useMemo(()=>d?{reference:K}:Fe,[d,K])}const _n="Escape";function qe(e,o,r){switch(e){case"vertical":return o;case"horizontal":return r;default:return o||r}}function je(e,o){return qe(o,e===Mt||e===ze,e===De||e===Le)}function Je(e,o,r){return qe(o,e===ze,r?e===De:e===Le)||e==="Enter"||e===" "||e===""}function Gn(e,o,r){return qe(o,r?e===De:e===Le,e===ze)}function Wn(e,o,r,u){const d=r?e===Le:e===De,x=e===Mt;return o==="both"||o==="horizontal"&&u&&u>1?e===_n:qe(o,d,x)}function zn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.useState("floatingElement"),x=r.useState("domReferenceElement"),N=r.context.dataRef,{listRef:s,activeIndex:I,onNavigate:E=()=>{},enabled:h=!0,selectedIndex:T=null,allowEscape:S=!1,loopFocus:K=!1,nested:b=!1,rtl:i=!1,virtual:l=!1,focusItemOnOpen:g="auto",focusItemOnHover:a=!0,openOnArrowKeyDown:y=!0,disabledIndices:M=void 0,orientation:t="vertical",parentOrientation:R,cols:v=1,scrollItemIntoView:k=!0,itemSizes:F,dense:se=!1,id:G,resetOnPointerLeave:J=!0,externalTree:w}=o,q=In(d),L=Te(q),P=ot(),Y=xt(w);fe(()=>{N.current.orientation=t},[N,t]);const Q=Cn(x),ee=n.useRef(g),p=n.useRef(T??-1),B=n.useRef(null),Z=n.useRef(!0),m=xe(c=>{E(p.current===-1?null:p.current,c)}),ue=n.useRef(m),ce=n.useRef(!!d),pe=n.useRef(u),$=n.useRef(!1),ae=n.useRef(!1),te=Te(M),U=Te(u),A=Te(k),ie=Te(T),he=Te(J),ge=xe(()=>{function c(_){l?Y?.events.emit("virtualfocus",_):dn(_,{sync:$.current,preventScroll:!0})}const O=s.current[p.current],f=ae.current;O&&c(O),($.current?_=>_():requestAnimationFrame)(()=>{const _=s.current[p.current]||O;if(!_)return;O||c(_);const ne=A.current;ne&&ye&&(f||!Z.current)&&_.scrollIntoView?.(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne)})});fe(()=>{h&&(u&&d?(p.current=T??-1,ee.current&&T!=null&&(ae.current=!0,m())):ce.current&&(p.current=-1,ue.current()))},[h,u,d,T,m]),fe(()=>{if(h){if(!u){$.current=!1;return}if(d)if(I==null){if($.current=!1,ie.current!=null)return;if(ce.current&&(p.current=-1,ge()),(!pe.current||!ce.current)&&ee.current&&(B.current!=null||ee.current===!0&&B.current==null)){let c=0;const O=()=>{s.current[0]==null?(c<2&&(c?requestAnimationFrame:queueMicrotask)(O),c+=1):(p.current=B.current==null||Je(B.current,t,i)||b?$e(s):gt(s),B.current=null,m())};O()}}else pt(s,I)||(p.current=I,ge(),ae.current=!1)}},[h,u,d,I,ie,b,s,t,i,m,ge,te]),fe(()=>{if(!h||d||!Y||l||!ce.current)return;const c=Y.nodesRef.current,O=c.find(_=>_.id===P)?.context?.elements.floating,f=dt(Mn(d)),H=c.some(_=>_.context&&ke(_.context.elements.floating,f));O&&!H&&Z.current&&O.focus({preventScroll:!0})},[h,d,Y,P,l]),fe(()=>{ue.current=m,pe.current=u,ce.current=!!d}),fe(()=>{u||(B.current=null,ee.current=g)},[u,g]);const le=I!=null,ye=n.useMemo(()=>{function c(f){if(!U.current)return;const H=s.current.indexOf(f.currentTarget);H!==-1&&p.current!==H&&(p.current=H,m(f))}return{onFocus(f){$.current=!0,c(f)},onClick:({currentTarget:f})=>f.focus({preventScroll:!0}),onMouseMove(f){$.current=!0,ae.current=!1,a&&c(f)},onPointerLeave(f){if(!U.current||!Z.current||f.pointerType==="touch")return;$.current=!0;const H=f.relatedTarget;!a||s.current.includes(H)||he.current&&(p.current=-1,m(f),l||L.current?.focus({preventScroll:!0}))}}},[U,L,a,s,m,he,l]),j=n.useCallback(()=>R??Y?.nodesRef.current.find(c=>c.id===P)?.context?.dataRef?.current.orientation,[P,Y,R]),W=xe(c=>{if(Z.current=!1,$.current=!0,c.which===229||!U.current&&c.currentTarget===L.current)return;if(b&&Wn(c.key,t,i,v)){je(c.key,j())||me(c),r.setOpen(!1,re(_e,c.nativeEvent)),et(x)&&(l?Y?.events.emit("virtualfocus",x):x.focus());return}const O=p.current,f=$e(s,M),H=gt(s,M);if(Q||(c.key==="Home"&&(me(c),p.current=f,m(c)),c.key==="End"&&(me(c),p.current=H,m(c))),v>1){const _=F||Array.from({length:s.current.length},()=>({width:1,height:1})),ne=On(_,v,se),be=ne.findIndex(de=>de!=null&&!Xe(s,de,M)),Pe=ne.reduce((de,Re,C)=>Re!=null&&!Xe(s,Re,M)?C:de,-1),Me=ne[Sn({current:ne.map(de=>de!=null?s.current[de]:null)},{event:c,orientation:t,loopFocus:K,rtl:i,cols:v,disabledIndices:kn([...(typeof M!="function"?M:null)||s.current.map((de,Re)=>Xe(s,Re,M)?Re:void 0),void 0],ne),minIndex:be,maxIndex:Pe,prevIndex:wn(p.current>H?f:p.current,_,ne,v,c.key===ze?"bl":c.key===(i?De:Le)?"tr":"tl"),stopEvent:!0})];if(Me!=null&&(p.current=Me,m(c)),t==="both")return}if(je(c.key,t)){if(me(c),u&&!l&&dt(c.currentTarget.ownerDocument)===c.currentTarget){p.current=Je(c.key,t,i)?f:H,m(c);return}Je(c.key,t,i)?K?O>=H?S&&O!==s.current.length?p.current=-1:($.current=!1,p.current=f):p.current=Ue(s,{startingIndex:O,disabledIndices:M}):p.current=Math.min(H,Ue(s,{startingIndex:O,disabledIndices:M})):K?O<=f?S&&O!==-1?p.current=s.current.length:($.current=!1,p.current=H):p.current=Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M}):p.current=Math.max(f,Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M})),pt(s,p.current)&&(p.current=-1),m(c)}}),z=n.useMemo(()=>l&&u&&le&&{"aria-activedescendant":`${G}-${I}`},[l,u,le,G,I]),Ie=n.useMemo(()=>({"aria-orientation":t==="both"?void 0:t,...Q?{}:z,onKeyDown(c){if(c.key==="Tab"&&c.shiftKey&&u&&!l){const O=Tn(c.nativeEvent);if(O&&!ke(L.current,O))return;me(c),r.setOpen(!1,re(We,c.nativeEvent)),et(x)&&x.focus();return}W(c)},onPointerMove(){Z.current=!0}}),[z,W,L,t,Q,r,u,l,x]),Ce=n.useMemo(()=>{function c(f){g==="auto"&&En(f.nativeEvent)&&(ee.current=!l)}function O(f){ee.current=g,g==="auto"&&Pn(f.nativeEvent)&&(ee.current=!0)}return{onKeyDown(f){const H=r.select("open");Z.current=!1;const _=f.key.startsWith("Arrow"),ne=Gn(f.key,j(),i),be=je(f.key,t),Pe=(b?ne:be)||f.key==="Enter"||f.key.trim()==="";if(l&&H)return W(f);if(!(!H&&!y&&_)){if(Pe){const Me=je(f.key,j());B.current=b&&Me?null:f.key}if(b){ne&&(me(f),H?(p.current=$e(s,te.current),m(f)):r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)));return}be&&(ie.current!=null&&(p.current=ie.current),me(f),!H&&y?r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)):W(f),H&&m(f))}},onFocus(f){r.select("open")&&!l&&(p.current=-1,m(f))},onPointerDown:O,onPointerEnter:O,onMouseDown:c,onClick:c}},[W,te,g,s,b,m,r,y,t,j,i,ie,l]),He=n.useMemo(()=>({...z,...Ce}),[z,Ce]);return n.useMemo(()=>h?{reference:He,floating:Ie,item:ye,trigger:Ce}:{},[h,He,Ie,Ce,ye])}function qn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.context.dataRef,{listRef:x,activeIndex:N,onMatch:s,onTypingChange:I,enabled:E=!0,findMatch:h=null,resetMs:T=750,ignoreKeys:S=Ge,selectedIndex:K=null}=o,b=Ee(),i=n.useRef(""),l=n.useRef(K??N??-1),g=n.useRef(null);fe(()=>{u&&(b.clear(),g.current=null,i.current="")},[u,b]),fe(()=>{u&&i.current===""&&(l.current=K??N??-1)},[u,K,N]);const a=xe(R=>{R?d.current.typing||(d.current.typing=R,I?.(R)):d.current.typing&&(d.current.typing=R,I?.(R))}),y=xe(R=>{function v(J,w,q){const L=h?h(w,q):w.find(P=>P?.toLocaleLowerCase().indexOf(q.toLocaleLowerCase())===0);return L?J.indexOf(L):-1}const k=x.current;if(i.current.length>0&&i.current[0]!==" "&&(v(k,k,i.current)===-1?a(!1):R.key===" "&&me(R)),k==null||S.includes(R.key)||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;u&&R.key!==" "&&(me(R),a(!0)),k.every(J=>J?J[0]?.toLocaleLowerCase()!==J[1]?.toLocaleLowerCase():!0)&&i.current===R.key&&(i.current="",l.current=g.current),i.current+=R.key,b.start(T,()=>{i.current="",l.current=g.current,a(!1)});const se=l.current,G=v(k,[...k.slice((se||0)+1),...k.slice(0,(se||0)+1)],i.current);G!==-1?(s?.(G),g.current=G):R.key!==" "&&(i.current="",a(!1))}),M=n.useMemo(()=>({onKeyDown:y}),[y]),t=n.useMemo(()=>({onKeyDown:y,onKeyUp(R){R.key===" "&&a(!1)}}),[y,a]);return n.useMemo(()=>E?{reference:M,floating:t}:{},[E,M,t])}const Tt=n.createContext(void 0);function Et(e){const o=n.useContext(Tt);if(o===void 0&&!e)throw new Error(Ne(33));return o}const Pt=n.createContext(void 0);function ve(e){const o=n.useContext(Pt);if(o===void 0&&!e)throw new Error(Ne(36));return o}const Yn=n.createContext(void 0);function Ye(e=!0){const o=n.useContext(Yn);if(o===void 0&&!e)throw new Error(Ne(25));return o}const $n={type:"regular-item"};function Xn(e){const{closeOnClick:o,disabled:r=!1,highlighted:u,id:d,store:x,nativeButton:N,itemMetadata:s,nodeId:I}=e,E=n.useRef(null),h=Ye(!0),T=h!==void 0,{events:S}=x.useState("floatingTreeRoot"),{getButtonProps:K,buttonRef:b}=vt({disabled:r,focusableWhenDisabled:!0,native:N}),i=n.useCallback(g=>Ze({id:d,role:"menuitem",tabIndex:u?0:-1,onMouseMove(a){I&&S.emit("itemhover",{nodeId:I,target:a.currentTarget})},onMouseEnter(){s.type==="submenu-trigger"&&s.setActive()},onKeyUp(a){a.key===" "&&x.context.typingRef.current&&a.preventBaseUIHandler()},onClick(a){o&&S.emit("close",{domEvent:a,reason:It})},onMouseUp(a){if(h){const y=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,T&&y&&Math.abs(a.clientX-y.x)<=1&&Math.abs(a.clientY-y.y)<=1)return}E.current&&x.context.allowMouseUpTriggerRef.current&&(!T||a.button===2)&&s.type==="regular-item"&&E.current.click()}},g,K),[d,u,K,o,S,x,T,h,s,I]),l=Nt(E,b);return n.useMemo(()=>({getItemProps:i,itemRef:l}),[i,l])}const Jn=n.forwardRef(function(o,r){const{render:u,className:d,id:x,label:N,nativeButton:s=!1,disabled:I=!1,closeOnClick:E=!0,...h}=o,T=Fn({label:N}),S=Et(!0),K=Ct(x),{store:b}=ve(),i=b.useState("isActive",T.index),l=b.useState("itemProps"),{getItemProps:g,itemRef:a}=Xn({closeOnClick:E,disabled:I,highlighted:i,id:K,store:b,nativeButton:s,nodeId:S?.nodeId,itemMetadata:$n}),y=n.useMemo(()=>({disabled:I,highlighted:i}),[I,i]);return Ae("div",o,{state:y,props:[l,h,g],ref:[a,r,T.ref]})}),Qn=n.createContext(void 0);function Zn(e){return n.useContext(Qn)}const eo={...ht,...Lt},to=n.forwardRef(function(o,r){const{render:u,className:d,finalFocus:x,...N}=o,{store:s}=ve(),{side:I,align:E}=Et(),h=Zn()!=null,T=s.useState("open"),S=s.useState("transitionStatus"),K=s.useState("popupProps"),b=s.useState("mounted"),i=s.useState("instantType"),l=s.useState("activeTriggerElement"),g=s.useState("parent"),a=s.useState("lastOpenChangeReason"),y=s.useState("rootId"),M=s.useState("floatingRootContext"),t=s.useState("floatingTreeRoot"),R=s.useState("closeDelay"),v=s.useState("activeTriggerElement"),k=g.type==="context-menu";Dt({open:T,ref:s.context.popupRef,onComplete(){T&&s.context.onOpenChangeComplete?.(!0)}}),n.useEffect(()=>{function q(L){s.setOpen(!1,re(L.reason,L.domEvent))}return t.events.on("close",q),()=>{t.events.off("close",q)}},[t.events,s]);const F=s.useState("hoverEnabled"),se=s.useState("disabled");Dn(M,{enabled:F&&!se&&!k&&g.type!=="menubar",closeDelay:R});const G=n.useMemo(()=>({transitionStatus:S,side:I,align:E,open:T,nested:g.type==="menu",instant:i}),[S,I,E,T,g.type,i]),J=Ae("div",o,{state:G,ref:[r,s.context.popupRef],stateAttributesMapping:eo,props:[K,{onKeyDown(q){h&&Bn.has(q.key)&&q.stopPropagation()}},Ln(S),N,{"data-rootownerid":y}]});let w=g.type===void 0||k;return(l||g.type==="menubar"&&a!==on)&&(w=!0),V.jsx(pn,{context:M,modal:k,disabled:!b,returnFocus:x===void 0?w:x,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?t:void 0,previousFocusableElement:v,nextFocusableElement:g.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:J})}),Ot=n.createContext(void 0);function no(){const e=n.useContext(Ot);if(e===void 0)throw new Error(Ne(32));return e}const oo=n.forwardRef(function(o,r){const{keepMounted:u=!1,...d}=o,{store:x}=ve();return x.useState("mounted")||u?V.jsx(Ot.Provider,{value:u,children:V.jsx(Ht,{ref:r,...d})}):null}),ro=n.forwardRef(function(o,r){const{anchor:u,positionMethod:d="absolute",className:x,render:N,side:s,align:I,sideOffset:E=0,alignOffset:h=0,collisionBoundary:T="clipping-ancestors",collisionPadding:S=5,arrowPadding:K=5,sticky:b=!1,disableAnchorTracking:i=!1,collisionAvoidance:l=Kt,...g}=o,{store:a}=ve(),y=no(),M=Ye(!0),t=a.useState("parent"),R=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),k=a.useState("mounted"),F=a.useState("open"),se=a.useState("modal"),G=a.useState("activeTriggerElement"),J=a.useState("lastOpenChangeReason"),w=a.useState("floatingNodeId"),q=a.useState("floatingParentNodeId");let L=u,P=E,Y=h,Q=I,ee=l;t.type==="context-menu"&&(L=u??t.context?.anchor,Q=Q??"start",!s&&Q!=="center"&&(Y=o.alignOffset??2,P=o.sideOffset??-5));let p=s,B=Q;t.type==="menu"?(p=p??"inline-end",B=B??"start",ee=o.collisionAvoidance??Ut):t.type==="menubar"&&(p=p??"bottom",B=B??"start");const Z=t.type==="context-menu",m=Hn({anchor:L,floatingRootContext:R,positionMethod:M?"fixed":d,mounted:k,side:p,sideOffset:P,align:B,alignOffset:Y,arrowPadding:Z?0:K,collisionBoundary:T,collisionPadding:S,sticky:b,nodeId:w,keepMounted:y,disableAnchorTracking:i,collisionAvoidance:ee,shiftCrossAxis:Z,externalTree:v}),ue=n.useMemo(()=>{const U={};return F||(U.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...m.positionerStyles,...U}}},[F,k,m.positionerStyles]);n.useEffect(()=>{function U(A){A.open?(A.parentNodeId===w&&a.set("hoverEnabled",!1),A.nodeId!==w&&A.parentNodeId===a.select("floatingParentNodeId")&&a.setOpen(!1,re(Se))):A.parentNodeId===w&&A.reason!==Se&&a.set("hoverEnabled",!0)}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[a,v.events,w]),n.useEffect(()=>{if(a.select("floatingParentNodeId")==null)return;function U(A){if(A.open||A.nodeId!==a.select("floatingParentNodeId"))return;const ie=A.reason??Se;a.setOpen(!1,re(ie))}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[v.events,a]),n.useEffect(()=>{function U(A){!F||A.nodeId!==a.select("floatingParentNodeId")||A.target&&G&&G!==A.target&&a.setOpen(!1,re(Se))}return v.events.on("itemhover",U),()=>{v.events.off("itemhover",U)}},[v.events,F,G,a]),n.useEffect(()=>{const U={open:F,nodeId:w,parentNodeId:q,reason:a.select("lastOpenChangeReason")};v.events.emit("menuopenchange",U)},[v.events,F,a,w,q]);const ce=n.useMemo(()=>({open:F,side:m.side,align:m.align,anchorHidden:m.anchorHidden,nested:t.type==="menu"}),[F,m.side,m.align,m.anchorHidden,t.type]),pe=n.useMemo(()=>({side:m.side,align:m.align,arrowRef:m.arrowRef,arrowUncentered:m.arrowUncentered,arrowStyles:m.arrowStyles,nodeId:m.context.nodeId}),[m.side,m.align,m.arrowRef,m.arrowUncentered,m.arrowStyles,m.context.nodeId]),$=Ae("div",o,{state:ce,stateAttributesMapping:ht,ref:[r,a.useStateSetter("positionerElement")],props:[ue,g]}),ae=k&&t.type!=="menu"&&(t.type!=="menubar"&&se&&J!==we||t.type==="menubar"&&t.context.modal);let te=null;return t.type==="menubar"?te=t.context.contentElement:t.type===void 0&&(te=G),V.jsxs(Tt.Provider,{value:pe,children:[ae&&V.jsx(gn,{ref:t.type==="context-menu"||t.type==="nested-context-menu"?t.context.internalBackdropRef:null,inert:mn(!F),cutout:te}),V.jsx(jt,{id:w,children:V.jsx(Nn,{elementsRef:a.context.itemDomElements,labelsRef:a.context.itemLabels,children:$})})]})}),so=n.createContext(null);function St(e){return n.useContext(so)}const io={..._t,disabled:X(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:X(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:X(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:X(e=>e.stickIfOpen),parent:X(e=>e.parent),rootId:X(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:X(e=>e.activeIndex),isActive:X((e,o)=>e.activeIndex===o),hoverEnabled:X(e=>e.hoverEnabled),instantType:X(e=>e.instantType),lastOpenChangeReason:X(e=>e.openChangeReason),floatingTreeRoot:X(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:X(e=>e.floatingNodeId),floatingParentNodeId:X(e=>e.floatingParentNodeId),itemProps:X(e=>e.itemProps),closeDelay:X(e=>e.closeDelay),keyboardEventRelay:X(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class rt extends Bt{constructor(o){super({...ao(),...o},{positionerRef:n.createRef(),popupRef:n.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vt},io),this.observe(X(r=>r.allowMouseEnter),(r,u)=>{this.state.parent.type==="menu"&&r!==u&&this.state.parent.store.set("allowMouseEnter",r)}),this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(o,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:o,eventDetails:r})}static useStore(o,r){const u=At(()=>new rt(r)).current;return o??u}unsubscribeParentListener=null}function ao(){return{...Gt(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new yt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fe,keyboardEventRelay:void 0,closeDelay:0}}const uo=n.createContext(void 0);function co(){return n.useContext(uo)}function lo(e){const{children:o,open:r,onOpenChange:u,onOpenChangeComplete:d,defaultOpen:x=!1,disabled:N=!1,modal:s,loopFocus:I=!0,orientation:E="vertical",actionsRef:h,closeParentOnEsc:T=!1,handle:S,triggerId:K,defaultTriggerId:b=null,highlightItemOnHover:i=!0}=e,l=Ye(!0),g=ve(!0),a=St(),y=co(),M=n.useMemo(()=>y&&g?{type:"menu",store:g.store}:a?{type:"menubar",context:a}:l&&!g?{type:"context-menu",context:l}:{type:void 0},[l,g,a,y]),t=rt.useStore(S?.store,{parent:M}),R=t.useState("floatingTreeRoot"),v=bt(R),k=ot();fe(()=>{l&&!g?t.update({parent:{type:"context-menu",context:l},floatingNodeId:v,floatingParentNodeId:k}):g&&t.update({floatingNodeId:v,floatingParentNodeId:k})},[l,g,v,k,t]),t.useControlledProp("open",r,x),t.useControlledProp("activeTriggerId",K,b),t.useContextCallback("onOpenChangeComplete",d);const F=t.useState("open"),se=t.useState("activeTriggerElement"),G=t.useState("positionerElement"),J=t.useState("hoverEnabled"),w=t.useState("modal"),q=t.useState("disabled"),L=t.useState("lastOpenChangeReason"),P=t.useState("parent"),Y=t.useState("activeIndex"),Q=t.useState("payload"),ee=t.useState("floatingParentNodeId"),p=n.useRef(null),B=ee!=null;let Z;t.useSyncedValues({disabled:N,modal:P.type===void 0?s:void 0,rootId:rn()});const{openMethod:m,triggerProps:ue,reset:ce}=xn(F);Wt(t);const{forceUnmount:pe}=zt(F,t,()=>{t.update({allowMouseEnter:!1,stickIfOpen:!0}),ce()}),$=n.useRef(P.type!=="context-menu"),ae=Ee();n.useEffect(()=>{if(F||(p.current=null),P.type==="context-menu"){if(!F){ae.clear(),$.current=!1;return}ae.start(500,()=>{$.current=!0})}},[ae,F,P.type]),hn(F&&w&&L!==we&&m!=="touch",G),fe(()=>{!F&&!J&&t.set("hoverEnabled",!0)},[F,J,t]);const te=n.useRef(!0),U=Ee(),A=xe((C,D)=>{const oe=D.reason;if(F===C&&D.trigger===se&&L===oe||(D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},!C&&D.trigger==null&&(D.trigger=se??void 0),u?.(C,D),D.isCanceled))return;const kt={open:C,nativeEvent:D.event,reason:D.reason,nested:B};Z?.emit("openchange",kt);const Ke=D.event;if(C===!1&&Ke?.type==="click"&&Ke.pointerType==="touch"&&!te.current)return;if(!C&&Y!==null){const Oe=t.context.itemDomElements.current[Y];queueMicrotask(()=>{Oe?.setAttribute("tabindex","-1")})}C&&oe===lt?(te.current=!1,U.start(300,()=>{te.current=!0})):(te.current=!0,U.clear());const st=(oe===Ve||oe===It)&&Ke.detail===0&&Ke?.isTrusted,Ft=!C&&(oe===sn||oe==null);function it(){const Oe={open:C,openChangeReason:oe};p.current=D.event??null;const at=D.trigger?.id??null;(at||C)&&(Oe.activeTriggerId=at,Oe.activeTriggerElement=D.trigger??null),t.update(Oe)}oe===we?Qe.flushSync(it):it(),P.type==="menubar"&&(oe===lt||oe===We||oe===we||oe===_e||oe===Se)?t.set("instantType","group"):st||Ft?t.set("instantType",st?"click":"dismiss"):t.set("instantType",void 0)}),ie=n.useCallback(C=>{const D=re(C);return D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},D},[t]),he=n.useCallback(()=>{t.setOpen(!1,ie(an))},[t,ie]);n.useImperativeHandle(h,()=>({unmount:pe,close:he}),[pe,he]);let ge;P.type==="context-menu"&&(ge=P.context),n.useImperativeHandle(ge?.positionerRef,()=>G,[G]),n.useImperativeHandle(ge?.actionsRef,()=>({setOpen:A}),[A]);const le=qt({popupStore:t,onOpenChange:A});Z=le.context.events,n.useEffect(()=>{const C=({open:D,eventDetails:oe})=>A(D,oe);return Z.on("setOpen",C),()=>{Z?.off("setOpen",C)}},[Z,A]);const ye=Yt(le,{enabled:!q,bubbles:{escapeKey:T&&P.type==="menu"},outsidePress(){return P.type!=="context-menu"||p.current?.type==="contextmenu"?!0:$.current},externalTree:B?R:void 0}),j=yn(le,{role:"menu"}),W=bn(),z=n.useCallback(C=>{t.select("activeIndex")!==C&&t.set("activeIndex",C)},[t]),Ie=zn(le,{enabled:!q,listRef:t.context.itemDomElements,activeIndex:Y,nested:P.type!==void 0,loopFocus:I,orientation:E,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:W==="rtl",disabledIndices:Ge,onNavigate:z,openOnArrowKeyDown:P.type!=="context-menu",externalTree:B?R:void 0,focusItemOnHover:i}),Ce=n.useCallback(C=>{t.context.typingRef.current=C},[t]),He=qn(le,{listRef:t.context.itemLabels,activeIndex:Y,resetMs:Xt,onMatch:C=>{F&&C!==Y&&t.set("activeIndex",C)},onTypingChange:Ce}),{getReferenceProps:c,getFloatingProps:O,getItemProps:f,getTriggerProps:H}=Rt([ye,j,Ie,He]),_=n.useMemo(()=>{const C=Ze(c(),{onMouseEnter(){t.set("hoverEnabled",!0)},onMouseMove(){t.set("allowMouseEnter",!0)}},ue);return delete C.role,C},[c,t,ue]),ne=n.useMemo(()=>{const C=H();if(!C)return C;const D=Ze(C,ue);return delete D.role,delete D["aria-controls"],D},[H,ue]),be=mt(),Pe=n.useMemo(()=>O({onMouseEnter(){P.type==="menu"&&be.request(()=>t.set("hoverEnabled",!1))},onMouseMove(){t.set("allowMouseEnter",!0)},onClick(){t.select("hoverEnabled")&&t.set("hoverEnabled",!1)},onKeyDown(C){const D=t.select("keyboardEventRelay");D&&!C.isPropagationStopped()&&D(C)}}),[O,P.type,be,t]),Me=n.useMemo(()=>f(),[f]);t.useSyncedValues({floatingRootContext:le,activeTriggerProps:_,inactiveTriggerProps:ne,popupProps:Pe,itemProps:Me});const de=n.useMemo(()=>({store:t,parent:M}),[t,M]),Re=V.jsx(Pt.Provider,{value:de,children:typeof o=="function"?o({payload:Q}):o});return P.type===void 0||P.type==="context-menu"?V.jsx($t,{externalTree:R,children:Re}):Re}function fo(e){const o=e.getBoundingClientRect(),r=window.getComputedStyle(e,"::before"),u=window.getComputedStyle(e,"::after");if(!(r.content!=="none"||u.content!=="none"))return o;const x=parseFloat(r.width)||0,N=parseFloat(r.height)||0,s=parseFloat(u.width)||0,I=parseFloat(u.height)||0,E=Math.max(o.width,x,s),h=Math.max(o.height,N,I),T=E-o.width,S=h-o.height;return{left:o.left-T/2,right:o.right+T/2,top:o.top-S/2,bottom:o.bottom+S/2}}function po(e){const{render:o,className:r,state:u=Fe,props:d=Ge,refs:x=Ge,metadata:N,stateAttributesMapping:s,tag:I="div",...E}=e,{compositeProps:h,compositeRef:T}=An({metadata:N});return Ae(I,e,{state:u,ref:[...x,T],props:[h,...d,E],stateAttributesMapping:s})}function wt(e){if(et(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!un(e))return wt(cn(e))}function go(e){const{enabled:o=!0,mouseDownAction:r,open:u}=e,d=n.useRef(!1);return n.useMemo(()=>o?{onMouseDown:x=>{(r==="open"&&!u||r==="close"&&u)&&(d.current=!0,tt(x.currentTarget).addEventListener("click",()=>{d.current=!1},{once:!0}))},onClick:x=>{d.current&&(d.current=!1,x.preventBaseUIHandler())}}:Fe,[o,r,u])}const Be=2,mo=n.forwardRef(function(o,r){const{render:u,className:d,disabled:x=!1,nativeButton:N=!0,id:s,openOnHover:I,delay:E=100,closeDelay:h=0,handle:T,payload:S,...K}=o,b=ve(!0),i=T?.store??b?.store;if(!i)throw new Error(Ne(85));const l=Ct(s),g=i.useState("isTriggerActive",l),a=i.useState("floatingRootContext"),y=i.useState("isOpenedByTrigger",l),M=n.useRef(null),t=ho(),R=ln(!0),v=xt(),k=n.useMemo(()=>v??new yt,[v]),F=bt(k),se=ot(),{registerTrigger:G,isMountedByThisTrigger:J}=Jt(l,M,i,{payload:S,closeDelay:h,parent:t,floatingTreeRoot:k,floatingNodeId:F,floatingParentNodeId:se,keyboardEventRelay:R?.relayKeyboardEvent}),w=t.type==="menubar",q=i.useState("disabled"),L=x||q||w&&t.context.disabled,{getButtonProps:P,buttonRef:Y}=vt({disabled:L,native:N});n.useEffect(()=>{!y&&t.type===void 0&&(i.context.allowMouseUpTriggerRef.current=!1)},[i,y,t.type]);const Q=n.useRef(null),ee=Ee(),p=xe(j=>{if(!Q.current)return;ee.clear(),i.context.allowMouseUpTriggerRef.current=!1;const W=j.target;if(ke(Q.current,W)||ke(i.select("positionerElement"),W)||W===Q.current||W!=null&&wt(W)===i.select("rootId"))return;const z=fo(Q.current);j.clientX>=z.left-Be&&j.clientX<=z.right+Be&&j.clientY>=z.top-Be&&j.clientY<=z.bottom+Be||k.events.emit("close",{domEvent:j,reason:fn})});n.useEffect(()=>{y&&i.select("lastOpenChangeReason")===we&&tt(Q.current).addEventListener("mouseup",p,{once:!0})},[y,p,i]);const B=w&&t.context.hasSubmenuOpen,m=Kn(a,{enabled:(I??B)&&!L&&t.type!=="context-menu"&&(!w||B&&!J),handleClose:Un({blockPointerEvents:!w}),mouseOnly:!0,move:!1,restMs:t.type===void 0?E:void 0,delay:{close:h},triggerElementRef:M,externalTree:k,isActiveTrigger:g}),ue=xo(y,i.select("lastOpenChangeReason")),ce=Vn(a,{enabled:!L&&t.type!=="context-menu",event:y&&w?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:t.type===void 0?ue:!1}),pe=jn(a,{enabled:!L&&B}),$=go({open:y,enabled:w,mouseDownAction:"open"}),ae=Rt([ce,pe]),te=n.useMemo(()=>({disabled:L,open:y}),[L,y]),U=i.useState("triggerProps",J),A=[Q,r,Y,G,M],ie=[ae.getReferenceProps(),m??Fe,U,{"aria-haspopup":"menu",id:l,onMouseDown:j=>{if(i.select("open"))return;ee.start(200,()=>{i.context.allowMouseUpTriggerRef.current=!0}),tt(j.currentTarget).addEventListener("mouseup",p,{once:!0})}},w?{role:"menuitem"}:{},$,K,P],he=n.useRef(null),ge=xe(j=>{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))}),Qt(he.current)?.focus()}),le=xe(j=>{const W=i.select("positionerElement");if(W&&Zt(j,W))i.context.beforeContentFocusGuardRef.current?.focus();else{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))});let z=en(i.context.triggerFocusTargetRef.current||M.current);for(;z!==null&&ke(W,z);){const Ie=z;if(z=tn(z),z===Ie)break}z?.focus()}}),ye=Ae("button",o,{enabled:!w,stateAttributesMapping:ut,state:te,ref:A,props:ie});return w?V.jsx(po,{tag:"button",render:u,className:d,state:te,refs:A,props:ie,stateAttributesMapping:ut}):y?V.jsxs(n.Fragment,{children:[V.jsx(ct,{ref:he,onFocus:ge},`${l}-pre-focus-guard`),V.jsx(n.Fragment,{children:ye},l),V.jsx(ct,{ref:i.context.triggerFocusTargetRef,onFocus:le},`${l}-post-focus-guard`)]}):V.jsx(n.Fragment,{children:ye},l)});function xo(e,o){const r=Ee(),[u,d]=n.useState(!1);return fe(()=>{e&&o==="trigger-hover"?(d(!0),r.start(nn,()=>{d(!1)})):e||(r.clear(),d(!1))},[e,o,r]),u}function ho(){const e=Ye(!0),o=ve(!0),r=St();return n.useMemo(()=>r?{type:"menubar",context:r}:e&&!o?{type:"context-menu",context:e}:{type:void 0},[e,o,r])}function Oo({children:e,...o}){return V.jsx(lo,{...o,children:e})}function So({className:e,...o}){return V.jsx(mo,{className:nt(e),...o})}function wo({className:e,side:o="bottom",align:r="end",children:u}){return V.jsx(oo,{children:V.jsx(ro,{side:o,align:r,children:V.jsx(to,{className:nt("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:u})})})}function ko({className:e,...o}){return V.jsx(Jn,{className:nt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...o})}export{Oo as M,So as a,wo as b,ko as c};
|
|
1
|
+
import{r as n,j as V,w as Qe}from"./main-CEuT8-Qi.js";import{ab as Fe,ah as Ge,ac as Ne,ad as Ze,t as Nt,ag as Ae,u as At,c as nt}from"./button-DNC5N25i.js";import{u as mt,a as Ee,b as Te,c as ot,d as xt,e as Dt,p as ht,t as Lt,F as Ht,D as Kt,P as Ut,f as jt,R as Bt,g as Vt,h as _t,i as X,j as yt,k as Gt,l as bt,m as Wt,n as zt,o as qt,q as Yt,r as Rt,s as $t,T as Xt,v as Jt,w as Qt,x as Zt,y as en,z as tn,A as ut,B as ct,C as nn}from"./popupStateMapping-D5k-jOeY.js";import{g as re,t as Ve,u as fe,a as xe,l as _e,i as et,j as We,f as vt,k as It,d as Ct,o as on,m as we,s as Se,p as rn,q as lt,r as sn,v as an,w as un,x as cn,b as ln,y as fn}from"./useButton-DVAfkehQ.js";import{e as dn,F as pn,I as gn,i as mn,f as xn,g as hn,h as yn}from"./use-file-explorer-state-DppKEjcl.js";import{u as bn}from"./DirectionContext-DRcND-Cm.js";import{i as ft,f as Rn,g as vn,h as In,j as Cn,d as dt,k as Mn,e as ke,s as me,a as ze,b as De,c as Le,l as Tn,m as En,n as Pn,A as Mt,o as tt}from"./owner-CFRNz_Tp.js";import{h as pt,g as $e,a as gt,c as On,i as Xe,b as Sn,d as wn,e as kn,f as Ue,j as Fn,C as Nn,u as An}from"./useCompositeItem-CzdGhGcj.js";import{u as Dn,e as Ln,f as Hn,h as Kn,i as Un,j as jn}from"./tooltip-D57Pal0B.js";import{C as Bn}from"./composite-Bliqcmg4.js";function Vn(e,o={}){const r="rootStore"in e?e.rootStore:e,u=r.context.dataRef,{enabled:d=!0,event:x="click",toggle:N=!0,ignoreMouse:s=!1,stickIfOpen:I=!0,touchOpenDelay:E=0}=o,h=n.useRef(void 0),T=mt(),S=Ee(),K=n.useMemo(()=>({onPointerDown(b){h.current=b.pointerType},onMouseDown(b){const i=h.current,l=b.nativeEvent,g=r.select("open");if(b.button!==0||x==="click"||ft(i,!0)&&s)return;const a=u.current.openEvent,y=a?.type,M=r.select("domReferenceElement")!==b.currentTarget,t=g&&M||!(g&&N&&(!(a&&I)||y==="click"||y==="mousedown"));if(vn(l.target)){const v=re(Ve,l,l.target);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v);return}const R=b.currentTarget;T.request(()=>{const v=re(Ve,l,R);t&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,v)}):r.setOpen(t,v)})},onClick(b){if(x==="mousedown-only")return;const i=h.current;if(x==="mousedown"&&i){h.current=void 0;return}if(ft(i,!0)&&s)return;const l=r.select("open"),g=u.current.openEvent,a=r.select("domReferenceElement")!==b.currentTarget,y=l&&a||!(l&&N&&(!(g&&I)||Rn(g))),M=re(Ve,b.nativeEvent,b.currentTarget);y&&i==="touch"&&E>0?S.start(E,()=>{r.setOpen(!0,M)}):r.setOpen(y,M)},onKeyDown(){h.current=void 0}}),[u,x,s,r,I,N,T,S,E]);return n.useMemo(()=>d?{reference:K}:Fe,[d,K])}const _n="Escape";function qe(e,o,r){switch(e){case"vertical":return o;case"horizontal":return r;default:return o||r}}function je(e,o){return qe(o,e===Mt||e===ze,e===De||e===Le)}function Je(e,o,r){return qe(o,e===ze,r?e===De:e===Le)||e==="Enter"||e===" "||e===""}function Gn(e,o,r){return qe(o,r?e===De:e===Le,e===ze)}function Wn(e,o,r,u){const d=r?e===Le:e===De,x=e===Mt;return o==="both"||o==="horizontal"&&u&&u>1?e===_n:qe(o,d,x)}function zn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.useState("floatingElement"),x=r.useState("domReferenceElement"),N=r.context.dataRef,{listRef:s,activeIndex:I,onNavigate:E=()=>{},enabled:h=!0,selectedIndex:T=null,allowEscape:S=!1,loopFocus:K=!1,nested:b=!1,rtl:i=!1,virtual:l=!1,focusItemOnOpen:g="auto",focusItemOnHover:a=!0,openOnArrowKeyDown:y=!0,disabledIndices:M=void 0,orientation:t="vertical",parentOrientation:R,cols:v=1,scrollItemIntoView:k=!0,itemSizes:F,dense:se=!1,id:G,resetOnPointerLeave:J=!0,externalTree:w}=o,q=In(d),L=Te(q),P=ot(),Y=xt(w);fe(()=>{N.current.orientation=t},[N,t]);const Q=Cn(x),ee=n.useRef(g),p=n.useRef(T??-1),B=n.useRef(null),Z=n.useRef(!0),m=xe(c=>{E(p.current===-1?null:p.current,c)}),ue=n.useRef(m),ce=n.useRef(!!d),pe=n.useRef(u),$=n.useRef(!1),ae=n.useRef(!1),te=Te(M),U=Te(u),A=Te(k),ie=Te(T),he=Te(J),ge=xe(()=>{function c(_){l?Y?.events.emit("virtualfocus",_):dn(_,{sync:$.current,preventScroll:!0})}const O=s.current[p.current],f=ae.current;O&&c(O),($.current?_=>_():requestAnimationFrame)(()=>{const _=s.current[p.current]||O;if(!_)return;O||c(_);const ne=A.current;ne&&ye&&(f||!Z.current)&&_.scrollIntoView?.(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne)})});fe(()=>{h&&(u&&d?(p.current=T??-1,ee.current&&T!=null&&(ae.current=!0,m())):ce.current&&(p.current=-1,ue.current()))},[h,u,d,T,m]),fe(()=>{if(h){if(!u){$.current=!1;return}if(d)if(I==null){if($.current=!1,ie.current!=null)return;if(ce.current&&(p.current=-1,ge()),(!pe.current||!ce.current)&&ee.current&&(B.current!=null||ee.current===!0&&B.current==null)){let c=0;const O=()=>{s.current[0]==null?(c<2&&(c?requestAnimationFrame:queueMicrotask)(O),c+=1):(p.current=B.current==null||Je(B.current,t,i)||b?$e(s):gt(s),B.current=null,m())};O()}}else pt(s,I)||(p.current=I,ge(),ae.current=!1)}},[h,u,d,I,ie,b,s,t,i,m,ge,te]),fe(()=>{if(!h||d||!Y||l||!ce.current)return;const c=Y.nodesRef.current,O=c.find(_=>_.id===P)?.context?.elements.floating,f=dt(Mn(d)),H=c.some(_=>_.context&&ke(_.context.elements.floating,f));O&&!H&&Z.current&&O.focus({preventScroll:!0})},[h,d,Y,P,l]),fe(()=>{ue.current=m,pe.current=u,ce.current=!!d}),fe(()=>{u||(B.current=null,ee.current=g)},[u,g]);const le=I!=null,ye=n.useMemo(()=>{function c(f){if(!U.current)return;const H=s.current.indexOf(f.currentTarget);H!==-1&&p.current!==H&&(p.current=H,m(f))}return{onFocus(f){$.current=!0,c(f)},onClick:({currentTarget:f})=>f.focus({preventScroll:!0}),onMouseMove(f){$.current=!0,ae.current=!1,a&&c(f)},onPointerLeave(f){if(!U.current||!Z.current||f.pointerType==="touch")return;$.current=!0;const H=f.relatedTarget;!a||s.current.includes(H)||he.current&&(p.current=-1,m(f),l||L.current?.focus({preventScroll:!0}))}}},[U,L,a,s,m,he,l]),j=n.useCallback(()=>R??Y?.nodesRef.current.find(c=>c.id===P)?.context?.dataRef?.current.orientation,[P,Y,R]),W=xe(c=>{if(Z.current=!1,$.current=!0,c.which===229||!U.current&&c.currentTarget===L.current)return;if(b&&Wn(c.key,t,i,v)){je(c.key,j())||me(c),r.setOpen(!1,re(_e,c.nativeEvent)),et(x)&&(l?Y?.events.emit("virtualfocus",x):x.focus());return}const O=p.current,f=$e(s,M),H=gt(s,M);if(Q||(c.key==="Home"&&(me(c),p.current=f,m(c)),c.key==="End"&&(me(c),p.current=H,m(c))),v>1){const _=F||Array.from({length:s.current.length},()=>({width:1,height:1})),ne=On(_,v,se),be=ne.findIndex(de=>de!=null&&!Xe(s,de,M)),Pe=ne.reduce((de,Re,C)=>Re!=null&&!Xe(s,Re,M)?C:de,-1),Me=ne[Sn({current:ne.map(de=>de!=null?s.current[de]:null)},{event:c,orientation:t,loopFocus:K,rtl:i,cols:v,disabledIndices:kn([...(typeof M!="function"?M:null)||s.current.map((de,Re)=>Xe(s,Re,M)?Re:void 0),void 0],ne),minIndex:be,maxIndex:Pe,prevIndex:wn(p.current>H?f:p.current,_,ne,v,c.key===ze?"bl":c.key===(i?De:Le)?"tr":"tl"),stopEvent:!0})];if(Me!=null&&(p.current=Me,m(c)),t==="both")return}if(je(c.key,t)){if(me(c),u&&!l&&dt(c.currentTarget.ownerDocument)===c.currentTarget){p.current=Je(c.key,t,i)?f:H,m(c);return}Je(c.key,t,i)?K?O>=H?S&&O!==s.current.length?p.current=-1:($.current=!1,p.current=f):p.current=Ue(s,{startingIndex:O,disabledIndices:M}):p.current=Math.min(H,Ue(s,{startingIndex:O,disabledIndices:M})):K?O<=f?S&&O!==-1?p.current=s.current.length:($.current=!1,p.current=H):p.current=Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M}):p.current=Math.max(f,Ue(s,{startingIndex:O,decrement:!0,disabledIndices:M})),pt(s,p.current)&&(p.current=-1),m(c)}}),z=n.useMemo(()=>l&&u&&le&&{"aria-activedescendant":`${G}-${I}`},[l,u,le,G,I]),Ie=n.useMemo(()=>({"aria-orientation":t==="both"?void 0:t,...Q?{}:z,onKeyDown(c){if(c.key==="Tab"&&c.shiftKey&&u&&!l){const O=Tn(c.nativeEvent);if(O&&!ke(L.current,O))return;me(c),r.setOpen(!1,re(We,c.nativeEvent)),et(x)&&x.focus();return}W(c)},onPointerMove(){Z.current=!0}}),[z,W,L,t,Q,r,u,l,x]),Ce=n.useMemo(()=>{function c(f){g==="auto"&&En(f.nativeEvent)&&(ee.current=!l)}function O(f){ee.current=g,g==="auto"&&Pn(f.nativeEvent)&&(ee.current=!0)}return{onKeyDown(f){const H=r.select("open");Z.current=!1;const _=f.key.startsWith("Arrow"),ne=Gn(f.key,j(),i),be=je(f.key,t),Pe=(b?ne:be)||f.key==="Enter"||f.key.trim()==="";if(l&&H)return W(f);if(!(!H&&!y&&_)){if(Pe){const Me=je(f.key,j());B.current=b&&Me?null:f.key}if(b){ne&&(me(f),H?(p.current=$e(s,te.current),m(f)):r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)));return}be&&(ie.current!=null&&(p.current=ie.current),me(f),!H&&y?r.setOpen(!0,re(_e,f.nativeEvent,f.currentTarget)):W(f),H&&m(f))}},onFocus(f){r.select("open")&&!l&&(p.current=-1,m(f))},onPointerDown:O,onPointerEnter:O,onMouseDown:c,onClick:c}},[W,te,g,s,b,m,r,y,t,j,i,ie,l]),He=n.useMemo(()=>({...z,...Ce}),[z,Ce]);return n.useMemo(()=>h?{reference:He,floating:Ie,item:ye,trigger:Ce}:{},[h,He,Ie,Ce,ye])}function qn(e,o){const r="rootStore"in e?e.rootStore:e,u=r.useState("open"),d=r.context.dataRef,{listRef:x,activeIndex:N,onMatch:s,onTypingChange:I,enabled:E=!0,findMatch:h=null,resetMs:T=750,ignoreKeys:S=Ge,selectedIndex:K=null}=o,b=Ee(),i=n.useRef(""),l=n.useRef(K??N??-1),g=n.useRef(null);fe(()=>{u&&(b.clear(),g.current=null,i.current="")},[u,b]),fe(()=>{u&&i.current===""&&(l.current=K??N??-1)},[u,K,N]);const a=xe(R=>{R?d.current.typing||(d.current.typing=R,I?.(R)):d.current.typing&&(d.current.typing=R,I?.(R))}),y=xe(R=>{function v(J,w,q){const L=h?h(w,q):w.find(P=>P?.toLocaleLowerCase().indexOf(q.toLocaleLowerCase())===0);return L?J.indexOf(L):-1}const k=x.current;if(i.current.length>0&&i.current[0]!==" "&&(v(k,k,i.current)===-1?a(!1):R.key===" "&&me(R)),k==null||S.includes(R.key)||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;u&&R.key!==" "&&(me(R),a(!0)),k.every(J=>J?J[0]?.toLocaleLowerCase()!==J[1]?.toLocaleLowerCase():!0)&&i.current===R.key&&(i.current="",l.current=g.current),i.current+=R.key,b.start(T,()=>{i.current="",l.current=g.current,a(!1)});const se=l.current,G=v(k,[...k.slice((se||0)+1),...k.slice(0,(se||0)+1)],i.current);G!==-1?(s?.(G),g.current=G):R.key!==" "&&(i.current="",a(!1))}),M=n.useMemo(()=>({onKeyDown:y}),[y]),t=n.useMemo(()=>({onKeyDown:y,onKeyUp(R){R.key===" "&&a(!1)}}),[y,a]);return n.useMemo(()=>E?{reference:M,floating:t}:{},[E,M,t])}const Tt=n.createContext(void 0);function Et(e){const o=n.useContext(Tt);if(o===void 0&&!e)throw new Error(Ne(33));return o}const Pt=n.createContext(void 0);function ve(e){const o=n.useContext(Pt);if(o===void 0&&!e)throw new Error(Ne(36));return o}const Yn=n.createContext(void 0);function Ye(e=!0){const o=n.useContext(Yn);if(o===void 0&&!e)throw new Error(Ne(25));return o}const $n={type:"regular-item"};function Xn(e){const{closeOnClick:o,disabled:r=!1,highlighted:u,id:d,store:x,nativeButton:N,itemMetadata:s,nodeId:I}=e,E=n.useRef(null),h=Ye(!0),T=h!==void 0,{events:S}=x.useState("floatingTreeRoot"),{getButtonProps:K,buttonRef:b}=vt({disabled:r,focusableWhenDisabled:!0,native:N}),i=n.useCallback(g=>Ze({id:d,role:"menuitem",tabIndex:u?0:-1,onMouseMove(a){I&&S.emit("itemhover",{nodeId:I,target:a.currentTarget})},onMouseEnter(){s.type==="submenu-trigger"&&s.setActive()},onKeyUp(a){a.key===" "&&x.context.typingRef.current&&a.preventBaseUIHandler()},onClick(a){o&&S.emit("close",{domEvent:a,reason:It})},onMouseUp(a){if(h){const y=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,T&&y&&Math.abs(a.clientX-y.x)<=1&&Math.abs(a.clientY-y.y)<=1)return}E.current&&x.context.allowMouseUpTriggerRef.current&&(!T||a.button===2)&&s.type==="regular-item"&&E.current.click()}},g,K),[d,u,K,o,S,x,T,h,s,I]),l=Nt(E,b);return n.useMemo(()=>({getItemProps:i,itemRef:l}),[i,l])}const Jn=n.forwardRef(function(o,r){const{render:u,className:d,id:x,label:N,nativeButton:s=!1,disabled:I=!1,closeOnClick:E=!0,...h}=o,T=Fn({label:N}),S=Et(!0),K=Ct(x),{store:b}=ve(),i=b.useState("isActive",T.index),l=b.useState("itemProps"),{getItemProps:g,itemRef:a}=Xn({closeOnClick:E,disabled:I,highlighted:i,id:K,store:b,nativeButton:s,nodeId:S?.nodeId,itemMetadata:$n}),y=n.useMemo(()=>({disabled:I,highlighted:i}),[I,i]);return Ae("div",o,{state:y,props:[l,h,g],ref:[a,r,T.ref]})}),Qn=n.createContext(void 0);function Zn(e){return n.useContext(Qn)}const eo={...ht,...Lt},to=n.forwardRef(function(o,r){const{render:u,className:d,finalFocus:x,...N}=o,{store:s}=ve(),{side:I,align:E}=Et(),h=Zn()!=null,T=s.useState("open"),S=s.useState("transitionStatus"),K=s.useState("popupProps"),b=s.useState("mounted"),i=s.useState("instantType"),l=s.useState("activeTriggerElement"),g=s.useState("parent"),a=s.useState("lastOpenChangeReason"),y=s.useState("rootId"),M=s.useState("floatingRootContext"),t=s.useState("floatingTreeRoot"),R=s.useState("closeDelay"),v=s.useState("activeTriggerElement"),k=g.type==="context-menu";Dt({open:T,ref:s.context.popupRef,onComplete(){T&&s.context.onOpenChangeComplete?.(!0)}}),n.useEffect(()=>{function q(L){s.setOpen(!1,re(L.reason,L.domEvent))}return t.events.on("close",q),()=>{t.events.off("close",q)}},[t.events,s]);const F=s.useState("hoverEnabled"),se=s.useState("disabled");Dn(M,{enabled:F&&!se&&!k&&g.type!=="menubar",closeDelay:R});const G=n.useMemo(()=>({transitionStatus:S,side:I,align:E,open:T,nested:g.type==="menu",instant:i}),[S,I,E,T,g.type,i]),J=Ae("div",o,{state:G,ref:[r,s.context.popupRef],stateAttributesMapping:eo,props:[K,{onKeyDown(q){h&&Bn.has(q.key)&&q.stopPropagation()}},Ln(S),N,{"data-rootownerid":y}]});let w=g.type===void 0||k;return(l||g.type==="menubar"&&a!==on)&&(w=!0),V.jsx(pn,{context:M,modal:k,disabled:!b,returnFocus:x===void 0?w:x,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?t:void 0,previousFocusableElement:v,nextFocusableElement:g.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:J})}),Ot=n.createContext(void 0);function no(){const e=n.useContext(Ot);if(e===void 0)throw new Error(Ne(32));return e}const oo=n.forwardRef(function(o,r){const{keepMounted:u=!1,...d}=o,{store:x}=ve();return x.useState("mounted")||u?V.jsx(Ot.Provider,{value:u,children:V.jsx(Ht,{ref:r,...d})}):null}),ro=n.forwardRef(function(o,r){const{anchor:u,positionMethod:d="absolute",className:x,render:N,side:s,align:I,sideOffset:E=0,alignOffset:h=0,collisionBoundary:T="clipping-ancestors",collisionPadding:S=5,arrowPadding:K=5,sticky:b=!1,disableAnchorTracking:i=!1,collisionAvoidance:l=Kt,...g}=o,{store:a}=ve(),y=no(),M=Ye(!0),t=a.useState("parent"),R=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),k=a.useState("mounted"),F=a.useState("open"),se=a.useState("modal"),G=a.useState("activeTriggerElement"),J=a.useState("lastOpenChangeReason"),w=a.useState("floatingNodeId"),q=a.useState("floatingParentNodeId");let L=u,P=E,Y=h,Q=I,ee=l;t.type==="context-menu"&&(L=u??t.context?.anchor,Q=Q??"start",!s&&Q!=="center"&&(Y=o.alignOffset??2,P=o.sideOffset??-5));let p=s,B=Q;t.type==="menu"?(p=p??"inline-end",B=B??"start",ee=o.collisionAvoidance??Ut):t.type==="menubar"&&(p=p??"bottom",B=B??"start");const Z=t.type==="context-menu",m=Hn({anchor:L,floatingRootContext:R,positionMethod:M?"fixed":d,mounted:k,side:p,sideOffset:P,align:B,alignOffset:Y,arrowPadding:Z?0:K,collisionBoundary:T,collisionPadding:S,sticky:b,nodeId:w,keepMounted:y,disableAnchorTracking:i,collisionAvoidance:ee,shiftCrossAxis:Z,externalTree:v}),ue=n.useMemo(()=>{const U={};return F||(U.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...m.positionerStyles,...U}}},[F,k,m.positionerStyles]);n.useEffect(()=>{function U(A){A.open?(A.parentNodeId===w&&a.set("hoverEnabled",!1),A.nodeId!==w&&A.parentNodeId===a.select("floatingParentNodeId")&&a.setOpen(!1,re(Se))):A.parentNodeId===w&&A.reason!==Se&&a.set("hoverEnabled",!0)}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[a,v.events,w]),n.useEffect(()=>{if(a.select("floatingParentNodeId")==null)return;function U(A){if(A.open||A.nodeId!==a.select("floatingParentNodeId"))return;const ie=A.reason??Se;a.setOpen(!1,re(ie))}return v.events.on("menuopenchange",U),()=>{v.events.off("menuopenchange",U)}},[v.events,a]),n.useEffect(()=>{function U(A){!F||A.nodeId!==a.select("floatingParentNodeId")||A.target&&G&&G!==A.target&&a.setOpen(!1,re(Se))}return v.events.on("itemhover",U),()=>{v.events.off("itemhover",U)}},[v.events,F,G,a]),n.useEffect(()=>{const U={open:F,nodeId:w,parentNodeId:q,reason:a.select("lastOpenChangeReason")};v.events.emit("menuopenchange",U)},[v.events,F,a,w,q]);const ce=n.useMemo(()=>({open:F,side:m.side,align:m.align,anchorHidden:m.anchorHidden,nested:t.type==="menu"}),[F,m.side,m.align,m.anchorHidden,t.type]),pe=n.useMemo(()=>({side:m.side,align:m.align,arrowRef:m.arrowRef,arrowUncentered:m.arrowUncentered,arrowStyles:m.arrowStyles,nodeId:m.context.nodeId}),[m.side,m.align,m.arrowRef,m.arrowUncentered,m.arrowStyles,m.context.nodeId]),$=Ae("div",o,{state:ce,stateAttributesMapping:ht,ref:[r,a.useStateSetter("positionerElement")],props:[ue,g]}),ae=k&&t.type!=="menu"&&(t.type!=="menubar"&&se&&J!==we||t.type==="menubar"&&t.context.modal);let te=null;return t.type==="menubar"?te=t.context.contentElement:t.type===void 0&&(te=G),V.jsxs(Tt.Provider,{value:pe,children:[ae&&V.jsx(gn,{ref:t.type==="context-menu"||t.type==="nested-context-menu"?t.context.internalBackdropRef:null,inert:mn(!F),cutout:te}),V.jsx(jt,{id:w,children:V.jsx(Nn,{elementsRef:a.context.itemDomElements,labelsRef:a.context.itemLabels,children:$})})]})}),so=n.createContext(null);function St(e){return n.useContext(so)}const io={..._t,disabled:X(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:X(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:X(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:X(e=>e.stickIfOpen),parent:X(e=>e.parent),rootId:X(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:X(e=>e.activeIndex),isActive:X((e,o)=>e.activeIndex===o),hoverEnabled:X(e=>e.hoverEnabled),instantType:X(e=>e.instantType),lastOpenChangeReason:X(e=>e.openChangeReason),floatingTreeRoot:X(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:X(e=>e.floatingNodeId),floatingParentNodeId:X(e=>e.floatingParentNodeId),itemProps:X(e=>e.itemProps),closeDelay:X(e=>e.closeDelay),keyboardEventRelay:X(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class rt extends Bt{constructor(o){super({...ao(),...o},{positionerRef:n.createRef(),popupRef:n.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:n.createRef(),beforeContentFocusGuardRef:n.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vt},io),this.observe(X(r=>r.allowMouseEnter),(r,u)=>{this.state.parent.type==="menu"&&r!==u&&this.state.parent.store.set("allowMouseEnter",r)}),this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(o,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:o,eventDetails:r})}static useStore(o,r){const u=At(()=>new rt(r)).current;return o??u}unsubscribeParentListener=null}function ao(){return{...Gt(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new yt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fe,keyboardEventRelay:void 0,closeDelay:0}}const uo=n.createContext(void 0);function co(){return n.useContext(uo)}function lo(e){const{children:o,open:r,onOpenChange:u,onOpenChangeComplete:d,defaultOpen:x=!1,disabled:N=!1,modal:s,loopFocus:I=!0,orientation:E="vertical",actionsRef:h,closeParentOnEsc:T=!1,handle:S,triggerId:K,defaultTriggerId:b=null,highlightItemOnHover:i=!0}=e,l=Ye(!0),g=ve(!0),a=St(),y=co(),M=n.useMemo(()=>y&&g?{type:"menu",store:g.store}:a?{type:"menubar",context:a}:l&&!g?{type:"context-menu",context:l}:{type:void 0},[l,g,a,y]),t=rt.useStore(S?.store,{parent:M}),R=t.useState("floatingTreeRoot"),v=bt(R),k=ot();fe(()=>{l&&!g?t.update({parent:{type:"context-menu",context:l},floatingNodeId:v,floatingParentNodeId:k}):g&&t.update({floatingNodeId:v,floatingParentNodeId:k})},[l,g,v,k,t]),t.useControlledProp("open",r,x),t.useControlledProp("activeTriggerId",K,b),t.useContextCallback("onOpenChangeComplete",d);const F=t.useState("open"),se=t.useState("activeTriggerElement"),G=t.useState("positionerElement"),J=t.useState("hoverEnabled"),w=t.useState("modal"),q=t.useState("disabled"),L=t.useState("lastOpenChangeReason"),P=t.useState("parent"),Y=t.useState("activeIndex"),Q=t.useState("payload"),ee=t.useState("floatingParentNodeId"),p=n.useRef(null),B=ee!=null;let Z;t.useSyncedValues({disabled:N,modal:P.type===void 0?s:void 0,rootId:rn()});const{openMethod:m,triggerProps:ue,reset:ce}=xn(F);Wt(t);const{forceUnmount:pe}=zt(F,t,()=>{t.update({allowMouseEnter:!1,stickIfOpen:!0}),ce()}),$=n.useRef(P.type!=="context-menu"),ae=Ee();n.useEffect(()=>{if(F||(p.current=null),P.type==="context-menu"){if(!F){ae.clear(),$.current=!1;return}ae.start(500,()=>{$.current=!0})}},[ae,F,P.type]),hn(F&&w&&L!==we&&m!=="touch",G),fe(()=>{!F&&!J&&t.set("hoverEnabled",!0)},[F,J,t]);const te=n.useRef(!0),U=Ee(),A=xe((C,D)=>{const oe=D.reason;if(F===C&&D.trigger===se&&L===oe||(D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},!C&&D.trigger==null&&(D.trigger=se??void 0),u?.(C,D),D.isCanceled))return;const kt={open:C,nativeEvent:D.event,reason:D.reason,nested:B};Z?.emit("openchange",kt);const Ke=D.event;if(C===!1&&Ke?.type==="click"&&Ke.pointerType==="touch"&&!te.current)return;if(!C&&Y!==null){const Oe=t.context.itemDomElements.current[Y];queueMicrotask(()=>{Oe?.setAttribute("tabindex","-1")})}C&&oe===lt?(te.current=!1,U.start(300,()=>{te.current=!0})):(te.current=!0,U.clear());const st=(oe===Ve||oe===It)&&Ke.detail===0&&Ke?.isTrusted,Ft=!C&&(oe===sn||oe==null);function it(){const Oe={open:C,openChangeReason:oe};p.current=D.event??null;const at=D.trigger?.id??null;(at||C)&&(Oe.activeTriggerId=at,Oe.activeTriggerElement=D.trigger??null),t.update(Oe)}oe===we?Qe.flushSync(it):it(),P.type==="menubar"&&(oe===lt||oe===We||oe===we||oe===_e||oe===Se)?t.set("instantType","group"):st||Ft?t.set("instantType",st?"click":"dismiss"):t.set("instantType",void 0)}),ie=n.useCallback(C=>{const D=re(C);return D.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},D},[t]),he=n.useCallback(()=>{t.setOpen(!1,ie(an))},[t,ie]);n.useImperativeHandle(h,()=>({unmount:pe,close:he}),[pe,he]);let ge;P.type==="context-menu"&&(ge=P.context),n.useImperativeHandle(ge?.positionerRef,()=>G,[G]),n.useImperativeHandle(ge?.actionsRef,()=>({setOpen:A}),[A]);const le=qt({popupStore:t,onOpenChange:A});Z=le.context.events,n.useEffect(()=>{const C=({open:D,eventDetails:oe})=>A(D,oe);return Z.on("setOpen",C),()=>{Z?.off("setOpen",C)}},[Z,A]);const ye=Yt(le,{enabled:!q,bubbles:{escapeKey:T&&P.type==="menu"},outsidePress(){return P.type!=="context-menu"||p.current?.type==="contextmenu"?!0:$.current},externalTree:B?R:void 0}),j=yn(le,{role:"menu"}),W=bn(),z=n.useCallback(C=>{t.select("activeIndex")!==C&&t.set("activeIndex",C)},[t]),Ie=zn(le,{enabled:!q,listRef:t.context.itemDomElements,activeIndex:Y,nested:P.type!==void 0,loopFocus:I,orientation:E,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:W==="rtl",disabledIndices:Ge,onNavigate:z,openOnArrowKeyDown:P.type!=="context-menu",externalTree:B?R:void 0,focusItemOnHover:i}),Ce=n.useCallback(C=>{t.context.typingRef.current=C},[t]),He=qn(le,{listRef:t.context.itemLabels,activeIndex:Y,resetMs:Xt,onMatch:C=>{F&&C!==Y&&t.set("activeIndex",C)},onTypingChange:Ce}),{getReferenceProps:c,getFloatingProps:O,getItemProps:f,getTriggerProps:H}=Rt([ye,j,Ie,He]),_=n.useMemo(()=>{const C=Ze(c(),{onMouseEnter(){t.set("hoverEnabled",!0)},onMouseMove(){t.set("allowMouseEnter",!0)}},ue);return delete C.role,C},[c,t,ue]),ne=n.useMemo(()=>{const C=H();if(!C)return C;const D=Ze(C,ue);return delete D.role,delete D["aria-controls"],D},[H,ue]),be=mt(),Pe=n.useMemo(()=>O({onMouseEnter(){P.type==="menu"&&be.request(()=>t.set("hoverEnabled",!1))},onMouseMove(){t.set("allowMouseEnter",!0)},onClick(){t.select("hoverEnabled")&&t.set("hoverEnabled",!1)},onKeyDown(C){const D=t.select("keyboardEventRelay");D&&!C.isPropagationStopped()&&D(C)}}),[O,P.type,be,t]),Me=n.useMemo(()=>f(),[f]);t.useSyncedValues({floatingRootContext:le,activeTriggerProps:_,inactiveTriggerProps:ne,popupProps:Pe,itemProps:Me});const de=n.useMemo(()=>({store:t,parent:M}),[t,M]),Re=V.jsx(Pt.Provider,{value:de,children:typeof o=="function"?o({payload:Q}):o});return P.type===void 0||P.type==="context-menu"?V.jsx($t,{externalTree:R,children:Re}):Re}function fo(e){const o=e.getBoundingClientRect(),r=window.getComputedStyle(e,"::before"),u=window.getComputedStyle(e,"::after");if(!(r.content!=="none"||u.content!=="none"))return o;const x=parseFloat(r.width)||0,N=parseFloat(r.height)||0,s=parseFloat(u.width)||0,I=parseFloat(u.height)||0,E=Math.max(o.width,x,s),h=Math.max(o.height,N,I),T=E-o.width,S=h-o.height;return{left:o.left-T/2,right:o.right+T/2,top:o.top-S/2,bottom:o.bottom+S/2}}function po(e){const{render:o,className:r,state:u=Fe,props:d=Ge,refs:x=Ge,metadata:N,stateAttributesMapping:s,tag:I="div",...E}=e,{compositeProps:h,compositeRef:T}=An({metadata:N});return Ae(I,e,{state:u,ref:[...x,T],props:[h,...d,E],stateAttributesMapping:s})}function wt(e){if(et(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!un(e))return wt(cn(e))}function go(e){const{enabled:o=!0,mouseDownAction:r,open:u}=e,d=n.useRef(!1);return n.useMemo(()=>o?{onMouseDown:x=>{(r==="open"&&!u||r==="close"&&u)&&(d.current=!0,tt(x.currentTarget).addEventListener("click",()=>{d.current=!1},{once:!0}))},onClick:x=>{d.current&&(d.current=!1,x.preventBaseUIHandler())}}:Fe,[o,r,u])}const Be=2,mo=n.forwardRef(function(o,r){const{render:u,className:d,disabled:x=!1,nativeButton:N=!0,id:s,openOnHover:I,delay:E=100,closeDelay:h=0,handle:T,payload:S,...K}=o,b=ve(!0),i=T?.store??b?.store;if(!i)throw new Error(Ne(85));const l=Ct(s),g=i.useState("isTriggerActive",l),a=i.useState("floatingRootContext"),y=i.useState("isOpenedByTrigger",l),M=n.useRef(null),t=ho(),R=ln(!0),v=xt(),k=n.useMemo(()=>v??new yt,[v]),F=bt(k),se=ot(),{registerTrigger:G,isMountedByThisTrigger:J}=Jt(l,M,i,{payload:S,closeDelay:h,parent:t,floatingTreeRoot:k,floatingNodeId:F,floatingParentNodeId:se,keyboardEventRelay:R?.relayKeyboardEvent}),w=t.type==="menubar",q=i.useState("disabled"),L=x||q||w&&t.context.disabled,{getButtonProps:P,buttonRef:Y}=vt({disabled:L,native:N});n.useEffect(()=>{!y&&t.type===void 0&&(i.context.allowMouseUpTriggerRef.current=!1)},[i,y,t.type]);const Q=n.useRef(null),ee=Ee(),p=xe(j=>{if(!Q.current)return;ee.clear(),i.context.allowMouseUpTriggerRef.current=!1;const W=j.target;if(ke(Q.current,W)||ke(i.select("positionerElement"),W)||W===Q.current||W!=null&&wt(W)===i.select("rootId"))return;const z=fo(Q.current);j.clientX>=z.left-Be&&j.clientX<=z.right+Be&&j.clientY>=z.top-Be&&j.clientY<=z.bottom+Be||k.events.emit("close",{domEvent:j,reason:fn})});n.useEffect(()=>{y&&i.select("lastOpenChangeReason")===we&&tt(Q.current).addEventListener("mouseup",p,{once:!0})},[y,p,i]);const B=w&&t.context.hasSubmenuOpen,m=Kn(a,{enabled:(I??B)&&!L&&t.type!=="context-menu"&&(!w||B&&!J),handleClose:Un({blockPointerEvents:!w}),mouseOnly:!0,move:!1,restMs:t.type===void 0?E:void 0,delay:{close:h},triggerElementRef:M,externalTree:k,isActiveTrigger:g}),ue=xo(y,i.select("lastOpenChangeReason")),ce=Vn(a,{enabled:!L&&t.type!=="context-menu",event:y&&w?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:t.type===void 0?ue:!1}),pe=jn(a,{enabled:!L&&B}),$=go({open:y,enabled:w,mouseDownAction:"open"}),ae=Rt([ce,pe]),te=n.useMemo(()=>({disabled:L,open:y}),[L,y]),U=i.useState("triggerProps",J),A=[Q,r,Y,G,M],ie=[ae.getReferenceProps(),m??Fe,U,{"aria-haspopup":"menu",id:l,onMouseDown:j=>{if(i.select("open"))return;ee.start(200,()=>{i.context.allowMouseUpTriggerRef.current=!0}),tt(j.currentTarget).addEventListener("mouseup",p,{once:!0})}},w?{role:"menuitem"}:{},$,K,P],he=n.useRef(null),ge=xe(j=>{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))}),Qt(he.current)?.focus()}),le=xe(j=>{const W=i.select("positionerElement");if(W&&Zt(j,W))i.context.beforeContentFocusGuardRef.current?.focus();else{Qe.flushSync(()=>{i.setOpen(!1,re(We,j.nativeEvent,j.currentTarget))});let z=en(i.context.triggerFocusTargetRef.current||M.current);for(;z!==null&&ke(W,z);){const Ie=z;if(z=tn(z),z===Ie)break}z?.focus()}}),ye=Ae("button",o,{enabled:!w,stateAttributesMapping:ut,state:te,ref:A,props:ie});return w?V.jsx(po,{tag:"button",render:u,className:d,state:te,refs:A,props:ie,stateAttributesMapping:ut}):y?V.jsxs(n.Fragment,{children:[V.jsx(ct,{ref:he,onFocus:ge},`${l}-pre-focus-guard`),V.jsx(n.Fragment,{children:ye},l),V.jsx(ct,{ref:i.context.triggerFocusTargetRef,onFocus:le},`${l}-post-focus-guard`)]}):V.jsx(n.Fragment,{children:ye},l)});function xo(e,o){const r=Ee(),[u,d]=n.useState(!1);return fe(()=>{e&&o==="trigger-hover"?(d(!0),r.start(nn,()=>{d(!1)})):e||(r.clear(),d(!1))},[e,o,r]),u}function ho(){const e=Ye(!0),o=ve(!0),r=St();return n.useMemo(()=>r?{type:"menubar",context:r}:e&&!o?{type:"context-menu",context:e}:{type:void 0},[e,o,r])}function Oo({children:e,...o}){return V.jsx(lo,{...o,children:e})}function So({className:e,...o}){return V.jsx(mo,{className:nt(e),...o})}function wo({className:e,side:o="bottom",align:r="end",children:u}){return V.jsx(oo,{children:V.jsx(ro,{side:o,align:r,children:V.jsx(to,{className:nt("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:u})})})}function ko({className:e,...o}){return V.jsx(Jn,{className:nt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...o})}export{Oo as M,So as a,wo as b,ko as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./main-
|
|
1
|
+
import{j as t}from"./main-CEuT8-Qi.js";function a({className:e}){return t.jsx("div",{className:e,children:t.jsx("span",{className:"text-xl",children:"🦎"})})}function i({className:e}){return t.jsx("span",{className:e,style:{background:"linear-gradient(90deg, #10b981, #14b8a6, #06b6d4, #8b5cf6, #ec4899)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",fontWeight:600},children:"OpenCami"})}export{a as O,i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l}from"./main-
|
|
1
|
+
import{r as l}from"./main-CEuT8-Qi.js";import{c as p,i as d}from"./useButton-DVAfkehQ.js";const m=[];function y(t){l.useEffect(t,m)}const r=typeof navigator<"u",e=h(),u=T(),c=g(),P=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),R=e.platform==="MacIntel"&&e.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(e.platform),S=r&&/apple/i.test(navigator.vendor),s=r&&/android/i.test(u)||/android/i.test(c),D=r&&u.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,f=c.includes("jsdom/");function h(){if(!r)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t?.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function g(){if(!r)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:o,version:n})=>`${o}/${n}`).join(" "):navigator.userAgent}function T(){if(!r)return"";const t=navigator.userAgentData;return t?.platform?t.platform:navigator.platform??""}const i="data-base-ui-focusable",x="active",k="selected",E="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",C="ArrowLeft",O="ArrowRight",v="ArrowUp",L="ArrowDown";function _(t){let o=t.activeElement;for(;o?.shadowRoot?.activeElement!=null;)o=o.shadowRoot.activeElement;return o}function W(t,o){if(!t||!o)return!1;const n=o.getRootNode?.();if(t.contains(o))return!0;if(n&&p(n)){let a=o;for(;a;){if(t===a)return!0;a=a.parentNode||a.host}}return!1}function M(t){return"composedPath"in t?t.composedPath()[0]:t.target}function F(t,o){if(o==null)return!1;if("composedPath"in t)return t.composedPath().includes(o);const n=t;return n.target!=null&&o.contains(n.target)}function I(t){return t.matches("html,body")}function N(t){return t?.ownerDocument||document}function A(t){return d(t)&&t.matches(E)}function U(t){return t?t.getAttribute("role")==="combobox"&&A(t):!1}function V(t){if(!t||f)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Y(t){return t?t.hasAttribute(i)?t:t.querySelector(`[${i}]`)||t:null}function j(t){t.preventDefault(),t.stopPropagation()}function B(t){return"nativeEvent"in t}function K(t){return t.mozInputSource===0&&t.isTrusted?!0:s&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function $(t){return f?!1:!s&&t.width===0&&t.height===0||s&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function q(t,o){const n=["mouse","pen"];return o||n.push("",void 0),n.includes(t)}function z(t){const o=t.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}function H(t){return t?.ownerDocument||document}export{v as A,i as F,k as S,E as T,L as a,C as b,O as c,_ as d,W as e,z as f,A as g,Y as h,q as i,U as j,N as k,M as l,K as m,$ as n,H as o,R as p,P as q,V as r,j as s,D as t,y as u,S as v,B as w,I as x,F as y,x as z};
|