diff --git "a/static/assets/index-ff495248.js" "b/static/assets/index-ff495248.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-ff495248.js" @@ -0,0 +1,400 @@ +function L1(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dh={exports:{}},Ss={},fh={exports:{}},oe={};/** + * @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 Ro=Symbol.for("react.element"),D1=Symbol.for("react.portal"),z1=Symbol.for("react.fragment"),F1=Symbol.for("react.strict_mode"),B1=Symbol.for("react.profiler"),$1=Symbol.for("react.provider"),U1=Symbol.for("react.context"),V1=Symbol.for("react.forward_ref"),H1=Symbol.for("react.suspense"),W1=Symbol.for("react.memo"),G1=Symbol.for("react.lazy"),Cf=Symbol.iterator;function K1(e){return e===null||typeof e!="object"?null:(e=Cf&&e[Cf]||e["@@iterator"],typeof e=="function"?e:null)}var ph={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mh=Object.assign,hh={};function xi(e,t,n){this.props=e,this.context=t,this.refs=hh,this.updater=n||ph}xi.prototype.isReactComponent={};xi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};xi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gh(){}gh.prototype=xi.prototype;function Oc(e,t,n){this.props=e,this.context=t,this.refs=hh,this.updater=n||ph}var Lc=Oc.prototype=new gh;Lc.constructor=Oc;mh(Lc,xi.prototype);Lc.isPureReactComponent=!0;var bf=Array.isArray,yh=Object.prototype.hasOwnProperty,Dc={current:null},vh={key:!0,ref:!0,__self:!0,__source:!0};function xh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)yh.call(t,r)&&!vh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,q=A[Y];if(0>>1;Yi(Me,k))sei(K,Me)?(A[Y]=K,A[se]=k,Y=se):(A[Y]=Me,A[re]=k,Y=re);else if(sei(K,k))A[Y]=K,A[se]=k,Y=se;else break e}}return F}function i(A,F){var k=A.sortIndex-F.sortIndex;return k!==0?k:A.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],d=1,f=null,p=3,m=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,g=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 x(A){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=A)r(u),F.sortIndex=F.expirationTime,t(a,F);else break;F=n(u)}}function C(A){if(y=!1,x(A),!w)if(n(a)!==null)w=!0,$(E);else{var F=n(u);F!==null&&H(C,F.startTime-A)}}function E(A,F){w=!1,y&&(y=!1,g(_),_=-1),m=!0;var k=p;try{for(x(F),f=n(a);f!==null&&(!(f.expirationTime>F)||A&&!T());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var q=Y(f.expirationTime<=F);F=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(a)&&r(a),x(F)}else r(a);f=n(a)}if(f!==null)var b=!0;else{var re=n(u);re!==null&&H(C,re.startTime-F),b=!1}return b}finally{f=null,p=k,m=!1}}var N=!1,j=null,_=-1,z=5,M=-1;function T(){return!(e.unstable_now()-MA||125Y?(A.sortIndex=k,t(u,A),n(a)===null&&A===n(u)&&(y?(g(_),_=-1):y=!0,H(C,k-Y))):(A.sortIndex=q,t(a,A),w||m||(w=!0,$(E))),A},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(A){var F=p;return function(){var k=p;p=F;try{return A.apply(this,arguments)}finally{p=k}}}})(bh);Ch.exports=bh;var iw=Ch.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 ow=h,xt=iw;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Za=Object.prototype.hasOwnProperty,lw=/^[: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]*$/,Ef={},jf={};function sw(e){return Za.call(jf,e)?!0:Za.call(Ef,e)?!1:lw.test(e)?jf[e]=!0:(Ef[e]=!0,!1)}function aw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function uw(e,t,n,r){if(t===null||typeof t>"u"||aw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 tt(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var We={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){We[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];We[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){We[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){We[e]=new tt(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){We[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){We[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){We[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){We[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){We[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bc=/[\-:]([a-z])/g;function $c(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(Bc,$c);We[t]=new tt(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(Bc,$c);We[t]=new tt(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(Bc,$c);We[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){We[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});We.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){We[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Uc(e,t,n,r){var i=We.hasOwnProperty(t)?We[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wi(e):""}function cw(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=la(e.type,!1),e;case 11:return e=la(e.type.render,!1),e;case 1:return e=la(e.type,!0),e;default:return""}}function ru(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 $r:return"Fragment";case Br:return"Portal";case eu:return"Profiler";case Vc:return"StrictMode";case tu:return"Suspense";case nu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jh:return(e.displayName||"Context")+".Consumer";case Eh:return(e._context.displayName||"Context")+".Provider";case Hc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wc:return t=e.displayName||null,t!==null?t:ru(e.type)||"Memo";case Rn:t=e._payload,e=e._init;try{return ru(e(t))}catch{}}return null}function dw(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 ru(t);case 8:return t===Vc?"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 qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fw(e){var t=Ah(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wo(e){e._valueTracker||(e._valueTracker=fw(e))}function _h(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ah(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ll(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 iu(e,t){var n=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Af(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Th(e,t){t=t.checked,t!=null&&Uc(e,"checked",t,!1)}function ou(e,t){Th(e,t);var n=qn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lu(e,t.type,n):t.hasOwnProperty("defaultValue")&&lu(e,t.type,qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _f(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function lu(e,t,n){(t!=="number"||Ll(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gi=Array.isArray;function Zr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Go.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qi={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},pw=["Webkit","ms","Moz","O"];Object.keys(qi).forEach(function(e){pw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qi[t]=qi[e]})});function Oh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qi.hasOwnProperty(e)&&qi[e]?(""+t).trim():t+"px"}function Lh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Oh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var mw=Te({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 uu(e,t){if(t){if(mw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function cu(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 du=null;function Gc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fu=null,ei=null,ti=null;function If(e){if(e=Oo(e)){if(typeof fu!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Es(t),fu(e.stateNode,e.type,t))}}function Dh(e){ei?ti?ti.push(e):ti=[e]:ei=e}function zh(){if(ei){var e=ei,t=ti;if(ti=ei=null,If(e),t)for(e=0;e>>=0,e===0?32:31-(Nw(e)/Ew|0)|0}var Ko=64,Yo=4194304;function Ki(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 Bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Ki(s):(o&=l,o!==0&&(r=Ki(o)))}else l=n&~i,l!==0?r=Ki(l):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Io(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function _w(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0=Ji),Uf=String.fromCharCode(32),Vf=!1;function ig(e,t){switch(e){case"keyup":return iS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ur=!1;function lS(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(Vf=!0,Uf);case"textInput":return e=t.data,e===Uf&&Vf?null:e;default:return null}}function sS(e,t){if(Ur)return e==="compositionend"||!ed&&ig(e,t)?(e=ng(),xl=Xc=Ln=null,Ur=!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:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kf(n)}}function ug(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ug(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cg(){for(var e=window,t=Ll();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ll(e.document)}return t}function td(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 gS(e){var t=cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(r!==null&&td(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Yf(n,o);var l=Yf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Vr=null,vu=null,eo=null,xu=!1;function Qf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xu||Vr==null||Vr!==Ll(r)||(r=Vr,"selectionStart"in r&&td(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),eo&&go(eo,r)||(eo=r,r=Vl(vu,"onSelect"),0Gr||(e.current=Nu[Gr],Nu[Gr]=null,Gr--)}function Se(e,t){Gr++,Nu[Gr]=e.current,e.current=t}var Xn={},qe=nr(Xn),ot=nr(!1),xr=Xn;function di(e,t){var n=e.type.contextTypes;if(!n)return Xn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function lt(e){return e=e.childContextTypes,e!=null}function Wl(){je(ot),je(qe)}function np(e,t,n){if(qe.current!==Xn)throw Error(D(168));Se(qe,t),Se(ot,n)}function xg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(D(108,dw(e)||"Unknown",i));return Te({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,xr=qe.current,Se(qe,e),Se(ot,ot.current),!0}function rp(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=xg(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,je(ot),je(qe),Se(qe,e)):je(ot),Se(ot,n)}var cn=null,js=!1,wa=!1;function wg(e){cn===null?cn=[e]:cn.push(e)}function PS(e){js=!0,wg(e)}function rr(){if(!wa&&cn!==null){wa=!0;var e=0,t=he;try{var n=cn;for(he=1;e>=l,i-=l,dn=1<<32-Ft(t)+i|n<_?(z=j,j=null):z=j.sibling;var M=p(g,j,x[_],C);if(M===null){j===null&&(j=z);break}e&&j&&M.alternate===null&&t(g,j),v=o(M,v,_),N===null?E=M:N.sibling=M,N=M,j=z}if(_===x.length)return n(g,j),Pe&&cr(g,_),E;if(j===null){for(;__?(z=j,j=null):z=j.sibling;var T=p(g,j,M.value,C);if(T===null){j===null&&(j=z);break}e&&j&&T.alternate===null&&t(g,j),v=o(T,v,_),N===null?E=T:N.sibling=T,N=T,j=z}if(M.done)return n(g,j),Pe&&cr(g,_),E;if(j===null){for(;!M.done;_++,M=x.next())M=f(g,M.value,C),M!==null&&(v=o(M,v,_),N===null?E=M:N.sibling=M,N=M);return Pe&&cr(g,_),E}for(j=r(g,j);!M.done;_++,M=x.next())M=m(j,g,_,M.value,C),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?_:M.key),v=o(M,v,_),N===null?E=M:N.sibling=M,N=M);return e&&j.forEach(function(P){return t(g,P)}),Pe&&cr(g,_),E}function S(g,v,x,C){if(typeof x=="object"&&x!==null&&x.type===$r&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ho:e:{for(var E=x.key,N=v;N!==null;){if(N.key===E){if(E=x.type,E===$r){if(N.tag===7){n(g,N.sibling),v=i(N,x.props.children),v.return=g,g=v;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Rn&&lp(E)===N.type){n(g,N.sibling),v=i(N,x.props),v.ref=zi(g,N,x),v.return=g,g=v;break e}n(g,N);break}else t(g,N);N=N.sibling}x.type===$r?(v=vr(x.props.children,g.mode,C,x.key),v.return=g,g=v):(C=jl(x.type,x.key,x.props,null,g.mode,C),C.ref=zi(g,v,x),C.return=g,g=C)}return l(g);case Br:e:{for(N=x.key;v!==null;){if(v.key===N)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),v=i(v,x.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=Pa(x,g.mode,C),v.return=g,g=v}return l(g);case Rn:return N=x._init,S(g,v,N(x._payload),C)}if(Gi(x))return w(g,v,x,C);if(Ii(x))return y(g,v,x,C);tl(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,x),v.return=g,g=v):(n(g,v),v=ja(x,g.mode,C),v.return=g,g=v),l(g)):n(g,v)}return S}var pi=bg(!0),Ng=bg(!1),Ql=nr(null),ql=null,Qr=null,od=null;function ld(){od=Qr=ql=null}function sd(e){var t=Ql.current;je(Ql),e._currentValue=t}function Pu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ri(e,t){ql=e,od=Qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function At(e){var t=e._currentValue;if(od!==e)if(e={context:e,memoizedValue:t,next:null},Qr===null){if(ql===null)throw Error(D(308));Qr=e,ql.dependencies={lanes:0,firstContext:e}}else Qr=Qr.next=e;return t}var mr=null;function ad(e){mr===null?mr=[e]:mr.push(e)}function Eg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ad(t)):(n.next=i.next,i.next=n),t.interleaved=n,vn(e,r)}function vn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var In=!1;function ud(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jg(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 pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,vn(e,n)}return i=r.interleaved,i===null?(t.next=t,ad(r)):(t.next=i.next,i.next=t),r.interleaved=t,vn(e,n)}function Sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yc(e,n)}}function sp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xl(e,t,n,r){var i=e.updateQueue;In=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=a))}if(o!==null){var f=i.baseState;l=0,d=u=a=null,s=o;do{var p=s.lane,m=s.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(p=t,m=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){f=w.call(m,f,p);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,p=typeof w=="function"?w.call(m,f,p):w,p==null)break e;f=Te({},f,p);break e;case 2:In=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else m={eventTime:m,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(u=d=m,a=f):d=d.next=m,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(d===null&&(a=f),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);kr|=l,e.lanes=l,e.memoizedState=f}}function ap(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ka.transition;ka.transition={};try{e(!1),t()}finally{he=n,ka.transition=r}}function Hg(){return _t().memoizedState}function RS(e,t,n){var r=Wn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Gg(t,n);else if(n=Eg(e,t,n,r),n!==null){var i=Ze();Bt(n,e,r,i),Kg(n,t,r)}}function IS(e,t,n){var r=Wn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wg(e))Gg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,Ut(s,l)){var a=t.interleaved;a===null?(i.next=i,ad(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Eg(e,t,i,r),n!==null&&(i=Ze(),Bt(n,e,r,i),Kg(n,t,r))}}function Wg(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Gg(e,t){to=Zl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yc(e,n)}}var es={readContext:At,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},MS={readContext:At,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:cp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Cl(4194308,4,Fg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cl(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=RS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:up,useDebugValue:yd,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=up(!1),t=e[0];return e=TS.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,i=Yt();if(Pe){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),Ue===null)throw Error(D(349));Sr&30||Tg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,cp(Ig.bind(null,r,o,e),[e]),r.flags|=2048,bo(9,Rg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Yt(),t=Ue.identifierPrefix;if(Pe){var n=fn,r=dn;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ko++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[qt]=t,e[xo]=r,ry(e,t,!1,!1),t.stateNode=e;e:{switch(l=cu(n,r),n){case"dialog":Ee("cancel",e),Ee("close",e),i=r;break;case"iframe":case"object":case"embed":Ee("load",e),i=r;break;case"video":case"audio":for(i=0;igi&&(t.flags|=128,r=!0,Fi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Jl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Pe)return Ye(t),null}else 2*Ie()-o.renderingStartTime>gi&&n!==1073741824&&(t.flags|=128,r=!0,Fi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ie(),t.sibling=null,n=Ae.current,Se(Ae,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return Cd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function US(e,t){switch(rd(t),t.tag){case 1:return lt(t.type)&&Wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mi(),je(ot),je(qe),fd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dd(t),null;case 13:if(je(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Ae),null;case 4:return mi(),null;case 10:return sd(t.type._context),null;case 22:case 23:return Cd(),null;case 24:return null;default:return null}}var rl=!1,Qe=!1,VS=typeof WeakSet=="function"?WeakSet:Set,G=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Du(e,t,n){try{n()}catch(r){Re(e,t,r)}}var Sp=!1;function HS(e,t){if(wu=$l,e=cg(),td(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(s=l+i),f!==o||r!==0&&f.nodeType!==3||(a=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++u===i&&(s=l),p===o&&++d===r&&(a=l),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Su={focusedElem:e,selectionRange:n},$l=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,S=w.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ot(t.type,y),S);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(C){Re(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=Sp,Sp=!1,w}function no(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Du(t,n,o)}i=i.next}while(i!==r)}}function _s(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ly(e){var t=e.alternate;t!==null&&(e.alternate=null,ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[xo],delete t[bu],delete t[ES],delete t[jS])),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 sy(e){return e.tag===5||e.tag===3||e.tag===4}function kp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sy(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 Fu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hl));else if(r!==4&&(e=e.child,e!==null))for(Fu(e,t,n),e=e.sibling;e!==null;)Fu(e,t,n),e=e.sibling}function Bu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Bu(e,t,n),e=e.sibling;e!==null;)Bu(e,t,n),e=e.sibling}var Ve=null,Dt=!1;function jn(e,t,n){for(n=n.child;n!==null;)ay(e,t,n),n=n.sibling}function ay(e,t,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(ks,n)}catch{}switch(n.tag){case 5:Qe||qr(n,t);case 6:var r=Ve,i=Dt;Ve=null,jn(e,t,n),Ve=r,Dt=i,Ve!==null&&(Dt?(e=Ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ve.removeChild(n.stateNode));break;case 18:Ve!==null&&(Dt?(e=Ve,n=n.stateNode,e.nodeType===8?xa(e.parentNode,n):e.nodeType===1&&xa(e,n),mo(e)):xa(Ve,n.stateNode));break;case 4:r=Ve,i=Dt,Ve=n.stateNode.containerInfo,Dt=!0,jn(e,t,n),Ve=r,Dt=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Du(n,t,l),i=i.next}while(i!==r)}jn(e,t,n);break;case 1:if(!Qe&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Re(n,t,s)}jn(e,t,n);break;case 21:jn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,jn(e,t,n),Qe=r):jn(e,t,n);break;default:jn(e,t,n)}}function Cp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new VS),t.forEach(function(r){var i=ZS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Rt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GS(r/1960))-r,10e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,rs=0,ce&6)throw Error(D(331));var i=ce;for(ce|=4,G=e.current;G!==null;){var o=G,l=o.child;if(G.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aIe()-Sd?yr(e,0):wd|=n),st(e,t)}function gy(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Ze();e=vn(e,t),e!==null&&(Io(e,t,n),st(e,n))}function JS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gy(e,n)}function ZS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),gy(e,n)}var yy;yy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,BS(e,t,n);it=!!(e.flags&131072)}else it=!1,Pe&&t.flags&1048576&&Sg(t,Yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bl(e,t),e=t.pendingProps;var i=di(t,qe.current);ri(t,n),i=md(null,t,r,e,i,n);var o=hd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(o=!0,Gl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ud(t),i.updater=As,t.stateNode=i,i._reactInternals=t,_u(t,r,e,n),t=Iu(null,t,r,!0,o,n)):(t.tag=0,Pe&&o&&nd(t),Je(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=tk(r),e=Ot(r,e),i){case 0:t=Ru(null,t,r,e,n);break e;case 1:t=vp(null,t,r,e,n);break e;case 11:t=gp(null,t,r,e,n);break e;case 14:t=yp(null,t,r,Ot(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),Ru(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),vp(e,t,r,i,n);case 3:e:{if(ey(t),e===null)throw Error(D(387));r=t.pendingProps,o=t.memoizedState,i=o.element,jg(e,t),Xl(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=hi(Error(D(423)),t),t=xp(e,t,r,n,i);break e}else if(r!==i){i=hi(Error(D(424)),t),t=xp(e,t,r,n,i);break e}else for(ht=Un(t.stateNode.containerInfo.firstChild),yt=t,Pe=!0,zt=null,n=Ng(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fi(),r===i){t=xn(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return Pg(t),e===null&&ju(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,ku(r,i)?l=null:o!==null&&ku(r,o)&&(t.flags|=32),Zg(e,t),Je(e,t,l,n),t.child;case 6:return e===null&&ju(t),null;case 13:return ty(e,t,n);case 4:return cd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),gp(e,t,r,i,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,Se(Ql,r._currentValue),r._currentValue=l,o!==null)if(Ut(o.value,l)){if(o.children===i.children&&!ot.current){t=xn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=pn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Pu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(D(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Pu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Je(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ri(t,n),i=At(i),r=r(i),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,i=Ot(r,t.pendingProps),i=Ot(r.type,i),yp(e,t,r,i,n);case 15:return Xg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),bl(e,t),t.tag=1,lt(r)?(e=!0,Gl(t)):e=!1,ri(t,n),Yg(t,r,i),_u(t,r,i,n),Iu(null,t,r,!0,e,n);case 19:return ny(e,t,n);case 22:return Jg(e,t,n)}throw Error(D(156,t.tag))};function vy(e,t){return Wh(e,t)}function ek(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,r){return new ek(e,t,n,r)}function Nd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tk(e){if(typeof e=="function")return Nd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hc)return 11;if(e===Wc)return 14}return 2}function Gn(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function jl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Nd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case $r:return vr(n.children,i,o,t);case Vc:l=8,i|=8;break;case eu:return e=Et(12,n,t,i|2),e.elementType=eu,e.lanes=o,e;case tu:return e=Et(13,n,t,i),e.elementType=tu,e.lanes=o,e;case nu:return e=Et(19,n,t,i),e.elementType=nu,e.lanes=o,e;case Ph:return Rs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Eh:l=10;break e;case jh:l=9;break e;case Hc:l=11;break e;case Wc:l=14;break e;case Rn:l=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=Et(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function vr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function Rs(e,t,n,r){return e=Et(22,e,r,t),e.elementType=Ph,e.lanes=n,e.stateNode={isHidden:!1},e}function ja(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Pa(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nk(e,t,n,r,i){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=aa(0),this.expirationTimes=aa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ed(e,t,n,r,i,o,l,s,a){return e=new nk(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Et(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ud(o),e}function rk(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),kh.exports=wt;var ki=kh.exports;const ak=ws(ki);var Tp=ki;Ja.createRoot=Tp.createRoot,Ja.hydrateRoot=Tp.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Cy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ck(){return Math.random().toString(36).substr(2,8)}function Ip(e,t){return{usr:e.state,key:e.key,idx:t}}function Wu(e,t,n,r){return n===void 0&&(n=null),Eo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ci(t):t,{state:n,key:t&&t.key||r||ck()})}function ls(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ci(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function dk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=zn.Pop,a=null,u=d();u==null&&(u=0,l.replaceState(Eo({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function f(){s=zn.Pop;let S=d(),g=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:g})}function p(S,g){s=zn.Push;let v=Wu(y.location,S,g);n&&n(v,S),u=d()+1;let x=Ip(v,u),C=y.createHref(v);try{l.pushState(x,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(C)}o&&a&&a({action:s,location:y.location,delta:1})}function m(S,g){s=zn.Replace;let v=Wu(y.location,S,g);n&&n(v,S),u=d();let x=Ip(v,u),C=y.createHref(v);l.replaceState(x,"",C),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let g=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof S=="string"?S:ls(S);return v=v.replace(/ $/,"%20"),De(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let y={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(Rp,f),a=S,()=>{i.removeEventListener(Rp,f),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let g=w(S);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:m,go(S){return l.go(S)}};return y}var Mp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mp||(Mp={}));function fk(e,t,n){return n===void 0&&(n="/"),pk(e,t,n,!1)}function pk(e,t,n,r){let i=typeof t=="string"?Ci(t):t,o=_d(i.pathname||"/",n);if(o==null)return null;let l=by(e);mk(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(De(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Kn([r,a.relativePath]),d=n.concat(a);o.children&&o.children.length>0&&(De(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),by(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Sk(u,o.index),routesMeta:d})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Ny(o.path))i(o,l,a)}),t}function Ny(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=Ny(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function mk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const hk=/^:[\w-]+$/,gk=3,yk=2,vk=1,xk=10,wk=-2,Op=e=>e==="*";function Sk(e,t){let n=e.split("/"),r=n.length;return n.some(Op)&&(r+=wk),t&&(r+=yk),n.filter(i=>!Op(i)).reduce((i,o)=>i+(hk.test(o)?gk:o===""?vk:xk),r)}function kk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Ck(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:p,isOptional:m}=d;if(p==="*"){let y=s[f]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[f];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function bk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Cy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Nk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function _d(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Ek(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ci(e):e;return{pathname:n?n.startsWith("/")?n:jk(n,t):t,search:_k(r),hash:Tk(i)}}function jk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Aa(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Pk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ey(e,t){let n=Pk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function jy(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ci(e):(i=Eo({},e),De(!i.pathname||!i.pathname.includes("?"),Aa("?","pathname","search",i)),De(!i.pathname||!i.pathname.includes("#"),Aa("#","pathname","hash",i)),De(!i.search||!i.search.includes("#"),Aa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let f=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}s=f>=0?t[f]:"/"}let a=Ek(i,s),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||d)&&(a.pathname+="/"),a}const Kn=e=>e.join("/").replace(/\/\/+/g,"/"),Ak=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_k=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Rk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Py=["post","put","patch","delete"];new Set(Py);const Ik=["get",...Py];new Set(Ik);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let f=jy(u,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Kn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,l,o,e])}const zk=h.createContext(null);function Fk(e){let t=h.useContext(ir).outlet;return t&&h.createElement(zk.Provider,{value:e},t)}function Ty(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(Tr),{matches:i}=h.useContext(ir),{pathname:o}=zo(),l=JSON.stringify(Ey(i,r.v7_relativeSplatPath));return h.useMemo(()=>jy(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Bk(e,t){return $k(e,t)}function $k(e,t,n,r){Do()||De(!1);let{navigator:i}=h.useContext(Tr),{matches:o}=h.useContext(ir),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=zo(),d;if(t){var f;let S=typeof t=="string"?Ci(t):t;a==="/"||(f=S.pathname)!=null&&f.startsWith(a)||De(!1),d=S}else d=u;let p=d.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=fk(e,{pathname:m}),y=Gk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Kn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Kn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?h.createElement(Ds.Provider,{value:{location:jo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:zn.Pop}},y):y}function Uk(){let e=qk(),t=Rk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,o)}const Vk=h.createElement(Uk,null);class Hk extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(ir.Provider,{value:this.props.routeContext},h.createElement(Ay.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Wk(e){let{routeContext:t,match:n,children:r}=e,i=h.useContext(Td);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(ir.Provider,{value:t},r)}function Gk(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let d=l.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);d>=0||De(!1),l=l.slice(0,Math.min(l.length,d+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((d,f,p)=>{let m,w=!1,y=null,S=null;n&&(m=s&&f.route.id?s[f.route.id]:void 0,y=f.route.errorElement||Vk,a&&(u<0&&p===0?(Jk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=f.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,p+1)),v=()=>{let x;return m?x=y:w?x=S:f.route.Component?x=h.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,h.createElement(Wk,{match:f,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(Hk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var Ry=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ry||{}),ss=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ss||{});function Kk(e){let t=h.useContext(Td);return t||De(!1),t}function Yk(e){let t=h.useContext(Mk);return t||De(!1),t}function Qk(e){let t=h.useContext(ir);return t||De(!1),t}function Iy(e){let t=Qk(),n=t.matches[t.matches.length-1];return n.route.id||De(!1),n.route.id}function qk(){var e;let t=h.useContext(Ay),n=Yk(ss.UseRouteError),r=Iy(ss.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Xk(){let{router:e}=Kk(Ry.UseNavigateStable),t=Iy(ss.UseNavigateStable),n=h.useRef(!1);return _y(()=>{n.current=!0}),h.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,jo({fromRouteId:t},o)))},[e,t])}const Dp={};function Jk(e,t,n){!t&&!Dp[e]&&(Dp[e]=!0)}function Zk(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function eC(e){return Fk(e.context)}function _n(e){De(!1)}function tC(e){let{basename:t="/",children:n=null,location:r,navigationType:i=zn.Pop,navigator:o,static:l=!1,future:s}=e;Do()&&De(!1);let a=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:a,navigator:o,static:l,future:jo({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Ci(r));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:w="default"}=r,y=h.useMemo(()=>{let S=_d(d,a);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:w},navigationType:i}},[a,d,f,p,m,w,i]);return y==null?null:h.createElement(Tr.Provider,{value:u},h.createElement(Ds.Provider,{children:n,value:y}))}function nC(e){let{children:t,location:n}=e;return Bk(Gu(t),n)}new Promise(()=>{});function Gu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,i)=>{if(!h.isValidElement(r))return;let o=[...t,i];if(r.type===h.Fragment){n.push.apply(n,Gu(r.props.children,o));return}r.type!==_n&&De(!1),!r.props.index||!r.props.children||De(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Gu(r.props.children,o)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ku(){return Ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function iC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oC(e,t){return e.button===0&&(!t||t==="_self")&&!iC(e)}const lC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],sC="6";try{window.__reactRouterVersion=sC}catch{}const aC="startTransition",zp=Fc[aC];function uC(e){let{basename:t,children:n,future:r,window:i}=e,o=h.useRef();o.current==null&&(o.current=uk({window:i,v5Compat:!0}));let l=o.current,[s,a]=h.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=h.useCallback(f=>{u&&zp?zp(()=>a(f)):a(f)},[a,u]);return h.useLayoutEffect(()=>l.listen(d),[l,d]),h.useEffect(()=>Zk(r),[r]),h.createElement(tC,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const cC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fC=h.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:d,viewTransition:f}=t,p=rC(t,lC),{basename:m}=h.useContext(Tr),w,y=!1;if(typeof u=="string"&&dC.test(u)&&(w=u,cC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=_d(C.pathname,m);C.origin===x.origin&&E!=null?u=E+C.search+C.hash:y=!0}catch{}let S=Ok(u,{relative:i}),g=pC(u,{replace:l,state:s,target:a,preventScrollReset:d,relative:i,viewTransition:f});function v(x){r&&r(x),x.defaultPrevented||g(x)}return h.createElement("a",Ku({},p,{href:w||S,onClick:y||o?r:v,ref:n,target:a}))});var Fp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fp||(Fp={}));var Bp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Bp||(Bp={}));function pC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Lk(),u=zo(),d=Ty(e,{relative:l});return h.useCallback(f=>{if(oC(f,n)){f.preventDefault();let p=r!==void 0?r:ls(u)===ls(d);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,d,r,i,n,e,o,l,s])}function My(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var zy="!";function SC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,d,f=0;fu?d-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function kC(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var i=r[0]==="[";i?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function CC(e){return{cache:wC(e.cacheSize),splitModifiers:SC(e),...hC(e)}}var bC=/\s+/;function NC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(bC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,d=s.baseClassName,f=s.maybePostfixModifierPosition,p=r(f?d.substring(0,f):d),m=!!f;if(!p){if(!f)return{isTailwindClass:!1,originalClassName:l};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=kC(a).join(":"),y=u?w+zy:w;return{isTailwindClass:!0,modifierId:y,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,d=s+a;return o.has(d)?!1:(o.add(d),i(a,u).forEach(function(f){return o.add(s+f)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function EC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Hp=e=>{const t=VC(e);return t.charAt(0).toUpperCase()+t.slice(1)},$y=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),HC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var WC={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 v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>h.createElement("svg",{ref:a,...WC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$y("lucide",i),...!o&&!HC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,d])=>h.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const te=(e,t)=>{const n=h.forwardRef(({className:r,...i},o)=>h.createElement(GC,{ref:o,iconNode:t,className:$y(`lucide-${UC(Hp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Hp(e),n};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],YC=te("arrow-right",KC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QC=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Uy=te("award",QC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Po=te("book-open",qC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],mn=te("bot",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JC=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Yn=te("brain",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eb=te("check",ZC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Id=te("chevron-down",tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rb=te("chevron-up",nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ob=te("circle-check-big",ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],as=te("cloud",lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ab=te("code",sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Vy=te("copy",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cb=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],db=te("cpu",cb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],zs=te("download",fb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pb=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Hy=te("hard-drive",pb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Jr=te("heart",mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],gb=te("history",hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],vb=te("house",yb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Wy=te("info",xb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qu=te("loader-circle",wb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Qn=te("message-square",Sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Cb=te("panel-left-close",kb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Nb=te("panel-left-open",bb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xu=te("plus",Eb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Pb=te("rotate-ccw",jb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],_b=te("save",Ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tb=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Rb=te("send",Tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ib=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Mb=te("server",Ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ob=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Md=te("settings",Ob);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],Gy=te("share",Lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Db=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ju=te("shield",Db);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zb=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Zu=te("sparkles",zb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Bb=te("square",Fb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $b=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ky=te("star",$b);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ub=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Od=te("trash-2",Ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vb=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Hb=te("trending-up",Vb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wb=[["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"}]],Gb=te("triangle-alert",Wb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kb=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Yb=te("upload",Kb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],qb=te("user",Qb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],us=te("users",Xb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],cs=te("zap",Jb),Zb=[{name:"Home",href:"/",icon:vb,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:Qn,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:Po,description:"Browse and manage AI models"},{name:"My Assistants",href:"/assistants",icon:mn,description:"Manage your custom AI assistants"},{name:"Community",href:"/community",icon:us,description:"Discover and share assistant templates"},{name:"Settings",href:"/settings",icon:Md,description:"Application settings"}];function eN(){const e=zo();return c.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[c.jsx("div",{className:"p-6 border-b",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:c.jsx(Yn,{className:"h-5 w-5 text-primary-foreground"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),c.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),c.jsx("nav",{className:"space-y-1",children:Zb.map(t=>{const n=e.pathname===t.href;return c.jsxs(fC,{to:t.href,className:ue("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[c.jsx(t.icon,{className:"h-4 w-4"}),c.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function tN(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(eN,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(eC,{})})]})}const me=h.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));me.displayName="Card";const jt=h.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));jt.displayName="CardHeader";const $t=h.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));$t.displayName="CardTitle";const nN=h.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));nN.displayName="CardDescription";const ve=h.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));ve.displayName="CardContent";const rN=h.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));rN.displayName="CardFooter";function Wp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Wp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=h.Children.toArray(o),a=s.find(sN);if(a){const u=a.props.children,d=s.map(f=>f===a?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:f);return c.jsx(t,{...l,ref:i,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var iN=yi("Slot");function oN(e){const t=h.forwardRef((n,r)=>{const{children:i,...o}=n;if(h.isValidElement(i)){const l=uN(i),s=aN(o,i.props);return i.type!==h.Fragment&&(s.ref=r?Yy(r,l):l),h.cloneElement(i,s)}return h.Children.count(i)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qy=Symbol("radix.slottable");function lN(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Qy,t}function sN(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qy}function aN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function uN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Gp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kp=Oy,Ld=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Kp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=o==null?void 0:o[u];if(d===null)return null;const p=Gp(d)||Gp(f);return i[u][p]}),s=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...u,f,p]:u},[]);return Kp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Dd=Ld("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pe=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?iN:"button";return c.jsx(l,{className:ue(Dd({variant:t,size:n,className:e})),ref:o,...i})});pe.displayName="Button";const cN=Ld("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Fe({className:e,variant:t,...n}){return c.jsx("div",{className:ue(cN({variant:t}),e),...n})}function dN(){const[e,t]=h.useState({models:0,assistants:0,isOnline:!1});h.useEffect(()=>{n(),r()},[]);const n=()=>{try{const l=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(s=>({...s,assistants:l.length}))}catch(l){console.error("Failed to load stats:",l)}},r=async()=>{try{const l=`${window.location.protocol}//${window.location.host}`,s=await fetch(`${l}/models`);if(s.ok){const a=await s.json();t(u=>{var d;return{...u,models:((d=a.models)==null?void 0:d.length)||0,isOnline:!0}})}}catch(l){console.error("System check failed:",l),t(s=>({...s,isOnline:!1}))}},i=[{title:"Start Chatting",description:"Begin conversations with AI models",icon:Qn,href:"/playground",color:"bg-blue-600",primary:!0},{title:"Browse Models",description:"Manage and load AI models",icon:Po,href:"/models",color:"bg-green-600",primary:!1},{title:"My Assistants",description:"Custom AI assistant configurations",icon:mn,href:"/assistants",color:"bg-purple-600",primary:!1},{title:"Community",description:"Discover and share templates",icon:us,href:"/community",color:"bg-orange-600",primary:!1}],o=[{icon:Ju,title:"Privacy First",description:"Local processing with complete data control"},{icon:cs,title:"High Performance",description:"Optimized for speed and efficiency"},{icon:db,title:"Local & Cloud",description:"Run models locally or access cloud APIs"},{icon:Yn,title:"Advanced Models",description:"Support for latest AI capabilities"}];return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-100 border-b",children:c.jsx("div",{className:"max-w-6xl mx-auto px-6 py-16",children:c.jsxs("div",{className:"text-center space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[c.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:c.jsx(Yn,{className:"h-7 w-7 text-white"})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Edge LLM"}),c.jsx(Fe,{variant:e.isOnline?"default":"secondary",className:"text-xs",children:e.isOnline?"Online":"Offline"})]})]}),c.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Professional AI platform for local and cloud language models. Complete privacy, advanced features, industrial-grade performance."}),c.jsxs("div",{className:"flex items-center justify-center gap-4 pt-4",children:[c.jsxs(pe,{size:"lg",onClick:()=>window.location.href="/playground",className:"flex items-center gap-2",children:[c.jsx(Qn,{className:"h-5 w-5"}),"Start Chatting",c.jsx(YC,{className:"h-4 w-4"})]}),c.jsxs(pe,{size:"lg",variant:"outline",onClick:()=>window.location.href="/models",children:[c.jsx(Po,{className:"h-5 w-5 mr-2"}),"Browse Models"]})]})]})})}),c.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-12 space-y-12",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Quick Actions"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:i.map(l=>c.jsx(me,{className:`hover:shadow-lg transition-all duration-200 cursor-pointer hover:-translate-y-1 ${l.primary?"ring-2 ring-blue-200":""}`,onClick:()=>window.location.href=l.href,children:c.jsxs(ve,{className:"p-6 text-center space-y-4",children:[c.jsx("div",{className:`w-12 h-12 ${l.color} rounded-lg flex items-center justify-center mx-auto`,children:c.jsx(l.icon,{className:"h-6 w-6 text-white"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-lg",children:l.title}),c.jsx("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]})]})},l.title))})]}),c.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[c.jsx(me,{children:c.jsxs(ve,{className:"p-6 text-center",children:[c.jsx("div",{className:"text-3xl font-bold text-blue-600 mb-2",children:e.models}),c.jsx("div",{className:"text-sm text-gray-600",children:"Available Models"})]})}),c.jsx(me,{children:c.jsxs(ve,{className:"p-6 text-center",children:[c.jsx("div",{className:"text-3xl font-bold text-purple-600 mb-2",children:e.assistants}),c.jsx("div",{className:"text-sm text-gray-600",children:"My Assistants"})]})}),c.jsx(me,{children:c.jsxs(ve,{className:"p-6 text-center",children:[c.jsx("div",{className:"text-3xl font-bold text-green-600 mb-2",children:"5"}),c.jsx("div",{className:"text-sm text-gray-600",children:"Community Templates"})]})})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Core Features"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:o.map(l=>c.jsx(me,{className:"text-center",children:c.jsxs(ve,{className:"p-6 space-y-4",children:[c.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mx-auto",children:c.jsx(l.icon,{className:"h-6 w-6 text-gray-700"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold",children:l.title}),c.jsx("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]})]})},l.title))})]}),c.jsxs("section",{className:"text-center bg-gray-50 rounded-2xl p-8",children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Ready to Get Started?"}),c.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:"Choose your preferred way to begin. Load models for local processing or start chatting with cloud APIs immediately."}),c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsxs(pe,{onClick:()=>window.location.href="/playground",children:[c.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Open Playground"]}),c.jsxs(pe,{variant:"outline",onClick:()=>window.location.href="/assistants",children:[c.jsx(mn,{className:"h-4 w-4 mr-2"}),"Create Assistant"]})]})]})]})]})}function ds(e,[t,n]){return Math.min(n,Math.max(t,e))}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function fN(e,t){const n=h.createContext(t),r=o=>{const{children:l,...s}=o,a=h.useMemo(()=>s,Object.values(s));return c.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=h.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Cn(e,t=[]){let n=[];function r(o,l){const s=h.createContext(l),a=n.length;n=[...n,l];const u=f=>{var g;const{scope:p,children:m,...w}=f,y=((g=p==null?void 0:p[e])==null?void 0:g[a])||s,S=h.useMemo(()=>w,Object.values(w));return c.jsx(y.Provider,{value:S,children:m})};u.displayName=o+"Provider";function d(f,p){var y;const m=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,w=h.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,d]}const i=()=>{const o=n.map(l=>h.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,pN(i,...t)]}function pN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const f=a(o)[`__scope${u}`];return{...s,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ge=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},mN=Fc[" useInsertionEffect ".trim().toString()]||Ge;function br({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=hN({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const f=d.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,r])}const u=h.useCallback(d=>{var f;if(s){const p=gN(d)?d(e):d;p!==e&&((f=l.current)==null||f.call(l,p))}else o(d)},[s,e,o,l]);return[a,u]}function hN({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),i=h.useRef(n),o=h.useRef(t);return mN(()=>{o.current=t},[t]),h.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function gN(e){return typeof e=="function"}var yN=h.createContext(void 0);function Fs(e){const t=h.useContext(yN);return e||t||"ltr"}function qy(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Xy(e){const[t,n]=h.useState(void 0);return Ge(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var vN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=vN.reduce((e,t)=>{const n=yi(`Primitive.${t}`),r=h.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xN(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}function zd(e){const t=e+"CollectionProvider",[n,r]=Cn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:g}=y,v=Lt.useRef(null),x=Lt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:x,collectionRef:v,children:g})};l.displayName=t;const s=e+"CollectionSlot",a=yi(s),u=Lt.forwardRef((y,S)=>{const{scope:g,children:v}=y,x=o(s,g),C=fe(S,x.collectionRef);return c.jsx(a,{ref:C,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=yi(d),m=Lt.forwardRef((y,S)=>{const{scope:g,children:v,...x}=y,C=Lt.useRef(null),E=fe(S,C),N=o(d,g);return Lt.useEffect(()=>(N.itemMap.set(C,{ref:C,...x}),()=>void N.itemMap.delete(C))),c.jsx(p,{[f]:"",ref:E,children:v})});m.displayName=d;function w(y){const S=o(e+"CollectionConsumer",y);return Lt.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((N,j)=>x.indexOf(N.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},w,r]}var Jy=["PageUp","PageDown"],Zy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ev={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},bi="Slider",[ec,wN,SN]=zd(bi),[tv,VI]=Cn(bi,[SN]),[kN,Bs]=tv(bi),nv=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...y}=e,S=h.useRef(new Set),g=h.useRef(0),x=l==="horizontal"?CN:bN,[C=[],E]=br({prop:d,defaultProp:u,onChange:T=>{var V;(V=[...S.current][g.current])==null||V.focus(),f(T)}}),N=h.useRef(C);function j(T){const P=AN(C,T);M(T,P)}function _(T){M(T,g.current)}function z(){const T=N.current[g.current];C[g.current]!==T&&p(C)}function M(T,P,{commit:V}={commit:!1}){const O=IN(o),L=MN(Math.round((T-r)/o)*o+r,O),$=ds(L,[r,i]);E((H=[])=>{const A=jN(H,$,P);if(RN(A,a*o)){g.current=A.indexOf($);const F=String(A)!==String(H);return F&&V&&p(A),F?A:H}else return H})}return c.jsx(kN,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:w,children:c.jsx(ec.Provider,{scope:e.__scopeSlider,children:c.jsx(ec.Slot,{scope:e.__scopeSlider,children:c.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:Z(y.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:_,onSlideEnd:s?void 0:z,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,C.length-1,{commit:!0}),onStepKeyDown:({event:T,direction:P})=>{if(!s){const L=Jy.includes(T.key)||T.shiftKey&&Zy.includes(T.key)?10:1,$=g.current,H=C[$],A=o*L*P;M(H+A,$,{commit:!0})}}})})})})});nv.displayName=bi;var[rv,iv]=tv(bi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),CN=h.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...d}=e,[f,p]=h.useState(null),m=fe(t,x=>p(x)),w=h.useRef(void 0),y=Fs(i),S=y==="ltr",g=S&&!o||!S&&o;function v(x){const C=w.current||f.getBoundingClientRect(),E=[0,C.width],j=Fd(E,g?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return c.jsx(rv,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:c.jsx(ov,{dir:y,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=v(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=v(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const E=ev[g?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:E?-1:1})}})})}),bN=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,d=h.useRef(null),f=fe(t,d),p=h.useRef(void 0),m=!i;function w(y){const S=p.current||d.current.getBoundingClientRect(),g=[0,S.height],x=Fd(g,m?[r,n]:[n,r]);return p.current=S,x(y-S.top)}return c.jsx(rv,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:c.jsx(ov,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);o==null||o(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:y=>{const g=ev[m?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:g?-1:1})}})})}),ov=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,d=Bs(bi,n);return c.jsx(ne.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,f=>{f.key==="Home"?(l(f),f.preventDefault()):f.key==="End"?(s(f),f.preventDefault()):Jy.concat(Zy).includes(f.key)&&(a(f),f.preventDefault())}),onPointerDown:Z(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(p)?p.focus():r(f)}),onPointerMove:Z(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:Z(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),o(f))})})}),lv="SliderTrack",sv=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Bs(lv,n);return c.jsx(ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});sv.displayName=lv;var tc="SliderRange",av=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Bs(tc,n),o=iv(tc,n),l=h.useRef(null),s=fe(t,l),a=i.values.length,u=i.values.map(p=>dv(p,i.min,i.max)),d=a>1?Math.min(...u):0,f=100-Math.max(...u);return c.jsx(ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:f+"%"}})});av.displayName=tc;var nc="SliderThumb",uv=h.forwardRef((e,t)=>{const n=wN(e.__scopeSlider),[r,i]=h.useState(null),o=fe(t,s=>i(s)),l=h.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(NN,{...e,ref:o,index:l})}),NN=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Bs(nc,n),s=iv(nc,n),[a,u]=h.useState(null),d=fe(t,v=>u(v)),f=a?l.form||!!a.closest("form"):!0,p=Xy(a),m=l.values[r],w=m===void 0?0:dv(m,l.min,l.max),y=PN(r,l.values.length),S=p==null?void 0:p[s.size],g=S?_N(S,w,s.direction):0;return h.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${g}px)`},children:[c.jsx(ec.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),f&&c.jsx(cv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});uv.displayName=nc;var EN="RadioBubbleInput",cv=h.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=h.useRef(null),o=fe(i,r),l=qy(t);return h.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const f=new Event("input",{bubbles:!0});d.call(s,t),s.dispatchEvent(f)}},[l,t]),c.jsx(ne.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});cv.displayName=EN;function jN(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function dv(e,t,n){const o=100/(n-t)*(e-t);return ds(o,[0,100])}function PN(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function AN(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function _N(e,t,n){const r=e/2,o=Fd([0,50],[0,r]);return(r-o(t)*n)*n}function TN(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function RN(e,t){if(t>0){const n=TN(e);return Math.min(...n)>=t}return!0}function Fd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function IN(e){return(String(e).split(".")[1]||"").length}function MN(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var fv=nv,ON=sv,LN=av,DN=uv;const rc=h.forwardRef(({className:e,...t},n)=>c.jsxs(fv,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(ON,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(LN,{className:"absolute h-full bg-primary"})}),c.jsx(DN,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));rc.displayName=fv.displayName;var zN="Label",pv=h.forwardRef((e,t)=>c.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pv.displayName=zN;var mv=pv;const FN=Ld("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kt=h.forwardRef(({className:e,...t},n)=>c.jsx(mv,{ref:n,className:ue(FN(),e),...t}));kt.displayName=mv.displayName;const hv=h.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));hv.displayName="Input";const Bd=h.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ue("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Bd.displayName="Textarea";function Jn(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function BN(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e);h.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var $N="DismissableLayer",ic="dismissableLayer.update",UN="dismissableLayer.pointerDownOutside",VN="dismissableLayer.focusOutside",Yp,gv=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$d=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=h.useContext(gv),[d,f]=h.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),w=fe(t,j=>f(j)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(S),v=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=g,E=GN(j=>{const _=j.target,z=[...u.branches].some(M=>M.contains(_));!C||z||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=KN(j=>{const _=j.target;[...u.branches].some(M=>M.contains(_))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return BN(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Qp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yp)}},[d,p,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Qp())},[d,u]),h.useEffect(()=>{const j=()=>m({});return document.addEventListener(ic,j),()=>document.removeEventListener(ic,j)},[]),c.jsx(ne.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,E.onPointerDownCapture)})});$d.displayName=$N;var HN="DismissableLayerBranch",WN=h.forwardRef((e,t)=>{const n=h.useContext(gv),r=h.useRef(null),i=fe(t,r);return h.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(ne.div,{...e,ref:i})});WN.displayName=HN;function GN(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=h.useRef(!1),i=h.useRef(()=>{});return h.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){yv(UN,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function KN(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=h.useRef(!1);return h.useEffect(()=>{const i=o=>{o.target&&!r.current&&yv(VN,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qp(){const e=new CustomEvent(ic);document.dispatchEvent(e)}function yv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xN(i,o):i.dispatchEvent(o)}var _a=0;function vv(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qp()),document.body.insertAdjacentElement("beforeend",e[1]??qp()),_a++,()=>{_a===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_a--}},[])}function qp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ta="focusScope.autoFocusOnMount",Ra="focusScope.autoFocusOnUnmount",Xp={bubbles:!1,cancelable:!0},YN="FocusScope",Ud=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=h.useState(null),u=Jn(i),d=Jn(o),f=h.useRef(null),p=fe(t,y=>a(y)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let y=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?f.current=C:Tn(f.current,{select:!0})},S=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Tn(f.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Tn(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const v=new MutationObserver(g);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,m.paused]),h.useEffect(()=>{if(s){Zp.add(m);const y=document.activeElement;if(!s.contains(y)){const g=new CustomEvent(Ta,Xp);s.addEventListener(Ta,u),s.dispatchEvent(g),g.defaultPrevented||(QN(eE(xv(s)),{select:!0}),document.activeElement===y&&Tn(s))}return()=>{s.removeEventListener(Ta,u),setTimeout(()=>{const g=new CustomEvent(Ra,Xp);s.addEventListener(Ra,d),s.dispatchEvent(g),g.defaultPrevented||Tn(y??document.body,{select:!0}),s.removeEventListener(Ra,d),Zp.remove(m)},0)}}},[s,u,d,m]);const w=h.useCallback(y=>{if(!n&&!r||m.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,g=document.activeElement;if(S&&g){const v=y.currentTarget,[x,C]=qN(v);x&&C?!y.shiftKey&&g===C?(y.preventDefault(),n&&Tn(x,{select:!0})):y.shiftKey&&g===x&&(y.preventDefault(),n&&Tn(C,{select:!0})):g===v&&y.preventDefault()}},[n,r,m.paused]);return c.jsx(ne.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Ud.displayName=YN;function QN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tn(r,{select:t}),document.activeElement!==n)return}function qN(e){const t=xv(e),n=Jp(t,e),r=Jp(t.reverse(),e);return[n,r]}function xv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jp(e,t){for(const n of e)if(!XN(n,{upTo:t}))return n}function XN(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function JN(e){return e instanceof HTMLInputElement&&"select"in e}function Tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JN(e)&&t&&e.select()}}var Zp=ZN();function ZN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=em(e,t),e.unshift(t)},remove(t){var n;e=em(e,t),(n=e[0])==null||n.resume()}}}function em(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eE(e){return e.filter(t=>t.tagName!=="A")}var tE=Fc[" useId ".trim().toString()]||(()=>{}),nE=0;function hn(e){const[t,n]=h.useState(tE());return Ge(()=>{e||n(r=>r??String(nE++))},[e]),e||(t?`radix-${t}`:"")}const rE=["top","right","bottom","left"],Zn=Math.min,mt=Math.max,fs=Math.round,sl=Math.floor,nn=e=>({x:e,y:e}),iE={left:"right",right:"left",bottom:"top",top:"bottom"},oE={start:"end",end:"start"};function oc(e,t,n){return mt(e,Zn(t,n))}function wn(e,t){return typeof e=="function"?e(t):e}function Sn(e){return e.split("-")[0]}function Ni(e){return e.split("-")[1]}function Vd(e){return e==="x"?"y":"x"}function Hd(e){return e==="y"?"height":"width"}const lE=new Set(["top","bottom"]);function Zt(e){return lE.has(Sn(e))?"y":"x"}function Wd(e){return Vd(Zt(e))}function sE(e,t,n){n===void 0&&(n=!1);const r=Ni(e),i=Wd(e),o=Hd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ps(l)),[l,ps(l)]}function aE(e){const t=ps(e);return[lc(e),t,lc(t)]}function lc(e){return e.replace(/start|end/g,t=>oE[t])}const tm=["left","right"],nm=["right","left"],uE=["top","bottom"],cE=["bottom","top"];function dE(e,t,n){switch(e){case"top":case"bottom":return n?t?nm:tm:t?tm:nm;case"left":case"right":return t?uE:cE;default:return[]}}function fE(e,t,n,r){const i=Ni(e);let o=dE(Sn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(lc)))),o}function ps(e){return e.replace(/left|right|bottom|top/g,t=>iE[t])}function pE(e){return{top:0,right:0,bottom:0,left:0,...e}}function wv(e){return typeof e!="number"?pE(e):{top:e,right:e,bottom:e,left:e}}function ms(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rm(e,t,n){let{reference:r,floating:i}=e;const o=Zt(t),l=Wd(t),s=Hd(l),a=Sn(t),u=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(a){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Ni(t)){case"start":m[l]-=p*(n&&u?-1:1);break;case"end":m[l]+=p*(n&&u?-1:1);break}return m}const mE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=rm(u,r,a),p=r,m={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:d=0}=wn(e,t)||{};if(u==null)return{};const f=wv(d),p={x:n,y:r},m=Wd(i),w=Hd(m),y=await l.getDimensions(u),S=m==="y",g=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[m]-p[m]-o.floating[w],E=p[m]-o.reference[m],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=N?N[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[x]||o.floating[w]);const _=C/2-E/2,z=j/2-y[w]/2-1,M=Zn(f[g],z),T=Zn(f[v],z),P=M,V=j-y[w]-T,O=j/2-y[w]/2+_,L=oc(P,O,V),$=!a.arrow&&Ni(i)!=null&&O!==L&&o.reference[w]/2-(OO<=0)){var T,P;const O=(((T=o.flip)==null?void 0:T.index)||0)+1,L=j[O];if(L&&(!(f==="alignment"?v!==Zt(L):!1)||M.every(A=>Zt(A.placement)===v?A.overflows[0]>0:!0)))return{data:{index:O,overflows:M},reset:{placement:L}};let $=(P=M.filter(H=>H.overflows[0]<=0).sort((H,A)=>H.overflows[1]-A.overflows[1])[0])==null?void 0:P.placement;if(!$)switch(m){case"bestFit":{var V;const H=(V=M.filter(A=>{if(N){const F=Zt(A.placement);return F===v||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,k)=>F+k,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:V[0];H&&($=H);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function im(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function om(e){return rE.some(t=>e[t]>=0)}const yE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=wn(e,t);switch(r){case"referenceHidden":{const o=await Ao(t,{...i,elementContext:"reference"}),l=im(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:om(l)}}}case"escaped":{const o=await Ao(t,{...i,altBoundary:!0}),l=im(o,n.floating);return{data:{escapedOffsets:l,escaped:om(l)}}}default:return{}}}}},Sv=new Set(["left","top"]);async function vE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Sn(n),s=Ni(n),a=Zt(n)==="y",u=Sv.has(l)?-1:1,d=o&&a?-1:1,f=wn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),a?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const xE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await vE(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},wE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:g,y:v}=S;return{x:g,y:v}}},...a}=wn(e,t),u={x:n,y:r},d=await Ao(t,a),f=Zt(Sn(i)),p=Vd(f);let m=u[p],w=u[f];if(o){const S=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=m+d[S],x=m-d[g];m=oc(v,m,x)}if(l){const S=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=w+d[S],x=w-d[g];w=oc(v,w,x)}const y=s.fn({...t,[p]:m,[f]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[f]:l}}}}}},SE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=wn(e,t),d={x:n,y:r},f=Zt(i),p=Vd(f);let m=d[p],w=d[f];const y=wn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,E=o.reference[p]+o.reference[x]-S.mainAxis;mE&&(m=E)}if(u){var g,v;const x=p==="y"?"width":"height",C=Sv.has(Sn(i)),E=o.reference[f]-o.floating[x]+(C&&((g=l.offset)==null?void 0:g[f])||0)+(C?0:S.crossAxis),N=o.reference[f]+o.reference[x]+(C?0:((v=l.offset)==null?void 0:v[f])||0)-(C?S.crossAxis:0);wN&&(w=N)}return{[p]:m,[f]:w}}}},kE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=wn(e,t),d=await Ao(t,u),f=Sn(i),p=Ni(i),m=Zt(i)==="y",{width:w,height:y}=o.floating;let S,g;f==="top"||f==="bottom"?(S=f,g=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(g=f,S=p==="end"?"top":"bottom");const v=y-d.top-d.bottom,x=w-d.left-d.right,C=Zn(y-d[S],v),E=Zn(w-d[g],x),N=!t.middlewareData.shift;let j=C,_=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),N&&!p){const M=mt(d.left,0),T=mt(d.right,0),P=mt(d.top,0),V=mt(d.bottom,0);m?_=w-2*(M!==0||T!==0?M+T:mt(d.left,d.right)):j=y-2*(P!==0||V!==0?P+V:mt(d.top,d.bottom))}await a({...t,availableWidth:_,availableHeight:j});const z=await l.getDimensions(s.floating);return w!==z.width||y!==z.height?{reset:{rects:!0}}:{}}}};function $s(){return typeof window<"u"}function Ei(e){return kv(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){var t;return(t=(kv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kv(e){return $s()?e instanceof Node||e instanceof vt(e).Node:!1}function Vt(e){return $s()?e instanceof Element||e instanceof vt(e).Element:!1}function rn(e){return $s()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function lm(e){return!$s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const CE=new Set(["inline","contents"]);function Fo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!CE.has(i)}const bE=new Set(["table","td","th"]);function NE(e){return bE.has(Ei(e))}const EE=[":popover-open",":modal"];function Us(e){return EE.some(t=>{try{return e.matches(t)}catch{return!1}})}const jE=["transform","translate","scale","rotate","perspective"],PE=["transform","translate","scale","rotate","perspective","filter"],AE=["paint","layout","strict","content"];function Gd(e){const t=Kd(),n=Vt(e)?Ht(e):e;return jE.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||PE.some(r=>(n.willChange||"").includes(r))||AE.some(r=>(n.contain||"").includes(r))}function _E(e){let t=er(e);for(;rn(t)&&!vi(t);){if(Gd(t))return t;if(Us(t))return null;t=er(t)}return null}function Kd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const TE=new Set(["html","body","#document"]);function vi(e){return TE.has(Ei(e))}function Ht(e){return vt(e).getComputedStyle(e)}function Vs(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if(Ei(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lm(e)&&e.host||ln(e);return lm(t)?t.host:t}function Cv(e){const t=er(e);return vi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rn(t)&&Fo(t)?t:Cv(t)}function _o(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Cv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=vt(i);if(o){const s=sc(l);return t.concat(l,l.visualViewport||[],Fo(i)?i:[],s&&n?_o(s):[])}return t.concat(i,_o(i,[],n))}function sc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bv(e){const t=Ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=rn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=fs(n)!==o||fs(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Yd(e){return Vt(e)?e:e.contextElement}function oi(e){const t=Yd(e);if(!rn(t))return nn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=bv(t);let l=(o?fs(n.width):n.width)/r,s=(o?fs(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const RE=nn(0);function Nv(e){const t=vt(e);return!Kd()||!t.visualViewport?RE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function Nr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Yd(e);let l=nn(1);t&&(r?Vt(r)&&(l=oi(r)):l=oi(e));const s=IE(o,n,r)?Nv(o):nn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,d=i.width/l.x,f=i.height/l.y;if(o){const p=vt(o),m=r&&Vt(r)?vt(r):r;let w=p,y=sc(w);for(;y&&r&&m!==w;){const S=oi(y),g=y.getBoundingClientRect(),v=Ht(y),x=g.left+(y.clientLeft+parseFloat(v.paddingLeft))*S.x,C=g.top+(y.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,d*=S.x,f*=S.y,a+=x,u+=C,w=vt(y),y=sc(w)}}return ms({width:d,height:f,x:a,y:u})}function Hs(e,t){const n=Vs(e).scrollLeft;return t?t.left+n:Nr(ln(e)).left+n}function Ev(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Hs(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function ME(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ln(r),s=t?Us(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=nn(1);const d=nn(0),f=rn(r);if((f||!f&&!o)&&((Ei(r)!=="body"||Fo(l))&&(a=Vs(r)),rn(r))){const m=Nr(r);u=oi(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=l&&!f&&!o?Ev(l,a):nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-a.scrollTop*u.y+d.y+p.y}}function OE(e){return Array.from(e.getClientRects())}function LE(e){const t=ln(e),n=Vs(e),r=e.ownerDocument.body,i=mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Hs(e);const s=-n.scrollTop;return Ht(r).direction==="rtl"&&(l+=mt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const sm=25;function DE(e,t){const n=vt(e),r=ln(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const d=Kd();(!d||d&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Hs(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-f.clientWidth-m);w<=sm&&(o-=w)}else u<=sm&&(o+=u);return{width:o,height:l,x:s,y:a}}const zE=new Set(["absolute","fixed"]);function FE(e,t){const n=Nr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=rn(e)?oi(e):nn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function am(e,t,n){let r;if(t==="viewport")r=DE(e,n);else if(t==="document")r=LE(ln(e));else if(Vt(t))r=FE(t,n);else{const i=Nv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ms(r)}function jv(e,t){const n=er(e);return n===t||!Vt(n)||vi(n)?!1:Ht(n).position==="fixed"||jv(n,t)}function BE(e,t){const n=t.get(e);if(n)return n;let r=_o(e,[],!1).filter(s=>Vt(s)&&Ei(s)!=="body"),i=null;const o=Ht(e).position==="fixed";let l=o?er(e):e;for(;Vt(l)&&!vi(l);){const s=Ht(l),a=Gd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&zE.has(i.position)||Fo(l)&&!a&&jv(e,l))?r=r.filter(d=>d!==l):i=s,l=er(l)}return t.set(e,r),r}function $E(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Us(t)?[]:BE(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,d)=>{const f=am(t,d,i);return u.top=mt(f.top,u.top),u.right=Zn(f.right,u.right),u.bottom=Zn(f.bottom,u.bottom),u.left=mt(f.left,u.left),u},am(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function UE(e){const{width:t,height:n}=bv(e);return{width:t,height:n}}function VE(e,t,n){const r=rn(t),i=ln(t),o=n==="fixed",l=Nr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=nn(0);function u(){a.x=Hs(i)}if(r||!r&&!o)if((Ei(t)!=="body"||Fo(i))&&(s=Vs(t)),r){const m=Nr(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&u();o&&!r&&i&&u();const d=i&&!r&&!o?Ev(i,s):nn(0),f=l.left+s.scrollLeft-a.x-d.x,p=l.top+s.scrollTop-a.y-d.y;return{x:f,y:p,width:l.width,height:l.height}}function Ia(e){return Ht(e).position==="static"}function um(e,t){if(!rn(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ln(e)===n&&(n=n.ownerDocument.body),n}function Pv(e,t){const n=vt(e);if(Us(e))return n;if(!rn(e)){let i=er(e);for(;i&&!vi(i);){if(Vt(i)&&!Ia(i))return i;i=er(i)}return n}let r=um(e,t);for(;r&&NE(r)&&Ia(r);)r=um(r,t);return r&&vi(r)&&Ia(r)&&!Gd(r)?n:r||_E(e)||n}const HE=async function(e){const t=this.getOffsetParent||Pv,n=this.getDimensions,r=await n(e.floating);return{reference:VE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WE(e){return Ht(e).direction==="rtl"}const GE={convertOffsetParentRelativeRectToViewportRelativeRect:ME,getDocumentElement:ln,getClippingRect:$E,getOffsetParent:Pv,getElementRects:HE,getClientRects:OE,getDimensions:UE,getScale:oi,isElement:Vt,isRTL:WE};function Av(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KE(e,t){let n=null,r;const i=ln(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=u;if(s||t(),!p||!m)return;const w=sl(f),y=sl(i.clientWidth-(d+p)),S=sl(i.clientHeight-(f+m)),g=sl(d),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-g+"px",threshold:mt(0,Zn(1,a))||1};let C=!0;function E(N){const j=N[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!Av(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return l(!0),o}function YE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Yd(e),d=i||o?[...u?_o(u):[],..._o(t)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const f=u&&s?KE(u,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!a&&m.observe(u),m.observe(t));let w,y=a?Nr(e):null;a&&S();function S(){const g=Nr(e);y&&!Av(y,g)&&n(),y=g,w=requestAnimationFrame(S)}return n(),()=>{var g;d.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const QE=xE,qE=wE,XE=gE,JE=kE,ZE=yE,cm=hE,e2=SE,t2=(e,t,n)=>{const r=new Map,i={platform:GE,...n},o={...i.platform,_c:r};return mE(e,t,{...i,platform:o})};var n2=typeof document<"u",r2=function(){},Pl=n2?h.useLayoutEffect:r2;function hs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!hs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _v(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dm(e,t){const n=_v(e);return Math.round(t*n)/n}function Ma(e){const t=h.useRef(e);return Pl(()=>{t.current=e}),t}function i2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);hs(p,r)||m(r);const[w,y]=h.useState(null),[S,g]=h.useState(null),v=h.useCallback(A=>{A!==N.current&&(N.current=A,y(A))},[]),x=h.useCallback(A=>{A!==j.current&&(j.current=A,g(A))},[]),C=o||w,E=l||S,N=h.useRef(null),j=h.useRef(null),_=h.useRef(d),z=a!=null,M=Ma(a),T=Ma(i),P=Ma(u),V=h.useCallback(()=>{if(!N.current||!j.current)return;const A={placement:t,strategy:n,middleware:p};T.current&&(A.platform=T.current),t2(N.current,j.current,A).then(F=>{const k={...F,isPositioned:P.current!==!1};O.current&&!hs(_.current,k)&&(_.current=k,ki.flushSync(()=>{f(k)}))})},[p,t,n,T,P]);Pl(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const O=h.useRef(!1);Pl(()=>(O.current=!0,()=>{O.current=!1}),[]),Pl(()=>{if(C&&(N.current=C),E&&(j.current=E),C&&E){if(M.current)return M.current(C,E,V);V()}},[C,E,V,M,z]);const L=h.useMemo(()=>({reference:N,floating:j,setReference:v,setFloating:x}),[v,x]),$=h.useMemo(()=>({reference:C,floating:E}),[C,E]),H=h.useMemo(()=>{const A={position:n,left:0,top:0};if(!$.floating)return A;const F=dm($.floating,d.x),k=dm($.floating,d.y);return s?{...A,transform:"translate("+F+"px, "+k+"px)",..._v($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:k}},[n,s,$.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:V,refs:L,elements:$,floatingStyles:H}),[d,V,L,$,H])}const o2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?cm({element:r.current,padding:i}).fn(n):{}:r?cm({element:r,padding:i}).fn(n):{}}}},l2=(e,t)=>({...QE(e),options:[e,t]}),s2=(e,t)=>({...qE(e),options:[e,t]}),a2=(e,t)=>({...e2(e),options:[e,t]}),u2=(e,t)=>({...XE(e),options:[e,t]}),c2=(e,t)=>({...JE(e),options:[e,t]}),d2=(e,t)=>({...ZE(e),options:[e,t]}),f2=(e,t)=>({...o2(e),options:[e,t]});var p2="Arrow",Tv=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tv.displayName=p2;var m2=Tv,Qd="Popper",[Rv,Iv]=Cn(Qd),[h2,Mv]=Rv(Qd),Ov=e=>{const{__scopePopper:t,children:n}=e,[r,i]=h.useState(null);return c.jsx(h2,{scope:t,anchor:r,onAnchorChange:i,children:n})};Ov.displayName=Qd;var Lv="PopperAnchor",Dv=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Mv(Lv,n),l=h.useRef(null),s=fe(t,l),a=h.useRef(null);return h.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:c.jsx(ne.div,{...i,ref:s})});Dv.displayName=Lv;var qd="PopperContent",[g2,y2]=Rv(qd),zv=h.forwardRef((e,t)=>{var K,ie,Ce,I,W,Q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,S=Mv(qd,n),[g,v]=h.useState(null),x=fe(t,ge=>v(ge)),[C,E]=h.useState(null),N=Xy(C),j=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,z=r+(o!=="center"?"-"+o:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],P=T.length>0,V={padding:M,boundary:T.filter(x2),altBoundary:P},{refs:O,floatingStyles:L,placement:$,isPositioned:H,middlewareData:A}=i2({strategy:"fixed",placement:z,whileElementsMounted:(...ge)=>YE(...ge,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[l2({mainAxis:i+_,alignmentAxis:l}),a&&s2({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?a2():void 0,...V}),a&&u2({...V}),c2({...V,apply:({elements:ge,rects:xe,availableWidth:ct,availableHeight:Nn})=>{const{width:En,height:na}=xe.reference,ar=ge.floating.style;ar.setProperty("--radix-popper-available-width",`${ct}px`),ar.setProperty("--radix-popper-available-height",`${Nn}px`),ar.setProperty("--radix-popper-anchor-width",`${En}px`),ar.setProperty("--radix-popper-anchor-height",`${na}px`)}}),C&&f2({element:C,padding:s}),w2({arrowWidth:j,arrowHeight:_}),p&&d2({strategy:"referenceHidden",...V})]}),[F,k]=$v($),Y=Jn(w);Ge(()=>{H&&(Y==null||Y())},[H,Y]);const q=(K=A.arrow)==null?void 0:K.x,b=(ie=A.arrow)==null?void 0:ie.y,re=((Ce=A.arrow)==null?void 0:Ce.centerOffset)!==0,[Me,se]=h.useState();return Ge(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(I=A.transformOrigin)==null?void 0:I.x,(W=A.transformOrigin)==null?void 0:W.y].join(" "),...((Q=A.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(g2,{scope:n,placedSide:F,onArrowChange:E,arrowX:q,arrowY:b,shouldHideArrow:re,children:c.jsx(ne.div,{"data-side":F,"data-align":k,...y,ref:x,style:{...y.style,animation:H?void 0:"none"}})})})});zv.displayName=qd;var Fv="PopperArrow",v2={top:"bottom",right:"left",bottom:"top",left:"right"},Bv=h.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=y2(Fv,r),l=v2[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(m2,{...i,ref:n,style:{...i.style,display:"block"}})})});Bv.displayName=Fv;function x2(e){return e!==null}var w2=e=>({name:"transformOrigin",options:e,fn(t){var S,g,v;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,d]=$v(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,m=(((v=i.arrow)==null?void 0:v.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?f:`${p}px`,y=`${-a}px`):u==="top"?(w=l?f:`${p}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?f:`${m}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?f:`${m}px`),{data:{x:w,y}}}});function $v(e){const[t,n="center"]=e.split("-");return[t,n]}var S2=Ov,k2=Dv,C2=zv,b2=Bv,N2="Portal",Xd=h.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=h.useState(!1);Ge(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ak.createPortal(c.jsx(ne.div,{...r,ref:t}),l):null});Xd.displayName=N2;var Uv=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),E2="VisuallyHidden",j2=h.forwardRef((e,t)=>c.jsx(ne.span,{...e,ref:t,style:{...Uv,...e.style}}));j2.displayName=E2;var P2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lr=new WeakMap,al=new WeakMap,ul={},Oa=0,Vv=function(e){return e&&(e.host||Vv(e.parentNode))},A2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Vv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_2=function(e,t,n,r){var i=A2(t,Array.isArray(e)?e:[e]);ul[n]||(ul[n]=new WeakMap);var o=ul[n],l=[],s=new Set,a=new Set(i),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};i.forEach(u);var d=function(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))d(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",y=(Lr.get(p)||0)+1,S=(o.get(p)||0)+1;Lr.set(p,y),o.set(p,S),l.push(p),y===1&&w&&al.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(t),s.clear(),Oa++,function(){l.forEach(function(f){var p=Lr.get(f)-1,m=o.get(f)-1;Lr.set(f,p),o.set(f,m),p||(al.has(f)||f.removeAttribute(r),al.delete(f)),m||f.removeAttribute(n)}),Oa--,Oa||(Lr=new WeakMap,Lr=new WeakMap,al=new WeakMap,ul={})}},Hv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||P2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),_2(r,i,n,"aria-hidden")):function(){return null}},Xt=function(){return Xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return K2;var t=Y2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},q2=Yv(),li="data-scroll-locked",X2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(R2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(li,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Al,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(_l,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Al," .").concat(Al,` { + right: 0 `).concat(r,`; + } + + .`).concat(_l," .").concat(_l,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(li,`] { + `).concat(I2,": ").concat(s,`px; + } +`)},mm=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},J2=function(){h.useEffect(function(){return document.body.setAttribute(li,(mm()+1).toString()),function(){var e=mm()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},Z2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;J2();var o=h.useMemo(function(){return Q2(i)},[i]);return h.createElement(q2,{styles:X2(o,!t,i,n?"":"!important")})},ac=!1;if(typeof window<"u")try{var cl=Object.defineProperty({},"passive",{get:function(){return ac=!0,!0}});window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{ac=!1}var Dr=ac?{passive:!1}:!1,ej=function(e){return e.tagName==="TEXTAREA"},Qv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ej(e)&&n[t]==="visible")},tj=function(e){return Qv(e,"overflowY")},nj=function(e){return Qv(e,"overflowX")},hm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=qv(e,r);if(i){var o=Xv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ij=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},qv=function(e,t){return e==="v"?tj(t):nj(t)},Xv=function(e,t){return e==="v"?rj(t):ij(t)},oj=function(e,t){return e==="h"&&t==="rtl"?-1:1},lj=function(e,t,n,r,i){var o=oj(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,d=l>0,f=0,p=0;do{if(!s)break;var m=Xv(e,s),w=m[0],y=m[1],S=m[2],g=y-S-o*w;(w||g)&&qv(e,s)&&(f+=g,p+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(d&&(i&&Math.abs(f)<1||!i&&l>f)||!d&&(i&&Math.abs(p)<1||!i&&-l>p))&&(u=!0),u},dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gm=function(e){return[e.deltaX,e.deltaY]},ym=function(e){return e&&"current"in e?e.current:e},sj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aj=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},uj=0,zr=[];function cj(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),i=h.useState(uj++)[0],o=h.useState(Yv)[0],l=h.useRef(e);h.useEffect(function(){l.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=T2([e.lockRef.current],(e.shards||[]).map(ym),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=h.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var g=dl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-g[0],C="deltaY"in y?y.deltaY:v[1]-g[1],E,N=y.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in y&&j==="h"&&N.type==="range")return!1;var _=hm(j,N);if(!_)return!0;if(_?E=j:(E=j==="v"?"h":"v",_=hm(j,N)),!_)return!1;if(!r.current&&"changedTouches"in y&&(x||C)&&(r.current=E),!E)return!0;var z=r.current||E;return lj(z,S,y,z==="h"?x:C,!0)},[]),a=h.useCallback(function(y){var S=y;if(!(!zr.length||zr[zr.length-1]!==o)){var g="deltaY"in S?gm(S):dl(S),v=t.current.filter(function(E){return E.name===S.type&&(E.target===S.target||S.target===E.shadowParent)&&sj(E.delta,g)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(ym).filter(Boolean).filter(function(E){return E.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=h.useCallback(function(y,S,g,v){var x={name:y,delta:S,target:g,should:v,shadowParent:dj(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=h.useCallback(function(y){n.current=dl(y),r.current=void 0},[]),f=h.useCallback(function(y){u(y.type,gm(y),y.target,s(y,e.lockRef.current))},[]),p=h.useCallback(function(y){u(y.type,dl(y),y.target,s(y,e.lockRef.current))},[]);h.useEffect(function(){return zr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Dr),document.addEventListener("touchmove",a,Dr),document.addEventListener("touchstart",d,Dr),function(){zr=zr.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Dr),document.removeEventListener("touchmove",a,Dr),document.removeEventListener("touchstart",d,Dr)}},[]);var m=e.removeScrollBar,w=e.inert;return h.createElement(h.Fragment,null,w?h.createElement(o,{styles:aj(i)}):null,m?h.createElement(Z2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fj=B2(Kv,cj);var Jv=h.forwardRef(function(e,t){return h.createElement(Ws,Xt({},e,{ref:t,sideCar:fj}))});Jv.classNames=Ws.classNames;const Zv=Jv;var pj=[" ","Enter","ArrowUp","ArrowDown"],mj=[" ","Enter"],Er="Select",[Gs,Ks,hj]=zd(Er),[ji,HI]=Cn(Er,[hj,Iv]),Ys=Iv(),[gj,or]=ji(Er),[yj,vj]=ji(Er),ex=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:w}=e,y=Ys(t),[S,g]=h.useState(null),[v,x]=h.useState(null),[C,E]=h.useState(!1),N=Fs(u),[j,_]=br({prop:r,defaultProp:i??!1,onChange:o,caller:Er}),[z,M]=br({prop:l,defaultProp:s,onChange:a,caller:Er}),T=h.useRef(null),P=S?w||!!S.closest("form"):!0,[V,O]=h.useState(new Set),L=Array.from(V).map($=>$.props.value).join(";");return c.jsx(S2,{...y,children:c.jsxs(gj,{required:m,scope:t,trigger:S,onTriggerChange:g,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:hn(),value:z,onValueChange:M,open:j,onOpenChange:_,dir:N,triggerPointerDownPosRef:T,disabled:p,children:[c.jsx(Gs.Provider,{scope:t,children:c.jsx(yj,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback($=>{O(H=>new Set(H).add($))},[]),onNativeOptionRemove:h.useCallback($=>{O(H=>{const A=new Set(H);return A.delete($),A})},[]),children:n})}),P?c.jsxs(Nx,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:z,onChange:$=>M($.target.value),disabled:p,form:w,children:[z===void 0?c.jsx("option",{value:""}):null,Array.from(V)]},L):null]})})};ex.displayName=Er;var tx="SelectTrigger",nx=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Ys(n),l=or(tx,n),s=l.disabled||r,a=fe(t,l.onTriggerChange),u=Ks(n),d=h.useRef("touch"),[f,p,m]=jx(y=>{const S=u().filter(x=>!x.disabled),g=S.find(x=>x.value===l.value),v=Px(S,y,g);v!==void 0&&l.onValueChange(v.value)}),w=y=>{s||(l.onOpenChange(!0),m()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return c.jsx(k2,{asChild:!0,...o,children:c.jsx(ne.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ex(l.value)?"":void 0,...i,ref:a,onClick:Z(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&w(y)}),onPointerDown:Z(i.onPointerDown,y=>{d.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:Z(i.onKeyDown,y=>{const S=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&pj.includes(y.key)&&(w(),y.preventDefault())})})})});nx.displayName=tx;var rx="SelectValue",ix=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=or(rx,n),{onValueNodeHasChildrenChange:u}=a,d=o!==void 0,f=fe(t,a.onValueNodeChange);return Ge(()=>{u(d)},[u,d]),c.jsx(ne.span,{...s,ref:f,style:{pointerEvents:"none"},children:Ex(a.value)?c.jsx(c.Fragment,{children:l}):o})});ix.displayName=rx;var xj="SelectIcon",ox=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});ox.displayName=xj;var wj="SelectPortal",lx=e=>c.jsx(Xd,{asChild:!0,...e});lx.displayName=wj;var jr="SelectContent",sx=h.forwardRef((e,t)=>{const n=or(jr,e.__scopeSelect),[r,i]=h.useState();if(Ge(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ki.createPortal(c.jsx(ax,{scope:e.__scopeSelect,children:c.jsx(Gs.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(ux,{...e,ref:t})});sx.displayName=jr;var Mt=10,[ax,lr]=ji(jr),Sj="SelectContentImpl",kj=yi("SelectContent.RemoveScroll"),ux=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S,...g}=e,v=or(jr,n),[x,C]=h.useState(null),[E,N]=h.useState(null),j=fe(t,K=>C(K)),[_,z]=h.useState(null),[M,T]=h.useState(null),P=Ks(n),[V,O]=h.useState(!1),L=h.useRef(!1);h.useEffect(()=>{if(x)return Hv(x)},[x]),vv();const $=h.useCallback(K=>{const[ie,...Ce]=P().map(Q=>Q.ref.current),[I]=Ce.slice(-1),W=document.activeElement;for(const Q of K)if(Q===W||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===ie&&E&&(E.scrollTop=0),Q===I&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==W))return},[P,E]),H=h.useCallback(()=>$([_,x]),[$,_,x]);h.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:A,triggerPointerDownPosRef:F}=v;h.useEffect(()=>{if(x){let K={x:0,y:0};const ie=I=>{var W,Q;K={x:Math.abs(Math.round(I.pageX)-(((W=F.current)==null?void 0:W.x)??0)),y:Math.abs(Math.round(I.pageY)-(((Q=F.current)==null?void 0:Q.y)??0))}},Ce=I=>{K.x<=10&&K.y<=10?I.preventDefault():x.contains(I.target)||A(!1),document.removeEventListener("pointermove",ie),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[x,A,F]),h.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[k,Y]=jx(K=>{const ie=P().filter(W=>!W.disabled),Ce=ie.find(W=>W.ref.current===document.activeElement),I=Px(ie,K,Ce);I&&setTimeout(()=>I.ref.current.focus())}),q=h.useCallback((K,ie,Ce)=>{const I=!L.current&&!Ce;(v.value!==void 0&&v.value===ie||I)&&(z(K),I&&(L.current=!0))},[v.value]),b=h.useCallback(()=>x==null?void 0:x.focus(),[x]),re=h.useCallback((K,ie,Ce)=>{const I=!L.current&&!Ce;(v.value!==void 0&&v.value===ie||I)&&T(K)},[v.value]),Me=r==="popper"?uc:cx,se=Me===uc?{side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return c.jsx(ax,{scope:n,content:x,viewport:E,onViewportChange:N,itemRefCallback:q,selectedItem:_,onItemLeave:b,itemTextRefCallback:re,focusSelectedItem:H,selectedItemText:M,position:r,isPositioned:V,searchRef:k,children:c.jsx(Zv,{as:kj,allowPinchZoom:!0,children:c.jsx(Ud,{asChild:!0,trapped:v.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Z(i,K=>{var ie;(ie=v.trigger)==null||ie.focus({preventScroll:!0}),K.preventDefault()}),children:c.jsx($d,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(Me,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:K=>K.preventDefault(),...g,...se,onPlaced:()=>O(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Z(g.onKeyDown,K=>{const ie=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ie&&K.key.length===1&&Y(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let I=P().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(K.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const W=K.target,Q=I.indexOf(W);I=I.slice(Q+1)}setTimeout(()=>$(I)),K.preventDefault()}})})})})})})});ux.displayName=Sj;var Cj="SelectItemAlignedPosition",cx=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=or(jr,n),l=lr(jr,n),[s,a]=h.useState(null),[u,d]=h.useState(null),f=fe(t,j=>d(j)),p=Ks(n),m=h.useRef(!1),w=h.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:g,focusSelectedItem:v}=l,x=h.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&y&&S&&g){const j=o.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(o.dir!=="rtl"){const W=M.left-_.left,Q=z.left-W,ge=j.left-Q,xe=j.width+ge,ct=Math.max(xe,_.width),Nn=window.innerWidth-Mt,En=ds(Q,[Mt,Math.max(Mt,Nn-ct)]);s.style.minWidth=xe+"px",s.style.left=En+"px"}else{const W=_.right-M.right,Q=window.innerWidth-z.right-W,ge=window.innerWidth-j.right-Q,xe=j.width+ge,ct=Math.max(xe,_.width),Nn=window.innerWidth-Mt,En=ds(Q,[Mt,Math.max(Mt,Nn-ct)]);s.style.minWidth=xe+"px",s.style.right=En+"px"}const T=p(),P=window.innerHeight-Mt*2,V=y.scrollHeight,O=window.getComputedStyle(u),L=parseInt(O.borderTopWidth,10),$=parseInt(O.paddingTop,10),H=parseInt(O.borderBottomWidth,10),A=parseInt(O.paddingBottom,10),F=L+$+V+A+H,k=Math.min(S.offsetHeight*5,F),Y=window.getComputedStyle(y),q=parseInt(Y.paddingTop,10),b=parseInt(Y.paddingBottom,10),re=j.top+j.height/2-Mt,Me=P-re,se=S.offsetHeight/2,K=S.offsetTop+se,ie=L+$+K,Ce=F-ie;if(ie<=re){const W=T.length>0&&S===T[T.length-1].ref.current;s.style.bottom="0px";const Q=u.clientHeight-y.offsetTop-y.offsetHeight,ge=Math.max(Me,se+(W?b:0)+Q+H),xe=ie+ge;s.style.height=xe+"px"}else{const W=T.length>0&&S===T[0].ref.current;s.style.top="0px";const ge=Math.max(re,L+y.offsetTop+(W?q:0)+se)+Ce;s.style.height=ge+"px",y.scrollTop=ie-re+y.offsetTop}s.style.margin=`${Mt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,y,S,g,o.dir,r]);Ge(()=>x(),[x]);const[C,E]=h.useState();Ge(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const N=h.useCallback(j=>{j&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return c.jsx(Nj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(ne.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});cx.displayName=Cj;var bj="SelectPopperPosition",uc=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Mt,...o}=e,l=Ys(n);return c.jsx(C2,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uc.displayName=bj;var[Nj,Jd]=ji(jr,{}),cc="SelectViewport",dx=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=lr(cc,n),l=Jd(cc,n),s=fe(t,o.onViewportChange),a=h.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Gs.Slot,{scope:n,children:c.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&f){const m=Math.abs(a.current-d.scrollTop);if(m>0){const w=window.innerHeight-Mt*2,y=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),g=Math.max(y,S);if(g0?C:0,f.style.justifyContent="flex-end")}}}a.current=d.scrollTop})})})]})});dx.displayName=cc;var fx="SelectGroup",[Ej,jj]=ji(fx),px=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hn();return c.jsx(Ej,{scope:n,id:i,children:c.jsx(ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});px.displayName=fx;var mx="SelectLabel",hx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=jj(mx,n);return c.jsx(ne.div,{id:i.id,...r,ref:t})});hx.displayName=mx;var gs="SelectItem",[Pj,gx]=ji(gs),yx=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=or(gs,n),a=lr(gs,n),u=s.value===r,[d,f]=h.useState(o??""),[p,m]=h.useState(!1),w=fe(t,v=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,v,r,i)}),y=hn(),S=h.useRef("touch"),g=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Pj,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:h.useCallback(v=>{f(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Gs.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:c.jsx(ne.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>m(!0)),onBlur:Z(l.onBlur,()=>m(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:Z(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:Z(l.onPointerMove,v=>{var x;S.current=v.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Z(l.onKeyDown,v=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(mj.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});yx.displayName=gs;var Qi="SelectItemText",vx=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=or(Qi,n),s=lr(Qi,n),a=gx(Qi,n),u=vj(Qi,n),[d,f]=h.useState(null),p=fe(t,g=>f(g),a.onItemTextChange,g=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,g,a.value,a.disabled)}),m=d==null?void 0:d.textContent,w=h.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return Ge(()=>(y(w),()=>S(w)),[y,S,w]),c.jsxs(c.Fragment,{children:[c.jsx(ne.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ki.createPortal(o.children,l.valueNode):null]})});vx.displayName=Qi;var xx="SelectItemIndicator",wx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return gx(xx,n).isSelected?c.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});wx.displayName=xx;var dc="SelectScrollUpButton",Sx=h.forwardRef((e,t)=>{const n=lr(dc,e.__scopeSelect),r=Jd(dc,e.__scopeSelect),[i,o]=h.useState(!1),l=fe(t,r.onScrollButtonChange);return Ge(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(Cx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Sx.displayName=dc;var fc="SelectScrollDownButton",kx=h.forwardRef((e,t)=>{const n=lr(fc,e.__scopeSelect),r=Jd(fc,e.__scopeSelect),[i,o]=h.useState(!1),l=fe(t,r.onScrollButtonChange);return Ge(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(Cx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});kx.displayName=fc;var Cx=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=lr("SelectScrollButton",n),l=h.useRef(null),s=Ks(n),a=h.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return h.useEffect(()=>()=>a(),[a]),Ge(()=>{var d;const u=s().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),c.jsx(ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Z(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{a()})})}),Aj="SelectSeparator",bx=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});bx.displayName=Aj;var pc="SelectArrow",_j=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ys(n),o=or(pc,n),l=lr(pc,n);return o.open&&l.position==="popper"?c.jsx(b2,{...i,...r,ref:t}):null});_j.displayName=pc;var Tj="SelectBubbleInput",Nx=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=h.useRef(null),o=fe(r,i),l=qy(t);return h.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const f=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(f)}},[l,t]),c.jsx(ne.select,{...n,style:{...Uv,...n.style},ref:o,defaultValue:t})});Nx.displayName=Tj;function Ex(e){return e===""||e===void 0}function jx(e){const t=Jn(e),n=h.useRef(""),r=h.useRef(0),i=h.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Px(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Rj(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function Rj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ij=ex,Ax=nx,Mj=ix,Oj=ox,Lj=lx,_x=sx,Dj=dx,zj=px,Tx=hx,Rx=yx,Fj=vx,Bj=wx,Ix=Sx,Mx=kx,Ox=bx;const $j=Ij,vm=zj,Uj=Mj,Lx=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Ax,{ref:r,className:ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(Oj,{asChild:!0,children:c.jsx(Id,{className:"h-4 w-4 opacity-50"})})]}));Lx.displayName=Ax.displayName;const Dx=h.forwardRef(({className:e,...t},n)=>c.jsx(Ix,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(rb,{className:"h-4 w-4"})}));Dx.displayName=Ix.displayName;const zx=h.forwardRef(({className:e,...t},n)=>c.jsx(Mx,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Id,{className:"h-4 w-4"})}));zx.displayName=Mx.displayName;const Fx=h.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(Lj,{children:c.jsxs(_x,{ref:i,className:ue("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(Dx,{}),c.jsx(Dj,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(zx,{})]})}));Fx.displayName=_x.displayName;const mc=h.forwardRef(({className:e,...t},n)=>c.jsx(Tx,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));mc.displayName=Tx.displayName;const hc=h.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Rx,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Bj,{children:c.jsx(eb,{className:"h-4 w-4"})})}),c.jsx(Fj,{children:t})]}));hc.displayName=Rx.displayName;const Vj=h.forwardRef(({className:e,...t},n)=>c.jsx(Ox,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));Vj.displayName=Ox.displayName;function Hj(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Pi=e=>{const{present:t,children:n}=e,r=Wj(t),i=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=fe(r.ref,Gj(i));return typeof n=="function"||r.isPresent?h.cloneElement(i,{ref:o}):null};Pi.displayName="Presence";function Wj(e){const[t,n]=h.useState(),r=h.useRef(null),i=h.useRef(e),o=h.useRef("none"),l=e?"mounted":"unmounted",[s,a]=Hj(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=fl(r.current);o.current=s==="mounted"?u:"none"},[s]),Ge(()=>{const u=r.current,d=i.current;if(d!==e){const p=o.current,m=fl(u);e?a("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Ge(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const y=fl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=fl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function fl(e){return(e==null?void 0:e.animationName)||"none"}function Gj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qs="Collapsible",[Kj,WI]=Cn(Qs),[Yj,Zd]=Kj(Qs),Bx=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=e,[a,u]=br({prop:r,defaultProp:i??!1,onChange:l,caller:Qs});return c.jsx(Yj,{scope:n,disabled:o,contentId:hn(),open:a,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),children:c.jsx(ne.div,{"data-state":tf(a),"data-disabled":o?"":void 0,...s,ref:t})})});Bx.displayName=Qs;var $x="CollapsibleTrigger",Ux=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Zd($x,n);return c.jsx(ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":tf(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Z(e.onClick,i.onOpenToggle)})});Ux.displayName=$x;var ef="CollapsibleContent",Vx=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Zd(ef,e.__scopeCollapsible);return c.jsx(Pi,{present:n||i.open,children:({present:o})=>c.jsx(Qj,{...r,ref:t,present:o})})});Vx.displayName=ef;var Qj=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=Zd(ef,n),[s,a]=h.useState(r),u=h.useRef(null),d=fe(t,u),f=h.useRef(0),p=f.current,m=h.useRef(0),w=m.current,y=l.open||s,S=h.useRef(y),g=h.useRef(void 0);return h.useEffect(()=>{const v=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(v)},[]),Ge(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();f.current=x.height,m.current=x.width,S.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),a(r)}},[l.open,r]),c.jsx(ne.div,{"data-state":tf(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:y&&i})});function tf(e){return e?"open":"closed"}var qj=Bx;const Xj=qj,Jj=Ux,Zj=Vx;var qs="Dialog",[Hx,Wx]=Cn(qs),[eP,Wt]=Hx(qs),Gx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=h.useRef(null),a=h.useRef(null),[u,d]=br({prop:r,defaultProp:i??!1,onChange:o,caller:qs});return c.jsx(eP,{scope:t,triggerRef:s,contentRef:a,contentId:hn(),titleId:hn(),descriptionId:hn(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:l,children:n})};Gx.displayName=qs;var Kx="DialogTrigger",Yx=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Kx,n),o=fe(t,i.triggerRef);return c.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":of(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});Yx.displayName=Kx;var nf="DialogPortal",[tP,Qx]=Hx(nf,{forceMount:void 0}),qx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Wt(nf,t);return c.jsx(tP,{scope:t,forceMount:n,children:h.Children.map(r,l=>c.jsx(Pi,{present:n||o.open,children:c.jsx(Xd,{asChild:!0,container:i,children:l})}))})};qx.displayName=nf;var ys="DialogOverlay",Xx=h.forwardRef((e,t)=>{const n=Qx(ys,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(ys,e.__scopeDialog);return o.modal?c.jsx(Pi,{present:r||o.open,children:c.jsx(rP,{...i,ref:t})}):null});Xx.displayName=ys;var nP=yi("DialogOverlay.RemoveScroll"),rP=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(ys,n);return c.jsx(Zv,{as:nP,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(ne.div,{"data-state":of(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pr="DialogContent",Jx=h.forwardRef((e,t)=>{const n=Qx(Pr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pr,e.__scopeDialog);return c.jsx(Pi,{present:r||o.open,children:o.modal?c.jsx(iP,{...i,ref:t}):c.jsx(oP,{...i,ref:t})})});Jx.displayName=Pr;var iP=h.forwardRef((e,t)=>{const n=Wt(Pr,e.__scopeDialog),r=h.useRef(null),i=fe(t,n.contentRef,r);return h.useEffect(()=>{const o=r.current;if(o)return Hv(o)},[]),c.jsx(Zx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),oP=h.forwardRef((e,t)=>{const n=Wt(Pr,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return c.jsx(Zx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Zx=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Wt(Pr,n),a=h.useRef(null),u=fe(t,a);return vv(),c.jsxs(c.Fragment,{children:[c.jsx(Ud,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx($d,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":of(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(sP,{titleId:s.titleId}),c.jsx(uP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),rf="DialogTitle",e0=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(rf,n);return c.jsx(ne.h2,{id:i.titleId,...r,ref:t})});e0.displayName=rf;var t0="DialogDescription",n0=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(t0,n);return c.jsx(ne.p,{id:i.descriptionId,...r,ref:t})});n0.displayName=t0;var r0="DialogClose",i0=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(r0,n);return c.jsx(ne.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});i0.displayName=r0;function of(e){return e?"open":"closed"}var o0="DialogTitleWarning",[lP,l0]=fN(o0,{contentName:Pr,titleName:rf,docsSlug:"dialog"}),sP=({titleId:e})=>{const t=l0(o0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aP="DialogDescriptionWarning",uP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${l0(aP).contentName}}.`;return h.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},cP=Gx,dP=Yx,fP=qx,pP=Xx,mP=Jx,hP=e0,gP=n0,s0=i0,a0="AlertDialog",[yP,GI]=Cn(a0,[Wx]),bn=Wx(),u0=e=>{const{__scopeAlertDialog:t,...n}=e,r=bn(t);return c.jsx(cP,{...r,...n,modal:!0})};u0.displayName=a0;var vP="AlertDialogTrigger",xP=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bn(n);return c.jsx(dP,{...i,...r,ref:t})});xP.displayName=vP;var wP="AlertDialogPortal",c0=e=>{const{__scopeAlertDialog:t,...n}=e,r=bn(t);return c.jsx(fP,{...r,...n})};c0.displayName=wP;var SP="AlertDialogOverlay",d0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bn(n);return c.jsx(pP,{...i,...r,ref:t})});d0.displayName=SP;var si="AlertDialogContent",[kP,CP]=yP(si),bP=lN("AlertDialogContent"),f0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=bn(n),l=h.useRef(null),s=fe(t,l),a=h.useRef(null);return c.jsx(lP,{contentName:si,titleName:p0,docsSlug:"alert-dialog",children:c.jsx(kP,{scope:n,cancelRef:a,children:c.jsxs(mP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=a.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(bP,{children:r}),c.jsx(EP,{contentRef:l})]})})})});f0.displayName=si;var p0="AlertDialogTitle",m0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bn(n);return c.jsx(hP,{...i,...r,ref:t})});m0.displayName=p0;var h0="AlertDialogDescription",g0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bn(n);return c.jsx(gP,{...i,...r,ref:t})});g0.displayName=h0;var NP="AlertDialogAction",y0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bn(n);return c.jsx(s0,{...i,...r,ref:t})});y0.displayName=NP;var v0="AlertDialogCancel",x0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=CP(v0,n),o=bn(n),l=fe(t,i);return c.jsx(s0,{...o,...r,ref:l})});x0.displayName=v0;var EP=({contentRef:e})=>{const t=`\`${si}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${si}\` by passing a \`${h0}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${si}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},jP=u0,PP=c0,w0=d0,S0=f0,k0=y0,C0=x0,b0=m0,N0=g0;const xm=jP,AP=PP,E0=h.forwardRef(({className:e,...t},n)=>c.jsx(w0,{className:ue("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));E0.displayName=w0.displayName;const gc=h.forwardRef(({className:e,...t},n)=>c.jsxs(AP,{children:[c.jsx(E0,{}),c.jsx(S0,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));gc.displayName=S0.displayName;const yc=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});yc.displayName="AlertDialogHeader";const vc=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vc.displayName="AlertDialogFooter";const xc=h.forwardRef(({className:e,...t},n)=>c.jsx(b0,{ref:n,className:ue("text-lg font-semibold",e),...t}));xc.displayName=b0.displayName;const wc=h.forwardRef(({className:e,...t},n)=>c.jsx(N0,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));wc.displayName=N0.displayName;const Sc=h.forwardRef(({className:e,...t},n)=>c.jsx(k0,{ref:n,className:ue(Dd(),e),...t}));Sc.displayName=k0.displayName;const kc=h.forwardRef(({className:e,...t},n)=>c.jsx(C0,{ref:n,className:ue(Dd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));kc.displayName=C0.displayName;function _P(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IP={};function wm(e,t){return((t||IP).jsx?RP:TP).test(e)}const MP=/[ \t\n\f\r]/g;function OP(e){return typeof e=="object"?e.type==="text"?Sm(e.value):!1:Sm(e)}function Sm(e){return e.replace(MP,"")===""}class Bo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bo.prototype.normal={};Bo.prototype.property={};Bo.prototype.space=void 0;function j0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bo(n,r,t)}function Cc(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="";ut.prototype.booleanish=!1;ut.prototype.boolean=!1;ut.prototype.commaOrSpaceSeparated=!1;ut.prototype.commaSeparated=!1;ut.prototype.defined=!1;ut.prototype.mustUseProperty=!1;ut.prototype.number=!1;ut.prototype.overloadedBoolean=!1;ut.prototype.property="";ut.prototype.spaceSeparated=!1;ut.prototype.space=void 0;let LP=0;const ee=Ir(),Oe=Ir(),bc=Ir(),B=Ir(),we=Ir(),ai=Ir(),ft=Ir();function Ir(){return 2**++LP}const Nc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Oe,commaOrSpaceSeparated:ft,commaSeparated:ai,number:B,overloadedBoolean:bc,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),Fa=Object.keys(Nc);class lf extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),km(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&$P.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Cm,HP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Cm.test(o)){let l=o.replace(BP,VP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=lf}return new i(r,t)}function VP(e){return"-"+e.toLowerCase()}function HP(e){return e.charAt(1).toUpperCase()}const WP=j0([P0,DP,T0,R0,I0],"html"),sf=j0([P0,zP,T0,R0,I0],"svg");function GP(e){return e.join(" ").trim()}var af={},bm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,KP=/\n/g,YP=/^\s*/,QP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qP=/^:\s*/,XP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,JP=/^[;\s]*/,ZP=/^\s+|\s+$/g,eA=` +`,Nm="/",Em="*",fr="",tA="comment",nA="declaration",rA=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var y=w.match(KP);y&&(n+=y.length);var S=w.lastIndexOf(eA);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return i(S),e=e.slice(S.length),y}}function u(){a(YP)}function d(w){var y;for(w=w||[];y=f();)y!==!1&&w.push(y);return w}function f(){var w=o();if(!(Nm!=e.charAt(0)||Em!=e.charAt(1))){for(var y=2;fr!=e.charAt(y)&&(Em!=e.charAt(y)||Nm!=e.charAt(y+1));)++y;if(y+=2,fr===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,i(S),e=e.slice(y),r+=2,w({type:tA,comment:S})}}function p(){var w=o(),y=a(QP);if(y){if(f(),!a(qP))return s("property missing ':'");var S=a(XP),g=w({type:nA,property:jm(y[0].replace(bm,fr)),value:S?jm(S[0].replace(bm,fr)):fr});return a(JP),g}}function m(){var w=[];d(w);for(var y;y=p();)y!==!1&&(w.push(y),d(w));return w}return u(),m()};function jm(e){return e?e.replace(ZP,fr):fr}var iA=Ol&&Ol.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(af,"__esModule",{value:!0});af.default=lA;var oA=iA(rA);function lA(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,oA.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.camelCase=void 0;var sA=/^--[a-zA-Z0-9_-]+$/,aA=/-([a-z])/g,uA=/^[^-]+$/,cA=/^-(webkit|moz|ms|o|khtml)-/,dA=/^-(ms)-/,fA=function(e){return!e||uA.test(e)||sA.test(e)},pA=function(e,t){return t.toUpperCase()},Pm=function(e,t){return"".concat(t,"-")},mA=function(e,t){return t===void 0&&(t={}),fA(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(dA,Pm):e=e.replace(cA,Pm),e.replace(aA,pA))};Xs.camelCase=mA;var hA=Ol&&Ol.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gA=hA(af),yA=Xs;function Ec(e,t){var n={};return!e||typeof e!="string"||(0,gA.default)(e,function(r,i){r&&i&&(n[(0,yA.camelCase)(r,t)]=i)}),n}Ec.default=Ec;var vA=Ec;const xA=ws(vA),M0=O0("end"),uf=O0("start");function O0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wA(e){const t=uf(e),n=M0(e);if(t&&n)return{start:t,end:n}}function oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Am(e.position):"start"in e||"end"in e?Am(e):"line"in e||"column"in e?jc(e):""}function jc(e){return _m(e&&e.line)+":"+_m(e&&e.column)}function Am(e){return jc(e&&e.start)+"-"+jc(e&&e.end)}function _m(e){return e&&typeof e=="number"?e:1}class Xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=oo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const cf={}.hasOwnProperty,SA=new Map,kA=/[A-Z]/g,CA=new Set(["table","tbody","thead","tfoot","tr"]),bA=new Set(["td","th"]),L0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function NA(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=IA(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=RA(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?sf:WP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=D0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function D0(e,t,n){if(t.type==="element")return EA(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return AA(e,t,n);if(t.type==="mdxjsEsm")return PA(e,t);if(t.type==="root")return _A(e,t,n);if(t.type==="text")return TA(e,t)}function EA(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=sf,e.schema=i),e.ancestors.push(t);const o=F0(e,t.tagName,!1),l=MA(e,t);let s=ff(e,t);return CA.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!OP(a):!0})),z0(e,l,o,t),df(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function jA(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}To(e,t.position)}function PA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);To(e,t.position)}function AA(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=sf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:F0(e,t.name,!0),l=OA(e,t),s=ff(e,t);return z0(e,l,o,t),df(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function _A(e,t,n){const r={};return df(r,ff(e,t)),e.create(t,e.Fragment,r,n)}function TA(e,t){return t.value}function z0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function df(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function RA(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function IA(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=uf(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function MA(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&cf.call(t.properties,i)){const o=LA(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&bA.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function OA(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else To(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else To(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function ff(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:SA;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(on(e,e.length,0,t),e):t}const Im={}.hasOwnProperty;function HA(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=sr(/[A-Za-z]/),gt=sr(/[\dA-Za-z]/),KA=sr(/[#-'*+\--9=?A-Z^-~]/);function Pc(e){return e!==null&&(e<32||e===127)}const Ac=sr(/\d/),YA=sr(/[\dA-Fa-f]/),QA=sr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const qA=sr(/\p{P}|\p{S}/u),XA=sr(/\s/);function sr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _i(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return de(a)?(e.enter(n),s(a)):t(a)}function s(a){return de(a)&&o++l))return;const j=t.events.length;let _=j,z,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(z){M=t.events[_][1].end;break}z=!0}for(g(r),N=j;Nx;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function n_(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Om(e){if(e===null||at(e)||XA(e))return 1;if(qA(e))return 2}function mf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Lm(f,-a),Lm(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Nt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Nt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=Nt(u,mf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Nt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Nt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,on(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&de(N)?ke(e,v,"linePrefix",o+1)(N):v(N)}function v(N){return N===null||X(N)?e.check(Dm,y,C)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||X(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),x)}function C(N){return e.exit("codeFenced"),t(N)}function E(N,j,_){let z=0;return M;function M(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),T}function T(L){return N.enter("codeFencedFence"),de(L)?ke(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===s?(N.enter("codeFencedFenceSequence"),V(L)):_(L)}function V(L){return L===s?(z++,N.consume(L),V):z>=l?(N.exit("codeFencedFenceSequence"),de(L)?ke(N,O,"whitespace")(L):O(L)):_(L)}function O(L){return L===null||X(L)?(N.exit("codeFencedFence"),j(L)):_(L)}}}function m_(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const $a={name:"codeIndented",tokenize:g_},h_={partial:!0,tokenize:y_};function g_(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",4+1)(u)}function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):X(u)?e.attempt(h_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function y_(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ke(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const v_={name:"codeText",previous:w_,resolve:x_,tokenize:S_};function x_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Vi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function G0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||Pc(g)?n(g):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(g))}function p(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===62?(e.exit("chunkString"),e.exit(s),p(g)):g===null||g===60||X(g)?n(g):(e.consume(g),g===92?w:m)}function w(g){return g===60||g===62||g===92?(e.consume(g),m):m(g)}function y(g){return!d&&(g===null||g===41||at(g))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(g)):d999||m===null||m===91||m===93&&!a||m===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):X(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||X(m)||s++>999?(e.exit("chunkString"),d(m)):(e.consume(m),a||(a=!de(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}}function Y0(e,t,n,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||X(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===l||p===92?(e.consume(p),d):d(p)}}function lo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):de(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const A_={name:"definition",tokenize:T_},__={partial:!0,tokenize:R_};function T_(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return K0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a):n(m)}function a(m){return at(m)?lo(e,u)(m):u(m)}function u(m){return G0(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(__,f,f)(m)}function f(m){return de(m)?ke(e,p,"whitespace")(m):p(m)}function p(m){return m===null||X(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function R_(e,t,n){return r;function r(s){return at(s)?lo(e,i)(s):n(s)}function i(s){return Y0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return de(s)?ke(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const I_={name:"hardBreakEscape",tokenize:M_};function M_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return X(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const O_={name:"headingAtx",resolve:L_,tokenize:D_};function L_(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function D_(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||at(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),a(d)):d===null||X(d)?(e.exit("atxHeading"),t(d)):de(d)?ke(e,s,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),s(d))}function u(d){return d===null||d===35||at(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const z_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Fm=["pre","script","style","textarea"],F_={concrete:!0,name:"htmlFlow",resolveTo:U_,tokenize:V_},B_={partial:!0,tokenize:W_},$_={partial:!0,tokenize:H_};function U_(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function V_(e,t,n){const r=this;let i,o,l,s,a;return u;function u(b){return d(b)}function d(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),o=!0,y):b===63?(e.consume(b),i=3,r.interrupt?t:k):Jt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),i=2,m):b===91?(e.consume(b),i=5,s=0,w):Jt(b)?(e.consume(b),i=4,r.interrupt?t:k):n(b)}function m(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const re="CDATA[";return b===re.charCodeAt(s++)?(e.consume(b),s===re.length?r.interrupt?t:P:w):n(b)}function y(b){return Jt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||at(b)){const re=b===47,Me=l.toLowerCase();return!re&&!o&&Fm.includes(Me)?(i=1,r.interrupt?t(b):P(b)):z_.includes(l.toLowerCase())?(i=6,re?(e.consume(b),g):r.interrupt?t(b):P(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?v(b):x(b))}return b===45||gt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function g(b){return b===62?(e.consume(b),r.interrupt?t:P):n(b)}function v(b){return de(b)?(e.consume(b),v):M(b)}function x(b){return b===47?(e.consume(b),M):b===58||b===95||Jt(b)?(e.consume(b),C):de(b)?(e.consume(b),x):M(b)}function C(b){return b===45||b===46||b===58||b===95||gt(b)?(e.consume(b),C):E(b)}function E(b){return b===61?(e.consume(b),N):de(b)?(e.consume(b),E):x(b)}function N(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,j):de(b)?(e.consume(b),N):_(b)}function j(b){return b===a?(e.consume(b),a=null,z):b===null||X(b)?n(b):(e.consume(b),j)}function _(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||at(b)?E(b):(e.consume(b),_)}function z(b){return b===47||b===62||de(b)?x(b):n(b)}function M(b){return b===62?(e.consume(b),T):n(b)}function T(b){return b===null||X(b)?P(b):de(b)?(e.consume(b),T):n(b)}function P(b){return b===45&&i===2?(e.consume(b),$):b===60&&i===1?(e.consume(b),H):b===62&&i===4?(e.consume(b),Y):b===63&&i===3?(e.consume(b),k):b===93&&i===5?(e.consume(b),F):X(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(B_,q,V)(b)):b===null||X(b)?(e.exit("htmlFlowData"),V(b)):(e.consume(b),P)}function V(b){return e.check($_,O,q)(b)}function O(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),L}function L(b){return b===null||X(b)?V(b):(e.enter("htmlFlowData"),P(b))}function $(b){return b===45?(e.consume(b),k):P(b)}function H(b){return b===47?(e.consume(b),l="",A):P(b)}function A(b){if(b===62){const re=l.toLowerCase();return Fm.includes(re)?(e.consume(b),Y):P(b)}return Jt(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),A):P(b)}function F(b){return b===93?(e.consume(b),k):P(b)}function k(b){return b===62?(e.consume(b),Y):b===45&&i===2?(e.consume(b),k):P(b)}function Y(b){return b===null||X(b)?(e.exit("htmlFlowData"),q(b)):(e.consume(b),Y)}function q(b){return e.exit("htmlFlow"),t(b)}}function H_(e,t,n){const r=this;return i;function i(l){return X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function W_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Js,t,n)}}const G_={name:"htmlText",tokenize:K_};function K_(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),E):k===63?(e.consume(k),x):Jt(k)?(e.consume(k),_):n(k)}function u(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),o=0,w):Jt(k)?(e.consume(k),v):n(k)}function d(k){return k===45?(e.consume(k),m):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),p):X(k)?(l=f,H(k)):(e.consume(k),f)}function p(k){return k===45?(e.consume(k),m):f(k)}function m(k){return k===62?$(k):k===45?p(k):f(k)}function w(k){const Y="CDATA[";return k===Y.charCodeAt(o++)?(e.consume(k),o===Y.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(l=y,H(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),g):y(k)}function g(k){return k===62?$(k):k===93?(e.consume(k),g):y(k)}function v(k){return k===null||k===62?$(k):X(k)?(l=v,H(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):X(k)?(l=x,H(k)):(e.consume(k),x)}function C(k){return k===62?$(k):x(k)}function E(k){return Jt(k)?(e.consume(k),N):n(k)}function N(k){return k===45||gt(k)?(e.consume(k),N):j(k)}function j(k){return X(k)?(l=j,H(k)):de(k)?(e.consume(k),j):$(k)}function _(k){return k===45||gt(k)?(e.consume(k),_):k===47||k===62||at(k)?z(k):n(k)}function z(k){return k===47?(e.consume(k),$):k===58||k===95||Jt(k)?(e.consume(k),M):X(k)?(l=z,H(k)):de(k)?(e.consume(k),z):$(k)}function M(k){return k===45||k===46||k===58||k===95||gt(k)?(e.consume(k),M):T(k)}function T(k){return k===61?(e.consume(k),P):X(k)?(l=T,H(k)):de(k)?(e.consume(k),T):z(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,V):X(k)?(l=P,H(k)):de(k)?(e.consume(k),P):(e.consume(k),O)}function V(k){return k===i?(e.consume(k),i=void 0,L):k===null?n(k):X(k)?(l=V,H(k)):(e.consume(k),V)}function O(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||at(k)?z(k):(e.consume(k),O)}function L(k){return k===47||k===62||at(k)?z(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),A}function A(k){return de(k)?ke(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):F(k)}function F(k){return e.enter("htmlTextData"),l(k)}}const hf={name:"labelEnd",resolveAll:X_,resolveTo:J_,tokenize:Z_},Y_={tokenize:eT},Q_={tokenize:tT},q_={tokenize:nT};function X_(e){let t=-1;const n=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),de(u)?ke(e,s,"whitespace")(u):s(u))}}const nt={continuation:{tokenize:fT},exit:mT,name:"list",tokenize:dT},uT={partial:!0,tokenize:hT},cT={partial:!0,tokenize:pT};function dT(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ac(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Tl,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return Ac(m)&&++l<10?(e.consume(m),a):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Js,r.interrupt?n:d,e.attempt(uT,p,f))}function d(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function f(m){return de(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function fT(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Js,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!de(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cT,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(nt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function pT(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function mT(e){e.exit(this.containerState.type)}function hT(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!de(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Bm={name:"setextUnderline",resolveTo:gT,tokenize:yT};function gT(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function yT(e,t,n){const r=this;let i;return o;function o(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),de(u)?ke(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const vT={tokenize:xT};function xT(e){const t=this,n=e.attempt(Js,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(b_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const wT={resolveAll:q0()},ST=Q0("string"),kT=Q0("text");function Q0(e){return{resolveAll:q0(e==="text"?CT:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(d){return u(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),a}function a(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),a)}function u(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function LT(e,t){let n=-1;const r=[];let i;for(;++n0){const Tt=J.tokenStack[J.tokenStack.length-1];(Tt[1]||Um).call(J,void 0,Tt[0])}for(U.position={start:An(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:An(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function ZT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Z0(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function tR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Z0(e,t);const i={src:_i(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function nR(e,t){const n={src:_i(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function rR(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function iR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Z0(e,t);const i={href:_i(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function oR(e,t){const n={href:_i(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lR(e,t,n){const r=e.all(t),i=n?sR(n):e1(t),o={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function aR(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=uf(t.children[1]),a=M0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function pR(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Wm(t.slice(i),i>0,!1)),o.join("")}function Wm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Vm||o===Hm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Vm||o===Hm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gR(e,t){const n={type:"text",value:hR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vR={blockquote:KT,break:YT,code:QT,delete:qT,emphasis:XT,footnoteReference:JT,heading:ZT,html:eR,imageReference:tR,image:nR,inlineCode:rR,linkReference:iR,link:oR,listItem:lR,list:aR,paragraph:uR,root:cR,strong:dR,table:fR,tableCell:mR,tableRow:pR,text:gR,thematicBreak:yR,toml:pl,yaml:pl,definition:pl,footnoteDefinition:pl};function pl(){}const t1=-1,Zs=0,so=1,vs=2,gf=3,yf=4,vf=5,xf=6,n1=7,r1=8,Gm=typeof self=="object"?self:globalThis,xR=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Zs:case t1:return n(l,i);case so:{const s=n([],i);for(const a of l)s.push(r(a));return s}case vs:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case gf:return n(new Date(l),i);case yf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case vf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case xf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case n1:{const{name:s,message:a}=l;return n(new Gm[s](a),i)}case r1:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Gm[o](l),i)};return r},Km=e=>xR(new Map,e)(0),Fr="",{toString:wR}={},{keys:SR}=Object,Hi=e=>{const t=typeof e;if(t!=="object"||!e)return[Zs,t];const n=wR.call(e).slice(8,-1);switch(n){case"Array":return[so,Fr];case"Object":return[vs,Fr];case"Date":return[gf,Fr];case"RegExp":return[yf,Fr];case"Map":return[vf,Fr];case"Set":return[xf,Fr];case"DataView":return[so,n]}return n.includes("Array")?[so,n]:n.includes("Error")?[n1,n]:[vs,n]},ml=([e,t])=>e===Zs&&(t==="function"||t==="symbol"),kR=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Hi(l);switch(s){case Zs:{let d=l;switch(a){case"bigint":s=r1,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return i([t1],l)}return i([s,d],l)}case so:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const d=[],f=i([s,d],l);for(const p of l)d.push(o(p));return f}case vs:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const d=[],f=i([s,d],l);for(const p of SR(l))(e||!ml(Hi(l[p])))&&d.push([o(p),o(l[p])]);return f}case gf:return i([s,l.toISOString()],l);case yf:{const{source:d,flags:f}=l;return i([s,{source:d,flags:f}],l)}case vf:{const d=[],f=i([s,d],l);for(const[p,m]of l)(e||!(ml(Hi(p))||ml(Hi(m))))&&d.push([o(p),o(m)]);return f}case xf:{const d=[],f=i([s,d],l);for(const p of l)(e||!ml(Hi(p)))&&d.push(o(p));return f}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Ym=(e,{json:t,lossy:n}={})=>{const r=[];return kR(!(t||n),!!t,new Map,r)(e),r},xs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Km(Ym(e,t)):structuredClone(e):(e,t)=>Km(Ym(e,t));function CR(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function bR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function NR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||CR,r=e.options.footnoteBackLabel||bR,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let v=typeof n=="string"?n:n(a,m);typeof v=="string"&&(v={type:"text",value:v}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,m),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else d.push(...w);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...xs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const i1=function(e){if(e==null)return AR;if(typeof e=="function")return ea(e);if(typeof e=="object")return Array.isArray(e)?ER(e):jR(e);if(typeof e=="string")return PR(e);throw new Error("Expected function, string, or object as test")};function ER(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=o1,w,y,S;if((!t||o(a,u,d[d.length-1]||void 0))&&(m=MR(n(a,d)),m[0]===Qm))return m;if("children"in a&&a.children){const g=a;if(g.children&&m[0]!==RR)for(y=(r?g.children.length:-1)+l,S=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function qm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xm(e,t){const n=LR(e,t),r=n.one(e,void 0),i=NR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function $R(e,t){return e&&"run"in e?async function(n,r){const i=Xm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Xm(n,{file:r,...e||t})}}function Jm(e){if(e)throw e}var Rl=Object.prototype.hasOwnProperty,s1=Object.prototype.toString,Zm=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=function(t){return typeof Array.isArray=="function"?Array.isArray(t):s1.call(t)==="[object Array]"},nh=function(t){if(!t||s1.call(t)!=="[object Object]")return!1;var n=Rl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Rl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Rl.call(t,i)},rh=function(t,n){Zm&&n.name==="__proto__"?Zm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ih=function(t,n){if(n==="__proto__")if(Rl.call(t,n)){if(eh)return eh(t,n).value}else return;return t[n]},UR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const d=u;if(s&&n)throw d;return i(d)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const Qt={basename:WR,dirname:GR,extname:KR,join:YR,sep:"/"};function WR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$o(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function GR(e){if($o(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KR(e){$o(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function YR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qR(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function $o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const XR={cwd:JR};function JR(){return"/"}function Ic(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZR(e){if(typeof e=="string")e=new URL(e);else if(!Ic(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return eI(e)}function eI(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...w]=d;const y=r[p][1];Rc(y)&&Rc(m)&&(m=Va(!0,y,m)),r[p]=[u,m,...w]}}}}const iI=new wf().freeze();function Ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ya(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lh(e){if(!Rc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return oI(e)?e:new a1(e)}function oI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lI(e){return typeof e=="string"||sI(e)}function sI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ah=[],uh={allowDangerousHtml:!0},uI=/^(https?|ircs?|mailto|xmpp)$/i,cI=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function dI(e){const t=fI(e),n=pI(e);return mI(t.runSync(t.parse(n),n),e)}function fI(e){const t=e.rehypePlugins||ah,n=e.remarkPlugins||ah,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uh}:uh;return iI().use(GT).use(n).use($R,r).use(t)}function pI(e){const t=e.children||"",n=new a1;return typeof t=="string"&&(n.value=t),n}function mI(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||hI;for(const d of cI)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+aI+d.id,void 0);return l1(e,u),NA(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return l?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in Ba)if(Object.hasOwn(Ba,m)&&Object.hasOwn(d.properties,m)){const w=d.properties[m],y=Ba[m];(y===null||y.includes(d.tagName))&&(d.properties[m]=a(String(w||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,p)),m&&p&&typeof f=="number")return s&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function hI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||uI.test(e.slice(0,t))?e:""}const u1=h.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=h.useRef(null),d=()=>{var f;(f=u.current)==null||f.scrollIntoView({behavior:"smooth"})};return h.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(f=>({id:f.id,role:f.role,content:f.content.slice(0,50)+"..."}))),d()},[t]),c.jsxs("div",{className:ue("flex h-full flex-col",e),ref:a,...s,children:[c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:c.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((f,p)=>c.jsxs("div",{className:ue("flex gap-3 w-full",f.role==="user"?"justify-end":"justify-start"),children:[f.role!=="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:c.jsx(mn,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:ue("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",f.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[c.jsxs("div",{className:"text-xs opacity-70",children:[f.role==="user"?"You":"Assistant"," • #",p+1]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(dI,{components:{p:({children:m})=>c.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>c.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>c.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>c.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>c.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:f.content})})]}),f.role==="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:c.jsx(qb,{className:"h-4 w-4"})})]},`${f.id}-${p}`)),c.jsx("div",{ref:u})]}),c.jsx("div",{className:"border-t p-4",children:c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(Bd,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),i(f))}}),o?c.jsx(pe,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(Bb,{className:"h-4 w-4"})}):c.jsx(pe,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(Rb,{className:"h-4 w-4"})})]})})]})});u1.displayName="Chat";const Kt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function c1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function gI(){return c1()}class yI{getAllSessions(){const t=localStorage.getItem(Kt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:c1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},o=this.getAllSessions();return o.unshift(i),localStorage.setItem(Kt.sessions,JSON.stringify(o)),i}updateSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);i!==-1&&(r[i]={...r[i],...n,updatedAt:Date.now()},localStorage.setItem(Kt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Kt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Kt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:gI(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Kt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Kt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Kt.currentSession,t)}clear(){localStorage.removeItem(Kt.sessions),localStorage.removeItem(Kt.currentSession)}}const Ne=new yI;function vI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=h.useState([]),[l,s]=h.useState(null),[a,u]=h.useState(""),[d,f]=h.useState({isLoading:!1,error:null}),[p,m]=h.useState(n),[w,y]=h.useState(r),[S,g]=h.useState(.7),[v,x]=h.useState(1024),C=Lt.useMemo(()=>{var L;const O=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((L=O==null?void 0:O.messages)==null?void 0:L.length)||0}),O},[i,l]),E=Lt.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(L=>({id:L.id,role:L.role}))),O},[C==null?void 0:C.messages]);h.useEffect(()=>{const O=Ne.getAllSessions();o(O);const L=Ne.getCurrentSession();L?s(L.id):O.length>0&&(s(O[0].id),Ne.setCurrentSession(O[0].id))},[]);const N=h.useCallback(()=>{const O=Ne.createSession(void 0,p,w),L=Ne.getAllSessions();return o([...L]),s(O.id),Ne.setCurrentSession(O.id),O.id},[p,w]),j=h.useCallback(O=>{s(O),Ne.setCurrentSession(O)},[]),_=h.useCallback(O=>{Ne.deleteSession(O);const L=Ne.getAllSessions();o([...L]),l===O&&(L.length>0?(s(L[0].id),Ne.setCurrentSession(L[0].id)):s(null))},[l]),z=h.useCallback((O,L)=>{Ne.updateSession(O,{title:L});const $=Ne.getAllSessions();o([...$])},[]),M=h.useCallback(O=>{if(!l)return;Ne.addMessageToSession(l,O);const L=Ne.getAllSessions();o([...L])},[l]),T=h.useCallback(async()=>{var A,F;if(!a.trim()||d.isLoading)return;let O=l;O||(O=N());const L=a.trim();if(u(""),f({isLoading:!0,error:null}),O){Ne.addMessageToSession(O,{role:"user",content:L});const k=Ne.getAllSessions();o([...k])}const $=Ne.getSession(O),H=($==null?void 0:$.messages)&&$.messages.length>1;if(w&&!H&&O){Ne.addMessageToSession(O,{role:"system",content:w});const k=Ne.getAllSessions();o([...k])}try{const k=Ne.getSession(O),Y=((F=(A=k==null?void 0:k.messages)==null?void 0:A.filter(re=>re.role!=="system"))==null?void 0:F.map(re=>({role:re.role,content:re.content})))||[],q=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:L,messages:Y,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:v})});if(!q.ok){const re=await q.json();throw new Error(re.detail||`HTTP error! status: ${q.status}`)}const b=await q.json();if(O){Ne.addMessageToSession(O,{role:"assistant",content:b.content,thinking_content:b.thinking_content,model_used:b.model_used,supports_thinking:b.supports_thinking});const re=Ne.getAllSessions();o([...re])}f({isLoading:!1,error:null})}catch(k){const Y=k instanceof Error?k.message:"An error occurred";if(f({isLoading:!1,error:Y}),O){Ne.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`});const q=Ne.getAllSessions();o([...q])}}},[a,d.isLoading,l,N,M,w,E.length,t,p,S,v]),P=h.useCallback(()=>{f({isLoading:!1,error:null})},[]),V=h.useCallback(()=>{Ne.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:N,selectSession:j,deleteSession:_,renameSession:z,clearAllSessions:V,messages:E,input:a,setInput:u,sendMessage:T,stopGeneration:P,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:g,maxTokens:v,setMaxTokens:x}}function xI(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:d,isLoading:f,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:g,maxTokens:v,setMaxTokens:x}=vI(),[C,E]=h.useState(!1),[N,j]=h.useState(!1),[_,z]=h.useState(null),[M,T]=h.useState(!1),[P,V]=h.useState(null),[O,L]=h.useState(!1),[$,H]=h.useState(""),[A,F]=h.useState(""),[k,Y]=h.useState([]),q=()=>{if(!$.trim())return;const I={id:Date.now().toString(),name:$,description:A,model:p,systemPrompt:w,temperature:S,maxTokens:v,createdAt:new Date().toISOString()},W=JSON.parse(localStorage.getItem("savedAssistants")||"[]");W.push(I),localStorage.setItem("savedAssistants",JSON.stringify(W)),H(""),F(""),L(!1),alert("助手保存成功!可在模型目录中查看。")},b=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Technical Writer",prompt:"You are a technical writer. Create clear, comprehensive documentation and explanations. Use proper formatting and structure your responses logically."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{name:"Research Assistant",prompt:"You are a research assistant. Provide detailed, well-researched responses with clear reasoning. Cite sources when relevant and present information objectively."},{name:"Teacher",prompt:"You are an experienced teacher. Explain concepts clearly, use examples, and break down complex topics into understandable parts. Be encouraging and patient."}],re=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];h.useEffect(()=>{ie(),Me()},[]);const Me=()=>{try{const I=localStorage.getItem("loadAssistantConfig");if(I){const W=JSON.parse(I);m(W.model),y(W.systemPrompt||""),g(W.temperature||.7),x(W.maxTokens||1024),localStorage.removeItem("loadAssistantConfig"),setTimeout(()=>{alert(`Assistant "${W.name}" loaded successfully!`)},500)}}catch(I){console.error("Failed to load assistant configuration:",I)}};h.useEffect(()=>{if(p&&!k.find(I=>I.model_name===p)){const I=k[0];I&&m(I.model_name)}},[k,p,m]),h.useEffect(()=>{(async()=>{if(!p||!k.length)return;const W=k.find(xe=>xe.model_name===p);if(!W)return;const Q=`${window.location.protocol}//${window.location.host}`;if(W.type==="local"&&!W.is_loaded){V(W),T(!0);return}const ge=k.filter(xe=>xe.type==="local"&&xe.is_loaded&&xe.model_name!==p);for(const xe of ge)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:xe.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${xe.model_name}`)}catch(ct){console.error(`Error auto-unloading model ${xe.model_name}:`,ct)}ge.length>0&&ie()})()},[p,k]);const se=async()=>{if(P){T(!1),z(P.model_name);try{const I=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${I}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:P.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${P.model_name}`),ie();else{console.error(`❌ Failed to load model: ${P.model_name}`);const Q=k.find(ge=>ge.type==="api");Q&&m(Q.model_name)}}catch(I){console.error("Error loading model:",I);const W=k.find(Q=>Q.type==="api");W&&m(W.model_name)}finally{z(null),V(null)}}},K=()=>{T(!1),V(null);const I=k.find(W=>W.type==="api");I&&m(I.model_name)};h.useEffect(()=>{const I=async()=>{const W=`${window.location.protocol}//${window.location.host}`,Q=k.filter(ge=>ge.type==="local"&&ge.is_loaded);for(const ge of Q)try{await fetch(`${W}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ge.model_name})}),console.log(`✅ Cleanup: unloaded ${ge.model_name}`)}catch(xe){console.error(`Error cleaning up model ${ge.model_name}:`,xe)}};return()=>{I()}},[k]);const ie=async()=>{try{const I=`${window.location.protocol}//${window.location.host}`,W=await fetch(`${I}/models`);if(W.ok){const Q=await W.json();if(Y(Q.models),Q.current_model&&p!==Q.current_model)m(Q.current_model);else if(!p&&Q.models.length>0){const xe=Q.models.find(ct=>ct.type==="api")||Q.models[0];m(xe.model_name)}}}catch(I){console.error("Failed to fetch models:",I)}},Ce=I=>{a(I)};return c.jsxs("div",{className:"min-h-screen bg-background flex",children:[c.jsx("div",{className:` + ${C?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:c.jsxs("div",{className:"p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs(pe,{onClick:r,size:"sm",children:[c.jsx(Xu,{className:"h-4 w-4 mr-1"}),"New"]})]}),c.jsx("div",{className:"space-y-2",children:e.map(I=>c.jsxs(me,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===I.id?"bg-accent border-primary":""}`,onClick:()=>i(I.id),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:I.title}),c.jsx(pe,{size:"sm",variant:"ghost",onClick:W=>{W.stopPropagation(),o(I.id)},className:"h-6 w-6 p-0",children:c.jsx(Od,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[I.messages.length," messages"]})]},I.id))})]})}),C&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>E(!1)}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>E(!C),className:"lg:hidden",children:C?c.jsx(Cb,{className:"h-4 w-4"}):c.jsx(Nb,{className:"h-4 w-4"})}),c.jsx(Qn,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&c.jsxs(Fe,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[c.jsxs(pe,{variant:"outline",size:"sm",onClick:()=>E(!C),className:"hidden lg:flex flex-shrink-0",children:[c.jsx(gb,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),c.jsxs(pe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(ab,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"View code"}),c.jsx("span",{className:"sm:hidden",children:"Code"})]}),c.jsxs(pe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(Yb,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),c.jsxs(pe,{variant:"outline",size:"sm",className:"flex-shrink-0",onClick:()=>L(!0),children:[c.jsx(_b,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Save Assistant"})]}),c.jsxs(pe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(Gy,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&c.jsx("div",{className:"p-6 border-b",children:c.jsxs(me,{children:[c.jsx(jt,{children:c.jsx($t,{className:"text-base",children:"Start with a sample prompt"})}),c.jsx(ve,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:re.map((I,W)=>c.jsx(pe,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>Ce(I.prompt),disabled:f,children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:I.title}),c.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:I.description})]})},W))})})]})}),c.jsx(u1,{messages:l.map(I=>({id:I.id,role:I.role,content:I.content,createdAt:new Date(I.timestamp)})),input:s,handleInputChange:I=>a(I.target.value),handleSubmit:async I=>{I.preventDefault(),!(!p||!k.find(W=>W.model_name===p))&&await u()},isGenerating:f,stop:d,className:"flex-1"})]}),c.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:c.jsxs("div",{className:"p-4 space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Md,{className:"h-4 w-4"}),c.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),c.jsxs(me,{children:[c.jsx(jt,{children:c.jsx($t,{className:"text-sm",children:"Model Selection"})}),c.jsxs(ve,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(kt,{className:"text-xs font-medium mb-2",children:"Active Model"}),c.jsxs($j,{value:p||"",onValueChange:m,children:[c.jsx(Lx,{className:"w-full",children:c.jsx(Uj,{placeholder:"Select a model...",children:p&&(()=>{const I=k.find(Q=>Q.model_name===p);if(!I)return p;const W=I.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[W?c.jsx(as,{className:"h-4 w-4 text-blue-500"}):I.supports_thinking?c.jsx(Yn,{className:"h-4 w-4 text-purple-500"}):c.jsx(cs,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:I.name}),_===p?c.jsx(Fe,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(Fe,{variant:"outline",className:"text-xs",children:W?"API":I.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(Fx,{children:[c.jsxs(vm,{children:[c.jsx(mc,{children:"🌐 API Models"}),k.filter(I=>I.type==="api").map(I=>c.jsx(hc,{value:I.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(as,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:I.name}),c.jsx(Fe,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},I.model_name))]}),c.jsxs(vm,{children:[c.jsx(mc,{children:"💻 Local Models"}),k.filter(I=>I.type==="local").map(I=>c.jsx(hc,{value:I.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[I.supports_thinking?c.jsx(Yn,{className:"h-4 w-4 text-purple-500"}):c.jsx(cs,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:I.name}),_===I.model_name?c.jsx(Fe,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):I.is_loaded?c.jsx(Fe,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):c.jsx(Fe,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},I.model_name))]})]})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsx(pe,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:c.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[c.jsx(Po,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),c.jsxs(me,{children:[c.jsx(jt,{children:c.jsx($t,{className:"text-sm",children:"Parameters"})}),c.jsxs(ve,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(kt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),c.jsx(rc,{value:[S],onValueChange:I=>g(I[0]),min:0,max:2,step:.01,className:"mt-2",disabled:f}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),c.jsxs("div",{children:[c.jsxs(kt,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),c.jsx(rc,{value:[v],onValueChange:I=>x(I[0]),min:100,max:4096,step:100,className:"mt-2",disabled:f})]})]})]}),c.jsx(me,{children:c.jsxs(Xj,{open:N,onOpenChange:j,children:[c.jsx(jt,{children:c.jsx(Jj,{asChild:!0,children:c.jsxs(pe,{variant:"ghost",className:"w-full justify-between p-0",disabled:f,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Qn,{className:"h-4 w-4"}),c.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&c.jsx(Fe,{variant:"secondary",className:"text-xs",children:"Custom"})]}),c.jsx(Id,{className:`h-4 w-4 transition-transform ${N?"transform rotate-180":""}`})]})})}),c.jsx(Zj,{children:c.jsxs(ve,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(kt,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),c.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:b.map(I=>c.jsx(pe,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>y(I.prompt),disabled:f,children:I.name},I.name))})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx(kt,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&c.jsxs(pe,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-6 px-2 text-xs",disabled:f,children:[c.jsx(Pb,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),c.jsx("textarea",{id:"system-prompt",value:w,onChange:I=>y(I.target.value),placeholder:"Enter custom system prompt to define how the model should behave...",className:"w-full min-h-[80px] text-xs p-2 border rounded-md bg-background",disabled:f}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),c.jsx(xm,{open:M,onOpenChange:T,children:c.jsxs(gc,{children:[c.jsxs(yc,{children:[c.jsxs(xc,{className:"flex items-center gap-2",children:[c.jsx(zs,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),c.jsx(wc,{asChild:!0,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["You're about to load ",c.jsx("strong",{children:P==null?void 0:P.name})," locally."]}),c.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Gb,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),c.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Storage:"})," ",P==null?void 0:P.size_gb]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"RAM:"})," ~",P==null?void 0:P.size_gb," (while running)"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),c.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:c.jsxs("div",{className:"text-sm text-blue-700",children:[c.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),c.jsx("p",{className:"mt-1",children:P==null?void 0:P.description}),(P==null?void 0:P.supports_thinking)&&c.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[c.jsx(Yn,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),c.jsxs(vc,{children:[c.jsx(kc,{onClick:K,children:"Cancel"}),c.jsx(Sc,{onClick:se,children:"Load Model"})]})]})}),c.jsx(xm,{open:O,onOpenChange:L,children:c.jsxs(gc,{children:[c.jsxs(yc,{children:[c.jsxs(xc,{className:"flex items-center gap-2",children:[c.jsx(mn,{className:"h-5 w-5 text-blue-500"}),"Save Current Configuration as Assistant"]}),c.jsx(wc,{children:"Save your current model settings and system prompt as a reusable assistant."})]}),c.jsxs("div",{className:"space-y-4 py-4",children:[c.jsxs("div",{children:[c.jsx(kt,{htmlFor:"assistant-name",children:"Assistant Name"}),c.jsx(hv,{id:"assistant-name",value:$,onChange:I=>H(I.target.value),placeholder:"e.g., Code Review Expert",className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx(kt,{htmlFor:"assistant-description",children:"Description"}),c.jsx(Bd,{id:"assistant-description",value:A,onChange:I=>F(I.target.value),placeholder:"Describe what this assistant is good at...",rows:3,className:"mt-1"})]}),c.jsxs("div",{className:"bg-muted p-3 rounded-md text-sm",children:[c.jsx("div",{className:"font-medium mb-2",children:"Current Configuration:"}),c.jsxs("div",{className:"space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:["Model: ",p]}),c.jsxs("div",{children:["Temperature: ",S]}),c.jsxs("div",{children:["Max Tokens: ",v]}),c.jsxs("div",{children:["System Prompt: ",w?w.slice(0,50)+"...":"None"]})]})]})]}),c.jsxs(vc,{children:[c.jsx(kc,{onClick:()=>L(!1),children:"Cancel"}),c.jsx(Sc,{onClick:q,disabled:!$.trim(),children:"Save Assistant"})]})]})})]})}function wI(){const[e,t]=h.useState([]),[n,r]=h.useState(!0),[i,o]=h.useState(null);h.useEffect(()=>{l()},[]);const l=async()=>{try{const u=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${u}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const f=await d.json();t(f.models)}catch(u){console.error("Error fetching models:",u)}finally{r(!1)}},s=async u=>{o(u);try{const d=`${window.location.protocol}//${window.location.host}`,f=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})});if(!f.ok)throw new Error(`Failed to load model: ${f.status}`);l()}catch(d){console.error("Error loading model:",d)}finally{o(null)}},a=async u=>{o(u);try{const d=`${window.location.protocol}//${window.location.host}`,f=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})});if(!f.ok)throw new Error(`Failed to unload model: ${f.status}`);l()}catch(d){console.error("Error unloading model:",d)}finally{o(null)}};return n?c.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:c.jsx(qu,{className:"h-8 w-8 animate-spin"})}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(Po,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),c.jsxs(pe,{onClick:()=>window.location.href="/playground",className:"flex items-center gap-2",children:[c.jsx(cs,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsx(me,{className:"bg-blue-50 border-blue-200",children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Wy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),c.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Load models to use them in the playground. Models are cached locally for faster access. Each model requires significant storage space and initial download time."})]})]})})}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(as,{className:"h-5 w-5"}),"API Models",c.jsx(Fe,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(u=>u.type==="api").map(u=>c.jsx(ch,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(Hy,{className:"h-5 w-5"}),"Local Models",c.jsx(Fe,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(u=>u.type==="local").map(u=>c.jsx(ch,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),c.jsxs(me,{children:[c.jsx(jt,{children:c.jsxs($t,{className:"flex items-center gap-2",children:[c.jsx(Yn,{className:"h-5 w-5"}),"Model Statistics"]})}),c.jsx(ve,{children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.filter(u=>u.type==="api").length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"API Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(u=>u.type==="local").length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Local Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-orange-600",children:e.filter(u=>u.is_loaded).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(u=>u.supports_thinking).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function ch({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return c.jsxs(me,{className:"hover:shadow-md transition-shadow",children:[c.jsx(jt,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs($t,{className:"text-base flex items-center gap-2",children:[i?c.jsx(as,{className:"h-4 w-4 text-blue-600"}):c.jsx(Hy,{className:"h-4 w-4 text-green-600"}),e.name]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&c.jsx(ob,{className:"h-5 w-5 text-green-600"})]})}),c.jsxs(ve,{className:"space-y-3",children:[c.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Size:"}),c.jsx(Fe,{variant:"outline",className:"text-xs",children:e.size_gb})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),c.jsx(Fe,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Type:"}),c.jsx(Fe,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Features:"}),c.jsxs(Fe,{variant:"outline",className:"text-xs",children:[c.jsx(Yn,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),c.jsx("div",{className:"pt-2",children:l?c.jsxs(pe,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(qu,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(Od,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):c.jsxs(pe,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(qu,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(zs,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function SI(){const[e,t]=h.useState([]);h.useEffect(()=>{n()},[]);const n=()=>{try{const s=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(s)}catch(s){console.error("Failed to load assistants:",s)}},r=s=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(s)),window.location.href="/playground"},i=s=>{const a=e.filter(u=>u.id!==s);t(a),localStorage.setItem("savedAssistants",JSON.stringify(a))},o=s=>{alert(`"${s.name}" has been shared to the community! (This is a demo - in production, it would be submitted for review.)`)},l=()=>{window.location.href="/playground"};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:c.jsx(mn,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"My Assistants"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your custom AI assistants and configurations"})]})]}),c.jsxs(pe,{onClick:l,className:"flex items-center gap-2",children:[c.jsx(Xu,{className:"h-4 w-4"}),"Create New Assistant"]})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsx(me,{className:"bg-purple-50 border-purple-200",children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Zu,{className:"h-5 w-5 text-purple-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-purple-900",children:"Custom AI Assistants"}),c.jsx("p",{className:"text-sm text-purple-700 mt-1",children:"Create specialized AI assistants by configuring models, prompts, and parameters in the Playground. Save different configurations for various tasks and workflows."})]})]})})}),e.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(s=>c.jsx(kI,{assistant:s,onUse:()=>r(s),onDelete:()=>i(s.id),onShare:()=>o(s)},s.id))}):c.jsxs(me,{className:"text-center py-16",children:[c.jsx(mn,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),c.jsx("h3",{className:"text-xl font-medium mb-3",children:"No assistants yet"}),c.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Create your first AI assistant by configuring parameters and prompts in the Playground, then saving your configuration for future use."}),c.jsxs(pe,{onClick:l,size:"lg",className:"flex items-center gap-2 mx-auto",children:[c.jsx(Xu,{className:"h-5 w-5"}),"Create Your First Assistant"]})]}),e.length>0&&c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Assistants"})]}),c.jsx(mn,{className:"h-8 w-8 text-purple-600"})]})})}),c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:new Set(e.map(s=>s.model)).size}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Models Used"})]}),c.jsx(Qn,{className:"h-8 w-8 text-blue-600"})]})})}),c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(s=>s.createdAt&&new Date(s.createdAt)>new Date(Date.now()-7*24*60*60*1e3)).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Created This Week"})]}),c.jsx(Zu,{className:"h-8 w-8 text-green-600"})]})})})]})]})})]})}function kI({assistant:e,onUse:t,onDelete:n,onShare:r}){return c.jsxs(me,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[c.jsx(jt,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs($t,{className:"text-base flex items-center gap-2",children:[c.jsx(mn,{className:"h-4 w-4 text-purple-600"}),e.name]}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description provided"})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx(pe,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Share to community",children:c.jsx(Gy,{className:"h-4 w-4"})}),c.jsx(pe,{variant:"ghost",size:"sm",onClick:n,className:"text-red-500 hover:text-red-600 hover:bg-red-50",title:"Delete assistant",children:c.jsx(Od,{className:"h-4 w-4"})})]})]})}),c.jsxs(ve,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Model:"}),c.jsx("p",{className:"text-gray-800 truncate",children:e.model})]}),c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),c.jsx("p",{className:"text-gray-800",children:e.temperature})]}),c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),c.jsx("p",{className:"text-gray-800",children:e.maxTokens})]}),c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Created:"}),c.jsx("p",{className:"text-gray-800",children:new Date(e.createdAt).toLocaleDateString()})]})]}),e.systemPrompt&&c.jsxs("div",{className:"bg-blue-50 rounded p-2",children:[c.jsx("span",{className:"text-xs font-medium text-blue-700",children:"System Prompt:"}),c.jsx("p",{className:"text-xs text-blue-600 mt-1 line-clamp-2",children:e.systemPrompt})]}),c.jsxs(pe,{onClick:t,className:"w-full flex items-center gap-2",children:[c.jsx(Qn,{className:"h-4 w-4"}),"Use Assistant"]})]})]})}var qa="rovingFocusGroup.onEntryFocus",CI={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[Mc,d1,bI]=zd(Uo),[NI,f1]=Cn(Uo,[bI]),[EI,jI]=NI(Uo),p1=h.forwardRef((e,t)=>c.jsx(Mc.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Mc.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(PI,{...e,ref:t})})}));p1.displayName=Uo;var PI=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=h.useRef(null),m=fe(t,p),w=Fs(o),[y,S]=br({prop:l,defaultProp:s??null,onChange:a,caller:Uo}),[g,v]=h.useState(!1),x=Jn(u),C=d1(n),E=h.useRef(!1),[N,j]=h.useState(0);return h.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(qa,x),()=>_.removeEventListener(qa,x)},[x]),c.jsx(EI,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:y,onItemFocus:h.useCallback(_=>S(_),[S]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:h.useCallback(()=>j(_=>_-1),[]),children:c.jsx(ne.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{E.current=!0}),onFocus:Z(e.onFocus,_=>{const z=!E.current;if(_.target===_.currentTarget&&z&&!g){const M=new CustomEvent(qa,CI);if(_.currentTarget.dispatchEvent(M),!M.defaultPrevented){const T=C().filter($=>$.focusable),P=T.find($=>$.active),V=T.find($=>$.id===y),L=[P,V,...T].filter(Boolean).map($=>$.ref.current);g1(L,d)}}E.current=!1}),onBlur:Z(e.onBlur,()=>v(!1))})})}),m1="RovingFocusGroupItem",h1=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=hn(),u=o||a,d=jI(m1,n),f=d.currentTabStopId===u,p=d1(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:y}=d;return h.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),c.jsx(Mc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(ne.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?d.onItemFocus(u):S.preventDefault()}),onFocus:Z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const g=TI(S,d.orientation,d.dir);if(g!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=d.loop?RI(x,C+1):x.slice(C+1)}setTimeout(()=>g1(x))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:y!=null}):l})})});h1.displayName=m1;var AI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _I(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TI(e,t,n){const r=_I(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AI[r]}function g1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function RI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var II=p1,MI=h1,ta="Tabs",[OI,KI]=Cn(ta,[f1]),y1=f1(),[LI,Sf]=OI(ta),v1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,d=Fs(s),[f,p]=br({prop:r,onChange:i,defaultProp:o??"",caller:ta});return c.jsx(LI,{scope:n,baseId:hn(),value:f,onValueChange:p,orientation:l,dir:d,activationMode:a,children:c.jsx(ne.div,{dir:d,"data-orientation":l,...u,ref:t})})});v1.displayName=ta;var x1="TabsList",w1=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Sf(x1,n),l=y1(n);return c.jsx(II,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});w1.displayName=x1;var S1="TabsTrigger",k1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Sf(S1,n),s=y1(n),a=N1(l.baseId,r),u=E1(l.baseId,r),d=r===l.value;return c.jsx(MI,{asChild:!0,...s,focusable:!i,active:d,children:c.jsx(ne.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:Z(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:Z(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const f=l.activationMode!=="manual";!d&&!i&&f&&l.onValueChange(r)})})})});k1.displayName=S1;var C1="TabsContent",b1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Sf(C1,n),a=N1(s.baseId,r),u=E1(s.baseId,r),d=r===s.value,f=h.useRef(d);return h.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(Pi,{present:i||d,children:({present:p})=>c.jsx(ne.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&o})})});b1.displayName=C1;function N1(e,t){return`${e}-trigger-${t}`}function E1(e,t){return`${e}-content-${t}`}var DI=v1,j1=w1,P1=k1,A1=b1;const zI=DI,_1=h.forwardRef(({className:e,...t},n)=>c.jsx(j1,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));_1.displayName=j1.displayName;const Il=h.forwardRef(({className:e,...t},n)=>c.jsx(P1,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Il.displayName=P1.displayName;const Ml=h.forwardRef(({className:e,...t},n)=>c.jsx(A1,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ml.displayName=A1.displayName;function FI(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer that provides detailed analysis, suggests improvements, and identifies potential issues.",author:"EdgeLLM Team",category:"coding",tags:["code review","programming","best practices"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a senior software engineer specializing in code review. Analyze the provided code for: + +1. **Code Quality**: Structure, readability, maintainability +2. **Best Practices**: Following language conventions and patterns +3. **Performance**: Potential optimizations and bottlenecks +4. **Security**: Common vulnerabilities and security issues +5. **Testing**: Testability and edge cases + +Provide constructive feedback with specific examples and actionable suggestions.`,temperature:.3,maxTokens:1500,likes:245,downloads:1200,isOfficial:!0,createdAt:"2024-01-15"},{id:"writing-tutor",name:"Academic Writing Tutor",description:"Helps improve academic writing with structure suggestions, grammar corrections, and clarity enhancements.",author:"Academic Guild",category:"writing",tags:["academic writing","essay","research"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are an experienced academic writing tutor. Help users improve their writing by: + +1. **Structure & Organization**: Clear thesis, logical flow, proper transitions +2. **Clarity & Precision**: Eliminate ambiguity, improve word choice +3. **Academic Style**: Formal tone, appropriate citations, scholarly voice +4. **Grammar & Mechanics**: Correct errors, improve sentence variety +5. **Argument Development**: Strengthen evidence, address counterarguments + +Provide specific feedback with examples and rewrite suggestions where helpful.`,temperature:.4,maxTokens:1200,likes:189,downloads:856,isOfficial:!1,createdAt:"2024-01-20"},{id:"data-analyst",name:"Data Analysis Assistant",description:"Helps analyze data, create visualizations, and explain statistical concepts in simple terms.",author:"DataPro",category:"analysis",tags:["data science","statistics","visualization"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a data analysis expert. Help users understand and analyze data by: + +1. **Data Exploration**: Identify patterns, outliers, relationships +2. **Statistical Analysis**: Apply appropriate tests, interpret results +3. **Visualization**: Suggest effective charts and graphs +4. **Insights**: Draw meaningful conclusions from data +5. **Communication**: Explain complex concepts simply + +Provide step-by-step analysis and practical recommendations.`,temperature:.2,maxTokens:1e3,likes:156,downloads:643,isOfficial:!1,createdAt:"2024-01-25"},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories, characters, and narrative techniques.",author:"StoryMaster",category:"creative",tags:["creative writing","storytelling","fiction"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a creative writing coach with expertise in storytelling. Help writers by: + +1. **Story Development**: Plot structure, pacing, conflict resolution +2. **Character Creation**: Compelling personalities, realistic dialogue, character arcs +3. **World Building**: Consistent settings, atmosphere, details +4. **Writing Techniques**: Show vs tell, point of view, voice +5. **Inspiration**: Creative prompts, overcoming writer's block + +Provide encouraging feedback and concrete suggestions to enhance creativity.`,temperature:.8,maxTokens:1200,likes:312,downloads:987,isOfficial:!1,createdAt:"2024-01-30"},{id:"interview-prep",name:"Interview Preparation Coach",description:"Helps prepare for job interviews with practice questions, answer strategies, and confidence building.",author:"CareerBoost",category:"career",tags:["interview","job search","career"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a professional career coach specializing in interview preparation. Help candidates by: + +1. **Question Practice**: Common and behavioral interview questions +2. **Answer Framework**: STAR method, structured responses +3. **Company Research**: Industry insights, company-specific preparation +4. **Confidence Building**: Reducing anxiety, improving presentation +5. **Follow-up**: Thank you notes, next steps + +Provide personalized advice and realistic practice scenarios.`,temperature:.5,maxTokens:1e3,likes:278,downloads:1456,isOfficial:!0,createdAt:"2024-02-05"}]}function BI(){const[e]=h.useState(FI()),[t,n]=h.useState([]);h.useEffect(()=>{r()},[]);const r=()=>{try{const u=JSON.parse(localStorage.getItem("likedTemplates")||"[]");n(u)}catch(u){console.error("Failed to load liked templates:",u)}},i=u=>{const d=t.includes(u)?t.filter(f=>f!==u):[...t,u];n(d),localStorage.setItem("likedTemplates",JSON.stringify(d))},o=u=>{const d={name:u.name,description:u.description,model:u.model,systemPrompt:u.systemPrompt,temperature:u.temperature,maxTokens:u.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(d)),window.location.href="/playground"},l=e.filter(u=>u.isOfficial||u.likes>200),s=e.reduce((u,d)=>u+d.likes,0),a=e.reduce((u,d)=>u+d.downloads,0);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(us,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Community Templates"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Discover and share AI assistant templates created by the community"})]})]}),c.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Jr,{className:"h-4 w-4"}),c.jsxs("span",{children:[s.toLocaleString()," likes"]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(zs,{className:"h-4 w-4"}),c.jsxs("span",{children:[a.toLocaleString()," downloads"]})]})]})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsx(me,{className:"bg-blue-50 border-blue-200",children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Zu,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Community-Powered AI"}),c.jsx("p",{className:"text-sm text-blue-700 mt-1",children:'Explore specialized AI assistant templates created by experts and the community. Click "Use Template" to load any configuration directly into your Playground.'})]})]})})}),c.jsxs(zI,{defaultValue:"all",className:"space-y-6",children:[c.jsxs(_1,{className:"grid w-full grid-cols-3",children:[c.jsxs(Il,{value:"all",className:"flex items-center gap-2",children:[c.jsx(us,{className:"h-4 w-4"}),"All Templates"]}),c.jsxs(Il,{value:"featured",className:"flex items-center gap-2",children:[c.jsx(Ky,{className:"h-4 w-4"}),"Featured"]}),c.jsxs(Il,{value:"liked",className:"flex items-center gap-2",children:[c.jsx(Jr,{className:"h-4 w-4"}),"My Likes"]})]}),c.jsx(Ml,{value:"all",className:"space-y-6",children:c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(u=>c.jsx(Xa,{template:u,isLiked:t.includes(u.id),onLike:()=>i(u.id),onUse:()=>o(u)},u.id))})}),c.jsx(Ml,{value:"featured",className:"space-y-6",children:c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(u=>c.jsx(Xa,{template:u,isLiked:t.includes(u.id),onLike:()=>i(u.id),onUse:()=>o(u),featured:!0},u.id))})}),c.jsx(Ml,{value:"liked",className:"space-y-6",children:t.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.filter(u=>t.includes(u.id)).map(u=>c.jsx(Xa,{template:u,isLiked:!0,onLike:()=>i(u.id),onUse:()=>o(u)},u.id))}):c.jsxs(me,{className:"text-center py-16",children:[c.jsx(Jr,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),c.jsx("h3",{className:"text-xl font-medium mb-3",children:"No liked templates yet"}),c.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Explore the community templates and click the heart icon to save your favorites for easy access."})]})})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Templates"})]}),c.jsx(Vy,{className:"h-8 w-8 text-blue-600"})]})})}),c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(u=>u.isOfficial).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Official"})]}),c.jsx(Uy,{className:"h-8 w-8 text-green-600"})]})})}),c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-red-500",children:s.toLocaleString()}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Likes"})]}),c.jsx(Jr,{className:"h-8 w-8 text-red-500"})]})})}),c.jsx(me,{children:c.jsx(ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:a.toLocaleString()}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Downloads"})]}),c.jsx(Hb,{className:"h-8 w-8 text-purple-600"})]})})})]})]})})]})}function Xa({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1}){return c.jsxs(me,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${i?"ring-2 ring-yellow-200 shadow-md":""}`,children:[c.jsx(jt,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx($t,{className:"text-base",children:e.name}),e.isOfficial&&c.jsxs(Fe,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[c.jsx(Uy,{className:"h-3 w-3 mr-1"}),"Official"]}),i&&c.jsx(Ky,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),c.jsxs("p",{className:"text-xs text-blue-600 font-medium",children:["by ",e.author]}),c.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:e.description})]}),c.jsx(pe,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:c.jsx(Jr,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),c.jsxs(ve,{className:"space-y-4",children:[c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(o=>c.jsx(Fe,{variant:"secondary",className:"text-xs",children:o},o))}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),c.jsx("p",{className:"text-gray-800",children:e.temperature})]}),c.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[c.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),c.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Jr,{className:"h-3 w-3"}),c.jsx("span",{children:e.likes})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(zs,{className:"h-3 w-3"}),c.jsx("span",{children:e.downloads})]})]}),c.jsxs(pe,{size:"sm",onClick:r,className:"flex items-center gap-1",children:[c.jsx(Vy,{className:"h-3 w-3"}),"Use"]})]})]})]})}function $I(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Md,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsxs(me,{children:[c.jsx(jt,{children:c.jsxs($t,{className:"flex items-center gap-2",children:[c.jsx(Mb,{className:"h-5 w-5"}),"Server Configuration"]})}),c.jsx(ve,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(kt,{className:"text-sm font-medium",children:"Backend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),c.jsxs("div",{children:[c.jsx(kt,{className:"text-sm font-medium",children:"Frontend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),c.jsxs(me,{children:[c.jsx(jt,{children:c.jsxs($t,{className:"flex items-center gap-2",children:[c.jsx(Ju,{className:"h-5 w-5"}),"Privacy & Security"]})}),c.jsx(ve,{className:"space-y-4",children:c.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Ju,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),c.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),c.jsxs(me,{children:[c.jsx(jt,{children:c.jsxs($t,{className:"flex items-center gap-2",children:[c.jsx(Wy,{className:"h-5 w-5"}),"System Information"]})}),c.jsx(ve,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(kt,{className:"text-sm font-medium",children:"Platform"}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx(Fe,{variant:"outline",children:"Local"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),c.jsxs("div",{children:[c.jsx(kt,{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"mt-1",children:c.jsx(Fe,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function UI(){return c.jsx(uC,{children:c.jsx(nC,{children:c.jsxs(_n,{path:"/",element:c.jsx(tN,{}),children:[c.jsx(_n,{index:!0,element:c.jsx(dN,{})}),c.jsx(_n,{path:"playground",element:c.jsx(xI,{})}),c.jsx(_n,{path:"models",element:c.jsx(wI,{})}),c.jsx(_n,{path:"assistants",element:c.jsx(SI,{})}),c.jsx(_n,{path:"community",element:c.jsx(BI,{})}),c.jsx(_n,{path:"settings",element:c.jsx($I,{})})]})})})}Ja.createRoot(document.getElementById("root")).render(c.jsx(Lt.StrictMode,{children:c.jsx(UI,{})})); +//# sourceMappingURL=index-ff495248.js.map