function R1(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 Ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dh={exports:{}},ks={},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 _o=Symbol.for("react.element"),I1=Symbol.for("react.portal"),M1=Symbol.for("react.fragment"),O1=Symbol.for("react.strict_mode"),L1=Symbol.for("react.profiler"),D1=Symbol.for("react.provider"),z1=Symbol.for("react.context"),F1=Symbol.for("react.forward_ref"),B1=Symbol.for("react.suspense"),$1=Symbol.for("react.memo"),U1=Symbol.for("react.lazy"),kf=Symbol.iterator;function V1(e){return e===null||typeof e!="object"?null:(e=kf&&e[kf]||e["@@iterator"],typeof e=="function"?e:null)}var ph={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mh=Object.assign,hh={};function vi(e,t,n){this.props=e,this.context=t,this.refs=hh,this.updater=n||ph}vi.prototype.isReactComponent={};vi.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")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gh(){}gh.prototype=vi.prototype;function Dc(e,t,n){this.props=e,this.context=t,this.refs=hh,this.updater=n||ph}var zc=Dc.prototype=new gh;zc.constructor=Dc;mh(zc,vi.prototype);zc.isPureReactComponent=!0;var Cf=Array.isArray,yh=Object.prototype.hasOwnProperty,Fc={current:null},xh={key:!0,ref:!0,__self:!0,__source:!0};function vh(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)&&!xh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,q=P[Y];if(0>>1;Yi(Me,k))sei(G,Me)?(P[Y]=G,P[se]=k,Y=se):(P[Y]=Me,P[ne]=k,Y=ne);else if(sei(G,k))P[Y]=G,P[se]=k,Y=se;else break e}}return F}function i(P,F){var k=P.sortIndex-F.sortIndex;return k!==0?k:P.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=[],c=[],d=1,f=null,p=3,m=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(P){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=P)r(c),F.sortIndex=F.expirationTime,t(a,F);else break;F=n(c)}}function C(P){if(y=!1,v(P),!w)if(n(a)!==null)w=!0,$(E);else{var F=n(c);F!==null&&W(C,F.startTime-P)}}function E(P,F){w=!1,y&&(y=!1,g(A),A=-1),m=!0;var k=p;try{for(v(F),f=n(a);f!==null&&(!(f.expirationTime>F)||P&&!M());){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),v(F)}else r(a);f=n(a)}if(f!==null)var b=!0;else{var ne=n(c);ne!==null&&W(C,ne.startTime-F),b=!1}return b}finally{f=null,p=k,m=!1}}var N=!1,j=null,A=-1,L=5,_=-1;function M(){return!(e.unstable_now()-_P||125Y?(P.sortIndex=k,t(c,P),n(a)===null&&P===n(c)&&(y?(g(A),A=-1):y=!0,W(C,k-Y))):(P.sortIndex=q,t(a,P),w||m||(w=!0,$(E))),P},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(P){var F=p;return function(){var k=p;p=F;try{return P.apply(this,arguments)}finally{p=k}}}})(bh);Ch.exports=bh;var ew=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 tw=h,vt=ew;function z(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"),tu=Object.prototype.hasOwnProperty,nw=/^[: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]*$/,Nf={},Ef={};function rw(e){return tu.call(Ef,e)?!0:tu.call(Nf,e)?!1:nw.test(e)?Ef[e]=!0:(Nf[e]=!0,!1)}function iw(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 ow(e,t,n,r){if(t===null||typeof t>"u"||iw(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 Uc=/[\-:]([a-z])/g;function Vc(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(Uc,Vc);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(Uc,Vc);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(Uc,Vc);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 Hc(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:"")?Hi(e):""}function lw(e){switch(e.tag){case 5:return Hi(e.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("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 ou(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 Fr:return"Fragment";case zr:return"Portal";case nu:return"Profiler";case Wc:return"StrictMode";case ru:return"Suspense";case iu: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 Kc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gc:return t=e.displayName||null,t!==null?t:ou(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return ou(e(t))}catch{}}return null}function sw(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 ou(t);case 8:return t===Wc?"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 Yn(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 aw(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 Ho(e){e._valueTracker||(e._valueTracker=aw(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 Dl(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 lu(e,t){var n=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Yn(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&&Hc(e,"checked",t,!1)}function su(e,t){Th(e,t);var n=Yn(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")?au(e,t.type,n):t.hasOwnProperty("defaultValue")&&au(e,t.type,Yn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Af(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 au(e,t,n){(t!=="number"||Dl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wi=Array.isArray;function Xr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ao(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},uw=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(e){uw.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 cw=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 du(e,t){if(t){if(cw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function fu(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 pu=null;function Yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mu=null,Jr=null,Zr=null;function Rf(e){if(e=Io(e)){if(typeof mu!="function")throw Error(z(280));var t=e.stateNode;t&&(t=js(t),mu(e.stateNode,e.type,t))}}function Dh(e){Jr?Zr?Zr.push(e):Zr=[e]:Jr=e}function zh(){if(Jr){var e=Jr,t=Zr;if(Zr=Jr=null,Rf(e),t)for(e=0;e>>=0,e===0?32:31-(Sw(e)/kw|0)|0}var Ko=64,Go=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 $l(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 To(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bt(t),e[t]=n}function Ew(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=Xi),$f=String.fromCharCode(32),Uf=!1;function ig(e,t){switch(e){case"keyup":return eS.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 Br=!1;function nS(e,t){switch(e){case"compositionend":return og(t);case"keypress":return t.which!==32?null:(Uf=!0,$f);case"textInput":return e=t.data,e===$f&&Uf?null:e;default:return null}}function rS(e,t){if(Br)return e==="compositionend"||!nd&&ig(e,t)?(e=ng(),xl=Zc=Mn=null,Br=!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=Dl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dl(e.document)}return t}function rd(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 fS(e){var t=cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ug(n.ownerDocument.documentElement,n)){if(r!==null&&rd(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=Gf(n,o);var l=Gf(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,$r=null,wu=null,Zi=null,Su=!1;function Yf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Su||$r==null||$r!==Dl(r)||(r=$r,"selectionStart"in r&&rd(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}),Zi&&ho(Zi,r)||(Zi=r,r=Hl(wu,"onSelect"),0Hr||(e.current=ju[Hr],ju[Hr]=null,Hr--)}function Se(e,t){Hr++,ju[Hr]=e.current,e.current=t}var Qn={},Qe=er(Qn),ot=er(!1),xr=Qn;function ui(e,t){var n=e.type.contextTypes;if(!n)return Qn;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 Kl(){je(ot),je(Qe)}function tp(e,t,n){if(Qe.current!==Qn)throw Error(z(168));Se(Qe,t),Se(ot,n)}function vg(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(z(108,sw(e)||"Unknown",i));return Te({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,xr=Qe.current,Se(Qe,e),Se(ot,ot.current),!0}function np(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=vg(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,je(ot),je(Qe),Se(Qe,e)):je(ot),Se(ot,n)}var dn=null,Ps=!1,wa=!1;function wg(e){dn===null?dn=[e]:dn.push(e)}function bS(e){Ps=!0,wg(e)}function tr(){if(!wa&&dn!==null){wa=!0;var e=0,t=ge;try{var n=dn;for(ge=1;e>=l,i-=l,fn=1<<32-Bt(t)+i|n<A?(L=j,j=null):L=j.sibling;var _=p(g,j,v[A],C);if(_===null){j===null&&(j=L);break}e&&j&&_.alternate===null&&t(g,j),x=o(_,x,A),N===null?E=_:N.sibling=_,N=_,j=L}if(A===v.length)return n(g,j),Pe&&ur(g,A),E;if(j===null){for(;AA?(L=j,j=null):L=j.sibling;var M=p(g,j,_.value,C);if(M===null){j===null&&(j=L);break}e&&j&&M.alternate===null&&t(g,j),x=o(M,x,A),N===null?E=M:N.sibling=M,N=M,j=L}if(_.done)return n(g,j),Pe&&ur(g,A),E;if(j===null){for(;!_.done;A++,_=v.next())_=f(g,_.value,C),_!==null&&(x=o(_,x,A),N===null?E=_:N.sibling=_,N=_);return Pe&&ur(g,A),E}for(j=r(g,j);!_.done;A++,_=v.next())_=m(j,g,A,_.value,C),_!==null&&(e&&_.alternate!==null&&j.delete(_.key===null?A:_.key),x=o(_,x,A),N===null?E=_:N.sibling=_,N=_);return e&&j.forEach(function(T){return t(g,T)}),Pe&&ur(g,A),E}function S(g,x,v,C){if(typeof v=="object"&&v!==null&&v.type===Fr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Vo:e:{for(var E=v.key,N=x;N!==null;){if(N.key===E){if(E=v.type,E===Fr){if(N.tag===7){n(g,N.sibling),x=i(N,v.props.children),x.return=g,g=x;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_n&&op(E)===N.type){n(g,N.sibling),x=i(N,v.props),x.ref=Di(g,N,v),x.return=g,g=x;break e}n(g,N);break}else t(g,N);N=N.sibling}v.type===Fr?(x=yr(v.props.children,g.mode,C,v.key),x.return=g,g=x):(C=El(v.type,v.key,v.props,null,g.mode,C),C.ref=Di(g,x,v),C.return=g,g=C)}return l(g);case zr:e:{for(N=v.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=i(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=Pa(v,g.mode,C),x.return=g,g=x}return l(g);case _n:return N=v._init,S(g,x,N(v._payload),C)}if(Wi(v))return w(g,x,v,C);if(Ri(v))return y(g,x,v,C);el(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,v),x.return=g,g=x):(n(g,x),x=ja(v,g.mode,C),x.return=g,g=x),l(g)):n(g,x)}return S}var di=bg(!0),Ng=bg(!1),ql=er(null),Xl=null,Gr=null,sd=null;function ad(){sd=Gr=Xl=null}function ud(e){var t=ql.current;je(ql),e._currentValue=t}function _u(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 ti(e,t){Xl=e,sd=Gr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},Gr===null){if(Xl===null)throw Error(z(308));Gr=e,Xl.dependencies={lanes:0,firstContext:e}}else Gr=Gr.next=e;return t}var pr=null;function cd(e){pr===null?pr=[e]:pr.push(e)}function Eg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,cd(t)):(n.next=i.next,i.next=n),t.interleaved=n,yn(e,r)}function yn(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 Tn=!1;function dd(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 mn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(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,yn(e,n)}return i=r.interleaved,i===null?(t.next=t,cd(r)):(t.next=i.next,i.next=t),r.interleaved=t,yn(e,n)}function wl(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,qc(e,n)}}function lp(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 Jl(e,t,n,r){var i=e.updateQueue;Tn=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,c=a.next;a.next=null,l===null?o=c:l.next=c,l=a;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=a))}if(o!==null){var f=i.baseState;l=0,d=c=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:Tn=!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?(c=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=c,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);Sr|=l,e.lanes=l,e.memoizedState=f}}function sp(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{ge=n,ka.transition=r}}function Hg(){return Tt().memoizedState}function PS(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Kg(t,n);else if(n=Eg(e,t,n,r),n!==null){var i=Ze();$t(n,e,r,i),Gg(n,t,r)}}function AS(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wg(e))Kg(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,Vt(s,l)){var a=t.interleaved;a===null?(i.next=i,cd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Eg(e,t,i,r),n!==null&&(i=Ze(),$t(n,e,r,i),Gg(n,t,r))}}function Wg(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Kg(e,t){eo=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qc(e,n)}}var ts={readContext:_t,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},_S={readContext:_t,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:up,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,kl(4194308,4,Fg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var n=Qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qt();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=PS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:ap,useDebugValue:vd,useDeferredValue:function(e){return Qt().memoizedState=e},useTransition:function(){var e=ap(!1),t=e[0];return e=jS.bind(null,e[1]),Qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,i=Qt();if(Pe){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ue===null)throw Error(z(349));wr&30||Tg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,up(Ig.bind(null,r,o,e),[e]),r.flags|=2048,Co(9,Rg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Qt(),t=Ue.identifierPrefix;if(Pe){var n=pn,r=fn;n=(r&~(1<<32-Bt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=So++,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[Xt]=t,e[xo]=r,ry(e,t,!1,!1),t.stateNode=e;e:{switch(l=fu(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;imi&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Zl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Pe)return Ge(t),null}else 2*Ie()-o.renderingStartTime>mi&&n!==1073741824&&(t.flags|=128,r=!0,zi(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):(Ge(t),null);case 22:case 23:return Nd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function zS(e,t){switch(od(t),t.tag){case 1:return lt(t.type)&&Kl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fi(),je(ot),je(Qe),md(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return pd(t),null;case 13:if(je(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Ae),null;case 4:return fi(),null;case 10:return ud(t.type._context),null;case 22:case 23:return Nd(),null;case 24:return null;default:return null}}var nl=!1,Ye=!1,FS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Yr(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 Fu(e,t,n){try{n()}catch(r){Re(e,t,r)}}var wp=!1;function BS(e,t){if(ku=Ul,e=cg(),rd(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,c=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&&++c===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(Cu={focusedElem:e,selectionRange:n},Ul=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Lt(t.type,y),S);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(C){Re(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=wp,wp=!1,w}function to(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&&Fu(t,n,o)}i=i.next}while(i!==r)}}function Ts(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 Bu(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[Xt],delete t[xo],delete t[Eu],delete t[kS],delete t[CS])),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 Sp(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 $u(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=Wl));else if(r!==4&&(e=e.child,e!==null))for($u(e,t,n),e=e.sibling;e!==null;)$u(e,t,n),e=e.sibling}function Uu(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(Uu(e,t,n),e=e.sibling;e!==null;)Uu(e,t,n),e=e.sibling}var Ve=null,zt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)ay(e,t,n),n=n.sibling}function ay(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Cs,n)}catch{}switch(n.tag){case 5:Ye||Yr(n,t);case 6:var r=Ve,i=zt;Ve=null,Nn(e,t,n),Ve=r,zt=i,Ve!==null&&(zt?(e=Ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ve.removeChild(n.stateNode));break;case 18:Ve!==null&&(zt?(e=Ve,n=n.stateNode,e.nodeType===8?va(e.parentNode,n):e.nodeType===1&&va(e,n),po(e)):va(Ve,n.stateNode));break;case 4:r=Ve,i=zt,Ve=n.stateNode.containerInfo,zt=!0,Nn(e,t,n),Ve=r,zt=i;break;case 0:case 11:case 14:case 15:if(!Ye&&(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)&&Fu(n,t,l),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Ye&&(Yr(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)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,Nn(e,t,n),Ye=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function kp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FS),t.forEach(function(r){var i=QS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(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*US(r/1960))-r,10e?16:e,On===null)var r=!1;else{if(e=On,On=null,is=0,ce&6)throw Error(z(331));var i=ce;for(ce|=4,K=e.current;K!==null;){var o=K,l=o.child;if(K.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aIe()-Cd?gr(e,0):kd|=n),st(e,t)}function gy(e,t){t===0&&(e.mode&1?(t=Go,Go<<=1,!(Go&130023424)&&(Go=4194304)):t=1);var n=Ze();e=yn(e,t),e!==null&&(To(e,t,n),st(e,n))}function YS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gy(e,n)}function QS(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(z(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,LS(e,t,n);it=!!(e.flags&131072)}else it=!1,Pe&&t.flags&1048576&&Sg(t,Ql,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cl(e,t),e=t.pendingProps;var i=ui(t,Qe.current);ti(t,n),i=gd(null,t,r,e,i,n);var o=yd();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,dd(t),i.updater=_s,t.stateNode=i,i._reactInternals=t,Ru(t,r,e,n),t=Ou(null,t,r,!0,o,n)):(t.tag=0,Pe&&o&&id(t),Je(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=XS(r),e=Lt(r,e),i){case 0:t=Mu(null,t,r,e,n);break e;case 1:t=yp(null,t,r,e,n);break e;case 11:t=hp(null,t,r,e,n);break e;case 14:t=gp(null,t,r,Lt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),Mu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),yp(e,t,r,i,n);case 3:e:{if(ey(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,jg(e,t),Jl(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=pi(Error(z(423)),t),t=xp(e,t,r,n,i);break e}else if(r!==i){i=pi(Error(z(424)),t),t=xp(e,t,r,n,i);break e}else for(ht=Bn(t.stateNode.containerInfo.firstChild),yt=t,Pe=!0,Ft=null,n=Ng(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ci(),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&&Au(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,bu(r,i)?l=null:o!==null&&bu(r,o)&&(t.flags|=32),Zg(e,t),Je(e,t,l,n),t.child;case 6:return e===null&&Au(t),null;case 13:return ty(e,t,n);case 4:return fd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=di(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:Lt(r,i),hp(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(Vt(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=mn(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?a.next=a:(a.next=d.next,d.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),_u(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(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),_u(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,ti(t,n),i=_t(i),r=r(i),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,i=Lt(r,t.pendingProps),i=Lt(r.type,i),gp(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:Lt(r,i),Cl(e,t),t.tag=1,lt(r)?(e=!0,Gl(t)):e=!1,ti(t,n),Yg(t,r,i),Ru(t,r,i,n),Ou(null,t,r,!0,e,n);case 19:return ny(e,t,n);case 22:return Jg(e,t,n)}throw Error(z(156,t.tag))};function xy(e,t){return Wh(e,t)}function qS(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 qS(e,t,n,r)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XS(e){if(typeof e=="function")return jd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kc)return 11;if(e===Gc)return 14}return 2}function Hn(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 El(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")jd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Fr:return yr(n.children,i,o,t);case Wc:l=8,i|=8;break;case nu:return e=Et(12,n,t,i|2),e.elementType=nu,e.lanes=o,e;case ru:return e=Et(13,n,t,i),e.elementType=ru,e.lanes=o,e;case iu:return e=Et(19,n,t,i),e.elementType=iu,e.lanes=o,e;case Ph:return Is(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 Kc:l=11;break e;case Gc:l=14;break e;case _n:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Et(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function yr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function Is(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 JS(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 Pd(e,t,n,r,i,o,l,s,a){return e=new JS(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},dd(o),e}function ZS(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 ik=Ss(ki);var _p=ki;eu.createRoot=_p.createRoot,eu.hydrateRoot=_p.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 No(){return No=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 lk(){return Math.random().toString(36).substr(2,8)}function Rp(e,t){return{usr:e.state,key:e.key,idx:t}}function Gu(e,t,n,r){return n===void 0&&(n=null),No({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ci(t):t,{state:n,key:t&&t.key||r||lk()})}function ss(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 sk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Ln.Pop,a=null,c=d();c==null&&(c=0,l.replaceState(No({},l.state,{idx:c}),""));function d(){return(l.state||{idx:null}).idx}function f(){s=Ln.Pop;let S=d(),g=S==null?null:S-c;c=S,a&&a({action:s,location:y.location,delta:g})}function p(S,g){s=Ln.Push;let x=Gu(y.location,S,g);n&&n(x,S),c=d()+1;let v=Rp(x,c),C=y.createHref(x);try{l.pushState(v,"",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=Ln.Replace;let x=Gu(y.location,S,g);n&&n(x,S),c=d();let v=Rp(x,c),C=y.createHref(x);l.replaceState(v,"",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,x=typeof S=="string"?S:ss(S);return x=x.replace(/ $/,"%20"),ze(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,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(Tp,f),a=S,()=>{i.removeEventListener(Tp,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 Ip;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ip||(Ip={}));function ak(e,t,n){return n===void 0&&(n="/"),uk(e,t,n,!1)}function uk(e,t,n,r){let i=typeof t=="string"?Ci(t):t,o=Rd(i.pathname||"/",n);if(o==null)return null;let l=by(e);ck(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("/")&&(ze(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 c=Wn([r,a.relativePath]),d=n.concat(a);o.children&&o.children.length>0&&(ze(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),by(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:yk(c,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 ck(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const dk=/^:[\w-]+$/,fk=3,pk=2,mk=1,hk=10,gk=-2,Mp=e=>e==="*";function yk(e,t){let n=e.split("/"),r=n.length;return n.some(Mp)&&(r+=gk),t&&(r+=pk),n.filter(i=>!Mp(i)).reduce((i,o)=>i+(dk.test(o)?fk:o===""?mk:hk),r)}function xk(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 vk(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?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function wk(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 Sk(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 Rd(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 kk(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:Ck(n,t):t,search:Ek(r),hash:jk(i)}}function Ck(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 bk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ey(e,t){let n=bk(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=No({},e),ze(!i.pathname||!i.pathname.includes("?"),Aa("?","pathname","search",i)),ze(!i.pathname||!i.pathname.includes("#"),Aa("#","pathname","hash",i)),ze(!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=kk(i,s),c=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(c||d)&&(a.pathname+="/"),a}const Wn=e=>e.join("/").replace(/\/\/+/g,"/"),Nk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ek=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pk(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 Ak=["get",...Py];new Set(Ak);/** * 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 Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),h.useCallback(function(c,d){if(d===void 0&&(d={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let f=jy(c,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Wn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,l,o,e])}const Mk=h.createContext(null);function Ok(e){let t=h.useContext(nr).outlet;return t&&h.createElement(Mk.Provider,{value:e},t)}function Ty(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(Ar),{matches:i}=h.useContext(nr),{pathname:o}=Lo(),l=JSON.stringify(Ey(i,r.v7_relativeSplatPath));return h.useMemo(()=>jy(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Lk(e,t){return Dk(e,t)}function Dk(e,t,n,r){Oo()||ze(!1);let{navigator:i}=h.useContext(Ar),{matches:o}=h.useContext(nr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let c=Lo(),d;if(t){var f;let S=typeof t=="string"?Ci(t):t;a==="/"||(f=S.pathname)!=null&&f.startsWith(a)||ze(!1),d=S}else d=c;let p=d.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=ak(e,{pathname:m}),y=Uk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Wn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Wn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?h.createElement(zs.Provider,{value:{location:Eo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ln.Pop}},y):y}function zk(){let e=Kk(),t=Pk(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 Fk=h.createElement(zk,null);class Bk 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(nr.Provider,{value:this.props.routeContext},h.createElement(Ay.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $k(e){let{routeContext:t,match:n,children:r}=e,i=h.useContext(Id);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(nr.Provider,{value:t},r)}function Uk(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||ze(!1),l=l.slice(0,Math.min(l.length,d+1))}let a=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,c+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||Fk,a&&(c<0&&p===0?(Yk("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=f.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,p+1)),x=()=>{let v;return m?v=y:w?v=S:f.route.Component?v=h.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,h.createElement($k,{match:f,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(Bk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var Ry=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ry||{}),as=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}(as||{});function Vk(e){let t=h.useContext(Id);return t||ze(!1),t}function Hk(e){let t=h.useContext(_k);return t||ze(!1),t}function Wk(e){let t=h.useContext(nr);return t||ze(!1),t}function Iy(e){let t=Wk(),n=t.matches[t.matches.length-1];return n.route.id||ze(!1),n.route.id}function Kk(){var e;let t=h.useContext(Ay),n=Hk(as.UseRouteError),r=Iy(as.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Gk(){let{router:e}=Vk(Ry.UseNavigateStable),t=Iy(as.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,Eo({fromRouteId:t},o)))},[e,t])}const Lp={};function Yk(e,t,n){!t&&!Lp[e]&&(Lp[e]=!0)}function Qk(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 qk(e){return Ok(e.context)}function Pn(e){ze(!1)}function Xk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ln.Pop,navigator:o,static:l=!1,future:s}=e;Oo()&&ze(!1);let a=t.replace(/^\/*/,"/"),c=h.useMemo(()=>({basename:a,navigator:o,static:l,future:Eo({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=Rd(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(Ar.Provider,{value:c},h.createElement(zs.Provider,{children:n,value:y}))}function Jk(e){let{children:t,location:n}=e;return Lk(Yu(t),n)}new Promise(()=>{});function Yu(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,Yu(r.props.children,o));return}r.type!==Pn&&ze(!1),!r.props.index||!r.props.children||ze(!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=Yu(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 Qu(){return Qu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function eC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tC(e,t){return e.button===0&&(!t||t==="_self")&&!eC(e)}const nC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rC="6";try{window.__reactRouterVersion=rC}catch{}const iC="startTransition",Dp=$c[iC];function oC(e){let{basename:t,children:n,future:r,window:i}=e,o=h.useRef();o.current==null&&(o.current=ok({window:i,v5Compat:!0}));let l=o.current,[s,a]=h.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},d=h.useCallback(f=>{c&&Dp?Dp(()=>a(f)):a(f)},[a,c]);return h.useLayoutEffect(()=>l.listen(d),[l,d]),h.useEffect(()=>Qk(r),[r]),h.createElement(Xk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const lC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,My=h.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:c,preventScrollReset:d,viewTransition:f}=t,p=Zk(t,nC),{basename:m}=h.useContext(Ar),w,y=!1;if(typeof c=="string"&&sC.test(c)&&(w=c,lC))try{let v=new URL(window.location.href),C=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=Rd(C.pathname,m);C.origin===v.origin&&E!=null?c=E+C.search+C.hash:y=!0}catch{}let S=Tk(c,{relative:i}),g=aC(c,{replace:l,state:s,target:a,preventScrollReset:d,relative:i,viewTransition:f});function x(v){r&&r(v),v.defaultPrevented||g(v)}return h.createElement("a",Qu({},p,{href:w||S,onClick:y||o?r:x,ref:n,target:a}))});var zp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(zp||(zp={}));var Fp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fp||(Fp={}));function aC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Rk(),c=Lo(),d=Ty(e,{relative:l});return h.useCallback(f=>{if(tC(f,n)){f.preventDefault();let p=r!==void 0?r:ss(c)===ss(d);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[c,a,d,r,i,n,e,o,l,s])}function Oy(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 Fy="!";function gC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,c=0,d,f=0;fc?d-c:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function yC(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 xC(e){return{cache:hC(e.cacheSize),splitModifiers:gC(e),...cC(e)}}var vC=/\s+/;function wC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(vC).map(function(l){var s=n(l),a=s.modifiers,c=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=yC(a).join(":"),y=c?w+Fy: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,c=l.hasPostfixModifier,d=s+a;return o.has(d)?!1:(o.add(d),i(a,c).forEach(function(f){return o.add(s+f)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function SC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Vp=e=>{const t=zC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Uy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),FC=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 BC={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 $C=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,...BC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Uy("lucide",i),...!o&&!FC(s)&&{"aria-hidden":"true"},...s},[...l.map(([c,d])=>h.createElement(c,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($C,{ref:o,iconNode:t,className:Uy(`lucide-${DC(Vp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Vp(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 UC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_a=te("arrow-right",UC);/** * @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 VC=[["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"}]],Vy=te("award",VC);/** * @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 HC=[["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"}]],Od=te("book-open",HC);/** * @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 WC=[["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"}]],Ut=te("bot",WC);/** * @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:"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"}]],Kn=te("brain",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 GC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],YC=te("check",GC);/** * @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:"m6 9 6 6 6-6",key:"qrunsl"}]],Hy=te("chevron-down",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:"m18 15-6-6-6 6",key:"153udz"}]],XC=te("chevron-up",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 JC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ZC=te("circle-check-big",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 eb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],us=te("cloud",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 tb=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],nb=te("code",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 rb=[["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"}]],Wy=te("copy",rb);/** * @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:"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"}]],ob=te("cpu",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:"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"}]],Fs=te("download",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=[["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"}]],Ky=te("hard-drive",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 ab=[["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"}]],qr=te("heart",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 ub=[["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"}]],cb=te("history",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 db=[["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"}]],fb=te("house",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 pb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Gy=te("info",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:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ju=te("loader-circle",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:"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"}]],hi=te("message-square",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 gb=[["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"}]],yb=te("panel-left-close",gb);/** * @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=[["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"}]],vb=te("panel-left-open",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:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Zu=te("plus",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:"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"}]],kb=te("rotate-ccw",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 Cb=[["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"}]],bb=te("save",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 Nb=[["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"}]],Eb=te("send",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 jb=[["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"}]],Pb=te("server",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:"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"}]],Ld=te("settings",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 _b=[["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"}]],Yy=te("share",_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 Tb=[["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"}]],ec=te("shield",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 Rb=[["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"}]],tc=te("sparkles",Rb);/** * @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:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Mb=te("square",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:"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"}]],Qy=te("star",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:"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"}]],Dd=te("trash-2",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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],zb=te("trending-up",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 Fb=[["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"}]],Bb=te("triangle-alert",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:"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"}]],Ub=te("upload",$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 Vb=[["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"}]],Hb=te("user",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:"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"}]],cs=te("users",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:"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"}]],ds=te("zap",Kb),Gb=[{name:"Home",href:"/",icon:fb,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:hi,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:Od,description:"Browse and manage AI models"},{name:"My Assistants",href:"/assistants",icon:Ut,description:"Manage your custom AI assistants"},{name:"Community",href:"/community",icon:cs,description:"Discover and share assistant templates"},{name:"Settings",href:"/settings",icon:Ld,description:"Application settings"}];function Yb(){const e=Lo();return u.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[u.jsx("div",{className:"p-6 border-b",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:u.jsx(Kn,{className:"h-5 w-5 text-primary-foreground"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),u.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:u.jsxs("div",{children:[u.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),u.jsx("nav",{className:"space-y-1",children:Gb.map(t=>{const n=e.pathname===t.href;return u.jsxs(My,{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:[u.jsx(t.icon,{className:"h-4 w-4"}),u.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Qb(){return u.jsxs("div",{className:"flex h-screen bg-background",children:[u.jsx("div",{className:"w-64 border-r",children:u.jsx(Yb,{})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx(qk,{})})]})}const de=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));de.displayName="Card";const jt=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));jt.displayName="CardHeader";const Pt=h.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));Pt.displayName="CardTitle";const qb=h.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));qb.displayName="CardDescription";const he=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));he.displayName="CardContent";const Xb=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));Xb.displayName="CardFooter";function Hp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Hp(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(tN);if(a){const c=a.props.children,d=s.map(f=>f===a?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...l,ref:i,children:h.isValidElement(c)?h.cloneElement(c,void 0,d):null})}return u.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Jb=gi("Slot");function Zb(e){const t=h.forwardRef((n,r)=>{const{children:i,...o}=n;if(h.isValidElement(i)){const l=rN(i),s=nN(o,i.props);return i.type!==h.Fragment&&(s.ref=r?qy(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 Xy=Symbol("radix.slottable");function eN(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Xy,t}function tN(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xy}function nN(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 rN(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 Wp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kp=Ly,zd=(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(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const p=Wp(d)||Wp(f);return i[c][p]}),s=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,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})?[...c,f,p]:c},[]);return Kp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Fd=zd("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"}}),me=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Jb:"button";return u.jsx(l,{className:ue(Fd({variant:t,size:n,className:e})),ref:o,...i})});me.displayName="Button";const iN=zd("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 Le({className:e,variant:t,...n}){return u.jsx("div",{className:ue(iN({variant:t}),e),...n})}function oN(){const[e,t]=h.useState({models:0,assistants:0,isOnline:!1});h.useEffect(()=>{n(),r()},[]);const n=()=>{try{const o=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(l=>({...l,assistants:o.length}))}catch(o){console.error("Failed to load stats:",o)}},r=async()=>{try{const o=`${window.location.protocol}//${window.location.host}`,l=await fetch(`${o}/models`);if(l.ok){const s=await l.json();t(a=>{var c;return{...a,models:((c=s.models)==null?void 0:c.length)||0,isOnline:!0}})}}catch(o){console.error("System check failed:",o),t(l=>({...l,isOnline:!1}))}},i=[{icon:ec,title:"Privacy First",description:"Local processing with complete data control"},{icon:ds,title:"High Performance",description:"Optimized for speed and efficiency"},{icon:ob,title:"Local & Cloud",description:"Run models locally or access cloud APIs"},{icon:Kn,title:"Advanced Models",description:"Support for latest AI capabilities"}];return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-100 border-b",children:u.jsx("div",{className:"max-w-6xl mx-auto px-6 py-16",children:u.jsxs("div",{className:"text-center space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[u.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:u.jsx(Kn,{className:"h-7 w-7 text-white"})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Edge LLM"}),u.jsx(Le,{variant:e.isOnline?"default":"secondary",className:"text-xs",children:e.isOnline?"Online":"Offline"})]})]}),u.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."})]})})}),u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-12 space-y-12",children:[u.jsxs("section",{children:[u.jsxs("div",{className:"text-center mb-8",children:[u.jsx("h2",{className:"text-2xl font-semibold mb-3",children:"Choose Your Starting Point"}),u.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Select the path that matches your experience level and goals"})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[u.jsx(de,{className:"hover:shadow-xl transition-all duration-300 cursor-pointer hover:-translate-y-2 border-2 border-green-200 bg-green-50",children:u.jsxs(he,{className:"p-8 text-center space-y-6",children:[u.jsx("div",{className:"w-16 h-16 bg-green-600 rounded-2xl flex items-center justify-center mx-auto",children:u.jsx(cs,{className:"h-8 w-8 text-white"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"inline-flex items-center gap-1 bg-green-100 text-green-700 px-3 py-1 rounded-full text-xs font-medium mb-3",children:[u.jsx("span",{children:"👋"})," New to AI Assistants"]}),u.jsx("h3",{className:"font-bold text-xl mb-2",children:"Start with Templates"}),u.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Explore pre-built AI assistants from our community. Perfect for learning and getting immediate results."})]}),u.jsxs(me,{className:"w-full bg-green-600 hover:bg-green-700",size:"lg",onClick:()=>window.location.href="/community",children:["Browse Templates",u.jsx(_a,{className:"h-4 w-4 ml-2"})]})]})}),u.jsx(de,{className:"hover:shadow-xl transition-all duration-300 cursor-pointer hover:-translate-y-2 border-2 border-blue-200 bg-blue-50",children:u.jsxs(he,{className:"p-8 text-center space-y-6",children:[u.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-2xl flex items-center justify-center mx-auto",children:u.jsx(Ut,{className:"h-8 w-8 text-white"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"inline-flex items-center gap-1 bg-blue-100 text-blue-700 px-3 py-1 rounded-full text-xs font-medium mb-3",children:[u.jsx("span",{children:"🎯"})," Ready to Create"]}),u.jsx("h3",{className:"font-bold text-xl mb-2",children:"Build Custom Assistant"}),u.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Create your own AI assistant with custom prompts, parameters, and specialized behaviors."})]}),u.jsxs(me,{className:"w-full",size:"lg",onClick:()=>window.location.href="/playground?mode=create",children:["Create Assistant",u.jsx(_a,{className:"h-4 w-4 ml-2"})]})]})}),u.jsx(de,{className:"hover:shadow-xl transition-all duration-300 cursor-pointer hover:-translate-y-2 border-2 border-purple-200 bg-purple-50",children:u.jsxs(he,{className:"p-8 text-center space-y-6",children:[u.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-2xl flex items-center justify-center mx-auto",children:u.jsx(hi,{className:"h-8 w-8 text-white"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"inline-flex items-center gap-1 bg-purple-100 text-purple-700 px-3 py-1 rounded-full text-xs font-medium mb-3",children:[u.jsx("span",{children:"💬"})," Just Want to Chat"]}),u.jsx("h3",{className:"font-bold text-xl mb-2",children:"Quick Conversation"}),u.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Jump straight into chatting with AI models. No setup required, start talking immediately."})]}),u.jsxs(me,{className:"w-full bg-purple-600 hover:bg-purple-700",size:"lg",onClick:()=>window.location.href="/playground",children:["Start Chatting",u.jsx(_a,{className:"h-4 w-4 ml-2"})]})]})})]})]}),u.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[u.jsx(de,{children:u.jsxs(he,{className:"p-6 text-center",children:[u.jsx("div",{className:"text-3xl font-bold text-blue-600 mb-2",children:e.models}),u.jsx("div",{className:"text-sm text-gray-600",children:"Available Models"})]})}),u.jsx(de,{children:u.jsxs(he,{className:"p-6 text-center",children:[u.jsx("div",{className:"text-3xl font-bold text-purple-600 mb-2",children:e.assistants}),u.jsx("div",{className:"text-sm text-gray-600",children:"My Assistants"})]})}),u.jsx(de,{children:u.jsxs(he,{className:"p-6 text-center",children:[u.jsx("div",{className:"text-3xl font-bold text-green-600 mb-2",children:"5"}),u.jsx("div",{className:"text-sm text-gray-600",children:"Community Templates"})]})})]}),u.jsxs("section",{children:[u.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Core Features"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:i.map(o=>u.jsx(de,{className:"text-center",children:u.jsxs(he,{className:"p-6 space-y-4",children:[u.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mx-auto",children:u.jsx(o.icon,{className:"h-6 w-6 text-gray-700"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold",children:o.title}),u.jsx("p",{className:"text-sm text-gray-600 mt-1",children:o.description})]})]})},o.title))})]}),u.jsxs("section",{className:"text-center bg-gray-50 rounded-2xl p-8",children:[u.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Ready to Get Started?"}),u.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."}),u.jsxs("div",{className:"flex items-center justify-center gap-4",children:[u.jsxs(me,{onClick:()=>window.location.href="/playground",children:[u.jsx(hi,{className:"h-4 w-4 mr-2"}),"Open Playground"]}),u.jsxs(me,{variant:"outline",onClick:()=>window.location.href="/assistants",children:[u.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Create Assistant"]})]})]})]})]})}function fs(e,[t,n]){return Math.min(n,Math.max(t,e))}function ee(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 lN(e,t){const n=h.createContext(t),r=o=>{const{children:l,...s}=o,a=h.useMemo(()=>s,Object.values(s));return u.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 rr(e,t=[]){let n=[];function r(o,l){const s=h.createContext(l),a=n.length;n=[...n,l];const c=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 u.jsx(y.Provider,{value:S,children:m})};c.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[c,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,sN(i,...t)]}function sN(...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:c})=>{const f=a(o)[`__scope${c}`];return{...s,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var qe=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},aN=$c[" useInsertionEffect ".trim().toString()]||qe;function yi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=uN({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 c=h.useCallback(d=>{var f;if(s){const p=cN(d)?d(e):d;p!==e&&((f=l.current)==null||f.call(l,p))}else o(d)},[s,e,o,l]);return[a,c]}function uN({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),i=h.useRef(n),o=h.useRef(t);return aN(()=>{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 cN(e){return typeof e=="function"}var dN=h.createContext(void 0);function Bs(e){const t=h.useContext(dN);return e||t||"ltr"}function Jy(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 Zy(e){const[t,n]=h.useState(void 0);return qe(()=>{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,c=Array.isArray(a)?a[0]:a;l=c.inlineSize,s=c.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 fN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=fN.reduce((e,t)=>{const n=gi(`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),u.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function pN(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}function Bd(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:g}=y,x=Dt.useRef(null),v=Dt.useRef(new Map).current;return u.jsx(i,{scope:S,itemMap:v,collectionRef:x,children:g})};l.displayName=t;const s=e+"CollectionSlot",a=gi(s),c=Dt.forwardRef((y,S)=>{const{scope:g,children:x}=y,v=o(s,g),C=pe(S,v.collectionRef);return u.jsx(a,{ref:C,children:x})});c.displayName=s;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=gi(d),m=Dt.forwardRef((y,S)=>{const{scope:g,children:x,...v}=y,C=Dt.useRef(null),E=pe(S,C),N=o(d,g);return Dt.useEffect(()=>(N.itemMap.set(C,{ref:C,...v}),()=>void N.itemMap.delete(C))),u.jsx(p,{[f]:"",ref:E,children:x})});m.displayName=d;function w(y){const S=o(e+"CollectionConsumer",y);return Dt.useCallback(()=>{const x=S.collectionRef.current;if(!x)return[];const v=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((N,j)=>v.indexOf(N.ref.current)-v.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:m},w,r]}var ex=["PageUp","PageDown"],tx=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nx={"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",[nc,mN,hN]=Bd(bi),[rx,PI]=rr(bi,[hN]),[gN,$s]=rx(bi),ix=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:c=[r],value:d,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...y}=e,S=h.useRef(new Set),g=h.useRef(0),v=l==="horizontal"?yN:xN,[C=[],E]=yi({prop:d,defaultProp:c,onChange:M=>{var V;(V=[...S.current][g.current])==null||V.focus(),f(M)}}),N=h.useRef(C);function j(M){const T=CN(C,M);_(M,T)}function A(M){_(M,g.current)}function L(){const M=N.current[g.current];C[g.current]!==M&&p(C)}function _(M,T,{commit:V}={commit:!1}){const O=jN(o),D=PN(Math.round((M-r)/o)*o+r,O),$=fs(D,[r,i]);E((W=[])=>{const P=SN(W,$,T);if(EN(P,a*o)){g.current=P.indexOf($);const F=String(P)!==String(W);return F&&V&&p(P),F?P:W}else return W})}return u.jsx(gN,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:w,children:u.jsx(nc.Provider,{scope:e.__scopeSlider,children:u.jsx(nc.Slot,{scope:e.__scopeSlider,children:u.jsx(v,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:ee(y.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:A,onSlideEnd:s?void 0:L,onHomeKeyDown:()=>!s&&_(r,0,{commit:!0}),onEndKeyDown:()=>!s&&_(i,C.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:T})=>{if(!s){const D=ex.includes(M.key)||M.shiftKey&&tx.includes(M.key)?10:1,$=g.current,W=C[$],P=o*D*T;_(W+P,$,{commit:!0})}}})})})})});ix.displayName=bi;var[ox,lx]=rx(bi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yN=h.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:c,...d}=e,[f,p]=h.useState(null),m=pe(t,v=>p(v)),w=h.useRef(void 0),y=Bs(i),S=y==="ltr",g=S&&!o||!S&&o;function x(v){const C=w.current||f.getBoundingClientRect(),E=[0,C.width],j=$d(E,g?[n,r]:[r,n]);return w.current=C,j(v-C.left)}return u.jsx(ox,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:u.jsx(sx,{dir:y,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const C=x(v.clientX);l==null||l(C)},onSlideMove:v=>{const C=x(v.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:v=>{const E=nx[g?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:E?-1:1})}})})}),xN=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...c}=e,d=h.useRef(null),f=pe(t,d),p=h.useRef(void 0),m=!i;function w(y){const S=p.current||d.current.getBoundingClientRect(),g=[0,S.height],v=$d(g,m?[r,n]:[n,r]);return p.current=S,v(y-S.top)}return u.jsx(ox,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:u.jsx(sx,{"data-orientation":"vertical",...c,ref:f,style:{...c.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=nx[m?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:g?-1:1})}})})}),sx=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...c}=e,d=$s(bi,n);return u.jsx(ie.span,{...c,ref:t,onKeyDown:ee(e.onKeyDown,f=>{f.key==="Home"?(l(f),f.preventDefault()):f.key==="End"?(s(f),f.preventDefault()):ex.concat(tx).includes(f.key)&&(a(f),f.preventDefault())}),onPointerDown:ee(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(p)?p.focus():r(f)}),onPointerMove:ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:ee(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),o(f))})})}),ax="SliderTrack",ux=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=$s(ax,n);return u.jsx(ie.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});ux.displayName=ax;var rc="SliderRange",cx=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=$s(rc,n),o=lx(rc,n),l=h.useRef(null),s=pe(t,l),a=i.values.length,c=i.values.map(p=>px(p,i.min,i.max)),d=a>1?Math.min(...c):0,f=100-Math.max(...c);return u.jsx(ie.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:f+"%"}})});cx.displayName=rc;var ic="SliderThumb",dx=h.forwardRef((e,t)=>{const n=mN(e.__scopeSlider),[r,i]=h.useState(null),o=pe(t,s=>i(s)),l=h.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return u.jsx(vN,{...e,ref:o,index:l})}),vN=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=$s(ic,n),s=lx(ic,n),[a,c]=h.useState(null),d=pe(t,x=>c(x)),f=a?l.form||!!a.closest("form"):!0,p=Zy(a),m=l.values[r],w=m===void 0?0:px(m,l.min,l.max),y=kN(r,l.values.length),S=p==null?void 0:p[s.size],g=S?bN(S,w,s.direction):0;return h.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${g}px)`},children:[u.jsx(nc.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(ie.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:ee(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),f&&u.jsx(fx,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});dx.displayName=ic;var wN="RadioBubbleInput",fx=h.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=h.useRef(null),o=pe(i,r),l=Jy(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]),u.jsx(ie.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});fx.displayName=wN;function SN(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function px(e,t,n){const o=100/(n-t)*(e-t);return fs(o,[0,100])}function kN(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function CN(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 bN(e,t,n){const r=e/2,o=$d([0,50],[0,r]);return(r-o(t)*n)*n}function NN(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function EN(e,t){if(t>0){const n=NN(e);return Math.min(...n)>=t}return!0}function $d(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 jN(e){return(String(e).split(".")[1]||"").length}function PN(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var mx=ix,AN=ux,_N=cx,TN=dx;const oc=h.forwardRef(({className:e,...t},n)=>u.jsxs(mx,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[u.jsx(AN,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:u.jsx(_N,{className:"absolute h-full bg-primary"})}),u.jsx(TN,{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"})]}));oc.displayName=mx.displayName;var RN="Label",hx=h.forwardRef((e,t)=>u.jsx(ie.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())}}));hx.displayName=RN;var gx=hx;const IN=zd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kt=h.forwardRef(({className:e,...t},n)=>u.jsx(gx,{ref:n,className:ue(IN(),e),...t}));kt.displayName=gx.displayName;const yx=h.forwardRef(({className:e,type:t,...n},r)=>u.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}));yx.displayName="Input";const Ud=h.forwardRef(({className:e,...t},n)=>u.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}));Ud.displayName="Textarea";function qn(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 MN(e,t=globalThis==null?void 0:globalThis.document){const n=qn(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 ON="DismissableLayer",lc="dismissableLayer.update",LN="dismissableLayer.pointerDownOutside",DN="dismissableLayer.focusOutside",Gp,xx=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vd=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,c=h.useContext(xx),[d,f]=h.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),w=pe(t,j=>f(j)),y=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(S),x=d?y.indexOf(d):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,C=x>=g,E=BN(j=>{const A=j.target,L=[...c.branches].some(_=>_.contains(A));!C||L||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=$N(j=>{const A=j.target;[...c.branches].some(_=>_.contains(A))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return MN(j=>{x===c.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),h.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Gp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Yp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Gp)}},[d,p,n,c]),h.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Yp())},[d,c]),h.useEffect(()=>{const j=()=>m({});return document.addEventListener(lc,j),()=>document.removeEventListener(lc,j)},[]),u.jsx(ie.div,{...a,ref:w,style:{pointerEvents:v?C?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,E.onPointerDownCapture)})});Vd.displayName=ON;var zN="DismissableLayerBranch",FN=h.forwardRef((e,t)=>{const n=h.useContext(xx),r=h.useRef(null),i=pe(t,r);return h.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(ie.div,{...e,ref:i})});FN.displayName=zN;function BN(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=h.useRef(!1),i=h.useRef(()=>{});return h.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){vx(LN,n,c,{discrete:!0})};const c={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 $N(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=h.useRef(!1);return h.useEffect(()=>{const i=o=>{o.target&&!r.current&&vx(DN,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 Yp(){const e=new CustomEvent(lc);document.dispatchEvent(e)}function vx(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?pN(i,o):i.dispatchEvent(o)}var Ta=0;function wx(){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()),Ta++,()=>{Ta===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ta--}},[])}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 Ra="focusScope.autoFocusOnMount",Ia="focusScope.autoFocusOnUnmount",qp={bubbles:!1,cancelable:!0},UN="FocusScope",Hd=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=h.useState(null),c=qn(i),d=qn(o),f=h.useRef(null),p=pe(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(v){if(m.paused||!s)return;const C=v.target;s.contains(C)?f.current=C:An(f.current,{select:!0})},S=function(v){if(m.paused||!s)return;const C=v.relatedTarget;C!==null&&(s.contains(C)||An(f.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const E of v)E.removedNodes.length>0&&An(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const x=new MutationObserver(g);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),x.disconnect()}}},[r,s,m.paused]),h.useEffect(()=>{if(s){Jp.add(m);const y=document.activeElement;if(!s.contains(y)){const g=new CustomEvent(Ra,qp);s.addEventListener(Ra,c),s.dispatchEvent(g),g.defaultPrevented||(VN(YN(Sx(s)),{select:!0}),document.activeElement===y&&An(s))}return()=>{s.removeEventListener(Ra,c),setTimeout(()=>{const g=new CustomEvent(Ia,qp);s.addEventListener(Ia,d),s.dispatchEvent(g),g.defaultPrevented||An(y??document.body,{select:!0}),s.removeEventListener(Ia,d),Jp.remove(m)},0)}}},[s,c,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 x=y.currentTarget,[v,C]=HN(x);v&&C?!y.shiftKey&&g===C?(y.preventDefault(),n&&An(v,{select:!0})):y.shiftKey&&g===v&&(y.preventDefault(),n&&An(C,{select:!0})):g===x&&y.preventDefault()}},[n,r,m.paused]);return u.jsx(ie.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Hd.displayName=UN;function VN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(An(r,{select:t}),document.activeElement!==n)return}function HN(e){const t=Sx(e),n=Xp(t,e),r=Xp(t.reverse(),e);return[n,r]}function Sx(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 Xp(e,t){for(const n of e)if(!WN(n,{upTo:t}))return n}function WN(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 KN(e){return e instanceof HTMLInputElement&&"select"in e}function An(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KN(e)&&t&&e.select()}}var Jp=GN();function GN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Zp(e,t),e.unshift(t)},remove(t){var n;e=Zp(e,t),(n=e[0])==null||n.resume()}}}function Zp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YN(e){return e.filter(t=>t.tagName!=="A")}var QN=$c[" useId ".trim().toString()]||(()=>{}),qN=0;function Gn(e){const[t,n]=h.useState(QN());return qe(()=>{e||n(r=>r??String(qN++))},[e]),e||(t?`radix-${t}`:"")}const XN=["top","right","bottom","left"],Xn=Math.min,mt=Math.max,ps=Math.round,ll=Math.floor,rn=e=>({x:e,y:e}),JN={left:"right",right:"left",bottom:"top",top:"bottom"},ZN={start:"end",end:"start"};function sc(e,t,n){return mt(e,Xn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function wn(e){return e.split("-")[0]}function Ni(e){return e.split("-")[1]}function Wd(e){return e==="x"?"y":"x"}function Kd(e){return e==="y"?"height":"width"}const eE=new Set(["top","bottom"]);function en(e){return eE.has(wn(e))?"y":"x"}function Gd(e){return Wd(en(e))}function tE(e,t,n){n===void 0&&(n=!1);const r=Ni(e),i=Gd(e),o=Kd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ms(l)),[l,ms(l)]}function nE(e){const t=ms(e);return[ac(e),t,ac(t)]}function ac(e){return e.replace(/start|end/g,t=>ZN[t])}const em=["left","right"],tm=["right","left"],rE=["top","bottom"],iE=["bottom","top"];function oE(e,t,n){switch(e){case"top":case"bottom":return n?t?tm:em:t?em:tm;case"left":case"right":return t?rE:iE;default:return[]}}function lE(e,t,n,r){const i=Ni(e);let o=oE(wn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(ac)))),o}function ms(e){return e.replace(/left|right|bottom|top/g,t=>JN[t])}function sE(e){return{top:0,right:0,bottom:0,left:0,...e}}function kx(e){return typeof e!="number"?sE(e):{top:e,right:e,bottom:e,left:e}}function hs(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 nm(e,t,n){let{reference:r,floating:i}=e;const o=en(t),l=Gd(t),s=Kd(l),a=wn(t),c=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&&c?-1:1);break;case"end":m[l]+=p*(n&&c?-1:1);break}return m}const aE=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 c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=nm(c,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:c,padding:d=0}=vn(e,t)||{};if(c==null)return{};const f=kx(d),p={x:n,y:r},m=Gd(i),w=Kd(m),y=await l.getDimensions(c),S=m==="y",g=S?"top":"left",x=S?"bottom":"right",v=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(c));let j=N?N[v]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[v]||o.floating[w]);const A=C/2-E/2,L=j/2-y[w]/2-1,_=Xn(f[g],L),M=Xn(f[x],L),T=_,V=j-y[w]-M,O=j/2-y[w]/2+A,D=sc(T,O,V),$=!a.arrow&&Ni(i)!=null&&O!==D&&o.reference[w]/2-(OO<=0)){var M,T;const O=(((M=o.flip)==null?void 0:M.index)||0)+1,D=j[O];if(D&&(!(f==="alignment"?x!==en(D):!1)||_.every(P=>en(P.placement)===x?P.overflows[0]>0:!0)))return{data:{index:O,overflows:_},reset:{placement:D}};let $=(T=_.filter(W=>W.overflows[0]<=0).sort((W,P)=>W.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(m){case"bestFit":{var V;const W=(V=_.filter(P=>{if(N){const F=en(P.placement);return F===x||F==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(F=>F>0).reduce((F,k)=>F+k,0)]).sort((P,F)=>P[1]-F[1])[0])==null?void 0:V[0];W&&($=W);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function rm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function im(e){return XN.some(t=>e[t]>=0)}const dE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=vn(e,t);switch(r){case"referenceHidden":{const o=await jo(t,{...i,elementContext:"reference"}),l=rm(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:im(l)}}}case"escaped":{const o=await jo(t,{...i,altBoundary:!0}),l=rm(o,n.floating);return{data:{escapedOffsets:l,escaped:im(l)}}}default:return{}}}}},Cx=new Set(["left","top"]);async function fE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=wn(n),s=Ni(n),a=en(n)==="y",c=Cx.has(l)?-1:1,d=o&&a?-1:1,f=vn(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*c}:{x:p*c,y:m*d}}const pE=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 fE(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}}}}},mE=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:x}=S;return{x:g,y:x}}},...a}=vn(e,t),c={x:n,y:r},d=await jo(t,a),f=en(wn(i)),p=Wd(f);let m=c[p],w=c[f];if(o){const S=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=m+d[S],v=m-d[g];m=sc(x,m,v)}if(l){const S=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=w+d[S],v=w-d[g];w=sc(x,w,v)}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}}}}}},hE=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:c=!0}=vn(e,t),d={x:n,y:r},f=en(i),p=Wd(f);let m=d[p],w=d[f];const y=vn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const v=p==="y"?"height":"width",C=o.reference[p]-o.floating[v]+S.mainAxis,E=o.reference[p]+o.reference[v]-S.mainAxis;mE&&(m=E)}if(c){var g,x;const v=p==="y"?"width":"height",C=Cx.has(wn(i)),E=o.reference[f]-o.floating[v]+(C&&((g=l.offset)==null?void 0:g[f])||0)+(C?0:S.crossAxis),N=o.reference[f]+o.reference[v]+(C?0:((x=l.offset)==null?void 0:x[f])||0)-(C?S.crossAxis:0);wN&&(w=N)}return{[p]:m,[f]:w}}}},gE=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=()=>{},...c}=vn(e,t),d=await jo(t,c),f=wn(i),p=Ni(i),m=en(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 x=y-d.top-d.bottom,v=w-d.left-d.right,C=Xn(y-d[S],x),E=Xn(w-d[g],v),N=!t.middlewareData.shift;let j=C,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=x),N&&!p){const _=mt(d.left,0),M=mt(d.right,0),T=mt(d.top,0),V=mt(d.bottom,0);m?A=w-2*(_!==0||M!==0?_+M:mt(d.left,d.right)):j=y-2*(T!==0||V!==0?T+V:mt(d.top,d.bottom))}await a({...t,availableWidth:A,availableHeight:j});const L=await l.getDimensions(s.floating);return w!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Us(){return typeof window<"u"}function Ei(e){return bx(e)?(e.nodeName||"").toLowerCase():"#document"}function xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sn(e){var t;return(t=(bx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bx(e){return Us()?e instanceof Node||e instanceof xt(e).Node:!1}function Ht(e){return Us()?e instanceof Element||e instanceof xt(e).Element:!1}function on(e){return Us()?e instanceof HTMLElement||e instanceof xt(e).HTMLElement:!1}function om(e){return!Us()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xt(e).ShadowRoot}const yE=new Set(["inline","contents"]);function Do(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!yE.has(i)}const xE=new Set(["table","td","th"]);function vE(e){return xE.has(Ei(e))}const wE=[":popover-open",":modal"];function Vs(e){return wE.some(t=>{try{return e.matches(t)}catch{return!1}})}const SE=["transform","translate","scale","rotate","perspective"],kE=["transform","translate","scale","rotate","perspective","filter"],CE=["paint","layout","strict","content"];function Yd(e){const t=Qd(),n=Ht(e)?Wt(e):e;return SE.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)||kE.some(r=>(n.willChange||"").includes(r))||CE.some(r=>(n.contain||"").includes(r))}function bE(e){let t=Jn(e);for(;on(t)&&!xi(t);){if(Yd(t))return t;if(Vs(t))return null;t=Jn(t)}return null}function Qd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const NE=new Set(["html","body","#document"]);function xi(e){return NE.has(Ei(e))}function Wt(e){return xt(e).getComputedStyle(e)}function Hs(e){return Ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(Ei(e)==="html")return e;const t=e.assignedSlot||e.parentNode||om(e)&&e.host||sn(e);return om(t)?t.host:t}function Nx(e){const t=Jn(e);return xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&Do(t)?t:Nx(t)}function Po(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Nx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=xt(i);if(o){const s=uc(l);return t.concat(l,l.visualViewport||[],Do(i)?i:[],s&&n?Po(s):[])}return t.concat(i,Po(i,[],n))}function uc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ex(e){const t=Wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=on(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ps(n)!==o||ps(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function qd(e){return Ht(e)?e:e.contextElement}function ri(e){const t=qd(e);if(!on(t))return rn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ex(t);let l=(o?ps(n.width):n.width)/r,s=(o?ps(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const EE=rn(0);function jx(e){const t=xt(e);return!Qd()||!t.visualViewport?EE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xt(e)?!1:t}function Cr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=qd(e);let l=rn(1);t&&(r?Ht(r)&&(l=ri(r)):l=ri(e));const s=jE(o,n,r)?jx(o):rn(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,d=i.width/l.x,f=i.height/l.y;if(o){const p=xt(o),m=r&&Ht(r)?xt(r):r;let w=p,y=uc(w);for(;y&&r&&m!==w;){const S=ri(y),g=y.getBoundingClientRect(),x=Wt(y),v=g.left+(y.clientLeft+parseFloat(x.paddingLeft))*S.x,C=g.top+(y.clientTop+parseFloat(x.paddingTop))*S.y;a*=S.x,c*=S.y,d*=S.x,f*=S.y,a+=v,c+=C,w=xt(y),y=uc(w)}}return hs({width:d,height:f,x:a,y:c})}function Ws(e,t){const n=Hs(e).scrollLeft;return t?t.left+n:Cr(sn(e)).left+n}function Px(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ws(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function PE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=sn(r),s=t?Vs(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},c=rn(1);const d=rn(0),f=on(r);if((f||!f&&!o)&&((Ei(r)!=="body"||Do(l))&&(a=Hs(r)),on(r))){const m=Cr(r);c=ri(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=l&&!f&&!o?Px(l,a):rn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-a.scrollTop*c.y+d.y+p.y}}function AE(e){return Array.from(e.getClientRects())}function _E(e){const t=sn(e),n=Hs(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+Ws(e);const s=-n.scrollTop;return Wt(r).direction==="rtl"&&(l+=mt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const lm=25;function TE(e,t){const n=xt(e),r=sn(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=Qd();(!d||d&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const c=Ws(r);if(c<=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<=lm&&(o-=w)}else c<=lm&&(o+=c);return{width:o,height:l,x:s,y:a}}const RE=new Set(["absolute","fixed"]);function IE(e,t){const n=Cr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=on(e)?ri(e):rn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:l,height:s,x:a,y:c}}function sm(e,t,n){let r;if(t==="viewport")r=TE(e,n);else if(t==="document")r=_E(sn(e));else if(Ht(t))r=IE(t,n);else{const i=jx(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return hs(r)}function Ax(e,t){const n=Jn(e);return n===t||!Ht(n)||xi(n)?!1:Wt(n).position==="fixed"||Ax(n,t)}function ME(e,t){const n=t.get(e);if(n)return n;let r=Po(e,[],!1).filter(s=>Ht(s)&&Ei(s)!=="body"),i=null;const o=Wt(e).position==="fixed";let l=o?Jn(e):e;for(;Ht(l)&&!xi(l);){const s=Wt(l),a=Yd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&RE.has(i.position)||Do(l)&&!a&&Ax(e,l))?r=r.filter(d=>d!==l):i=s,l=Jn(l)}return t.set(e,r),r}function OE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Vs(t)?[]:ME(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((c,d)=>{const f=sm(t,d,i);return c.top=mt(f.top,c.top),c.right=Xn(f.right,c.right),c.bottom=Xn(f.bottom,c.bottom),c.left=mt(f.left,c.left),c},sm(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function LE(e){const{width:t,height:n}=Ex(e);return{width:t,height:n}}function DE(e,t,n){const r=on(t),i=sn(t),o=n==="fixed",l=Cr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=rn(0);function c(){a.x=Ws(i)}if(r||!r&&!o)if((Ei(t)!=="body"||Do(i))&&(s=Hs(t)),r){const m=Cr(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?Px(i,s):rn(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 Ma(e){return Wt(e).position==="static"}function am(e,t){if(!on(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sn(e)===n&&(n=n.ownerDocument.body),n}function _x(e,t){const n=xt(e);if(Vs(e))return n;if(!on(e)){let i=Jn(e);for(;i&&!xi(i);){if(Ht(i)&&!Ma(i))return i;i=Jn(i)}return n}let r=am(e,t);for(;r&&vE(r)&&Ma(r);)r=am(r,t);return r&&xi(r)&&Ma(r)&&!Yd(r)?n:r||bE(e)||n}const zE=async function(e){const t=this.getOffsetParent||_x,n=this.getDimensions,r=await n(e.floating);return{reference:DE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FE(e){return Wt(e).direction==="rtl"}const BE={convertOffsetParentRelativeRectToViewportRelativeRect:PE,getDocumentElement:sn,getClippingRect:OE,getOffsetParent:_x,getElementRects:zE,getClientRects:AE,getDimensions:LE,getScale:ri,isElement:Ht,isRTL:FE};function Tx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $E(e,t){let n=null,r;const i=sn(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 c=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=c;if(s||t(),!p||!m)return;const w=ll(f),y=ll(i.clientWidth-(d+p)),S=ll(i.clientHeight-(f+m)),g=ll(d),v={rootMargin:-w+"px "+-y+"px "+-S+"px "+-g+"px",threshold:mt(0,Xn(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&&!Tx(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(E,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return l(!0),o}function UE(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,c=qd(e),d=i||o?[...c?Po(c):[],...Po(t)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const f=c&&s?$E(c,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!a&&m.observe(c),m.observe(t));let w,y=a?Cr(e):null;a&&S();function S(){const g=Cr(e);y&&!Tx(y,g)&&n(),y=g,w=requestAnimationFrame(S)}return n(),()=>{var g;d.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const VE=pE,HE=mE,WE=cE,KE=gE,GE=dE,um=uE,YE=hE,QE=(e,t,n)=>{const r=new Map,i={platform:BE,...n},o={...i.platform,_c:r};return aE(e,t,{...i,platform:o})};var qE=typeof document<"u",XE=function(){},jl=qE?h.useLayoutEffect:XE;function gs(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(!gs(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)&&!gs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Rx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cm(e,t){const n=Rx(e);return Math.round(t*n)/n}function Oa(e){const t=h.useRef(e);return jl(()=>{t.current=e}),t}function JE(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:c}=e,[d,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);gs(p,r)||m(r);const[w,y]=h.useState(null),[S,g]=h.useState(null),x=h.useCallback(P=>{P!==N.current&&(N.current=P,y(P))},[]),v=h.useCallback(P=>{P!==j.current&&(j.current=P,g(P))},[]),C=o||w,E=l||S,N=h.useRef(null),j=h.useRef(null),A=h.useRef(d),L=a!=null,_=Oa(a),M=Oa(i),T=Oa(c),V=h.useCallback(()=>{if(!N.current||!j.current)return;const P={placement:t,strategy:n,middleware:p};M.current&&(P.platform=M.current),QE(N.current,j.current,P).then(F=>{const k={...F,isPositioned:T.current!==!1};O.current&&!gs(A.current,k)&&(A.current=k,ki.flushSync(()=>{f(k)}))})},[p,t,n,M,T]);jl(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[c]);const O=h.useRef(!1);jl(()=>(O.current=!0,()=>{O.current=!1}),[]),jl(()=>{if(C&&(N.current=C),E&&(j.current=E),C&&E){if(_.current)return _.current(C,E,V);V()}},[C,E,V,_,L]);const D=h.useMemo(()=>({reference:N,floating:j,setReference:x,setFloating:v}),[x,v]),$=h.useMemo(()=>({reference:C,floating:E}),[C,E]),W=h.useMemo(()=>{const P={position:n,left:0,top:0};if(!$.floating)return P;const F=cm($.floating,d.x),k=cm($.floating,d.y);return s?{...P,transform:"translate("+F+"px, "+k+"px)",...Rx($.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:D,elements:$,floatingStyles:W}),[d,V,D,$,W])}const ZE=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?um({element:r.current,padding:i}).fn(n):{}:r?um({element:r,padding:i}).fn(n):{}}}},e2=(e,t)=>({...VE(e),options:[e,t]}),t2=(e,t)=>({...HE(e),options:[e,t]}),n2=(e,t)=>({...YE(e),options:[e,t]}),r2=(e,t)=>({...WE(e),options:[e,t]}),i2=(e,t)=>({...KE(e),options:[e,t]}),o2=(e,t)=>({...GE(e),options:[e,t]}),l2=(e,t)=>({...ZE(e),options:[e,t]});var s2="Arrow",Ix=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(ie.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ix.displayName=s2;var a2=Ix,Xd="Popper",[Mx,Ox]=rr(Xd),[u2,Lx]=Mx(Xd),Dx=e=>{const{__scopePopper:t,children:n}=e,[r,i]=h.useState(null);return u.jsx(u2,{scope:t,anchor:r,onAnchorChange:i,children:n})};Dx.displayName=Xd;var zx="PopperAnchor",Fx=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Lx(zx,n),l=h.useRef(null),s=pe(t,l),a=h.useRef(null);return h.useEffect(()=>{const c=a.current;a.current=(r==null?void 0:r.current)||l.current,c!==a.current&&o.onAnchorChange(a.current)}),r?null:u.jsx(ie.div,{...i,ref:s})});Fx.displayName=zx;var Jd="PopperContent",[c2,d2]=Mx(Jd),Bx=h.forwardRef((e,t)=>{var G,re,Ce,R,H,Q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,S=Lx(Jd,n),[g,x]=h.useState(null),v=pe(t,ye=>x(ye)),[C,E]=h.useState(null),N=Zy(C),j=(N==null?void 0:N.width)??0,A=(N==null?void 0:N.height)??0,L=r+(o!=="center"?"-"+o:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(c)?c:[c],T=M.length>0,V={padding:_,boundary:M.filter(p2),altBoundary:T},{refs:O,floatingStyles:D,placement:$,isPositioned:W,middlewareData:P}=JE({strategy:"fixed",placement:L,whileElementsMounted:(...ye)=>UE(...ye,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[e2({mainAxis:i+A,alignmentAxis:l}),a&&t2({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?n2():void 0,...V}),a&&r2({...V}),i2({...V,apply:({elements:ye,rects:ve,availableWidth:ct,availableHeight:Cn})=>{const{width:bn,height:na}=ve.reference,sr=ye.floating.style;sr.setProperty("--radix-popper-available-width",`${ct}px`),sr.setProperty("--radix-popper-available-height",`${Cn}px`),sr.setProperty("--radix-popper-anchor-width",`${bn}px`),sr.setProperty("--radix-popper-anchor-height",`${na}px`)}}),C&&l2({element:C,padding:s}),m2({arrowWidth:j,arrowHeight:A}),p&&o2({strategy:"referenceHidden",...V})]}),[F,k]=Vx($),Y=qn(w);qe(()=>{W&&(Y==null||Y())},[W,Y]);const q=(G=P.arrow)==null?void 0:G.x,b=(re=P.arrow)==null?void 0:re.y,ne=((Ce=P.arrow)==null?void 0:Ce.centerOffset)!==0,[Me,se]=h.useState();return qe(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),u.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:W?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(R=P.transformOrigin)==null?void 0:R.x,(H=P.transformOrigin)==null?void 0:H.y].join(" "),...((Q=P.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(c2,{scope:n,placedSide:F,onArrowChange:E,arrowX:q,arrowY:b,shouldHideArrow:ne,children:u.jsx(ie.div,{"data-side":F,"data-align":k,...y,ref:v,style:{...y.style,animation:W?void 0:"none"}})})})});Bx.displayName=Jd;var $x="PopperArrow",f2={top:"bottom",right:"left",bottom:"top",left:"right"},Ux=h.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=d2($x,r),l=f2[o.placedSide];return u.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:u.jsx(a2,{...i,ref:n,style:{...i.style,display:"block"}})})});Ux.displayName=$x;function p2(e){return e!==null}var m2=e=>({name:"transformOrigin",options:e,fn(t){var S,g,x;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,[c,d]=Vx(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,m=(((x=i.arrow)==null?void 0:x.y)??0)+a/2;let w="",y="";return c==="bottom"?(w=l?f:`${p}px`,y=`${-a}px`):c==="top"?(w=l?f:`${p}px`,y=`${r.floating.height+a}px`):c==="right"?(w=`${-a}px`,y=l?f:`${m}px`):c==="left"&&(w=`${r.floating.width+a}px`,y=l?f:`${m}px`),{data:{x:w,y}}}});function Vx(e){const[t,n="center"]=e.split("-");return[t,n]}var h2=Dx,g2=Fx,y2=Bx,x2=Ux,v2="Portal",Zd=h.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=h.useState(!1);qe(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ik.createPortal(u.jsx(ie.div,{...r,ref:t}),l):null});Zd.displayName=v2;var Hx=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"}),w2="VisuallyHidden",S2=h.forwardRef((e,t)=>u.jsx(ie.span,{...e,ref:t,style:{...Hx,...e.style}}));S2.displayName=w2;var k2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,sl=new WeakMap,al={},La=0,Wx=function(e){return e&&(e.host||Wx(e.parentNode))},C2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wx(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})},b2=function(e,t,n,r){var i=C2(t,Array.isArray(e)?e:[e]);al[n]||(al[n]=new WeakMap);var o=al[n],l=[],s=new Set,a=new Set(i),c=function(f){!f||s.has(f)||(s.add(f),c(f.parentNode))};i.forEach(c);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=(Mr.get(p)||0)+1,S=(o.get(p)||0)+1;Mr.set(p,y),o.set(p,S),l.push(p),y===1&&w&&sl.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(),La++,function(){l.forEach(function(f){var p=Mr.get(f)-1,m=o.get(f)-1;Mr.set(f,p),o.set(f,m),p||(sl.has(f)||f.removeAttribute(r),sl.delete(f)),m||f.removeAttribute(n)}),La--,La||(Mr=new WeakMap,Mr=new WeakMap,sl=new WeakMap,al={})}},Kx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||k2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),b2(r,i,n,"aria-hidden")):function(){return null}},Jt=function(){return Jt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return $2;var t=U2(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])}},H2=qx(),ii="data-scroll-locked",W2=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(E2,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body[`).concat(ii,`] { 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(Pl,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(Al,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(Pl," .").concat(Pl,` { right: 0 `).concat(r,`; } .`).concat(Al," .").concat(Al,` { margin-right: 0 `).concat(r,`; } body[`).concat(ii,`] { `).concat(j2,": ").concat(s,`px; } `)},pm=function(){var e=parseInt(document.body.getAttribute(ii)||"0",10);return isFinite(e)?e:0},K2=function(){h.useEffect(function(){return document.body.setAttribute(ii,(pm()+1).toString()),function(){var e=pm()-1;e<=0?document.body.removeAttribute(ii):document.body.setAttribute(ii,e.toString())}},[])},G2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;K2();var o=h.useMemo(function(){return V2(i)},[i]);return h.createElement(H2,{styles:W2(o,!t,i,n?"":"!important")})},cc=!1;if(typeof window<"u")try{var ul=Object.defineProperty({},"passive",{get:function(){return cc=!0,!0}});window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{cc=!1}var Or=cc?{passive:!1}:!1,Y2=function(e){return e.tagName==="TEXTAREA"},Xx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Y2(e)&&n[t]==="visible")},Q2=function(e){return Xx(e,"overflowY")},q2=function(e){return Xx(e,"overflowX")},mm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Jx(e,r);if(i){var o=Zx(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},X2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},J2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Jx=function(e,t){return e==="v"?Q2(t):q2(t)},Zx=function(e,t){return e==="v"?X2(t):J2(t)},Z2=function(e,t){return e==="h"&&t==="rtl"?-1:1},ej=function(e,t,n,r,i){var o=Z2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),c=!1,d=l>0,f=0,p=0;do{if(!s)break;var m=Zx(e,s),w=m[0],y=m[1],S=m[2],g=y-S-o*w;(w||g)&&Jx(e,s)&&(f+=g,p+=w);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}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))&&(c=!0),c},cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hm=function(e){return[e.deltaX,e.deltaY]},gm=function(e){return e&&"current"in e?e.current:e},tj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nj=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},rj=0,Lr=[];function ij(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),i=h.useState(rj++)[0],o=h.useState(qx)[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=N2([e.lockRef.current],(e.shards||[]).map(gm),!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=cl(y),x=n.current,v="deltaX"in y?y.deltaX:x[0]-g[0],C="deltaY"in y?y.deltaY:x[1]-g[1],E,N=y.target,j=Math.abs(v)>Math.abs(C)?"h":"v";if("touches"in y&&j==="h"&&N.type==="range")return!1;var A=mm(j,N);if(!A)return!0;if(A?E=j:(E=j==="v"?"h":"v",A=mm(j,N)),!A)return!1;if(!r.current&&"changedTouches"in y&&(v||C)&&(r.current=E),!E)return!0;var L=r.current||E;return ej(L,S,y,L==="h"?v:C,!0)},[]),a=h.useCallback(function(y){var S=y;if(!(!Lr.length||Lr[Lr.length-1]!==o)){var g="deltaY"in S?hm(S):cl(S),x=t.current.filter(function(E){return E.name===S.type&&(E.target===S.target||S.target===E.shadowParent)&&tj(E.delta,g)})[0];if(x&&x.should){S.cancelable&&S.preventDefault();return}if(!x){var v=(l.current.shards||[]).map(gm).filter(Boolean).filter(function(E){return E.contains(S.target)}),C=v.length>0?s(S,v[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),c=h.useCallback(function(y,S,g,x){var v={name:y,delta:S,target:g,should:x,shadowParent:oj(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(C){return C!==v})},1)},[]),d=h.useCallback(function(y){n.current=cl(y),r.current=void 0},[]),f=h.useCallback(function(y){c(y.type,hm(y),y.target,s(y,e.lockRef.current))},[]),p=h.useCallback(function(y){c(y.type,cl(y),y.target,s(y,e.lockRef.current))},[]);h.useEffect(function(){return Lr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Or),document.addEventListener("touchmove",a,Or),document.addEventListener("touchstart",d,Or),function(){Lr=Lr.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Or),document.removeEventListener("touchmove",a,Or),document.removeEventListener("touchstart",d,Or)}},[]);var m=e.removeScrollBar,w=e.inert;return h.createElement(h.Fragment,null,w?h.createElement(o,{styles:nj(i)}):null,m?h.createElement(G2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lj=M2(Qx,ij);var ev=h.forwardRef(function(e,t){return h.createElement(Ks,Jt({},e,{ref:t,sideCar:lj}))});ev.classNames=Ks.classNames;const tv=ev;var sj=[" ","Enter","ArrowUp","ArrowDown"],aj=[" ","Enter"],br="Select",[Gs,Ys,uj]=Bd(br),[ji,AI]=rr(br,[uj,Ox]),Qs=Ox(),[cj,ir]=ji(br),[dj,fj]=ji(br),nv=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:c,name:d,autoComplete:f,disabled:p,required:m,form:w}=e,y=Qs(t),[S,g]=h.useState(null),[x,v]=h.useState(null),[C,E]=h.useState(!1),N=Bs(c),[j,A]=yi({prop:r,defaultProp:i??!1,onChange:o,caller:br}),[L,_]=yi({prop:l,defaultProp:s,onChange:a,caller:br}),M=h.useRef(null),T=S?w||!!S.closest("form"):!0,[V,O]=h.useState(new Set),D=Array.from(V).map($=>$.props.value).join(";");return u.jsx(h2,{...y,children:u.jsxs(cj,{required:m,scope:t,trigger:S,onTriggerChange:g,valueNode:x,onValueNodeChange:v,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Gn(),value:L,onValueChange:_,open:j,onOpenChange:A,dir:N,triggerPointerDownPosRef:M,disabled:p,children:[u.jsx(Gs.Provider,{scope:t,children:u.jsx(dj,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback($=>{O(W=>new Set(W).add($))},[]),onNativeOptionRemove:h.useCallback($=>{O(W=>{const P=new Set(W);return P.delete($),P})},[]),children:n})}),T?u.jsxs(jv,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:L,onChange:$=>_($.target.value),disabled:p,form:w,children:[L===void 0?u.jsx("option",{value:""}):null,Array.from(V)]},D):null]})})};nv.displayName=br;var rv="SelectTrigger",iv=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Qs(n),l=ir(rv,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),c=Ys(n),d=h.useRef("touch"),[f,p,m]=Av(y=>{const S=c().filter(v=>!v.disabled),g=S.find(v=>v.value===l.value),x=_v(S,y,g);x!==void 0&&l.onValueChange(x.value)}),w=y=>{s||(l.onOpenChange(!0),m()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return u.jsx(g2,{asChild:!0,...o,children:u.jsx(ie.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":Pv(l.value)?"":void 0,...i,ref:a,onClick:ee(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&w(y)}),onPointerDown:ee(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:ee(i.onKeyDown,y=>{const S=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&sj.includes(y.key)&&(w(),y.preventDefault())})})})});iv.displayName=rv;var ov="SelectValue",lv=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=ir(ov,n),{onValueNodeHasChildrenChange:c}=a,d=o!==void 0,f=pe(t,a.onValueNodeChange);return qe(()=>{c(d)},[c,d]),u.jsx(ie.span,{...s,ref:f,style:{pointerEvents:"none"},children:Pv(a.value)?u.jsx(u.Fragment,{children:l}):o})});lv.displayName=ov;var pj="SelectIcon",sv=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(ie.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});sv.displayName=pj;var mj="SelectPortal",av=e=>u.jsx(Zd,{asChild:!0,...e});av.displayName=mj;var Nr="SelectContent",uv=h.forwardRef((e,t)=>{const n=ir(Nr,e.__scopeSelect),[r,i]=h.useState();if(qe(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ki.createPortal(u.jsx(cv,{scope:e.__scopeSelect,children:u.jsx(Gs.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(dv,{...e,ref:t})});uv.displayName=Nr;var Ot=10,[cv,or]=ji(Nr),hj="SelectContentImpl",gj=gi("SelectContent.RemoveScroll"),dv=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S,...g}=e,x=ir(Nr,n),[v,C]=h.useState(null),[E,N]=h.useState(null),j=pe(t,G=>C(G)),[A,L]=h.useState(null),[_,M]=h.useState(null),T=Ys(n),[V,O]=h.useState(!1),D=h.useRef(!1);h.useEffect(()=>{if(v)return Kx(v)},[v]),wx();const $=h.useCallback(G=>{const[re,...Ce]=T().map(Q=>Q.ref.current),[R]=Ce.slice(-1),H=document.activeElement;for(const Q of G)if(Q===H||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===re&&E&&(E.scrollTop=0),Q===R&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==H))return},[T,E]),W=h.useCallback(()=>$([A,v]),[$,A,v]);h.useEffect(()=>{V&&W()},[V,W]);const{onOpenChange:P,triggerPointerDownPosRef:F}=x;h.useEffect(()=>{if(v){let G={x:0,y:0};const re=R=>{var H,Q;G={x:Math.abs(Math.round(R.pageX)-(((H=F.current)==null?void 0:H.x)??0)),y:Math.abs(Math.round(R.pageY)-(((Q=F.current)==null?void 0:Q.y)??0))}},Ce=R=>{G.x<=10&&G.y<=10?R.preventDefault():v.contains(R.target)||P(!1),document.removeEventListener("pointermove",re),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[v,P,F]),h.useEffect(()=>{const G=()=>P(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[P]);const[k,Y]=Av(G=>{const re=T().filter(H=>!H.disabled),Ce=re.find(H=>H.ref.current===document.activeElement),R=_v(re,G,Ce);R&&setTimeout(()=>R.ref.current.focus())}),q=h.useCallback((G,re,Ce)=>{const R=!D.current&&!Ce;(x.value!==void 0&&x.value===re||R)&&(L(G),R&&(D.current=!0))},[x.value]),b=h.useCallback(()=>v==null?void 0:v.focus(),[v]),ne=h.useCallback((G,re,Ce)=>{const R=!D.current&&!Ce;(x.value!==void 0&&x.value===re||R)&&M(G)},[x.value]),Me=r==="popper"?dc:fv,se=Me===dc?{side:s,sideOffset:a,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return u.jsx(cv,{scope:n,content:v,viewport:E,onViewportChange:N,itemRefCallback:q,selectedItem:A,onItemLeave:b,itemTextRefCallback:ne,focusSelectedItem:W,selectedItemText:_,position:r,isPositioned:V,searchRef:k,children:u.jsx(tv,{as:gj,allowPinchZoom:!0,children:u.jsx(Hd,{asChild:!0,trapped:x.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ee(i,G=>{var re;(re=x.trigger)==null||re.focus({preventScroll:!0}),G.preventDefault()}),children:u.jsx(Vd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:u.jsx(Me,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:G=>G.preventDefault(),...g,...se,onPlaced:()=>O(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ee(g.onKeyDown,G=>{const re=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!re&&G.key.length===1&&Y(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let R=T().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(G.key)&&(R=R.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const H=G.target,Q=R.indexOf(H);R=R.slice(Q+1)}setTimeout(()=>$(R)),G.preventDefault()}})})})})})})});dv.displayName=hj;var yj="SelectItemAlignedPosition",fv=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ir(Nr,n),l=or(Nr,n),[s,a]=h.useState(null),[c,d]=h.useState(null),f=pe(t,j=>d(j)),p=Ys(n),m=h.useRef(!1),w=h.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:g,focusSelectedItem:x}=l,v=h.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&y&&S&&g){const j=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),_=g.getBoundingClientRect();if(o.dir!=="rtl"){const H=_.left-A.left,Q=L.left-H,ye=j.left-Q,ve=j.width+ye,ct=Math.max(ve,A.width),Cn=window.innerWidth-Ot,bn=fs(Q,[Ot,Math.max(Ot,Cn-ct)]);s.style.minWidth=ve+"px",s.style.left=bn+"px"}else{const H=A.right-_.right,Q=window.innerWidth-L.right-H,ye=window.innerWidth-j.right-Q,ve=j.width+ye,ct=Math.max(ve,A.width),Cn=window.innerWidth-Ot,bn=fs(Q,[Ot,Math.max(Ot,Cn-ct)]);s.style.minWidth=ve+"px",s.style.right=bn+"px"}const M=p(),T=window.innerHeight-Ot*2,V=y.scrollHeight,O=window.getComputedStyle(c),D=parseInt(O.borderTopWidth,10),$=parseInt(O.paddingTop,10),W=parseInt(O.borderBottomWidth,10),P=parseInt(O.paddingBottom,10),F=D+$+V+P+W,k=Math.min(S.offsetHeight*5,F),Y=window.getComputedStyle(y),q=parseInt(Y.paddingTop,10),b=parseInt(Y.paddingBottom,10),ne=j.top+j.height/2-Ot,Me=T-ne,se=S.offsetHeight/2,G=S.offsetTop+se,re=D+$+G,Ce=F-re;if(re<=ne){const H=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const Q=c.clientHeight-y.offsetTop-y.offsetHeight,ye=Math.max(Me,se+(H?b:0)+Q+W),ve=re+ye;s.style.height=ve+"px"}else{const H=M.length>0&&S===M[0].ref.current;s.style.top="0px";const ye=Math.max(ne,D+y.offsetTop+(H?q:0)+se)+Ce;s.style.height=ye+"px",y.scrollTop=re-ne+y.offsetTop}s.style.margin=`${Ot}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,c,y,S,g,o.dir,r]);qe(()=>v(),[v]);const[C,E]=h.useState();qe(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const N=h.useCallback(j=>{j&&w.current===!0&&(v(),x==null||x(),w.current=!1)},[v,x]);return u.jsx(vj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:u.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:u.jsx(ie.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});fv.displayName=yj;var xj="SelectPopperPosition",dc=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ot,...o}=e,l=Qs(n);return u.jsx(y2,{...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)"}})});dc.displayName=xj;var[vj,ef]=ji(Nr,{}),fc="SelectViewport",pv=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=or(fc,n),l=ef(fc,n),s=pe(t,o.onViewportChange),a=h.useRef(0);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(Gs.Slot,{scope:n,children:u.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ee(i.onScroll,c=>{const d=c.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-Ot*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})})})]})});pv.displayName=fc;var mv="SelectGroup",[wj,Sj]=ji(mv),hv=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Gn();return u.jsx(wj,{scope:n,id:i,children:u.jsx(ie.div,{role:"group","aria-labelledby":i,...r,ref:t})})});hv.displayName=mv;var gv="SelectLabel",yv=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Sj(gv,n);return u.jsx(ie.div,{id:i.id,...r,ref:t})});yv.displayName=gv;var ys="SelectItem",[kj,xv]=ji(ys),vv=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=ir(ys,n),a=or(ys,n),c=s.value===r,[d,f]=h.useState(o??""),[p,m]=h.useState(!1),w=pe(t,x=>{var v;return(v=a.itemRefCallback)==null?void 0:v.call(a,x,r,i)}),y=Gn(),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 u.jsx(kj,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:h.useCallback(x=>{f(v=>v||((x==null?void 0:x.textContent)??"").trim())},[]),children:u.jsx(Gs.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:u.jsx(ie.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:ee(l.onFocus,()=>m(!0)),onBlur:ee(l.onBlur,()=>m(!1)),onClick:ee(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:ee(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:ee(l.onPointerDown,x=>{S.current=x.pointerType}),onPointerMove:ee(l.onPointerMove,x=>{var v;S.current=x.pointerType,i?(v=a.onItemLeave)==null||v.call(a):S.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(l.onPointerLeave,x=>{var v;x.currentTarget===document.activeElement&&((v=a.onItemLeave)==null||v.call(a))}),onKeyDown:ee(l.onKeyDown,x=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&x.key===" "||(aj.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})})})})});vv.displayName=ys;var Yi="SelectItemText",wv=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ir(Yi,n),s=or(Yi,n),a=xv(Yi,n),c=fj(Yi,n),[d,f]=h.useState(null),p=pe(t,g=>f(g),a.onItemTextChange,g=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,g,a.value,a.disabled)}),m=d==null?void 0:d.textContent,w=h.useMemo(()=>u.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=c;return qe(()=>(y(w),()=>S(w)),[y,S,w]),u.jsxs(u.Fragment,{children:[u.jsx(ie.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ki.createPortal(o.children,l.valueNode):null]})});wv.displayName=Yi;var Sv="SelectItemIndicator",kv=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return xv(Sv,n).isSelected?u.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});kv.displayName=Sv;var pc="SelectScrollUpButton",Cv=h.forwardRef((e,t)=>{const n=or(pc,e.__scopeSelect),r=ef(pc,e.__scopeSelect),[i,o]=h.useState(!1),l=pe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?u.jsx(Nv,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Cv.displayName=pc;var mc="SelectScrollDownButton",bv=h.forwardRef((e,t)=>{const n=or(mc,e.__scopeSelect),r=ef(mc,e.__scopeSelect),[i,o]=h.useState(!1),l=pe(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?u.jsx(Nv,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});bv.displayName=mc;var Nv=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=or("SelectScrollButton",n),l=h.useRef(null),s=Ys(n),a=h.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return h.useEffect(()=>()=>a(),[a]),qe(()=>{var d;const c=s().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),u.jsx(ie.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ee(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ee(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ee(i.onPointerLeave,()=>{a()})})}),Cj="SelectSeparator",Ev=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});Ev.displayName=Cj;var hc="SelectArrow",bj=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Qs(n),o=ir(hc,n),l=or(hc,n);return o.open&&l.position==="popper"?u.jsx(x2,{...i,...r,ref:t}):null});bj.displayName=hc;var Nj="SelectBubbleInput",jv=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=h.useRef(null),o=pe(r,i),l=Jy(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]),u.jsx(ie.select,{...n,style:{...Hx,...n.style},ref:o,defaultValue:t})});jv.displayName=Nj;function Pv(e){return e===""||e===void 0}function Av(e){const t=qn(e),n=h.useRef(""),r=h.useRef(0),i=h.useCallback(l=>{const s=n.current+l;t(s),function a(c){n.current=c,window.clearTimeout(r.current),c!==""&&(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 _v(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Ej(e,Math.max(o,0));i.length===1&&(l=l.filter(c=>c!==n));const a=l.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function Ej(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jj=nv,Tv=iv,Pj=lv,Aj=sv,_j=av,Rv=uv,Tj=pv,Rj=hv,Iv=yv,Mv=vv,Ij=wv,Mj=kv,Ov=Cv,Lv=bv,Dv=Ev;const ym=jj,Ba=Rj,xm=Pj,gc=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Tv,{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,u.jsx(Aj,{asChild:!0,children:u.jsx(Hy,{className:"h-4 w-4 opacity-50"})})]}));gc.displayName=Tv.displayName;const zv=h.forwardRef(({className:e,...t},n)=>u.jsx(Ov,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(XC,{className:"h-4 w-4"})}));zv.displayName=Ov.displayName;const Fv=h.forwardRef(({className:e,...t},n)=>u.jsx(Lv,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Hy,{className:"h-4 w-4"})}));Fv.displayName=Lv.displayName;const yc=h.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx(_j,{children:u.jsxs(Rv,{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:[u.jsx(zv,{}),u.jsx(Tj,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(Fv,{})]})}));yc.displayName=Rv.displayName;const _l=h.forwardRef(({className:e,...t},n)=>u.jsx(Iv,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));_l.displayName=Iv.displayName;const Tl=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Mv,{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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Mj,{children:u.jsx(YC,{className:"h-4 w-4"})})}),u.jsx(Ij,{children:t})]}));Tl.displayName=Mv.displayName;const Oj=h.forwardRef(({className:e,...t},n)=>u.jsx(Dv,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));Oj.displayName=Dv.displayName;function Lj(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var zo=e=>{const{present:t,children:n}=e,r=Dj(t),i=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=pe(r.ref,zj(i));return typeof n=="function"||r.isPresent?h.cloneElement(i,{ref:o}):null};zo.displayName="Presence";function Dj(e){const[t,n]=h.useState(),r=h.useRef(null),i=h.useRef(e),o=h.useRef("none"),l=e?"mounted":"unmounted",[s,a]=Lj(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=dl(r.current);o.current=s==="mounted"?c:"none"},[s]),qe(()=>{const c=r.current,d=i.current;if(d!==e){const p=o.current,m=dl(c);e?a("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),qe(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=m=>{const y=dl(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",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=dl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),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(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function dl(e){return(e==null?void 0:e.animationName)||"none"}function zj(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="Dialog",[Bv,$v]=rr(qs),[Fj,Kt]=Bv(qs),Uv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=h.useRef(null),a=h.useRef(null),[c,d]=yi({prop:r,defaultProp:i??!1,onChange:o,caller:qs});return u.jsx(Fj,{scope:t,triggerRef:s,contentRef:a,contentId:Gn(),titleId:Gn(),descriptionId:Gn(),open:c,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:l,children:n})};Uv.displayName=qs;var Vv="DialogTrigger",Hv=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(Vv,n),o=pe(t,i.triggerRef);return u.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rf(i.open),...r,ref:o,onClick:ee(e.onClick,i.onOpenToggle)})});Hv.displayName=Vv;var tf="DialogPortal",[Bj,Wv]=Bv(tf,{forceMount:void 0}),Kv=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Kt(tf,t);return u.jsx(Bj,{scope:t,forceMount:n,children:h.Children.map(r,l=>u.jsx(zo,{present:n||o.open,children:u.jsx(Zd,{asChild:!0,container:i,children:l})}))})};Kv.displayName=tf;var xs="DialogOverlay",Gv=h.forwardRef((e,t)=>{const n=Wv(xs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(xs,e.__scopeDialog);return o.modal?u.jsx(zo,{present:r||o.open,children:u.jsx(Uj,{...i,ref:t})}):null});Gv.displayName=xs;var $j=gi("DialogOverlay.RemoveScroll"),Uj=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(xs,n);return u.jsx(tv,{as:$j,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(ie.div,{"data-state":rf(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Er="DialogContent",Yv=h.forwardRef((e,t)=>{const n=Wv(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(Er,e.__scopeDialog);return u.jsx(zo,{present:r||o.open,children:o.modal?u.jsx(Vj,{...i,ref:t}):u.jsx(Hj,{...i,ref:t})})});Yv.displayName=Er;var Vj=h.forwardRef((e,t)=>{const n=Kt(Er,e.__scopeDialog),r=h.useRef(null),i=pe(t,n.contentRef,r);return h.useEffect(()=>{const o=r.current;if(o)return Kx(o)},[]),u.jsx(Qv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,o=>o.preventDefault())})}),Hj=h.forwardRef((e,t)=>{const n=Kt(Er,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return u.jsx(Qv,{...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,c;(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;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Qv=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Kt(Er,n),a=h.useRef(null),c=pe(t,a);return wx(),u.jsxs(u.Fragment,{children:[u.jsx(Hd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(Vd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rf(s.open),...l,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Kj,{titleId:s.titleId}),u.jsx(Yj,{contentRef:a,descriptionId:s.descriptionId})]})]})}),nf="DialogTitle",qv=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(nf,n);return u.jsx(ie.h2,{id:i.titleId,...r,ref:t})});qv.displayName=nf;var Xv="DialogDescription",Jv=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(Xv,n);return u.jsx(ie.p,{id:i.descriptionId,...r,ref:t})});Jv.displayName=Xv;var Zv="DialogClose",e0=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(Zv,n);return u.jsx(ie.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});e0.displayName=Zv;function rf(e){return e?"open":"closed"}var t0="DialogTitleWarning",[Wj,n0]=lN(t0,{contentName:Er,titleName:nf,docsSlug:"dialog"}),Kj=({titleId:e})=>{const t=n0(t0),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},Gj="DialogDescriptionWarning",Yj=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n0(Gj).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},Qj=Uv,qj=Hv,Xj=Kv,Jj=Gv,Zj=Yv,eP=qv,tP=Jv,r0=e0,i0="AlertDialog",[nP,_I]=rr(i0,[$v]),kn=$v(),o0=e=>{const{__scopeAlertDialog:t,...n}=e,r=kn(t);return u.jsx(Qj,{...r,...n,modal:!0})};o0.displayName=i0;var rP="AlertDialogTrigger",iP=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return u.jsx(qj,{...i,...r,ref:t})});iP.displayName=rP;var oP="AlertDialogPortal",l0=e=>{const{__scopeAlertDialog:t,...n}=e,r=kn(t);return u.jsx(Xj,{...r,...n})};l0.displayName=oP;var lP="AlertDialogOverlay",s0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return u.jsx(Jj,{...i,...r,ref:t})});s0.displayName=lP;var oi="AlertDialogContent",[sP,aP]=nP(oi),uP=eN("AlertDialogContent"),a0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=kn(n),l=h.useRef(null),s=pe(t,l),a=h.useRef(null);return u.jsx(Wj,{contentName:oi,titleName:u0,docsSlug:"alert-dialog",children:u.jsx(sP,{scope:n,cancelRef:a,children:u.jsxs(Zj,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:ee(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=a.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(uP,{children:r}),u.jsx(dP,{contentRef:l})]})})})});a0.displayName=oi;var u0="AlertDialogTitle",c0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return u.jsx(eP,{...i,...r,ref:t})});c0.displayName=u0;var d0="AlertDialogDescription",f0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return u.jsx(tP,{...i,...r,ref:t})});f0.displayName=d0;var cP="AlertDialogAction",p0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return u.jsx(r0,{...i,...r,ref:t})});p0.displayName=cP;var m0="AlertDialogCancel",h0=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=aP(m0,n),o=kn(n),l=pe(t,i);return u.jsx(r0,{...o,...r,ref:l})});h0.displayName=m0;var dP=({contentRef:e})=>{const t=`\`${oi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${oi}\` by passing a \`${d0}\` 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 \`${oi}\`. 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},fP=o0,pP=l0,g0=s0,y0=a0,x0=p0,v0=h0,w0=c0,S0=f0;const vm=fP,mP=pP,k0=h.forwardRef(({className:e,...t},n)=>u.jsx(g0,{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}));k0.displayName=g0.displayName;const xc=h.forwardRef(({className:e,...t},n)=>u.jsxs(mP,{children:[u.jsx(k0,{}),u.jsx(y0,{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})]}));xc.displayName=y0.displayName;const vc=({className:e,...t})=>u.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});vc.displayName="AlertDialogHeader";const wc=({className:e,...t})=>u.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});wc.displayName="AlertDialogFooter";const Sc=h.forwardRef(({className:e,...t},n)=>u.jsx(w0,{ref:n,className:ue("text-lg font-semibold",e),...t}));Sc.displayName=w0.displayName;const kc=h.forwardRef(({className:e,...t},n)=>u.jsx(S0,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));kc.displayName=S0.displayName;const Cc=h.forwardRef(({className:e,...t},n)=>u.jsx(x0,{ref:n,className:ue(Fd(),e),...t}));Cc.displayName=x0.displayName;const bc=h.forwardRef(({className:e,...t},n)=>u.jsx(v0,{ref:n,className:ue(Fd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));bc.displayName=v0.displayName;function hP(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const gP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xP={};function wm(e,t){return((t||xP).jsx?yP:gP).test(e)}const vP=/[ \t\n\f\r]/g;function wP(e){return typeof e=="object"?e.type==="text"?Sm(e.value):!1:Sm(e)}function Sm(e){return e.replace(vP,"")===""}class Fo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fo.prototype.normal={};Fo.prototype.property={};Fo.prototype.space=void 0;function C0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Fo(n,r,t)}function Nc(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 SP=0;const Z=Tr(),Oe=Tr(),Ec=Tr(),B=Tr(),we=Tr(),li=Tr(),ft=Tr();function Tr(){return 2**++SP}const jc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:Oe,commaOrSpaceSeparated:ft,commaSeparated:li,number:B,overloadedBoolean:Ec,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),$a=Object.keys(jc);class of extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),km(this,"space",i),typeof r=="number")for(;++o<$a.length;){const l=$a[o];km(this,$a[o],(r&jc[l])===jc[l])}}}of.prototype.defined=!0;function km(e,t,n){n&&(e[t]=n)}function Pi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new of(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Nc(r)]=r,n[Nc(o.attribute)]=r}return new Fo(t,n,e.space)}const b0=Pi({properties:{ariaActiveDescendant:null,ariaAtomic:Oe,ariaAutoComplete:null,ariaBusy:Oe,ariaChecked:Oe,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:we,ariaCurrent:null,ariaDescribedBy:we,ariaDetails:null,ariaDisabled:Oe,ariaDropEffect:we,ariaErrorMessage:null,ariaExpanded:Oe,ariaFlowTo:we,ariaGrabbed:Oe,ariaHasPopup:null,ariaHidden:Oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:we,ariaLevel:B,ariaLive:null,ariaModal:Oe,ariaMultiLine:Oe,ariaMultiSelectable:Oe,ariaOrientation:null,ariaOwns:we,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Oe,ariaReadOnly:Oe,ariaRelevant:null,ariaRequired:Oe,ariaRoleDescription:we,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Oe,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N0(e,t){return t in e?e[t]:t}function E0(e,t){return N0(e,t.toLowerCase())}const kP=Pi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:li,acceptCharset:we,accessKey:we,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:we,autoFocus:Z,autoPlay:Z,blocking:we,capture:null,charSet:null,checked:Z,cite:null,className:we,cols:B,colSpan:null,content:null,contentEditable:Oe,controls:Z,controlsList:we,coords:B|li,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:Ec,draggable:Oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:we,height:B,hidden:Ec,high:B,href:null,hrefLang:null,htmlFor:we,httpEquiv:we,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:we,itemRef:we,itemScope:Z,itemType:we,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:B,pattern:null,ping:we,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:we,required:Z,reversed:Z,rows:B,rowSpan:B,sandbox:we,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:Oe,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:we,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Oe,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:B,security:null,unselectable:null},space:"html",transform:E0}),CP=Pi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ft,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:we,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:li,g2:li,glyphName:li,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:we,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ft,rev:ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ft,requiredFeatures:ft,requiredFonts:ft,requiredFormats:ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ft,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N0}),j0=Pi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),P0=Pi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:E0}),A0=Pi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bP={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NP=/[A-Z]/g,Cm=/-[a-z]/g,EP=/^data[-\w.:]+$/i;function jP(e,t){const n=Nc(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&EP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Cm,AP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Cm.test(o)){let l=o.replace(NP,PP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=of}return new i(r,t)}function PP(e){return"-"+e.toLowerCase()}function AP(e){return e.charAt(1).toUpperCase()}const _P=C0([b0,kP,j0,P0,A0],"html"),lf=C0([b0,CP,j0,P0,A0],"svg");function TP(e){return e.join(" ").trim()}var sf={},bm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,RP=/\n/g,IP=/^\s*/,MP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,OP=/^:\s*/,LP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,DP=/^[;\s]*/,zP=/^\s+|\s+$/g,FP=` `,Nm="/",Em="*",dr="",BP="comment",$P="declaration",UP=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(RP);y&&(n+=y.length);var S=w.lastIndexOf(FP);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),c(),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 c(){a(IP)}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;dr!=e.charAt(y)&&(Em!=e.charAt(y)||Nm!=e.charAt(y+1));)++y;if(y+=2,dr===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:BP,comment:S})}}function p(){var w=o(),y=a(MP);if(y){if(f(),!a(OP))return s("property missing ':'");var S=a(LP),g=w({type:$P,property:jm(y[0].replace(bm,dr)),value:S?jm(S[0].replace(bm,dr)):dr});return a(DP),g}}function m(){var w=[];d(w);for(var y;y=p();)y!==!1&&(w.push(y),d(w));return w}return c(),m()};function jm(e){return e?e.replace(zP,dr):dr}var VP=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sf,"__esModule",{value:!0});sf.default=WP;var HP=VP(UP);function WP(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,HP.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 KP=/^--[a-zA-Z0-9_-]+$/,GP=/-([a-z])/g,YP=/^[^-]+$/,QP=/^-(webkit|moz|ms|o|khtml)-/,qP=/^-(ms)-/,XP=function(e){return!e||YP.test(e)||KP.test(e)},JP=function(e,t){return t.toUpperCase()},Pm=function(e,t){return"".concat(t,"-")},ZP=function(e,t){return t===void 0&&(t={}),XP(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qP,Pm):e=e.replace(QP,Pm),e.replace(GP,JP))};Xs.camelCase=ZP;var eA=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tA=eA(sf),nA=Xs;function Pc(e,t){var n={};return!e||typeof e!="string"||(0,tA.default)(e,function(r,i){r&&i&&(n[(0,nA.camelCase)(r,t)]=i)}),n}Pc.default=Pc;var rA=Pc;const iA=Ss(rA),_0=T0("end"),af=T0("start");function T0(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 oA(e){const t=af(e),n=_0(e);if(t&&n)return{start:t,end:n}}function io(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?Ac(e):""}function Ac(e){return _m(e&&e.line)+":"+_m(e&&e.column)}function Am(e){return Ac(e&&e.start)+"-"+Ac(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=io(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 uf={}.hasOwnProperty,lA=new Map,sA=/[A-Z]/g,aA=new Set(["table","tbody","thead","tfoot","tr"]),uA=new Set(["td","th"]),R0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cA(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=xA(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=yA(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"?lf:_P,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=I0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function I0(e,t,n){if(t.type==="element")return dA(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mA(e,t,n);if(t.type==="mdxjsEsm")return pA(e,t);if(t.type==="root")return hA(e,t,n);if(t.type==="text")return gA(e,t)}function dA(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lf,e.schema=i),e.ancestors.push(t);const o=O0(e,t.tagName,!1),l=vA(e,t);let s=df(e,t);return aA.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!wP(a):!0})),M0(e,l,o,t),cf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function fA(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)}Ao(e,t.position)}function pA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ao(e,t.position)}function mA(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:O0(e,t.name,!0),l=wA(e,t),s=df(e,t);return M0(e,l,o,t),cf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function hA(e,t,n){const r={};return cf(r,df(e,t)),e.create(t,e.Fragment,r,n)}function gA(e,t){return t.value}function M0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yA(e,t,n){return r;function r(i,o,l,s){const c=Array.isArray(l.children)?n:t;return s?c(o,l,s):c(o,l)}}function xA(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=af(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 vA(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&uf.call(t.properties,i)){const o=SA(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&uA.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 wA(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 Ao(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 Ao(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function df(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:lA;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?(ln(e,e.length,0,t),e):t}const Im={}.hasOwnProperty;function AA(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 si(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=lr(/[A-Za-z]/),gt=lr(/[\dA-Za-z]/),RA=lr(/[#-'*+\--9=?A-Z^-~]/);function _c(e){return e!==null&&(e<32||e===127)}const Tc=lr(/\d/),IA=lr(/[\dA-Fa-f]/),MA=lr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function fe(e){return e===-2||e===-1||e===32}const OA=lr(/\p{P}|\p{S}/u),LA=lr(/\s/);function lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ai(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 fe(a)?(e.enter(n),s(a)):t(a)}function s(a){return fe(a)&&o++l))return;const j=t.events.length;let A=j,L,_;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(L){_=t.events[A][1].end;break}L=!0}for(g(r),N=j;Nv;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $A(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)||LA(e))return 1;if(OA(e))return 2}function pf(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},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Nt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Nt(c,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=Nt(c,pf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Nt(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Nt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ln(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&fe(N)?ke(e,x,"linePrefix",o+1)(N):x(N)}function x(N){return N===null||X(N)?e.check(Dm,y,C)(N):(e.enter("codeFlowValue"),v(N))}function v(N){return N===null||X(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),v)}function C(N){return e.exit("codeFenced"),t(N)}function E(N,j,A){let L=0;return _;function _(D){return N.enter("lineEnding"),N.consume(D),N.exit("lineEnding"),M}function M(D){return N.enter("codeFencedFence"),fe(D)?ke(N,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===s?(N.enter("codeFencedFenceSequence"),V(D)):A(D)}function V(D){return D===s?(L++,N.consume(D),V):L>=l?(N.exit("codeFencedFenceSequence"),fe(D)?ke(N,O,"whitespace")(D):O(D)):A(D)}function O(D){return D===null||X(D)?(N.exit("codeFencedFence"),j(D)):A(D)}}}function ZA(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 Va={name:"codeIndented",tokenize:t_},e_={partial:!0,tokenize:n_};function t_(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ke(e,o,"linePrefix",4+1)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?a(c):X(c)?e.attempt(e_,l,a)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||X(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),s)}function a(c){return e.exit("codeIndented"),t(c)}}function n_(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 r_={name:"codeText",previous:o_,resolve:i_,tokenize:l_};function i_(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&&Ui(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),Ui(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ui(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 U0(e,t,n,r,i,o,l,s,a){const c=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||_c(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=!fe(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}}function H0(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),c(p))}function c(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,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||X(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:d)}function f(p){return p===l||p===92?(e.consume(p),d):d(p)}}function oo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):fe(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const m_={name:"definition",tokenize:g_},h_={partial:!0,tokenize:y_};function g_(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return V0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=si(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)?oo(e,c)(m):c(m)}function c(m){return U0(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(h_,f,f)(m)}function f(m){return fe(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 y_(e,t,n){return r;function r(s){return at(s)?oo(e,i)(s):n(s)}function i(s){return H0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return fe(s)?ke(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const x_={name:"hardBreakEscape",tokenize:v_};function v_(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 w_={name:"headingAtx",resolve:S_,tokenize:k_};function S_(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"},ln(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function k_(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)):fe(d)?ke(e,s,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),s(d))}function c(d){return d===null||d===35||at(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),c)}}const C_=["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"],b_={concrete:!0,name:"htmlFlow",resolveTo:j_,tokenize:P_},N_={partial:!0,tokenize:__},E_={partial:!0,tokenize:A_};function j_(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 P_(e,t,n){const r=this;let i,o,l,s,a;return c;function c(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):Zt(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):Zt(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 ne="CDATA[";return b===ne.charCodeAt(s++)?(e.consume(b),s===ne.length?r.interrupt?t:T:w):n(b)}function y(b){return Zt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||at(b)){const ne=b===47,Me=l.toLowerCase();return!ne&&!o&&Fm.includes(Me)?(i=1,r.interrupt?t(b):T(b)):C_.includes(l.toLowerCase())?(i=6,ne?(e.consume(b),g):r.interrupt?t(b):T(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?x(b):v(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:T):n(b)}function x(b){return fe(b)?(e.consume(b),x):_(b)}function v(b){return b===47?(e.consume(b),_):b===58||b===95||Zt(b)?(e.consume(b),C):fe(b)?(e.consume(b),v):_(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):fe(b)?(e.consume(b),E):v(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):fe(b)?(e.consume(b),N):A(b)}function j(b){return b===a?(e.consume(b),a=null,L):b===null||X(b)?n(b):(e.consume(b),j)}function A(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),A)}function L(b){return b===47||b===62||fe(b)?v(b):n(b)}function _(b){return b===62?(e.consume(b),M):n(b)}function M(b){return b===null||X(b)?T(b):fe(b)?(e.consume(b),M):n(b)}function T(b){return b===45&&i===2?(e.consume(b),$):b===60&&i===1?(e.consume(b),W):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(N_,q,V)(b)):b===null||X(b)?(e.exit("htmlFlowData"),V(b)):(e.consume(b),T)}function V(b){return e.check(E_,O,q)(b)}function O(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),D}function D(b){return b===null||X(b)?V(b):(e.enter("htmlFlowData"),T(b))}function $(b){return b===45?(e.consume(b),k):T(b)}function W(b){return b===47?(e.consume(b),l="",P):T(b)}function P(b){if(b===62){const ne=l.toLowerCase();return Fm.includes(ne)?(e.consume(b),Y):T(b)}return Zt(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),P):T(b)}function F(b){return b===93?(e.consume(b),k):T(b)}function k(b){return b===62?(e.consume(b),Y):b===45&&i===2?(e.consume(b),k):T(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 A_(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 __(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Js,t,n)}}const T_={name:"htmlText",tokenize:R_};function R_(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),c):k===47?(e.consume(k),E):k===63?(e.consume(k),v):Zt(k)?(e.consume(k),A):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),o=0,w):Zt(k)?(e.consume(k),x):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,W(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,W(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 x(k){return k===null||k===62?$(k):X(k)?(l=x,W(k)):(e.consume(k),x)}function v(k){return k===null?n(k):k===63?(e.consume(k),C):X(k)?(l=v,W(k)):(e.consume(k),v)}function C(k){return k===62?$(k):v(k)}function E(k){return Zt(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,W(k)):fe(k)?(e.consume(k),j):$(k)}function A(k){return k===45||gt(k)?(e.consume(k),A):k===47||k===62||at(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),$):k===58||k===95||Zt(k)?(e.consume(k),_):X(k)?(l=L,W(k)):fe(k)?(e.consume(k),L):$(k)}function _(k){return k===45||k===46||k===58||k===95||gt(k)?(e.consume(k),_):M(k)}function M(k){return k===61?(e.consume(k),T):X(k)?(l=M,W(k)):fe(k)?(e.consume(k),M):L(k)}function T(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=T,W(k)):fe(k)?(e.consume(k),T):(e.consume(k),O)}function V(k){return k===i?(e.consume(k),i=void 0,D):k===null?n(k):X(k)?(l=V,W(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)?L(k):(e.consume(k),O)}function D(k){return k===47||k===62||at(k)?L(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return fe(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 mf={name:"labelEnd",resolveAll:L_,resolveTo:D_,tokenize:z_},I_={tokenize:F_},M_={tokenize:B_},O_={tokenize:$_};function L_(e){let t=-1;const n=[];for(;++t=3&&(c===null||X(c))?(e.exit("thematicBreak"),t(c)):n(c)}function a(c){return c===i?(e.consume(c),r++,a):(e.exit("thematicBreakSequence"),fe(c)?ke(e,s,"whitespace")(c):s(c))}}const nt={continuation:{tokenize:X_},exit:Z_,name:"list",tokenize:q_},Y_={partial:!0,tokenize:eT},Q_={partial:!0,tokenize:J_};function q_(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:Tc(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(Rl,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return Tc(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"),c(m)):n(m)}function c(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(Y_,p,f))}function d(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function f(m){return fe(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 X_(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||!fe(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(Q_,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 J_(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 Z_(e){e.exit(this.containerState.type)}function eT(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!fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Bm={name:"setextUnderline",resolveTo:tT,tokenize:nT};function tT(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 nT(e,t,n){const r=this;let i;return o;function o(c){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=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),fe(c)?ke(e,a,"lineSuffix")(c):a(c))}function a(c){return c===null||X(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const rT={tokenize:iT};function iT(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(u_,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 oT={resolveAll:K0()},lT=W0("string"),sT=W0("text");function W0(e){return{resolveAll:K0(e==="text"?aT: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 c(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 c(d)?(n.exit("data"),o(d)):(n.consume(d),a)}function c(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 ST(e,t){let n=-1;const r=[];let i;for(;++n0){const Rt=J.tokenStack[J.tokenStack.length-1];(Rt[1]||Um).call(J,void 0,Rt[0])}for(U.position={start:jn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:jn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}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 FT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Q0(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 BT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Q0(e,t);const i={src:Ai(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 $T(e,t){const n={src:Ai(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 UT(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 VT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Q0(e,t);const i={href:Ai(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 HT(e,t){const n={href:Ai(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 WT(e,t,n){const r=e.all(t),i=n?KT(n):q0(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 GT(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=af(t.children[1]),a=_0(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 JT(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 c=[];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 tR(e,t){const n={type:"text",value:eR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rR={blockquote:RT,break:IT,code:MT,delete:OT,emphasis:LT,footnoteReference:DT,heading:zT,html:FT,imageReference:BT,image:$T,inlineCode:UT,linkReference:VT,link:HT,listItem:WT,list:GT,paragraph:YT,root:QT,strong:qT,table:XT,tableCell:ZT,tableRow:JT,text:tR,thematicBreak:nR,toml:fl,yaml:fl,definition:fl,footnoteDefinition:fl};function fl(){}const X0=-1,Zs=0,lo=1,vs=2,hf=3,gf=4,yf=5,xf=6,J0=7,Z0=8,Km=typeof self=="object"?self:globalThis,iR=(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 X0:return n(l,i);case lo:{const s=n([],i);for(const a of l)s.push(r(a));return s}case vs:{const s=n({},i);for(const[a,c]of l)s[r(a)]=r(c);return s}case hf:return n(new Date(l),i);case gf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case yf:{const s=n(new Map,i);for(const[a,c]of l)s.set(r(a),r(c));return s}case xf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case J0:{const{name:s,message:a}=l;return n(new Km[s](a),i)}case Z0: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 Km[o](l),i)};return r},Gm=e=>iR(new Map,e)(0),Dr="",{toString:oR}={},{keys:lR}=Object,Vi=e=>{const t=typeof e;if(t!=="object"||!e)return[Zs,t];const n=oR.call(e).slice(8,-1);switch(n){case"Array":return[lo,Dr];case"Object":return[vs,Dr];case"Date":return[hf,Dr];case"RegExp":return[gf,Dr];case"Map":return[yf,Dr];case"Set":return[xf,Dr];case"DataView":return[lo,n]}return n.includes("Array")?[lo,n]:n.includes("Error")?[J0,n]:[vs,n]},pl=([e,t])=>e===Zs&&(t==="function"||t==="symbol"),sR=(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]=Vi(l);switch(s){case Zs:{let d=l;switch(a){case"bigint":s=Z0,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return i([X0],l)}return i([s,d],l)}case lo:{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 lR(l))(e||!pl(Vi(l[p])))&&d.push([o(p),o(l[p])]);return f}case hf:return i([s,l.toISOString()],l);case gf:{const{source:d,flags:f}=l;return i([s,{source:d,flags:f}],l)}case yf:{const d=[],f=i([s,d],l);for(const[p,m]of l)(e||!(pl(Vi(p))||pl(Vi(m))))&&d.push([o(p),o(m)]);return f}case xf:{const d=[],f=i([s,d],l);for(const p of l)(e||!pl(Vi(p)))&&d.push(o(p));return f}}const{message:c}=l;return i([s,{name:a,message:c}],l)};return o},Ym=(e,{json:t,lossy:n}={})=>{const r=[];return sR(!(t||n),!!t,new Map,r)(e),r},ws=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Gm(Ym(e,t)):structuredClone(e):(e,t)=>Gm(Ym(e,t));function aR(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 uR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function cR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||aR,r=e.options.footnoteBackLabel||uR,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 x=typeof n=="string"?n:n(a,m);typeof x=="string"&&(x={type:"text",value:x}),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(x)?x:[x]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const x=S.children[S.children.length-1];x&&x.type==="text"?x.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(c,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ws(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 e1=function(e){if(e==null)return mR;if(typeof e=="function")return ea(e);if(typeof e=="object")return Array.isArray(e)?dR(e):fR(e);if(typeof e=="string")return pR(e);throw new Error("Expected function, string, or object as test")};function dR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=t1,w,y,S;if((!t||o(a,c,d[d.length-1]||void 0))&&(m=vR(n(a,d)),m[0]===Qm))return m;if("children"in a&&a.children){const g=a;if(g.children&&m[0]!==yR)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=SR(e,t),r=n.one(e,void 0),i=cR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` `},i),o}function ER(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 Il=Object.prototype.hasOwnProperty,r1=Object.prototype.toString,Zm=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=function(t){return typeof Array.isArray=="function"?Array.isArray(t):r1.call(t)==="[object Array]"},nh=function(t){if(!t||r1.call(t)!=="[object Object]")return!1;var n=Il.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Il.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Il.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(Il.call(t,n)){if(eh)return eh(t,n).value}else return;return t[n]},jR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,c=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(c){const d=c;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:_R,dirname:TR,extname:RR,join:IR,sep:"/"};function _R(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bo(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 TR(e){if(Bo(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 RR(e){Bo(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 IR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function OR(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 Bo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const LR={cwd:DR};function DR(){return"/"}function Oc(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(!Oc(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 FR(e)}function FR(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];Mc(y)&&Mc(m)&&(m=Wa(!0,y,m)),r[p]=[c,m,...w]}}}}const VR=new vf().freeze();function Qa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xa(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(!Mc(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 ml(e){return HR(e)?e:new i1(e)}function HR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function WR(e){return typeof e=="string"||KR(e)}function KR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const GR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ah=[],uh={allowDangerousHtml:!0},YR=/^(https?|ircs?|mailto|xmpp)$/i,QR=[{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 qR(e){const t=XR(e),n=JR(e);return ZR(t.runSync(t.parse(n),n),e)}function XR(e){const t=e.rehypePlugins||ah,n=e.remarkPlugins||ah,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uh}:uh;return VR().use(TT).use(n).use(ER,r).use(t)}function JR(e){const t=e.children||"",n=new i1;return typeof t=="string"&&(n.value=t),n}function ZR(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||eI;for(const d of QR)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+GR+d.id,void 0);return n1(e,c),cA(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function c(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 Ua)if(Object.hasOwn(Ua,m)&&Object.hasOwn(d.properties,m)){const w=d.properties[m],y=Ua[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 eI(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||YR.test(e.slice(0,t))?e:""}const o1=h.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const c=h.useRef(null),d=()=>{var f;(f=c.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]),u.jsxs("div",{className:ue("flex h-full flex-col",e),ref:a,...s,children:[u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?u.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:u.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((f,p)=>u.jsxs("div",{className:ue("flex gap-3 w-full",f.role==="user"?"justify-end":"justify-start"),children:[f.role!=="user"&&u.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:u.jsx(Ut,{className:"h-4 w-4 text-primary-foreground"})}),u.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:[u.jsxs("div",{className:"text-xs opacity-70",children:[f.role==="user"?"You":"Assistant"," • #",p+1]}),u.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:u.jsx(qR,{components:{p:({children:m})=>u.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>u.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>u.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>u.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?u.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):u.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>u.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>u.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>u.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>u.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>u.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>u.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>u.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:f.content})})]}),f.role==="user"&&u.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:u.jsx(Hb,{className:"h-4 w-4"})})]},`${f.id}-${p}`)),u.jsx("div",{ref:c})]}),u.jsx("div",{className:"border-t p-4",children:u.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[u.jsx(Ud,{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?u.jsx(me,{type:"button",onClick:l,variant:"outline",size:"icon",children:u.jsx(Mb,{className:"h-4 w-4"})}):u.jsx(me,{type:"submit",disabled:!n.trim(),size:"icon",children:u.jsx(Eb,{className:"h-4 w-4"})})]})})]})});o1.displayName="Chat";const Yt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function l1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function tI(){return l1()}class nI{getAllSessions(){const t=localStorage.getItem(Yt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:l1(),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(Yt.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(Yt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Yt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Yt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:tI(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Yt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Yt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Yt.currentSession,t)}clear(){localStorage.removeItem(Yt.sessions),localStorage.removeItem(Yt.currentSession)}}const Ne=new nI;function rI(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,c]=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),[x,v]=h.useState(1024),C=Dt.useMemo(()=>{var D;const O=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((D=O==null?void 0:O.messages)==null?void 0:D.length)||0}),O},[i,l]),E=Dt.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(D=>({id:D.id,role:D.role}))),O},[C==null?void 0:C.messages]);h.useEffect(()=>{const O=Ne.getAllSessions();o(O);const D=Ne.getCurrentSession();D?s(D.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),D=Ne.getAllSessions();return o([...D]),s(O.id),Ne.setCurrentSession(O.id),O.id},[p,w]),j=h.useCallback(O=>{s(O),Ne.setCurrentSession(O)},[]),A=h.useCallback(O=>{Ne.deleteSession(O);const D=Ne.getAllSessions();o([...D]),l===O&&(D.length>0?(s(D[0].id),Ne.setCurrentSession(D[0].id)):s(null))},[l]),L=h.useCallback((O,D)=>{Ne.updateSession(O,{title:D});const $=Ne.getAllSessions();o([...$])},[]),_=h.useCallback(O=>{if(!l)return;Ne.addMessageToSession(l,O);const D=Ne.getAllSessions();o([...D])},[l]),M=h.useCallback(async()=>{var P,F;if(!a.trim()||d.isLoading)return;let O=l;O||(O=N());const D=a.trim();if(c(""),f({isLoading:!0,error:null}),O){Ne.addMessageToSession(O,{role:"user",content:D});const k=Ne.getAllSessions();o([...k])}const $=Ne.getSession(O),W=($==null?void 0:$.messages)&&$.messages.length>1;if(w&&!W&&O){Ne.addMessageToSession(O,{role:"system",content:w});const k=Ne.getAllSessions();o([...k])}try{const k=Ne.getSession(O),Y=((F=(P=k==null?void 0:k.messages)==null?void 0:P.filter(ne=>ne.role!=="system"))==null?void 0:F.map(ne=>({role:ne.role,content:ne.content})))||[],q=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:Y,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:x})});if(!q.ok){const ne=await q.json();throw new Error(ne.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 ne=Ne.getAllSessions();o([...ne])}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,_,w,E.length,t,p,S,x]),T=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:A,renameSession:L,clearAllSessions:V,messages:E,input:a,setInput:c,sendMessage:M,stopGeneration:T,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:g,maxTokens:x,setMaxTokens:v}}function iI(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:c,stopGeneration:d,isLoading:f,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:g,maxTokens:x,setMaxTokens:v}=rI(),[C,E]=h.useState(!1),[N,j]=h.useState(null),[A,L]=h.useState(!1),[_,M]=h.useState(null),[T,V]=h.useState(!1),[O,D]=h.useState(""),[$,W]=h.useState(""),[P,F]=h.useState(!1),[k,Y]=h.useState([]),q=()=>{if(!O.trim())return;const R={id:Date.now().toString(),name:O,description:$,model:p,systemPrompt:w,temperature:S,maxTokens:x,createdAt:new Date().toISOString()},H=JSON.parse(localStorage.getItem("savedAssistants")||"[]");H.push(R),localStorage.setItem("savedAssistants",JSON.stringify(H)),D(""),W(""),V(!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."}],ne=[{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(()=>{re(),Me(),new URLSearchParams(window.location.search).get("mode")==="create"&&F(!0)},[]);const Me=()=>{try{const R=localStorage.getItem("loadAssistantConfig");if(R){const H=JSON.parse(R);m(H.model),y(H.systemPrompt||""),g(H.temperature||.7),v(H.maxTokens||1024),localStorage.removeItem("loadAssistantConfig"),setTimeout(()=>{alert(`Assistant "${H.name}" loaded successfully!`)},500)}}catch(R){console.error("Failed to load assistant configuration:",R)}};h.useEffect(()=>{if(p&&!k.find(R=>R.model_name===p)){const R=k[0];R&&m(R.model_name)}},[k,p,m]),h.useEffect(()=>{(async()=>{if(!p||!k.length)return;const H=k.find(ve=>ve.model_name===p);if(!H)return;const Q=`${window.location.protocol}//${window.location.host}`;if(H.type==="local"&&!H.is_loaded){M(H),L(!0);return}const ye=k.filter(ve=>ve.type==="local"&&ve.is_loaded&&ve.model_name!==p);for(const ve of ye)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ve.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ve.model_name}`)}catch(ct){console.error(`Error auto-unloading model ${ve.model_name}:`,ct)}ye.length>0&&re()})()},[p,k]);const se=async()=>{if(_){L(!1),j(_.model_name);try{const R=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${R}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:_.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${_.model_name}`),re();else{console.error(`❌ Failed to load model: ${_.model_name}`);const Q=k.find(ye=>ye.type==="api");Q&&m(Q.model_name)}}catch(R){console.error("Error loading model:",R);const H=k.find(Q=>Q.type==="api");H&&m(H.model_name)}finally{j(null),M(null)}}},G=()=>{L(!1),M(null);const R=k.find(H=>H.type==="api");R&&m(R.model_name)};h.useEffect(()=>{const R=async()=>{const H=`${window.location.protocol}//${window.location.host}`,Q=k.filter(ye=>ye.type==="local"&&ye.is_loaded);for(const ye of Q)try{await fetch(`${H}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ye.model_name})}),console.log(`✅ Cleanup: unloaded ${ye.model_name}`)}catch(ve){console.error(`Error cleaning up model ${ye.model_name}:`,ve)}};return()=>{R()}},[k]);const re=async()=>{try{const R=`${window.location.protocol}//${window.location.host}`,H=await fetch(`${R}/models`);if(H.ok){const Q=await H.json();if(Y(Q.models),Q.current_model&&p!==Q.current_model)m(Q.current_model);else if(!p&&Q.models.length>0){const ve=Q.models.find(ct=>ct.type==="api")||Q.models[0];m(ve.model_name)}}}catch(R){console.error("Failed to fetch models:",R)}},Ce=R=>{a(R)};return u.jsxs("div",{className:"min-h-screen bg-background flex",children:[u.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:u.jsxs("div",{className:"p-4 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),u.jsxs(me,{onClick:r,size:"sm",children:[u.jsx(Zu,{className:"h-4 w-4 mr-1"}),"New"]})]}),u.jsx("div",{className:"space-y-2",children:e.map(R=>u.jsxs(de,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===R.id?"bg-accent border-primary":""}`,onClick:()=>i(R.id),children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium truncate",children:R.title}),u.jsx(me,{size:"sm",variant:"ghost",onClick:H=>{H.stopPropagation(),o(R.id)},className:"h-6 w-6 p-0",children:u.jsx(Dd,{className:"h-3 w-3"})})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[R.messages.length," messages"]})]},R.id))})]})}),C&&u.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>E(!1)}),u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsxs("div",{className:"flex h-14 items-center px-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(me,{variant:"ghost",size:"sm",onClick:()=>E(!C),className:"lg:hidden",children:C?u.jsx(yb,{className:"h-4 w-4"}):u.jsx(vb,{className:"h-4 w-4"})}),P?u.jsx(Ut,{className:"h-5 w-5 text-blue-600"}):u.jsx(hi,{className:"h-5 w-5"}),u.jsx("h1",{className:"text-lg font-semibold",children:P?"Create AI Assistant":"Chat Playground"}),P&&u.jsx(Le,{variant:"default",className:"text-xs bg-blue-600",children:"Creation Mode"}),t&&!P&&u.jsxs(Le,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[u.jsxs(me,{variant:"outline",size:"sm",onClick:()=>E(!C),className:"hidden lg:flex flex-shrink-0",children:[u.jsx(cb,{className:"h-4 w-4 mr-2"}),u.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),u.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[u.jsx(nb,{className:"h-4 w-4 mr-2"}),u.jsx("span",{className:"hidden sm:inline",children:"View code"}),u.jsx("span",{className:"sm:hidden",children:"Code"})]}),u.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[u.jsx(Ub,{className:"h-4 w-4 mr-2"}),u.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),u.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",onClick:()=>V(!0),children:[u.jsx(bb,{className:"h-4 w-4 mr-2"}),u.jsx("span",{className:"hidden sm:inline",children:"Save Assistant"})]}),u.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[u.jsx(Yy,{className:"h-4 w-4 mr-2"}),u.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),u.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[u.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&u.jsx("div",{className:"p-6 border-b",children:u.jsxs(de,{children:[u.jsx(jt,{children:u.jsx(Pt,{className:"text-base",children:"Start with a sample prompt"})}),u.jsx(he,{children:u.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:ne.map((R,H)=>u.jsx(me,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>Ce(R.prompt),disabled:f,children:u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:R.title}),u.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:R.description})]})},H))})})]})}),u.jsx(o1,{messages:l.map(R=>({id:R.id,role:R.role,content:R.content,createdAt:new Date(R.timestamp)})),input:s,handleInputChange:R=>a(R.target.value),handleSubmit:async R=>{R.preventDefault(),!(!p||!k.find(H=>H.model_name===p))&&await c()},isGenerating:f,stop:d,className:"flex-1"})]}),u.jsx("div",{className:"w-[480px] xl:w-[520px] border-l bg-muted/30 overflow-y-auto",children:u.jsxs("div",{className:"p-6 space-y-8",children:[u.jsxs("div",{className:"flex items-center gap-3 pb-6 border-b",children:[u.jsx(Ld,{className:"h-6 w-6"}),u.jsx("h2",{className:"font-semibold text-xl",children:"Assistant Configuration"})]}),u.jsxs(de,{children:[u.jsx(jt,{children:u.jsx(Pt,{className:"text-base",children:"Model Selection"})}),u.jsxs(he,{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(kt,{className:"text-sm font-medium mb-3 block",children:"Active Model"}),u.jsxs(ym,{value:p||"",onValueChange:m,children:[u.jsx(gc,{className:"w-full",children:u.jsx(xm,{placeholder:"Select a model...",children:p&&(()=>{const R=k.find(Q=>Q.model_name===p);if(!R)return p;const H=R.type==="api";return u.jsxs("div",{className:"flex items-center gap-2",children:[H?u.jsx(us,{className:"h-4 w-4 text-blue-500"}):R.supports_thinking?u.jsx(Kn,{className:"h-4 w-4 text-purple-500"}):u.jsx(ds,{className:"h-4 w-4 text-green-500"}),u.jsx("span",{className:"truncate",children:R.name}),N===p?u.jsx(Le,{variant:"outline",className:"text-xs",children:"Loading..."}):u.jsx(Le,{variant:"outline",className:"text-xs",children:H?"API":R.is_loaded?"Loaded":"Available"})]})})()})}),u.jsxs(yc,{children:[u.jsxs(Ba,{children:[u.jsx(_l,{children:"🌐 API Models"}),k.filter(R=>R.type==="api").map(R=>u.jsx(Tl,{value:R.model_name,children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(us,{className:"h-4 w-4 text-blue-500"}),u.jsx("span",{children:R.name}),u.jsx(Le,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},R.model_name))]}),u.jsxs(Ba,{children:[u.jsx(_l,{children:"💻 Local Models"}),k.filter(R=>R.type==="local").map(R=>u.jsx(Tl,{value:R.model_name,children:u.jsxs("div",{className:"flex items-center gap-2",children:[R.supports_thinking?u.jsx(Kn,{className:"h-4 w-4 text-purple-500"}):u.jsx(ds,{className:"h-4 w-4 text-green-500"}),u.jsx("span",{children:R.name}),N===R.model_name?u.jsx(Le,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):R.is_loaded?u.jsx(Le,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):u.jsx(Le,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},R.model_name))]})]})]})]}),u.jsx("div",{className:"pt-2 border-t",children:u.jsx(me,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:u.jsxs(My,{to:"/models",className:"flex items-center gap-2",children:[u.jsx(Od,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),u.jsxs(de,{children:[u.jsx(jt,{children:u.jsx(Pt,{className:"text-base",children:"Generation Parameters"})}),u.jsxs(he,{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsxs(kt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),u.jsx(oc,{value:[S],onValueChange:R=>g(R[0]),min:0,max:2,step:.01,className:"mt-2",disabled:f}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),u.jsxs("div",{children:[u.jsxs(kt,{className:"text-xs font-medium",children:["Max Tokens: ",x]}),u.jsx(oc,{value:[x],onValueChange:R=>v(R[0]),min:100,max:4096,step:100,className:"mt-2",disabled:f})]})]})]}),u.jsxs(de,{className:"border-2 border-blue-200 bg-blue-50/50",children:[u.jsx(jt,{children:u.jsxs(Pt,{className:"text-sm flex items-center gap-2",children:[u.jsx(Ut,{className:"h-4 w-4 text-blue-600"}),"Assistant Configuration",w&&u.jsx(Le,{variant:"default",className:"text-xs bg-blue-600",children:"Custom"})]})}),u.jsxs(he,{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(kt,{className:"text-base font-medium text-muted-foreground mb-4 block",children:"Quick Presets"}),u.jsxs(ym,{value:"",onValueChange:R=>{const H=b.find(Q=>Q.name===R);H&&y(H.prompt)},children:[u.jsx(gc,{className:"w-full h-12",children:u.jsx(xm,{placeholder:"Choose a preset..."})}),u.jsx(yc,{children:u.jsxs(Ba,{children:[u.jsx(_l,{children:"Assistant Presets"}),b.map(R=>u.jsx(Tl,{value:R.name,children:u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{className:"font-medium",children:R.name}),u.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:[R.prompt.slice(0,60),"..."]})]})},R.name))]})})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-5",children:[u.jsx(kt,{htmlFor:"system-prompt",className:"text-lg font-semibold",children:"System Instructions"}),w&&u.jsxs(me,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-8 px-3 text-sm",disabled:f,children:[u.jsx(kb,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),u.jsx("textarea",{id:"system-prompt",value:w,onChange:R=>y(R.target.value),placeholder:"Define your AI assistant's role, personality, and behavior. For example: 'You are a helpful coding assistant that explains concepts clearly and provides practical examples...'",className:"w-full min-h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-y",disabled:f}),u.jsxs("p",{className:"text-base text-blue-600 mt-4 bg-blue-50 p-4 rounded-lg",children:["💡 ",u.jsx("strong",{children:"Tip:"})," Be specific about the assistant's role, tone, and how it should respond to help users."]})]})]})]})]})})]})]}),u.jsx(vm,{open:A,onOpenChange:L,children:u.jsxs(xc,{children:[u.jsxs(vc,{children:[u.jsxs(Sc,{className:"flex items-center gap-2",children:[u.jsx(Fs,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),u.jsx(kc,{asChild:!0,children:u.jsxs("div",{className:"space-y-3",children:[u.jsxs("p",{children:["You're about to load ",u.jsx("strong",{children:_==null?void 0:_.name})," locally."]}),u.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(Bb,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),u.jsxs("div",{className:"text-sm",children:[u.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),u.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[u.jsxs("li",{children:["• ",u.jsx("strong",{children:"Storage:"})," ",_==null?void 0:_.size_gb]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"RAM:"})," ~",_==null?void 0:_.size_gb," (while running)"]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),u.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:u.jsxs("div",{className:"text-sm text-blue-700",children:[u.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),u.jsx("p",{className:"mt-1",children:_==null?void 0:_.description}),(_==null?void 0:_.supports_thinking)&&u.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[u.jsx(Kn,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),u.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."})]})})]}),u.jsxs(wc,{children:[u.jsx(bc,{onClick:G,children:"Cancel"}),u.jsx(Cc,{onClick:se,children:"Load Model"})]})]})}),u.jsx(vm,{open:T,onOpenChange:V,children:u.jsxs(xc,{children:[u.jsxs(vc,{children:[u.jsxs(Sc,{className:"flex items-center gap-2",children:[u.jsx(Ut,{className:"h-5 w-5 text-blue-500"}),"Save Current Configuration as Assistant"]}),u.jsx(kc,{children:"Save your current model settings and system prompt as a reusable assistant."})]}),u.jsxs("div",{className:"space-y-4 py-4",children:[u.jsxs("div",{children:[u.jsx(kt,{htmlFor:"assistant-name",children:"Assistant Name"}),u.jsx(yx,{id:"assistant-name",value:O,onChange:R=>D(R.target.value),placeholder:"e.g., Code Review Expert",className:"mt-1"})]}),u.jsxs("div",{children:[u.jsx(kt,{htmlFor:"assistant-description",children:"Description"}),u.jsx(Ud,{id:"assistant-description",value:$,onChange:R=>W(R.target.value),placeholder:"Describe what this assistant is good at...",rows:3,className:"mt-1"})]}),u.jsxs("div",{className:"bg-muted p-3 rounded-md text-sm",children:[u.jsx("div",{className:"font-medium mb-2",children:"Current Configuration:"}),u.jsxs("div",{className:"space-y-1 text-muted-foreground",children:[u.jsxs("div",{children:["Model: ",p]}),u.jsxs("div",{children:["Temperature: ",S]}),u.jsxs("div",{children:["Max Tokens: ",x]}),u.jsxs("div",{children:["System Prompt: ",w?w.slice(0,50)+"...":"None"]})]})]})]}),u.jsxs(wc,{children:[u.jsx(bc,{onClick:()=>V(!1),children:"Cancel"}),u.jsx(Cc,{onClick:q,disabled:!O.trim(),children:"Save Assistant"})]})]})})]})}function oI(){const[e,t]=h.useState([]),[n,r]=h.useState(!0),[i,o]=h.useState(null);h.useEffect(()=>{l()},[]);const l=async()=>{try{const c=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${c}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const f=await d.json();t(f.models)}catch(c){console.error("Error fetching models:",c)}finally{r(!1)}},s=async c=>{o(c);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:c})});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 c=>{o(c);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:c})});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?u.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:u.jsx(Ju,{className:"h-8 w-8 animate-spin"})}):u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto p-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:u.jsx(Od,{className:"h-5 w-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),u.jsxs(me,{onClick:()=>window.location.href="/playground",className:"flex items-center gap-2",children:[u.jsx(ds,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[u.jsx(de,{className:"bg-blue-50 border-blue-200",children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(Gy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),u.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."})]})]})})}),u.jsxs("div",{children:[u.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[u.jsx(us,{className:"h-5 w-5"}),"API Models",u.jsx(Le,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(c=>c.type==="api").map(c=>u.jsx(ch,{model:c,modelLoading:i,onLoad:s,onUnload:a},c.model_name))})]}),u.jsxs("div",{children:[u.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[u.jsx(Ky,{className:"h-5 w-5"}),"Local Models",u.jsx(Le,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(c=>c.type==="local").map(c=>u.jsx(ch,{model:c,modelLoading:i,onLoad:s,onUnload:a},c.model_name))})]}),u.jsxs(de,{children:[u.jsx(jt,{children:u.jsxs(Pt,{className:"flex items-center gap-2",children:[u.jsx(Kn,{className:"h-5 w-5"}),"Model Statistics"]})}),u.jsx(he,{children:u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.filter(c=>c.type==="api").length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"API Models"})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(c=>c.type==="local").length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Local Models"})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"text-2xl font-bold text-orange-600",children:e.filter(c=>c.is_loaded).length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(c=>c.supports_thinking).length}),u.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 u.jsxs(de,{className:"hover:shadow-md transition-shadow",children:[u.jsx(jt,{className:"pb-3",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs(Pt,{className:"text-base flex items-center gap-2",children:[i?u.jsx(us,{className:"h-4 w-4 text-blue-600"}):u.jsx(Ky,{className:"h-4 w-4 text-green-600"}),e.name]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&u.jsx(ZC,{className:"h-5 w-5 text-green-600"})]})}),u.jsxs(he,{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Size:"}),u.jsx(Le,{variant:"outline",className:"text-xs",children:e.size_gb})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),u.jsx(Le,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Type:"}),u.jsx(Le,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Features:"}),u.jsxs(Le,{variant:"outline",className:"text-xs",children:[u.jsx(Kn,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),u.jsx("div",{className:"pt-2",children:l?u.jsxs(me,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?u.jsx(Ju,{className:"h-4 w-4 mr-2 animate-spin"}):u.jsx(Dd,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):u.jsxs(me,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?u.jsx(Ju,{className:"h-4 w-4 mr-2 animate-spin"}):u.jsx(Fs,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function lI(){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(c=>c.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 u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto p-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:u.jsx(Ut,{className:"h-5 w-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold",children:"My Assistants"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your custom AI assistants and configurations"})]})]}),u.jsxs(me,{onClick:l,className:"flex items-center gap-2",children:[u.jsx(Zu,{className:"h-4 w-4"}),"Create New Assistant"]})]})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[u.jsx(de,{className:"bg-purple-50 border-purple-200",children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(tc,{className:"h-5 w-5 text-purple-600 mt-0.5"}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-purple-900",children:"Custom AI Assistants"}),u.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?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(s=>u.jsx(sI,{assistant:s,onUse:()=>r(s),onDelete:()=>i(s.id),onShare:()=>o(s)},s.id))}):u.jsxs(de,{className:"text-center py-16",children:[u.jsx(Ut,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),u.jsx("h3",{className:"text-xl font-medium mb-3",children:"No assistants yet"}),u.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."}),u.jsxs(me,{onClick:l,size:"lg",className:"flex items-center gap-2 mx-auto",children:[u.jsx(Zu,{className:"h-5 w-5"}),"Create Your First Assistant"]})]}),e.length>0&&u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Assistants"})]}),u.jsx(Ut,{className:"h-8 w-8 text-purple-600"})]})})}),u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-blue-600",children:new Set(e.map(s=>s.model)).size}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Models Used"})]}),u.jsx(hi,{className:"h-8 w-8 text-blue-600"})]})})}),u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.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}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Created This Week"})]}),u.jsx(tc,{className:"h-8 w-8 text-green-600"})]})})})]})]})})]})}function sI({assistant:e,onUse:t,onDelete:n,onShare:r}){return u.jsxs(de,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[u.jsx(jt,{className:"pb-3",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs(Pt,{className:"text-base flex items-center gap-2",children:[u.jsx(Ut,{className:"h-4 w-4 text-purple-600"}),e.name]}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description provided"})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(me,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Share to community",children:u.jsx(Yy,{className:"h-4 w-4"})}),u.jsx(me,{variant:"ghost",size:"sm",onClick:n,className:"text-red-500 hover:text-red-600 hover:bg-red-50",title:"Delete assistant",children:u.jsx(Dd,{className:"h-4 w-4"})})]})]})}),u.jsxs(he,{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Model:"}),u.jsx("p",{className:"text-gray-800 truncate",children:e.model})]}),u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),u.jsx("p",{className:"text-gray-800",children:e.temperature})]}),u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),u.jsx("p",{className:"text-gray-800",children:e.maxTokens})]}),u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Created:"}),u.jsx("p",{className:"text-gray-800",children:new Date(e.createdAt).toLocaleDateString()})]})]}),e.systemPrompt&&u.jsxs("div",{className:"bg-blue-50 rounded p-2",children:[u.jsx("span",{className:"text-xs font-medium text-blue-700",children:"System Prompt:"}),u.jsx("p",{className:"text-xs text-blue-600 mt-1 line-clamp-2",children:e.systemPrompt})]}),u.jsxs(me,{onClick:t,className:"w-full flex items-center gap-2",children:[u.jsx(hi,{className:"h-4 w-4"}),"Use Assistant"]})]})]})}var Ja="rovingFocusGroup.onEntryFocus",aI={bubbles:!1,cancelable:!0},$o="RovingFocusGroup",[Lc,s1,uI]=Bd($o),[cI,a1]=rr($o,[uI]),[dI,fI]=cI($o),u1=h.forwardRef((e,t)=>u.jsx(Lc.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Lc.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(pI,{...e,ref:t})})}));u1.displayName=$o;var pI=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,p=h.useRef(null),m=pe(t,p),w=Bs(o),[y,S]=yi({prop:l,defaultProp:s??null,onChange:a,caller:$o}),[g,x]=h.useState(!1),v=qn(c),C=s1(n),E=h.useRef(!1),[N,j]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(Ja,v),()=>A.removeEventListener(Ja,v)},[v]),u.jsx(dI,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:y,onItemFocus:h.useCallback(A=>S(A),[S]),onItemShiftTab:h.useCallback(()=>x(!0),[]),onFocusableItemAdd:h.useCallback(()=>j(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>j(A=>A-1),[]),children:u.jsx(ie.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{E.current=!0}),onFocus:ee(e.onFocus,A=>{const L=!E.current;if(A.target===A.currentTarget&&L&&!g){const _=new CustomEvent(Ja,aI);if(A.currentTarget.dispatchEvent(_),!_.defaultPrevented){const M=C().filter($=>$.focusable),T=M.find($=>$.active),V=M.find($=>$.id===y),D=[T,V,...M].filter(Boolean).map($=>$.ref.current);f1(D,d)}}E.current=!1}),onBlur:ee(e.onBlur,()=>x(!1))})})}),c1="RovingFocusGroupItem",d1=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=Gn(),c=o||a,d=fI(c1,n),f=d.currentTabStopId===c,p=s1(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:y}=d;return h.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),u.jsx(Lc.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:u.jsx(ie.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:ee(e.onMouseDown,S=>{r?d.onItemFocus(c):S.preventDefault()}),onFocus:ee(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const g=gI(S,d.orientation,d.dir);if(g!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const C=v.indexOf(S.currentTarget);v=d.loop?yI(v,C+1):v.slice(C+1)}setTimeout(()=>f1(v))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:y!=null}):l})})});d1.displayName=c1;var mI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gI(e,t,n){const r=hI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mI[r]}function f1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function yI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xI=u1,vI=d1,ta="Tabs",[wI,TI]=rr(ta,[a1]),p1=a1(),[SI,wf]=wI(ta),m1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...c}=e,d=Bs(s),[f,p]=yi({prop:r,onChange:i,defaultProp:o??"",caller:ta});return u.jsx(SI,{scope:n,baseId:Gn(),value:f,onValueChange:p,orientation:l,dir:d,activationMode:a,children:u.jsx(ie.div,{dir:d,"data-orientation":l,...c,ref:t})})});m1.displayName=ta;var h1="TabsList",g1=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=wf(h1,n),l=p1(n);return u.jsx(xI,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(ie.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});g1.displayName=h1;var y1="TabsTrigger",x1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=wf(y1,n),s=p1(n),a=S1(l.baseId,r),c=k1(l.baseId,r),d=r===l.value;return u.jsx(vI,{asChild:!0,...s,focusable:!i,active:d,children:u.jsx(ie.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const f=l.activationMode!=="manual";!d&&!i&&f&&l.onValueChange(r)})})})});x1.displayName=y1;var v1="TabsContent",w1=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=wf(v1,n),a=S1(s.baseId,r),c=k1(s.baseId,r),d=r===s.value,f=h.useRef(d);return h.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),u.jsx(zo,{present:i||d,children:({present:p})=>u.jsx(ie.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&o})})});w1.displayName=v1;function S1(e,t){return`${e}-trigger-${t}`}function k1(e,t){return`${e}-content-${t}`}var kI=m1,C1=g1,b1=x1,N1=w1;const CI=kI,E1=h.forwardRef(({className:e,...t},n)=>u.jsx(C1,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));E1.displayName=C1.displayName;const Ml=h.forwardRef(({className:e,...t},n)=>u.jsx(b1,{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}));Ml.displayName=b1.displayName;const Ol=h.forwardRef(({className:e,...t},n)=>u.jsx(N1,{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}));Ol.displayName=N1.displayName;function bI(){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 NI(){const[e]=h.useState(bI()),[t,n]=h.useState([]);h.useEffect(()=>{r()},[]);const r=()=>{try{const c=JSON.parse(localStorage.getItem("likedTemplates")||"[]");n(c)}catch(c){console.error("Failed to load liked templates:",c)}},i=c=>{const d=t.includes(c)?t.filter(f=>f!==c):[...t,c];n(d),localStorage.setItem("likedTemplates",JSON.stringify(d))},o=c=>{const d={name:c.name,description:c.description,model:c.model,systemPrompt:c.systemPrompt,temperature:c.temperature,maxTokens:c.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(d)),window.location.href="/playground"},l=e.filter(c=>c.isOfficial||c.likes>200),s=e.reduce((c,d)=>c+d.likes,0),a=e.reduce((c,d)=>c+d.downloads,0);return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto p-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:u.jsx(cs,{className:"h-5 w-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold",children:"Community Templates"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Discover and share AI assistant templates created by the community"})]})]}),u.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(qr,{className:"h-4 w-4"}),u.jsxs("span",{children:[s.toLocaleString()," likes"]})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Fs,{className:"h-4 w-4"}),u.jsxs("span",{children:[a.toLocaleString()," downloads"]})]})]})]})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[u.jsx(de,{className:"bg-blue-50 border-blue-200",children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(tc,{className:"h-5 w-5 text-blue-600 mt-0.5"}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-blue-900",children:"Community-Powered AI"}),u.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.'})]})]})})}),u.jsxs(CI,{defaultValue:"all",className:"space-y-6",children:[u.jsxs(E1,{className:"grid w-full grid-cols-3",children:[u.jsxs(Ml,{value:"all",className:"flex items-center gap-2",children:[u.jsx(cs,{className:"h-4 w-4"}),"All Templates"]}),u.jsxs(Ml,{value:"featured",className:"flex items-center gap-2",children:[u.jsx(Qy,{className:"h-4 w-4"}),"Featured"]}),u.jsxs(Ml,{value:"liked",className:"flex items-center gap-2",children:[u.jsx(qr,{className:"h-4 w-4"}),"My Likes"]})]}),u.jsx(Ol,{value:"all",className:"space-y-6",children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(c=>u.jsx(Za,{template:c,isLiked:t.includes(c.id),onLike:()=>i(c.id),onUse:()=>o(c)},c.id))})}),u.jsx(Ol,{value:"featured",className:"space-y-6",children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(c=>u.jsx(Za,{template:c,isLiked:t.includes(c.id),onLike:()=>i(c.id),onUse:()=>o(c),featured:!0},c.id))})}),u.jsx(Ol,{value:"liked",className:"space-y-6",children:t.length>0?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.filter(c=>t.includes(c.id)).map(c=>u.jsx(Za,{template:c,isLiked:!0,onLike:()=>i(c.id),onUse:()=>o(c)},c.id))}):u.jsxs(de,{className:"text-center py-16",children:[u.jsx(qr,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),u.jsx("h3",{className:"text-xl font-medium mb-3",children:"No liked templates yet"}),u.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."})]})})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Templates"})]}),u.jsx(Wy,{className:"h-8 w-8 text-blue-600"})]})})}),u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(c=>c.isOfficial).length}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Official"})]}),u.jsx(Vy,{className:"h-8 w-8 text-green-600"})]})})}),u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-red-500",children:s.toLocaleString()}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Likes"})]}),u.jsx(qr,{className:"h-8 w-8 text-red-500"})]})})}),u.jsx(de,{children:u.jsx(he,{className:"pt-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-2xl font-bold text-purple-600",children:a.toLocaleString()}),u.jsx("div",{className:"text-sm text-muted-foreground",children:"Downloads"})]}),u.jsx(zb,{className:"h-8 w-8 text-purple-600"})]})})})]})]})})]})}function Za({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1}){return u.jsxs(de,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${i?"ring-2 ring-yellow-200 shadow-md":""}`,children:[u.jsx(jt,{className:"pb-3",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx(Pt,{className:"text-base",children:e.name}),e.isOfficial&&u.jsxs(Le,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[u.jsx(Vy,{className:"h-3 w-3 mr-1"}),"Official"]}),i&&u.jsx(Qy,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),u.jsxs("p",{className:"text-xs text-blue-600 font-medium",children:["by ",e.author]}),u.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:e.description})]}),u.jsx(me,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:u.jsx(qr,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),u.jsxs(he,{className:"space-y-4",children:[u.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(o=>u.jsx(Le,{variant:"secondary",className:"text-xs",children:o},o))}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),u.jsx("p",{className:"text-gray-800",children:e.temperature})]}),u.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[u.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),u.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(qr,{className:"h-3 w-3"}),u.jsx("span",{children:e.likes})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Fs,{className:"h-3 w-3"}),u.jsx("span",{children:e.downloads})]})]}),u.jsxs(me,{size:"sm",onClick:r,className:"flex items-center gap-1",children:[u.jsx(Wy,{className:"h-3 w-3"}),"Use"]})]})]})]})}function EI(){return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b",children:u.jsx("div",{className:"flex h-14 items-center px-6",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ld,{className:"h-5 w-5"}),u.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[u.jsxs(de,{children:[u.jsx(jt,{children:u.jsxs(Pt,{className:"flex items-center gap-2",children:[u.jsx(Pb,{className:"h-5 w-5"}),"Server Configuration"]})}),u.jsx(he,{className:"space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx(kt,{className:"text-sm font-medium",children:"Backend URL"}),u.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),u.jsxs("div",{children:[u.jsx(kt,{className:"text-sm font-medium",children:"Frontend URL"}),u.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),u.jsxs(de,{children:[u.jsx(jt,{children:u.jsxs(Pt,{className:"flex items-center gap-2",children:[u.jsx(ec,{className:"h-5 w-5"}),"Privacy & Security"]})}),u.jsx(he,{className:"space-y-4",children:u.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(ec,{className:"h-4 w-4 text-green-600"}),u.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),u.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),u.jsxs(de,{children:[u.jsx(jt,{children:u.jsxs(Pt,{className:"flex items-center gap-2",children:[u.jsx(Gy,{className:"h-5 w-5"}),"System Information"]})}),u.jsx(he,{className:"space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx(kt,{className:"text-sm font-medium",children:"Platform"}),u.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[u.jsx(Le,{variant:"outline",children:"Local"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),u.jsxs("div",{children:[u.jsx(kt,{className:"text-sm font-medium",children:"Status"}),u.jsx("div",{className:"mt-1",children:u.jsx(Le,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function jI(){return u.jsx(oC,{children:u.jsx(Jk,{children:u.jsxs(Pn,{path:"/",element:u.jsx(Qb,{}),children:[u.jsx(Pn,{index:!0,element:u.jsx(oN,{})}),u.jsx(Pn,{path:"playground",element:u.jsx(iI,{})}),u.jsx(Pn,{path:"models",element:u.jsx(oI,{})}),u.jsx(Pn,{path:"assistants",element:u.jsx(lI,{})}),u.jsx(Pn,{path:"community",element:u.jsx(NI,{})}),u.jsx(Pn,{path:"settings",element:u.jsx(EI,{})})]})})})}eu.createRoot(document.getElementById("root")).render(u.jsx(Dt.StrictMode,{children:u.jsx(jI,{})})); //# sourceMappingURL=index-144414e6.js.map