diff --git "a/assets/index-DAJCFClI.js" "b/assets/index-DAJCFClI.js" new file mode 100644--- /dev/null +++ "b/assets/index-DAJCFClI.js" @@ -0,0 +1,132 @@ +var Rv=Object.defineProperty;var Pv=(n,o,i)=>o in n?Rv(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i;var rt=(n,o,i)=>Pv(n,typeof o!="symbol"?o+"":o,i);function Tv(n,o){for(var i=0;il[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();function sm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wu={exports:{}},gi={},Su={exports:{}},_e={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tp;function Nv(){if(tp)return _e;tp=1;var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.iterator;function w(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,C={};function k(R,Y,ue){this.props=R,this.context=Y,this.refs=C,this.updater=ue||S}k.prototype.isReactComponent={},k.prototype.setState=function(R,Y){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,Y,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=k.prototype;function V(R,Y,ue){this.props=R,this.context=Y,this.refs=C,this.updater=ue||S}var T=V.prototype=new N;T.constructor=V,b(T,k.prototype),T.isPureReactComponent=!0;var j=Array.isArray,M=Object.prototype.hasOwnProperty,D={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function A(R,Y,ue){var ce,le={},oe=null,he=null;if(Y!=null)for(ce in Y.ref!==void 0&&(he=Y.ref),Y.key!==void 0&&(oe=""+Y.key),Y)M.call(Y,ce)&&!W.hasOwnProperty(ce)&&(le[ce]=Y[ce]);var xe=arguments.length-2;if(xe===1)le.children=ue;else if(1>>1,Y=I[R];if(0>>1;Rc(le,B))oec(he,le)?(I[R]=he,I[oe]=B,R=oe):(I[R]=le,I[ce]=B,R=ce);else if(oec(he,B))I[R]=he,I[oe]=B,R=oe;else break e}}return q}function c(I,q){var B=I.sortIndex-q.sortIndex;return B!==0?B:I.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var h=[],m=[],v=1,g=null,w=3,S=!1,b=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(I){for(var q=i(m);q!==null;){if(q.callback===null)l(m);else if(q.startTime<=I)l(m),q.sortIndex=q.expirationTime,o(h,q);else break;q=i(m)}}function j(I){if(C=!1,T(I),!b)if(i(h)!==null)b=!0,X(M);else{var q=i(m);q!==null&&Q(j,q.startTime-I)}}function M(I,q){b=!1,C&&(C=!1,N(A),A=-1),S=!0;var B=w;try{for(T(q),g=i(h);g!==null&&(!(g.expirationTime>q)||I&&!te());){var R=g.callback;if(typeof R=="function"){g.callback=null,w=g.priorityLevel;var Y=R(g.expirationTime<=q);q=n.unstable_now(),typeof Y=="function"?g.callback=Y:g===i(h)&&l(h),T(q)}else l(h);g=i(h)}if(g!==null)var ue=!0;else{var ce=i(m);ce!==null&&Q(j,ce.startTime-q),ue=!1}return ue}finally{g=null,w=B,S=!1}}var D=!1,W=null,A=-1,U=5,ne=-1;function te(){return!(n.unstable_now()-neI||125R?(I.sortIndex=B,o(m,I),i(h)===null&&I===i(m)&&(C?(N(A),A=-1):C=!0,Q(j,B-R))):(I.sortIndex=Y,o(h,I),b||S||(b=!0,X(M))),I},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(I){var q=w;return function(){var B=w;w=q;try{return I.apply(this,arguments)}finally{w=B}}}})(Eu)),Eu}var sp;function Iv(){return sp||(sp=1,bu.exports=jv()),bu.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var lp;function Lv(){if(lp)return Nt;lp=1;var n=Ii(),o=Iv();function i(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,m=/^[: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]*$/,v={},g={};function w(e){return h.call(g,e)?!0:h.call(v,e)?!1:m.test(e)?g[e]=!0:(v[e]=!0,!1)}function S(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,r,s){if(t===null||typeof t>"u"||S(e,t,r,s))return!0;if(s)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,s,a,f,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=f,this.removeEmptyString=y}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){k[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];k[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){k[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){k[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){k[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){k[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){k[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){k[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){k[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function V(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(N,V);k[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(N,V);k[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(N,V);k[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){k[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),k.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){k[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function T(e,t,r,s){var a=k.hasOwnProperty(t)?k[t]:null;(a!==null?a.type!==0:s||!(2_||a[y]!==f[_]){var P=` +`+a[y].replace(" at new "," at ");return e.displayName&&P.includes("")&&(P=P.replace("",e.displayName)),P}while(1<=y&&0<=_);break}}}finally{ue=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Y(e):""}function le(e){switch(e.tag){case 5:return Y(e.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function oe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case D:return"Portal";case U:return"Profiler";case A:return"StrictMode";case K:return"Suspense";case G:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case te:return(e.displayName||"Context")+".Consumer";case ne:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function he(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oe(t);case 8:return t===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function de(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Te(e){var t=de(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(y){s=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ke(e){e._valueTracker||(e._valueTracker=Te(e))}function Bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=de(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function bt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function it(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function jt(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=xe(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function tn(e,t){t=t.checked,t!=null&&T(e,"checked",t,!1)}function Ht(e,t){tn(e,t);var r=xe(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?On(e,t.type,r):t.hasOwnProperty("defaultValue")&&On(e,t.type,xe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cr(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function On(e,t,r){(t!=="number"||bt(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Re=Array.isArray;function ie(e,t,r,s){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=gn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Lt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ve={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rn=["Webkit","ms","Moz","O"];Object.keys(Ve).forEach(function(e){rn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ve[t]=Ve[e]})});function on(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ve.hasOwnProperty(e)&&Ve[e]?(""+t).trim():t+"px"}function _r(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,a=on(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,a):e[r]=a}}var Jr=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zn(e,t){if(t){if(Jr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Jn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var er=null;function Me(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ye=null,ut=null,et=null;function Kt(e){if(e=ti(e)){if(typeof Ye!="function")throw Error(i(280));var t=e.stateNode;t&&(t=ls(t),Ye(e.stateNode,e.type,t))}}function Et(e){ut?et?et.push(e):et=[e]:ut=e}function vn(){if(ut){var e=ut,t=et;if(et=ut=null,Kt(e),t)for(e=0;e>>=0,e===0?32:31-(Bh(e)/Hh|0)|0}var Bi=64,Hi=4194304;function zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;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:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wi(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,a=e.suspendedLanes,f=e.pingedLanes,y=r&268435455;if(y!==0){var _=y&~a;_!==0?s=zo(_):(f&=y,f!==0&&(s=zo(f)))}else y=r&~a,y!==0?s=zo(y):f!==0&&(s=zo(f));if(s===0)return 0;if(t!==0&&t!==s&&(t&a)===0&&(a=s&-s,f=t&-t,a>=f||a===16&&(f&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0r;r++)t.push(e);return t}function Do(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ln(t),e[t]=r}function Gh(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Ko),Yc=" ",Gc=!1;function Qc(e,t){switch(e){case"keyup":return kg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oo=!1;function Eg(e,t){switch(e){case"compositionend":return Xc(t);case"keypress":return t.which!==32?null:(Gc=!0,Yc);case"textInput":return e=t.data,e===Yc&&Gc?null:e;default:return null}}function Cg(e,t){if(oo)return e==="compositionend"||!ea&&Qc(e,t)?(e=Uc(),Xi=Gl=ir=null,oo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rf(r)}}function sf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lf(){for(var e=window,t=bt();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=bt(e.document)}return t}function ra(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ig(e){var t=lf(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&sf(r.ownerDocument.documentElement,r)){if(s!==null&&ra(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,f=Math.min(s.start,a);s=s.end===void 0?f:Math.min(s.end,a),!e.extend&&f>s&&(a=s,s=f,f=a),a=of(r,f);var y=of(r,s);a&&y&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),f>s?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,io=null,oa=null,Xo=null,ia=!1;function af(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ia||io==null||io!==bt(s)||(s=io,"selectionStart"in s&&ra(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Xo&&Qo(Xo,s)||(Xo=s,s=os(oa,"onSelect"),0co||(e.current=va[co],va[co]=null,co--)}function De(e,t){co++,va[co]=e.current,e.current=t}var ur={},dt=ar(ur),Ct=ar(!1),Nr=ur;function fo(e,t){var r=e.type.contextTypes;if(!r)return ur;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var a={},f;for(f in r)a[f]=t[f];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function _t(e){return e=e.childContextTypes,e!=null}function as(){$e(Ct),$e(dt)}function bf(e,t,r){if(dt.current!==ur)throw Error(i(168));De(dt,t),De(Ct,r)}function Ef(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var a in s)if(!(a in t))throw Error(i(108,he(e)||"Unknown",a));return B({},r,s)}function us(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ur,Nr=dt.current,De(dt,e),De(Ct,Ct.current),!0}function Cf(e,t,r){var s=e.stateNode;if(!s)throw Error(i(169));r?(e=Ef(e,t,Nr),s.__reactInternalMemoizedMergedChildContext=e,$e(Ct),$e(dt),De(dt,e)):$e(Ct),De(Ct,r)}var zn=null,cs=!1,ya=!1;function _f(e){zn===null?zn=[e]:zn.push(e)}function Kg(e){cs=!0,_f(e)}function cr(){if(!ya&&zn!==null){ya=!0;var e=0,t=Le;try{var r=zn;for(Le=1;e>=y,a-=y,Dn=1<<32-ln(t)+a|r<be?(at=Se,Se=null):at=Se.sibling;var Oe=Z(F,Se,$[be],re);if(Oe===null){Se===null&&(Se=at);break}e&&Se&&Oe.alternate===null&&t(F,Se),O=f(Oe,O,be),we===null?ye=Oe:we.sibling=Oe,we=Oe,Se=at}if(be===$.length)return r(F,Se),Be&&Or(F,be),ye;if(Se===null){for(;be<$.length;be++)Se=ee(F,$[be],re),Se!==null&&(O=f(Se,O,be),we===null?ye=Se:we.sibling=Se,we=Se);return Be&&Or(F,be),ye}for(Se=s(F,Se);be<$.length;be++)at=ae(Se,F,be,$[be],re),at!==null&&(e&&at.alternate!==null&&Se.delete(at.key===null?be:at.key),O=f(at,O,be),we===null?ye=at:we.sibling=at,we=at);return e&&Se.forEach(function(xr){return t(F,xr)}),Be&&Or(F,be),ye}function ve(F,O,$,re){var ye=q($);if(typeof ye!="function")throw Error(i(150));if($=ye.call($),$==null)throw Error(i(151));for(var we=ye=null,Se=O,be=O=0,at=null,Oe=$.next();Se!==null&&!Oe.done;be++,Oe=$.next()){Se.index>be?(at=Se,Se=null):at=Se.sibling;var xr=Z(F,Se,Oe.value,re);if(xr===null){Se===null&&(Se=at);break}e&&Se&&xr.alternate===null&&t(F,Se),O=f(xr,O,be),we===null?ye=xr:we.sibling=xr,we=xr,Se=at}if(Oe.done)return r(F,Se),Be&&Or(F,be),ye;if(Se===null){for(;!Oe.done;be++,Oe=$.next())Oe=ee(F,Oe.value,re),Oe!==null&&(O=f(Oe,O,be),we===null?ye=Oe:we.sibling=Oe,we=Oe);return Be&&Or(F,be),ye}for(Se=s(F,Se);!Oe.done;be++,Oe=$.next())Oe=ae(Se,F,be,Oe.value,re),Oe!==null&&(e&&Oe.alternate!==null&&Se.delete(Oe.key===null?be:Oe.key),O=f(Oe,O,be),we===null?ye=Oe:we.sibling=Oe,we=Oe);return e&&Se.forEach(function(_v){return t(F,_v)}),Be&&Or(F,be),ye}function qe(F,O,$,re){if(typeof $=="object"&&$!==null&&$.type===W&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case M:e:{for(var ye=$.key,we=O;we!==null;){if(we.key===ye){if(ye=$.type,ye===W){if(we.tag===7){r(F,we.sibling),O=a(we,$.props.children),O.return=F,F=O;break e}}else if(we.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===X&&Of(ye)===we.type){r(F,we.sibling),O=a(we,$.props),O.ref=ni(F,we,$),O.return=F,F=O;break e}r(F,we);break}else t(F,we);we=we.sibling}$.type===W?(O=Vr($.props.children,F.mode,re,$.key),O.return=F,F=O):(re=Ds($.type,$.key,$.props,null,F.mode,re),re.ref=ni(F,O,$),re.return=F,F=re)}return y(F);case D:e:{for(we=$.key;O!==null;){if(O.key===we)if(O.tag===4&&O.stateNode.containerInfo===$.containerInfo&&O.stateNode.implementation===$.implementation){r(F,O.sibling),O=a(O,$.children||[]),O.return=F,F=O;break e}else{r(F,O);break}else t(F,O);O=O.sibling}O=hu($,F.mode,re),O.return=F,F=O}return y(F);case X:return we=$._init,qe(F,O,we($._payload),re)}if(Re($))return pe(F,O,$,re);if(q($))return ve(F,O,$,re);ms(F,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,O!==null&&O.tag===6?(r(F,O.sibling),O=a(O,$),O.return=F,F=O):(r(F,O),O=mu($,F.mode,re),O.return=F,F=O),y(F)):r(F,O)}return qe}var go=jf(!0),If=jf(!1),hs=ar(null),gs=null,vo=null,Ea=null;function Ca(){Ea=vo=gs=null}function _a(e){var t=hs.current;$e(hs),e._currentValue=t}function Ra(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function yo(e,t){gs=e,Ea=vo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rt=!0),e.firstContext=null)}function Qt(e){var t=e._currentValue;if(Ea!==e)if(e={context:e,memoizedValue:t,next:null},vo===null){if(gs===null)throw Error(i(308));vo=e,gs.dependencies={lanes:0,firstContext:e}}else vo=vo.next=e;return t}var jr=null;function Pa(e){jr===null?jr=[e]:jr.push(e)}function Lf(e,t,r,s){var a=t.interleaved;return a===null?(r.next=r,Pa(t)):(r.next=a.next,a.next=r),t.interleaved=r,Vn(e,s)}function Vn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fr=!1;function Ta(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Af(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ne&2)!==0){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,Vn(e,r)}return a=s.interleaved,a===null?(t.next=t,Pa(s)):(t.next=a.next,a.next=t),s.interleaved=t,Vn(e,r)}function vs(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Bl(e,r)}}function zf(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var a=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var y={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};f===null?a=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?a=f=t:f=f.next=t}else a=f=t;r={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:f,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ys(e,t,r,s){var a=e.updateQueue;fr=!1;var f=a.firstBaseUpdate,y=a.lastBaseUpdate,_=a.shared.pending;if(_!==null){a.shared.pending=null;var P=_,H=P.next;P.next=null,y===null?f=H:y.next=H,y=P;var J=e.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==y&&(_===null?J.firstBaseUpdate=H:_.next=H,J.lastBaseUpdate=P))}if(f!==null){var ee=a.baseState;y=0,J=H=P=null,_=f;do{var Z=_.lane,ae=_.eventTime;if((s&Z)===Z){J!==null&&(J=J.next={eventTime:ae,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var pe=e,ve=_;switch(Z=t,ae=r,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){ee=pe.call(ae,ee,Z);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,Z=typeof pe=="function"?pe.call(ae,ee,Z):pe,Z==null)break e;ee=B({},ee,Z);break e;case 2:fr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,Z=a.effects,Z===null?a.effects=[_]:Z.push(_))}else ae={eventTime:ae,lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(H=J=ae,P=ee):J=J.next=ae,y|=Z;if(_=_.next,_===null){if(_=a.shared.pending,_===null)break;Z=_,_=Z.next,Z.next=null,a.lastBaseUpdate=Z,a.shared.pending=null}}while(!0);if(J===null&&(P=ee),a.baseState=P,a.firstBaseUpdate=H,a.lastBaseUpdate=J,t=a.shared.interleaved,t!==null){a=t;do y|=a.lane,a=a.next;while(a!==t)}else f===null&&(a.shared.lanes=0);Ar|=y,e.lanes=y,e.memoizedState=ee}}function Df(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var s=Ia.transition;Ia.transition={};try{e(!1),t()}finally{Le=r,Ia.transition=s}}function rd(){return Xt().memoizedState}function Xg(e,t,r){var s=gr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},od(e))id(t,r);else if(r=Lf(e,t,r,s),r!==null){var a=xt();pn(r,e,s,a),sd(r,t,s)}}function qg(e,t,r){var s=gr(e),a={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(od(e))id(t,a);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,_=f(y,r);if(a.hasEagerState=!0,a.eagerState=_,an(_,y)){var P=t.interleaved;P===null?(a.next=a,Pa(t)):(a.next=P.next,P.next=a),t.interleaved=a;return}}catch{}finally{}r=Lf(e,t,a,s),r!==null&&(a=xt(),pn(r,e,s,a),sd(r,t,s))}}function od(e){var t=e.alternate;return e===We||t!==null&&t===We}function id(e,t){si=Ss=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function sd(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Bl(e,r)}}var Es={readContext:Qt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},Zg={readContext:Qt,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:Qf,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ks(4194308,4,Zf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return ks(4,2,e,t)},useMemo:function(e,t){var r=bn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=bn();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Xg.bind(null,We,e),[s.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:Yf,useDebugValue:Ua,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=Yf(!1),t=e[0];return e=Qg.bind(null,e[1]),bn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=We,a=bn();if(Be){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),lt===null)throw Error(i(349));(Lr&30)!==0||$f(s,t,r)}a.memoizedState=r;var f={value:r,getSnapshot:t};return a.queue=f,Qf(Hf.bind(null,s,f,e),[e]),s.flags|=2048,ui(9,Bf.bind(null,s,f,r,t),void 0,null),r},useId:function(){var e=bn(),t=lt.identifierPrefix;if(Be){var r=Fn,s=Dn;r=(s&~(1<<32-ln(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=li++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=y.createElement(r,{is:s.is}):(e=y.createElement(r),r==="select"&&(y=e,s.multiple?y.multiple=!0:s.size&&(y.size=s.size))):e=y.createElementNS(e,r),e[Sn]=t,e[ei]=s,_d(e,t,!1,!1),t.stateNode=e;e:{switch(y=Jn(r,s),r){case"dialog":Ue("cancel",e),Ue("close",e),a=s;break;case"iframe":case"object":case"embed":Ue("load",e),a=s;break;case"video":case"audio":for(a=0;abo&&(t.flags|=128,s=!0,ci(f,!1),t.lanes=4194304)}else{if(!s)if(e=xs(y),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ci(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Be)return mt(t),null}else 2*Xe()-f.renderingStartTime>bo&&r!==1073741824&&(t.flags|=128,s=!0,ci(f,!1),t.lanes=4194304);f.isBackwards?(y.sibling=t.child,t.child=y):(r=f.last,r!==null?r.sibling=y:t.child=y,f.last=y)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Xe(),t.sibling=null,r=He.current,De(He,s?r&1|2:r&1),t):(mt(t),null);case 22:case 23:return fu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(Ft&1073741824)!==0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function sv(e,t){switch(wa(t),t.tag){case 1:return _t(t.type)&&as(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),$e(Ct),$e(dt),ja(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ma(t),null;case 13:if($e(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(He),null;case 4:return xo(),null;case 10:return _a(t.type._context),null;case 22:case 23:return fu(),null;case 24:return null;default:return null}}var Ps=!1,ht=!1,lv=typeof WeakSet=="function"?WeakSet:Set,fe=null;function So(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Ge(e,t,s)}else r.current=null}function Ja(e,t,r){try{r()}catch(s){Ge(e,t,s)}}var Td=!1;function av(e,t){if(fa=Gi,e=lf(),ra(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var a=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,_=-1,P=-1,H=0,J=0,ee=e,Z=null;t:for(;;){for(var ae;ee!==r||a!==0&&ee.nodeType!==3||(_=y+a),ee!==f||s!==0&&ee.nodeType!==3||(P=y+s),ee.nodeType===3&&(y+=ee.nodeValue.length),(ae=ee.firstChild)!==null;)Z=ee,ee=ae;for(;;){if(ee===e)break t;if(Z===r&&++H===a&&(_=y),Z===f&&++J===s&&(P=y),(ae=ee.nextSibling)!==null)break;ee=Z,Z=ee.parentNode}ee=ae}r=_===-1||P===-1?null:{start:_,end:P}}else r=null}r=r||{start:0,end:0}}else r=null;for(da={focusedElem:e,selectionRange:r},Gi=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,qe=pe.memoizedState,F=t.stateNode,O=F.getSnapshotBeforeUpdate(t.elementType===t.type?ve:cn(t.type,ve),qe);F.__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(i(163))}}catch(re){Ge(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return pe=Td,Td=!1,pe}function fi(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&e)===e){var f=a.destroy;a.destroy=void 0,f!==void 0&&Ja(t,r,f)}a=a.next}while(a!==s)}}function Ts(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 s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function eu(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 Nd(e){var t=e.alternate;t!==null&&(e.alternate=null,Nd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sn],delete t[ei],delete t[ga],delete t[Hg],delete t[Wg])),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 Md(e){return e.tag===5||e.tag===3||e.tag===4}function Od(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Md(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 tu(e,t,r){var s=e.tag;if(s===5||s===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=ss));else if(s!==4&&(e=e.child,e!==null))for(tu(e,t,r),e=e.sibling;e!==null;)tu(e,t,r),e=e.sibling}function nu(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(nu(e,t,r),e=e.sibling;e!==null;)nu(e,t,r),e=e.sibling}var ct=null,fn=!1;function pr(e,t,r){for(r=r.child;r!==null;)jd(e,t,r),r=r.sibling}function jd(e,t,r){if(wn&&typeof wn.onCommitFiberUnmount=="function")try{wn.onCommitFiberUnmount($i,r)}catch{}switch(r.tag){case 5:ht||So(r,t);case 6:var s=ct,a=fn;ct=null,pr(e,t,r),ct=s,fn=a,ct!==null&&(fn?(e=ct,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ct.removeChild(r.stateNode));break;case 18:ct!==null&&(fn?(e=ct,r=r.stateNode,e.nodeType===8?ha(e.parentNode,r):e.nodeType===1&&ha(e,r),Bo(e)):ha(ct,r.stateNode));break;case 4:s=ct,a=fn,ct=r.stateNode.containerInfo,fn=!0,pr(e,t,r),ct=s,fn=a;break;case 0:case 11:case 14:case 15:if(!ht&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){a=s=s.next;do{var f=a,y=f.destroy;f=f.tag,y!==void 0&&((f&2)!==0||(f&4)!==0)&&Ja(r,t,y),a=a.next}while(a!==s)}pr(e,t,r);break;case 1:if(!ht&&(So(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(_){Ge(r,t,_)}pr(e,t,r);break;case 21:pr(e,t,r);break;case 22:r.mode&1?(ht=(s=ht)||r.memoizedState!==null,pr(e,t,r),ht=s):pr(e,t,r);break;default:pr(e,t,r)}}function Id(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new lv),t.forEach(function(s){var a=vv.bind(null,e,s);r.has(s)||(r.add(s),s.then(a,a))})}}function dn(e,t){var r=t.deletions;if(r!==null)for(var s=0;sa&&(a=y),s&=~f}if(s=a,s=Xe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*cv(s/1960))-s,10e?16:e,hr===null)var s=!1;else{if(e=hr,hr=null,Is=0,(Ne&6)!==0)throw Error(i(331));var a=Ne;for(Ne|=4,fe=e.current;fe!==null;){var f=fe,y=f.child;if((fe.flags&16)!==0){var _=f.deletions;if(_!==null){for(var P=0;P<_.length;P++){var H=_[P];for(fe=H;fe!==null;){var J=fe;switch(J.tag){case 0:case 11:case 15:fi(8,J,f)}var ee=J.child;if(ee!==null)ee.return=J,fe=ee;else for(;fe!==null;){J=fe;var Z=J.sibling,ae=J.return;if(Nd(J),J===H){fe=null;break}if(Z!==null){Z.return=ae,fe=Z;break}fe=ae}}}var pe=f.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var qe=ve.sibling;ve.sibling=null,ve=qe}while(ve!==null)}}fe=f}}if((f.subtreeFlags&2064)!==0&&y!==null)y.return=f,fe=y;else e:for(;fe!==null;){if(f=fe,(f.flags&2048)!==0)switch(f.tag){case 0:case 11:case 15:fi(9,f,f.return)}var F=f.sibling;if(F!==null){F.return=f.return,fe=F;break e}fe=f.return}}var O=e.current;for(fe=O;fe!==null;){y=fe;var $=y.child;if((y.subtreeFlags&2064)!==0&&$!==null)$.return=y,fe=$;else e:for(y=O;fe!==null;){if(_=fe,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Ts(9,_)}}catch(ye){Ge(_,_.return,ye)}if(_===y){fe=null;break e}var re=_.sibling;if(re!==null){re.return=_.return,fe=re;break e}fe=_.return}}if(Ne=a,cr(),wn&&typeof wn.onPostCommitFiberRoot=="function")try{wn.onPostCommitFiberRoot($i,e)}catch{}s=!0}return s}finally{Le=r,qt.transition=t}}return!1}function Kd(e,t,r){t=wo(r,t),t=cd(e,t,1),e=dr(e,t,1),t=xt(),e!==null&&(Do(e,1,t),Tt(e,t))}function Ge(e,t,r){if(e.tag===3)Kd(e,e,r);else for(;t!==null;){if(t.tag===3){Kd(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(mr===null||!mr.has(s))){e=wo(r,e),e=fd(t,e,1),t=dr(t,e,1),e=xt(),t!==null&&(Do(t,1,e),Tt(t,e));break}}t=t.return}}function hv(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=xt(),e.pingedLanes|=e.suspendedLanes&r,lt===e&&(ft&r)===r&&(nt===4||nt===3&&(ft&130023424)===ft&&500>Xe()-iu?Dr(e,0):ou|=r),Tt(e,t)}function Yd(e,t){t===0&&((e.mode&1)===0?t=1:(t=Hi,Hi<<=1,(Hi&130023424)===0&&(Hi=4194304)));var r=xt();e=Vn(e,t),e!==null&&(Do(e,t,r),Tt(e,r))}function gv(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Yd(e,r)}function vv(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(i(314))}s!==null&&s.delete(t),Yd(e,r)}var Gd;Gd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ct.current)Rt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Rt=!1,ov(e,t,r);Rt=(e.flags&131072)!==0}else Rt=!1,Be&&(t.flags&1048576)!==0&&Rf(t,ds,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Rs(e,t),e=t.pendingProps;var a=fo(t,dt.current);yo(t,r),a=Aa(null,t,s,e,a,r);var f=za();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(s)?(f=!0,us(t)):f=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ta(t),a.updater=Cs,t.stateNode=a,a._reactInternals=t,Ba(t,s,e,r),t=Ya(null,t,s,!0,f,r)):(t.tag=0,Be&&f&&xa(t),yt(null,t,a,r),t=t.child),t;case 16:s=t.elementType;e:{switch(Rs(e,t),e=t.pendingProps,a=s._init,s=a(s._payload),t.type=s,a=t.tag=xv(s),e=cn(s,e),a){case 0:t=Ka(null,t,s,e,r);break e;case 1:t=wd(null,t,s,e,r);break e;case 11:t=hd(null,t,s,e,r);break e;case 14:t=gd(null,t,s,cn(s.type,e),r);break e}throw Error(i(306,s,""))}return t;case 0:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:cn(s,a),Ka(e,t,s,a,r);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:cn(s,a),wd(e,t,s,a,r);case 3:e:{if(Sd(t),e===null)throw Error(i(387));s=t.pendingProps,f=t.memoizedState,a=f.element,Af(e,t),ys(t,s,null,r);var y=t.memoizedState;if(s=y.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){a=wo(Error(i(423)),t),t=kd(e,t,s,r,a);break e}else if(s!==a){a=wo(Error(i(424)),t),t=kd(e,t,s,r,a);break e}else for(Dt=lr(t.stateNode.containerInfo.firstChild),zt=t,Be=!0,un=null,r=If(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ho(),s===a){t=$n(e,t,r);break e}yt(e,t,s,r)}t=t.child}return t;case 5:return Ff(t),e===null&&ka(t),s=t.type,a=t.pendingProps,f=e!==null?e.memoizedProps:null,y=a.children,pa(s,a)?y=null:f!==null&&pa(s,f)&&(t.flags|=32),xd(e,t),yt(e,t,y,r),t.child;case 6:return e===null&&ka(t),null;case 13:return bd(e,t,r);case 4:return Na(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=go(t,null,s,r):yt(e,t,s,r),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:cn(s,a),hd(e,t,s,a,r);case 7:return yt(e,t,t.pendingProps,r),t.child;case 8:return yt(e,t,t.pendingProps.children,r),t.child;case 12:return yt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,a=t.pendingProps,f=t.memoizedProps,y=a.value,De(hs,s._currentValue),s._currentValue=y,f!==null)if(an(f.value,y)){if(f.children===a.children&&!Ct.current){t=$n(e,t,r);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var _=f.dependencies;if(_!==null){y=f.child;for(var P=_.firstContext;P!==null;){if(P.context===s){if(f.tag===1){P=Un(-1,r&-r),P.tag=2;var H=f.updateQueue;if(H!==null){H=H.shared;var J=H.pending;J===null?P.next=P:(P.next=J.next,J.next=P),H.pending=P}}f.lanes|=r,P=f.alternate,P!==null&&(P.lanes|=r),Ra(f.return,r,t),_.lanes|=r;break}P=P.next}}else if(f.tag===10)y=f.type===t.type?null:f.child;else if(f.tag===18){if(y=f.return,y===null)throw Error(i(341));y.lanes|=r,_=y.alternate,_!==null&&(_.lanes|=r),Ra(y,r,t),y=f.sibling}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===t){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}yt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,yo(t,r),a=Qt(a),s=s(a),t.flags|=1,yt(e,t,s,r),t.child;case 14:return s=t.type,a=cn(s,t.pendingProps),a=cn(s.type,a),gd(e,t,s,a,r);case 15:return vd(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:cn(s,a),Rs(e,t),t.tag=1,_t(s)?(e=!0,us(t)):e=!1,yo(t,r),ad(t,s,a),Ba(t,s,a,r),Ya(null,t,s,!0,e,r);case 19:return Cd(e,t,r);case 22:return yd(e,t,r)}throw Error(i(156,t.tag))};function Qd(e,t){return Rc(e,t)}function yv(e,t,r,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,r,s){return new yv(e,t,r,s)}function pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xv(e){if(typeof e=="function")return pu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===L)return 11;if(e===z)return 14}return 2}function yr(e,t){var r=e.alternate;return r===null?(r=Zt(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 Ds(e,t,r,s,a,f){var y=2;if(s=e,typeof e=="function")pu(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case W:return Vr(r.children,a,f,t);case A:y=8,a|=8;break;case U:return e=Zt(12,r,t,a|2),e.elementType=U,e.lanes=f,e;case K:return e=Zt(13,r,t,a),e.elementType=K,e.lanes=f,e;case G:return e=Zt(19,r,t,a),e.elementType=G,e.lanes=f,e;case Q:return Fs(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:y=10;break e;case te:y=9;break e;case L:y=11;break e;case z:y=14;break e;case X:y=16,s=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Zt(y,r,t,a),t.elementType=e,t.type=s,t.lanes=f,t}function Vr(e,t,r,s){return e=Zt(7,e,s,t),e.lanes=r,e}function Fs(e,t,r,s){return e=Zt(22,e,s,t),e.elementType=Q,e.lanes=r,e.stateNode={isHidden:!1},e}function mu(e,t,r){return e=Zt(6,e,null,t),e.lanes=r,e}function hu(e,t,r){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wv(e,t,r,s,a){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=$l(0),this.expirationTimes=$l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$l(0),this.identifierPrefix=s,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function gu(e,t,r,s,a,f,y,_,P){return e=new wv(e,t,r,_,P),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Zt(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ta(f),e}function Sv(e,t,r){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),ku.exports=Lv(),ku.exports}var up;function Av(){if(up)return Ks;up=1;var n=um();return Ks.createRoot=n.createRoot,Ks.hydrateRoot=n.hydrateRoot,Ks}var zv=Av();const Dv=sm(zv);async function vi(n){const o=await fetch(n);if(!o.ok)throw new Error(`${n}: ${o.status} ${o.statusText}`);return o.json()}function Fv(){const[n,o]=E.useState(null),[i,l]=E.useState(null);return E.useEffect(()=>{let c=!1;return(async()=>{try{const[u,d,p,h]=await Promise.all([vi("/data/summary.json"),vi("/data/clusters.json"),vi("/data/prs.json"),vi("/data/contributors.json")]);let m=[];if(u.pr_scope_available)try{m=await vi("/data/pr_scope_clusters.json")}catch{}c||o({summary:u,clusters:d,prs:p,contributors:h,prScopeClusters:m})}catch(u){c||l(u.message)}})(),()=>{c=!0}},[]),{data:n,error:i}}function Hn(n,o,i){return n&&o.includes(n)?n:i}function Vv(){return typeof window>"u"?new URLSearchParams:new URLSearchParams(window.location.search)}function Uv(){const n=Vv();return{activeTab:Hn(n.get("tab"),["clusters","prs","contributors","pr_scope"],"prs"),focusMode:Hn(n.get("focus"),["first","all","known"],"all"),selectedClusterId:n.get("cluster"),prSortKey:Hn(n.get("pr_sort"),["updated_at","size","automation_risk"],"updated_at"),prSortDirection:Hn(n.get("pr_dir"),["asc","desc"],"desc"),prFilter:Hn(n.get("pr_filter"),["open","all","flagged","clustered","unclustered","merged"],"open"),clusterSortKey:Hn(n.get("cluster_sort"),["recent_pr_count","pr_count","last_activity_at","flagged_prs"],"recent_pr_count"),prScopeSortKey:Hn(n.get("scope_sort"),["recent_pr_count","pr_count","average_similarity","last_activity_at"],"average_similarity"),contributorSortKey:Hn(n.get("contrib_sort"),["recent_pr_count","snapshot_pr_count","cluster_count","status","follow_through_score","automation_risk_signal","public_pr_count_42d","public_repo_count_42d"],"recent_pr_count"),contributorSortDirection:Hn(n.get("contrib_dir"),["asc","desc"],"desc")}}function $v(){const n=E.useMemo(Uv,[]),[o,i]=E.useState(n.activeTab),[l,c]=E.useState(n.focusMode),[u,d]=E.useState(n.selectedClusterId),[p,h]=E.useState(n.prSortKey),[m,v]=E.useState(n.prSortDirection),[g,w]=E.useState(n.prFilter),[S,b]=E.useState(n.clusterSortKey),[C,k]=E.useState(n.prScopeSortKey),[N,V]=E.useState(n.contributorSortKey),[T,j]=E.useState(n.contributorSortDirection);return E.useEffect(()=>{const M=new URLSearchParams;M.set("tab",o),M.set("focus",l),M.set("pr_sort",p),M.set("pr_dir",m),M.set("pr_filter",g),M.set("cluster_sort",S),M.set("scope_sort",C),M.set("contrib_sort",N),M.set("contrib_dir",T),u&&M.set("cluster",u),window.history.replaceState(null,"",`${window.location.pathname}?${M}`)},[o,l,p,m,g,S,C,N,T,u]),{activeTab:o,setActiveTab:i,focusMode:l,setFocusMode:c,selectedClusterId:u,setSelectedClusterId:d,prSortKey:p,setPrSortKey:h,prSortDirection:m,setPrSortDirection:v,prFilter:g,setPrFilter:w,clusterSortKey:S,setClusterSortKey:b,prScopeSortKey:C,setPrScopeSortKey:k,contributorSortKey:N,setContributorSortKey:V,contributorSortDirection:T,setContributorSortDirection:j}}function To(n){switch((n??"").toLowerCase()){case"low":case"strong":return"low";case"mixed":case"medium":return"medium";case"high":case"weak":return"high";default:return"neutral"}}function Ju(n,o){var i;return To((i=o.get(n.author??""))==null?void 0:i.automation_risk_signal)}function Bv(n,o){var l;let i="neutral";for(const c of n.authors){const u=To((l=o.get(c))==null?void 0:l.automation_risk_signal);if(u==="high")return"high";u==="medium"?i="medium":u==="low"&&i==="neutral"&&(i="low")}return i}function Mo(n,o){return!!(o.known_contributor||o.repo_association==="MEMBER"||o.repo_association==="OWNER"||o.repo_association==="COLLABORATOR"||(n==null?void 0:n.author_association)==="MEMBER"||(n==null?void 0:n.author_association)==="OWNER"||(n==null?void 0:n.author_association)==="COLLABORATOR")}function Oo(n,o){return o.first_seen_in_snapshot||o.repo_association==="FIRST_TIME_CONTRIBUTOR"||o.repo_association==="FIRST_TIMER"?!0:(n==null?void 0:n.author_association)==="FIRST_TIME_CONTRIBUTOR"||(n==null?void 0:n.author_association)==="FIRST_TIMER"}function Hv(n){return Oo(void 0,n)?2:Mo(void 0,n)?0:1}function Wv(n){return Oo(void 0,n)?"first contribution":Mo(void 0,n)?"known":"unknown"}function Uu(n,o){if(!n)return-1;const i=o.indexOf(n.toLowerCase());return i>=0?i:-1}function cm(n){return Math.max(n.patch_similarity,n.code_similarity,n.size_similarity,n.file_overlap,n.area_overlap)}function Kv(n){return n?cm(n):null}function _i(n){return cm(n)}function Yv(n,o,i){const l=(n.pairwise_similarity??[]).find(c=>c.left_pr_number===o&&c.right_pr_number===i||c.left_pr_number===i&&c.right_pr_number===o);return l?_i(l):0}function Gv(n,o){return(n.pairwise_similarity??[]).flatMap(i=>i.left_pr_number===o?[{otherPrNumber:i.right_pr_number,similarity:_i(i)}]:i.right_pr_number===o?[{otherPrNumber:i.left_pr_number,similarity:_i(i)}]:[]).sort((i,l)=>l.similarity-i.similarity).slice(0,2)}function fm(n){return n>=.5?"mat-vhigh":n>=.25?"mat-high":n>=.1?"mat-med":n>0?"mat-low":"mat-none"}function Qv(n,o,i){return n.recent_pr_numbers.reduce((l,c)=>{const u=o.get(c);if(!u)return l;const d=Ju(u,i);return d==="medium"||d==="high"?l+1:l},0)}function Xv(n,o,i){return n.pairwise.find(l=>l.left_pr_number===o&&l.right_pr_number===i||l.left_pr_number===i&&l.right_pr_number===o)}function qv(n,o){return n.pairwise.flatMap(i=>i.left_pr_number===o?[{otherPrNumber:i.right_pr_number,similarity:i.similarity}]:i.right_pr_number===o?[{otherPrNumber:i.left_pr_number,similarity:i.similarity}]:[]).sort((i,l)=>l.similarity-i.similarity).slice(0,3)}function dm(n,o=.5){return n.pairwise.filter(i=>i.similarity>=o).length}function ec(n,o,i){return o?i==="all"?!0:i==="known"?Mo(n,o):Oo(n,o):i!=="known"}function Zv(n,o){return o==="all"?!0:o==="known"?Mo(void 0,n):Oo(void 0,n)}function Jv(n,o,i){switch(i){case"all":return!0;case"flagged":{const l=Ju(n,o);return l==="medium"||l==="high"}case"clustered":return!!n.cluster_id;case"unclustered":return!n.cluster_id;case"open":return n.state==="open"&&!n.merged;case"merged":return n.merged}}function pm(n,...o){if(!n)return!0;const i=n.toLowerCase();return o.some(l=>l==null?void 0:l.toLowerCase().includes(i))}function tc(n){return n?new Intl.DateTimeFormat(void 0,{dateStyle:"medium"}).format(new Date(n)):"—"}function ey(n){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(n))}function Kr(n){return(n.additions??0)+(n.deletions??0)}function ty(n,o=!1){const i=[`${n.recent_pr_count} recent PRs`],l=Oo(void 0,n),c=Mo(void 0,n);l?i.push("first contribution focus"):c&&i.push("known contributor");const u=ny(n.repo_association);return u&&!ry(u,{first:l,known:c})&&i.push(u),n.automation_risk_signal&&n.automation_risk_signal!=="low"&&i.push(`${n.automation_risk_signal} automation risk`),n.follow_through_score&&n.follow_through_score!=="strong"&&i.push(`${n.follow_through_score} follow-through`),n.heuristic_note&&i.push(n.heuristic_note),i.slice(0,o?4:6).join(" · ")}function ny(n){return n?n.toLowerCase().replace(/_/g," "):null}function ry(n,o){return!!(o.first&&(n==="first time contributor"||n==="first timer")||o.known&&(n==="member"||n==="owner"||n==="collaborator"))}function Sl(n){return n.state==="open"&&!n.merged}function $u(n,o){if(n&&!o)return n;if(!n&&o)return o;if(n||o)return{...n,...o}}const Si={};function nc(n,o,i,l,c){let u={...Bu(n,Si)};return o&&(u=sl(u,o)),i&&(u=sl(u,i)),l&&(u=sl(u,l)),u}function oy(n){if(n.length===0)return Si;if(n.length===1)return Bu(n[0],Si);let o={...Bu(n[0],Si)};for(let i=1;i=65&&c<=90&&(typeof o=="function"||typeof o>"u")}function mm(n){return typeof n=="function"}function Bu(n,o){return mm(n)?n(o):n??Si}function ly(n,o){return o?n?i=>{if(ay(i)){const c=i;Hu(c);const u=o(c);return c.baseUIHandlerPrevented||n==null||n(c),u}const l=o(i);return n==null||n(i),l}:o:n}function Hu(n){return n.preventBaseUIHandler=()=>{n.baseUIHandlerPrevented=!0},n}function hm(n,o){return o?n?o+" "+n:o:n}function ay(n){return n!=null&&typeof n=="object"&&"nativeEvent"in n}function uy(n,o){return function(l,...c){const u=new URL(n);return u.searchParams.set("code",l.toString()),c.forEach(d=>u.searchParams.append("args[]",d)),`${o} error #${l}; visit ${u} for the full message.`}}const Nn=uy("https://base-ui.com/production-error","Base UI"),cp={};function Ot(n,o){const i=E.useRef(cp);return i.current===cp&&(i.current=n(o)),i}function Ri(n,o,i,l){const c=Ot(gm).current;return fy(c,n,o,i,l)&&vm(c,[n,o,i,l]),c.callback}function cy(n){const o=Ot(gm).current;return dy(o,n)&&vm(o,n),o.callback}function gm(){return{callback:null,cleanup:null,refs:[]}}function fy(n,o,i,l,c){return n.refs[0]!==o||n.refs[1]!==i||n.refs[2]!==l||n.refs[3]!==c}function dy(n,o){return n.refs.length!==o.length||n.refs.some((i,l)=>i!==o[l])}function vm(n,o){if(n.refs=o,o.every(i=>i==null)){n.callback=null;return}n.callback=i=>{if(n.cleanup&&(n.cleanup(),n.cleanup=null),i!=null){const l=Array(o.length).fill(null);for(let c=0;c{for(let c=0;c=n}function fp(n){if(!E.isValidElement(n))return null;const o=n,i=o.props;return(ym(19)?i==null?void 0:i.ref:o.ref)??null}function my(n,o){const i={};for(const l in n){const c=n[l];if(o!=null&&o.hasOwnProperty(l)){const u=o[l](c);u!=null&&Object.assign(i,u);continue}c===!0?i[`data-${l.toLowerCase()}`]="":c&&(i[`data-${l.toLowerCase()}`]=c.toString())}return i}function hy(n,o){return typeof n=="function"?n(o):n}function gy(n,o){return typeof n=="function"?n(o):n}function Ut(){}const cl=Object.freeze([]),gt=Object.freeze({}),vy={style:{transition:"none"}},yy={fallbackAxisSide:"end"};function St(n,o,i={}){const l=o.render,c=xy(o,i);if(i.enabled===!1)return null;const u=i.state??gt;return Sy(n,l,c,u)}function xy(n,o={}){const{className:i,style:l,render:c}=n,{state:u=gt,ref:d,props:p,stateAttributesMapping:h,enabled:m=!0}=o,v=m?hy(i,u):void 0,g=m?gy(l,u):void 0,w=m?my(u,h):gt,S=m?$u(w,Array.isArray(p)?oy(p):p)??gt:gt;return typeof document<"u"&&(m?Array.isArray(d)?S.ref=cy([S.ref,fp(c),...d]):S.ref=Ri(S.ref,fp(c),d):Ri(null,null)),m?(v!==void 0&&(S.className=hm(S.className,v)),g!==void 0&&(S.style=$u(S.style,g)),S):gt}const wy=Symbol.for("react.lazy");function Sy(n,o,i,l){if(o){if(typeof o=="function")return o(i,l);const c=nc(i,o.props);c.ref=i.ref;let u=o;return(u==null?void 0:u.$$typeof)===wy&&(u=E.Children.toArray(o)[0]),E.cloneElement(u,c)}if(n&&typeof n=="string")return ky(n,i);throw new Error(Nn(8))}function ky(n,o){return n==="button"?E.createElement("button",{type:"button",...o,key:o.key}):n==="img"?E.createElement("img",{alt:"",...o,key:o.key}):E.createElement(n,o)}function by(n){return St(n.defaultTagName??"div",n,n)}function xm(n){var o,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(o=0;otypeof n=="boolean"?`${n}`:n===0?"0":n,pp=wm,rc=(n,o)=>i=>{var l;if((o==null?void 0:o.variants)==null)return pp(n,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:c,defaultVariants:u}=o,d=Object.keys(c).map(m=>{const v=i==null?void 0:i[m],g=u==null?void 0:u[m];if(v===null)return null;const w=dp(v)||dp(g);return c[m][w]}),p=i&&Object.entries(i).reduce((m,v)=>{let[g,w]=v;return w===void 0||(m[g]=w),m},{}),h=o==null||(l=o.compoundVariants)===null||l===void 0?void 0:l.reduce((m,v)=>{let{class:g,className:w,...S}=v;return Object.entries(S).every(b=>{let[C,k]=b;return Array.isArray(k)?k.includes({...u,...p}[C]):{...u,...p}[C]===k})?[...m,g,w]:m},[]);return pp(n,d,h,i==null?void 0:i.class,i==null?void 0:i.className)},Ey=(n,o)=>{const i=new Array(n.length+o.length);for(let l=0;l({classGroupId:n,validator:o}),Sm=(n=new Map,o=null,i)=>({nextPart:n,validators:o,classGroupId:i}),fl="-",mp=[],_y="arbitrary..",Ry=n=>{const o=Ty(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Py(d);const p=d.split(fl),h=p[0]===""&&p.length>1?1:0;return km(p,h,o)},getConflictingClassGroupIds:(d,p)=>{if(p){const h=l[d],m=i[d];return h?m?Ey(m,h):h:m||mp}return i[d]||mp}}},km=(n,o,i)=>{if(n.length-o===0)return i.classGroupId;const c=n[o],u=i.nextPart.get(c);if(u){const m=km(n,o+1,u);if(m)return m}const d=i.validators;if(d===null)return;const p=o===0?n.join(fl):n.slice(o).join(fl),h=d.length;for(let m=0;mn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=n.slice(1,-1),i=o.indexOf(":"),l=o.slice(0,i);return l?_y+l:void 0})(),Ty=n=>{const{theme:o,classGroups:i}=n;return Ny(i,o)},Ny=(n,o)=>{const i=Sm();for(const l in n){const c=n[l];oc(c,i,l,o)}return i},oc=(n,o,i,l)=>{const c=n.length;for(let u=0;u{if(typeof n=="string"){Oy(n,o,i);return}if(typeof n=="function"){jy(n,o,i,l);return}Iy(n,o,i,l)},Oy=(n,o,i)=>{const l=n===""?o:bm(o,n);l.classGroupId=i},jy=(n,o,i,l)=>{if(Ly(n)){oc(n(l),o,i,l);return}o.validators===null&&(o.validators=[]),o.validators.push(Cy(i,n))},Iy=(n,o,i,l)=>{const c=Object.entries(n),u=c.length;for(let d=0;d{let i=n;const l=o.split(fl),c=l.length;for(let u=0;u"isThemeGetter"in n&&n.isThemeGetter===!0,Ay=n=>{if(n<1)return{get:()=>{},set:()=>{}};let o=0,i=Object.create(null),l=Object.create(null);const c=(u,d)=>{i[u]=d,o++,o>n&&(o=0,l=i,i=Object.create(null))};return{get(u){let d=i[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return c(u,d),d},set(u,d){u in i?i[u]=d:c(u,d)}}},Wu="!",hp=":",zy=[],gp=(n,o,i,l,c)=>({modifiers:n,hasImportantModifier:o,baseClassName:i,maybePostfixModifierPosition:l,isExternal:c}),Dy=n=>{const{prefix:o,experimentalParseClassName:i}=n;let l=c=>{const u=[];let d=0,p=0,h=0,m;const v=c.length;for(let C=0;Ch?m-h:void 0;return gp(u,S,w,b)};if(o){const c=o+hp,u=l;l=d=>d.startsWith(c)?u(d.slice(c.length)):gp(zy,!1,d,void 0,!0)}if(i){const c=l;l=u=>i({className:u,parseClassName:c})}return l},Fy=n=>{const o=new Map;return n.orderSensitiveModifiers.forEach((i,l)=>{o.set(i,1e6+l)}),i=>{const l=[];let c=[];for(let u=0;u0&&(c.sort(),l.push(...c),c=[]),l.push(d)):c.push(d)}return c.length>0&&(c.sort(),l.push(...c)),l}},Vy=n=>({cache:Ay(n.cacheSize),parseClassName:Dy(n),sortModifiers:Fy(n),...Ry(n)}),Uy=/\s+/,$y=(n,o)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:c,sortModifiers:u}=o,d=[],p=n.trim().split(Uy);let h="";for(let m=p.length-1;m>=0;m-=1){const v=p[m],{isExternal:g,modifiers:w,hasImportantModifier:S,baseClassName:b,maybePostfixModifierPosition:C}=i(v);if(g){h=v+(h.length>0?" "+h:h);continue}let k=!!C,N=l(k?b.substring(0,C):b);if(!N){if(!k){h=v+(h.length>0?" "+h:h);continue}if(N=l(b),!N){h=v+(h.length>0?" "+h:h);continue}k=!1}const V=w.length===0?"":w.length===1?w[0]:u(w).join(":"),T=S?V+Wu:V,j=T+N;if(d.indexOf(j)>-1)continue;d.push(j);const M=c(N,k);for(let D=0;D0?" "+h:h)}return h},By=(...n)=>{let o=0,i,l,c="";for(;o{if(typeof n=="string")return n;let o,i="";for(let l=0;l{let i,l,c,u;const d=h=>{const m=o.reduce((v,g)=>g(v),n());return i=Vy(m),l=i.cache.get,c=i.cache.set,u=p,p(h)},p=h=>{const m=l(h);if(m)return m;const v=$y(h,i);return c(h,v),v};return u=d,(...h)=>u(By(...h))},Wy=[],ot=n=>{const o=i=>i[n]||Wy;return o.isThemeGetter=!0,o},Cm=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_m=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ky=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wr=n=>Ky.test(n),Ce=n=>!!n&&!Number.isNaN(Number(n)),Sr=n=>!!n&&Number.isInteger(Number(n)),Cu=n=>n.endsWith("%")&&Ce(n.slice(0,-1)),Wn=n=>Yy.test(n),Rm=()=>!0,Zy=n=>Gy.test(n)&&!Qy.test(n),ic=()=>!1,Jy=n=>Xy.test(n),ex=n=>qy.test(n),tx=n=>!me(n)&&!ge(n),nx=n=>kr(n,Nm,ic),me=n=>Cm.test(n),Ur=n=>kr(n,Mm,Zy),vp=n=>kr(n,cx,Ce),rx=n=>kr(n,jm,Rm),ox=n=>kr(n,Om,ic),yp=n=>kr(n,Pm,ic),ix=n=>kr(n,Tm,ex),Ys=n=>kr(n,Im,Jy),ge=n=>_m.test(n),yi=n=>qr(n,Mm),sx=n=>qr(n,Om),xp=n=>qr(n,Pm),lx=n=>qr(n,Nm),ax=n=>qr(n,Tm),Gs=n=>qr(n,Im,!0),ux=n=>qr(n,jm,!0),kr=(n,o,i)=>{const l=Cm.exec(n);return l?l[1]?o(l[1]):i(l[2]):!1},qr=(n,o,i=!1)=>{const l=_m.exec(n);return l?l[1]?o(l[1]):i:!1},Pm=n=>n==="position"||n==="percentage",Tm=n=>n==="image"||n==="url",Nm=n=>n==="length"||n==="size"||n==="bg-size",Mm=n=>n==="length",cx=n=>n==="number",Om=n=>n==="family-name",jm=n=>n==="number"||n==="weight",Im=n=>n==="shadow",fx=()=>{const n=ot("color"),o=ot("font"),i=ot("text"),l=ot("font-weight"),c=ot("tracking"),u=ot("leading"),d=ot("breakpoint"),p=ot("container"),h=ot("spacing"),m=ot("radius"),v=ot("shadow"),g=ot("inset-shadow"),w=ot("text-shadow"),S=ot("drop-shadow"),b=ot("blur"),C=ot("perspective"),k=ot("aspect"),N=ot("ease"),V=ot("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...j(),ge,me],D=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],A=()=>[ge,me,h],U=()=>[wr,"full","auto",...A()],ne=()=>[Sr,"none","subgrid",ge,me],te=()=>["auto",{span:["full",Sr,ge,me]},Sr,ge,me],L=()=>[Sr,"auto",ge,me],K=()=>["auto","min","max","fr",ge,me],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...A()],Q=()=>[wr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],I=()=>[wr,"screen","full","dvw","lvw","svw","min","max","fit",...A()],q=()=>[wr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],B=()=>[n,ge,me],R=()=>[...j(),xp,yp,{position:[ge,me]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",lx,nx,{size:[ge,me]}],ce=()=>[Cu,yi,Ur],le=()=>["","none","full",m,ge,me],oe=()=>["",Ce,yi,Ur],he=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ce,Cu,xp,yp],Te=()=>["","none",b,ge,me],Ke=()=>["none",Ce,ge,me],Bt=()=>["none",Ce,ge,me],bt=()=>[Ce,ge,me],it=()=>[wr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wn],breakpoint:[Wn],color:[Rm],container:[Wn],"drop-shadow":[Wn],ease:["in","out","in-out"],font:[tx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wn],shadow:[Wn],spacing:["px",Ce],text:[Wn],"text-shadow":[Wn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wr,me,ge,k]}],container:["container"],columns:[{columns:[Ce,me,ge,p]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Sr,"auto",ge,me]}],basis:[{basis:[wr,"full","auto",p,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,wr,"auto","initial","none",me]}],grow:[{grow:["",Ce,ge,me]}],shrink:[{shrink:["",Ce,ge,me]}],order:[{order:[Sr,"first","last","none",ge,me]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[p,"screen",...Q()]}],"min-w":[{"min-w":[p,"screen","none",...Q()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[d]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",i,yi,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,ux,rx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cu,me]}],"font-family":[{font:[sx,ox,o]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,ge,me]}],"line-clamp":[{"line-clamp":[Ce,"none",ge,vp]}],leading:[{leading:[u,...A()]}],"list-image":[{"list-image":["none",ge,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ge,Ur]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ce,"auto",ge,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sr,ge,me],radial:["",ge,me],conic:[Sr,ge,me]},ax,ix]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ge,me]}],"outline-w":[{outline:["",Ce,yi,Ur]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",v,Gs,Ys]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",g,Gs,Ys]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ce,Ur]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",w,Gs,Ys]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ce,ge,me]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ge,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,me]}],filter:[{filter:["","none",ge,me]}],blur:[{blur:Te()}],brightness:[{brightness:[Ce,ge,me]}],contrast:[{contrast:[Ce,ge,me]}],"drop-shadow":[{"drop-shadow":["","none",S,Gs,Ys]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ce,ge,me]}],"hue-rotate":[{"hue-rotate":[Ce,ge,me]}],invert:[{invert:["",Ce,ge,me]}],saturate:[{saturate:[Ce,ge,me]}],sepia:[{sepia:["",Ce,ge,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,me]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ge,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ge,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ge,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ge,me]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ge,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ge,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ge,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ge,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ge,me]}],ease:[{ease:["linear","initial",N,ge,me]}],delay:[{delay:[Ce,ge,me]}],animate:[{animate:["none",V,ge,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ge,me]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Ke()}],"rotate-x":[{"rotate-x":Ke()}],"rotate-y":[{"rotate-y":Ke()}],"rotate-z":[{"rotate-z":Ke()}],scale:[{scale:Bt()}],"scale-x":[{"scale-x":Bt()}],"scale-y":[{"scale-y":Bt()}],"scale-z":[{"scale-z":Bt()}],"scale-3d":["scale-3d"],skew:[{skew:bt()}],"skew-x":[{"skew-x":bt()}],"skew-y":[{"skew-y":bt()}],transform:[{transform:[ge,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ce,yi,Ur,vp]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dx=Hy(fx);function Pe(...n){return dx(wm(n))}const px=rc("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",cluster:"font-mono border-primary/20 bg-primary/8 text-primary cursor-pointer hover:bg-primary/16",reference:"text-[0.6rem] uppercase tracking-wide font-semibold border-primary/20 bg-primary/12 text-primary","risk-high":"border-risk-high/25 bg-risk-high/10 text-risk-high-foreground","risk-medium":"border-risk-medium/25 bg-risk-medium/8 text-risk-medium-foreground","risk-low":"border-risk-low/25 bg-risk-low/8 text-risk-low-foreground",warning:"border-warning/25 bg-warning/8 text-warning-foreground",count:"border-primary/20 text-primary"}},defaultVariants:{variant:"default"}});function Rn({className:n,variant:o="default",render:i,...l}){return by({defaultTagName:"span",props:nc({className:Pe(px({variant:o}),n)},l),render:i,state:{slot:"badge",variant:o}})}const _u=am[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],mx=_u&&_u!==E.useLayoutEffect?_u:n=>n();function Ee(n){const o=Ot(hx).current;return o.next=n,mx(o.effect),o.trampoline}function hx(){const n={next:void 0,callback:gx,trampoline:(...o)=>{var i;return(i=n.callback)==null?void 0:i.call(n,...o)},effect:()=>{n.callback=n.next}};return n}function gx(){}let wp=(function(n){return n.disabled="data-disabled",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});const vx={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},wi={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},yx={disabled:!1,...wi},xx={valid(n){return n===null?null:n?{[wp.valid]:""}:{[wp.invalid]:""}}},wx=E.createContext({invalid:void 0,name:void 0,validityData:{state:vx,errors:[],error:"",value:"",initialValue:null},setValidityData:Ut,disabled:void 0,touched:wi.touched,setTouched:Ut,dirty:wi.dirty,setDirty:Ut,filled:wi.filled,setFilled:Ut,focused:wi.focused,setFocused:Ut,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:yx,markedDirtyRef:{current:!1},validation:{getValidationProps:(n=gt)=>n,getInputValidationProps:(n=gt)=>n,inputRef:{current:null},commit:async()=>{}}});function Lm(n=!0){const o=E.useContext(wx);if(o.setValidityData===Ut&&!n)throw new Error(Nn(28));return o}const Sx=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ut,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function kx(){return E.useContext(Sx)}const bx={...am};let Sp=0;function Ex(n,o="mui"){const[i,l]=E.useState(n),c=n||i;return E.useEffect(()=>{i==null&&(Sp+=1,l(`${o}-${Sp}`))},[i,o]),c}const kp=bx.useId;function kl(n,o){if(kp!==void 0){const i=kp();return n??(o?`${o}-${i}`:i)}return Ex(n,o)}function bl(n){return kl(n,"base-ui")}const Cx=E.createContext({controlId:void 0,registerControlId:Ut,labelId:void 0,setLabelId:Ut,messageIds:[],setMessageIds:Ut,getDescriptionProps:n=>n});function Am(){return E.useContext(Cx)}const _x=[];function El(n){E.useEffect(n,_x)}const xi=0;class Yn{constructor(){rt(this,"currentId",xi);rt(this,"clear",()=>{this.currentId!==xi&&(clearTimeout(this.currentId),this.currentId=xi)});rt(this,"disposeEffect",()=>this.clear)}static create(){return new Yn}start(o,i){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xi,i()},o)}isStarted(){return this.currentId!==xi}}function Pi(){const n=Ot(Yn.create).current;return El(n.disposeEffect),n}function Rx(n,o){return{...n,state:{...n.state,valid:!o&&n.state.valid}}}function Cl(){return typeof window<"u"}function jo(n){return sc(n)?(n.nodeName||"").toLowerCase():"#document"}function vt(n){var o;return(n==null||(o=n.ownerDocument)==null?void 0:o.defaultView)||window}function Mn(n){var o;return(o=(sc(n)?n.ownerDocument:n.document)||window.document)==null?void 0:o.documentElement}function sc(n){return Cl()?n instanceof Node||n instanceof vt(n).Node:!1}function je(n){return Cl()?n instanceof Element||n instanceof vt(n).Element:!1}function kt(n){return Cl()?n instanceof HTMLElement||n instanceof vt(n).HTMLElement:!1}function dl(n){return!Cl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof vt(n).ShadowRoot}function Li(n){const{overflow:o,overflowX:i,overflowY:l,display:c}=$t(n);return/auto|scroll|overlay|hidden|clip/.test(o+l+i)&&c!=="inline"&&c!=="contents"}function Px(n){return/^(table|td|th)$/.test(jo(n))}function _l(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Tx=/transform|translate|scale|rotate|perspective|filter/,Nx=/paint|layout|strict|content/,$r=n=>!!n&&n!=="none";let Ru;function lc(n){const o=je(n)?$t(n):n;return $r(o.transform)||$r(o.translate)||$r(o.scale)||$r(o.rotate)||$r(o.perspective)||!Rl()&&($r(o.backdropFilter)||$r(o.filter))||Tx.test(o.willChange||"")||Nx.test(o.contain||"")}function Mx(n){let o=Gn(n);for(;kt(o)&&!Kn(o);){if(lc(o))return o;if(_l(o))return null;o=Gn(o)}return null}function Rl(){return Ru==null&&(Ru=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ru}function Kn(n){return/^(html|body|#document)$/.test(jo(n))}function $t(n){return vt(n).getComputedStyle(n)}function Pl(n){return je(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Gn(n){if(jo(n)==="html")return n;const o=n.assignedSlot||n.parentNode||dl(n)&&n.host||Mn(n);return dl(o)?o.host:o}function zm(n){const o=Gn(n);return Kn(o)?n.ownerDocument?n.ownerDocument.body:n.body:kt(o)&&Li(o)?o:zm(o)}function Ti(n,o,i){var l;o===void 0&&(o=[]),i===void 0&&(i=!0);const c=zm(n),u=c===((l=n.ownerDocument)==null?void 0:l.body),d=vt(c);if(u){const p=Ku(d);return o.concat(d,d.visualViewport||[],Li(c)?c:[],p&&i?Ti(p):[])}else return o.concat(c,Ti(c,[],i))}function Ku(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Qn(n){return(n==null?void 0:n.ownerDocument)||document}const Ai=typeof navigator<"u",Pu=zx(),Ox=Fx(),jx=Dx();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Pu.platform==="MacIntel"&&Pu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Pu.platform);const Ix=Ai&&/apple/i.test(navigator.vendor),Lx=Ai&&Ox.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Ax=jx.includes("jsdom/");function zx(){if(!Ai)return{platform:"",maxTouchPoints:-1};const n=navigator.userAgentData;return n!=null&&n.platform?{platform:n.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Dx(){if(!Ai)return"";const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(({brand:o,version:i})=>`${o}/${i}`).join(" "):navigator.userAgent}function Fx(){if(!Ai)return"";const n=navigator.userAgentData;return n!=null&&n.platform?n.platform:navigator.platform??""}const Vx="data-base-ui-focusable",Dm="active",Fm="selected",Vm="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Tu="ArrowLeft",Nu="ArrowRight",Ux="ArrowUp",$x="ArrowDown";function Yu(n){var i;let o=n.activeElement;for(;((i=o==null?void 0:o.shadowRoot)==null?void 0:i.activeElement)!=null;)o=o.shadowRoot.activeElement;return o}function wt(n,o){var l;if(!n||!o)return!1;const i=(l=o.getRootNode)==null?void 0:l.call(o);if(n.contains(o))return!0;if(i&&dl(i)){let c=o;for(;c;){if(n===c)return!0;c=c.parentNode||c.host}}return!1}function pl(n,o){if(!je(n))return!1;const i=n;if(o.hasElement(i))return!i.hasAttribute("data-trigger-disabled");for(const[,l]of o.entries())if(wt(l,i))return!l.hasAttribute("data-trigger-disabled");return!1}function Cn(n){return"composedPath"in n?n.composedPath()[0]:n.target}function mn(n,o){if(o==null)return!1;if("composedPath"in n)return n.composedPath().includes(o);const i=n;return i.target!=null&&o.contains(i.target)}function Bx(n){return n.matches("html,body")}function Hx(n){return kt(n)&&n.matches(Vm)}function Wx(n){if(!n||Ax)return!0;try{return n.matches(":focus-visible")}catch{return!0}}function Wr(n,o,i=!0){return n.filter(c=>{var u;return c.parentId===o&&(!i||((u=c.context)==null?void 0:u.open))}).flatMap(c=>[c,...Wr(n,c.id,i)])}function Mu(n){n.preventDefault(),n.stopPropagation()}function Kx(n){return"nativeEvent"in n}function ml(n,o){const i=["mouse","pen"];return i.push("",void 0),i.includes(n)}function Yx(n){const o=n.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}const Gx=["top","right","bottom","left"],No=Math.min,Vt=Math.max,hl=Math.round,Br=Math.floor,Pn=n=>({x:n,y:n}),Qx={left:"right",right:"left",bottom:"top",top:"bottom"};function Gu(n,o,i){return Vt(n,No(o,i))}function Xn(n,o){return typeof n=="function"?n(o):n}function Mt(n){return n.split("-")[0]}function br(n){return n.split("-")[1]}function ac(n){return n==="x"?"y":"x"}function uc(n){return n==="y"?"height":"width"}function en(n){const o=n[0];return o==="t"||o==="b"?"y":"x"}function cc(n){return ac(en(n))}function Xx(n,o,i){i===void 0&&(i=!1);const l=br(n),c=cc(n),u=uc(c);let d=c==="x"?l===(i?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[u]>o.floating[u]&&(d=gl(d)),[d,gl(d)]}function qx(n){const o=gl(n);return[Qu(n),o,Qu(o)]}function Qu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const bp=["left","right"],Ep=["right","left"],Zx=["top","bottom"],Jx=["bottom","top"];function e0(n,o,i){switch(n){case"top":case"bottom":return i?o?Ep:bp:o?bp:Ep;case"left":case"right":return o?Zx:Jx;default:return[]}}function t0(n,o,i,l){const c=br(n);let u=e0(Mt(n),i==="start",l);return c&&(u=u.map(d=>d+"-"+c),o&&(u=u.concat(u.map(Qu)))),u}function gl(n){const o=Mt(n);return Qx[o]+n.slice(o.length)}function n0(n){return{top:0,right:0,bottom:0,left:0,...n}}function Um(n){return typeof n!="number"?n0(n):{top:n,right:n,bottom:n,left:n}}function vl(n){const{x:o,y:i,width:l,height:c}=n;return{width:l,height:c,top:i,left:o,right:o+l,bottom:i+c,x:o,y:i}}function Qs(n,o,i){return Math.floor(n/o)!==i}function Xu(n,o){return o<0||o>=n.current.length}function r0(n,o){return Jt(n,{disabledIndices:o})}function o0(n,o){return Jt(n,{decrement:!0,startingIndex:n.current.length,disabledIndices:o})}function Jt(n,{startingIndex:o=-1,decrement:i=!1,disabledIndices:l,amount:c=1}={}){let u=o;do u+=i?-c:c;while(u>=0&&u<=n.current.length-1&&Ro(n,u,l));return u}function i0(n,{event:o,orientation:i,loopFocus:l,rtl:c,cols:u,disabledIndices:d,minIndex:p,maxIndex:h,prevIndex:m,stopEvent:v=!1}){let g=m,w;if(o.key===Ux?w="up":o.key===$x&&(w="down"),w){const S=[],b=[];let C=!1,k=0;{let A=null,U=-1;n.current.forEach((ne,te)=>{if(ne==null)return;k+=1;const L=ne.closest('[role="row"]');L&&(C=!0),(L!==A||U===-1)&&(A=L,U+=1,S[U]=[]),S[U].push(te),b[te]=U})}let N=!1,V=0;if(C)for(const A of S){const U=A.length;U>V&&(V=U),U!==u&&(N=!0)}const T=N&&k{if(!N||m===-1)return;const U=b[m];if(U==null)return;const ne=S[U].indexOf(m),te=A==="up"?-1:1;for(let L=U+te,K=0;K=S.length){if(!l||T)return;L=L<0?S.length-1:0}const G=S[L];for(let z=Math.min(ne,G.length-1);z>=0;z-=1){const X=G[z];if(!Ro(n,X,d))return X}}},D=A=>{if(!T||m===-1)return;const U=m%j,ne=A==="up"?-j:j,te=h-h%j,L=Br(h/j)+1;for(let K=m-U+ne,G=0;Gh){if(!l)return;K=K<0?te:0}const z=Math.min(K+j-1,h);for(let X=Math.min(K+U,z);X>=K;X-=1)if(!Ro(n,X,d))return X}};v&&Mu(o);const W=M(w)??D(w);if(W!==void 0)g=W;else if(m===-1)g=w==="up"?h:p;else if(g=Jt(n,{startingIndex:m,amount:j,decrement:w==="up",disabledIndices:d}),l){if(w==="up"&&(m-jA?ne:ne-j}w==="down"&&m+j>h&&(g=Jt(n,{startingIndex:m%j-j,amount:j,disabledIndices:d}))}Xu(n,g)&&(g=m)}if(i==="both"){const S=Br(m/u);o.key===(c?Tu:Nu)&&(v&&Mu(o),m%u!==u-1?(g=Jt(n,{startingIndex:m,disabledIndices:d}),l&&Qs(g,u,S)&&(g=Jt(n,{startingIndex:m-m%u-1,disabledIndices:d}))):l&&(g=Jt(n,{startingIndex:m-m%u-1,disabledIndices:d})),Qs(g,u,S)&&(g=m)),o.key===(c?Nu:Tu)&&(v&&Mu(o),m%u!==0?(g=Jt(n,{startingIndex:m,decrement:!0,disabledIndices:d}),l&&Qs(g,u,S)&&(g=Jt(n,{startingIndex:m+(u-m%u),decrement:!0,disabledIndices:d}))):l&&(g=Jt(n,{startingIndex:m+(u-m%u),decrement:!0,disabledIndices:d})),Qs(g,u,S)&&(g=m));const b=Br(h/u)===S;Xu(n,g)&&(l&&b?g=o.key===(c?Nu:Tu)?h:Jt(n,{startingIndex:m-m%u-1,disabledIndices:d}):g=m)}return g}function s0(n,o,i){const l=[];let c=0;return n.forEach(({width:u,height:d},p)=>{let h=!1;for(i&&(c=0);!h;){const m=[];for(let v=0;vl[v]==null)?(m.forEach(v=>{l[v]=p}),h=!0):c+=1}}),[...l]}function l0(n,o,i,l,c){if(n===-1)return-1;const u=i.indexOf(n),d=o[n];switch(c){case"tl":return u;case"tr":return d?u+d.width-1:u;case"bl":return d?u+(d.height-1)*l:u;case"br":return i.lastIndexOf(n);default:return-1}}function a0(n,o){return o.flatMap((i,l)=>n.includes(i)?[l]:[])}function Ro(n,o,i){if(typeof i=="function"?i(o):(i==null?void 0:i.includes(o))??!1)return!0;const c=n.current[o];return c?u0(c)?!i&&(c.hasAttribute("disabled")||c.getAttribute("aria-disabled")==="true"):!0:!1}function u0(n){return $t(n).display!=="none"}const c0=()=>{},ke=typeof document<"u"?E.useLayoutEffect:c0;var Zr=um();const Xs=null;class f0{constructor(){rt(this,"callbacks",[]);rt(this,"callbacksCount",0);rt(this,"nextId",1);rt(this,"startId",1);rt(this,"isScheduled",!1);rt(this,"tick",o=>{var c;this.isScheduled=!1;const i=this.callbacks,l=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,l>0)for(let u=0;u=this.callbacks.length||(this.callbacks[i]=null,this.callbacksCount-=1)}}const qs=new f0;class Ze{constructor(){rt(this,"currentId",Xs);rt(this,"cancel",()=>{this.currentId!==Xs&&(qs.cancel(this.currentId),this.currentId=Xs)});rt(this,"disposeEffect",()=>this.cancel)}static create(){return new Ze}static request(o){return qs.request(o)}static cancel(o){return qs.cancel(o)}request(o){this.cancel(),this.currentId=qs.request(()=>{this.currentId=Xs,o()})}}function $m(){const n=Ot(Ze.create).current;return El(n.disposeEffect),n}function d0(n){return n==null?n:"current"in n?n.current:n}let Yr=(function(n){return n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n})({});const p0={[Yr.startingStyle]:""},m0={[Yr.endingStyle]:""},fc={transitionStatus(n){return n==="starting"?p0:n==="ending"?m0:null}};function Bm(n,o=!1,i=!0){const l=$m();return Ee((c,u=null)=>{l.cancel();function d(){Zr.flushSync(c)}const p=d0(n);if(p==null)return;const h=p;if(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)c();else{let g=function(){const S=Yr.startingStyle;if(!h.hasAttribute(S)){l.request(w);return}const b=new MutationObserver(()=>{h.hasAttribute(S)||(b.disconnect(),w())});b.observe(h,{attributes:!0,attributeFilter:[S]}),u==null||u.addEventListener("abort",()=>b.disconnect(),{once:!0})},w=function(){Promise.all(h.getAnimations().map(S=>S.finished)).then(()=>{u!=null&&u.aborted||d()}).catch(()=>{const S=h.getAnimations();if(i){if(u!=null&&u.aborted)return;d()}else S.length>0&&S.some(b=>b.pending||b.playState!=="finished")&&w()})};var m=g,v=w;if(o){g();return}l.request(w)}})}function dc(n){const{enabled:o=!0,open:i,ref:l,onComplete:c}=n,u=Ee(c),d=Bm(l,i,!1);E.useEffect(()=>{if(!o)return;const p=new AbortController;return d(u,p.signal),()=>{p.abort()}},[o,i,u,d])}function Hm(n,o=!1,i=!1){const[l,c]=E.useState(n&&o?"idle":void 0),[u,d]=E.useState(n);return n&&!u&&(d(!0),c("starting")),!n&&u&&l!=="ending"&&!i&&c("ending"),!n&&!u&&l==="ending"&&c(void 0),ke(()=>{if(!n&&u&&l!=="ending"&&i){const p=Ze.request(()=>{c("ending")});return()=>{Ze.cancel(p)}}},[n,u,l,i]),ke(()=>{if(!n||o)return;const p=Ze.request(()=>{c(void 0)});return()=>{Ze.cancel(p)}},[o,n]),ke(()=>{if(!n||!o)return;n&&u&&l!=="idle"&&c("starting");const p=Ze.request(()=>{c("idle")});return()=>{Ze.cancel(p)}},[o,n,u,c,l]),E.useMemo(()=>({mounted:u,setMounted:d,transitionStatus:l}),[u,l])}function Tl({controlled:n,default:o,name:i,state:l="value"}){const{current:c}=E.useRef(n!==void 0),[u,d]=E.useState(o),p=c?n:u,h=E.useCallback(m=>{c||d(m)},[]);return[p,h]}function h0(n={}){const{id:o,implicit:i=!1,controlRef:l}=n,{controlId:c,registerControlId:u}=Am(),d=bl(o),p=i?c:void 0,h=Ot(()=>Symbol("labelable-control")),m=E.useRef(!1),v=E.useRef(o!=null),g=Ee(()=>{!m.current||u===Ut||(m.current=!1,u(h.current,void 0))});return ke(()=>{if(u===Ut)return;let w;if(i){const S=l==null?void 0:l.current;je(S)&&S.closest("label")!=null?w=o??null:w=p??d}else if(o!=null)v.current=!0,w=o;else if(v.current)w=d;else{g();return}if(w===void 0){g();return}m.current=!0,u(h.current,w)},[o,l,p,u,i,d,h,g]),E.useEffect(()=>g,[g]),c??d}function g0(n){const{enabled:o=!0,value:i,id:l,name:c,controlRef:u,commit:d}=n,{formRef:p}=kx(),{invalid:h,markedDirtyRef:m,validityData:v,setValidityData:g}=Lm(),w=Ee(n.getValue);ke(()=>{if(!o)return;let S=i;S===void 0&&(S=w()),v.initialValue===null&&S!==null&&g(b=>({...b,initialValue:S}))},[o,g,i,v.initialValue,w]),ke(()=>{!o||!l||p.current.fields.set(l,{getValue:w,name:c,controlRef:u,validityData:Rx(v,h),validate(S=!0){let b=i;b===void 0&&(b=w()),m.current=!0,S?Zr.flushSync(()=>d(b)):d(b)}})},[d,u,o,p,w,l,h,m,c,v,i]),ke(()=>{const S=p.current.fields;return()=>{l&&S.delete(l)}},[p,l])}const zi="none",Ni="trigger-press",_n="trigger-hover",ll="trigger-focus",v0="outside-press",pc="escape-key",y0="disabled",x0="imperative-action";function Qe(n,o,i,l){let c=!1,u=!1;const d=gt;return{reason:n,event:o??new Event("base-ui"),cancel(){c=!0},allowPropagation(){u=!0},get isCanceled(){return c},get isPropagationAllowed(){return u},trigger:i,...d}}const w0=E.forwardRef(function(o,i){const{render:l,className:c,id:u,name:d,value:p,disabled:h=!1,onValueChange:m,defaultValue:v,autoFocus:g=!1,...w}=o,{state:S,name:b,disabled:C,setTouched:k,setDirty:N,validityData:V,setFocused:T,setFilled:j,validationMode:M,validation:D}=Lm(),W=C||h,A=b??d,U={...S,disabled:W},{labelId:ne}=Am(),te=h0({id:u});ke(()=>{var I;const Q=p!=null;(I=D.inputRef.current)!=null&&I.value||Q&&p!==""?j(!0):Q&&p===""&&j(!1)},[D.inputRef,j,p]);const L=E.useRef(null);ke(()=>{g&&L.current===Yu(Qn(L.current))&&T(!0)},[g,T]);const[K]=Tl({controlled:p,default:v,name:"FieldControl",state:"value"}),G=p!==void 0,z=G?K:void 0;return g0({id:te,name:A,commit:D.commit,value:z,getValue:()=>{var Q;return(Q=D.inputRef.current)==null?void 0:Q.value},controlRef:D.inputRef}),St("input",o,{ref:[i,L],state:U,props:[{id:te,disabled:W,name:A,ref:D.inputRef,"aria-labelledby":ne,autoFocus:g,...G?{value:z}:{defaultValue:v},onChange(Q){const I=Q.currentTarget.value;m==null||m(I,Qe(zi,Q.nativeEvent)),N(I!==V.initialValue),j(I!=="")},onFocus(){T(!0)},onBlur(Q){k(!0),T(!1),M==="onBlur"&&D.commit(Q.currentTarget.value)},onKeyDown(Q){Q.currentTarget.tagName==="INPUT"&&Q.key==="Enter"&&(k(!0),D.commit(Q.currentTarget.value))}},D.getInputValidationProps(),w],stateAttributesMapping:xx})}),S0=E.forwardRef(function(o,i){return x.jsx(w0,{ref:i,...o})});function k0({className:n,type:o,...i}){return x.jsx(S0,{type:o,"data-slot":"input",className:Pe("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),...i})}function Co({className:n,...o}){return x.jsx("div",{"data-slot":"skeleton",className:Pe("animate-pulse rounded-md bg-muted",n),...o})}function b0({className:n,size:o="default",...i}){return x.jsx("div",{"data-slot":"card","data-size":o,className:Pe("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",n),...i})}function E0({className:n,...o}){return x.jsx("div",{"data-slot":"card-header",className:Pe("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",n),...o})}function C0({className:n,...o}){return x.jsx("div",{"data-slot":"card-title",className:Pe("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",n),...o})}function _0({className:n,...o}){return x.jsx("div",{"data-slot":"card-description",className:Pe("text-sm text-muted-foreground",n),...o})}function R0({className:n,...o}){return x.jsx("div",{"data-slot":"card-content",className:Pe("px-4 group-data-[size=sm]/card:px-3",n),...o})}const P0=rc("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function T0({className:n,variant:o,...i}){return x.jsx("div",{"data-slot":"alert",role:"alert",className:Pe(P0({variant:o}),n),...i})}function N0({className:n,...o}){return x.jsx("div",{"data-slot":"alert-title",className:Pe("font-heading font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",n),...o})}function M0({className:n,...o}){return x.jsx("div",{"data-slot":"alert-description",className:Pe("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),...o})}/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wm=(...n)=>n.filter((o,i,l)=>!!o&&o.trim()!==""&&l.indexOf(o)===i).join(" ").trim();/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O0=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j0=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,i,l)=>l?l.toUpperCase():i.toLowerCase());/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cp=n=>{const o=j0(n);return o.charAt(0).toUpperCase()+o.slice(1)};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Ou={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I0=n=>{for(const o in n)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},L0=E.createContext({}),A0=()=>E.useContext(L0),z0=E.forwardRef(({color:n,size:o,strokeWidth:i,absoluteStrokeWidth:l,className:c="",children:u,iconNode:d,...p},h)=>{const{size:m=24,strokeWidth:v=2,absoluteStrokeWidth:g=!1,color:w="currentColor",className:S=""}=A0()??{},b=l??g?Number(i??v)*24/Number(o??m):i??v;return E.createElement("svg",{ref:h,...Ou,width:o??m??Ou.width,height:o??m??Ou.height,stroke:n??w,strokeWidth:b,className:Wm("lucide",S,c),...!u&&!I0(p)&&{"aria-hidden":"true"},...p},[...d.map(([C,k])=>E.createElement(C,k)),...Array.isArray(u)?u:[u]])});/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Er=(n,o)=>{const i=E.forwardRef(({className:l,...c},u)=>E.createElement(z0,{ref:u,iconNode:o,className:Wm(`lucide-${O0(Cp(n))}`,`lucide-${n}`,l),...c}));return i.displayName=Cp(n),i};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nl=Er("chevron-down",D0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ml=Er("chevron-right",F0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V0=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],U0=Er("external-link",V0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $0=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],B0=Er("file-code-corner",$0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H0=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],W0=Er("flag",H0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K0=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Y0=Er("folder-tree",K0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Km=Er("info",G0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],X0=Er("triangle-alert",Q0);function Ol({title:n,description:o,children:i}){return x.jsxs(b0,{className:"animate-in fade-in slide-in-from-bottom-1 duration-200",children:[x.jsxs(E0,{children:[x.jsx(C0,{children:n}),o?x.jsx(_0,{className:"max-w-prose",children:o}):null]}),x.jsx(R0,{children:i})]})}function q0({items:n}){return x.jsx("section",{className:"grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-px rounded-xl overflow-hidden bg-border mb-4","aria-label":"Key numbers",children:n.map(o=>x.jsxs("article",{className:"bg-card px-4 py-3.5 flex flex-col gap-1",children:[x.jsx("span",{className:"text-[0.68rem] font-medium uppercase tracking-wider text-muted-foreground",children:o.label}),x.jsx("strong",{className:"text-[1.85rem] leading-none font-bold tabular-nums tracking-tight",children:o.value})]},o.label))})}function Tn({href:n,children:o}){return x.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm text-primary hover:underline whitespace-nowrap",children:[o,x.jsx(U0,{className:"size-3"})]})}function hn({label:n,active:o,direction:i,onClick:l}){return x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:x.jsxs("button",{type:"button",className:Pe("inline-flex items-center gap-1 cursor-pointer",o&&"text-foreground"),onClick:l,children:[n,x.jsx("span",{className:"text-muted-foreground text-[0.75em]",children:o?i==="desc"?"↓":"↑":"↕"})]})})}const Z0={high:"risk-high",medium:"risk-medium",low:"risk-low",neutral:"outline"};function Zs({label:n,value:o,tone:i}){return x.jsxs(Rn,{variant:Z0[i],children:[x.jsx("span",{className:"text-muted-foreground",children:n}),x.jsx("strong",{className:"font-medium",children:o})]})}function Ym({level:n}){return n==="low"||n==="neutral"?null:x.jsxs("span",{className:Pe("inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wide",n==="high"?"text-destructive":"text-warning"),children:[x.jsx(W0,{className:"size-3"}),n," risk"]})}function J0({contributor:n,inline:o}){return n?x.jsxs("div",{className:Pe("flex flex-wrap gap-1.5",o&&"mt-1.5"),children:[Mo(void 0,n)?x.jsx(Zs,{label:"Contributor",value:"known",tone:"low"}):null,Oo(void 0,n)?x.jsx(Zs,{label:"Contributor",value:"first contribution",tone:"high"}):null,x.jsx(Zs,{label:"Automation",value:n.automation_risk_signal??"unknown",tone:To(n.automation_risk_signal)}),x.jsx(Zs,{label:"Follow-through",value:n.follow_through_score??"unknown",tone:To(n.follow_through_score)})]}):x.jsx("div",{className:Pe("flex flex-wrap gap-1.5",o&&"mt-1.5"),children:"No contributor profile"})}function jl({contributor:n,compact:o}){return n?x.jsx("div",{className:Pe("text-muted-foreground",o&&"text-xs mt-0.5"),children:ty(n,o)}):null}function ew({clusterId:n,onOpenCluster:o}){return x.jsx(Rn,{variant:"cluster",render:x.jsx("button",{type:"button",onClick:()=>o(n)}),children:n})}function Gm({value:n,onChange:o,placeholder:i}){return x.jsx(k0,{type:"search",value:n,onChange:l=>o(l.target.value),placeholder:i??"Search…",className:"w-56 max-w-full"})}function tw(){return x.jsxs("div",{className:"flex flex-col gap-4 pt-4","aria-busy":"true","aria-label":"Loading",children:[x.jsx(Co,{className:"h-8 w-64"}),x.jsx(Co,{className:"h-4 w-96"}),x.jsx("div",{className:"grid grid-cols-6 gap-px rounded-xl overflow-hidden",children:Array.from({length:6},(n,o)=>x.jsx(Co,{className:"h-[72px] rounded-none"},o))}),x.jsx(Co,{className:"h-14 w-full"}),x.jsx(Co,{className:"h-14 w-full"}),x.jsx(Co,{className:"h-14 w-full"})]})}function nw({message:n}){return x.jsxs(T0,{variant:"destructive",children:[x.jsx(X0,{}),x.jsx(N0,{children:"Could not load dashboard data"}),x.jsxs(M0,{children:[x.jsx("pre",{className:"mt-2 overflow-auto text-xs font-mono",children:n}),x.jsxs("p",{className:"mt-2",children:["Generate data with ",x.jsx("code",{className:"text-destructive",children:"uv run slop-farmer dashboard-data"})," into ",x.jsx("code",{className:"text-destructive",children:"web/public/data"}),"."]})]})]})}function rw(n,o,i,l,c){const u=c==="desc"?-1:1,d=_p(n,i,l),p=_p(o,i,l);return dp?1*u:o.number-n.number}function _p(n,o,i){var l;switch(i){case"updated_at":return n.updated_at??n.created_at??"";case"size":return Kr(n);case"automation_risk":return Uu(((l=o.get(n.author??""))==null?void 0:l.automation_risk_signal)??null,["low","medium","high"])}}function ow(n){return"desc"}function iw(n,o,i,l){const c=l==="desc"?-1:1,u=Rp(n,i),d=Rp(o,i);return ud?1*c:n.author.localeCompare(o.author)}function Rp(n,o){switch(o){case"recent_pr_count":return n.recent_pr_count;case"snapshot_pr_count":return n.snapshot_pr_count;case"cluster_count":return n.cluster_count;case"status":return Hv(n);case"follow_through_score":return Uu(n.follow_through_score,["weak","mixed","strong"]);case"automation_risk_signal":return Uu(n.automation_risk_signal,["low","medium","high"]);case"public_pr_count_42d":return n.public_pr_count_42d??-1;case"public_repo_count_42d":return n.public_repo_count_42d??-1}}function sw(n){return"desc"}function lw(n,o,i,l,c){const u=Pp(n,i,l,c),d=Pp(o,i,l,c);return ud?-1:(o.last_activity_at??"").localeCompare(n.last_activity_at??"")}function Pp(n,o,i,l){switch(o){case"recent_pr_count":return n.recent_pr_count;case"pr_count":return n.pr_count;case"last_activity_at":return n.last_activity_at??"";case"flagged_prs":return Qv(n,i,l)}}function aw(n,o,i){const l=Tp(n,i),c=Tp(o,i);return lc?-1:(o.last_activity_at??"").localeCompare(n.last_activity_at??"")}function Tp(n,o){switch(o){case"recent_pr_count":return n.recent_pr_count;case"pr_count":return n.pr_count;case"average_similarity":return n.average_similarity;case"last_activity_at":return n.last_activity_at??""}}function uw(n){const{open:o,defaultOpen:i,onOpenChange:l,disabled:c}=n,u=o!==void 0,[d,p]=Tl({controlled:o,default:i,name:"Collapsible",state:"open"}),{mounted:h,setMounted:m,transitionStatus:v}=Hm(d,!0,!0),[g,w]=E.useState(d),[{height:S,width:b},C]=E.useState({height:void 0,width:void 0}),k=bl(),[N,V]=E.useState(),T=N??k,[j,M]=E.useState(!1),[D,W]=E.useState(!1),A=E.useRef(null),U=E.useRef(null),ne=E.useRef(null),te=E.useRef(null),L=Bm(te,!1),K=Ee(G=>{const z=!d,X=Qe(Ni,G.nativeEvent);if(l(z,X),X.isCanceled)return;const Q=te.current;U.current==="css-animation"&&Q!=null&&Q.style.removeProperty("animation-name"),!j&&!D&&(U.current!=null&&U.current!=="css-animation"&&!h&&z&&m(!0),U.current==="css-animation"&&(!g&&z&&w(!0),!h&&z&&m(!0))),p(z),U.current==="none"&&h&&!z&&m(!1)});return ke(()=>{u&&U.current==="none"&&!D&&!d&&m(!1)},[u,D,d,o,m]),E.useMemo(()=>({abortControllerRef:A,animationTypeRef:U,disabled:c,handleTrigger:K,height:S,mounted:h,open:d,panelId:T,panelRef:te,runOnceAnimationsFinish:L,setDimensions:C,setHiddenUntilFound:M,setKeepMounted:W,setMounted:m,setOpen:p,setPanelIdState:V,setVisible:w,transitionDimensionRef:ne,transitionStatus:v,visible:g,width:b}),[A,U,c,K,S,h,d,T,te,L,C,M,W,m,p,w,ne,v,g,b])}const Qm=E.createContext(void 0);function Xm(){const n=E.useContext(Qm);if(n===void 0)throw new Error(Nn(15));return n}let ki=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=Yr.startingStyle]="startingStyle",n[n.endingStyle=Yr.endingStyle]="endingStyle",n})({}),cw=(function(n){return n.panelOpen="data-panel-open",n})({});const fw={[ki.open]:""},dw={[ki.closed]:""},pw={open(n){return n?{[cw.panelOpen]:""}:null}},mw={open(n){return n?fw:dw}},qm={...mw,...fc},hw=E.forwardRef(function(o,i){const{render:l,className:c,defaultOpen:u=!1,disabled:d=!1,onOpenChange:p,open:h,...m}=o,v=Ee(p),g=uw({open:h,defaultOpen:u,onOpenChange:v,disabled:d}),w=E.useMemo(()=>({open:g.open,disabled:g.disabled,transitionStatus:g.transitionStatus}),[g.open,g.disabled,g.transitionStatus]),S=E.useMemo(()=>({...g,onOpenChange:v,state:w}),[g,v,w]),b=St("div",o,{state:w,ref:i,props:m,stateAttributesMapping:qm});return x.jsx(Qm.Provider,{value:S,children:b})}),Zm=E.createContext(void 0);function Jm(n=!1){const o=E.useContext(Zm);if(o===void 0&&!n)throw new Error(Nn(16));return o}function gw(n){const{focusableWhenDisabled:o,disabled:i,composite:l=!1,tabIndex:c=0,isNativeButton:u}=n,d=l&&o!==!1,p=l&&o===!1;return{props:E.useMemo(()=>{const m={onKeyDown(v){i&&o&&v.key!=="Tab"&&v.preventDefault()}};return l||(m.tabIndex=c,!u&&i&&(m.tabIndex=o?c:-1)),(u&&(o||d)||!u&&i)&&(m["aria-disabled"]=i),u&&(!o||p)&&(m.disabled=i),m},[l,i,o,d,p,u,c])}}function eh(n={}){const{disabled:o=!1,focusableWhenDisabled:i,tabIndex:l=0,native:c=!0,composite:u}=n,d=E.useRef(null),p=Jm(!0),h=u??p!==void 0,{props:m}=gw({focusableWhenDisabled:i,disabled:o,composite:h,tabIndex:l,isNativeButton:c}),v=E.useCallback(()=>{const S=d.current;ju(S)&&h&&o&&m.disabled===void 0&&S.disabled&&(S.disabled=!1)},[o,m.disabled,h]);ke(v,[v]);const g=E.useCallback((S={})=>{const{onClick:b,onMouseDown:C,onKeyUp:k,onKeyDown:N,onPointerDown:V,...T}=S;return nc({type:c?"button":void 0,onClick(M){if(o){M.preventDefault();return}b==null||b(M)},onMouseDown(M){o||C==null||C(M)},onKeyDown(M){if(o||(Hu(M),N==null||N(M),M.baseUIHandlerPrevented))return;const D=M.target===M.currentTarget,W=M.currentTarget,A=ju(W),U=!c&&vw(W),ne=D&&(c?A:!U),te=M.key==="Enter",L=M.key===" ",K=W.getAttribute("role"),G=(K==null?void 0:K.startsWith("menuitem"))||K==="option"||K==="gridcell";if(D&&h&&L){if(M.defaultPrevented&&G)return;M.preventDefault(),U||c&&A?(W.click(),M.preventBaseUIHandler()):ne&&(b==null||b(M),M.preventBaseUIHandler());return}ne&&(!c&&(L||te)&&M.preventDefault(),!c&&te&&(b==null||b(M)))},onKeyUp(M){if(!o){if(Hu(M),k==null||k(M),M.target===M.currentTarget&&c&&h&&ju(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!c&&!h&&M.key===" "&&(b==null||b(M))}},onPointerDown(M){if(o){M.preventDefault();return}V==null||V(M)}},c?void 0:{role:"button"},m,T)},[o,m,h,c]),w=Ee(S=>{d.current=S,v()});return{getButtonProps:g,buttonRef:w}}function ju(n){return kt(n)&&n.tagName==="BUTTON"}function vw(n){return!!((n==null?void 0:n.tagName)==="A"&&(n!=null&&n.href))}const yw={...pw,...fc},xw=E.forwardRef(function(o,i){const{panelId:l,open:c,handleTrigger:u,state:d,disabled:p}=Xm(),{className:h,disabled:m=p,id:v,render:g,nativeButton:w=!0,...S}=o,{getButtonProps:b,buttonRef:C}=eh({disabled:m,focusableWhenDisabled:!0,native:w}),k=E.useMemo(()=>({"aria-controls":c?l:void 0,"aria-expanded":c,onClick:u}),[l,c,u]);return St("button",o,{state:d,ref:[i,C],props:[k,S,b],stateAttributesMapping:yw})});let ww=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n})({});function Sw(n){const{abortControllerRef:o,animationTypeRef:i,externalRef:l,height:c,hiddenUntilFound:u,keepMounted:d,id:p,mounted:h,onOpenChange:m,open:v,panelRef:g,runOnceAnimationsFinish:w,setDimensions:S,setMounted:b,setOpen:C,setVisible:k,transitionDimensionRef:N,visible:V,width:T}=n,j=E.useRef(!1),M=E.useRef(null),D=E.useRef(v),W=E.useRef(v),A=$m(),U=E.useMemo(()=>i.current==="css-animation"?!V:!v&&!h,[v,h,V,i]),ne=Ee(L=>{if(!L)return;if(i.current==null||N.current==null){const z=getComputedStyle(L),X=z.animationName!=="none"&&z.animationName!=="",Q=z.transitionDuration!=="0s"&&z.transitionDuration!=="";X&&Q||(z.animationName==="none"&&z.transitionDuration!=="0s"?i.current="css-transition":z.animationName!=="none"&&z.transitionDuration==="0s"?i.current="css-animation":i.current="none"),L.getAttribute(ww.orientation)==="horizontal"||z.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(i.current!=="css-transition")return;(c===void 0||T===void 0)&&(S({height:L.scrollHeight,width:L.scrollWidth}),W.current&&L.style.setProperty("transition-duration","0s"));let K=-1,G=-1;return K=Ze.request(()=>{W.current=!1,G=Ze.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})}),()=>{Ze.cancel(K),Ze.cancel(G)}}),te=Ri(l,g,ne);return ke(()=>{if(i.current!=="css-transition")return;const L=g.current;if(!L)return;let K=-1;if(o.current!=null&&(o.current.abort(),o.current=null),v){const G={"justify-content":L.style.justifyContent,"align-items":L.style.alignItems,"align-content":L.style.alignContent,"justify-items":L.style.justifyItems};Object.keys(G).forEach(z=>{L.style.setProperty(z,"initial","important")}),!W.current&&!d&&L.setAttribute(ki.startingStyle,""),S({height:L.scrollHeight,width:L.scrollWidth}),K=Ze.request(()=>{Object.entries(G).forEach(([z,X])=>{X===""?L.style.removeProperty(z):L.style.setProperty(z,X)})})}else{if(L.scrollHeight===0&&L.scrollWidth===0)return;S({height:L.scrollHeight,width:L.scrollWidth});const G=new AbortController;o.current=G;const z=G.signal;let X=null;const Q=ki.endingStyle;return X=new MutationObserver(I=>{I.some(B=>B.type==="attributes"&&B.attributeName===Q)&&(X==null||X.disconnect(),X=null,w(()=>{S({height:0,width:0}),L.style.removeProperty("content-visibility"),b(!1),o.current===G&&(o.current=null)},z))}),X.observe(L,{attributes:!0,attributeFilter:[Q]}),()=>{X==null||X.disconnect(),A.cancel(),o.current===G&&(G.abort(),o.current=null)}}return()=>{Ze.cancel(K)}},[o,i,A,u,d,h,v,g,w,S,b]),ke(()=>{if(i.current!=="css-animation")return;const L=g.current;L&&(M.current=L.style.animationName||M.current,L.style.setProperty("animation-name","none"),S({height:L.scrollHeight,width:L.scrollWidth}),!D.current&&!j.current&&L.style.removeProperty("animation-name"),v?(o.current!=null&&(o.current.abort(),o.current=null),b(!0),k(!0)):(o.current=new AbortController,w(()=>{b(!1),k(!1),o.current=null},o.current.signal)))},[o,i,v,g,w,S,b,k,V]),El(()=>{const L=Ze.request(()=>{D.current=!1});return()=>Ze.cancel(L)}),ke(()=>{if(!u)return;const L=g.current;if(!L)return;let K=-1,G=-1;return v&&j.current&&(L.style.transitionDuration="0s",S({height:L.scrollHeight,width:L.scrollWidth}),K=Ze.request(()=>{j.current=!1,G=Ze.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})})),()=>{Ze.cancel(K),Ze.cancel(G)}},[u,v,g,S]),ke(()=>{const L=g.current;L&&u&&U&&(L.setAttribute("hidden","until-found"),i.current==="css-transition"&&L.setAttribute(ki.startingStyle,""))},[u,U,i,g]),E.useEffect(function(){const K=g.current;if(!K)return;function G(z){j.current=!0,C(!0),m(!0,Qe(zi,z))}return K.addEventListener("beforematch",G),()=>{K.removeEventListener("beforematch",G)}},[m,g,C]),E.useMemo(()=>({props:{hidden:U,id:p,ref:te}}),[U,p,te])}let Np=(function(n){return n.collapsiblePanelHeight="--collapsible-panel-height",n.collapsiblePanelWidth="--collapsible-panel-width",n})({});const kw=E.forwardRef(function(o,i){const{className:l,hiddenUntilFound:c,keepMounted:u,render:d,id:p,...h}=o,{abortControllerRef:m,animationTypeRef:v,height:g,mounted:w,onOpenChange:S,open:b,panelId:C,panelRef:k,runOnceAnimationsFinish:N,setDimensions:V,setHiddenUntilFound:T,setKeepMounted:j,setMounted:M,setPanelIdState:D,setOpen:W,setVisible:A,state:U,transitionDimensionRef:ne,visible:te,width:L,transitionStatus:K}=Xm(),G=c??!1,z=u??!1;ke(()=>{if(p)return D(p),()=>{D(void 0)}},[p,D]),ke(()=>{T(G)},[T,G]),ke(()=>{j(z)},[j,z]);const{props:X}=Sw({abortControllerRef:m,animationTypeRef:v,externalRef:i,height:g,hiddenUntilFound:G,id:C,keepMounted:z,mounted:w,onOpenChange:S,open:b,panelRef:k,runOnceAnimationsFinish:N,setDimensions:V,setMounted:M,setOpen:W,setVisible:A,transitionDimensionRef:ne,visible:te,width:L});dc({open:b&&K==="idle",ref:k,onComplete(){b&&V({height:void 0,width:void 0})}});const Q=E.useMemo(()=>({...U,transitionStatus:K}),[U,K]),I=St("div",o,{state:Q,ref:[i,k],props:[X,{style:{[Np.collapsiblePanelHeight]:g===void 0?"auto":`${g}px`,[Np.collapsiblePanelWidth]:L===void 0?"auto":`${L}px`}},h],stateAttributesMapping:qm});return z||G||!z&&w?I:null});function th({...n}){return x.jsx(hw,{"data-slot":"collapsible",...n})}function nh({...n}){return x.jsx(xw,{"data-slot":"collapsible-trigger",...n})}function rh({...n}){return x.jsx(kw,{"data-slot":"collapsible-content",...n})}const qu=[];let Zu;function bw(){return Zu}function Ew(n){qu.push(n)}function oh(n){const o=(i,l)=>{const c=Ot(_w).current;let u;try{Zu=c;for(const d of qu)d.before(c);u=n(i,l);for(const d of qu)d.after(c);c.didInitialize=!0}finally{Zu=void 0}return u};return o.displayName=n.displayName||n.name,o}function Cw(n){return E.forwardRef(oh(n))}function _w(){return{didInitialize:!1}}function Rw(n){const o=E.useRef(!0);o.current&&(o.current=!1,n())}const ih=E.createContext(void 0);function Di(n){const o=E.useContext(ih);if(o===void 0&&!n)throw new Error(Nn(72));return o}function Pw(n,o){return o!=null&&!ml(o)?0:typeof n=="function"?n():n}function bi(n,o,i){const l=Pw(n,i);return typeof l=="number"?l:l==null?void 0:l[o]}function Mp(n){return typeof n=="function"?n():n}function sh(n,o){return o||n==="click"||n==="mousedown"}const lh=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Yn,currentIdRef:{current:null},currentContextRef:{current:null}});function Tw(n){const{children:o,delay:i,timeoutMs:l=0}=n,c=E.useRef(i),u=E.useRef(i),d=E.useRef(null),p=E.useRef(null),h=Pi();return x.jsx(lh.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:c,initialDelayRef:u,currentIdRef:d,timeoutMs:l,currentContextRef:p,timeout:h}),[l,h]),children:o})}function Nw(n,o={open:!1}){const i="rootStore"in n?n.rootStore:n,l=i.useState("floatingId"),{open:c}=o,u=E.useContext(lh),{currentIdRef:d,delayRef:p,timeoutMs:h,initialDelayRef:m,currentContextRef:v,hasProvider:g,timeout:w}=u,[S,b]=E.useState(!1);return ke(()=>{function C(){var k;b(!1),(k=v.current)==null||k.setIsInstantPhase(!1),d.current=null,v.current=null,p.current=m.current}if(d.current&&!c&&d.current===l){if(b(!1),h){const k=l;return w.start(h,()=>{i.select("open")||d.current&&d.current!==k||C()}),()=>{w.clear()}}C()}},[c,l,d,p,h,m,v,w,i]),ke(()=>{if(!c)return;const C=v.current,k=d.current;w.clear(),v.current={onOpenChange:i.setOpen,setIsInstantPhase:b},d.current=l,p.current={open:0,close:bi(m.current,"close")},k!==null&&k!==l?(b(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,Qe(zi))):(b(!1),C==null||C.setIsInstantPhase(!1))},[c,l,i,d,p,h,m,v,w]),ke(()=>()=>{v.current=null},[v]),E.useMemo(()=>({hasProvider:g,delayRef:p,isInstantPhase:S}),[g,p,S])}function Hr(n){const o=Ot(Mw,n).current;return o.next=n,ke(o.effect),o}function Mw(n){const o={current:n,next:n,effect:()=>{o.current=o.next}};return o}function mc(n){return`data-base-ui-${n}`}const Ow=E.createContext(null),jw=()=>E.useContext(Ow),Iw=mc("portal");function Lw(n={}){const{ref:o,container:i,componentProps:l=gt,elementProps:c}=n,u=kl(),d=jw(),p=d==null?void 0:d.portalNode,[h,m]=E.useState(null),[v,g]=E.useState(null),w=Ee(k=>{k!==null&&g(k)}),S=E.useRef(null);ke(()=>{if(i===null){S.current&&(S.current=null,g(null),m(null));return}if(u==null)return;const k=(i&&(sc(i)?i:i.current))??p??document.body;if(k==null){S.current&&(S.current=null,g(null),m(null));return}S.current!==k&&(S.current=k,g(null),m(k))},[i,p,u]);const b=St("div",l,{ref:[o,w],props:[{id:u,[Iw]:""},c]});return{portalNode:v,portalSubtree:h&&b?Zr.createPortal(b,h):null}}function Aw(){const n=new Map;return{emit(o,i){var l;(l=n.get(o))==null||l.forEach(c=>c(i))},on(o,i){n.has(o)||n.set(o,new Set),n.get(o).add(i)},off(o,i){var l;(l=n.get(o))==null||l.delete(i)}}}const zw=E.createContext(null),Dw=E.createContext(null),hc=()=>{var n;return((n=E.useContext(zw))==null?void 0:n.id)||null},Il=n=>{const o=E.useContext(Dw);return n??o};function Fw(n,o){let i=null,l=null,c=!1;return{contextElement:n||void 0,getBoundingClientRect(){var S;const u=(n==null?void 0:n.getBoundingClientRect())||{width:0,height:0,x:0,y:0},d=o.axis==="x"||o.axis==="both",p=o.axis==="y"||o.axis==="both",h=["mouseenter","mousemove"].includes(((S=o.dataRef.current.openEvent)==null?void 0:S.type)||"")&&o.pointerType!=="touch";let m=u.width,v=u.height,g=u.x,w=u.y;return i==null&&o.x&&d&&(i=u.x-o.x),l==null&&o.y&&p&&(l=u.y-o.y),g-=i||0,w-=l||0,m=0,v=0,!c||h?(m=o.axis==="y"?u.width:0,v=o.axis==="x"?u.height:0,g=d&&o.x!=null?o.x:g,w=p&&o.y!=null?o.y:w):c&&!h&&(v=o.axis==="x"?u.height:v,m=o.axis==="y"?u.width:m),c=!0,{width:m,height:v,x:g,y:w,top:w,right:g+m,bottom:w+v,left:g}}}}function Op(n){return n!=null&&n.clientX!=null}function Vw(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),c=i.useState("floatingElement"),u=i.useState("domReferenceElement"),d=i.context.dataRef,{enabled:p=!0,axis:h="both"}=o,m=E.useRef(!1),v=E.useRef(null),[g,w]=E.useState(),[S,b]=E.useState([]),C=Ee((j,M,D)=>{m.current||d.current.openEvent&&!Op(d.current.openEvent)||i.set("positionReference",Fw(D??u,{x:j,y:M,axis:h,dataRef:d,pointerType:g}))}),k=Ee(j=>{l?v.current||b([]):C(j.clientX,j.clientY,j.currentTarget)}),N=ml(g)?c:l,V=E.useCallback(()=>{if(!N||!p)return;const j=vt(c);function M(D){const W=Cn(D);wt(c,W)?(j.removeEventListener("mousemove",M),v.current=null):C(D.clientX,D.clientY)}if(!d.current.openEvent||Op(d.current.openEvent)){j.addEventListener("mousemove",M);const D=()=>{j.removeEventListener("mousemove",M),v.current=null};return v.current=D,D}i.set("positionReference",u)},[N,p,c,d,u,i,C]);E.useEffect(()=>V(),[V,S]),E.useEffect(()=>{p&&!c&&(m.current=!1)},[p,c]),E.useEffect(()=>{!p&&l&&(m.current=!0)},[p,l]);const T=E.useMemo(()=>{function j(M){w(M.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:k,onMouseEnter:k}},[k]);return E.useMemo(()=>p?{reference:T,trigger:T}:{},[p,T])}const Uw={intentional:"onClick",sloppy:"onPointerDown"};function $w(){return!1}function Bw(n){return{escapeKey:typeof n=="boolean"?n:(n==null?void 0:n.escapeKey)??!1,outsidePress:typeof n=="boolean"?n:(n==null?void 0:n.outsidePress)??!0}}function Hw(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),c=i.useState("floatingElement"),{dataRef:u}=i.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="sloppy",referencePress:v=$w,referencePressEvent:g="sloppy",bubbles:w,externalTree:S}=o,b=Il(S),C=Ee(typeof h=="function"?h:()=>!1),k=typeof h=="function"?C:h,N=k!==!1,V=Ee(()=>m),T=E.useRef(!1),j=E.useRef(!1),M=E.useRef(!1),{escapeKey:D,outsidePress:W}=Bw(w),A=E.useRef(null),U=Pi(),ne=Pi(),te=Ee(()=>{ne.clear(),u.current.insideReactTree=!1}),L=E.useRef(!1),K=E.useRef(""),G=Ee(v),z=Ee(R=>{var oe;if(!l||!d||!p||R.key!=="Escape"||L.current)return;const Y=(oe=u.current.floatingContext)==null?void 0:oe.nodeId,ue=b?Wr(b.nodesRef.current,Y):[];if(!D&&ue.length>0){let he=!0;if(ue.forEach(xe=>{var de;(de=xe.context)!=null&&de.open&&!xe.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const ce=Kx(R)?R.nativeEvent:R,le=Qe(pc,ce);i.setOpen(!1,le),!D&&!le.isPropagationAllowed&&R.stopPropagation()}),X=Ee(()=>{u.current.insideReactTree=!0,ne.start(0,te)});E.useEffect(()=>{if(!l||!d)return;u.current.__escapeKeyBubbles=D,u.current.__outsidePressBubbles=W;const R=new Yn,Y=new Yn;function ue(){R.clear(),L.current=!0}function ce(){R.start(Rl()?5:0,()=>{L.current=!1})}function le(){M.current=!0,Y.start(0,()=>{M.current=!1})}function oe(){T.current=!1,j.current=!1}function he(){const ie=K.current,se=ie==="pen"||!ie?"mouse":ie,Ie=V(),Fe=typeof Ie=="function"?Ie():Ie;return typeof Fe=="string"?Fe:Fe[se]}function xe(ie){const se=he();return se==="intentional"&&ie.type!=="click"||se==="sloppy"&&ie.type==="click"}function de(ie){var Fe;const se=(Fe=u.current.floatingContext)==null?void 0:Fe.nodeId,Ie=b&&Wr(b.nodesRef.current,se).some(It=>{var nn;return mn(ie,(nn=It.context)==null?void 0:nn.elements.floating)});return mn(ie,i.select("floatingElement"))||mn(ie,i.select("domReferenceElement"))||Ie}function Te(ie){var Lt;if(xe(ie)){te();return}if(u.current.insideReactTree){te();return}const se=Cn(ie),Ie=`[${mc("inert")}]`;let Fe=Array.from(Qn(i.select("floatingElement")).querySelectorAll(Ie));const It=je(se)?se.getRootNode():null;dl(It)&&(Fe=Fe.concat(Array.from(It.querySelectorAll(Ie))));const nn=i.context.triggerElements;if(se&&(nn.hasElement(se)||nn.hasMatchingElement(Ve=>wt(Ve,se))))return;let Wt=je(se)?se:null;for(;Wt&&!Kn(Wt);){const Ve=Gn(Wt);if(Kn(Ve)||!je(Ve))break;Wt=Ve}if(Fe.length&&je(se)&&!Bx(se)&&!wt(se,i.select("floatingElement"))&&Fe.every(Ve=>!wt(Wt,Ve)))return;if(kt(se)&&!("touches"in ie)){const Ve=Kn(se),rn=$t(se),on=/auto|scroll/,_r=Ve||on.test(rn.overflowX),Jr=Ve||on.test(rn.overflowY),Zn=_r&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,Jn=Jr&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,er=rn.direction==="rtl",Me=Jn&&(er?ie.offsetX<=se.offsetWidth-se.clientWidth:ie.offsetX>se.clientWidth),Ye=Zn&&ie.offsetY>se.clientHeight;if(Me||Ye)return}if(de(ie))return;if(he()==="intentional"&&M.current){Y.clear(),M.current=!1;return}if(typeof k=="function"&&!k(ie))return;const gn=(Lt=u.current.floatingContext)==null?void 0:Lt.nodeId,qn=b?Wr(b.nodesRef.current,gn):[];if(qn.length>0){let Ve=!0;if(qn.forEach(rn=>{var on;(on=rn.context)!=null&&on.open&&!rn.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}i.setOpen(!1,Qe(v0,ie)),te()}function Ke(ie){he()!=="sloppy"||ie.pointerType==="touch"||!i.select("open")||!d||mn(ie,i.select("floatingElement"))||mn(ie,i.select("domReferenceElement"))||Te(ie)}function Bt(ie){if(he()!=="sloppy"||!i.select("open")||!d||mn(ie,i.select("floatingElement"))||mn(ie,i.select("domReferenceElement")))return;const se=ie.touches[0];se&&(A.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function bt(ie){K.current="touch";const se=Cn(ie);function Ie(){Bt(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function it(ie){if(U.clear(),ie.type==="pointerdown"&&(K.current=ie.pointerType),ie.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const se=Cn(ie);function Ie(){ie.type==="pointerdown"?Ke(ie):Te(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function jt(ie){if(!T.current)return;const se=j.current;if(oe(),he()==="intentional"){if(ie.type==="pointercancel"){se&&le();return}if(!de(ie)){if(se){le();return}typeof k=="function"&&!k(ie)||(Y.clear(),M.current=!0,te())}}}function tn(ie){if(he()!=="sloppy"||!A.current||mn(ie,i.select("floatingElement"))||mn(ie,i.select("domReferenceElement")))return;const se=ie.touches[0];if(!se)return;const Ie=Math.abs(se.clientX-A.current.startX),Fe=Math.abs(se.clientY-A.current.startY),It=Math.sqrt(Ie*Ie+Fe*Fe);It>5&&(A.current.dismissOnTouchEnd=!0),It>10&&(Te(ie),U.clear(),A.current=null)}function Ht(ie){const se=Cn(ie);function Ie(){tn(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function Cr(ie){he()!=="sloppy"||!A.current||mn(ie,i.select("floatingElement"))||mn(ie,i.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&Te(ie),U.clear(),A.current=null)}function On(ie){const se=Cn(ie);function Ie(){Cr(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}const Re=Qn(c);return p&&(Re.addEventListener("keydown",z),Re.addEventListener("compositionstart",ue),Re.addEventListener("compositionend",ce)),N&&(Re.addEventListener("click",it,!0),Re.addEventListener("pointerdown",it,!0),Re.addEventListener("pointerup",jt,!0),Re.addEventListener("pointercancel",jt,!0),Re.addEventListener("mousedown",it,!0),Re.addEventListener("mouseup",jt,!0),Re.addEventListener("touchstart",bt,!0),Re.addEventListener("touchmove",Ht,!0),Re.addEventListener("touchend",On,!0)),()=>{p&&(Re.removeEventListener("keydown",z),Re.removeEventListener("compositionstart",ue),Re.removeEventListener("compositionend",ce)),N&&(Re.removeEventListener("click",it,!0),Re.removeEventListener("pointerdown",it,!0),Re.removeEventListener("pointerup",jt,!0),Re.removeEventListener("pointercancel",jt,!0),Re.removeEventListener("mousedown",it,!0),Re.removeEventListener("mouseup",jt,!0),Re.removeEventListener("touchstart",bt,!0),Re.removeEventListener("touchmove",Ht,!0),Re.removeEventListener("touchend",On,!0)),R.clear(),Y.clear(),oe(),M.current=!1}},[u,c,p,N,k,l,d,D,W,z,te,V,b,i,U]),E.useEffect(te,[k,te]);const Q=E.useMemo(()=>({onKeyDown:z,[Uw[g]]:R=>{G()&&i.setOpen(!1,Qe(Ni,R.nativeEvent))},...g!=="intentional"&&{onClick(R){G()&&i.setOpen(!1,Qe(Ni,R.nativeEvent))}}}),[z,i,g,G]),I=Ee(R=>{if(!l||!d||R.button!==0)return;const Y=Cn(R.nativeEvent);wt(i.select("floatingElement"),Y)&&(T.current||(T.current=!0,j.current=!1))}),q=Ee(R=>{!l||!d||(R.defaultPrevented||R.nativeEvent.defaultPrevented)&&T.current&&(j.current=!0)}),B=E.useMemo(()=>({onKeyDown:z,onPointerDown:q,onMouseDown:q,onClickCapture:X,onMouseDownCapture(R){X(),I(R)},onPointerDownCapture(R){X(),I(R)},onMouseUpCapture:X,onTouchEndCapture:X,onTouchMoveCapture:X}),[z,X,I,q]);return E.useMemo(()=>d?{reference:Q,floating:B,trigger:Q}:{},[d,Q,B])}function jp(n,o,i){let{reference:l,floating:c}=n;const u=en(o),d=cc(o),p=uc(d),h=Mt(o),m=u==="y",v=l.x+l.width/2-c.width/2,g=l.y+l.height/2-c.height/2,w=l[p]/2-c[p]/2;let S;switch(h){case"top":S={x:v,y:l.y-c.height};break;case"bottom":S={x:v,y:l.y+l.height};break;case"right":S={x:l.x+l.width,y:g};break;case"left":S={x:l.x-c.width,y:g};break;default:S={x:l.x,y:l.y}}switch(br(o)){case"start":S[d]-=w*(i&&m?-1:1);break;case"end":S[d]+=w*(i&&m?-1:1);break}return S}async function Ww(n,o){var i;o===void 0&&(o={});const{x:l,y:c,platform:u,rects:d,elements:p,strategy:h}=n,{boundary:m="clippingAncestors",rootBoundary:v="viewport",elementContext:g="floating",altBoundary:w=!1,padding:S=0}=Xn(o,n),b=Um(S),k=p[w?g==="floating"?"reference":"floating":g],N=vl(await u.getClippingRect({element:(i=await(u.isElement==null?void 0:u.isElement(k)))==null||i?k:k.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:m,rootBoundary:v,strategy:h})),V=g==="floating"?{x:l,y:c,width:d.floating.width,height:d.floating.height}:d.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),j=await(u.isElement==null?void 0:u.isElement(T))?await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1}:{x:1,y:1},M=vl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:V,offsetParent:T,strategy:h}):V);return{top:(N.top-M.top+b.top)/j.y,bottom:(M.bottom-N.bottom+b.bottom)/j.y,left:(N.left-M.left+b.left)/j.x,right:(M.right-N.right+b.right)/j.x}}const Kw=50,Yw=async(n,o,i)=>{const{placement:l="bottom",strategy:c="absolute",middleware:u=[],platform:d}=i,p=d.detectOverflow?d:{...d,detectOverflow:Ww},h=await(d.isRTL==null?void 0:d.isRTL(o));let m=await d.getElementRects({reference:n,floating:o,strategy:c}),{x:v,y:g}=jp(m,l,h),w=l,S=0;const b={};for(let C=0;CG<=0)){var te,L;const G=(((te=u.flip)==null?void 0:te.index)||0)+1,z=W[G];if(z&&(!(g==="alignment"?V!==en(z):!1)||ne.every(I=>en(I.placement)===V?I.overflows[0]>0:!0)))return{data:{index:G,overflows:ne},reset:{placement:z}};let X=(L=ne.filter(Q=>Q.overflows[0]<=0).sort((Q,I)=>Q.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(S){case"bestFit":{var K;const Q=(K=ne.filter(I=>{if(D){const q=en(I.placement);return q===V||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,B)=>q+B,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:K[0];Q&&(X=Q);break}case"initialPlacement":X=p;break}if(c!==X)return{reset:{placement:X}}}return{}}}};function Ip(n,o){return{top:n.top-o.height,right:n.right-o.width,bottom:n.bottom-o.height,left:n.left-o.width}}function Lp(n){return Gx.some(o=>n[o]>=0)}const Qw=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(o){const{rects:i,platform:l}=o,{strategy:c="referenceHidden",...u}=Xn(n,o);switch(c){case"referenceHidden":{const d=await l.detectOverflow(o,{...u,elementContext:"reference"}),p=Ip(d,i.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Lp(p)}}}case"escaped":{const d=await l.detectOverflow(o,{...u,altBoundary:!0}),p=Ip(d,i.floating);return{data:{escapedOffsets:p,escaped:Lp(p)}}}default:return{}}}}},ah=new Set(["left","top"]);async function Xw(n,o){const{placement:i,platform:l,elements:c}=n,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),d=Mt(i),p=br(i),h=en(i)==="y",m=ah.has(d)?-1:1,v=u&&h?-1:1,g=Xn(o,n);let{mainAxis:w,crossAxis:S,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return p&&typeof b=="number"&&(S=p==="end"?b*-1:b),h?{x:S*v,y:w*m}:{x:w*m,y:S*v}}const qw=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(o){var i,l;const{x:c,y:u,placement:d,middlewareData:p}=o,h=await Xw(o,n);return d===((i=p.offset)==null?void 0:i.placement)&&(l=p.arrow)!=null&&l.alignmentOffset?{}:{x:c+h.x,y:u+h.y,data:{...h,placement:d}}}}},Zw=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(o){const{x:i,y:l,placement:c,platform:u}=o,{mainAxis:d=!0,crossAxis:p=!1,limiter:h={fn:N=>{let{x:V,y:T}=N;return{x:V,y:T}}},...m}=Xn(n,o),v={x:i,y:l},g=await u.detectOverflow(o,m),w=en(Mt(c)),S=ac(w);let b=v[S],C=v[w];if(d){const N=S==="y"?"top":"left",V=S==="y"?"bottom":"right",T=b+g[N],j=b-g[V];b=Gu(T,b,j)}if(p){const N=w==="y"?"top":"left",V=w==="y"?"bottom":"right",T=C+g[N],j=C-g[V];C=Gu(T,C,j)}const k=h.fn({...o,[S]:b,[w]:C});return{...k,data:{x:k.x-i,y:k.y-l,enabled:{[S]:d,[w]:p}}}}}},Jw=function(n){return n===void 0&&(n={}),{options:n,fn(o){const{x:i,y:l,placement:c,rects:u,middlewareData:d}=o,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=Xn(n,o),v={x:i,y:l},g=en(c),w=ac(g);let S=v[w],b=v[g];const C=Xn(p,o),k=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const T=w==="y"?"height":"width",j=u.reference[w]-u.floating[T]+k.mainAxis,M=u.reference[w]+u.reference[T]-k.mainAxis;SM&&(S=M)}if(m){var N,V;const T=w==="y"?"width":"height",j=ah.has(Mt(c)),M=u.reference[g]-u.floating[T]+(j&&((N=d.offset)==null?void 0:N[g])||0)+(j?0:k.crossAxis),D=u.reference[g]+u.reference[T]+(j?0:((V=d.offset)==null?void 0:V[g])||0)-(j?k.crossAxis:0);bD&&(b=D)}return{[w]:S,[g]:b}}}},eS=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(o){var i,l;const{placement:c,rects:u,platform:d,elements:p}=o,{apply:h=()=>{},...m}=Xn(n,o),v=await d.detectOverflow(o,m),g=Mt(c),w=br(c),S=en(c)==="y",{width:b,height:C}=u.floating;let k,N;g==="top"||g==="bottom"?(k=g,N=w===(await(d.isRTL==null?void 0:d.isRTL(p.floating))?"start":"end")?"left":"right"):(N=g,k=w==="end"?"top":"bottom");const V=C-v.top-v.bottom,T=b-v.left-v.right,j=No(C-v[k],V),M=No(b-v[N],T),D=!o.middlewareData.shift;let W=j,A=M;if((i=o.middlewareData.shift)!=null&&i.enabled.x&&(A=T),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(W=V),D&&!w){const ne=Vt(v.left,0),te=Vt(v.right,0),L=Vt(v.top,0),K=Vt(v.bottom,0);S?A=b-2*(ne!==0||te!==0?ne+te:Vt(v.left,v.right)):W=C-2*(L!==0||K!==0?L+K:Vt(v.top,v.bottom))}await h({...o,availableWidth:A,availableHeight:W});const U=await d.getDimensions(p.floating);return b!==U.width||C!==U.height?{reset:{rects:!0}}:{}}}};function uh(n){const o=$t(n);let i=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const c=kt(n),u=c?n.offsetWidth:i,d=c?n.offsetHeight:l,p=hl(i)!==u||hl(l)!==d;return p&&(i=u,l=d),{width:i,height:l,$:p}}function gc(n){return je(n)?n:n.contextElement}function Po(n){const o=gc(n);if(!kt(o))return Pn(1);const i=o.getBoundingClientRect(),{width:l,height:c,$:u}=uh(o);let d=(u?hl(i.width):i.width)/l,p=(u?hl(i.height):i.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const tS=Pn(0);function ch(n){const o=vt(n);return!Rl()||!o.visualViewport?tS:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function nS(n,o,i){return o===void 0&&(o=!1),!i||o&&i!==vt(n)?!1:o}function Gr(n,o,i,l){o===void 0&&(o=!1),i===void 0&&(i=!1);const c=n.getBoundingClientRect(),u=gc(n);let d=Pn(1);o&&(l?je(l)&&(d=Po(l)):d=Po(n));const p=nS(u,i,l)?ch(u):Pn(0);let h=(c.left+p.x)/d.x,m=(c.top+p.y)/d.y,v=c.width/d.x,g=c.height/d.y;if(u){const w=vt(u),S=l&&je(l)?vt(l):l;let b=w,C=Ku(b);for(;C&&l&&S!==b;){const k=Po(C),N=C.getBoundingClientRect(),V=$t(C),T=N.left+(C.clientLeft+parseFloat(V.paddingLeft))*k.x,j=N.top+(C.clientTop+parseFloat(V.paddingTop))*k.y;h*=k.x,m*=k.y,v*=k.x,g*=k.y,h+=T,m+=j,b=vt(C),C=Ku(b)}}return vl({width:v,height:g,x:h,y:m})}function Ll(n,o){const i=Pl(n).scrollLeft;return o?o.left+i:Gr(Mn(n)).left+i}function fh(n,o){const i=n.getBoundingClientRect(),l=i.left+o.scrollLeft-Ll(n,i),c=i.top+o.scrollTop;return{x:l,y:c}}function rS(n){let{elements:o,rect:i,offsetParent:l,strategy:c}=n;const u=c==="fixed",d=Mn(l),p=o?_l(o.floating):!1;if(l===d||p&&u)return i;let h={scrollLeft:0,scrollTop:0},m=Pn(1);const v=Pn(0),g=kt(l);if((g||!g&&!u)&&((jo(l)!=="body"||Li(d))&&(h=Pl(l)),g)){const S=Gr(l);m=Po(l),v.x=S.x+l.clientLeft,v.y=S.y+l.clientTop}const w=d&&!g&&!u?fh(d,h):Pn(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-h.scrollLeft*m.x+v.x+w.x,y:i.y*m.y-h.scrollTop*m.y+v.y+w.y}}function oS(n){return Array.from(n.getClientRects())}function iS(n){const o=Mn(n),i=Pl(n),l=n.ownerDocument.body,c=Vt(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),u=Vt(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let d=-i.scrollLeft+Ll(n);const p=-i.scrollTop;return $t(l).direction==="rtl"&&(d+=Vt(o.clientWidth,l.clientWidth)-c),{width:c,height:u,x:d,y:p}}const Ap=25;function sS(n,o){const i=vt(n),l=Mn(n),c=i.visualViewport;let u=l.clientWidth,d=l.clientHeight,p=0,h=0;if(c){u=c.width,d=c.height;const v=Rl();(!v||v&&o==="fixed")&&(p=c.offsetLeft,h=c.offsetTop)}const m=Ll(l);if(m<=0){const v=l.ownerDocument,g=v.body,w=getComputedStyle(g),S=v.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,b=Math.abs(l.clientWidth-g.clientWidth-S);b<=Ap&&(u-=b)}else m<=Ap&&(u+=m);return{width:u,height:d,x:p,y:h}}function lS(n,o){const i=Gr(n,!0,o==="fixed"),l=i.top+n.clientTop,c=i.left+n.clientLeft,u=kt(n)?Po(n):Pn(1),d=n.clientWidth*u.x,p=n.clientHeight*u.y,h=c*u.x,m=l*u.y;return{width:d,height:p,x:h,y:m}}function zp(n,o,i){let l;if(o==="viewport")l=sS(n,i);else if(o==="document")l=iS(Mn(n));else if(je(o))l=lS(o,i);else{const c=ch(n);l={x:o.x-c.x,y:o.y-c.y,width:o.width,height:o.height}}return vl(l)}function dh(n,o){const i=Gn(n);return i===o||!je(i)||Kn(i)?!1:$t(i).position==="fixed"||dh(i,o)}function aS(n,o){const i=o.get(n);if(i)return i;let l=Ti(n,[],!1).filter(p=>je(p)&&jo(p)!=="body"),c=null;const u=$t(n).position==="fixed";let d=u?Gn(n):n;for(;je(d)&&!Kn(d);){const p=$t(d),h=lc(d);!h&&p.position==="fixed"&&(c=null),(u?!h&&!c:!h&&p.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||Li(d)&&!h&&dh(n,d))?l=l.filter(v=>v!==d):c=p,d=Gn(d)}return o.set(n,l),l}function uS(n){let{element:o,boundary:i,rootBoundary:l,strategy:c}=n;const d=[...i==="clippingAncestors"?_l(o)?[]:aS(o,this._c):[].concat(i),l],p=zp(o,d[0],c);let h=p.top,m=p.right,v=p.bottom,g=p.left;for(let w=1;w{d(!1,1e-7)},1e3)}W===1&&!mh(m,n.getBoundingClientRect())&&d(),j=!1}try{i=new IntersectionObserver(M,{...T,root:c.ownerDocument})}catch{i=new IntersectionObserver(M,T)}i.observe(n)}return d(!0),u}function Fp(n,o,i,l){l===void 0&&(l={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,m=gc(n),v=c||u?[...m?Ti(m):[],...o?Ti(o):[]]:[];v.forEach(N=>{c&&N.addEventListener("scroll",i,{passive:!0}),u&&N.addEventListener("resize",i)});const g=m&&p?hS(m,i):null;let w=-1,S=null;d&&(S=new ResizeObserver(N=>{let[V]=N;V&&V.target===m&&S&&o&&(S.unobserve(o),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var T;(T=S)==null||T.observe(o)})),i()}),m&&!h&&S.observe(m),o&&S.observe(o));let b,C=h?Gr(n):null;h&&k();function k(){const N=Gr(n);C&&!mh(C,N)&&i(),C=N,b=requestAnimationFrame(k)}return i(),()=>{var N;v.forEach(V=>{c&&V.removeEventListener("scroll",i),u&&V.removeEventListener("resize",i)}),g==null||g(),(N=S)==null||N.disconnect(),S=null,h&&cancelAnimationFrame(b)}}const gS=qw,vS=Zw,yS=Gw,xS=eS,wS=Qw,SS=Jw,kS=(n,o,i)=>{const l=new Map,c={platform:mS,...i},u={...c.platform,_c:l};return Yw(n,o,{...c,platform:u})};var bS=typeof document<"u",ES=function(){},al=bS?E.useLayoutEffect:ES;function yl(n,o){if(n===o)return!0;if(typeof n!=typeof o)return!1;if(typeof n=="function"&&n.toString()===o.toString())return!0;let i,l,c;if(n&&o&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==o.length)return!1;for(l=i;l--!==0;)if(!yl(n[l],o[l]))return!1;return!0}if(c=Object.keys(n),i=c.length,i!==Object.keys(o).length)return!1;for(l=i;l--!==0;)if(!{}.hasOwnProperty.call(o,c[l]))return!1;for(l=i;l--!==0;){const u=c[l];if(!(u==="_owner"&&n.$$typeof)&&!yl(n[u],o[u]))return!1}return!0}return n!==n&&o!==o}function hh(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Vp(n,o){const i=hh(n);return Math.round(o*i)/i}function Lu(n){const o=E.useRef(n);return al(()=>{o.current=n}),o}function CS(n){n===void 0&&(n={});const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:c,elements:{reference:u,floating:d}={},transform:p=!0,whileElementsMounted:h,open:m}=n,[v,g]=E.useState({x:0,y:0,strategy:i,placement:o,middlewareData:{},isPositioned:!1}),[w,S]=E.useState(l);yl(w,l)||S(l);const[b,C]=E.useState(null),[k,N]=E.useState(null),V=E.useCallback(I=>{I!==D.current&&(D.current=I,C(I))},[]),T=E.useCallback(I=>{I!==W.current&&(W.current=I,N(I))},[]),j=u||b,M=d||k,D=E.useRef(null),W=E.useRef(null),A=E.useRef(v),U=h!=null,ne=Lu(h),te=Lu(c),L=Lu(m),K=E.useCallback(()=>{if(!D.current||!W.current)return;const I={placement:o,strategy:i,middleware:w};te.current&&(I.platform=te.current),kS(D.current,W.current,I).then(q=>{const B={...q,isPositioned:L.current!==!1};G.current&&!yl(A.current,B)&&(A.current=B,Zr.flushSync(()=>{g(B)}))})},[w,o,i,te,L]);al(()=>{m===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,g(I=>({...I,isPositioned:!1})))},[m]);const G=E.useRef(!1);al(()=>(G.current=!0,()=>{G.current=!1}),[]),al(()=>{if(j&&(D.current=j),M&&(W.current=M),j&&M){if(ne.current)return ne.current(j,M,K);K()}},[j,M,K,ne,U]);const z=E.useMemo(()=>({reference:D,floating:W,setReference:V,setFloating:T}),[V,T]),X=E.useMemo(()=>({reference:j,floating:M}),[j,M]),Q=E.useMemo(()=>{const I={position:i,left:0,top:0};if(!X.floating)return I;const q=Vp(X.floating,v.x),B=Vp(X.floating,v.y);return p?{...I,transform:"translate("+q+"px, "+B+"px)",...hh(X.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:q,top:B}},[i,p,X.floating,v.x,v.y]);return E.useMemo(()=>({...v,update:K,refs:z,elements:X,floatingStyles:Q}),[v,K,z,X,Q])}const _S=(n,o)=>{const i=gS(n);return{name:i.name,fn:i.fn,options:[n,o]}},RS=(n,o)=>{const i=vS(n);return{name:i.name,fn:i.fn,options:[n,o]}},PS=(n,o)=>({fn:SS(n).fn,options:[n,o]}),TS=(n,o)=>{const i=yS(n);return{name:i.name,fn:i.fn,options:[n,o]}},NS=(n,o)=>{const i=xS(n);return{name:i.name,fn:i.fn,options:[n,o]}},MS=(n,o)=>{const i=wS(n);return{name:i.name,fn:i.fn,options:[n,o]}};var xl=Symbol("NOT_FOUND");function OS(n,o=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(o)}function jS(n,o=`expected an object, instead received ${typeof n}`){if(typeof n!="object")throw new TypeError(o)}function IS(n,o="expected all items to be functions, instead received the following types: "){if(!n.every(i=>typeof i=="function")){const i=n.map(l=>typeof l=="function"?`function ${l.name||"unnamed"}()`:typeof l).join(", ");throw new TypeError(`${o}[${i}]`)}}var Up=n=>Array.isArray(n)?n:[n];function LS(n){const o=Array.isArray(n[0])?n[0]:n;return IS(o,"createSelector expects all input-selectors to be functions, but received the following types: "),o}function AS(n,o){const i=[],{length:l}=n;for(let c=0;co(p,m.key));if(h>-1){const m=i[h];return h>0&&(i.splice(h,1),i.unshift(m)),m.value}return xl}function c(p,h){l(p)===xl&&(i.unshift({key:p,value:h}),i.length>n&&i.pop())}function u(){return i}function d(){i=[]}return{get:l,put:c,getEntries:u,clear:d}}var FS=(n,o)=>n===o;function VS(n){return function(i,l){if(i===null||l===null||i.length!==l.length)return!1;const{length:c}=i;for(let u=0;uu(S.value,v));w&&(v=w.value,p!==0&&p--)}h.put(arguments,v)}return v}return m.clearCache=()=>{h.clear(),m.resetResultsCount()},m.resultsCount=()=>p,m.resetResultsCount=()=>{p=0},m}var $S=class{constructor(n){this.value=n}deref(){return this.value}},BS=typeof WeakRef<"u"?WeakRef:$S,HS=0,$p=1;function Js(){return{s:HS,v:void 0,o:null,p:null}}function gh(n,o={}){let i=Js();const{resultEqualityCheck:l}=o;let c,u=0;function d(){var g;let p=i;const{length:h}=arguments;for(let w=0,S=h;w{i=Js(),d.resetResultsCount()},d.resultsCount=()=>u,d.resetResultsCount=()=>{u=0},d}function vh(n,...o){const i=typeof n=="function"?{memoize:n,memoizeOptions:o}:n,l=(...c)=>{let u=0,d=0,p,h={},m=c.pop();typeof m=="object"&&(h=m,m=c.pop()),OS(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);const v={...i,...h},{memoize:g,memoizeOptions:w=[],argsMemoize:S=gh,argsMemoizeOptions:b=[]}=v,C=Up(w),k=Up(b),N=LS(c),V=g(function(){return u++,m.apply(null,arguments)},...C),T=S(function(){d++;const M=AS(N,arguments);return p=V.apply(null,M),p},...k);return Object.assign(T,{resultFunc:m,memoizedResultFunc:V,dependencies:N,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:g,argsMemoize:S})};return Object.assign(l,{withTypes:()=>l}),l}var WS=vh(gh),KS=Object.assign((n,o=WS)=>{jS(n,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof n}`);const i=Object.keys(n),l=i.map(u=>n[u]);return o(l,(...u)=>u.reduce((d,p,h)=>(d[i[h]]=p,d),{}))},{withTypes:()=>KS});vh({memoize:US,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ae=(n,o,i,l,c,u,...d)=>{if(d.length>0)throw new Error(Nn(1));let p;if(n)p=n;else throw new Error("Missing arguments");return p};var Au={exports:{}},zu={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Bp;function YS(){if(Bp)return zu;Bp=1;var n=Ii();function o(g,w){return g===w&&(g!==0||1/g===1/w)||g!==g&&w!==w}var i=typeof Object.is=="function"?Object.is:o,l=n.useState,c=n.useEffect,u=n.useLayoutEffect,d=n.useDebugValue;function p(g,w){var S=w(),b=l({inst:{value:S,getSnapshot:w}}),C=b[0].inst,k=b[1];return u(function(){C.value=S,C.getSnapshot=w,h(C)&&k({inst:C})},[g,S,w]),c(function(){return h(C)&&k({inst:C}),g(function(){h(C)&&k({inst:C})})},[g]),d(S),S}function h(g){var w=g.getSnapshot;g=g.value;try{var S=w();return!i(g,S)}catch{return!0}}function m(g,w){return w()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:p;return zu.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,zu}var Hp;function yh(){return Hp||(Hp=1,Au.exports=YS()),Au.exports}var xh=yh(),Du={exports:{}},Fu={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wp;function GS(){if(Wp)return Fu;Wp=1;var n=Ii(),o=yh();function i(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var l=typeof Object.is=="function"?Object.is:i,c=o.useSyncExternalStore,u=n.useRef,d=n.useEffect,p=n.useMemo,h=n.useDebugValue;return Fu.useSyncExternalStoreWithSelector=function(m,v,g,w,S){var b=u(null);if(b.current===null){var C={hasValue:!1,value:null};b.current=C}else C=b.current;b=p(function(){function N(D){if(!V){if(V=!0,T=D,D=w(D),S!==void 0&&C.hasValue){var W=C.value;if(S(W,D))return j=W}return j=D}if(W=j,l(T,D))return W;var A=w(D);return S!==void 0&&S(W,A)?(T=D,W):(T=D,j=A)}var V=!1,T,j,M=g===void 0?null:g;return[function(){return N(v())},M===null?void 0:function(){return N(M())}]},[v,g,w,S]);var k=c(m,b[0],b[1]);return d(function(){C.hasValue=!0,C.value=k},[k]),h(k),k},Fu}var Kp;function QS(){return Kp||(Kp=1,Du.exports=GS()),Du.exports}var XS=QS();const qS=ym(19),ZS=qS?e1:t1;function wh(n,o,i,l,c){return ZS(n,o,i,l,c)}function JS(n,o,i,l,c){const u=E.useCallback(()=>o(n.getSnapshot(),i,l,c),[n,o,i,l,c]);return xh.useSyncExternalStore(n.subscribe,u,u)}Ew({before(n){n.syncIndex=0,n.didInitialize||(n.syncTick=1,n.syncHooks=[],n.didChangeStore=!0,n.getSnapshot=()=>{let o=!1;for(let i=0;i0&&(n.didChangeStore&&(n.didChangeStore=!1,n.subscribe=o=>{const i=new Set;for(const c of n.syncHooks)i.add(c.store);const l=[];for(const c of i)l.push(c.subscribe(o));return()=>{for(const c of l)c()}}),xh.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot))}});function e1(n,o,i,l,c){const u=bw();if(!u)return JS(n,o,i,l,c);const d=u.syncIndex;u.syncIndex+=1;let p;return u.didInitialize?(p=u.syncHooks[d],(p.store!==n||p.selector!==o||!Object.is(p.a1,i)||!Object.is(p.a2,l)||!Object.is(p.a3,c))&&(p.store!==n&&(u.didChangeStore=!0),p.store=n,p.selector=o,p.a1=i,p.a2=l,p.a3=c,p.didChange=!0)):(p={store:n,selector:o,a1:i,a2:l,a3:c,value:o(n.getSnapshot(),i,l,c),didChange:!1},u.syncHooks.push(p)),p.value}function t1(n,o,i,l,c){return XS.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,u=>o(u,i,l,c))}class n1{constructor(o){rt(this,"subscribe",o=>(this.listeners.add(o),()=>{this.listeners.delete(o)}));rt(this,"getSnapshot",()=>this.state);this.state=o,this.listeners=new Set,this.updateTick=0}setState(o){if(this.state===o)return;this.state=o,this.updateTick+=1;const i=this.updateTick;for(const l of this.listeners){if(i!==this.updateTick)return;l(o)}}update(o){for(const i in o)if(!Object.is(this.state[i],o[i])){this.setState({...this.state,...o});return}}set(o,i){Object.is(this.state[o],i)||this.setState({...this.state,[o]:i})}notifyAll(){const o={...this.state};this.setState(o)}use(o,i,l,c){return wh(this,o,i,l,c)}}class Sh extends n1{constructor(o,i={},l){super(o),this.context=i,this.selectors=l}useSyncedValue(o,i){E.useDebugValue(o),ke(()=>{this.state[o]!==i&&this.set(o,i)},[o,i])}useSyncedValueWithCleanup(o,i){const l=this;ke(()=>(l.state[o]!==i&&l.set(o,i),()=>{l.set(o,void 0)}),[l,o,i])}useSyncedValues(o){const i=this,l=Object.values(o);ke(()=>{i.update(o)},[i,...l])}useControlledProp(o,i){E.useDebugValue(o);const l=i!==void 0;ke(()=>{l&&!Object.is(this.state[o],i)&&super.setState({...this.state,[o]:i})},[o,i,l])}select(o,i,l,c){const u=this.selectors[o];return u(this.state,i,l,c)}useState(o,i,l,c){return E.useDebugValue(o),wh(this,this.selectors[o],i,l,c)}useContextCallback(o,i){E.useDebugValue(o);const l=Ee(i??Ut);this.context[o]=l}useStateSetter(o){const i=E.useRef(void 0);return i.current===void 0&&(i.current=l=>{this.set(o,l)}),i.current}observe(o,i){let l;typeof o=="function"?l=o:l=this.selectors[o];let c=l(this.state);return i(c,c,this),this.subscribe(u=>{const d=l(u);if(!Object.is(c,d)){const p=c;c=d,i(d,p,this)}})}}const r1={open:Ae(n=>n.open),domReferenceElement:Ae(n=>n.domReferenceElement),referenceElement:Ae(n=>n.positionReference??n.referenceElement),floatingElement:Ae(n=>n.floatingElement),floatingId:Ae(n=>n.floatingId)};class vc extends Sh{constructor(i){const{nested:l,noEmit:c,onOpenChange:u,triggerElements:d,...p}=i;super({...p,positionReference:p.referenceElement,domReferenceElement:p.referenceElement},{onOpenChange:u,dataRef:{current:{}},events:Aw(),nested:l,noEmit:c,triggerElements:d},r1);rt(this,"setOpen",(i,l)=>{var c,u;if((!i||!this.state.open||Yx(l.event))&&(this.context.dataRef.current.openEvent=i?l.event:void 0),!this.context.noEmit){const d={open:i,reason:l.reason,nativeEvent:l.event,nested:this.context.nested,triggerElement:l.trigger};this.context.events.emit("openchange",d)}(u=(c=this.context).onOpenChange)==null||u.call(c,i,l)})}}function o1(n,o){const i=E.useRef(null),l=E.useRef(null);return E.useCallback(c=>{if(n!==void 0){if(i.current!==null){const u=i.current,d=l.current,p=o.context.triggerElements.getById(u);d&&p===d&&o.context.triggerElements.delete(u),i.current=null,l.current=null}c!==null&&(i.current=n,l.current=c,o.context.triggerElements.add(n,c))}},[o,n])}function i1(n,o,i,l){const c=i.useState("isMountedByTrigger",n),u=o1(n,i),d=Ee(p=>{if(u(p),!p||!i.select("open"))return;const h=i.select("activeTriggerId");if(h===n){i.update({activeTriggerElement:p,...l});return}h==null&&i.update({activeTriggerId:n,activeTriggerElement:p,...l})});return ke(()=>{c&&i.update({activeTriggerElement:o.current,...l})},[c,i,o,...Object.values(l)]),{registerTrigger:d,isMountedByThisTrigger:c}}function s1(n){const o=n.useState("open");ke(()=>{if(o&&!n.select("activeTriggerId")&&n.context.triggerElements.size===1){const i=n.context.triggerElements.entries().next();if(!i.done){const[l,c]=i.value;n.update({activeTriggerId:l,activeTriggerElement:c})}}},[o,n])}function l1(n,o,i){const{mounted:l,setMounted:c,transitionStatus:u}=Hm(n);o.useSyncedValues({mounted:l,transitionStatus:u});const d=Ee(()=>{var h,m;c(!1),o.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),(m=(h=o.context).onOpenChangeComplete)==null||m.call(h,!1)}),p=o.useState("preventUnmountingOnClose");return dc({enabled:!p,open:n,ref:o.context.popupRef,onComplete(){n||d()}}),{forceUnmount:d,transitionStatus:u}}class yc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(o,i){const l=this.idMap.get(o);l!==i&&(l!==void 0&&this.elementsSet.delete(l),this.elementsSet.add(i),this.idMap.set(o,i))}delete(o){const i=this.idMap.get(o);i&&(this.elementsSet.delete(i),this.idMap.delete(o))}hasElement(o){return this.elementsSet.has(o)}hasMatchingElement(o){for(const i of this.elementsSet)if(o(i))return!0;return!1}getById(o){return this.idMap.get(o)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function a1(){return new vc({open:!1,floatingElement:null,referenceElement:null,triggerElements:new yc,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function u1(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:a1(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:gt,inactiveTriggerProps:gt,popupProps:gt}}const el=Ae(n=>n.triggerIdProp??n.activeTriggerId),c1={open:Ae(n=>n.openProp??n.open),mounted:Ae(n=>n.mounted),transitionStatus:Ae(n=>n.transitionStatus),floatingRootContext:Ae(n=>n.floatingRootContext),preventUnmountingOnClose:Ae(n=>n.preventUnmountingOnClose),payload:Ae(n=>n.payload),activeTriggerId:el,activeTriggerElement:Ae(n=>n.mounted?n.activeTriggerElement:null),isTriggerActive:Ae((n,o)=>o!==void 0&&el(n)===o),isOpenedByTrigger:Ae((n,o)=>o!==void 0&&el(n)===o&&n.open),isMountedByTrigger:Ae((n,o)=>o!==void 0&&el(n)===o&&n.mounted),triggerProps:Ae((n,o)=>o?n.activeTriggerProps:n.inactiveTriggerProps),popupProps:Ae(n=>n.popupProps),popupElement:Ae(n=>n.popupElement),positionerElement:Ae(n=>n.positionerElement)};function f1(n){const{open:o=!1,onOpenChange:i,elements:l={}}=n,c=kl(),u=hc()!=null,d=Ot(()=>new vc({open:o,onOpenChange:i,referenceElement:l.reference??null,floatingElement:l.floating??null,triggerElements:new yc,floatingId:c,nested:u,noEmit:!1})).current;return ke(()=>{const p={open:o,floatingId:c};l.reference!==void 0&&(p.referenceElement=l.reference,p.domReferenceElement=je(l.reference)?l.reference:null),l.floating!==void 0&&(p.floatingElement=l.floating),d.update(p)},[o,c,l.reference,l.floating,d]),d.context.onOpenChange=i,d.context.nested=u,d.context.noEmit=!1,d}function d1(n={}){const{nodeId:o,externalTree:i}=n,l=f1(n),c=n.rootContext||l,u={reference:c.useState("referenceElement"),floating:c.useState("floatingElement"),domReference:c.useState("domReferenceElement")},[d,p]=E.useState(null),h=E.useRef(null),m=Il(i);ke(()=>{u.domReference&&(h.current=u.domReference)},[u.domReference]);const v=CS({...n,elements:{...u,...d&&{reference:d}}}),g=E.useCallback(W=>{const A=je(W)?{getBoundingClientRect:()=>W.getBoundingClientRect(),getClientRects:()=>W.getClientRects(),contextElement:W}:W;p(A),v.refs.setReference(A)},[v.refs]),[w,S]=E.useState(null),[b,C]=E.useState(null);c.useSyncedValue("referenceElement",w),c.useSyncedValue("domReferenceElement",je(w)?w:null),c.useSyncedValue("floatingElement",b);const k=E.useCallback(W=>{(je(W)||W===null)&&(h.current=W,S(W)),(je(v.refs.reference.current)||v.refs.reference.current===null||W!==null&&!je(W))&&v.refs.setReference(W)},[v.refs,S]),N=E.useCallback(W=>{C(W),v.refs.setFloating(W)},[v.refs]),V=E.useMemo(()=>({...v.refs,setReference:k,setFloating:N,setPositionReference:g,domReference:h}),[v.refs,k,N,g]),T=E.useMemo(()=>({...v.elements,domReference:u.domReference}),[v.elements,u.domReference]),j=c.useState("open"),M=c.useState("floatingId"),D=E.useMemo(()=>({...v,dataRef:c.context.dataRef,open:j,onOpenChange:c.setOpen,events:c.context.events,floatingId:M,refs:V,elements:T,nodeId:o,rootStore:c}),[v,V,T,o,c,j,M]);return ke(()=>{c.context.dataRef.current.floatingContext=D;const W=m==null?void 0:m.nodesRef.current.find(A=>A.id===o);W&&(W.context=D)}),E.useMemo(()=>({...v,context:D,refs:V,elements:T,rootStore:c}),[v,V,T,D,c])}function p1(n){const{popupStore:o,noEmit:i=!1,treatPopupAsFloatingElement:l=!1,onOpenChange:c}=n,u=kl(),d=hc()!=null,p=o.useState("open"),h=o.useState("activeTriggerElement"),m=o.useState(l?"popupElement":"positionerElement"),v=o.context.triggerElements,g=Ot(()=>new vc({open:p,referenceElement:h,floatingElement:m,triggerElements:v,onOpenChange:c,floatingId:u,nested:d,noEmit:i})).current;return ke(()=>{const w={open:p,floatingId:u,referenceElement:h,floatingElement:m};je(h)&&(w.domReferenceElement=h),g.state.positionReference===g.state.referenceElement&&(w.positionReference=h),g.update(w)},[p,u,h,m,g]),g.context.onOpenChange=c,g.context.nested=d,g.context.noEmit=i,g}const Vu=Lx&&Ix;function m1(n,o={}){const i="rootStore"in n?n.rootStore:n,{events:l,dataRef:c}=i.context,{enabled:u=!0,delay:d}=o,p=E.useRef(!1),h=E.useRef(null),m=Pi(),v=E.useRef(!0);E.useEffect(()=>{const w=i.select("domReferenceElement");if(!u)return;const S=vt(w);function b(){const N=i.select("domReferenceElement");!i.select("open")&&kt(N)&&N===Yu(Qn(N))&&(p.current=!0)}function C(){v.current=!0}function k(){v.current=!1}return S.addEventListener("blur",b),Vu&&(S.addEventListener("keydown",C,!0),S.addEventListener("pointerdown",k,!0)),()=>{S.removeEventListener("blur",b),Vu&&(S.removeEventListener("keydown",C,!0),S.removeEventListener("pointerdown",k,!0))}},[i,u]),E.useEffect(()=>{if(!u)return;function w(S){if(S.reason===Ni||S.reason===pc){const b=i.select("domReferenceElement");je(b)&&(h.current=b,p.current=!0)}}return l.on("openchange",w),()=>{l.off("openchange",w)}},[l,u,i]);const g=E.useMemo(()=>({onMouseLeave(){p.current=!1,h.current=null},onFocus(w){const S=w.currentTarget;if(p.current){if(h.current===S)return;p.current=!1,h.current=null}const b=Cn(w.nativeEvent);if(je(b)){if(Vu&&!w.relatedTarget){if(!v.current&&!Hx(b))return}else if(!Wx(b))return}const C=pl(w.relatedTarget,i.context.triggerElements),{nativeEvent:k,currentTarget:N}=w,V=typeof d=="function"?d():d;if(i.select("open")&&C||V===0||V===void 0){i.setOpen(!0,Qe(ll,k,N));return}m.start(V,()=>{p.current||i.setOpen(!0,Qe(ll,k,N))})},onBlur(w){p.current=!1,h.current=null;const S=w.relatedTarget,b=w.nativeEvent,C=je(S)&&S.hasAttribute(mc("focus-guard"))&&S.getAttribute("data-type")==="outside";m.start(0,()=>{var T;const k=i.select("domReferenceElement"),N=Yu(k?k.ownerDocument:document);!S&&N===k||wt((T=c.current.floatingContext)==null?void 0:T.refs.floating.current,N)||wt(k,N)||C||pl(S??N,i.context.triggerElements)||i.setOpen(!1,Qe(ll,b))})}}),[c,i,m,d]);return E.useMemo(()=>u?{reference:g,trigger:g}:{},[u,g])}const h1=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Vm}`;function g1(n){return n?!!n.closest(h1):!1}class xc{constructor(){rt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});rt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Yn,this.restTimeout=new Yn,this.handleCloseOptions=void 0}static create(){return new xc}}function wc(n){var o,i,l;n.performedPointerEventsMutation&&((o=n.pointerEventsScopeElement)==null||o.style.removeProperty("pointer-events"),(i=n.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(l=n.pointerEventsFloatingElement)==null||l.style.removeProperty("pointer-events"),n.performedPointerEventsMutation=!1,n.pointerEventsScopeElement=null,n.pointerEventsReferenceElement=null,n.pointerEventsFloatingElement=null)}function v1(n,o){const{scopeElement:i,referenceElement:l,floatingElement:c}=o;wc(n),n.performedPointerEventsMutation=!0,n.pointerEventsScopeElement=i,n.pointerEventsReferenceElement=l,n.pointerEventsFloatingElement=c,i.style.pointerEvents="none",l.style.pointerEvents="auto",c.style.pointerEvents="auto"}function kh(n){const o=Ot(xc.create).current,i=n.context.dataRef.current;return i.hoverInteractionState||(i.hoverInteractionState=o),El(i.hoverInteractionState.disposeEffect),i.hoverInteractionState}function y1(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),c=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,{enabled:p=!0,closeDelay:h=0}=o,m=kh(i),v=Il(),g=hc(),w=Ee(()=>{var T;return sh((T=d.current.openEvent)==null?void 0:T.type,m.interactedInside)}),S=Ee(()=>{var j;const T=(j=d.current.openEvent)==null?void 0:j.type;return(T==null?void 0:T.includes("mouse"))&&T!=="mousedown"}),b=Ee(T=>pl(T,i.context.triggerElements)),C=E.useCallback(T=>{const j=bi(h,"close",m.pointerType),M=()=>{i.setOpen(!1,Qe(_n,T)),v==null||v.events.emit("floating.closed",T)};j?m.openChangeTimeout.start(j,M):(m.openChangeTimeout.clear(),M())},[h,i,m,v]),k=Ee(()=>{wc(m)}),N=Ee(T=>{const j=Cn(T);if(!g1(j)){m.interactedInside=!1;return}m.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null});ke(()=>{l||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,k())},[l,m,k]),E.useEffect(()=>k,[k]),ke(()=>{var T,j,M,D,W;if(p&&l&&(T=m.handleCloseOptions)!=null&&T.blockPointerEvents&&S()&&je(u)&&c){const A=u,U=c,ne=Qn(c),te=(M=(j=v==null?void 0:v.nodesRef.current.find(K=>K.id===g))==null?void 0:j.context)==null?void 0:M.elements.floating;te&&(te.style.pointerEvents="");const L=((W=(D=m.handleCloseOptions)==null?void 0:D.getScope)==null?void 0:W.call(D))??m.pointerEventsScopeElement??te??A.closest("[data-rootownerid]")??ne.body;return v1(m,{scopeElement:L,referenceElement:A,floatingElement:U}),()=>{k()}}},[p,l,u,c,m,S,v,g,k]);const V=Pi();E.useEffect(()=>{if(!p)return;function T(){m.openChangeTimeout.clear(),V.clear(),v==null||v.events.off("floating.closed",M),k()}function j(W){if(v&&g&&Wr(v.nodesRef.current,g).length>0){v.events.on("floating.closed",M);return}if(!b(W.relatedTarget)){if(m.handler){m.handler(W);return}k(),w()||C(W)}}function M(W){!v||!g||Wr(v.nodesRef.current,g).length>0||V.start(0,()=>{v.events.off("floating.closed",M),i.setOpen(!1,Qe(_n,W)),v.events.emit("floating.closed",W)})}const D=c;return D&&(D.addEventListener("mouseenter",T),D.addEventListener("mouseleave",j),D.addEventListener("pointerdown",N,!0)),()=>{D&&(D.removeEventListener("mouseenter",T),D.removeEventListener("mouseleave",j),D.removeEventListener("pointerdown",N,!0)),v==null||v.events.off("floating.closed",M)}},[p,c,i,d,w,b,C,k,N,m,v,g,V])}const x1={current:null};function w1(n,o={}){var te;const i="rootStore"in n?n.rootStore:n,{dataRef:l,events:c}=i.context,{enabled:u=!0,delay:d=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:v=!0,triggerElementRef:g=x1,externalTree:w,isActiveTrigger:S=!0,getHandleCloseContext:b}=o,C=Il(w),k=kh(i),N=Hr(p),V=Hr(d),T=Hr(m),j=Hr(u);S&&(k.handleCloseOptions=(te=N.current)==null?void 0:te.__options);const M=Ee(()=>{var L;return sh((L=l.current.openEvent)==null?void 0:L.type,k.interactedInside)}),D=Ee(L=>pl(L,i.context.triggerElements)),W=Ee((L,K,G)=>{const z=i.context.triggerElements;if(z.hasElement(K))return!L||!wt(L,K);if(!je(G))return!1;const X=G;return z.hasMatchingElement(Q=>wt(Q,X))&&(!L||!wt(L,X))}),A=E.useCallback((L,K=!0)=>{const G=bi(V.current,"close",k.pointerType);G?k.openChangeTimeout.start(G,()=>{i.setOpen(!1,Qe(_n,L)),C==null||C.events.emit("floating.closed",L)}):K&&(k.openChangeTimeout.clear(),i.setOpen(!1,Qe(_n,L)),C==null||C.events.emit("floating.closed",L))},[V,i,k,C]),U=Ee(()=>{if(!k.handler)return;Qn(i.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0});E.useEffect(()=>U,[U]);const ne=Ee(()=>{wc(k)});return E.useEffect(()=>{if(!u)return;function L(K){K.open||(U(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return c.on("openchange",L),()=>{c.off("openchange",L)}},[u,c,k,U]),E.useEffect(()=>{if(!u)return;const L=g.current??(S?i.select("domReferenceElement"):null);if(!je(L))return;function K(z){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,h&&!ml(k.pointerType)||Mp(T.current)>0&&!bi(V.current,"open"))return;const Q=bi(V.current,"open",k.pointerType),I=z.currentTarget??null,q=i.select("domReferenceElement"),B=I==null?!1:W(q,I,z.target),R=i.select("open"),Y=!R||B;B&&R?i.setOpen(!0,Qe(_n,z,I)):Q?k.openChangeTimeout.start(Q,()=>{Y&&i.setOpen(!0,Qe(_n,z,I))}):Y&&i.setOpen(!0,Qe(_n,z,I))}function G(z){if(M()){ne();return}U();const X=i.select("domReferenceElement"),Q=Qn(X);k.restTimeout.clear(),k.restTimeoutPending=!1;const I=l.current.floatingContext??(b==null?void 0:b());if(D(z.relatedTarget))return;if(N.current&&I){i.select("open")||k.openChangeTimeout.clear();const R=g.current;k.handler=N.current({...I,tree:C,x:z.clientX,y:z.clientY,onClose(){ne(),U(),j.current&&!M()&&R===i.select("domReferenceElement")&&A(z,!0)}}),Q.addEventListener("mousemove",k.handler),k.handler(z);return}(k.pointerType==="touch"?!wt(i.select("floatingElement"),z.relatedTarget):!0)&&A(z)}return v&&L.addEventListener("mousemove",K,{once:!0}),L.addEventListener("mouseenter",K),L.addEventListener("mouseleave",G),()=>{v&&L.removeEventListener("mousemove",K),L.removeEventListener("mouseenter",K),L.removeEventListener("mouseleave",G)}},[U,ne,l,V,A,i,u,N,k,S,W,M,D,h,v,T,g,C,j,b]),E.useMemo(()=>{if(!u)return;function L(K){k.pointerType=K.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(K){const{nativeEvent:G}=K,z=K.currentTarget,X=i.select("domReferenceElement"),Q=i.select("open"),I=W(X,z,K.target);if(h&&!ml(k.pointerType))return;const q=Mp(T.current);if(Q&&!I||q===0||!I&&k.restTimeoutPending&&K.movementX**2+K.movementY**2<2)return;k.restTimeout.clear();function B(){if(k.restTimeoutPending=!1,M())return;const R=i.select("open");!k.blockMouseMove&&(!R||I)&&i.setOpen(!0,Qe(_n,G,z))}k.pointerType==="touch"?Zr.flushSync(()=>{B()}):I&&Q?B():(k.restTimeoutPending=!0,k.restTimeout.start(q,B))}}},[u,k,M,W,h,i,T])}function S1(n=[]){const o=n.map(m=>m==null?void 0:m.reference),i=n.map(m=>m==null?void 0:m.floating),l=n.map(m=>m==null?void 0:m.item),c=n.map(m=>m==null?void 0:m.trigger),u=E.useCallback(m=>tl(m,n,"reference"),o),d=E.useCallback(m=>tl(m,n,"floating"),i),p=E.useCallback(m=>tl(m,n,"item"),l),h=E.useCallback(m=>tl(m,n,"trigger"),c);return E.useMemo(()=>({getReferenceProps:u,getFloatingProps:d,getItemProps:p,getTriggerProps:h}),[u,d,p,h])}function tl(n,o,i){var d;const l=new Map,c=i==="item",u={};i==="floating"&&(u.tabIndex=-1,u[Vx]="");for(const p in n)c&&n&&(p===Dm||p===Fm)||(u[p]=n[p]);for(let p=0;p{var h;return(h=l.get(u))==null?void 0:h.map(m=>m(...p)).find(m=>m!==void 0)})):n[u]=d)}}const Gp=.1,k1=Gp*Gp,ze=.5;function nl(n,o,i,l,c,u){return l>=o!=u>=o&&n<=(c-i)*(o-l)/(u-l)+i}function rl(n,o,i,l,c,u,d,p,h,m){let v=!1;return nl(n,o,i,l,c,u)&&(v=!v),nl(n,o,c,u,d,p)&&(v=!v),nl(n,o,d,p,h,m)&&(v=!v),nl(n,o,h,m,i,l)&&(v=!v),v}function b1(n,o,i){return n>=i.x&&n<=i.x+i.width&&o>=i.y&&o<=i.y+i.height}function ol(n,o,i,l,c,u){const d=Math.min(i,c),p=Math.max(i,c),h=Math.min(l,u),m=Math.max(l,u);return n>=d&&n<=p&&o>=h&&o<=m}function E1(n={}){const{blockPointerEvents:o=!1}=n,i=new Yn,l=({x:c,y:u,placement:d,elements:p,onClose:h,nodeId:m,tree:v})=>{const g=d==null?void 0:d.split("-")[0];let w=!1,S=null,b=null,C=typeof performance<"u"?performance.now():0;function k(V,T){const j=performance.now(),M=j-C;if(S===null||b===null||M===0)return S=V,b=T,C=j,!1;const D=V-S,W=T-b,A=D*D+W*W,U=M*M*k1;return S=V,b=T,C=j,A0)}function K(){L()||N()}if(L())return;const G=j.getBoundingClientRect(),z=M.getBoundingClientRect(),X=c>z.right-z.width/2,Q=u>z.bottom-z.height/2,I=z.width>G.width,q=z.height>G.height,B=(I?G:z).left,R=(I?G:z).right,Y=(q?G:z).top,ue=(q?G:z).bottom;if(g==="top"&&u>=G.bottom-1||g==="bottom"&&u<=G.top+1||g==="left"&&c>=G.right-1||g==="right"&&c<=G.left+1){K();return}let ce=!1;switch(g){case"top":ce=ol(D,W,B,G.top+1,R,z.bottom-1);break;case"bottom":ce=ol(D,W,B,z.top+1,R,G.bottom-1);break;case"left":ce=ol(D,W,z.right-1,ue,G.left+1,Y);break;case"right":ce=ol(D,W,G.right-1,ue,z.left+1,Y);break}if(ce)return;if(w&&!b1(D,W,G)){K();return}if(!U&&k(D,W)){K();return}let le=!1;switch(g){case"top":{const oe=I?ze/2:ze*4,he=I||X?c+oe:c-oe,xe=I?c-oe:X?c+oe:c-oe,de=u+ze+1,Te=X||I?z.bottom-ze:z.top,Ke=X?I?z.bottom-ze:z.top:z.bottom-ze;le=rl(D,W,he,de,xe,de,z.left,Te,z.right,Ke);break}case"bottom":{const oe=I?ze/2:ze*4,he=I||X?c+oe:c-oe,xe=I?c-oe:X?c+oe:c-oe,de=u-ze,Te=X||I?z.top+ze:z.bottom,Ke=X?I?z.top+ze:z.bottom:z.top+ze;le=rl(D,W,he,de,xe,de,z.left,Te,z.right,Ke);break}case"left":{const oe=q?ze/2:ze*4,he=q||Q?u+oe:u-oe,xe=q?u-oe:Q?u+oe:u-oe,de=c+ze+1,Te=Q||q?z.right-ze:z.left,Ke=Q?q?z.right-ze:z.left:z.right-ze;le=rl(D,W,Te,z.top,Ke,z.bottom,de,he,de,xe);break}case"right":{const oe=q?ze/2:ze*4,he=q||Q?u+oe:u-oe,xe=q?u-oe:Q?u+oe:u-oe,de=c-ze,Te=Q||q?z.left+ze:z.right,Ke=Q?q?z.left+ze:z.right:z.left+ze;le=rl(D,W,de,he,de,xe,Te,z.top,Ke,z.bottom);break}}le?w||i.start(40,K):K()}};return l.__options={blockPointerEvents:o},l}const C1={...c1,disabled:Ae(n=>n.disabled),instantType:Ae(n=>n.instantType),isInstantPhase:Ae(n=>n.isInstantPhase),trackCursorAxis:Ae(n=>n.trackCursorAxis),disableHoverablePopup:Ae(n=>n.disableHoverablePopup),lastOpenChangeReason:Ae(n=>n.openChangeReason),closeOnClick:Ae(n=>n.closeOnClick),closeDelay:Ae(n=>n.closeDelay),hasViewport:Ae(n=>n.hasViewport)};class Sc extends Sh{constructor(i){super({..._1(),...i},{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new yc},C1);rt(this,"setOpen",(i,l)=>{var m,v;const c=l.reason,u=c===_n,d=i&&c===ll,p=!i&&(c===Ni||c===pc);if(l.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(v=(m=this.context).onOpenChange)==null||v.call(m,i,l),l.isCanceled)return;const h=()=>{var S;const g={open:i,openChangeReason:c};d?g.instantType="focus":p?g.instantType="dismiss":c===_n&&(g.instantType=void 0);const w=((S=l.trigger)==null?void 0:S.id)??null;(w||i)&&(g.activeTriggerId=w,g.activeTriggerElement=l.trigger??null),this.update(g)};u?Zr.flushSync(h):h()})}static useStore(i,l){const c=Ot(()=>new Sc(l)).current,u=i??c,d=p1({popupStore:u,onOpenChange:u.setOpen});return u.state.floatingRootContext=d,u}}function _1(){return{...u1(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const R1=oh(function(o){const{disabled:i=!1,defaultOpen:l=!1,open:c,disableHoverablePopup:u=!1,trackCursorAxis:d="none",actionsRef:p,onOpenChange:h,onOpenChangeComplete:m,handle:v,triggerId:g,defaultTriggerId:w=null,children:S}=o,b=Sc.useStore(v==null?void 0:v.store,{open:l,openProp:c,activeTriggerId:w,triggerIdProp:g});Rw(()=>{c===void 0&&b.state.open===!1&&l===!0&&b.update({open:!0,activeTriggerId:w})}),b.useControlledProp("openProp",c),b.useControlledProp("triggerIdProp",g),b.useContextCallback("onOpenChange",h),b.useContextCallback("onOpenChangeComplete",m);const C=b.useState("open"),k=!i&&C,N=b.useState("activeTriggerId"),V=b.useState("payload");b.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:u}),ke(()=>{C&&i&&b.setOpen(!1,Qe(y0))},[C,i,b]),b.useSyncedValue("disabled",i),s1(b);const{forceUnmount:T,transitionStatus:j}=l1(k,b),M=b.useState("isInstantPhase"),D=b.useState("instantType"),W=b.useState("lastOpenChangeReason"),A=E.useRef(null);ke(()=>{j==="ending"&&W===zi||j!=="ending"&&M?(D!=="delay"&&(A.current=D),b.set("instantType","delay")):A.current!==null&&(b.set("instantType",A.current),A.current=null)},[j,M,W,D,b]),ke(()=>{k&&N==null&&b.set("payload",void 0)},[b,N,k]);const U=E.useCallback(()=>{b.setOpen(!1,P1(b,x0))},[b]);E.useImperativeHandle(p,()=>({unmount:T,close:U}),[T,U]);const ne=b.useState("floatingRootContext"),te=Hw(ne,{enabled:!i,referencePress:()=>b.select("closeOnClick")}),L=Vw(ne,{enabled:!i&&d!=="none",axis:d==="none"?void 0:d}),{getReferenceProps:K,getFloatingProps:G,getTriggerProps:z}=S1([te,L]),X=E.useMemo(()=>K(),[K]),Q=E.useMemo(()=>z(),[z]),I=E.useMemo(()=>G(),[G]);return b.useSyncedValues({activeTriggerProps:X,inactiveTriggerProps:Q,popupProps:I}),x.jsx(ih.Provider,{value:b,children:typeof S=="function"?S({payload:V}):S})});function P1(n,o){const i=Qe(o);return i.preventUnmountOnClose=()=>{n.set("preventUnmountingOnClose",!0)},i}let kc=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=Yr.startingStyle]="startingStyle",n[n.endingStyle=Yr.endingStyle]="endingStyle",n.anchorHidden="data-anchor-hidden",n.side="data-side",n.align="data-align",n})({}),bh=(function(n){return n.popupOpen="data-popup-open",n.pressed="data-pressed",n})({});const T1={[bh.popupOpen]:""},N1={[kc.open]:""},M1={[kc.closed]:""},O1={[kc.anchorHidden]:""},j1={open(n){return n?T1:null}},bc={open(n){return n?N1:M1},anchorHidden(n){return n?O1:null}},Eh=E.createContext(void 0);function I1(){return E.useContext(Eh)}let L1=(function(n){return n[n.popupOpen=bh.popupOpen]="popupOpen",n.triggerDisabled="data-trigger-disabled",n})({});const A1=600,z1=Cw(function(o,i){const{className:l,render:c,handle:u,payload:d,disabled:p,delay:h,closeOnClick:m=!0,closeDelay:v,id:g,...w}=o,S=Di(!0),b=(u==null?void 0:u.store)??S;if(!b)throw new Error(Nn(82));const C=bl(g),k=b.useState("isTriggerActive",C),N=b.useState("isOpenedByTrigger",C),V=b.useState("floatingRootContext"),T=E.useRef(null),j=h??A1,M=v??0,{registerTrigger:D,isMountedByThisTrigger:W}=i1(C,T,b,{payload:d,closeOnClick:m,closeDelay:M}),A=I1(),{delayRef:U,isInstantPhase:ne,hasProvider:te}=Nw(V,{open:N});b.useSyncedValue("isInstantPhase",ne);const L=b.useState("disabled"),K=p??L,G=b.useState("trackCursorAxis"),z=b.useState("disableHoverablePopup"),X=w1(V,{enabled:!K,mouseOnly:!0,move:!1,handleClose:!z&&G!=="both"?E1():null,restMs(){const R=A==null?void 0:A.delay,Y=typeof U.current=="object"?U.current.open:void 0;let ue=j;return te&&(Y!==0?ue=h??R??j:ue=0),ue},delay(){const R=typeof U.current=="object"?U.current.close:void 0;let Y=M;return v==null&&te&&(Y=R),{close:Y}},triggerElementRef:T,isActiveTrigger:k}),Q=m1(V,{enabled:!K}).reference,I={open:N},q=b.useState("triggerProps",W);return St("button",o,{state:I,ref:[i,D,T],props:[X,Q,q,{onPointerDown(){b.set("closeOnClick",m)},id:C,[L1.triggerDisabled]:K?"":void 0},w],stateAttributesMapping:j1})}),Ch=E.createContext(void 0);function D1(){const n=E.useContext(Ch);if(n===void 0)throw new Error(Nn(70));return n}const F1=E.forwardRef(function(o,i){const{children:l,container:c,className:u,render:d,...p}=o,{portalNode:h,portalSubtree:m}=Lw({container:c,ref:i,componentProps:o,elementProps:p});return!m&&!h?null:x.jsxs(E.Fragment,{children:[m,h&&Zr.createPortal(l,h)]})}),V1=E.forwardRef(function(o,i){const{keepMounted:l=!1,...c}=o;return Di().useState("mounted")||l?x.jsx(Ch.Provider,{value:l,children:x.jsx(F1,{ref:i,...c})}):null}),_h=E.createContext(void 0);function Rh(){const n=E.useContext(_h);if(n===void 0)throw new Error(Nn(71));return n}const U1=E.createContext(void 0);function Ph(){const n=E.useContext(U1);return(n==null?void 0:n.direction)??"ltr"}const $1=n=>({name:"arrow",options:n,async fn(o){var q,B;const{x:i,y:l,placement:c,rects:u,platform:d,elements:p,middlewareData:h}=o,{element:m,padding:v=0,offsetParent:g="real"}=Xn(n,o)||{};if(m==null)return{};const w=Um(v),S={x:i,y:l},b=cc(c),C=uc(b),k=await d.getDimensions(m),N=b==="y",V=N?"top":"left",T=N?"bottom":"right",j=N?"clientHeight":"clientWidth",M=u.reference[C]+u.reference[b]-S[b]-u.floating[C],D=S[b]-u.reference[b],W=g==="real"?await((q=d.getOffsetParent)==null?void 0:q.call(d,m)):p.floating;let A=p.floating[j]||u.floating[C];(!A||!await((B=d.isElement)==null?void 0:B.call(d,W)))&&(A=p.floating[j]||u.floating[C]);const U=M/2-D/2,ne=A/2-k[C]/2-1,te=Math.min(w[V],ne),L=Math.min(w[T],ne),K=te,G=A-k[C]-L,z=A/2-k[C]/2+U,X=Gu(K,z,G),Q=!h.arrow&&br(c)!=null&&z!==X&&u.reference[C]/2-(z({...$1(n),options:[n,o]}),H1={name:"hide",async fn(n){var p;const{width:o,height:i,x:l,y:c}=n.rects.reference,u=o===0&&i===0&&l===0&&c===0;return{data:{referenceHidden:((p=(await MS().fn(n)).data)==null?void 0:p.referenceHidden)||u}}}},ul={sideX:"left",sideY:"top"},W1={name:"adaptiveOrigin",async fn(n){var V,T;const{x:o,y:i,rects:{floating:l},elements:{floating:c},platform:u,strategy:d,placement:p}=n,h=vt(c),m=h.getComputedStyle(c);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:o,y:i,data:ul};const g=await((V=u.getOffsetParent)==null?void 0:V.call(u,c));let w={width:0,height:0};if(d==="fixed"&&(h!=null&&h.visualViewport))w={width:h.visualViewport.width,height:h.visualViewport.height};else if(g===h){const j=Qn(c);w={width:j.documentElement.clientWidth,height:j.documentElement.clientHeight}}else await((T=u.isElement)==null?void 0:T.call(u,g))&&(w=await u.getDimensions(g));const S=Mt(p);let b=o,C=i;S==="left"&&(b=w.width-(o+l.width)),S==="top"&&(C=w.height-(i+l.height));const k=S==="left"?"right":ul.sideX,N=S==="top"?"bottom":ul.sideY;return{x:b,y:C,data:{sideX:k,sideY:N}}}};function Th(n,o,i){const l=n==="inline-start"||n==="inline-end";return{top:"top",right:l?i?"inline-start":"inline-end":"right",bottom:"bottom",left:l?i?"inline-end":"inline-start":"left"}[o]}function Qp(n,o,i){const{rects:l,placement:c}=n;return{side:Th(o,Mt(c),i),align:br(c)||"center",anchor:{width:l.reference.width,height:l.reference.height},positioner:{width:l.floating.width,height:l.floating.height}}}function K1(n){var Jn,er;const{anchor:o,positionMethod:i="absolute",side:l="bottom",sideOffset:c=0,align:u="center",alignOffset:d=0,collisionBoundary:p,collisionPadding:h=5,sticky:m=!1,arrowPadding:v=5,disableAnchorTracking:g=!1,keepMounted:w=!1,floatingRootContext:S,mounted:b,collisionAvoidance:C,shiftCrossAxis:k=!1,nodeId:N,adaptiveOrigin:V,lazyFlip:T=!1,externalTree:j}=n,[M,D]=E.useState(null);!b&&M!==null&&D(null);const W=C.side||"flip",A=C.align||"flip",U=C.fallbackAxisSide||"end",ne=typeof o=="function"?o:void 0,te=Ee(ne),L=ne?te:o,K=Hr(o),z=Ph()==="rtl",X=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":z?"left":"right","inline-start":z?"right":"left"}[l],Q=u==="center"?X:`${X}-${u}`;let I=h;const q=1,B=l==="bottom"?q:0,R=l==="top"?q:0,Y=l==="right"?q:0,ue=l==="left"?q:0;typeof I=="number"?I={top:I+B,right:I+ue,bottom:I+R,left:I+Y}:I&&(I={top:(I.top||0)+B,right:(I.right||0)+ue,bottom:(I.bottom||0)+R,left:(I.left||0)+Y});const ce={boundary:p==="clipping-ancestors"?"clippingAncestors":p,padding:I},le=E.useRef(null),oe=Hr(c),he=Hr(d),Te=[_S(Me=>{const Ye=Qp(Me,l,z),ut=typeof oe.current=="function"?oe.current(Ye):oe.current,et=typeof he.current=="function"?he.current(Ye):he.current;return{mainAxis:ut,crossAxis:et,alignmentAxis:et}},[typeof c!="function"?c:0,typeof d!="function"?d:0,z,l])],Ke=A==="none"&&W!=="shift",Bt=!Ke&&(m||k||W==="shift"),bt=W==="none"?null:TS({...ce,padding:{top:I.top+q,right:I.right+q,bottom:I.bottom+q,left:I.left+q},mainAxis:!k&&W==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:U}),it=Ke?null:RS(Me=>{const Ye=Qn(Me.elements.floating).documentElement;return{...ce,rootBoundary:k?{x:0,y:0,width:Ye.clientWidth,height:Ye.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:Bt,limiter:m||k?void 0:PS(ut=>{if(!le.current)return{};const{width:et,height:Kt}=le.current.getBoundingClientRect(),Et=en(Mt(ut.placement)),vn=Et==="y"?et:Kt,jn=Et==="y"?I.left+I.right:I.top+I.bottom;return{offset:vn/2+jn/2}})}},[ce,m,k,I,A]);W==="shift"||A==="shift"||u==="center"?Te.push(it,bt):Te.push(bt,it),Te.push(NS({...ce,apply({elements:{floating:Me},availableWidth:Ye,availableHeight:ut,rects:et}){const Kt=Me.style;Kt.setProperty("--available-width",`${Ye}px`),Kt.setProperty("--available-height",`${ut}px`);const Et=window.devicePixelRatio||1,{x:vn,y:jn,width:sn,height:Rr}=et.reference,eo=(Math.round((vn+sn)*Et)-Math.round(vn*Et))/Et,In=(Math.round((jn+Rr)*Et)-Math.round(jn*Et))/Et;Kt.setProperty("--anchor-width",`${eo}px`),Kt.setProperty("--anchor-height",`${In}px`)}}),B1(()=>({element:le.current||document.createElement("div"),padding:v,offsetParent:"floating"}),[v]),{name:"transformOrigin",fn(Me){var Vi,xn,Ao;const{elements:Ye,middlewareData:ut,placement:et,rects:Kt,y:Et}=Me,vn=Mt(et),jn=en(vn),sn=le.current,Rr=((Vi=ut.arrow)==null?void 0:Vi.x)||0,eo=((xn=ut.arrow)==null?void 0:xn.y)||0,In=(sn==null?void 0:sn.clientWidth)||0,Io=(sn==null?void 0:sn.clientHeight)||0,Ln=Rr+In/2,Fi=eo+Io/2,Pr=Math.abs(((Ao=ut.shift)==null?void 0:Ao.y)||0),to=Kt.reference.height/2,yn=typeof c=="function"?c(Qp(Me,l,z)):c,Lo=Pr>yn,Dl={top:`${Ln}px calc(100% + ${yn}px)`,bottom:`${Ln}px ${-yn}px`,left:`calc(100% + ${yn}px) ${Fi}px`,right:`${-yn}px ${Fi}px`}[vn],Fl=`${Ln}px ${Kt.reference.y+to-Et}px`;return Ye.floating.style.setProperty("--transform-origin",Bt&&jn==="y"&&Lo?Fl:Dl),{}}},H1,V),ke(()=>{!b&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[b,S]);const jt=E.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:tn,elements:Ht,x:Cr,y:On,middlewareData:Re,update:ie,placement:se,context:Ie,isPositioned:Fe,floatingStyles:It}=d1({rootContext:S,placement:Q,middleware:Te,strategy:i,whileElementsMounted:w?void 0:(...Me)=>Fp(...Me,jt),nodeId:N,externalTree:j}),{sideX:nn,sideY:Wt}=Re.adaptiveOrigin||ul,gn=Fe?i:"fixed",qn=E.useMemo(()=>{const Me=V?{position:gn,[nn]:Cr,[Wt]:On}:{position:gn,...It};return Fe||(Me.opacity=0),Me},[V,gn,nn,Cr,Wt,On,It,Fe]),Lt=E.useRef(null);ke(()=>{if(!b)return;const Me=K.current,Ye=typeof Me=="function"?Me():Me,et=(Xp(Ye)?Ye.current:Ye)||null||null;et!==Lt.current&&(tn.setPositionReference(et),Lt.current=et)},[b,tn,L,K]),E.useEffect(()=>{if(!b)return;const Me=K.current;typeof Me!="function"&&Xp(Me)&&Me.current!==Lt.current&&(tn.setPositionReference(Me.current),Lt.current=Me.current)},[b,tn,L,K]),E.useEffect(()=>{if(w&&b&&Ht.domReference&&Ht.floating)return Fp(Ht.domReference,Ht.floating,ie,jt)},[w,b,Ht,ie,jt]);const Ve=Mt(se),rn=Th(l,Ve,z),on=br(se)||"center",_r=!!((Jn=Re.hide)!=null&&Jn.referenceHidden);ke(()=>{T&&b&&Fe&&D(Ve)},[T,b,Fe,Ve]);const Jr=E.useMemo(()=>{var Me,Ye;return{position:"absolute",top:(Me=Re.arrow)==null?void 0:Me.y,left:(Ye=Re.arrow)==null?void 0:Ye.x}},[Re.arrow]),Zn=((er=Re.arrow)==null?void 0:er.centerOffset)!==0;return E.useMemo(()=>({positionerStyles:qn,arrowStyles:Jr,arrowRef:le,arrowUncentered:Zn,side:rn,align:on,physicalSide:Ve,anchorHidden:_r,refs:tn,context:Ie,isPositioned:Fe,update:ie}),[qn,Jr,le,Zn,rn,on,Ve,_r,tn,Ie,Fe,ie])}function Xp(n){return n!=null&&"current"in n}function Nh(n){return n==="starting"?vy:gt}const Y1=E.forwardRef(function(o,i){const{render:l,className:c,anchor:u,positionMethod:d="absolute",side:p="top",align:h="center",sideOffset:m=0,alignOffset:v=0,collisionBoundary:g="clipping-ancestors",collisionPadding:w=5,arrowPadding:S=5,sticky:b=!1,disableAnchorTracking:C=!1,collisionAvoidance:k=yy,...N}=o,V=Di(),T=D1(),j=V.useState("open"),M=V.useState("mounted"),D=V.useState("trackCursorAxis"),W=V.useState("disableHoverablePopup"),A=V.useState("floatingRootContext"),U=V.useState("instantType"),ne=V.useState("transitionStatus"),te=V.useState("hasViewport"),L=K1({anchor:u,positionMethod:d,floatingRootContext:A,mounted:M,side:p,sideOffset:m,align:h,alignOffset:v,collisionBoundary:g,collisionPadding:w,sticky:b,arrowPadding:S,disableAnchorTracking:C,keepMounted:T,collisionAvoidance:k,adaptiveOrigin:te?W1:void 0}),K=E.useMemo(()=>{const Q={};return(!j||D==="both"||W)&&(Q.pointerEvents="none"),{role:"presentation",hidden:!M,style:{...L.positionerStyles,...Q}}},[j,D,W,M,L.positionerStyles]),G=E.useMemo(()=>({open:j,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:D!=="none"?"tracking-cursor":U}),[j,L.side,L.align,L.anchorHidden,D,U]),z=E.useMemo(()=>({...G,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[G,L.arrowRef,L.arrowStyles,L.arrowUncentered]),X=St("div",o,{state:G,props:[K,Nh(ne),N],ref:[i,V.useStateSetter("positionerElement")],stateAttributesMapping:bc});return x.jsx(_h.Provider,{value:z,children:X})}),G1={...bc,...fc},Q1=E.forwardRef(function(o,i){const{className:l,render:c,...u}=o,d=Di(),{side:p,align:h}=Rh(),m=d.useState("open"),v=d.useState("instantType"),g=d.useState("transitionStatus"),w=d.useState("popupProps"),S=d.useState("floatingRootContext");dc({open:m,ref:d.context.popupRef,onComplete(){var V,T;m&&((T=(V=d.context).onOpenChangeComplete)==null||T.call(V,!0))}});const b=d.useState("disabled"),C=d.useState("closeDelay");return y1(S,{enabled:!b,closeDelay:C}),St("div",o,{state:{open:m,side:p,align:h,instant:v,transitionStatus:g},ref:[i,d.context.popupRef,d.useStateSetter("popupElement")],props:[w,Nh(g),u],stateAttributesMapping:G1})}),X1=E.forwardRef(function(o,i){const{className:l,render:c,...u}=o,p=Di().useState("instantType"),{open:h,arrowRef:m,side:v,align:g,arrowUncentered:w,arrowStyles:S}=Rh();return St("div",o,{state:{open:h,side:v,align:g,uncentered:w,instant:p},ref:[i,m],props:[{style:S,"aria-hidden":!0},u],stateAttributesMapping:bc})}),q1=function(o){const{delay:i,closeDelay:l,timeout:c=400}=o,u=E.useMemo(()=>({delay:i,closeDelay:l}),[i,l]),d=E.useMemo(()=>({open:i,close:l}),[i,l]);return x.jsx(Eh.Provider,{value:u,children:x.jsx(Tw,{delay:d,timeoutMs:c,children:o.children})})};function Z1({delay:n=0,...o}){return x.jsx(q1,{"data-slot":"tooltip-provider",delay:n,...o})}function Mi({...n}){return x.jsx(R1,{"data-slot":"tooltip",...n})}function Oi({...n}){return x.jsx(z1,{"data-slot":"tooltip-trigger",...n})}function ji({className:n,side:o="top",sideOffset:i=4,align:l="center",alignOffset:c=0,children:u,...d}){return x.jsx(V1,{children:x.jsx(Y1,{align:l,alignOffset:c,side:o,sideOffset:i,className:"isolate z-50",children:x.jsxs(Q1,{"data-slot":"tooltip-content",className:Pe("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),...d,children:[u,x.jsx(X1,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Mh=E.createContext(void 0);function J1(n=!0){const o=E.useContext(Mh);if(o===void 0&&!n)throw new Error(Nn(7));return o}const Oh=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ek(){return E.useContext(Oh)}let tk=(function(n){return n[n.None=0]="None",n[n.GuessFromOrder=1]="GuessFromOrder",n})({});function nk(n={}){const{label:o,metadata:i,textRef:l,indexGuessBehavior:c,index:u}=n,{register:d,unregister:p,subscribeMapChange:h,elementsRef:m,labelsRef:v,nextIndexRef:g}=ek(),w=E.useRef(-1),[S,b]=E.useState(u??(c===tk.GuessFromOrder?()=>{if(w.current===-1){const N=g.current;g.current+=1,w.current=N}return w.current}:-1)),C=E.useRef(null),k=E.useCallback(N=>{var V;if(C.current=N,S!==-1&&N!==null&&(m.current[S]=N,v)){const T=o!==void 0;v.current[S]=T?o:((V=l==null?void 0:l.current)==null?void 0:V.textContent)??N.textContent}},[S,m,v,o,l]);return ke(()=>{if(u!=null)return;const N=C.current;if(N)return d(N,i),()=>{p(N)}},[u,d,p,i]),ke(()=>{if(u==null)return h(N=>{var T;const V=C.current?(T=N.get(C.current))==null?void 0:T.index:null;V!=null&&b(V)})},[u,h,b]),E.useMemo(()=>({ref:k,index:S}),[S,k])}function rk(n={}){const{highlightItemOnHover:o,highlightedIndex:i,onHighlightedIndexChange:l}=Jm(),{ref:c,index:u}=nk(n),d=i===u,p=E.useRef(null),h=Ri(c,p);return{compositeProps:E.useMemo(()=>({tabIndex:d?0:-1,onFocus(){l(u)},onMouseMove(){const v=p.current;if(!o||!v)return;const g=v.hasAttribute("disabled")||v.ariaDisabled==="true";!d&&!g&&v.focus()}}),[d,l,u,o]),compositeRef:h,index:u}}function ok(n){const{render:o,className:i,state:l=gt,props:c=cl,refs:u=cl,metadata:d,stateAttributesMapping:p,tag:h="div",...m}=n,{compositeProps:v,compositeRef:g}=rk({metadata:d});return St(h,n,{state:l,ref:[...u,g],props:[v,...c,m],stateAttributesMapping:p})}const ik=E.forwardRef(function(o,i){const{className:l,defaultPressed:c=!1,disabled:u=!1,form:d,onPressedChange:p,pressed:h,render:m,type:v,value:g,nativeButton:w=!0,...S}=o,b=bl(g||void 0),C=J1(),k=(C==null?void 0:C.value)??[],N=C?void 0:c,V=(u||(C==null?void 0:C.disabled))??!1,[T,j]=Tl({controlled:C?b!==void 0&&k.indexOf(b)>-1:h,default:N,name:"Toggle",state:"pressed"}),M=Ee((L,K)=>{var G;b&&((G=C==null?void 0:C.setGroupValue)==null||G.call(C,b,L,K)),p==null||p(L,K)}),{getButtonProps:D,buttonRef:W}=eh({disabled:V,native:w}),A={disabled:V,pressed:T},U=[W,i],ne=[{"aria-pressed":T,onClick(L){const K=!T,G=Qe(zi,L.nativeEvent);M(K,G),!G.isCanceled&&j(K)}},S,D],te=St("button",o,{enabled:!C,state:A,ref:U,props:ne});return C?x.jsx(ok,{tag:"button",render:m,className:l,state:A,refs:U,props:ne}):te});function sk(n){const{children:o,elementsRef:i,labelsRef:l,onMapChange:c}=n,u=Ee(c),d=E.useRef(0),p=Ot(ak).current,h=Ot(lk).current,[m,v]=E.useState(0),g=E.useRef(m),w=Ee((N,V)=>{h.set(N,V??null),g.current+=1,v(g.current)}),S=Ee(N=>{h.delete(N),g.current+=1,v(g.current)}),b=E.useMemo(()=>{const N=new Map;return Array.from(h.keys()).filter(T=>T.isConnected).sort(uk).forEach((T,j)=>{const M=h.get(T)??{};N.set(T,{...M,index:j})}),N},[h,m]);ke(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const N=new MutationObserver(V=>{const T=new Set,j=M=>T.has(M)?T.delete(M):T.add(M);V.forEach(M=>{M.removedNodes.forEach(j),M.addedNodes.forEach(j)}),T.size===0&&(g.current+=1,v(g.current))});return b.forEach((V,T)=>{T.parentElement&&N.observe(T.parentElement,{childList:!0})}),()=>{N.disconnect()}},[b]),ke(()=>{g.current===m&&(i.current.length!==b.size&&(i.current.length=b.size),l&&l.current.length!==b.size&&(l.current.length=b.size),d.current=b.size),u(b)},[u,b,i,l,m]),ke(()=>()=>{i.current=[]},[i]),ke(()=>()=>{l&&(l.current=[])},[l]);const C=Ee(N=>(p.add(N),()=>{p.delete(N)}));ke(()=>{p.forEach(N=>N(b))},[p,b]);const k=E.useMemo(()=>({register:w,unregister:S,subscribeMapChange:C,elementsRef:i,labelsRef:l,nextIndexRef:d}),[w,S,C,i,l,d]);return x.jsx(Oh.Provider,{value:k,children:o})}function lk(){return new Map}function ak(){return new Set}function uk(n,o){const i=n.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING||i&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ck(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}const Ei="ArrowUp",_o="ArrowDown",wl="ArrowLeft",Ci="ArrowRight",Al="Home",zl="End",jh=new Set([wl,Ci]),fk=new Set([wl,Ci,Al,zl]),Ih=new Set([Ei,_o]),dk=new Set([Ei,_o,Al,zl]),Lh=new Set([...jh,...Ih]),pk=new Set([...Lh,Al,zl]),mk="Shift",hk="Control",gk="Alt",vk="Meta",yk=new Set([mk,hk,gk,vk]);function xk(n){return kt(n)&&n.tagName==="INPUT"}function qp(n){return!!(xk(n)&&n.selectionStart!=null||kt(n)&&n.tagName==="TEXTAREA")}function Zp(n,o,i,l){if(!n||!o||!o.scrollTo)return;let c=n.scrollLeft,u=n.scrollTop;const d=n.clientWidthn.scrollLeft+n.clientWidth-m.scrollPaddingRight?c=h+o.offsetWidth+v.scrollMarginRight-n.clientWidth+m.scrollPaddingRight:h-v.scrollMarginLeftn.scrollLeft+n.clientWidth-m.scrollPaddingRight&&(c=h+o.offsetWidth+v.scrollMarginRight-n.clientWidth+m.scrollPaddingRight))}if(p&&l!=="horizontal"){const h=Jp(n,o,"top"),m=il(n),v=il(o);h-v.scrollMarginTopn.scrollTop+n.clientHeight-m.scrollPaddingBottom&&(u=h+o.offsetHeight+v.scrollMarginBottom-n.clientHeight+m.scrollPaddingBottom)}n.scrollTo({left:c,top:u,behavior:"auto"})}function Jp(n,o,i){const l=i==="left"?"offsetLeft":"offsetTop";let c=0;for(;o.offsetParent&&(c+=o[l],o.offsetParent!==n);)o=o.offsetParent;return c}function il(n){const o=getComputedStyle(n);return{scrollMarginTop:parseFloat(o.scrollMarginTop)||0,scrollMarginRight:parseFloat(o.scrollMarginRight)||0,scrollMarginBottom:parseFloat(o.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(o.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(o.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(o.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(o.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(o.scrollPaddingLeft)||0}}const wk="data-composite-item-active",Sk=[];function kk(n){const{itemSizes:o,cols:i=1,loopFocus:l=!0,dense:c=!1,orientation:u="both",direction:d,highlightedIndex:p,onHighlightedIndexChange:h,rootRef:m,enableHomeAndEndKeys:v=!1,stopEventPropagation:g=!1,disabledIndices:w,modifierKeys:S=Sk}=n,[b,C]=E.useState(0),k=i>1,N=E.useRef(null),V=Ri(N,m),T=E.useRef([]),j=E.useRef(!1),M=p??b,D=Ee((U,ne=!1)=>{if((h??C)(U),ne){const te=T.current[U];Zp(N.current,te,d,u)}}),W=Ee(U=>{if(U.size===0||j.current)return;j.current=!0;const ne=Array.from(U.keys()),te=ne.find(K=>K==null?void 0:K.hasAttribute(wk))??null,L=te?ne.indexOf(te):-1;L!==-1&&D(L),Zp(N.current,te,d,u)}),A=E.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:V,onFocus(U){!N.current||!qp(U.target)||U.target.setSelectionRange(0,U.target.value.length??0)},onKeyDown(U){const ne=v?pk:Lh;if(!ne.has(U.key)||bk(U,S)||!N.current)return;const L=d==="rtl",K=L?wl:Ci,G={horizontal:K,vertical:_o,both:K}[u],z=L?Ci:wl,X={horizontal:z,vertical:Ei,both:z}[u];if(qp(U.target)&&!ck(U.target)){const ue=U.target.selectionStart,ce=U.target.selectionEnd,le=U.target.value??"";if(ue==null||U.shiftKey||ue!==ce||U.key!==X&&ue0)return}let Q=M;const I=r0(T,w),q=o0(T,w);if(k){const ue=o||Array.from({length:T.current.length},()=>({width:1,height:1})),ce=s0(ue,i,c),le=ce.findIndex(he=>he!=null&&!Ro(T,he,w)),oe=ce.reduce((he,xe,de)=>xe!=null&&!Ro(T,xe,w)?de:he,-1);Q=ce[i0({current:ce.map(he=>he?T.current[he]:null)},{event:U,orientation:u,loopFocus:l,cols:i,disabledIndices:a0([...w||T.current.map((he,xe)=>Ro(T,xe)?xe:void 0),void 0],ce),minIndex:le,maxIndex:oe,prevIndex:l0(M>q?I:M,ue,ce,i,U.key===_o?"bl":U.key===Ci?"tr":"tl"),rtl:L})]}const B={horizontal:[K],vertical:[_o],both:[K,_o]}[u],R={horizontal:[z],vertical:[Ei],both:[z,Ei]}[u],Y=k?ne:{horizontal:v?fk:jh,vertical:v?dk:Ih,both:ne}[u];v&&(U.key===Al?Q=I:U.key===zl&&(Q=q)),Q===M&&(B.includes(U.key)||R.includes(U.key))&&(l&&Q===q&&B.includes(U.key)?Q=I:l&&Q===I&&R.includes(U.key)?Q=q:Q=Jt(T,{startingIndex:Q,decrement:R.includes(U.key),disabledIndices:w})),Q!==M&&!Xu(T,Q)&&(g&&U.stopPropagation(),Y.has(U.key)&&U.preventDefault(),D(Q,!0),queueMicrotask(()=>{var ue;(ue=T.current[Q])==null||ue.focus()}))}}),[i,c,d,w,T,v,M,k,o,l,V,S,D,u,g]);return E.useMemo(()=>({props:A,highlightedIndex:M,onHighlightedIndexChange:D,elementsRef:T,disabledIndices:w,onMapChange:W,relayKeyboardEvent:A.onKeyDown}),[A,M,D,T,w,W])}function bk(n,o){for(const i of yk.values())if(!o.includes(i)&&n.getModifierState(i))return!0;return!1}function Ek(n){const{render:o,className:i,refs:l=cl,props:c=cl,state:u=gt,stateAttributesMapping:d,highlightedIndex:p,onHighlightedIndexChange:h,orientation:m,dense:v,itemSizes:g,loopFocus:w,cols:S,enableHomeAndEndKeys:b,onMapChange:C,stopEventPropagation:k=!0,rootRef:N,disabledIndices:V,modifierKeys:T,highlightItemOnHover:j=!1,tag:M="div",...D}=n,W=Ph(),{props:A,highlightedIndex:U,onHighlightedIndexChange:ne,elementsRef:te,onMapChange:L,relayKeyboardEvent:K}=kk({itemSizes:g,cols:S,loopFocus:w,dense:v,orientation:m,highlightedIndex:p,onHighlightedIndexChange:h,rootRef:N,stopEventPropagation:k,enableHomeAndEndKeys:b,direction:W,disabledIndices:V,modifierKeys:T}),G=St(M,n,{state:u,ref:l,props:[A,...c,D],stateAttributesMapping:d}),z=E.useMemo(()=>({highlightedIndex:U,onHighlightedIndexChange:ne,highlightItemOnHover:j,relayKeyboardEvent:K}),[U,ne,j,K]);return x.jsx(Zm.Provider,{value:z,children:x.jsx(sk,{elementsRef:te,onMapChange:X=>{C==null||C(X),L(X)},children:G})})}const Ck=E.createContext(void 0);function _k(n){return E.useContext(Ck)}let Rk=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n.multiple="data-multiple",n})({});const em={multiple(n){return n?{[Rk.multiple]:""}:null}},Pk=E.forwardRef(function(o,i){const{defaultValue:l,disabled:c=!1,loopFocus:u=!0,onValueChange:d,orientation:p="horizontal",multiple:h=!1,value:m,className:v,render:g,...w}=o,S=_k(),b=E.useMemo(()=>{if(m===void 0)return l??[]},[m,l]),C=E.useMemo(()=>m!==void 0||l!==void 0,[m,l]),k=((S==null?void 0:S.disabled)??!1)||c,[N,V]=Tl({controlled:m,default:b,name:"ToggleGroup",state:"value"}),T=Ee((A,U,ne)=>{let te;if(h?(te=N.slice(),U?te.push(A):te.splice(N.indexOf(A),1)):te=U?[A]:[],Array.isArray(te)){if(d==null||d(te,ne),ne.isCanceled)return;V(te)}}),j={disabled:k,multiple:h,orientation:p},M=E.useMemo(()=>({disabled:k,orientation:p,setGroupValue:T,value:N,isValueInitialized:C}),[k,p,T,N,C]),D={role:"group"},W=St("div",o,{enabled:!!S,state:j,ref:i,props:[D,w],stateAttributesMapping:em});return x.jsx(Mh.Provider,{value:M,children:S?W:x.jsx(Ek,{render:g,className:v,state:j,refs:[i],props:[D,w],stateAttributesMapping:em,loopFocus:u,enableHomeAndEndKeys:!0})})}),Tk=rc("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]",lg:"h-9 min-w-9 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),Ah=E.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function Qr({className:n,variant:o,size:i,spacing:l=0,orientation:c="horizontal",children:u,...d}){return x.jsx(Pk,{"data-slot":"toggle-group","data-variant":o,"data-size":i,"data-spacing":l,"data-orientation":c,style:{"--gap":l},className:Pe("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",n),...d,children:x.jsx(Ah.Provider,{value:{variant:o,size:i,spacing:l,orientation:c},children:u})})}function Xr({className:n,children:o,variant:i="default",size:l="default",...c}){const u=E.useContext(Ah);return x.jsx(ik,{"data-slot":"toggle-group-item","data-variant":u.variant||i,"data-size":u.size||l,"data-spacing":u.spacing,className:Pe("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",Tk({variant:u.variant||i,size:u.size||l}),n),...c,children:o})}const Nk=15,Mk={high:"border-l-risk-high",medium:"border-l-risk-medium",low:"border-l-risk-low",neutral:"border-l-border"},Ok={high:"bg-risk-high",medium:"bg-risk-medium",low:"bg-risk-low",neutral:"bg-border"},tm={"mat-none":"bg-muted/30 text-muted-foreground","mat-low":"bg-sim-low","mat-med":"bg-sim-med","mat-high":"bg-sim-high","mat-vhigh":"bg-sim-vhigh text-sim-vhigh-foreground"},jk=[{value:"recent_pr_count",label:"recent PRs"},{value:"flagged_prs",label:"flagged PRs"},{value:"last_activity_at",label:"latest activity"},{value:"pr_count",label:"total PRs"}],Ik=[{value:"open",label:"open PRs"},{value:"all",label:"all PRs"}];function Lk(n,o){return o==="all"?!0:n.state==="open"&&!n.merged}function Ak(n){const{clusters:o,prByNumber:i,contributorByAuthor:l,focusMode:c,selectedClusterId:u,onSelectCluster:d,sortKey:p,onSortKeyChange:h}=n,[m,v]=E.useState(()=>new Set(u?[u]:[])),[g,w]=E.useState("open"),S=E.useCallback(C=>v(k=>{const N=new Set(k);return N.has(C)?N.delete(C):N.add(C),N}),[]),b=E.useMemo(()=>{const C=[...o];if(C.sort((N,V)=>lw(N,V,p,i,l)),!u)return C;const k=C.find(N=>N.cluster_id===u);return k?[k,...C.filter(N=>N.cluster_id!==u)]:C},[o,l,i,u,p]);return x.jsxs(Ol,{title:"Issue Clusters",description:"Issue-centered groups of PRs and issues tied together by references, shared targets, and soft similarity.",children:[x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Sort by"}),x.jsx(Qr,{value:[p],onValueChange:C=>{C.length&&h(C[0])},spacing:2,size:"sm",children:jk.map(C=>x.jsx(Xr,{value:C.value,children:C.label},C.value))})]}),x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Show"}),x.jsx(Qr,{value:[g],onValueChange:C=>{C.length&&w(C[0])},spacing:2,size:"sm",children:Ik.map(C=>x.jsx(Xr,{value:C.value,children:C.label},C.value))})]}),x.jsx("div",{className:"flex flex-col gap-3",children:b.map(C=>x.jsx(zk,{cluster:C,prByNumber:i,contributorByAuthor:l,focusMode:c,selected:C.cluster_id===u,open:m.has(C.cluster_id),onToggle:()=>S(C.cluster_id),onSelect:()=>d(C.cluster_id),prStateFilter:g},C.cluster_id))})]})}function zk({cluster:n,prByNumber:o,contributorByAuthor:i,focusMode:l,selected:c,open:u,onToggle:d,prStateFilter:p}){const h=Bv(n,i),m=E.useMemo(()=>n.recent_pr_numbers.map(g=>o.get(g)).filter(g=>!!g).filter(g=>ec(g,i.get(g.author??""),l)).filter(g=>Lk(g,p)).sort((g,w)=>n.canonical_pr_number===g.number?-1:n.canonical_pr_number===w.number?1:Kr(g)-Kr(w)),[n,o,i,l,p]),v=E.useMemo(()=>(n.pairwise_similarity??[]).filter(g=>_i(g)>=.5).length,[n]);return x.jsx(th,{open:u,onOpenChange:d,children:x.jsxs("article",{id:`cluster-${n.cluster_id}`,className:Pe("rounded-lg border border-l-[3px] overflow-hidden transition-colors",Mk[h],c&&"ring-1 ring-primary/40"),children:[x.jsxs(nh,{className:Pe("flex w-full items-start justify-between gap-3 p-4 text-left cursor-pointer","bg-secondary/40 hover:bg-secondary/60 transition-colors"),children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[x.jsx("strong",{className:"text-sm",children:n.title}),x.jsxs(Rn,{variant:"count",children:[m.length," recent"]}),x.jsxs(Rn,{variant:"outline",children:[n.pr_count," total"]}),v>0?x.jsxs(Rn,{variant:"warning",title:"PR pairs in this issue cluster where at least one metric is high (≥ 0.50): code, size, files, areas, or patch.",children:[v," Similar Pair",v>1?"s":""]}):null]}),x.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[n.authors.slice(0,6).join(", "),n.authors.length>6?` +${n.authors.length-6}`:""," · ",n.evidence_types.join(", ")," · status ",n.status??"—"]}),n.summary?x.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-prose",children:n.summary}):null]}),x.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[n.github_url?x.jsx("span",{onClick:g=>g.stopPropagation(),children:x.jsx(Tn,{href:n.github_url,children:"Reference"})}):null,u?x.jsx(Nl,{className:"size-4 text-muted-foreground"}):x.jsx(Ml,{className:"size-4 text-muted-foreground"})]})]}),x.jsxs(rh,{keepMounted:!0,children:[x.jsx(Fk,{cluster:n,rows:m}),x.jsx("div",{className:"px-4 flex flex-col",children:m.map(g=>x.jsx(Dk,{row:g,contributor:i.get(g.author??""),reference:n.canonical_pr_number===g.number,similarity:n.pr_similarity[String(g.number)],peerMatches:Gv(n,g.number)},g.number))}),n.pr_count>m.length?x.jsxs("p",{className:"text-xs text-muted-foreground px-4 pb-3 mt-2",children:["+",n.pr_count-m.length," PRs hidden by focus filter or outside this window."]}):null]})]})})}function Dk({row:n,contributor:o,reference:i,similarity:l,peerMatches:c}){const u=To(o==null?void 0:o.automation_risk_signal),d=Kv(l);return x.jsxs("div",{className:"grid grid-cols-[4px_minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[x.jsx("div",{className:Pe("rounded-sm",Ok[u]),"aria-hidden":!0}),x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[x.jsxs("strong",{className:Pe("text-sm",!Sl(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),i?x.jsx(Rn,{variant:"reference",children:"reference"}):null,x.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:Kr(n)}),d!==null?x.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["sim ",d.toFixed(2)]}):null,x.jsx(Ym,{level:u})]}),x.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · ",tc(n.updated_at)," · ",n.changed_files??0," files · +",n.additions??0,"/-",n.deletions??0]}),c.length>0?x.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Similar to"," ",c.map((p,h)=>x.jsxs("span",{children:[h>0?", ":"","#",p.otherPrNumber," (",p.similarity.toFixed(2),")"]},p.otherPrNumber))]}):null,n.author?x.jsx(jl,{contributor:o,compact:!0}):null,n.body_excerpt?x.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-prose",children:n.body_excerpt}):null]}),x.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url?x.jsx(Tn,{href:n.html_url,children:"PR"}):null,n.files_url?x.jsx(Tn,{href:n.files_url,children:"Files"}):null]})]})}function Fk({cluster:n,rows:o}){const[i,l]=E.useState(!0),c=o.slice(0,Nk);if(c.length<2)return null;const u=c.length>8,d=(n.pairwise_similarity??[]).filter(p=>_i(p)>=.5).length;return x.jsxs("div",{className:"px-4 py-2.5",children:[x.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:()=>l(p=>!p),children:[i?x.jsx(Nl,{className:"size-3"}):x.jsx(Ml,{className:"size-3"}),"Pairwise comparison",o.length>c.length?` (first ${c.length} of ${o.length})`:"",d>0?` · ${d} pair${d>1?"s":""} ≥ 0.50`:""]}),x.jsxs(Mi,{children:[x.jsx(Oi,{className:"ml-1.5 cursor-help align-middle",children:x.jsx(Km,{className:"size-3.5 text-muted-foreground hover:text-foreground"})}),x.jsx(ji,{side:"right",className:"text-xs max-w-xs",children:"Compares every PR pair in this issue cluster. Metrics: code (composite of size, file overlap, area overlap, patch overlap), size, files, areas, and patch. High values can come from size similarity alone."})]}),i?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"sim-grid mt-2",style:{"--sim-cols":`72px repeat(${c.length}, minmax(${u?"38px":"48px"}, 1fr))`},children:[x.jsx("div",{className:"min-h-8 rounded bg-muted/20"}),c.map(p=>x.jsxs("div",{className:Pe("min-h-8 rounded bg-muted/20 flex items-center justify-center font-mono text-muted-foreground px-0.5 truncate",u?"text-[0.65rem]":"text-xs"),title:p.title??void 0,children:["#",p.number]},`c-${p.number}`)),c.map(p=>x.jsxs(E.Fragment,{children:[x.jsxs("div",{className:Pe("min-h-8 rounded bg-muted/20 flex items-center justify-center font-mono text-muted-foreground px-0.5",u?"text-[0.65rem]":"text-xs"),title:p.title??void 0,children:["#",p.number]}),c.map(h=>{if(p.number===h.number)return x.jsx("div",{className:Pe("min-h-8 rounded bg-muted/20 flex items-center justify-center font-mono text-muted-foreground",u?"text-[0.65rem]":"text-xs"),children:"—"},`${p.number}-${h.number}`);const m=Yv(n,p.number,h.number),v=Vk(n,p.number,h.number);return x.jsxs(Mi,{children:[x.jsx(Oi,{render:x.jsx("div",{className:Pe("min-h-8 rounded flex items-center justify-center font-mono border border-border/40",u?"text-[0.65rem]":"text-xs",tm[fm(m)])}),children:m.toFixed(2)}),x.jsxs(ji,{side:"top",className:"font-mono text-xs",children:["#",p.number," ↔ #",h.number,v?x.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["patch ",v.patch_similarity.toFixed(2)," · code ",v.code_similarity.toFixed(2)," · size ",v.size_similarity.toFixed(2)," · file ",v.file_overlap.toFixed(2)," · area ",v.area_overlap.toFixed(2)]}):null]})]},`${p.number}-${h.number}`)})]},`rg-${p.number}`))]}),x.jsx("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:["mat-none","mat-low","mat-med","mat-high","mat-vhigh"].map((p,h)=>x.jsxs(E.Fragment,{children:[x.jsx("span",{className:Pe("inline-block size-3.5 rounded-sm border border-border/40",tm[p])}),["0","<.10","<.25","<.50","≥.50"][h]]},p))})]}):null]})}function Vk(n,o,i){return(n.pairwise_similarity??[]).find(l=>l.left_pr_number===o&&l.right_pr_number===i||l.left_pr_number===i&&l.right_pr_number===o)}const Uk={high:"border-l-[3px] border-l-risk-high bg-risk-high/[0.07]",medium:"border-l-[3px] border-l-risk-medium bg-risk-medium/[0.05]",low:"border-l-[3px] border-l-transparent",neutral:"border-l-[3px] border-l-transparent"},$k=[{value:"open",label:"open"},{value:"all",label:"all"},{value:"merged",label:"merged"},{value:"flagged",label:"flagged",tip:"PRs whose author has medium or high automation risk"},{value:"clustered",label:"clustered"},{value:"unclustered",label:"unclustered"}];function Bk(n){const{rows:o,contributorByAuthor:i,onOpenCluster:l,sortKey:c,sortDirection:u,onSortKeyChange:d,onSortDirectionChange:p,filterKey:h,onFilterKeyChange:m,focusLabel:v}=n,[g,w]=E.useState(""),S=E.useMemo(()=>o.filter(k=>Jv(k,i,h)).filter(k=>pm(g,k.title,k.author,k.body_excerpt)),[o,i,h,g]),b=E.useMemo(()=>[...S].sort((k,N)=>rw(k,N,i,c,u)),[S,i,c,u]);function C(k){k===c?p(u==="desc"?"asc":"desc"):(d(k),p(ow()))}return x.jsxs(Ol,{title:"Recent PRs",description:`Queue view for ${v} — hand off to GitHub for full review.`,children:[x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[x.jsx(Qr,{value:[h],onValueChange:k=>{k.length&&m(k[0])},spacing:2,size:"sm",children:$k.map(k=>x.jsx(Xr,{value:k.value,title:k.tip,children:k.label},k.value))}),x.jsx(Gm,{value:g,onChange:w,placeholder:"Filter by title, author…"})]}),x.jsxs("div",{className:"w-full overflow-x-auto",children:[x.jsxs("table",{className:"w-full border-collapse text-sm",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"border-b border-border",children:[x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"PR"}),x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Author"}),x.jsx(hn,{label:"Signal",active:c==="automation_risk",direction:u,onClick:()=>C("automation_risk")}),x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Cluster"}),x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Status"}),x.jsx(hn,{label:"Updated",active:c==="updated_at",direction:u,onClick:()=>C("updated_at")}),x.jsx(hn,{label:"Size",active:c==="size",direction:u,onClick:()=>C("size")}),x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Links"})]})}),x.jsx("tbody",{children:b.map(k=>{const N=Ju(k,i);return x.jsxs("tr",{className:Pe("border-b border-border last:border-b-0 transition-colors hover:bg-accent",Uk[N]),children:[x.jsxs("td",{className:"px-2 py-2.5 align-top",children:[x.jsxs("span",{className:Pe(!Sl(k)&&"line-through decoration-muted-foreground"),children:[x.jsxs("strong",{children:["#",k.number]})," ",k.title]}),k.body_excerpt?x.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:k.body_excerpt}):null]}),x.jsxs("td",{className:"px-2 py-2.5 align-top",children:[x.jsx("strong",{children:k.author??"—"}),k.author?x.jsx(jl,{contributor:i.get(k.author),compact:!0}):null,k.author_association?x.jsxs("div",{className:"text-xs text-muted-foreground",children:["association · ",k.author_association]}):null]}),x.jsx("td",{className:"px-2 py-2.5 align-top",children:k.author?x.jsx(J0,{contributor:i.get(k.author)}):"—"}),x.jsx("td",{className:"px-2 py-2.5 align-top",children:k.cluster_id?x.jsx(ew,{clusterId:k.cluster_id,onOpenCluster:l}):x.jsx("span",{className:"text-muted-foreground",children:"—"})}),x.jsxs("td",{className:"px-2 py-2.5 align-top text-sm whitespace-nowrap",children:[k.merged?"merged":k.state,k.draft?" · draft":""]}),x.jsx("td",{className:"px-2 py-2.5 align-top text-sm whitespace-nowrap",children:tc(k.updated_at)}),x.jsxs("td",{className:"px-2 py-2.5 align-top font-mono text-xs whitespace-nowrap tabular-nums",children:[k.changed_files??0,"f +",k.additions??0,"/-",k.deletions??0]}),x.jsx("td",{className:"px-2 py-2.5 align-top",children:x.jsxs("div",{className:"flex gap-2",children:[k.html_url?x.jsx(Tn,{href:k.html_url,children:"PR"}):null,k.files_url?x.jsx(Tn,{href:k.files_url,children:"Files"}):null]})})]},k.number)})})]}),b.length===0?x.jsxs("p",{className:"text-center text-muted-foreground py-8",children:["No PRs match the current filter",g?" and search":"","."]}):null]})]})}const Hk=15,nm={"mat-none":"bg-muted/30 text-muted-foreground","mat-low":"bg-sim-low","mat-med":"bg-sim-med","mat-high":"bg-sim-high","mat-vhigh":"bg-sim-vhigh text-sim-vhigh-foreground"},Wk=[{value:"average_similarity",label:"avg similarity"},{value:"recent_pr_count",label:"recent PRs"},{value:"last_activity_at",label:"latest activity"},{value:"pr_count",label:"total PRs"}],Kk=[{value:"open",label:"open PRs"},{value:"all",label:"all PRs"}];function Yk(n){const{clusters:o,prByNumber:i,contributorByAuthor:l,focusMode:c,sortKey:u,onSortKeyChange:d}=n,[p,h]=E.useState("open"),[m,v]=E.useState(new Set),g=E.useCallback(S=>v(b=>{const C=new Set(b);return C.has(S)?C.delete(S):C.add(S),C}),[]),w=E.useMemo(()=>{const S=[...o];return S.sort((b,C)=>aw(b,C,u)),S},[o,u]);return x.jsxs(Ol,{title:"Code Clusters",description:"Groups of PRs with similar change scope — overlapping files, directories, and diff areas that may indicate competing or related work.",children:[x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[x.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.length," code cluster",o.length!==1?"s":""]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Sort by"}),x.jsx(Qr,{value:[u],onValueChange:S=>{S.length&&d(S[0])},spacing:2,size:"sm",children:Wk.map(S=>x.jsx(Xr,{value:S.value,children:S.label},S.value))})]})]}),x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Show"}),x.jsx(Qr,{value:[p],onValueChange:S=>{S.length&&h(S[0])},spacing:2,size:"sm",children:Kk.map(S=>x.jsx(Xr,{value:S.value,children:S.label},S.value))})]}),x.jsx("div",{className:"flex flex-col gap-3",children:w.map(S=>x.jsx(Gk,{cluster:S,prByNumber:i,contributorByAuthor:l,focusMode:c,open:m.has(S.cluster_id),onToggle:()=>g(S.cluster_id),prStateFilter:p},S.cluster_id))})]})}function Gk({cluster:n,prByNumber:o,contributorByAuthor:i,focusMode:l,open:c,onToggle:u,prStateFilter:d}){const p=dm(n),h=E.useMemo(()=>n.pr_numbers.map(v=>o.get(v)).filter(v=>!!v).filter(v=>ec(v,i.get(v.author??""),l)).filter(v=>d==="all"||Sl(v)).sort((v,g)=>v.number===n.representative_pr_number?-1:g.number===n.representative_pr_number?1:Kr(v)-Kr(g)),[n,o,i,l,d]),m=n.average_similarity>=.6?"border-l-risk-high":n.average_similarity>=.4?"border-l-risk-medium":"border-l-primary/40";return x.jsx(th,{open:c,onOpenChange:u,children:x.jsxs("article",{className:Pe("rounded-lg border border-l-[3px] overflow-hidden transition-colors",m),children:[x.jsxs(nh,{className:Pe("flex w-full items-start justify-between gap-3 p-4 text-left cursor-pointer","bg-secondary/40 hover:bg-secondary/60 transition-colors"),children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[x.jsx("strong",{className:"text-sm",children:n.title}),x.jsxs(Rn,{variant:"count",children:[h.length," PR",h.length!==1?"s":""]}),x.jsxs(Rn,{variant:"outline",children:["avg ",n.average_similarity.toFixed(2)]}),p>0&&x.jsxs(Rn,{variant:"warning",title:"PR pairs in this code cluster with high overall scope similarity (≥ 0.50) based on changed files, directories, diff areas, and change shape.",children:[p," High Scope Similarity"]})]}),x.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[n.authors.slice(0,6).join(", "),n.authors.length>6?` +${n.authors.length-6}`:""]}),n.summary&&x.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-prose",children:n.summary})]}),x.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[x.jsx(Tn,{href:n.representative_url,children:"Representative PR"}),c?x.jsx(Nl,{className:"size-4 text-muted-foreground"}):x.jsx(Ml,{className:"size-4 text-muted-foreground"})]})]}),x.jsxs(rh,{keepMounted:!0,children:[x.jsx(Qk,{directories:n.shared_directories,filenames:n.shared_filenames}),x.jsx(qk,{cluster:n,rows:h}),x.jsx("div",{className:"px-4 flex flex-col",children:h.map(v=>x.jsx(Xk,{row:v,contributor:i.get(v.author??""),representative:v.number===n.representative_pr_number,cluster:n},v.number))}),n.pr_count>h.length?x.jsxs("p",{className:"text-xs text-muted-foreground px-4 pb-3 mt-2",children:["+",n.pr_count-h.length," PRs hidden by focus filter or outside this window."]}):null]})]})})}function Qk({directories:n,filenames:o}){return!n.length&&!o.length?null:x.jsxs("div",{className:"px-4 pt-2.5 pb-1 flex flex-wrap gap-1.5",children:[o.slice(0,5).map(i=>x.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-primary/10 text-primary text-xs font-mono px-1.5 py-0.5",children:[x.jsx(B0,{className:"size-3 shrink-0"}),i.split("/").pop()]},i)),n.slice(0,4).map(i=>x.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-muted text-muted-foreground text-xs font-mono px-1.5 py-0.5",children:[x.jsx(Y0,{className:"size-3 shrink-0"}),i]},i))]})}function Xk({row:n,contributor:o,representative:i,cluster:l}){const c=To(o==null?void 0:o.automation_risk_signal),u=qv(l,n.number);return x.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[x.jsxs("strong",{className:Pe("text-sm",!Sl(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),i?x.jsx(Rn,{variant:"reference",children:"representative"}):null,x.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:Kr(n)}),x.jsx(Ym,{level:c})]}),x.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · ",tc(n.updated_at)," · ",n.changed_files??0," files · +",n.additions??0,"/-",n.deletions??0]}),u.length>0&&x.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Overlaps with"," ",u.map((d,p)=>x.jsxs("span",{children:[p>0?", ":"","#",d.otherPrNumber," (",d.similarity.toFixed(2),")"]},d.otherPrNumber))]}),n.author&&x.jsx(jl,{contributor:o,compact:!0})]}),x.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url&&x.jsx(Tn,{href:n.html_url,children:"PR"}),n.files_url&&x.jsx(Tn,{href:n.files_url,children:"Files"})]})]})}function qk({cluster:n,rows:o}){const[i,l]=E.useState(!0),c=o.slice(0,Hk);if(c.length<2)return null;const u=dm(n);return x.jsxs("div",{className:"px-4 py-2.5",children:[x.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:()=>l(d=>!d),children:[i?x.jsx(Nl,{className:"size-3"}):x.jsx(Ml,{className:"size-3"}),"Pairwise scope similarity",o.length>c.length?` (first ${c.length} of ${o.length})`:"",u>0?` · ${u} pair${u>1?"s":""} ≥ 0.50`:""]}),x.jsxs(Mi,{children:[x.jsx(Oi,{className:"ml-1.5 cursor-help align-middle",children:x.jsx(Km,{className:"size-3.5 text-muted-foreground hover:text-foreground"})}),x.jsx(ji,{side:"right",className:"text-xs max-w-xs",children:"Compares PRs by change scope. Blends: content (file/directory/diff-area overlap), size (total changed lines), breadth (file-count and directory-count), and concentration (how focused the change is). This is a change-footprint comparison, not a semantic review."})]}),i&&x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"sim-grid mt-2",style:{"--sim-cols":`72px repeat(${c.length}, minmax(38px, 1fr))`},children:[x.jsx("div",{className:"min-h-8 rounded bg-muted/20"}),c.map(d=>x.jsxs("div",{className:"min-h-8 rounded bg-muted/20 flex items-center justify-center text-[0.65rem] font-mono text-muted-foreground px-0.5 truncate",title:d.title??void 0,children:["#",d.number]},`c-${d.number}`)),c.map(d=>x.jsxs(E.Fragment,{children:[x.jsxs("div",{className:"min-h-8 rounded bg-muted/20 flex items-center justify-center text-[0.65rem] font-mono text-muted-foreground px-0.5",title:d.title??void 0,children:["#",d.number]}),c.map(p=>{if(d.number===p.number)return x.jsx("div",{className:"min-h-8 rounded bg-muted/20 flex items-center justify-center text-[0.65rem] font-mono text-muted-foreground",children:"—"},`${d.number}-${p.number}`);const h=Xv(n,d.number,p.number),m=(h==null?void 0:h.similarity)??0;return x.jsxs(Mi,{children:[x.jsx(Oi,{render:x.jsx("div",{className:Pe("min-h-8 rounded flex items-center justify-center text-[0.65rem] font-mono border border-border/40",nm[fm(m)])}),children:m.toFixed(2)}),x.jsxs(ji,{side:"top",className:"font-mono text-xs max-w-xs",children:[x.jsxs("div",{children:["#",d.number," ↔ #",p.number]}),h&&x.jsxs(x.Fragment,{children:[x.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["content ",h.content_similarity.toFixed(2)," · breadth ",h.breadth_similarity.toFixed(2)," · concentration ",h.concentration_similarity.toFixed(2)," · size ",h.size_similarity.toFixed(2)]}),h.shared_filenames.length>0&&x.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["files: ",h.shared_filenames.slice(0,3).map(v=>v.split("/").pop()).join(", "),h.shared_filenames.length>3?` +${h.shared_filenames.length-3}`:""]})]})]})]},`${d.number}-${p.number}`)})]},`rg-${d.number}`))]}),x.jsx("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:["mat-none","mat-low","mat-med","mat-high","mat-vhigh"].map((d,p)=>x.jsxs(E.Fragment,{children:[x.jsx("span",{className:Pe("inline-block size-3.5 rounded-sm border border-border/40",nm[d])}),["0","<.10","<.25","<.50","≥.50"][p]]},d))})]})]})}function Zk(n){const{rows:o,sortKey:i,sortDirection:l,onSortKeyChange:c,onSortDirectionChange:u,focusLabel:d}=n,[p,h]=E.useState(""),m=E.useMemo(()=>o.filter(w=>pm(p,w.author,w.name,w.heuristic_note)),[o,p]),v=E.useMemo(()=>[...m].sort((w,S)=>iw(w,S,i,l)),[m,i,l]);function g(w){w===i?u(l==="desc"?"asc":"desc"):(c(w),u(sw()))}return x.jsxs(Ol,{title:"Contributors",description:`Contributor ranking under ${d}.`,children:[x.jsx("div",{className:"flex items-center justify-end gap-3 flex-wrap mb-3",children:x.jsx(Gm,{value:p,onChange:h,placeholder:"Filter by name…"})}),x.jsxs("div",{className:"w-full overflow-x-auto",children:[x.jsxs("table",{className:"w-full border-collapse text-sm",children:[x.jsx("thead",{children:x.jsxs("tr",{className:"border-b border-border",children:[x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Contributor"}),x.jsx(hn,{label:"Repo PRs (14d)",active:i==="recent_pr_count",direction:l,onClick:()=>g("recent_pr_count")}),x.jsx(hn,{label:"Repo PRs (snapshot)",active:i==="snapshot_pr_count",direction:l,onClick:()=>g("snapshot_pr_count")}),x.jsx(hn,{label:"Public PRs (42d)",active:i==="public_pr_count_42d",direction:l,onClick:()=>g("public_pr_count_42d")}),x.jsx(hn,{label:"Repos (42d)",active:i==="public_repo_count_42d",direction:l,onClick:()=>g("public_repo_count_42d")}),x.jsx(hn,{label:"Clusters",active:i==="cluster_count",direction:l,onClick:()=>g("cluster_count")}),x.jsx(hn,{label:"Status",active:i==="status",direction:l,onClick:()=>g("status")}),x.jsx(hn,{label:"Follow-through",active:i==="follow_through_score",direction:l,onClick:()=>g("follow_through_score")}),x.jsx(hn,{label:"Automation risk",active:i==="automation_risk_signal",direction:l,onClick:()=>g("automation_risk_signal")}),x.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Links"})]})}),x.jsx("tbody",{children:v.map(w=>x.jsxs("tr",{className:"border-b border-border last:border-b-0 transition-colors hover:bg-accent",children:[x.jsxs("td",{className:"px-2 py-2.5 align-top",children:[x.jsx("strong",{children:w.author}),w.name?x.jsx("div",{className:"text-xs text-muted-foreground",children:w.name}):null,x.jsx(jl,{contributor:w,compact:!0})]}),x.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:w.recent_pr_count}),x.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:w.snapshot_pr_count}),x.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:w.public_pr_count_42d??"—"}),x.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:w.public_repo_count_42d??"—"}),x.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:w.cluster_count}),x.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:Wv(w)}),x.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:w.follow_through_score??"—"}),x.jsx(Jk,{row:w}),x.jsx("td",{className:"px-2 py-2.5 align-top",children:x.jsxs("div",{className:"flex gap-2",children:[w.profile_url?x.jsx(Tn,{href:w.profile_url,children:"Profile"}):null,w.repo_pull_requests_url?x.jsx(Tn,{href:w.repo_pull_requests_url,children:"PRs"}):null]})})]},w.author))})]}),v.length===0?x.jsxs("p",{className:"text-center text-muted-foreground py-8",children:["No contributors match",p?" the search":"","."]}):null]})]})}function Jk({row:n}){const o=n.automation_risk_signal??"—";if(!(n.heuristic_note||n.account_age_days!=null||n.public_pr_count_42d!=null))return x.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:o});const l=[];return n.account_age_days!=null&&l.push(`Account age: ${n.account_age_days}d`),n.public_pr_count_42d!=null&&l.push(`Public PRs (42d): ${n.public_pr_count_42d}`),n.public_repo_count_42d!=null&&l.push(`Repos (42d): ${n.public_repo_count_42d}`),n.breadth_score&&l.push(`Breadth: ${n.breadth_score}`),n.heuristic_note&&l.push(n.heuristic_note),x.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:x.jsxs(Mi,{children:[x.jsx(Oi,{className:"underline decoration-dotted underline-offset-4 cursor-help",children:o}),x.jsx(ji,{side:"top",className:"text-xs max-w-xs whitespace-pre-wrap",children:l.join(` +`)})]})})}const eb=E.forwardRef(function(o,i){const{className:l,render:c,orientation:u="horizontal",...d}=o;return St("div",o,{state:{orientation:u},ref:i,props:[{role:"separator","aria-orientation":u},d]})});function rm({className:n,orientation:o="horizontal",...i}){return x.jsx(eb,{"data-slot":"separator",orientation:o,className:Pe("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),...i})}const om=[{key:"all",label:"Everyone",tip:"Full recent queue regardless of familiarity."},{key:"first",label:"Unknown / first",tip:"Prioritise newly-seen contributors and first-snapshot activity."},{key:"known",label:"Known",tip:"Only established or org-linked contributors."}];function tb(){const{data:n,error:o}=Fv(),i=$v(),l=!!(n!=null&&n.summary.pr_scope_available&&n.prScopeClusters.length),c=E.useMemo(()=>{const g=[{key:"prs",label:"PRs"},{key:"clusters",label:"Issue Clusters"}];return l&&g.push({key:"pr_scope",label:"Code Clusters"}),g.push({key:"contributors",label:"Contributors"}),g},[l]),u=E.useMemo(()=>new Map(((n==null?void 0:n.contributors)??[]).map(g=>[g.author,g])),[n]),d=E.useMemo(()=>new Map(((n==null?void 0:n.prs)??[]).map(g=>[g.number,g])),[n]),p=E.useMemo(()=>((n==null?void 0:n.prs)??[]).filter(g=>ec(g,u.get(g.author??""),i.focusMode)),[n,u,i.focusMode]),h=E.useMemo(()=>((n==null?void 0:n.contributors)??[]).filter(g=>Zv(g,i.focusMode)),[n,i.focusMode]),m=om.find(g=>g.key===i.focusMode).label.toLowerCase();if(E.useEffect(()=>{if(i.activeTab!=="clusters"||!i.selectedClusterId)return;const g=requestAnimationFrame(()=>{var w;(w=document.getElementById(`cluster-${i.selectedClusterId}`))==null||w.scrollIntoView({block:"start",behavior:"smooth"})});return()=>cancelAnimationFrame(g)},[i.activeTab,i.selectedClusterId]),o)return x.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[x.jsx(im,{}),x.jsx(nw,{message:o})]});if(!n)return x.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[x.jsx(im,{}),x.jsx(tw,{})]});const v=[{label:"Recent PRs",value:n.summary.pr_count},{label:"Issue clusters",value:n.summary.cluster_count},{label:"Clustered PRs",value:n.summary.clustered_pr_count},{label:"Contributors",value:n.summary.contributor_count},{label:"Open",value:n.summary.open_pr_count},{label:"Merged",value:n.summary.merged_pr_count}];return n.summary.pr_scope_cluster_count!=null&&v.push({label:"Code clusters",value:n.summary.pr_scope_cluster_count}),x.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[x.jsxs("header",{className:"pb-4 mb-3",children:[x.jsx("p",{className:"text-[0.68rem] font-semibold uppercase tracking-[0.10em] text-primary mb-1.5",children:"Repository dashboard"}),x.jsx("h1",{className:"text-[clamp(1.5rem,3vw,2.2rem)] font-bold leading-tight tracking-tight",children:n.summary.repo}),x.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Snapshot ",x.jsx("code",{className:"text-primary/80",children:n.summary.snapshot_id})," · ",n.summary.window_days,"-day window · refreshed ",ey(n.summary.generated_at)]})]}),x.jsx(rm,{className:"mb-3"}),x.jsx(q0,{items:v}),x.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap py-2.5 mb-4",children:[x.jsx(Qr,{value:[i.activeTab],onValueChange:g=>{g.length&&i.setActiveTab(g[0])},spacing:2,children:c.map(g=>x.jsx(Xr,{value:g.key,children:g.label},g.key))}),x.jsxs("div",{className:"flex items-center gap-2",role:"group","aria-label":"Contributor focus",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Focus:"}),x.jsx(Qr,{value:[i.focusMode],onValueChange:g=>{g.length&&i.setFocusMode(g[0])},spacing:2,size:"sm",children:om.map(g=>x.jsx(Xr,{value:g.key,title:g.tip,children:g.label},g.key))})]})]}),x.jsx(rm,{className:"mb-4"}),i.activeTab==="prs"?x.jsx(Bk,{rows:p,contributorByAuthor:u,onOpenCluster:g=>{i.setSelectedClusterId(g),i.setActiveTab("clusters")},sortKey:i.prSortKey,sortDirection:i.prSortDirection,onSortKeyChange:i.setPrSortKey,onSortDirectionChange:i.setPrSortDirection,filterKey:i.prFilter,onFilterKeyChange:i.setPrFilter,focusLabel:m}):null,i.activeTab==="clusters"?x.jsx(Ak,{clusters:n.clusters,prByNumber:d,contributorByAuthor:u,focusMode:i.focusMode,selectedClusterId:i.selectedClusterId,onSelectCluster:i.setSelectedClusterId,sortKey:i.clusterSortKey,onSortKeyChange:i.setClusterSortKey}):null,i.activeTab==="pr_scope"&&l?x.jsx(Yk,{clusters:n.prScopeClusters,prByNumber:d,contributorByAuthor:u,focusMode:i.focusMode,sortKey:i.prScopeSortKey,onSortKeyChange:i.setPrScopeSortKey}):null,i.activeTab==="contributors"?x.jsx(Zk,{rows:h,sortKey:i.contributorSortKey,sortDirection:i.contributorSortDirection,onSortKeyChange:i.setContributorSortKey,onSortDirectionChange:i.setContributorSortDirection,focusLabel:m}):null]})}function im(){return x.jsxs("header",{className:"pb-4 mb-3",children:[x.jsx("p",{className:"text-[0.68rem] font-semibold uppercase tracking-[0.10em] text-primary mb-1.5",children:"Repository dashboard"}),x.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"slop-farmer"})]})}Dv.createRoot(document.getElementById("root")).render(x.jsx(lm.StrictMode,{children:x.jsx(Z1,{children:x.jsx(tb,{})})}));