From bd4b79bd7b66cf456ddb21e51429cca8c005fa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Mon, 13 Apr 2026 09:13:38 +0000 Subject: [PATCH] fix(ui): Projection ref params now filter objects by matching type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RefCombobox infers object_type from param name when not explicitly set - e.g. param 'agent' automatically shows only agent-type objects - Also fixed engine type signature to preserve object_type in params 小橘 🍊(NEKO Team) --- packages/engine/src/engine.ts | 2 +- packages/engine/src/ui.html | 26 ++++++++--------- .../engine/ui/src/components/Projections.tsx | 29 ++++++++++++++----- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/packages/engine/src/engine.ts b/packages/engine/src/engine.ts index 25279b7..1c17c54 100644 --- a/packages/engine/src/engine.ts +++ b/packages/engine/src/engine.ts @@ -478,7 +478,7 @@ export async function createProjectionDef( db: D1Database, name: string, sources: Array<{ event_def: string; bindings: Record; expression: string }>, - params: Record, + params: Record, valueSchema: { type: string }, initialValue: any, ): Promise<{ name: string; hash: string }> { diff --git a/packages/engine/src/ui.html b/packages/engine/src/ui.html index ea00c41..9c7618e 100644 --- a/packages/engine/src/ui.html +++ b/packages/engine/src/ui.html @@ -12,7 +12,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var If;function x0(){if(If)return be;If=1;var n=Symbol.for("react.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),E=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=E&&T[E]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function j(T,R,re){this.props=T,this.context=R,this.refs=C,this.updater=re||b}j.prototype.isReactComponent={},j.prototype.setState=function(T,R){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,R,"setState")},j.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function I(){}I.prototype=j.prototype;function L(T,R,re){this.props=T,this.context=R,this.refs=C,this.updater=re||b}var P=L.prototype=new I;P.constructor=L,S(P,j.prototype),P.isPureReactComponent=!0;var M=Array.isArray,A=Object.prototype.hasOwnProperty,H={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function ee(T,R,re){var le,pe={},U=null,me=null;if(R!=null)for(le in R.ref!==void 0&&(me=R.ref),R.key!==void 0&&(U=""+R.key),R)A.call(R,le)&&!q.hasOwnProperty(le)&&(pe[le]=R[le]);var ie=arguments.length-2;if(ie===1)pe.children=re;else if(1>>1,R=D[T];if(0>>1;Ta(pe,K))Ua(me,pe)?(D[T]=me,D[U]=K,T=U):(D[T]=pe,D[le]=K,T=le);else if(Ua(me,K))D[T]=me,D[U]=K,T=U;else break e}}return X}function a(D,X){var K=D.sortIndex-X.sortIndex;return K!==0?K:D.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var h=[],v=[],x=1,E=null,w=3,b=!1,S=!1,C=!1,j=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(D){for(var X=o(v);X!==null;){if(X.callback===null)s(v);else if(X.startTime<=D)s(v),X.sortIndex=X.expirationTime,l(h,X);else break;X=o(v)}}function M(D){if(C=!1,P(D),!S)if(o(h)!==null)S=!0,ce(A);else{var X=o(v);X!==null&&ve(M,X.startTime-D)}}function A(D,X){S=!1,C&&(C=!1,I(ee),ee=-1),b=!0;var K=w;try{for(P(X),E=o(h);E!==null&&(!(E.expirationTime>X)||D&&!Q());){var T=E.callback;if(typeof T=="function"){E.callback=null,w=E.priorityLevel;var R=T(E.expirationTime<=X);X=n.unstable_now(),typeof R=="function"?E.callback=R:E===o(h)&&s(h),P(X)}else s(h);E=o(h)}if(E!==null)var re=!0;else{var le=o(v);le!==null&&ve(M,le.startTime-X),re=!1}return re}finally{E=null,w=K,b=!1}}var H=!1,q=null,ee=-1,he=5,J=-1;function Q(){return!(n.unstable_now()-JD||125T?(D.sortIndex=K,l(v,D),o(h)===null&&D===o(v)&&(C?(I(ee),ee=-1):C=!0,ve(M,K-T))):(D.sortIndex=R,l(h,D),S||b||(S=!0,ce(A))),D},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(D){var X=w;return function(){var K=w;w=X;try{return D.apply(this,arguments)}finally{w=K}}}})(za)),za}var Wf;function E0(){return Wf||(Wf=1,Aa.exports=S0()),Aa.exports}/** + */var zf;function S0(){return zf||(zf=1,(function(n){function l(D,X){var K=D.length;D.push(X);e:for(;0>>1,R=D[T];if(0>>1;Ta(pe,K))Ua(me,pe)?(D[T]=me,D[U]=K,T=U):(D[T]=pe,D[le]=K,T=le);else if(Ua(me,K))D[T]=me,D[U]=K,T=U;else break e}}return X}function a(D,X){var K=D.sortIndex-X.sortIndex;return K!==0?K:D.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var h=[],v=[],w=1,E=null,x=3,b=!1,S=!1,C=!1,j=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(D){for(var X=o(v);X!==null;){if(X.callback===null)s(v);else if(X.startTime<=D)s(v),X.sortIndex=X.expirationTime,l(h,X);else break;X=o(v)}}function M(D){if(C=!1,P(D),!S)if(o(h)!==null)S=!0,ce(A);else{var X=o(v);X!==null&&ve(M,X.startTime-D)}}function A(D,X){S=!1,C&&(C=!1,I(ee),ee=-1),b=!0;var K=x;try{for(P(X),E=o(h);E!==null&&(!(E.expirationTime>X)||D&&!Q());){var T=E.callback;if(typeof T=="function"){E.callback=null,x=E.priorityLevel;var R=T(E.expirationTime<=X);X=n.unstable_now(),typeof R=="function"?E.callback=R:E===o(h)&&s(h),P(X)}else s(h);E=o(h)}if(E!==null)var re=!0;else{var le=o(v);le!==null&&ve(M,le.startTime-X),re=!1}return re}finally{E=null,x=K,b=!1}}var H=!1,q=null,ee=-1,he=5,J=-1;function Q(){return!(n.unstable_now()-JD||125T?(D.sortIndex=K,l(v,D),o(h)===null&&D===o(v)&&(C?(I(ee),ee=-1):C=!0,ve(M,K-T))):(D.sortIndex=R,l(h,D),S||b||(S=!0,ce(A))),D},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(D){var X=x;return function(){var K=x;x=X;try{return D.apply(this,arguments)}finally{x=K}}}})(za)),za}var Wf;function E0(){return Wf||(Wf=1,Aa.exports=S0()),Aa.exports}/** * @license React * react-dom.production.min.js * @@ -36,7 +36,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Hf;function k0(){if(Hf)return ht;Hf=1;var n=Mi(),l=E0();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x={},E={};function w(e){return h.call(E,e)?!0:h.call(x,e)?!1:v.test(e)?E[e]=!0:(x[e]=!0,!1)}function b(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function S(e,t,r,i){if(t===null||typeof t>"u"||b(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,r,i,u,d,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=g}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];j[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){j[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function L(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,t,r,i){var u=j.hasOwnProperty(t)?j[t]:null;(u!==null?u.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,w={},E={};function x(e){return h.call(E,e)?!0:h.call(w,e)?!1:v.test(e)?E[e]=!0:(w[e]=!0,!1)}function b(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function S(e,t,r,i){if(t===null||typeof t>"u"||b(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,r,i,u,d,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=g}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];j[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){j[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function L(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(I,L);j[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,t,r,i){var u=j.hasOwnProperty(t)?j[t]:null;(u!==null?u.type!==0:i||!(2k||u[g]!==d[k]){var N=` @@ -46,13 +46,13 @@ Error generating stack: `+d.message+` `+d.stack}return{value:e,source:t,stack:u,digest:null}}function ia(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function sa(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Ug=typeof WeakMap=="function"?WeakMap:Map;function Bd(e,t,r){r=rn(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Zl||(Zl=!0,Sa=i),sa(e,t)},r}function Ud(e,t,r){r=rn(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var u=t.value;r.payload=function(){return i(u)},r.callback=function(){sa(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(r.callback=function(){sa(e,t),typeof i!="function"&&(jn===null?jn=new Set([this]):jn.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function Kd(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Ug;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(r)||(u.add(r),e=l0.bind(null,e,t,r),t.then(e,e))}function Qd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yd(e,t,r,i,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=rn(-1,1),t.tag=2,Cn(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var Kg=M.ReactCurrentOwner,ft=!1;function it(e,t,r,i){t.child=e===null?md(t,null,r,i):jr(t,e.child,r,i)}function Xd(e,t,r,i,u){r=r.render;var d=t.ref;return Pr(t,u),i=Js(e,t,r,i,d,u),r=Zs(),e!==null&&!ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,on(e,t,u)):($e&&r&&Ls(t),t.flags|=1,it(e,t,i,u),t.child)}function Gd(e,t,r,i,u){if(e===null){var d=r.type;return typeof d=="function"&&!Pa(d)&&d.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=d,qd(e,t,d,i,u)):(e=li(r.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&u)===0){var g=d.memoizedProps;if(r=r.compare,r=r!==null?r:mo,r(g,i)&&e.ref===t.ref)return on(e,t,u)}return t.flags|=1,e=Rn(d,i),e.ref=t.ref,e.return=t,t.child=e}function qd(e,t,r,i,u){if(e!==null){var d=e.memoizedProps;if(mo(d,i)&&e.ref===t.ref)if(ft=!1,t.pendingProps=i=d,(e.lanes&u)!==0)(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,on(e,t,u)}return aa(e,t,r,i,u)}function Jd(e,t,r){var i=t.pendingProps,u=i.children,d=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Mr,bt),bt|=r;else{if((r&1073741824)===0)return e=d!==null?d.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(Mr,bt),bt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=d!==null?d.baseLanes:r,Pe(Mr,bt),bt|=i}else d!==null?(i=d.baseLanes|r,t.memoizedState=null):i=r,Pe(Mr,bt),bt|=i;return it(e,t,u,r),t.child}function Zd(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function aa(e,t,r,i,u){var d=dt(r)?Wn:Xe.current;return d=Er(t,d),Pr(t,u),r=Js(e,t,r,i,d,u),i=Zs(),e!==null&&!ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,on(e,t,u)):($e&&i&&Ls(t),t.flags|=1,it(e,t,r,u),t.child)}function ef(e,t,r,i,u){if(dt(r)){var d=!0;Tl(t)}else d=!1;if(Pr(t,u),t.stateNode===null)Yl(e,t),Hd(t,r,i),la(t,r,i,u),i=!0;else if(e===null){var g=t.stateNode,k=t.memoizedProps;g.props=k;var N=g.context,F=r.contextType;typeof F=="object"&&F!==null?F=jt(F):(F=dt(r)?Wn:Xe.current,F=Er(t,F));var V=r.getDerivedStateFromProps,B=typeof V=="function"||typeof g.getSnapshotBeforeUpdate=="function";B||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k!==i||N!==F)&&Vd(t,g,i,F),kn=!1;var W=t.memoizedState;g.state=W,Al(t,i,g,u),N=t.memoizedState,k!==i||W!==N||ct.current||kn?(typeof V=="function"&&(oa(t,r,V,i),N=t.memoizedState),(k=kn||Wd(t,r,k,i,W,N,F))?(B||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=N),g.props=i,g.state=N,g.context=F,i=k):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{g=t.stateNode,gd(e,t),k=t.memoizedProps,F=t.type===t.elementType?k:It(t.type,k),g.props=F,B=t.pendingProps,W=g.context,N=r.contextType,typeof N=="object"&&N!==null?N=jt(N):(N=dt(r)?Wn:Xe.current,N=Er(t,N));var Z=r.getDerivedStateFromProps;(V=typeof Z=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k!==B||W!==N)&&Vd(t,g,i,N),kn=!1,W=t.memoizedState,g.state=W,Al(t,i,g,u);var ne=t.memoizedState;k!==B||W!==ne||ct.current||kn?(typeof Z=="function"&&(oa(t,r,Z,i),ne=t.memoizedState),(F=kn||Wd(t,r,F,i,W,ne,N)||!1)?(V||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(i,ne,N),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(i,ne,N)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||k===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),g.props=i,g.state=ne,g.context=N,i=F):(typeof g.componentDidUpdate!="function"||k===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),i=!1)}return ua(e,t,r,i,d,u)}function ua(e,t,r,i,u,d){Zd(e,t);var g=(t.flags&128)!==0;if(!i&&!g)return u&&ld(t,r,!1),on(e,t,d);i=t.stateNode,Kg.current=t;var k=g&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&g?(t.child=jr(t,e.child,null,d),t.child=jr(t,null,k,d)):it(e,t,k,d),t.memoizedState=i.state,u&&ld(t,r,!0),t.child}function tf(e){var t=e.stateNode;t.pendingContext?rd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rd(e,t.context,!1),Ks(e,t.containerInfo)}function nf(e,t,r,i,u){return Nr(),As(u),t.flags|=256,it(e,t,r,i),t.child}var ca={dehydrated:null,treeContext:null,retryLane:0};function da(e){return{baseLanes:e,cachePool:null,transitions:null}}function rf(e,t,r){var i=t.pendingProps,u=Me.current,d=!1,g=(t.flags&128)!==0,k;if((k=g)||(k=e!==null&&e.memoizedState===null?!1:(u&2)!==0),k?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),Pe(Me,u&1),e===null)return Ds(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(g=i.children,e=i.fallback,d?(i=t.mode,d=t.child,g={mode:"hidden",children:g},(i&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=g):d=ii(g,i,0,null),e=qn(e,i,r,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=da(r),t.memoizedState=ca,e):fa(t,g));if(u=e.memoizedState,u!==null&&(k=u.dehydrated,k!==null))return Qg(e,t,g,i,k,u,r);if(d){d=i.fallback,g=t.mode,u=e.child,k=u.sibling;var N={mode:"hidden",children:i.children};return(g&1)===0&&t.child!==u?(i=t.child,i.childLanes=0,i.pendingProps=N,t.deletions=null):(i=Rn(u,N),i.subtreeFlags=u.subtreeFlags&14680064),k!==null?d=Rn(k,d):(d=qn(d,g,r,null),d.flags|=2),d.return=t,i.return=t,i.sibling=d,t.child=i,i=d,d=t.child,g=e.child.memoizedState,g=g===null?da(r):{baseLanes:g.baseLanes|r,cachePool:null,transitions:g.transitions},d.memoizedState=g,d.childLanes=e.childLanes&~r,t.memoizedState=ca,i}return d=e.child,e=d.sibling,i=Rn(d,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function fa(e,t){return t=ii({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ql(e,t,r,i){return i!==null&&As(i),jr(t,e.child,null,r),e=fa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qg(e,t,r,i,u,d,g){if(r)return t.flags&256?(t.flags&=-257,i=ia(Error(o(422))),Ql(e,t,g,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=i.fallback,u=t.mode,i=ii({mode:"visible",children:i.children},u,0,null),d=qn(d,u,g,null),d.flags|=2,i.return=t,d.return=t,i.sibling=d,t.child=i,(t.mode&1)!==0&&jr(t,e.child,null,g),t.child.memoizedState=da(g),t.memoizedState=ca,d);if((t.mode&1)===0)return Ql(e,t,g,null);if(u.data==="$!"){if(i=u.nextSibling&&u.nextSibling.dataset,i)var k=i.dgst;return i=k,d=Error(o(419)),i=ia(d,i,void 0),Ql(e,t,g,i)}if(k=(g&e.childLanes)!==0,ft||k){if(i=Be,i!==null){switch(g&-g){case 4:u=2;break;case 16:u=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(i.suspendedLanes|g))!==0?0:u,u!==0&&u!==d.retryLane&&(d.retryLane=u,nn(e,u),At(i,e,u,-1))}return Oa(),i=ia(Error(o(421))),Ql(e,t,g,i)}return u.data==="$?"?(t.flags|=128,t.child=e.child,t=i0.bind(null,e),u._reactRetry=t,null):(e=d.treeContext,wt=wn(u.nextSibling),xt=t,$e=!0,Lt=null,e!==null&&(Ct[Nt++]=en,Ct[Nt++]=tn,Ct[Nt++]=Hn,en=e.id,tn=e.overflow,Hn=t),t=fa(t,i.children),t.flags|=4096,t)}function of(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Vs(e.return,t,r)}function pa(e,t,r,i,u){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:u}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=i,d.tail=r,d.tailMode=u)}function lf(e,t,r){var i=t.pendingProps,u=i.revealOrder,d=i.tail;if(it(e,t,i.children,r),i=Me.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&of(e,r,t);else if(e.tag===19)of(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Pe(Me,i),(t.mode&1)===0)t.memoizedState=null;else switch(u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&zl(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),pa(t,!1,u,r,d);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&zl(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}pa(t,!0,r,null,d);break;case"together":pa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function on(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Qn|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Rn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Rn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Yg(e,t,r){switch(t.tag){case 3:tf(t),Nr();break;case 5:xd(t);break;case 1:dt(t.type)&&Tl(t);break;case 4:Ks(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,u=t.memoizedProps.value;Pe(Il,i._currentValue),i._currentValue=u;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Pe(Me,Me.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?rf(e,t,r):(Pe(Me,Me.current&1),e=on(e,t,r),e!==null?e.sibling:null);Pe(Me,Me.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return lf(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Pe(Me,Me.current),i)break;return null;case 22:case 23:return t.lanes=0,Jd(e,t,r)}return on(e,t,r)}var sf,ma,af,uf;sf=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},ma=function(){},af=function(e,t,r,i){var u=e.memoizedProps;if(u!==i){e=t.stateNode,Un(Vt.current);var d=null;switch(r){case"input":u=Vi(e,u),i=Vi(e,i),d=[];break;case"select":u=K({},u,{value:void 0}),i=K({},i,{value:void 0}),d=[];break;case"textarea":u=Ki(e,u),i=Ki(e,i),d=[];break;default:typeof u.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=jl)}Yi(r,i);var g;r=null;for(F in u)if(!i.hasOwnProperty(F)&&u.hasOwnProperty(F)&&u[F]!=null)if(F==="style"){var k=u[F];for(g in k)k.hasOwnProperty(g)&&(r||(r={}),r[g]="")}else F!=="dangerouslySetInnerHTML"&&F!=="children"&&F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(a.hasOwnProperty(F)?d||(d=[]):(d=d||[]).push(F,null));for(F in i){var N=i[F];if(k=u?.[F],i.hasOwnProperty(F)&&N!==k&&(N!=null||k!=null))if(F==="style")if(k){for(g in k)!k.hasOwnProperty(g)||N&&N.hasOwnProperty(g)||(r||(r={}),r[g]="");for(g in N)N.hasOwnProperty(g)&&k[g]!==N[g]&&(r||(r={}),r[g]=N[g])}else r||(d||(d=[]),d.push(F,r)),r=N;else F==="dangerouslySetInnerHTML"?(N=N?N.__html:void 0,k=k?k.__html:void 0,N!=null&&k!==N&&(d=d||[]).push(F,N)):F==="children"?typeof N!="string"&&typeof N!="number"||(d=d||[]).push(F,""+N):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&(a.hasOwnProperty(F)?(N!=null&&F==="onScroll"&&Te("scroll",e),d||k===N||(d=[])):(d=d||[]).push(F,N))}r&&(d=d||[]).push("style",r);var F=d;(t.updateQueue=F)&&(t.flags|=4)}},uf=function(e,t,r,i){r!==i&&(t.flags|=4)};function Po(e,t){if(!$e)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,i|=u.subtreeFlags&14680064,i|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Xg(e,t,r){var i=t.pendingProps;switch(Is(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return dt(t.type)&&Pl(),qe(t),null;case 3:return i=t.stateNode,Tr(),Re(ct),Re(Xe),Xs(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(_l(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lt!==null&&(Ca(Lt),Lt=null))),ma(e,t),qe(t),null;case 5:Qs(t);var u=Un(ko.current);if(r=t.type,e!==null&&t.stateNode!=null)af(e,t,r,i,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(o(166));return qe(t),null}if(e=Un(Vt.current),_l(t)){i=t.stateNode,r=t.type;var d=t.memoizedProps;switch(i[Ht]=t,i[xo]=d,e=(t.mode&1)!==0,r){case"dialog":Te("cancel",i),Te("close",i);break;case"iframe":case"object":case"embed":Te("load",i);break;case"video":case"audio":for(u=0;u<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=g.createElement(r,{is:i.is}):(e=g.createElement(r),r==="select"&&(g=e,i.multiple?g.multiple=!0:i.size&&(g.size=i.size))):e=g.createElementNS(e,r),e[Ht]=t,e[xo]=i,sf(e,t,!1,!1),t.stateNode=e;e:{switch(g=Xi(r,i),r){case"dialog":Te("cancel",e),Te("close",e),u=i;break;case"iframe":case"object":case"embed":Te("load",e),u=i;break;case"video":case"audio":for(u=0;u_r&&(t.flags|=128,i=!0,Po(d,!1),t.lanes=4194304)}else{if(!i)if(e=zl(g),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Po(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!$e)return qe(t),null}else 2*De()-d.renderingStartTime>_r&&r!==1073741824&&(t.flags|=128,i=!0,Po(d,!1),t.lanes=4194304);d.isBackwards?(g.sibling=t.child,t.child=g):(r=d.last,r!==null?r.sibling=g:t.child=g,d.last=g)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=De(),t.sibling=null,r=Me.current,Pe(Me,i?r&1|2:r&1),t):(qe(t),null);case 22:case 23:return ja(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(bt&1073741824)!==0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function Gg(e,t){switch(Is(t),t.tag){case 1:return dt(t.type)&&Pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tr(),Re(ct),Re(Xe),Xs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Qs(t),null;case 13:if(Re(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Nr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(Me),null;case 4:return Tr(),null;case 10:return Hs(t.type._context),null;case 22:case 23:return ja(),null;case 24:return null;default:return null}}var Xl=!1,Je=!1,qg=typeof WeakSet=="function"?WeakSet:Set,te=null;function $r(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Fe(e,t,i)}else r.current=null}function ha(e,t,r){try{r()}catch(i){Fe(e,t,i)}}var cf=!1;function Jg(e,t){if(js=hl,e=Wc(),xs(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var u=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var g=0,k=-1,N=-1,F=0,V=0,B=e,W=null;t:for(;;){for(var Z;B!==r||u!==0&&B.nodeType!==3||(k=g+u),B!==d||i!==0&&B.nodeType!==3||(N=g+i),B.nodeType===3&&(g+=B.nodeValue.length),(Z=B.firstChild)!==null;)W=B,B=Z;for(;;){if(B===e)break t;if(W===r&&++F===u&&(k=g),W===d&&++V===i&&(N=g),(Z=B.nextSibling)!==null)break;B=W,W=B.parentNode}B=Z}r=k===-1||N===-1?null:{start:k,end:N}}else r=null}r=r||{start:0,end:0}}else r=null;for(Os={focusedElem:e,selectionRange:r},hl=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var ne=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var oe=ne.memoizedProps,Ae=ne.memoizedState,$=t.stateNode,O=$.getSnapshotBeforeUpdate(t.elementType===t.type?oe:It(t.type,oe),Ae);$.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Y){Fe(t,t.return,Y)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return ne=cf,cf=!1,ne}function To(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&e)===e){var d=u.destroy;u.destroy=void 0,d!==void 0&&ha(t,r,d)}u=u.next}while(u!==i)}}function Gl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function ga(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function df(e){var t=e.alternate;t!==null&&(e.alternate=null,df(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[xo],delete t[$s],delete t[_g],delete t[Lg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ff(e){return e.tag===5||e.tag===3||e.tag===4}function pf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ff(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function va(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jl));else if(i!==4&&(e=e.child,e!==null))for(va(e,t,r),e=e.sibling;e!==null;)va(e,t,r),e=e.sibling}function ya(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(ya(e,t,r),e=e.sibling;e!==null;)ya(e,t,r),e=e.sibling}var Ke=null,Ft=!1;function Nn(e,t,r){for(r=r.child;r!==null;)mf(e,t,r),r=r.sibling}function mf(e,t,r){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(ul,r)}catch{}switch(r.tag){case 5:Je||$r(r,t);case 6:var i=Ke,u=Ft;Ke=null,Nn(e,t,r),Ke=i,Ft=u,Ke!==null&&(Ft?(e=Ke,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ke.removeChild(r.stateNode));break;case 18:Ke!==null&&(Ft?(e=Ke,r=r.stateNode,e.nodeType===8?Rs(e.parentNode,r):e.nodeType===1&&Rs(e,r),so(e)):Rs(Ke,r.stateNode));break;case 4:i=Ke,u=Ft,Ke=r.stateNode.containerInfo,Ft=!0,Nn(e,t,r),Ke=i,Ft=u;break;case 0:case 11:case 14:case 15:if(!Je&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var d=u,g=d.destroy;d=d.tag,g!==void 0&&((d&2)!==0||(d&4)!==0)&&ha(r,t,g),u=u.next}while(u!==i)}Nn(e,t,r);break;case 1:if(!Je&&($r(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(k){Fe(r,t,k)}Nn(e,t,r);break;case 21:Nn(e,t,r);break;case 22:r.mode&1?(Je=(i=Je)||r.memoizedState!==null,Nn(e,t,r),Je=i):Nn(e,t,r);break;default:Nn(e,t,r)}}function hf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new qg),t.forEach(function(i){var u=s0.bind(null,e,i);r.has(i)||(r.add(i),i.then(u,u))})}}function Dt(e,t){var r=t.deletions;if(r!==null)for(var i=0;iu&&(u=g),i&=~d}if(i=u,i=De()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*e0(i/1960))-i,10e?16:e,On===null)var i=!1;else{if(e=On,On=null,ti=0,(ke&6)!==0)throw Error(o(331));var u=ke;for(ke|=4,te=e.current;te!==null;){var d=te,g=d.child;if((te.flags&16)!==0){var k=d.deletions;if(k!==null){for(var N=0;NDe()-ba?Xn(e,0):wa|=r),mt(e,t)}function Of(e,t){t===0&&((e.mode&1)===0?t=1:(t=dl,dl<<=1,(dl&130023424)===0&&(dl=4194304)));var r=st();e=nn(e,t),e!==null&&(no(e,t,r),mt(e,r))}function i0(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Of(e,r)}function s0(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(t),Of(e,r)}var Pf;Pf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ft=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ft=!1,Yg(e,t,r);ft=(e.flags&131072)!==0}else ft=!1,$e&&(t.flags&1048576)!==0&&sd(t,Ml,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Yl(e,t),e=t.pendingProps;var u=Er(t,Xe.current);Pr(t,r),u=Js(null,t,i,e,u,r);var d=Zs();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(i)?(d=!0,Tl(t)):d=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Us(t),u.updater=Kl,t.stateNode=u,u._reactInternals=t,la(t,i,e,r),t=ua(null,t,i,!0,d,r)):(t.tag=0,$e&&d&&Ls(t),it(null,t,u,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Yl(e,t),e=t.pendingProps,u=i._init,i=u(i._payload),t.type=i,u=t.tag=u0(i),e=It(i,e),u){case 0:t=aa(null,t,i,e,r);break e;case 1:t=ef(null,t,i,e,r);break e;case 11:t=Xd(null,t,i,e,r);break e;case 14:t=Gd(null,t,i,It(i.type,e),r);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,u=t.pendingProps,u=t.elementType===i?u:It(i,u),aa(e,t,i,u,r);case 1:return i=t.type,u=t.pendingProps,u=t.elementType===i?u:It(i,u),ef(e,t,i,u,r);case 3:e:{if(tf(t),e===null)throw Error(o(387));i=t.pendingProps,d=t.memoizedState,u=d.element,gd(e,t),Al(t,i,null,r);var g=t.memoizedState;if(i=g.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){u=Rr(Error(o(423)),t),t=nf(e,t,i,r,u);break e}else if(i!==u){u=Rr(Error(o(424)),t),t=nf(e,t,i,r,u);break e}else for(wt=wn(t.stateNode.containerInfo.firstChild),xt=t,$e=!0,Lt=null,r=md(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Nr(),i===u){t=on(e,t,r);break e}it(e,t,i,r)}t=t.child}return t;case 5:return xd(t),e===null&&Ds(t),i=t.type,u=t.pendingProps,d=e!==null?e.memoizedProps:null,g=u.children,Ps(i,u)?g=null:d!==null&&Ps(i,d)&&(t.flags|=32),Zd(e,t),it(e,t,g,r),t.child;case 6:return e===null&&Ds(t),null;case 13:return rf(e,t,r);case 4:return Ks(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=jr(t,null,i,r):it(e,t,i,r),t.child;case 11:return i=t.type,u=t.pendingProps,u=t.elementType===i?u:It(i,u),Xd(e,t,i,u,r);case 7:return it(e,t,t.pendingProps,r),t.child;case 8:return it(e,t,t.pendingProps.children,r),t.child;case 12:return it(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,u=t.pendingProps,d=t.memoizedProps,g=u.value,Pe(Il,i._currentValue),i._currentValue=g,d!==null)if(_t(d.value,g)){if(d.children===u.children&&!ct.current){t=on(e,t,r);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var k=d.dependencies;if(k!==null){g=d.child;for(var N=k.firstContext;N!==null;){if(N.context===i){if(d.tag===1){N=rn(-1,r&-r),N.tag=2;var F=d.updateQueue;if(F!==null){F=F.shared;var V=F.pending;V===null?N.next=N:(N.next=V.next,V.next=N),F.pending=N}}d.lanes|=r,N=d.alternate,N!==null&&(N.lanes|=r),Vs(d.return,r,t),k.lanes|=r;break}N=N.next}}else if(d.tag===10)g=d.type===t.type?null:d.child;else if(d.tag===18){if(g=d.return,g===null)throw Error(o(341));g.lanes|=r,k=g.alternate,k!==null&&(k.lanes|=r),Vs(g,r,t),g=d.sibling}else g=d.child;if(g!==null)g.return=d;else for(g=d;g!==null;){if(g===t){g=null;break}if(d=g.sibling,d!==null){d.return=g.return,g=d;break}g=g.return}d=g}it(e,t,u.children,r),t=t.child}return t;case 9:return u=t.type,i=t.pendingProps.children,Pr(t,r),u=jt(u),i=i(u),t.flags|=1,it(e,t,i,r),t.child;case 14:return i=t.type,u=It(i,t.pendingProps),u=It(i.type,u),Gd(e,t,i,u,r);case 15:return qd(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,u=t.pendingProps,u=t.elementType===i?u:It(i,u),Yl(e,t),t.tag=1,dt(i)?(e=!0,Tl(t)):e=!1,Pr(t,r),Hd(t,i,u),la(t,i,u,r),ua(null,t,i,!0,e,r);case 19:return lf(e,t,r);case 22:return Jd(e,t,r)}throw Error(o(156,t.tag))};function Tf(e,t){return ac(e,t)}function a0(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,r,i){return new a0(e,t,r,i)}function Pa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u0(e){if(typeof e=="function")return Pa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===z)return 11;if(e===G)return 14}return 2}function Rn(e,t){var r=e.alternate;return r===null?(r=Tt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function li(e,t,r,i,u,d){var g=2;if(i=e,typeof e=="function")Pa(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case q:return qn(r.children,u,d,t);case ee:g=8,u|=8;break;case he:return e=Tt(12,r,t,u|2),e.elementType=he,e.lanes=d,e;case ae:return e=Tt(13,r,t,u),e.elementType=ae,e.lanes=d,e;case ue:return e=Tt(19,r,t,u),e.elementType=ue,e.lanes=d,e;case ve:return ii(r,u,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:g=10;break e;case Q:g=9;break e;case z:g=11;break e;case G:g=14;break e;case ce:g=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=Tt(g,r,t,u),t.elementType=e,t.type=i,t.lanes=d,t}function qn(e,t,r,i){return e=Tt(7,e,i,t),e.lanes=r,e}function ii(e,t,r,i){return e=Tt(22,e,i,t),e.elementType=ve,e.lanes=r,e.stateNode={isHidden:!1},e}function Ta(e,t,r){return e=Tt(6,e,null,t),e.lanes=r,e}function Ra(e,t,r){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c0(e,t,r,i,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=os(0),this.expirationTimes=os(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=os(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function $a(e,t,r,i,u,d,g,k,N){return e=new c0(e,t,r,k,N),t===1?(t=1,d===!0&&(t|=8)):t=0,d=Tt(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Us(d),e}function d0(e,t,r){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Da.exports=k0(),Da.exports}var Bf;function C0(){if(Bf)return pi;Bf=1;var n=zp();return pi.createRoot=n.createRoot,pi.hydrateRoot=n.hydrateRoot,pi}var N0=C0();const j0=[{label:"Schema",items:[{id:"object-defs",label:"Object Defs",icon:"📦"},{id:"event-defs",label:"Event Defs",icon:"📋"},{id:"projection-defs",label:"Projection Defs",icon:"📊"}]},{label:"Data",items:[{id:"objects",label:"Objects",icon:"🗂️"},{id:"events",label:"Events",icon:"⚡"},{id:"projections",label:"Projections",icon:"📈"},{id:"reactions",label:"Reactions",icon:"🔔"}]},{label:"Observability",items:[{id:"reaction-logs",label:"Reaction Logs",icon:"📜"},{id:"request-logs",label:"Request Logs",icon:"📝"}]},{label:"Security",items:[{id:"api-keys",label:"API Keys",icon:"🔑"}]},{label:"System",items:[{id:"health",label:"Health",icon:"🏠"}]}];function O0({page:n,onPageChange:l,children:o}){return m.jsxs("div",{className:"flex h-screen bg-gray-950 text-gray-100",children:[m.jsxs("aside",{className:"w-64 bg-gray-900/50 backdrop-blur border-r border-gray-800 flex flex-col",children:[m.jsxs("div",{className:"p-6 border-b border-gray-800",children:[m.jsx("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent",children:"OGraph UI"}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Event Sourcing Dashboard"})]}),m.jsx("nav",{className:"flex-1 overflow-y-auto p-3",children:j0.map(s=>m.jsxs("div",{className:"mb-4",children:[m.jsx("div",{className:"px-4 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:s.label}),s.items.map(a=>m.jsxs("button",{onClick:()=>l(a.id),className:` w-full text-left px-4 py-2.5 rounded-lg mb-1 flex items-center gap-3 font-medium transition-all ${n===a.id?"bg-blue-600 text-white shadow-lg shadow-blue-500/30":"text-gray-400 hover:bg-gray-800/60 hover:text-gray-100"} - `,children:[m.jsx("span",{className:"text-lg",children:a.icon}),m.jsx("span",{className:"text-sm",children:a.label})]},a.id))]},s.label))}),m.jsx("div",{className:"p-4 border-t border-gray-800 text-xs text-gray-600",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),m.jsx("span",{children:"Connected"})]})})]}),m.jsx("main",{className:"flex-1 overflow-y-auto bg-gradient-to-br from-gray-950 via-gray-900 to-gray-950",children:m.jsx("div",{className:"p-8 max-w-[1600px] mx-auto",children:o})})]})}const P0="";let Ei=localStorage.getItem("ograph_token")||"";function T0(n){Ei=n,localStorage.setItem("ograph_token",n)}function R0(){return Ei}async function nt(n,l){const o=await fetch(P0+n,{...l,headers:{Authorization:Ei?`Bearer ${Ei}`:"","Content-Type":"application/json",...l?.headers}});if(o.status===401)throw new Error("UNAUTHORIZED");if(!o.ok)throw new Error(`API error: ${o.status}`);return o.json()}const $0=()=>nt("/health"),Wp=()=>nt("/object-defs"),ou=(n,l=50,o=0)=>nt(n?`/objects?type=${n}&limit=${l}&offset=${o}`:`/objects?limit=${l}&offset=${o}`),M0=n=>nt("/objects",{method:"POST",body:JSON.stringify({type:n})}),_0=()=>nt("/event-defs"),L0=(n,l=50,o=0)=>nt(n?`/events?ref=${n}&limit=${l}&offset=${o}`:`/events?limit=${l}&offset=${o}`),Hp=()=>nt("/projection-defs"),I0=(n=50,l=0)=>nt(`/reactions?limit=${n}&offset=${l}`),F0=n=>nt(`/reactions/${n}`,{method:"DELETE"}),D0=(n=50,l=0)=>nt(`/api-keys?limit=${n}&offset=${l}`),A0=n=>nt("/api-keys",{method:"POST",body:JSON.stringify(n)}),z0=n=>nt(`/api-keys/${n}`,{method:"DELETE"}),W0=(n,l)=>nt("/events",{method:"POST",body:JSON.stringify({type:n,payload:l})}),H0=(n=50,l=0,o)=>{let s=`/reaction-logs?limit=${n}&offset=${l}`;return o&&(s+=`&reaction_id=${o}`),nt(s)},V0=(n=50,l=0,o)=>{let s=`/request-logs?limit=${n}&offset=${l}`;return o&&(s+=`&api_key_id=${o}`),nt(s)};function $t(){return m.jsx("div",{className:"flex items-center justify-center p-12",children:m.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"})})}function fn({message:n="No data found"}){return m.jsx("div",{className:"flex items-center justify-center p-12 text-gray-500",children:m.jsxs("div",{className:"text-center",children:[m.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),m.jsx("p",{children:n})]})})}function lr({hash:n,short:l=!0}){const o=l&&n.length>8?n.slice(0,8):n;return m.jsx("span",{className:"inline-block px-2 py-1 bg-gray-800/50 rounded font-mono text-xs text-gray-400",children:o})}function Vr({total:n,limit:l,offset:o,onPageChange:s,onLimitChange:a}){const c=Math.floor(o/l)+1,f=Math.ceil(n/l),p=n===0?0:o+1,h=Math.min(o+l,n),v=o>0,x=o+l{a(parseInt(E.target.value,10)),s(0)},className:"bg-gray-800 text-gray-300 border border-gray-700 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[m.jsx("option",{value:"25",children:"25"}),m.jsx("option",{value:"50",children:"50"}),m.jsx("option",{value:"100",children:"100"})]})]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("button",{onClick:()=>s(o-l),disabled:!v,className:"px-3 py-1 bg-gray-800 text-gray-300 rounded border border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-700 text-sm",children:"Previous"}),m.jsxs("span",{className:"text-sm text-gray-400",children:["Page ",c," / ",f||1]}),m.jsx("button",{onClick:()=>s(o+l),disabled:!x,className:"px-3 py-1 bg-gray-800 text-gray-300 rounded border border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-700 text-sm",children:"Next"})]})]})}function B0(){const[n,l]=y.useState(null),[o,s]=y.useState(""),[a,c]=y.useState(!0);return y.useEffect(()=>{$0().then(l).catch(f=>s(f.message)).finally(()=>c(!1))},[]),a?m.jsx($t,{}):o?m.jsxs("div",{className:"text-red-500 text-center p-8",children:["Error: ",o]}):m.jsxs("div",{className:"max-w-2xl mx-auto",children:[m.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Health Check"}),m.jsxs("div",{className:"bg-gray-900/50 backdrop-blur border border-gray-800 rounded-lg p-8",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"w-4 h-4 bg-green-500 rounded-full"}),m.jsx("div",{className:"absolute inset-0 w-4 h-4 bg-green-500 rounded-full animate-ping opacity-75"})]}),m.jsx("span",{className:"text-green-500 font-semibold text-lg",children:"System Online"})]}),m.jsxs("div",{className:"text-gray-400 mt-4 flex items-baseline gap-2",children:[m.jsx("span",{children:"Version:"}),m.jsx("span",{className:"text-white font-mono bg-gray-800/50 px-3 py-1 rounded",children:n?.version})]})]})]})}function U0(){const[n,l]=y.useState([]),[o,s]=y.useState(""),[a,c]=y.useState(!0);return y.useEffect(()=>{Wp().then(f=>l(f.object_defs)).catch(f=>s(f.message)).finally(()=>c(!1))},[]),a?m.jsx($t,{}):o?m.jsxs("div",{className:"text-red-500 text-center p-8",children:["Error: ",o]}):m.jsxs("div",{className:"max-w-4xl mx-auto",children:[m.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Object Definitions"}),m.jsx("div",{className:"bg-gray-900/50 backdrop-blur rounded-lg overflow-hidden border border-gray-800",children:n.length===0?m.jsx(fn,{message:"No object definitions found"}):m.jsxs("table",{className:"w-full",children:[m.jsx("thead",{className:"bg-gray-800/80 border-b border-gray-700",children:m.jsx("tr",{children:m.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Name"})})}),m.jsx("tbody",{className:"divide-y divide-gray-800",children:n.map((f,p)=>m.jsx("tr",{className:`transition-colors ${p%2===0?"bg-gray-900/30":"bg-gray-850/30"} hover:bg-gray-800/60`,children:m.jsx("td",{className:"px-4 py-3 font-mono text-gray-100",children:f.name})},p))})]})})]})}const K0=typeof document<"u"?ye.useLayoutEffect:()=>{},Fn=n=>{var l;return(l=n?.ownerDocument)!==null&&l!==void 0?l:document},tr=n=>n&&"window"in n&&n.window===n?n:Fn(n).defaultView||window;function Q0(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function Y0(n){return Q0(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let X0=!1;function vu(){return X0}function nr(n,l){if(!vu())return l&&n?n.contains(l):!1;if(!n||!l)return!1;let o=l;for(;o!==null;){if(o===n)return!0;o.tagName==="SLOT"&&o.assignedSlot?o=o.assignedSlot.parentNode:Y0(o)?o=o.host:o=o.parentNode}return!1}const Wr=(n=document)=>{var l;if(!vu())return n.activeElement;let o=n.activeElement;for(;o&&"shadowRoot"in o&&(!((l=o.shadowRoot)===null||l===void 0)&&l.activeElement);)o=o.shadowRoot.activeElement;return o};function at(n){if(vu()&&n.target instanceof Element&&n.target.shadowRoot){var l,o;if("composedPath"in n)return(l=n.composedPath()[0])!==null&&l!==void 0?l:null;if("composedPath"in n.nativeEvent)return(o=n.nativeEvent.composedPath()[0])!==null&&o!==void 0?o:null}return n.target}function G0(n){if(q0())n.focus({preventScroll:!0});else{let l=J0(n);n.focus(),Z0(l)}}let mi=null;function q0(){if(mi==null){mi=!1;try{document.createElement("div").focus({get preventScroll(){return mi=!0,!0}})}catch{}}return mi}function J0(n){let l=n.parentNode,o=[],s=document.scrollingElement||document.documentElement;for(;l instanceof HTMLElement&&l!==s;)(l.offsetHeight"u"||window.navigator==null)return!1;let o=(l=window.navigator.userAgentData)===null||l===void 0?void 0:l.brands;return Array.isArray(o)&&o.some(s=>n.test(s.brand))||n.test(window.navigator.userAgent)}function Vp(n){var l;return typeof window<"u"&&window.navigator!=null?n.test(((l=window.navigator.userAgentData)===null||l===void 0?void 0:l.platform)||window.navigator.platform):!1}function Br(n){let l=null;return()=>(l==null&&(l=n()),l)}const ki=Br(function(){return Vp(/^Mac/i)}),ev=Br(function(){return Vp(/^iPad/i)||ki()&&navigator.maxTouchPoints>1}),tv=Br(function(){return _i(/AppleWebKit/i)&&!nv()}),nv=Br(function(){return _i(/Chrome/i)}),rv=Br(function(){return _i(/Android/i)}),ov=Br(function(){return _i(/Firefox/i)});function Vo(n,l,o=!0){var s,a;let{metaKey:c,ctrlKey:f,altKey:p,shiftKey:h}=l;ov()&&(!((a=window.event)===null||a===void 0||(s=a.type)===null||s===void 0)&&s.startsWith("key"))&&n.target==="_blank"&&(ki()?c=!0:f=!0);let v=tv()&&ki()&&!ev()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:c,ctrlKey:f,altKey:p,shiftKey:h}):new MouseEvent("click",{metaKey:c,ctrlKey:f,altKey:p,shiftKey:h,detail:1,bubbles:!0,cancelable:!0});Vo.isOpening=o,G0(n),n.dispatchEvent(v),Vo.isOpening=!1}Vo.isOpening=!1;function Bp(){let n=y.useRef(new Map),l=y.useCallback((a,c,f,p)=>{let h=p?.once?(...v)=>{n.current.delete(f),f(...v)}:f;n.current.set(f,{type:c,eventTarget:a,fn:h,options:p}),a.addEventListener(c,h,p)},[]),o=y.useCallback((a,c,f,p)=>{var h;let v=((h=n.current.get(f))===null||h===void 0?void 0:h.fn)||f;a.removeEventListener(c,v,p),n.current.delete(f)},[]),s=y.useCallback(()=>{n.current.forEach((a,c)=>{o(a.eventTarget,a.type,c,a.options)})},[o]);return y.useEffect(()=>s,[s]),{addGlobalListener:l,removeGlobalListener:o,removeAllGlobalListeners:s}}function lv(n){return n.pointerType===""&&n.isTrusted?!0:rv()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}var Ye=zp();function Up(n){let l=n;return l.nativeEvent=n,l.isDefaultPrevented=()=>l.defaultPrevented,l.isPropagationStopped=()=>l.cancelBubble,l.persist=()=>{},l}function iv(n,l){Object.defineProperty(n,"target",{value:l}),Object.defineProperty(n,"currentTarget",{value:l})}function Kp(n){let l=y.useRef({isFocused:!1,observer:null});return K0(()=>{const o=l.current;return()=>{o.observer&&(o.observer.disconnect(),o.observer=null)}},[]),y.useCallback(o=>{let s=at(o);if(s instanceof HTMLButtonElement||s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement){l.current.isFocused=!0;let a=s,c=f=>{if(l.current.isFocused=!1,a.disabled){let p=Up(f);n?.(p)}l.current.observer&&(l.current.observer.disconnect(),l.current.observer=null)};a.addEventListener("focusout",c,{once:!0}),l.current.observer=new MutationObserver(()=>{if(l.current.isFocused&&a.disabled){var f;(f=l.current.observer)===null||f===void 0||f.disconnect();let p=a===Wr()?null:Wr();a.dispatchEvent(new FocusEvent("blur",{relatedTarget:p})),a.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:p}))}}),l.current.observer.observe(a,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let sv=!1,Xo=null;const lu=new Set;let Wo=new Map,ir=!1,iu=!1;const av={Tab:!0,Escape:!0};function yu(n,l){for(let o of lu)o(n,l)}function uv(n){return!(n.metaKey||!ki()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function Ci(n){ir=!0,!Vo.isOpening&&uv(n)&&(Xo="keyboard",yu("keyboard",n))}function Ar(n){Xo="pointer","pointerType"in n&&n.pointerType,(n.type==="mousedown"||n.type==="pointerdown")&&(ir=!0,yu("pointer",n))}function Qp(n){!Vo.isOpening&&lv(n)&&(ir=!0,Xo="virtual")}function Yp(n){at(n)===window||at(n)===document||sv||!n.isTrusted||(!ir&&!iu&&(Xo="virtual",yu("virtual",n)),ir=!1,iu=!1)}function Xp(){ir=!1,iu=!0}function su(n){if(typeof window>"u"||typeof document>"u"||Wo.get(tr(n)))return;const l=tr(n),o=Fn(n);let s=l.HTMLElement.prototype.focus;l.HTMLElement.prototype.focus=function(){ir=!0,s.apply(this,arguments)},o.addEventListener("keydown",Ci,!0),o.addEventListener("keyup",Ci,!0),o.addEventListener("click",Qp,!0),l.addEventListener("focus",Yp,!0),l.addEventListener("blur",Xp,!1),typeof PointerEvent<"u"&&(o.addEventListener("pointerdown",Ar,!0),o.addEventListener("pointermove",Ar,!0),o.addEventListener("pointerup",Ar,!0)),l.addEventListener("beforeunload",()=>{Gp(n)},{once:!0}),Wo.set(l,{focus:s})}const Gp=(n,l)=>{const o=tr(n),s=Fn(n);l&&s.removeEventListener("DOMContentLoaded",l),Wo.has(o)&&(o.HTMLElement.prototype.focus=Wo.get(o).focus,s.removeEventListener("keydown",Ci,!0),s.removeEventListener("keyup",Ci,!0),s.removeEventListener("click",Qp,!0),o.removeEventListener("focus",Yp,!0),o.removeEventListener("blur",Xp,!1),typeof PointerEvent<"u"&&(s.removeEventListener("pointerdown",Ar,!0),s.removeEventListener("pointermove",Ar,!0),s.removeEventListener("pointerup",Ar,!0)),Wo.delete(o))};function cv(n){const l=Fn(n);let o;return l.readyState!=="loading"?su(n):(o=()=>{su(n)},l.addEventListener("DOMContentLoaded",o)),()=>Gp(n,o)}typeof document<"u"&&cv();function au(){return Xo!=="pointer"}const dv=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function fv(n,l,o){let s=Fn(o?at(o):void 0),a=o?at(o):void 0;const c=typeof window<"u"?tr(a).HTMLInputElement:HTMLInputElement,f=typeof window<"u"?tr(a).HTMLTextAreaElement:HTMLTextAreaElement,p=typeof window<"u"?tr(a).HTMLElement:HTMLElement,h=typeof window<"u"?tr(a).KeyboardEvent:KeyboardEvent;let v=Wr(s);return n=n||v instanceof c&&!dv.has(v.type)||v instanceof f||v instanceof p&&v.isContentEditable,!(n&&l==="keyboard"&&o instanceof h&&!av[o.key])}function pv(n,l,o){su(),y.useEffect(()=>{if(o?.enabled===!1)return;let s=(a,c)=>{fv(!!o?.isTextInput,a,c)&&n(au())};return lu.add(s),()=>{lu.delete(s)}},l)}function mv(n){let{isDisabled:l,onFocus:o,onBlur:s,onFocusChange:a}=n;const c=y.useCallback(h=>{if(at(h)===h.currentTarget)return s&&s(h),a&&a(!1),!0},[s,a]),f=Kp(c),p=y.useCallback(h=>{let v=at(h);const x=Fn(v),E=x?Wr(x):Wr();v===h.currentTarget&&v===E&&(o&&o(h),a&&a(!0),f(h))},[a,o,f]);return{focusProps:{onFocus:!l&&(o||a||s)?p:void 0,onBlur:!l&&(s||a)?c:void 0}}}function hv(n){let{isDisabled:l,onBlurWithin:o,onFocusWithin:s,onFocusWithinChange:a}=n,c=y.useRef({isFocusWithin:!1}),{addGlobalListener:f,removeAllGlobalListeners:p}=Bp(),h=y.useCallback(E=>{nr(E.currentTarget,at(E))&&c.current.isFocusWithin&&!nr(E.currentTarget,E.relatedTarget)&&(c.current.isFocusWithin=!1,p(),o&&o(E),a&&a(!1))},[o,a,c,p]),v=Kp(h),x=y.useCallback(E=>{if(!nr(E.currentTarget,at(E)))return;let w=at(E);const b=Fn(w),S=Wr(b);if(!c.current.isFocusWithin&&S===w){s&&s(E),a&&a(!0),c.current.isFocusWithin=!0,v(E);let C=E.currentTarget;f(b,"focus",j=>{let I=at(j);if(c.current.isFocusWithin&&!nr(C,I)){let L=new b.defaultView.FocusEvent("blur",{relatedTarget:I});iv(L,C);let P=Up(L);h(P)}},{capture:!0})}},[s,a,v,f,h]);return l?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:x,onBlur:h}}}let uu=!1,hi=0;function gv(){uu=!0,setTimeout(()=>{uu=!1},50)}function Uf(n){n.pointerType==="touch"&&gv()}function vv(){if(!(typeof document>"u"))return hi===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",Uf),hi++,()=>{hi--,!(hi>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",Uf)}}function xu(n){let{onHoverStart:l,onHoverChange:o,onHoverEnd:s,isDisabled:a}=n,[c,f]=y.useState(!1),p=y.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;y.useEffect(vv,[]);let{addGlobalListener:h,removeAllGlobalListeners:v}=Bp(),{hoverProps:x,triggerHoverEnd:E}=y.useMemo(()=>{let w=(C,j)=>{if(p.pointerType=j,a||j==="touch"||p.isHovered||!nr(C.currentTarget,at(C)))return;p.isHovered=!0;let I=C.currentTarget;p.target=I,h(Fn(at(C)),"pointerover",L=>{p.isHovered&&p.target&&!nr(p.target,at(L))&&b(L,L.pointerType)},{capture:!0}),l&&l({type:"hoverstart",target:I,pointerType:j}),o&&o(!0),f(!0)},b=(C,j)=>{let I=p.target;p.pointerType="",p.target=null,!(j==="touch"||!p.isHovered||!I)&&(p.isHovered=!1,v(),s&&s({type:"hoverend",target:I,pointerType:j}),o&&o(!1),f(!1))},S={};return typeof PointerEvent<"u"&&(S.onPointerEnter=C=>{uu&&C.pointerType==="mouse"||w(C,C.pointerType)},S.onPointerLeave=C=>{!a&&nr(C.currentTarget,at(C))&&b(C,C.pointerType)}),{hoverProps:S,triggerHoverEnd:b}},[l,o,s,a,p,h,v]);return y.useEffect(()=>{a&&E({currentTarget:p.target},p.pointerType)},[a]),{hoverProps:x,isHovered:c}}function wu(n={}){let{autoFocus:l=!1,isTextInput:o,within:s}=n,a=y.useRef({isFocused:!1,isFocusVisible:l||au()}),[c,f]=y.useState(!1),[p,h]=y.useState(()=>a.current.isFocused&&a.current.isFocusVisible),v=y.useCallback(()=>h(a.current.isFocused&&a.current.isFocusVisible),[]),x=y.useCallback(b=>{a.current.isFocused=b,a.current.isFocusVisible=au(),f(b),v()},[v]);pv(b=>{a.current.isFocusVisible=b,v()},[o,c],{enabled:c,isTextInput:o});let{focusProps:E}=mv({isDisabled:s,onFocusChange:x}),{focusWithinProps:w}=hv({isDisabled:!s,onFocusWithinChange:x});return{isFocused:c,isFocusVisible:p,focusProps:s?w:E}}var yv=Object.defineProperty,xv=(n,l,o)=>l in n?yv(n,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[l]=o,Wa=(n,l,o)=>(xv(n,typeof l!="symbol"?l+"":l,o),o);let wv=class{constructor(){Wa(this,"current",this.detect()),Wa(this,"handoffState","pending"),Wa(this,"currentId",0)}set(l){this.current!==l&&(this.handoffState="pending",this.currentId=0,this.current=l)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Qt=new wv;function Go(n){var l;return Qt.isServer?null:n==null?document:(l=n?.ownerDocument)!=null?l:document}function Ni(n){var l,o;return Qt.isServer?null:n==null?document:(o=(l=n?.getRootNode)==null?void 0:l.call(n))!=null?o:document}function qp(n){var l,o;return(o=(l=Ni(n))==null?void 0:l.activeElement)!=null?o:null}function bu(n){return qp(n)===n}function Jp(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(l=>setTimeout(()=>{throw l}))}function gt(){let n=[],l={addEventListener(o,s,a,c){return o.addEventListener(s,a,c),l.add(()=>o.removeEventListener(s,a,c))},requestAnimationFrame(...o){let s=requestAnimationFrame(...o);return l.add(()=>cancelAnimationFrame(s))},nextFrame(...o){return l.requestAnimationFrame(()=>l.requestAnimationFrame(...o))},setTimeout(...o){let s=setTimeout(...o);return l.add(()=>clearTimeout(s))},microTask(...o){let s={current:!0};return Jp(()=>{s.current&&o[0]()}),l.add(()=>{s.current=!1})},style(o,s,a){let c=o.style.getPropertyValue(s);return Object.assign(o.style,{[s]:a}),this.add(()=>{Object.assign(o.style,{[s]:c})})},group(o){let s=gt();return o(s),this.add(()=>s.dispose())},add(o){return n.includes(o)||n.push(o),()=>{let s=n.indexOf(o);if(s>=0)for(let a of n.splice(s,1))a()}},dispose(){for(let o of n.splice(0))o()}};return l}function cr(){let[n]=y.useState(gt);return y.useEffect(()=>()=>n.dispose(),[n]),n}let Le=(n,l)=>{Qt.isServer?y.useEffect(n,l):y.useLayoutEffect(n,l)};function Dn(n){let l=y.useRef(n);return Le(()=>{l.current=n},[n]),l}let xe=function(n){let l=Dn(n);return ye.useCallback((...o)=>l.current(...o),[l])};function bv(n){let l=n.width/2,o=n.height/2;return{top:n.clientY-o,right:n.clientX+l,bottom:n.clientY+o,left:n.clientX-l}}function Sv(n,l){return!(!n||!l||n.rightl.right||n.bottoml.bottom)}function Zp({disabled:n=!1}={}){let l=y.useRef(null),[o,s]=y.useState(!1),a=cr(),c=xe(()=>{l.current=null,s(!1),a.dispose()}),f=xe(p=>{if(a.dispose(),l.current===null){l.current=p.currentTarget,s(!0);{let h=Go(p.currentTarget);a.addEventListener(h,"pointerup",c,!1),a.addEventListener(h,"pointermove",v=>{if(l.current){let x=bv(v);s(Sv(x,l.current.getBoundingClientRect()))}},!1),a.addEventListener(h,"pointercancel",c,!1)}}});return{pressed:o,pressProps:n?{}:{onPointerDown:f,onPointerUp:c,onClick:c}}}function kt(n){return y.useMemo(()=>n,Object.values(n))}let Ev=y.createContext(void 0);function Li(){return y.useContext(Ev)}function Kf(...n){return Array.from(new Set(n.flatMap(l=>typeof l=="string"?l.split(" "):[]))).filter(Boolean).join(" ")}function tt(n,l,...o){if(n in l){let a=l[n];return typeof a=="function"?a(...o):a}let s=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,tt),s}var Bo=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Bo||{}),kv=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(kv||{});function rt(){let n=Nv();return y.useCallback(l=>Cv({mergeRefs:n,...l}),[n])}function Cv({ourProps:n,theirProps:l,slot:o,defaultTag:s,features:a,visible:c=!0,name:f,mergeRefs:p}){p=p??jv;let h=em(l,n);if(c)return gi(h,o,s,f,p);let v=a??0;if(v&2){let{static:x=!1,...E}=h;if(x)return gi(E,o,s,f,p)}if(v&1){let{unmount:x=!0,...E}=h;return tt(x?0:1,{0(){return null},1(){return gi({...E,hidden:!0,style:{display:"none"}},o,s,f,p)}})}return gi(h,o,s,f,p)}function gi(n,l={},o,s,a){let{as:c=o,children:f,refName:p="ref",...h}=Ha(n,["unmount","static"]),v=n.ref!==void 0?{[p]:n.ref}:{},x=typeof f=="function"?f(l):f;x=tm(x),"className"in h&&h.className&&typeof h.className=="function"&&(h.className=h.className(l)),h["aria-labelledby"]&&h["aria-labelledby"]===h.id&&(h["aria-labelledby"]=void 0);let E={};if(l){let w=!1,b=[];for(let[S,C]of Object.entries(l))typeof C=="boolean"&&(w=!0),C===!0&&b.push(S.replace(/([A-Z])/g,j=>`-${j.toLowerCase()}`));if(w){E["data-headlessui-state"]=b.join(" ");for(let S of b)E[`data-${S}`]=""}}if(xi(c)&&(Object.keys(Zn(h)).length>0||Object.keys(Zn(E)).length>0))if(!y.isValidElement(x)||Array.isArray(x)&&x.length>1||Pv(x)){if(Object.keys(Zn(h)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${s} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Zn(h)).concat(Object.keys(Zn(E))).map(w=>` - ${w}`).join(` -`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(w=>` - ${w}`).join(` + `,children:[m.jsx("span",{className:"text-lg",children:a.icon}),m.jsx("span",{className:"text-sm",children:a.label})]},a.id))]},s.label))}),m.jsx("div",{className:"p-4 border-t border-gray-800 text-xs text-gray-600",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),m.jsx("span",{children:"Connected"})]})})]}),m.jsx("main",{className:"flex-1 overflow-y-auto bg-gradient-to-br from-gray-950 via-gray-900 to-gray-950",children:m.jsx("div",{className:"p-8 max-w-[1600px] mx-auto",children:o})})]})}const P0="";let Ei=localStorage.getItem("ograph_token")||"";function T0(n){Ei=n,localStorage.setItem("ograph_token",n)}function R0(){return Ei}async function nt(n,l){const o=await fetch(P0+n,{...l,headers:{Authorization:Ei?`Bearer ${Ei}`:"","Content-Type":"application/json",...l?.headers}});if(o.status===401)throw new Error("UNAUTHORIZED");if(!o.ok)throw new Error(`API error: ${o.status}`);return o.json()}const $0=()=>nt("/health"),Wp=()=>nt("/object-defs"),ou=(n,l=50,o=0)=>nt(n?`/objects?type=${n}&limit=${l}&offset=${o}`:`/objects?limit=${l}&offset=${o}`),M0=n=>nt("/objects",{method:"POST",body:JSON.stringify({type:n})}),_0=()=>nt("/event-defs"),L0=(n,l=50,o=0)=>nt(n?`/events?ref=${n}&limit=${l}&offset=${o}`:`/events?limit=${l}&offset=${o}`),Hp=()=>nt("/projection-defs"),I0=(n=50,l=0)=>nt(`/reactions?limit=${n}&offset=${l}`),F0=n=>nt(`/reactions/${n}`,{method:"DELETE"}),D0=(n=50,l=0)=>nt(`/api-keys?limit=${n}&offset=${l}`),A0=n=>nt("/api-keys",{method:"POST",body:JSON.stringify(n)}),z0=n=>nt(`/api-keys/${n}`,{method:"DELETE"}),W0=(n,l)=>nt("/events",{method:"POST",body:JSON.stringify({type:n,payload:l})}),H0=(n=50,l=0,o)=>{let s=`/reaction-logs?limit=${n}&offset=${l}`;return o&&(s+=`&reaction_id=${o}`),nt(s)},V0=(n=50,l=0,o)=>{let s=`/request-logs?limit=${n}&offset=${l}`;return o&&(s+=`&api_key_id=${o}`),nt(s)};function $t(){return m.jsx("div",{className:"flex items-center justify-center p-12",children:m.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"})})}function fn({message:n="No data found"}){return m.jsx("div",{className:"flex items-center justify-center p-12 text-gray-500",children:m.jsxs("div",{className:"text-center",children:[m.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),m.jsx("p",{children:n})]})})}function lr({hash:n,short:l=!0}){const o=l&&n.length>8?n.slice(0,8):n;return m.jsx("span",{className:"inline-block px-2 py-1 bg-gray-800/50 rounded font-mono text-xs text-gray-400",children:o})}function Vr({total:n,limit:l,offset:o,onPageChange:s,onLimitChange:a}){const c=Math.floor(o/l)+1,f=Math.ceil(n/l),p=n===0?0:o+1,h=Math.min(o+l,n),v=o>0,w=o+l{a(parseInt(E.target.value,10)),s(0)},className:"bg-gray-800 text-gray-300 border border-gray-700 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[m.jsx("option",{value:"25",children:"25"}),m.jsx("option",{value:"50",children:"50"}),m.jsx("option",{value:"100",children:"100"})]})]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("button",{onClick:()=>s(o-l),disabled:!v,className:"px-3 py-1 bg-gray-800 text-gray-300 rounded border border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-700 text-sm",children:"Previous"}),m.jsxs("span",{className:"text-sm text-gray-400",children:["Page ",c," / ",f||1]}),m.jsx("button",{onClick:()=>s(o+l),disabled:!w,className:"px-3 py-1 bg-gray-800 text-gray-300 rounded border border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-700 text-sm",children:"Next"})]})]})}function B0(){const[n,l]=y.useState(null),[o,s]=y.useState(""),[a,c]=y.useState(!0);return y.useEffect(()=>{$0().then(l).catch(f=>s(f.message)).finally(()=>c(!1))},[]),a?m.jsx($t,{}):o?m.jsxs("div",{className:"text-red-500 text-center p-8",children:["Error: ",o]}):m.jsxs("div",{className:"max-w-2xl mx-auto",children:[m.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Health Check"}),m.jsxs("div",{className:"bg-gray-900/50 backdrop-blur border border-gray-800 rounded-lg p-8",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"w-4 h-4 bg-green-500 rounded-full"}),m.jsx("div",{className:"absolute inset-0 w-4 h-4 bg-green-500 rounded-full animate-ping opacity-75"})]}),m.jsx("span",{className:"text-green-500 font-semibold text-lg",children:"System Online"})]}),m.jsxs("div",{className:"text-gray-400 mt-4 flex items-baseline gap-2",children:[m.jsx("span",{children:"Version:"}),m.jsx("span",{className:"text-white font-mono bg-gray-800/50 px-3 py-1 rounded",children:n?.version})]})]})]})}function U0(){const[n,l]=y.useState([]),[o,s]=y.useState(""),[a,c]=y.useState(!0);return y.useEffect(()=>{Wp().then(f=>l(f.object_defs)).catch(f=>s(f.message)).finally(()=>c(!1))},[]),a?m.jsx($t,{}):o?m.jsxs("div",{className:"text-red-500 text-center p-8",children:["Error: ",o]}):m.jsxs("div",{className:"max-w-4xl mx-auto",children:[m.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Object Definitions"}),m.jsx("div",{className:"bg-gray-900/50 backdrop-blur rounded-lg overflow-hidden border border-gray-800",children:n.length===0?m.jsx(fn,{message:"No object definitions found"}):m.jsxs("table",{className:"w-full",children:[m.jsx("thead",{className:"bg-gray-800/80 border-b border-gray-700",children:m.jsx("tr",{children:m.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Name"})})}),m.jsx("tbody",{className:"divide-y divide-gray-800",children:n.map((f,p)=>m.jsx("tr",{className:`transition-colors ${p%2===0?"bg-gray-900/30":"bg-gray-850/30"} hover:bg-gray-800/60`,children:m.jsx("td",{className:"px-4 py-3 font-mono text-gray-100",children:f.name})},p))})]})})]})}const K0=typeof document<"u"?ye.useLayoutEffect:()=>{},Fn=n=>{var l;return(l=n?.ownerDocument)!==null&&l!==void 0?l:document},tr=n=>n&&"window"in n&&n.window===n?n:Fn(n).defaultView||window;function Q0(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function Y0(n){return Q0(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let X0=!1;function vu(){return X0}function nr(n,l){if(!vu())return l&&n?n.contains(l):!1;if(!n||!l)return!1;let o=l;for(;o!==null;){if(o===n)return!0;o.tagName==="SLOT"&&o.assignedSlot?o=o.assignedSlot.parentNode:Y0(o)?o=o.host:o=o.parentNode}return!1}const Wr=(n=document)=>{var l;if(!vu())return n.activeElement;let o=n.activeElement;for(;o&&"shadowRoot"in o&&(!((l=o.shadowRoot)===null||l===void 0)&&l.activeElement);)o=o.shadowRoot.activeElement;return o};function at(n){if(vu()&&n.target instanceof Element&&n.target.shadowRoot){var l,o;if("composedPath"in n)return(l=n.composedPath()[0])!==null&&l!==void 0?l:null;if("composedPath"in n.nativeEvent)return(o=n.nativeEvent.composedPath()[0])!==null&&o!==void 0?o:null}return n.target}function G0(n){if(q0())n.focus({preventScroll:!0});else{let l=J0(n);n.focus(),Z0(l)}}let mi=null;function q0(){if(mi==null){mi=!1;try{document.createElement("div").focus({get preventScroll(){return mi=!0,!0}})}catch{}}return mi}function J0(n){let l=n.parentNode,o=[],s=document.scrollingElement||document.documentElement;for(;l instanceof HTMLElement&&l!==s;)(l.offsetHeight"u"||window.navigator==null)return!1;let o=(l=window.navigator.userAgentData)===null||l===void 0?void 0:l.brands;return Array.isArray(o)&&o.some(s=>n.test(s.brand))||n.test(window.navigator.userAgent)}function Vp(n){var l;return typeof window<"u"&&window.navigator!=null?n.test(((l=window.navigator.userAgentData)===null||l===void 0?void 0:l.platform)||window.navigator.platform):!1}function Br(n){let l=null;return()=>(l==null&&(l=n()),l)}const ki=Br(function(){return Vp(/^Mac/i)}),ev=Br(function(){return Vp(/^iPad/i)||ki()&&navigator.maxTouchPoints>1}),tv=Br(function(){return _i(/AppleWebKit/i)&&!nv()}),nv=Br(function(){return _i(/Chrome/i)}),rv=Br(function(){return _i(/Android/i)}),ov=Br(function(){return _i(/Firefox/i)});function Vo(n,l,o=!0){var s,a;let{metaKey:c,ctrlKey:f,altKey:p,shiftKey:h}=l;ov()&&(!((a=window.event)===null||a===void 0||(s=a.type)===null||s===void 0)&&s.startsWith("key"))&&n.target==="_blank"&&(ki()?c=!0:f=!0);let v=tv()&&ki()&&!ev()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:c,ctrlKey:f,altKey:p,shiftKey:h}):new MouseEvent("click",{metaKey:c,ctrlKey:f,altKey:p,shiftKey:h,detail:1,bubbles:!0,cancelable:!0});Vo.isOpening=o,G0(n),n.dispatchEvent(v),Vo.isOpening=!1}Vo.isOpening=!1;function Bp(){let n=y.useRef(new Map),l=y.useCallback((a,c,f,p)=>{let h=p?.once?(...v)=>{n.current.delete(f),f(...v)}:f;n.current.set(f,{type:c,eventTarget:a,fn:h,options:p}),a.addEventListener(c,h,p)},[]),o=y.useCallback((a,c,f,p)=>{var h;let v=((h=n.current.get(f))===null||h===void 0?void 0:h.fn)||f;a.removeEventListener(c,v,p),n.current.delete(f)},[]),s=y.useCallback(()=>{n.current.forEach((a,c)=>{o(a.eventTarget,a.type,c,a.options)})},[o]);return y.useEffect(()=>s,[s]),{addGlobalListener:l,removeGlobalListener:o,removeAllGlobalListeners:s}}function lv(n){return n.pointerType===""&&n.isTrusted?!0:rv()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}var Ye=zp();function Up(n){let l=n;return l.nativeEvent=n,l.isDefaultPrevented=()=>l.defaultPrevented,l.isPropagationStopped=()=>l.cancelBubble,l.persist=()=>{},l}function iv(n,l){Object.defineProperty(n,"target",{value:l}),Object.defineProperty(n,"currentTarget",{value:l})}function Kp(n){let l=y.useRef({isFocused:!1,observer:null});return K0(()=>{const o=l.current;return()=>{o.observer&&(o.observer.disconnect(),o.observer=null)}},[]),y.useCallback(o=>{let s=at(o);if(s instanceof HTMLButtonElement||s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement){l.current.isFocused=!0;let a=s,c=f=>{if(l.current.isFocused=!1,a.disabled){let p=Up(f);n?.(p)}l.current.observer&&(l.current.observer.disconnect(),l.current.observer=null)};a.addEventListener("focusout",c,{once:!0}),l.current.observer=new MutationObserver(()=>{if(l.current.isFocused&&a.disabled){var f;(f=l.current.observer)===null||f===void 0||f.disconnect();let p=a===Wr()?null:Wr();a.dispatchEvent(new FocusEvent("blur",{relatedTarget:p})),a.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:p}))}}),l.current.observer.observe(a,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let sv=!1,Xo=null;const lu=new Set;let Wo=new Map,ir=!1,iu=!1;const av={Tab:!0,Escape:!0};function yu(n,l){for(let o of lu)o(n,l)}function uv(n){return!(n.metaKey||!ki()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function Ci(n){ir=!0,!Vo.isOpening&&uv(n)&&(Xo="keyboard",yu("keyboard",n))}function Ar(n){Xo="pointer","pointerType"in n&&n.pointerType,(n.type==="mousedown"||n.type==="pointerdown")&&(ir=!0,yu("pointer",n))}function Qp(n){!Vo.isOpening&&lv(n)&&(ir=!0,Xo="virtual")}function Yp(n){at(n)===window||at(n)===document||sv||!n.isTrusted||(!ir&&!iu&&(Xo="virtual",yu("virtual",n)),ir=!1,iu=!1)}function Xp(){ir=!1,iu=!0}function su(n){if(typeof window>"u"||typeof document>"u"||Wo.get(tr(n)))return;const l=tr(n),o=Fn(n);let s=l.HTMLElement.prototype.focus;l.HTMLElement.prototype.focus=function(){ir=!0,s.apply(this,arguments)},o.addEventListener("keydown",Ci,!0),o.addEventListener("keyup",Ci,!0),o.addEventListener("click",Qp,!0),l.addEventListener("focus",Yp,!0),l.addEventListener("blur",Xp,!1),typeof PointerEvent<"u"&&(o.addEventListener("pointerdown",Ar,!0),o.addEventListener("pointermove",Ar,!0),o.addEventListener("pointerup",Ar,!0)),l.addEventListener("beforeunload",()=>{Gp(n)},{once:!0}),Wo.set(l,{focus:s})}const Gp=(n,l)=>{const o=tr(n),s=Fn(n);l&&s.removeEventListener("DOMContentLoaded",l),Wo.has(o)&&(o.HTMLElement.prototype.focus=Wo.get(o).focus,s.removeEventListener("keydown",Ci,!0),s.removeEventListener("keyup",Ci,!0),s.removeEventListener("click",Qp,!0),o.removeEventListener("focus",Yp,!0),o.removeEventListener("blur",Xp,!1),typeof PointerEvent<"u"&&(s.removeEventListener("pointerdown",Ar,!0),s.removeEventListener("pointermove",Ar,!0),s.removeEventListener("pointerup",Ar,!0)),Wo.delete(o))};function cv(n){const l=Fn(n);let o;return l.readyState!=="loading"?su(n):(o=()=>{su(n)},l.addEventListener("DOMContentLoaded",o)),()=>Gp(n,o)}typeof document<"u"&&cv();function au(){return Xo!=="pointer"}const dv=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function fv(n,l,o){let s=Fn(o?at(o):void 0),a=o?at(o):void 0;const c=typeof window<"u"?tr(a).HTMLInputElement:HTMLInputElement,f=typeof window<"u"?tr(a).HTMLTextAreaElement:HTMLTextAreaElement,p=typeof window<"u"?tr(a).HTMLElement:HTMLElement,h=typeof window<"u"?tr(a).KeyboardEvent:KeyboardEvent;let v=Wr(s);return n=n||v instanceof c&&!dv.has(v.type)||v instanceof f||v instanceof p&&v.isContentEditable,!(n&&l==="keyboard"&&o instanceof h&&!av[o.key])}function pv(n,l,o){su(),y.useEffect(()=>{if(o?.enabled===!1)return;let s=(a,c)=>{fv(!!o?.isTextInput,a,c)&&n(au())};return lu.add(s),()=>{lu.delete(s)}},l)}function mv(n){let{isDisabled:l,onFocus:o,onBlur:s,onFocusChange:a}=n;const c=y.useCallback(h=>{if(at(h)===h.currentTarget)return s&&s(h),a&&a(!1),!0},[s,a]),f=Kp(c),p=y.useCallback(h=>{let v=at(h);const w=Fn(v),E=w?Wr(w):Wr();v===h.currentTarget&&v===E&&(o&&o(h),a&&a(!0),f(h))},[a,o,f]);return{focusProps:{onFocus:!l&&(o||a||s)?p:void 0,onBlur:!l&&(s||a)?c:void 0}}}function hv(n){let{isDisabled:l,onBlurWithin:o,onFocusWithin:s,onFocusWithinChange:a}=n,c=y.useRef({isFocusWithin:!1}),{addGlobalListener:f,removeAllGlobalListeners:p}=Bp(),h=y.useCallback(E=>{nr(E.currentTarget,at(E))&&c.current.isFocusWithin&&!nr(E.currentTarget,E.relatedTarget)&&(c.current.isFocusWithin=!1,p(),o&&o(E),a&&a(!1))},[o,a,c,p]),v=Kp(h),w=y.useCallback(E=>{if(!nr(E.currentTarget,at(E)))return;let x=at(E);const b=Fn(x),S=Wr(b);if(!c.current.isFocusWithin&&S===x){s&&s(E),a&&a(!0),c.current.isFocusWithin=!0,v(E);let C=E.currentTarget;f(b,"focus",j=>{let I=at(j);if(c.current.isFocusWithin&&!nr(C,I)){let L=new b.defaultView.FocusEvent("blur",{relatedTarget:I});iv(L,C);let P=Up(L);h(P)}},{capture:!0})}},[s,a,v,f,h]);return l?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:w,onBlur:h}}}let uu=!1,hi=0;function gv(){uu=!0,setTimeout(()=>{uu=!1},50)}function Uf(n){n.pointerType==="touch"&&gv()}function vv(){if(!(typeof document>"u"))return hi===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",Uf),hi++,()=>{hi--,!(hi>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",Uf)}}function xu(n){let{onHoverStart:l,onHoverChange:o,onHoverEnd:s,isDisabled:a}=n,[c,f]=y.useState(!1),p=y.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;y.useEffect(vv,[]);let{addGlobalListener:h,removeAllGlobalListeners:v}=Bp(),{hoverProps:w,triggerHoverEnd:E}=y.useMemo(()=>{let x=(C,j)=>{if(p.pointerType=j,a||j==="touch"||p.isHovered||!nr(C.currentTarget,at(C)))return;p.isHovered=!0;let I=C.currentTarget;p.target=I,h(Fn(at(C)),"pointerover",L=>{p.isHovered&&p.target&&!nr(p.target,at(L))&&b(L,L.pointerType)},{capture:!0}),l&&l({type:"hoverstart",target:I,pointerType:j}),o&&o(!0),f(!0)},b=(C,j)=>{let I=p.target;p.pointerType="",p.target=null,!(j==="touch"||!p.isHovered||!I)&&(p.isHovered=!1,v(),s&&s({type:"hoverend",target:I,pointerType:j}),o&&o(!1),f(!1))},S={};return typeof PointerEvent<"u"&&(S.onPointerEnter=C=>{uu&&C.pointerType==="mouse"||x(C,C.pointerType)},S.onPointerLeave=C=>{!a&&nr(C.currentTarget,at(C))&&b(C,C.pointerType)}),{hoverProps:S,triggerHoverEnd:b}},[l,o,s,a,p,h,v]);return y.useEffect(()=>{a&&E({currentTarget:p.target},p.pointerType)},[a]),{hoverProps:w,isHovered:c}}function wu(n={}){let{autoFocus:l=!1,isTextInput:o,within:s}=n,a=y.useRef({isFocused:!1,isFocusVisible:l||au()}),[c,f]=y.useState(!1),[p,h]=y.useState(()=>a.current.isFocused&&a.current.isFocusVisible),v=y.useCallback(()=>h(a.current.isFocused&&a.current.isFocusVisible),[]),w=y.useCallback(b=>{a.current.isFocused=b,a.current.isFocusVisible=au(),f(b),v()},[v]);pv(b=>{a.current.isFocusVisible=b,v()},[o,c],{enabled:c,isTextInput:o});let{focusProps:E}=mv({isDisabled:s,onFocusChange:w}),{focusWithinProps:x}=hv({isDisabled:!s,onFocusWithinChange:w});return{isFocused:c,isFocusVisible:p,focusProps:s?x:E}}var yv=Object.defineProperty,xv=(n,l,o)=>l in n?yv(n,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[l]=o,Wa=(n,l,o)=>(xv(n,typeof l!="symbol"?l+"":l,o),o);let wv=class{constructor(){Wa(this,"current",this.detect()),Wa(this,"handoffState","pending"),Wa(this,"currentId",0)}set(l){this.current!==l&&(this.handoffState="pending",this.currentId=0,this.current=l)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Qt=new wv;function Go(n){var l;return Qt.isServer?null:n==null?document:(l=n?.ownerDocument)!=null?l:document}function Ni(n){var l,o;return Qt.isServer?null:n==null?document:(o=(l=n?.getRootNode)==null?void 0:l.call(n))!=null?o:document}function qp(n){var l,o;return(o=(l=Ni(n))==null?void 0:l.activeElement)!=null?o:null}function bu(n){return qp(n)===n}function Jp(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(l=>setTimeout(()=>{throw l}))}function gt(){let n=[],l={addEventListener(o,s,a,c){return o.addEventListener(s,a,c),l.add(()=>o.removeEventListener(s,a,c))},requestAnimationFrame(...o){let s=requestAnimationFrame(...o);return l.add(()=>cancelAnimationFrame(s))},nextFrame(...o){return l.requestAnimationFrame(()=>l.requestAnimationFrame(...o))},setTimeout(...o){let s=setTimeout(...o);return l.add(()=>clearTimeout(s))},microTask(...o){let s={current:!0};return Jp(()=>{s.current&&o[0]()}),l.add(()=>{s.current=!1})},style(o,s,a){let c=o.style.getPropertyValue(s);return Object.assign(o.style,{[s]:a}),this.add(()=>{Object.assign(o.style,{[s]:c})})},group(o){let s=gt();return o(s),this.add(()=>s.dispose())},add(o){return n.includes(o)||n.push(o),()=>{let s=n.indexOf(o);if(s>=0)for(let a of n.splice(s,1))a()}},dispose(){for(let o of n.splice(0))o()}};return l}function cr(){let[n]=y.useState(gt);return y.useEffect(()=>()=>n.dispose(),[n]),n}let Le=(n,l)=>{Qt.isServer?y.useEffect(n,l):y.useLayoutEffect(n,l)};function Dn(n){let l=y.useRef(n);return Le(()=>{l.current=n},[n]),l}let xe=function(n){let l=Dn(n);return ye.useCallback((...o)=>l.current(...o),[l])};function bv(n){let l=n.width/2,o=n.height/2;return{top:n.clientY-o,right:n.clientX+l,bottom:n.clientY+o,left:n.clientX-l}}function Sv(n,l){return!(!n||!l||n.rightl.right||n.bottoml.bottom)}function Zp({disabled:n=!1}={}){let l=y.useRef(null),[o,s]=y.useState(!1),a=cr(),c=xe(()=>{l.current=null,s(!1),a.dispose()}),f=xe(p=>{if(a.dispose(),l.current===null){l.current=p.currentTarget,s(!0);{let h=Go(p.currentTarget);a.addEventListener(h,"pointerup",c,!1),a.addEventListener(h,"pointermove",v=>{if(l.current){let w=bv(v);s(Sv(w,l.current.getBoundingClientRect()))}},!1),a.addEventListener(h,"pointercancel",c,!1)}}});return{pressed:o,pressProps:n?{}:{onPointerDown:f,onPointerUp:c,onClick:c}}}function kt(n){return y.useMemo(()=>n,Object.values(n))}let Ev=y.createContext(void 0);function Li(){return y.useContext(Ev)}function Kf(...n){return Array.from(new Set(n.flatMap(l=>typeof l=="string"?l.split(" "):[]))).filter(Boolean).join(" ")}function tt(n,l,...o){if(n in l){let a=l[n];return typeof a=="function"?a(...o):a}let s=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,tt),s}var Bo=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Bo||{}),kv=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(kv||{});function rt(){let n=Nv();return y.useCallback(l=>Cv({mergeRefs:n,...l}),[n])}function Cv({ourProps:n,theirProps:l,slot:o,defaultTag:s,features:a,visible:c=!0,name:f,mergeRefs:p}){p=p??jv;let h=em(l,n);if(c)return gi(h,o,s,f,p);let v=a??0;if(v&2){let{static:w=!1,...E}=h;if(w)return gi(E,o,s,f,p)}if(v&1){let{unmount:w=!0,...E}=h;return tt(w?0:1,{0(){return null},1(){return gi({...E,hidden:!0,style:{display:"none"}},o,s,f,p)}})}return gi(h,o,s,f,p)}function gi(n,l={},o,s,a){let{as:c=o,children:f,refName:p="ref",...h}=Ha(n,["unmount","static"]),v=n.ref!==void 0?{[p]:n.ref}:{},w=typeof f=="function"?f(l):f;w=tm(w),"className"in h&&h.className&&typeof h.className=="function"&&(h.className=h.className(l)),h["aria-labelledby"]&&h["aria-labelledby"]===h.id&&(h["aria-labelledby"]=void 0);let E={};if(l){let x=!1,b=[];for(let[S,C]of Object.entries(l))typeof C=="boolean"&&(x=!0),C===!0&&b.push(S.replace(/([A-Z])/g,j=>`-${j.toLowerCase()}`));if(x){E["data-headlessui-state"]=b.join(" ");for(let S of b)E[`data-${S}`]=""}}if(xi(c)&&(Object.keys(Zn(h)).length>0||Object.keys(Zn(E)).length>0))if(!y.isValidElement(w)||Array.isArray(w)&&w.length>1||Pv(w)){if(Object.keys(Zn(h)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${s} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Zn(h)).concat(Object.keys(Zn(E))).map(x=>` - ${x}`).join(` +`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(x=>` - ${x}`).join(` `)].join(` -`))}else{let w=x.props,b=w?.className,S=typeof b=="function"?(...I)=>Kf(b(...I),h.className):Kf(b,h.className),C=S?{className:S}:{},j=em(x.props,Zn(Ha(h,["ref"])));for(let I in E)I in j&&delete E[I];return y.cloneElement(x,Object.assign({},j,E,v,{ref:a(Ov(x),v.ref)},C))}return y.createElement(c,Object.assign({},Ha(h,["ref"]),!xi(c)&&v,!xi(c)&&E),x)}function Nv(){let n=y.useRef([]),l=y.useCallback(o=>{for(let s of n.current)s!=null&&(typeof s=="function"?s(o):s.current=o)},[]);return(...o)=>{if(!o.every(s=>s==null))return n.current=o,l}}function jv(...n){return n.every(l=>l==null)?void 0:l=>{for(let o of n)o!=null&&(typeof o=="function"?o(l):o.current=l)}}function em(...n){if(n.length===0)return{};if(n.length===1)return n[0];let l={},o={};for(let s of n)for(let a in s)a.startsWith("on")&&typeof s[a]=="function"?(o[a]!=null||(o[a]=[]),o[a].push(s[a])):l[a]=s[a];if(l.disabled||l["aria-disabled"])for(let s in o)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(s)&&(o[s]=[a=>{var c;return(c=a?.preventDefault)==null?void 0:c.call(a)}]);for(let s in o)Object.assign(l,{[s](a,...c){let f=o[s];for(let p of f){if((a instanceof Event||a?.nativeEvent instanceof Event)&&a.defaultPrevented)return;p(a,...c)}}});return l}function qo(...n){if(n.length===0)return{};if(n.length===1)return n[0];let l={},o={};for(let s of n)for(let a in s)a.startsWith("on")&&typeof s[a]=="function"?(o[a]!=null||(o[a]=[]),o[a].push(s[a])):l[a]=s[a];for(let s in o)Object.assign(l,{[s](...a){let c=o[s];for(let f of c)f?.(...a)}});return l}function ot(n){var l;return Object.assign(y.forwardRef(n),{displayName:(l=n.displayName)!=null?l:n.name})}function Zn(n){let l=Object.assign({},n);for(let o in l)l[o]===void 0&&delete l[o];return l}function Ha(n,l=[]){let o=Object.assign({},n);for(let s of l)s in o&&delete o[s];return o}function Ov(n){return ye.version.split(".")[0]>="19"?n.props.ref:n.ref}function tm(n){if(n!=null&&n.$$typeof===Symbol.for("react.lazy")){let l=n._payload;if(l!=null&&l.status==="fulfilled")return tm(l.value)}return n}function xi(n){return n===y.Fragment||n===Symbol.for("react.fragment")}function Pv(n){return xi(n.type)}function nm(n,l,o){let[s,a]=y.useState(o),c=n!==void 0,f=y.useRef(c),p=y.useRef(!1),h=y.useRef(!1);return c&&!f.current&&!p.current?(p.current=!0,f.current=c,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!c&&f.current&&!h.current&&(h.current=!0,f.current=c,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[c?n:s,xe(v=>(c||Ye.flushSync(()=>a(v)),l?.(v)))]}function rm(n){let[l]=y.useState(n);return l}function om(n={},l=null,o=[]){for(let[s,a]of Object.entries(n))im(o,lm(l,s),a);return o}function lm(n,l){return n?n+"["+l+"]":l}function im(n,l,o){if(Array.isArray(o))for(let[s,a]of o.entries())im(n,lm(l,s.toString()),a);else o instanceof Date?n.push([l,o.toISOString()]):typeof o=="boolean"?n.push([l,o?"1":"0"]):typeof o=="string"?n.push([l,o]):typeof o=="number"?n.push([l,`${o}`]):o==null?n.push([l,""]):Rv(o)&&!y.isValidElement(o)&&om(o,l,n)}function Tv(n){var l,o;let s=(l=n?.form)!=null?l:n.closest("form");if(s){for(let a of s.elements)if(a!==n&&(a.tagName==="INPUT"&&a.type==="submit"||a.tagName==="BUTTON"&&a.type==="submit"||a.nodeName==="INPUT"&&a.type==="image")){a.click();return}(o=s.requestSubmit)==null||o.call(s)}}function Rv(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let l=Object.getPrototypeOf(n);return l===null||Object.getPrototypeOf(l)===null}let $v="span";var Su=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(Su||{});function Mv(n,l){var o;let{features:s=1,...a}=n,c={ref:l,"aria-hidden":(s&2)===2?!0:(o=a["aria-hidden"])!=null?o:void 0,hidden:(s&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(s&4)===4&&(s&2)!==2&&{display:"none"}}};return rt()({ourProps:c,theirProps:a,slot:{},defaultTag:$v,name:"Hidden"})}let sm=ot(Mv),_v=y.createContext(null);function Lv({children:n}){let l=y.useContext(_v);if(!l)return ye.createElement(ye.Fragment,null,n);let{target:o}=l;return o?Ye.createPortal(ye.createElement(ye.Fragment,null,n),o):null}function am({data:n,form:l,disabled:o,onReset:s,overrides:a}){let[c,f]=y.useState(null),p=cr();return y.useEffect(()=>{if(s&&c)return p.addEventListener(c,"reset",s)},[c,l,s]),ye.createElement(Lv,null,ye.createElement(Iv,{setForm:f,formId:l}),om(n).map(([h,v])=>ye.createElement(sm,{features:Su.Hidden,...Zn({key:h,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:l,disabled:o,name:h,value:v,...a})})))}function Iv({setForm:n,formId:l}){return y.useEffect(()=>{if(l){let o=document.getElementById(l);o&&n(o)}},[n,l]),l?null:ye.createElement(sm,{features:Su.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:o=>{if(!o)return;let s=o.closest("form");s&&n(s)}})}let Fv=y.createContext(void 0);function Eu(){return y.useContext(Fv)}function um(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function Ii(n){return um(n)&&"tagName"in n}function Gt(n){return Ii(n)&&"accessKey"in n}function rr(n){return Ii(n)&&"tabIndex"in n}function Dv(n){return Ii(n)&&"style"in n}function Av(n){return Gt(n)&&n.nodeName==="IFRAME"}function ji(n){return Gt(n)&&n.nodeName==="INPUT"}function Qf(n){return Gt(n)&&n.nodeName==="LABEL"}function zv(n){return Gt(n)&&n.nodeName==="FIELDSET"}function cm(n){return Gt(n)&&n.nodeName==="LEGEND"}function Wv(n){return Ii(n)?n.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Yf(n){let l=n.parentElement,o=null;for(;l&&!zv(l);)cm(l)&&(o=l),l=l.parentElement;let s=l?.getAttribute("disabled")==="";return s&&Hv(o)?!1:s}function Hv(n){if(!n)return!1;let l=n.previousElementSibling;for(;l!==null;){if(cm(l))return!1;l=l.previousElementSibling}return!0}let dm=Symbol();function Vv(n,l=!0){return Object.assign(n,{[dm]:l})}function vt(...n){let l=y.useRef(n);y.useEffect(()=>{l.current=n},[n]);let o=xe(s=>{for(let a of l.current)a!=null&&(typeof a=="function"?a(s):a.current=s)});return n.every(s=>s==null||s?.[dm])?void 0:o}let ku=y.createContext(null);ku.displayName="DescriptionContext";function fm(){let n=y.useContext(ku);if(n===null){let l=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(l,fm),l}return n}function pm(){var n,l;return(l=(n=y.useContext(ku))==null?void 0:n.value)!=null?l:void 0}let Bv="p";function Uv(n,l){let o=y.useId(),s=Li(),{id:a=`headlessui-description-${o}`,...c}=n,f=fm(),p=vt(l);Le(()=>f.register(a),[a,f.register]);let h=kt({...f.slot,disabled:s||!1}),v={ref:p,...f.props,id:a};return rt()({ourProps:v,theirProps:c,slot:h,defaultTag:Bv,name:f.name||"Description"})}let Kv=ot(Uv);Object.assign(Kv,{});var Ne=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(Ne||{});let Fi=y.createContext(null);Fi.displayName="LabelContext";function mm(){let n=y.useContext(Fi);if(n===null){let l=new Error("You used a