function O1(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 ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},Bs={},wh={exports:{}},ae={};/** * @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"),D1=Symbol.for("react.portal"),z1=Symbol.for("react.fragment"),F1=Symbol.for("react.strict_mode"),B1=Symbol.for("react.profiler"),$1=Symbol.for("react.provider"),U1=Symbol.for("react.context"),V1=Symbol.for("react.forward_ref"),H1=Symbol.for("react.suspense"),W1=Symbol.for("react.memo"),G1=Symbol.for("react.lazy"),Pf=Symbol.iterator;function K1(e){return e===null||typeof e!="object"?null:(e=Pf&&e[Pf]||e["@@iterator"],typeof e=="function"?e:null)}var Sh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bh=Object.assign,kh={};function Pi(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||Sh}Pi.prototype.isReactComponent={};Pi.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")};Pi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nh(){}Nh.prototype=Pi.prototype;function Hc(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||Sh}var Wc=Hc.prototype=new Nh;Wc.constructor=Hc;bh(Wc,Pi.prototype);Wc.isPureReactComponent=!0;var Tf=Array.isArray,Ch=Object.prototype.hasOwnProperty,Gc={current:null},jh={key:!0,ref:!0,__self:!0,__source:!0};function Eh(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)Ch.call(t,r)&&!jh.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,Y=A[V];if(0>>1;Vi(fe,b))iei(K,fe)?(A[V]=K,A[ie]=b,V=ie):(A[V]=fe,A[re]=b,V=re);else if(iei(K,b))A[V]=K,A[ie]=b,V=ie;else break e}}return F}function i(A,F){var b=A.sortIndex-F.sortIndex;return b!==0?b:A.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],f=1,d=null,p=3,m=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=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(A){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=A)r(c),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(c)}}function k(A){if(x=!1,v(A),!w)if(n(u)!==null)w=!0,O(j);else{var F=n(c);F!==null&&$(k,F.startTime-A)}}function j(A,F){w=!1,x&&(x=!1,y(T),T=-1),m=!0;var b=p;try{for(v(F),d=n(u);d!==null&&(!(d.expirationTime>F)||A&&!I());){var V=d.callback;if(typeof V=="function"){d.callback=null,p=d.priorityLevel;var Y=V(d.expirationTime<=F);F=e.unstable_now(),typeof Y=="function"?d.callback=Y:d===n(u)&&r(u),v(F)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var re=n(c);re!==null&&$(k,re.startTime-F),N=!1}return N}finally{d=null,p=b,m=!1}}var C=!1,E=null,T=-1,z=5,L=-1;function I(){return!(e.unstable_now()-LA||125V?(A.sortIndex=b,t(c,A),n(u)===null&&A===n(c)&&(x?(y(T),T=-1):x=!0,$(k,b-V))):(A.sortIndex=Y,t(u,A),w||m||(w=!0,O(j))),A},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(A){var F=p;return function(){var b=p;p=F;try{return A.apply(this,arguments)}finally{p=b}}}})(Ih);_h.exports=Ih;var iw=_h.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ow=g,jt=iw;function B(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"),wu=Object.prototype.hasOwnProperty,lw=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_f={},If={};function sw(e){return wu.call(If,e)?!0:wu.call(_f,e)?!1:lw.test(e)?If[e]=!0:(_f[e]=!0,!1)}function aw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function uw(e,t,n,r){if(t===null||typeof t>"u"||aw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(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 Xe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Xe[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Xe[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xe[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xe[e]=new st(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){Xe[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xe[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xe[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xe[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xe[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yc=/[\-:]([a-z])/g;function Xc(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(Yc,Xc);Xe[t]=new st(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(Yc,Xc);Xe[t]=new st(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(Yc,Xc);Xe[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xe[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Xe.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xe[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function qc(e,t,n,r){var i=Xe.hasOwnProperty(t)?Xe[t]:null;(i!==null?i.type!==0:r||!(2a||i[l]!==o[a]){var u=` `+i[l].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{Ca=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ji(e):""}function cw(e){switch(e.tag){case 5:return Ji(e.type);case 16:return Ji("Lazy");case 13:return Ji("Suspense");case 19:return Ji("SuspenseList");case 0:case 2:case 15:return e=ja(e.type,!1),e;case 11:return e=ja(e.type.render,!1),e;case 1:return e=ja(e.type,!0),e;default:return""}}function Nu(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 Hr:return"Fragment";case Vr:return"Portal";case Su:return"Profiler";case Jc:return"StrictMode";case bu:return"Suspense";case ku:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lh:return(e.displayName||"Context")+".Consumer";case Mh:return(e._context.displayName||"Context")+".Provider";case Zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ed:return t=e.displayName||null,t!==null?t:Nu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Nu(e(t))}catch{}}return null}function dw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nu(t);case 8:return t===Jc?"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 Jn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fw(e){var t=Dh(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 il(e){e._valueTracker||(e._valueTracker=fw(e))}function zh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ns(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 Cu(e,t){var n=t.checked;return Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jn(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 Fh(e,t){t=t.checked,t!=null&&qc(e,"checked",t,!1)}function ju(e,t){Fh(e,t);var n=Jn(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")?Eu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Eu(e,t.type,Jn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lf(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 Eu(e,t,n){(t!=="number"||ns(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zi=Array.isArray;function ri(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ol.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ro={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pw=["Webkit","ms","Moz","O"];Object.keys(ro).forEach(function(e){pw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ro[t]=ro[e]})});function Vh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ro.hasOwnProperty(e)&&ro[e]?(""+t).trim():t+"px"}function Hh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Vh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var mw=Me({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 Au(e,t){if(t){if(mw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function _u(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 Iu=null;function td(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ru=null,ii=null,oi=null;function zf(e){if(e=Ho(e)){if(typeof Ru!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ws(t),Ru(e.stateNode,e.type,t))}}function Wh(e){ii?oi?oi.push(e):oi=[e]:ii=e}function Gh(){if(ii){var e=ii,t=oi;if(oi=ii=null,zf(e),t)for(e=0;e>>=0,e===0?32:31-(Cw(e)/jw|0)|0}var ll=64,sl=4194304;function eo(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 ls(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 a=l&~i;a!==0?r=eo(a):(o&=l,o!==0&&(r=eo(o)))}else l=n&~i,l!==0?r=eo(l):o!==0&&(r=eo(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 Uo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function Aw(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=oo),Kf=String.fromCharCode(32),Qf=!1;function fg(e,t){switch(e){case"keyup":return iS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function lS(e,t){switch(e){case"compositionend":return pg(t);case"keypress":return t.which!==32?null:(Qf=!0,Kf);case"textInput":return e=t.data,e===Kf&&Qf?null:e;default:return null}}function sS(e,t){if(Wr)return e==="compositionend"||!ud&&fg(e,t)?(e=cg(),Il=ld=Fn=null,Wr=!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=Jf(n)}}function xg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(){for(var e=window,t=ns();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ns(e.document)}return t}function cd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function gS(e){var t=yg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xg(n.ownerDocument.documentElement,n)){if(r!==null&&cd(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=Zf(n,o);var l=Zf(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,Gr=null,Fu=null,so=null,Bu=!1;function ep(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bu||Gr==null||Gr!==ns(r)||(r=Gr,"selectionStart"in r&&cd(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}),so&&ko(so,r)||(so=r,r=us(Fu,"onSelect"),0Yr||(e.current=Gu[Yr],Gu[Yr]=null,Yr--)}function Ne(e,t){Yr++,Gu[Yr]=e.current,e.current=t}var Zn={},et=ir(Zn),ft=ir(!1),br=Zn;function xi(e,t){var n=e.type.contextTypes;if(!n)return Zn;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 pt(e){return e=e.childContextTypes,e!=null}function ds(){Pe(ft),Pe(et)}function sp(e,t,n){if(et.current!==Zn)throw Error(B(168));Ne(et,t),Ne(ft,n)}function Eg(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(B(108,dw(e)||"Unknown",i));return Me({},n,r)}function fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,br=et.current,Ne(et,e),Ne(ft,ft.current),!0}function ap(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Eg(e,t,br),r.__reactInternalMemoizedMergedChildContext=e,Pe(ft),Pe(et),Ne(et,e)):Pe(ft),Ne(ft,n)}var vn=null,Gs=!1,Ba=!1;function Pg(e){vn===null?vn=[e]:vn.push(e)}function PS(e){Gs=!0,Pg(e)}function or(){if(!Ba&&vn!==null){Ba=!0;var e=0,t=Se;try{var n=vn;for(Se=1;e>=l,i-=l,wn=1<<32-Kt(t)+i|n<T?(z=E,E=null):z=E.sibling;var L=p(y,E,v[T],k);if(L===null){E===null&&(E=z);break}e&&E&&L.alternate===null&&t(y,E),h=o(L,h,T),C===null?j=L:C.sibling=L,C=L,E=z}if(T===v.length)return n(y,E),Ae&&fr(y,T),j;if(E===null){for(;TT?(z=E,E=null):z=E.sibling;var I=p(y,E,L.value,k);if(I===null){E===null&&(E=z);break}e&&E&&I.alternate===null&&t(y,E),h=o(I,h,T),C===null?j=I:C.sibling=I,C=I,E=z}if(L.done)return n(y,E),Ae&&fr(y,T),j;if(E===null){for(;!L.done;T++,L=v.next())L=d(y,L.value,k),L!==null&&(h=o(L,h,T),C===null?j=L:C.sibling=L,C=L);return Ae&&fr(y,T),j}for(E=r(y,E);!L.done;T++,L=v.next())L=m(E,y,T,L.value,k),L!==null&&(e&&L.alternate!==null&&E.delete(L.key===null?T:L.key),h=o(L,h,T),C===null?j=L:C.sibling=L,C=L);return e&&E.forEach(function(P){return t(y,P)}),Ae&&fr(y,T),j}function S(y,h,v,k){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case rl:e:{for(var j=v.key,C=h;C!==null;){if(C.key===j){if(j=v.type,j===Hr){if(C.tag===7){n(y,C.sibling),h=i(C,v.props.children),h.return=y,y=h;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ln&&dp(j)===C.type){n(y,C.sibling),h=i(C,v.props),h.ref=Wi(y,C,v),h.return=y,y=h;break e}n(y,C);break}else t(y,C);C=C.sibling}v.type===Hr?(h=wr(v.props.children,y.mode,k,v.key),h.return=y,y=h):(k=Bl(v.type,v.key,v.props,null,y.mode,k),k.ref=Wi(y,h,v),k.return=y,y=k)}return l(y);case Vr:e:{for(C=v.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(y,h.sibling),h=i(h,v.children||[]),h.return=y,y=h;break e}else{n(y,h);break}else t(y,h);h=h.sibling}h=Qa(v,y.mode,k),h.return=y,y=h}return l(y);case Ln:return C=v._init,S(y,h,C(v._payload),k)}if(Zi(v))return w(y,h,v,k);if(Bi(v))return x(y,h,v,k);ml(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(y,h.sibling),h=i(h,v),h.return=y,y=h):(n(y,h),h=Ka(v,y.mode,k),h.return=y,y=h),l(y)):n(y,h)}return S}var vi=Ig(!0),Rg=Ig(!1),hs=ir(null),gs=null,Jr=null,md=null;function hd(){md=Jr=gs=null}function gd(e){var t=hs.current;Pe(hs),e._currentValue=t}function Yu(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 si(e,t){gs=e,md=Jr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function Ot(e){var t=e._currentValue;if(md!==e)if(e={context:e,memoizedValue:t,next:null},Jr===null){if(gs===null)throw Error(B(308));Jr=e,gs.dependencies={lanes:0,firstContext:e}}else Jr=Jr.next=e;return t}var gr=null;function xd(e){gr===null?gr=[e]:gr.push(e)}function Mg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,xd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(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 On=!1;function yd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lg(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 bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,xd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function Ml(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,rd(e,n)}}function fp(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 xs(e,t,n,r){var i=e.updateQueue;On=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,l===null?o=c:l.next=c,l=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==l&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(o!==null){var d=i.baseState;l=0,f=c=u=null,a=o;do{var p=a.lane,m=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,x=a;switch(p=t,m=n,x.tag){case 1:if(w=x.payload,typeof w=="function"){d=w.call(m,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=x.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Me({},d,p);break e;case 2:On=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,u=d):f=f.next=m,l|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(f===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,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);Cr|=l,e.lanes=l,e.memoizedState=d}}function pp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ua.transition;Ua.transition={};try{e(!1),t()}finally{Se=n,Ua.transition=r}}function Jg(){return Dt().memoizedState}function IS(e,t,n){var r=Qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zg(e))ex(t,n);else if(n=Mg(e,t,n,r),n!==null){var i=ot();Qt(n,e,r,i),tx(n,t,r)}}function RS(e,t,n){var r=Qn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zg(e))ex(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,a=o(l,n);if(i.hasEagerState=!0,i.eagerState=a,Yt(a,l)){var u=t.interleaved;u===null?(i.next=i,xd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Mg(e,t,i,r),n!==null&&(i=ot(),Qt(n,e,r,i),tx(n,t,r))}}function Zg(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ex(e,t){ao=vs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rd(e,n)}}var ws={readContext:Ot,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},MS={readContext:Ot,useCallback:function(e,t){return on().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:hp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ol(4194308,4,Kg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ol(4,2,e,t)},useMemo:function(e,t){var n=on();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=on();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=IS.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=on();return e={current:e},t.memoizedState=e},useState:mp,useDebugValue:jd,useDeferredValue:function(e){return on().memoizedState=e},useTransition:function(){var e=mp(!1),t=e[0];return e=_S.bind(null,e[1]),on().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,i=on();if(Ae){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ge===null)throw Error(B(349));Nr&30||Fg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,hp($g.bind(null,r,o,e),[e]),r.flags|=2048,_o(9,Bg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=on(),t=Ge.identifierPrefix;if(Ae){var n=Sn,r=wn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=To++,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[sn]=t,e[jo]=r,dx(e,t,!1,!1),t.stateNode=e;e:{switch(l=_u(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;ibi&&(t.flags|=128,r=!0,Gi(o,!1),t.lanes=4194304)}else{if(!r)if(e=ys(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Gi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ae)return Je(t),null}else 2*De()-o.renderingStartTime>bi&&n!==1073741824&&(t.flags|=128,r=!0,Gi(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=De(),t.sibling=null,n=_e.current,Ne(_e,r?n&1|2:n&1),t):(Je(t),null);case 22:case 23:return Id(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function US(e,t){switch(fd(t),t.tag){case 1:return pt(t.type)&&ds(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wi(),Pe(ft),Pe(et),Sd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wd(t),null;case 13:if(Pe(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(_e),null;case 4:return wi(),null;case 10:return gd(t.type._context),null;case 22:case 23:return Id(),null;case 24:return null;default:return null}}var gl=!1,Ze=!1,VS=typeof WeakSet=="function"?WeakSet:Set,G=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function ic(e,t,n){try{n()}catch(r){Le(e,t,r)}}var jp=!1;function HS(e,t){if($u=ss,e=yg(),cd(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,a=-1,u=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(a=l+i),d!==o||r!==0&&d.nodeType!==3||(u=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++c===i&&(a=l),p===o&&++f===r&&(u=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uu={focusedElem:e,selectionRange:n},ss=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var x=w.memoizedProps,S=w.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Vt(t.type,x),S);y.__reactInternalSnapshotBeforeUpdate=h}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(B(163))}}catch(k){Le(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=jp,jp=!1,w}function uo(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&&ic(t,n,o)}i=i.next}while(i!==r)}}function Ys(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 oc(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 mx(e){var t=e.alternate;t!==null&&(e.alternate=null,mx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sn],delete t[jo],delete t[Wu],delete t[jS],delete t[ES])),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 hx(e){return e.tag===5||e.tag===3||e.tag===4}function Ep(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hx(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 lc(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=cs));else if(r!==4&&(e=e.child,e!==null))for(lc(e,t,n),e=e.sibling;e!==null;)lc(e,t,n),e=e.sibling}function sc(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(sc(e,t,n),e=e.sibling;e!==null;)sc(e,t,n),e=e.sibling}var Ke=null,Wt=!1;function _n(e,t,n){for(n=n.child;n!==null;)gx(e,t,n),n=n.sibling}function gx(e,t,n){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount($s,n)}catch{}switch(n.tag){case 5:Ze||Zr(n,t);case 6:var r=Ke,i=Wt;Ke=null,_n(e,t,n),Ke=r,Wt=i,Ke!==null&&(Wt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(Wt?(e=Ke,n=n.stateNode,e.nodeType===8?Fa(e.parentNode,n):e.nodeType===1&&Fa(e,n),So(e)):Fa(Ke,n.stateNode));break;case 4:r=Ke,i=Wt,Ke=n.stateNode.containerInfo,Wt=!0,_n(e,t,n),Ke=r,Wt=i;break;case 0:case 11:case 14:case 15:if(!Ze&&(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)&&ic(n,t,l),i=i.next}while(i!==r)}_n(e,t,n);break;case 1:if(!Ze&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Le(n,t,a)}_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,_n(e,t,n),Ze=r):_n(e,t,n);break;default:_n(e,t,n)}}function Pp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new VS),t.forEach(function(r){var i=ZS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GS(r/1960))-r,10e?16:e,Bn===null)var r=!1;else{if(e=Bn,Bn=null,ks=0,pe&6)throw Error(B(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var o=G,l=o.child;if(G.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uDe()-Ad?vr(e,0):Td|=n),mt(e,t)}function Nx(e,t){t===0&&(e.mode&1?(t=sl,sl<<=1,!(sl&130023424)&&(sl=4194304)):t=1);var n=ot();e=Cn(e,t),e!==null&&(Uo(e,t,n),mt(e,n))}function JS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nx(e,n)}function ZS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Nx(e,n)}var Cx;Cx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,BS(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Ae&&t.flags&1048576&&Tg(t,ms,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dl(e,t),e=t.pendingProps;var i=xi(t,et.current);si(t,n),i=kd(null,t,r,e,i,n);var o=Nd();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,pt(r)?(o=!0,fs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yd(t),i.updater=Qs,t.stateNode=i,i._reactInternals=t,qu(t,r,e,n),t=ec(null,t,r,!0,o,n)):(t.tag=0,Ae&&o&&dd(t),it(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=tb(r),e=Vt(r,e),i){case 0:t=Zu(null,t,r,e,n);break e;case 1:t=kp(null,t,r,e,n);break e;case 11:t=Sp(null,t,r,e,n);break e;case 14:t=bp(null,t,r,Vt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Zu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),kp(e,t,r,i,n);case 3:e:{if(ax(t),e===null)throw Error(B(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Lg(e,t),xs(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=Si(Error(B(423)),t),t=Np(e,t,r,n,i);break e}else if(r!==i){i=Si(Error(B(424)),t),t=Np(e,t,r,n,i);break e}else for(bt=Wn(t.stateNode.containerInfo.firstChild),Nt=t,Ae=!0,Gt=null,n=Rg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){t=jn(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return Og(t),e===null&&Qu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Vu(r,i)?l=null:o!==null&&Vu(r,o)&&(t.flags|=32),sx(e,t),it(e,t,l,n),t.child;case 6:return e===null&&Qu(t),null;case 13:return ux(e,t,n);case 4:return vd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vi(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Sp(e,t,r,i,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(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,Ne(hs,r._currentValue),r._currentValue=l,o!==null)if(Yt(o.value,l)){if(o.children===i.children&&!ft.current){t=jn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=bn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Yu(o.return,n,t),a.lanes|=n;break}u=u.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(B(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Yu(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}it(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,si(t,n),i=Ot(i),r=r(i),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,i=Vt(r,t.pendingProps),i=Vt(r.type,i),bp(e,t,r,i,n);case 15:return ox(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Dl(e,t),t.tag=1,pt(r)?(e=!0,fs(t)):e=!1,si(t,n),nx(t,r,i),qu(t,r,i,n),ec(null,t,r,!0,e,n);case 19:return cx(e,t,n);case 22:return lx(e,t,n)}throw Error(B(156,t.tag))};function jx(e,t){return Zh(e,t)}function eb(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 It(e,t,n,r){return new eb(e,t,n,r)}function Md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tb(e){if(typeof e=="function")return Md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zc)return 11;if(e===ed)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=It(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 Bl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Md(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Hr:return wr(n.children,i,o,t);case Jc:l=8,i|=8;break;case Su:return e=It(12,n,t,i|2),e.elementType=Su,e.lanes=o,e;case bu:return e=It(13,n,t,i),e.elementType=bu,e.lanes=o,e;case ku:return e=It(19,n,t,i),e.elementType=ku,e.lanes=o,e;case Oh:return qs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mh:l=10;break e;case Lh:l=9;break e;case Zc:l=11;break e;case ed:l=14;break e;case Ln:l=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=It(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function wr(e,t,n,r){return e=It(7,e,r,t),e.lanes=n,e}function qs(e,t,n,r){return e=It(22,e,r,t),e.elementType=Oh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ka(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function Qa(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nb(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=Pa(0),this.expirationTimes=Pa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pa(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ld(e,t,n,r,i,o,l,a,u){return e=new nb(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=It(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yd(o),e}function rb(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ax)}catch(e){console.error(e)}}Ax(),Ah.exports=Et;var _i=Ah.exports;const ab=Fs(_i);var Op=_i;vu.createRoot=Op.createRoot,vu.hydrateRoot=Op.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 Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function _x(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cb(){return Math.random().toString(36).substr(2,8)}function zp(e,t){return{usr:e.state,key:e.key,idx:t}}function fc(e,t,n,r){return n===void 0&&(n=null),Ro({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ii(t):t,{state:n,key:t&&t.key||r||cb()})}function js(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 Ii(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 db(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,a=$n.Pop,u=null,c=f();c==null&&(c=0,l.replaceState(Ro({},l.state,{idx:c}),""));function f(){return(l.state||{idx:null}).idx}function d(){a=$n.Pop;let S=f(),y=S==null?null:S-c;c=S,u&&u({action:a,location:x.location,delta:y})}function p(S,y){a=$n.Push;let h=fc(x.location,S,y);n&&n(h,S),c=f()+1;let v=zp(h,c),k=x.createHref(h);try{l.pushState(v,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(k)}o&&u&&u({action:a,location:x.location,delta:1})}function m(S,y){a=$n.Replace;let h=fc(x.location,S,y);n&&n(h,S),c=f();let v=zp(h,c),k=x.createHref(h);l.replaceState(v,"",k),o&&u&&u({action:a,location:x.location,delta:0})}function w(S){let y=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:js(S);return h=h.replace(/ $/,"%20"),$e(y,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,y)}let x={get action(){return a},get location(){return e(i,l)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(Dp,d),u=S,()=>{i.removeEventListener(Dp,d),u=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let y=w(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(S){return l.go(S)}};return x}var Fp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Fp||(Fp={}));function fb(e,t,n){return n===void 0&&(n="/"),pb(e,t,n,!1)}function pb(e,t,n,r){let i=typeof t=="string"?Ii(t):t,o=Fd(i.pathname||"/",n);if(o==null)return null;let l=Ix(e);mb(l);let a=null;for(let u=0;a==null&&u{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};u.relativePath.startsWith("/")&&($e(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Xn([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&($e(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Ix(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Sb(c,o.index),routesMeta:f})};return e.forEach((o,l)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,l);else for(let u of Rx(o.path))i(o,l,u)}),t}function Rx(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=Rx(r.join("/")),a=[];return a.push(...l.map(u=>u===""?o:[o,u].join("/"))),i&&a.push(...l),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function mb(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const hb=/^:[\w-]+$/,gb=3,xb=2,yb=1,vb=10,wb=-2,Bp=e=>e==="*";function Sb(e,t){let n=e.split("/"),r=n.length;return n.some(Bp)&&(r+=wb),t&&(r+=xb),n.filter(i=>!Bp(i)).reduce((i,o)=>i+(hb.test(o)?gb:o===""?yb:vb),r)}function bb(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 kb(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let a=0;a{let{paramName:p,isOptional:m}=f;if(p==="*"){let x=a[d]||"";l=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=a[d];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function Nb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),_x(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,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Cb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _x(!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 Fd(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 jb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ii(e):e;return{pathname:n?n.startsWith("/")?n:Eb(n,t):t,search:Ab(r),hash:_b(i)}}function Eb(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 Ya(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 Pb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mx(e,t){let n=Pb(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Lx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ii(e):(i=Ro({},e),$e(!i.pathname||!i.pathname.includes("?"),Ya("?","pathname","search",i)),$e(!i.pathname||!i.pathname.includes("#"),Ya("#","pathname","hash",i)),$e(!i.search||!i.search.includes("#"),Ya("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,a;if(l==null)a=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}a=d>=0?t[d]:"/"}let u=jb(i,a),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}const Xn=e=>e.join("/").replace(/\/\/+/g,"/"),Tb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ab=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_b=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ib(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ox=["post","put","patch","delete"];new Set(Ox);const Rb=["get",...Ox];new Set(Rb);/** * 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 Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(c,f){if(f===void 0&&(f={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=Lx(c,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Xn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Db=g.createContext(null);function zb(e){let t=g.useContext(lr).outlet;return t&&g.createElement(Db.Provider,{value:e},t)}function Fx(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Mr),{matches:i}=g.useContext(lr),{pathname:o}=Ko(),l=JSON.stringify(Mx(i,r.v7_relativeSplatPath));return g.useMemo(()=>Lx(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Fb(e,t){return Bb(e,t)}function Bb(e,t,n,r){Go()||$e(!1);let{navigator:i}=g.useContext(Mr),{matches:o}=g.useContext(lr),l=o[o.length-1],a=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=Ko(),f;if(t){var d;let S=typeof t=="string"?Ii(t):t;u==="/"||(d=S.pathname)!=null&&d.startsWith(u)||$e(!1),f=S}else f=c;let p=f.pathname||"/",m=p;if(u!=="/"){let S=u.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=fb(e,{pathname:m}),x=Wb(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Xn([u,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Xn([u,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&x?g.createElement(na.Provider,{value:{location:Mo({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:$n.Pop}},x):x}function $b(){let e=Yb(),t=Ib(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 g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,o)}const Ub=g.createElement($b,null);class Vb extends g.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?g.createElement(lr.Provider,{value:this.props.routeContext},g.createElement(Dx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Hb(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Bd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(lr.Provider,{value:t},r)}function Wb(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,a=(i=n)==null?void 0:i.errors;if(a!=null){let f=l.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);f>=0||$e(!1),l=l.slice(0,Math.min(l.length,f+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,w=!1,x=null,S=null;n&&(m=a&&d.route.id?a[d.route.id]:void 0,x=d.route.errorElement||Ub,u&&(c<0&&p===0?(qb("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),h=()=>{let v;return m?v=x:w?v=S:d.route.Component?v=g.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=f,g.createElement(Hb,{match:d,routeContext:{outlet:f,matches:y,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Vb,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:h(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):h()},null)}var Bx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Bx||{}),Es=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}(Es||{});function Gb(e){let t=g.useContext(Bd);return t||$e(!1),t}function Kb(e){let t=g.useContext(Mb);return t||$e(!1),t}function Qb(e){let t=g.useContext(lr);return t||$e(!1),t}function $x(e){let t=Qb(),n=t.matches[t.matches.length-1];return n.route.id||$e(!1),n.route.id}function Yb(){var e;let t=g.useContext(Dx),n=Kb(Es.UseRouteError),r=$x(Es.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Xb(){let{router:e}=Gb(Bx.UseNavigateStable),t=$x(Es.UseNavigateStable),n=g.useRef(!1);return zx(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Mo({fromRouteId:t},o)))},[e,t])}const Up={};function qb(e,t,n){!t&&!Up[e]&&(Up[e]=!0)}function Jb(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 Zb(e){return zb(e.context)}function rn(e){$e(!1)}function ek(e){let{basename:t="/",children:n=null,location:r,navigationType:i=$n.Pop,navigator:o,static:l=!1,future:a}=e;Go()&&$e(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:o,static:l,future:Mo({v7_relativeSplatPath:!1},a)}),[u,a,o,l]);typeof r=="string"&&(r=Ii(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,x=g.useMemo(()=>{let S=Fd(f,u);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:w},navigationType:i}},[u,f,d,p,m,w,i]);return x==null?null:g.createElement(Mr.Provider,{value:c},g.createElement(na.Provider,{children:n,value:x}))}function tk(e){let{children:t,location:n}=e;return Fb(pc(t),n)}new Promise(()=>{});function pc(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let o=[...t,i];if(r.type===g.Fragment){n.push.apply(n,pc(r.props.children,o));return}r.type!==rn&&$e(!1),!r.props.index||!r.props.children||$e(!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=pc(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 mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function rk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ik(e,t){return e.button===0&&(!t||t==="_self")&&!rk(e)}const ok=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],lk="6";try{window.__reactRouterVersion=lk}catch{}const sk="startTransition",Vp=Qc[sk];function ak(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=ub({window:i,v5Compat:!0}));let l=o.current,[a,u]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},f=g.useCallback(d=>{c&&Vp?Vp(()=>u(d)):u(d)},[u,c]);return g.useLayoutEffect(()=>l.listen(f),[l,f]),g.useEffect(()=>Jb(r),[r]),g.createElement(ek,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:l,future:r})}const uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ck=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hp=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:a,target:u,to:c,preventScrollReset:f,viewTransition:d}=t,p=nk(t,ok),{basename:m}=g.useContext(Mr),w,x=!1;if(typeof c=="string"&&ck.test(c)&&(w=c,uk))try{let v=new URL(window.location.href),k=c.startsWith("//")?new URL(v.protocol+c):new URL(c),j=Fd(k.pathname,m);k.origin===v.origin&&j!=null?c=j+k.search+k.hash:x=!0}catch{}let S=Lb(c,{relative:i}),y=dk(c,{replace:l,state:a,target:u,preventScrollReset:f,relative:i,viewTransition:d});function h(v){r&&r(v),v.defaultPrevented||y(v)}return g.createElement("a",mc({},p,{href:w||S,onClick:x||o?r:h,ref:n,target:u}))});var Wp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wp||(Wp={}));var Gp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Gp||(Gp={}));function dk(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:a}=t===void 0?{}:t,u=Lr(),c=Ko(),f=Fx(e,{relative:l});return g.useCallback(d=>{if(ik(d,n)){d.preventDefault();let p=r!==void 0?r:js(c)===js(f);u(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:a})}},[c,u,f,r,i,n,e,o,l,a])}function Ux(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 a=n.get(l);if(a!==void 0)return a;if((a=r.get(l))!==void 0)return i(l,a),a},set:function(l,a){n.has(l)?n.set(l,a):i(l,a)}}}var Gx="!";function vk(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var a=[],u=0,c=0,f,d=0;dc?f-c:void 0;return{modifiers:a,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:S}}}function wk(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 Sk(e){return{cache:yk(e.cacheSize),splitModifiers:vk(e),...pk(e)}}var bk=/\s+/;function kk(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(bk).map(function(l){var a=n(l),u=a.modifiers,c=a.hasImportantModifier,f=a.baseClassName,d=a.maybePostfixModifierPosition,p=r(d?f.substring(0,d):f),m=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=wk(u).join(":"),x=c?w+Gx:w;return{isTailwindClass:!0,modifierId:x,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var a=l.modifierId,u=l.classGroupId,c=l.hasPostfixModifier,f=a+u;return o.has(f)?!1:(o.add(f),i(u,c).forEach(function(d){return o.add(a+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function Nk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$k=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Xp=e=>{const t=$k(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Uk=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 Vk={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 Hk=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...a},u)=>g.createElement("svg",{ref:u,...Vk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yx("lucide",i),...!o&&!Uk(a)&&{"aria-hidden":"true"},...a},[...l.map(([c,f])=>g.createElement(c,f)),...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=g.forwardRef(({className:r,...i},o)=>g.createElement(Hk,{ref:o,iconNode:t,className:Yx(`lucide-${Bk(Xp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Xp(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 Wk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gk=te("arrow-left",Wk);/** * @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 Kk=[["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"}]],Qk=te("award",Kk);/** * @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 Yk=[["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"}]],ra=te("book-open",Yk);/** * @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 Xk=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],qk=te("bookmark",Xk);/** * @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 Jk=[["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"}]],ti=te("bot",Jk);/** * @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 Zk=[["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"}]],Er=te("brain",Zk);/** * @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 eN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],tN=te("check",eN);/** * @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 nN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xx=te("chevron-down",nN);/** * @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 rN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],qp=te("chevron-left",rN);/** * @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 iN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jp=te("chevron-right",iN);/** * @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 oN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lN=te("chevron-up",oN);/** * @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 sN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aN=te("circle-check-big",sN);/** * @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 uN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ps=te("cloud",uN);/** * @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 cN=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],qx=te("crown",cN);/** * @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 dN=[["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"}]],fN=te("download",dN);/** * @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 pN=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],mN=te("eye",pN);/** * @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 hN=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],gN=te("file",hN);/** * @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 xN=[["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"}]],Jx=te("hard-drive",xN);/** * @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 yN=[["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"}]],vN=te("heart",yN);/** * @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 wN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Zx=te("info",wN);/** * @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 SN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xc=te("loader-circle",SN);/** * @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 bN=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Ud=te("menu",bN);/** * @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 kN=[["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"}]],ia=te("message-square",kN);/** * @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 NN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ts=te("plus",NN);/** * @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 CN=[["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"}]],ey=te("save",CN);/** * @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 jN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Zp=te("search",jN);/** * @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 EN=[["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"}]],PN=te("send",EN);/** * @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 TN=[["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"}]],AN=te("server",TN);/** * @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 _N=[["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"}]],ui=te("settings",_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 IN=[["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"}]],em=te("shield",IN);/** * @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 RN=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],MN=te("sliders-vertical",RN);/** * @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 LN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ON=te("square",LN);/** * @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 DN=[["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"}]],zN=te("star",DN);/** * @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 FN=[["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"}]],ty=te("trash-2",FN);/** * @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 BN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ny=te("trending-up",BN);/** * @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 $N=[["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"}]],UN=te("upload",$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 VN=[["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"}]],Vd=te("user",VN);/** * @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 HN=[["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"}]],WN=te("users",HN);/** * @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 GN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ry=te("x",GN);/** * @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 KN=[["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"}]],yc=te("zap",KN),QN=[{name:"Templates",href:"/templates",icon:Er,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:ia,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:ra,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:ui,description:"Application settings"}];function YN(){const e=Ko();return s.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[s.jsx("div",{className:"p-6 border-b",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:s.jsx(Er,{className:"h-5 w-5 text-primary-foreground"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),s.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[s.jsx("div",{children:s.jsxs(Hp,{to:"/",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent text-muted-foreground hover:text-foreground",children:[s.jsx(Gk,{className:"h-4 w-4"}),s.jsx("span",{children:"Back to Home"})]})}),s.jsxs("div",{children:[s.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),s.jsx("nav",{className:"space-y-1",children:QN.map(t=>{const n=e.pathname===t.href;return s.jsxs(Hp,{to:t.href,className:ce("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:[s.jsx(t.icon,{className:"h-4 w-4"}),s.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})]})]})}function XN(){return s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx("div",{className:"w-64 border-r",children:s.jsx(YN,{})}),s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Zb,{})})]})}function tm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=tm(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,a=g.Children.toArray(o),u=a.find(eC);if(u){const c=u.props.children,f=a.map(d=>d===u?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return s.jsx(t,{...l,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,f):null})}return s.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var qN=ki("Slot");function JN(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=nC(i),a=tC(o,i.props);return i.type!==g.Fragment&&(a.ref=r?iy(r,l):l),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oy=Symbol("radix.slottable");function ZN(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=oy,t}function eC(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oy}function tC(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]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function nC(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 nm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rm=Vx,Hd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return rm(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 f=n==null?void 0:n[c],d=o==null?void 0:o[c];if(f===null)return null;const p=nm(f)||nm(d);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[d,p]=f;return p===void 0||(c[d]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(w=>{let[x,S]=w;return Array.isArray(S)?S.includes({...o,...a}[x]):{...o,...a}[x]===S})?[...c,d,p]:c},[]);return rm(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},Wd=Hd("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"}}),J=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?qN:"button";return s.jsx(l,{className:ce(Wd({variant:t,size:n,className:e})),ref:o,...i})});J.displayName="Button";function rC(){const e=Lr();return s.jsxs("div",{className:"min-h-screen bg-white",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:t=>{console.error("Logo failed to load"),t.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Technology"}),s.jsx("button",{onClick:()=>e("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>e("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Ud,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"relative py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("div",{className:"relative mb-6",children:s.jsxs("h1",{className:"text-4xl md:text-6xl lg:text-7xl font-bold text-black leading-tight",children:["Offline AI that",s.jsx("br",{}),"works where the",s.jsx("br",{}),"cloud cannot"]})}),s.jsx("p",{className:"text-lg md:text-xl text-purple-700 font-semibold mb-8 max-w-3xl mx-auto",children:"AI that stays reliable, private, and resilient in any environment"}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-12",children:[s.jsx(J,{size:"lg",className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3 text-lg font-medium",onClick:()=>e("/usecases"),children:"Learn More"}),s.jsx(J,{size:"lg",variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-8 py-3 text-lg font-medium",onClick:()=>e("/mydevice"),children:"I already have a device"})]})]})}),s.jsx("div",{className:"py-12 px-4 sm:px-6 lg:px-8 bg-gray-50",children:s.jsx("div",{className:"max-w-6xl mx-auto",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/24h.png",alt:"24/7 Available",className:"h-10 w-10",onError:t=>{console.error("24h icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Always Available"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud AI fails without internet. Our offline AI runs fully on-device, ready to assist anywhere — from airplanes to remote mountains."})]}),s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/privacy.png",alt:"Privacy & Security",className:"h-10 w-10",onError:t=>{console.error("Privacy icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Privacy & Security"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud AI requires uploading sensitive data. Offline AI keeps all processing local, protecting personal privacy and enterprise security."})]}),s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/reliablity.png",alt:"Reliability",className:"h-10 w-10",onError:t=>{console.error("Reliability icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Reliability"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud latency can cost lives in emergencies. Offline AI responds instantly, built for survival, healthcare, and safety-critical moments."})]})]})})}),s.jsx("footer",{className:"bg-white text-gray-600 py-8 px-4 sm:px-6 lg:px-8 border-t border-gray-200",children:s.jsxs("div",{className:"max-w-6xl mx-auto text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-12 w-12",onError:t=>{console.error("Footer logo failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("p",{className:"text-gray-600 mb-6",children:"Need help? Contact us to get customized device and services"}),s.jsxs("div",{className:"flex justify-center space-x-6",children:[s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Privacy Policy"}),s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Terms of Service"}),s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Support"})]})]})})]})}const iC=Hd("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 xe({className:e,variant:t,...n}){return s.jsx("div",{className:ce(iC({variant:t}),e),...n})}const Ie=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ie.displayName="Card";const Mt=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",e),...t}));Mt.displayName="CardHeader";const Lt=g.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));Lt.displayName="CardTitle";const oC=g.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));oC.displayName="CardDescription";const Ye=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));Ye.displayName="CardContent";const lC=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));lC.displayName="CardFooter";function sC(){const[e,t]=g.useState("Hardware"),n=Lr();return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:r=>{console.error("Logo failed to load"),r.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("button",{onClick:()=>n("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Technology"}),s.jsx("button",{onClick:()=>n("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>n("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Ud,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"py-24 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Our Technology"}),s.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-8",children:"Low-cost FPGA-based design, optimized for Large Language Models on-device."}),s.jsx("div",{className:"flex justify-center mb-12",children:s.jsx("div",{className:"bg-white rounded-lg p-1 shadow-sm",children:["Hardware","Software"].map(r=>s.jsx("button",{onClick:()=>t(r),className:`px-6 py-2 rounded-md text-sm font-medium transition-all ${e===r?"bg-purple-600 text-white":"text-gray-700 hover:text-purple-600"}`,children:r},r))})})]})}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[e==="Hardware"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Hardware Description"}),s.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"EdgeMate is an ultra–low-budget single-board computer designed specifically for large language model (LLM) deployment. Despite its compact form factor and low power consumption, we provide:"}),s.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Accelerated inference performance — delivering up to 15 tokens per second on a 30B model, thanks to its optimized FPGA-based AI engine."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"High memory capacity — up to 40GB RAM, enabling hosting of LLMs up to ≥30B parameters."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Cost efficiency — making advanced AI workloads accessible at low cost."]})]})]}),s.jsx(Ie,{className:"bg-gradient-to-br from-purple-50 to-blue-50 border-0 shadow-lg",children:s.jsx(Ye,{className:"p-8 space-y-6",children:s.jsxs("div",{className:"flex flex-col space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Chip"}),s.jsx("span",{className:"text-base text-gray-700",children:"AMD Zynq UltraScale+ XCZU3EG"})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Processor"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Quad-core 64-bit Arm Cortex-A53 CPU"}),s.jsx("div",{children:"Dual-core 64-bit Arm Cortex-R5 CPU"}),s.jsx("div",{children:"ARM Mali-400 GPU"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"FPGA Fabric"}),s.jsx("span",{className:"text-base text-gray-700",children:"70K LUT, 360 DSP slices"})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Memory"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"8 GB 64-bit DDR4 (2400 Mbps) on CPU side"}),s.jsx("div",{children:"8 GB / 16 GB / 32 GB DDR4 (2133 Mbps) on FPGA side (SODIMM)"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Storage"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"256 GB PCIe 2.0 x1 NVMe SSD"}),s.jsx("div",{children:"MicroSD card slot"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"I/O"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"USB 2.0 / 3.0 via Type-C"}),s.jsx("div",{children:"Mini DisplayPort"})]})]})]})})})]}),e==="Software"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Software Stack"}),s.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"Our comprehensive software ecosystem is designed to maximize the potential of EdgeMate hardware, providing seamless LLM deployment and management capabilities:"}),s.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Custom FPGA-optimized inference engine with quantization support for efficient model deployment."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Edge LLM Platform — intuitive web interface for model management, chat, and system monitoring."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Support for popular model formats (GGUF, ONNX) and frameworks (Transformers, LLaMA.cpp)."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"REST API for seamless integration with existing applications and services."]})]})]}),s.jsx(Ie,{className:"bg-gradient-to-br from-green-50 to-blue-50 border-0 shadow-lg",children:s.jsx(Ye,{className:"p-8 space-y-6",children:s.jsxs("div",{className:"flex flex-col space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"OS Support"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Ubuntu 22.04 LTS"}),s.jsx("div",{children:"Custom Linux Distribution"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Model Formats"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"GGUF (LLaMA.cpp)"}),s.jsx("div",{children:"ONNX"}),s.jsx("div",{children:"PyTorch"}),s.jsx("div",{children:"Transformers"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Inference Engine"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Custom FPGA Accelerator"}),s.jsx("div",{children:"LLaMA.cpp Integration"}),s.jsx("div",{children:"Quantization Support"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Management Interface"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Web-based Dashboard"}),s.jsx("div",{children:"REST API"}),s.jsx("div",{children:"CLI Tools"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Development Tools"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Python SDK"}),s.jsx("div",{children:"Model Optimization Tools"}),s.jsx("div",{children:"Performance Profiler"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Security"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Secure Boot"}),s.jsx("div",{children:"Model Encryption"}),s.jsx("div",{children:"Access Control"})]})]})]})})})]})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"Why us?"}),s.jsxs("div",{className:"bg-white rounded-3xl shadow-xl overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-4 bg-gradient-to-r from-gray-50 to-gray-100",children:[s.jsx("div",{className:"p-6"}),s.jsx("div",{className:"p-6 text-center",children:s.jsx(xe,{className:"bg-purple-600 text-white font-bold px-4 py-2",children:"Ours"})}),s.jsx("div",{className:"p-6 text-center",children:s.jsx("span",{className:"font-bold text-gray-800",children:"Raspberry Pi 5"})}),s.jsx("div",{className:"p-6 text-center",children:s.jsx("span",{className:"font-bold text-gray-800",children:"Jetson Orin Nano"})})]}),[{label:"Price",ours:"$199",pi:"$120",jetson:"$249"},{label:"RAM",ours:"24GB/40GB",pi:"16GB",jetson:"8GB"},{label:"CPU",ours:"Cortex-A53",pi:"Cortex-A72",jetson:"Cortex-A78"},{label:"AI Engine",ours:"Optimized Accelerator on FPGA",pi:"Neon SIMD Instructions",jetson:"Cuda/Tensor Core"},{label:"Power",ours:"<10W",pi:"5-12 W",jetson:"7-25"},{label:"LLM decode Performance",ours:"15 tokens/s",pi:"<5 tokens/s",jetson:"15 tokens/s"}].map((r,i)=>s.jsxs("div",{className:`grid grid-cols-4 ${i%2===0?"bg-gray-50":"bg-white"}`,children:[s.jsx("div",{className:"p-4 font-medium text-gray-900 border-r border-gray-200",children:r.label}),s.jsx("div",{className:"p-4 text-center text-white bg-purple-600 font-medium",children:r.ours}),s.jsx("div",{className:"p-4 text-center text-purple-600 font-medium border-r border-gray-200",children:r.pi}),s.jsx("div",{className:"p-4 text-center text-purple-600 font-medium",children:r.jetson})]},r.label))]}),s.jsx("div",{className:"text-center mt-8",children:s.jsx(J,{onClick:()=>n("/usecases"),className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",children:"View use cases"})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"The device layout plan"}),s.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 text-center",children:[s.jsx("div",{className:"relative max-w-4xl mx-auto",children:s.jsx("img",{src:"/assets/chips.png",alt:"Device Layout Plan",className:"w-full h-auto rounded-lg shadow-lg",onError:r=>{console.error("Chips image failed to load"),r.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"flex justify-center space-x-4 mt-8",children:[s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white px-6 py-2",children:"Get your device"}),s.jsx(J,{variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-6 py-2",children:"View use cases"})]})]}),s.jsx("p",{className:"text-center text-gray-600 mt-6",children:"Need help? Contact us to get customized device and services"})]})]})}function aC(){const e=Lr(),t=[{id:1,category:"Use case 1: Outdoor Rescue",title:"Offline AI that guides survival in extreme environments",description:"When hikers, travelers, or drivers lose connection to mountains, forests, or rural roads, cloud AI systems can't offer real-time survival guidance, first aid tips, and emergency signaling — even without internet. Includes moments, it becomes your reliable voice of calm and safety.",image:"/api/placeholder/336/240",bgColor:"from-blue-100 to-purple-100"},{id:2,category:"Use case 2: Offline Healthcare",title:"A simple device for seniors to access trusted medical guidance",description:"Many elderly users struggle with smartphones and digital devices. Our simple, voice-only need to press a button or speak a request to get clear, step-by-step medical advice. No internet, no accounts, no complicated setup — just instant, private support for everyday health concerns that helps.",image:"/api/placeholder/336/240",bgColor:"from-green-100 to-blue-100"},{id:3,category:"Use case 3: AI Companion and Assistance",title:"A private, always-available conversational partner",description:"Life can be stressful and lonely at times. Our Offline AI device can be embedded inside a plush toy, transforming it into a private, always-available companion. It listens, talks, tells stories without uploading data to the cloud. AI partner that brings warmth, reassurance, and practical help whenever you need it.",image:"/api/placeholder/336/240",bgColor:"from-purple-100 to-pink-100"}];return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:n=>{console.error("Logo failed to load"),n.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("button",{onClick:()=>e("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Technology"}),s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>e("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Ud,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"py-24 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Use Case Examples"}),s.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-10",children:"Bringing intelligent computing to the edge of connectivity"})]})}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((n,r)=>s.jsx(Ie,{className:"bg-white shadow-lg border-0 rounded-3xl overflow-hidden h-full flex flex-col",children:s.jsxs(Ye,{className:"p-6 flex flex-col h-full",children:[s.jsx("div",{className:"w-full h-60 rounded-xl mb-6 overflow-hidden",children:s.jsx("img",{src:`/assets/${r===0?"outdoor_rescue.png":r===1?"health_care.png":"companion.png"}`,alt:n.title,className:"w-full h-full object-cover",onError:i=>{console.error(`Failed to load image for use case ${r+1}`),i.currentTarget.style.display="none";const o=document.createElement("div");o.className="w-full h-60 bg-gradient-to-br from-gray-200 to-gray-300 rounded-xl flex items-center justify-center",r===0?o.innerHTML='':r===1?o.innerHTML='':o.innerHTML='',i.currentTarget.parentNode&&i.currentTarget.parentNode.appendChild(o)}})}),s.jsxs("div",{className:"flex flex-col flex-grow space-y-4",children:[s.jsx("div",{className:"text-sm font-semibold text-purple-600",children:n.category}),s.jsx("h3",{className:"text-xl font-semibold text-black leading-tight",children:n.title}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed flex-grow",children:n.description}),s.jsx("div",{className:"pt-4",children:s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white text-sm px-4 py-2 w-auto",onClick:()=>{let i="";n.id===1?i="outdoor-rescue":n.id===2?i="offline-healthcare":n.id===3&&(i="ai-companion"),i&&localStorage.setItem("selectedUseCase",i),e("/mydevice")},children:"Select"})})]})]})},n.id))})}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-400/30 via-blue-500/30 to-pink-500/30 backdrop-blur-sm rounded-3xl"}),s.jsxs("div",{className:"relative bg-purple-400/20 backdrop-blur-lg rounded-3xl p-8 text-center",children:[s.jsx("div",{className:"flex justify-center mb-6 space-x-1",children:[...Array(20)].map((n,r)=>s.jsx("div",{className:"bg-purple-600 rounded-full animate-pulse",style:{width:"3px",height:`${Math.random()*40+10}px`,animationDelay:`${r*.1}s`,animationDuration:"1s"}},r))}),s.jsx("h2",{className:"text-2xl font-medium text-white mb-4",children:"Customize your own device"}),s.jsx("p",{className:"text-gray-900 mb-6",children:"Need help? Contact us to get customized device and services"}),s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",onClick:()=>e("/mydevice"),children:"Get Started"})]})]})})]})}const ni=g.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:ce("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}));ni.displayName="Input";var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=uC.reduce((e,t)=>{const n=ki(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...a}=i,u=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cC(e,t){e&&_i.flushSync(()=>e.dispatchEvent(t))}var dC="Label",ly=g.forwardRef((e,t)=>s.jsx(le.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())}}));ly.displayName=dC;var sy=ly;const fC=Hd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Te=g.forwardRef(({className:e,...t},n)=>s.jsx(sy,{ref:n,className:ce(fC(),e),...t}));Te.displayName=sy.displayName;const Gd=g.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ce("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}));Gd.displayName="Textarea";function As(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 pC(e,t){const n=g.createContext(t),r=o=>{const{children:l,...a}=o,u=g.useMemo(()=>a,Object.values(a));return s.jsx(n.Provider,{value:u,children:l})};r.displayName=e+"Provider";function i(o){const l=g.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 sr(e,t=[]){let n=[];function r(o,l){const a=g.createContext(l),u=n.length;n=[...n,l];const c=d=>{var y;const{scope:p,children:m,...w}=d,x=((y=p==null?void 0:p[e])==null?void 0:y[u])||a,S=g.useMemo(()=>w,Object.values(w));return s.jsx(x.Provider,{value:S,children:m})};c.displayName=o+"Provider";function f(d,p){var x;const m=((x=p==null?void 0:p[e])==null?void 0:x[u])||a,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(a){const u=(a==null?void 0:a[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,mC(i,...t)]}function mC(...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((a,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Kd(e){const t=e+"CollectionProvider",[n,r]=sr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:S,children:y}=x,h=Ht.useRef(null),v=Ht.useRef(new Map).current;return s.jsx(i,{scope:S,itemMap:v,collectionRef:h,children:y})};l.displayName=t;const a=e+"CollectionSlot",u=ki(a),c=Ht.forwardRef((x,S)=>{const{scope:y,children:h}=x,v=o(a,y),k=ve(S,v.collectionRef);return s.jsx(u,{ref:k,children:h})});c.displayName=a;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=ki(f),m=Ht.forwardRef((x,S)=>{const{scope:y,children:h,...v}=x,k=Ht.useRef(null),j=ve(S,k),C=o(f,y);return Ht.useEffect(()=>(C.itemMap.set(k,{ref:k,...v}),()=>void C.itemMap.delete(k))),s.jsx(p,{[d]:"",ref:j,children:h})});m.displayName=f;function w(x){const S=o(e+"CollectionConsumer",x);return Ht.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:m},w,r]}var hC=g.createContext(void 0);function oa(e){const t=g.useContext(hC);return e||t||"ltr"}function er(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function gC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e);g.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 xC="DismissableLayer",vc="dismissableLayer.update",yC="dismissableLayer.pointerDownOutside",vC="dismissableLayer.focusOutside",im,ay=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...u}=e,c=g.useContext(ay),[f,d]=g.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=ve(t,E=>d(E)),x=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=x.indexOf(S),h=f?x.indexOf(f):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=h>=y,j=bC(E=>{const T=E.target,z=[...c.branches].some(L=>L.contains(T));!k||z||(i==null||i(E),l==null||l(E),E.defaultPrevented||a==null||a())},p),C=kC(E=>{const T=E.target;[...c.branches].some(L=>L.contains(T))||(o==null||o(E),l==null||l(E),E.defaultPrevented||a==null||a())},p);return gC(E=>{h===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},p),g.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(im=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),om(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=im)}},[f,p,n,c]),g.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),om())},[f,c]),g.useEffect(()=>{const E=()=>m({});return document.addEventListener(vc,E),()=>document.removeEventListener(vc,E)},[]),s.jsx(le.div,{...u,ref:w,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,j.onPointerDownCapture)})});Qd.displayName=xC;var wC="DismissableLayerBranch",SC=g.forwardRef((e,t)=>{const n=g.useContext(ay),r=g.useRef(null),i=ve(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(le.div,{...e,ref:i})});SC.displayName=wC;function bC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){uy(yC,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 kC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&uy(vC,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 om(){const e=new CustomEvent(vc);document.dispatchEvent(e)}function uy(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?cC(i,o):i.dispatchEvent(o)}var Xa=0;function cy(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lm()),document.body.insertAdjacentElement("beforeend",e[1]??lm()),Xa++,()=>{Xa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xa--}},[])}function lm(){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 qa="focusScope.autoFocusOnMount",Ja="focusScope.autoFocusOnUnmount",sm={bubbles:!1,cancelable:!0},NC="FocusScope",Yd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[a,u]=g.useState(null),c=er(i),f=er(o),d=g.useRef(null),p=ve(t,x=>u(x)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let x=function(v){if(m.paused||!a)return;const k=v.target;a.contains(k)?d.current=k:Mn(d.current,{select:!0})},S=function(v){if(m.paused||!a)return;const k=v.relatedTarget;k!==null&&(a.contains(k)||Mn(d.current,{select:!0}))},y=function(v){if(document.activeElement===document.body)for(const j of v)j.removedNodes.length>0&&Mn(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",S);const h=new MutationObserver(y);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),h.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){um.add(m);const x=document.activeElement;if(!a.contains(x)){const y=new CustomEvent(qa,sm);a.addEventListener(qa,c),a.dispatchEvent(y),y.defaultPrevented||(CC(AC(dy(a)),{select:!0}),document.activeElement===x&&Mn(a))}return()=>{a.removeEventListener(qa,c),setTimeout(()=>{const y=new CustomEvent(Ja,sm);a.addEventListener(Ja,f),a.dispatchEvent(y),y.defaultPrevented||Mn(x??document.body,{select:!0}),a.removeEventListener(Ja,f),um.remove(m)},0)}}},[a,c,f,m]);const w=g.useCallback(x=>{if(!n&&!r||m.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,y=document.activeElement;if(S&&y){const h=x.currentTarget,[v,k]=jC(h);v&&k?!x.shiftKey&&y===k?(x.preventDefault(),n&&Mn(v,{select:!0})):x.shiftKey&&y===v&&(x.preventDefault(),n&&Mn(k,{select:!0})):y===h&&x.preventDefault()}},[n,r,m.paused]);return s.jsx(le.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Yd.displayName=NC;function CC(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mn(r,{select:t}),document.activeElement!==n)return}function jC(e){const t=dy(e),n=am(t,e),r=am(t.reverse(),e);return[n,r]}function dy(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 am(e,t){for(const n of e)if(!EC(n,{upTo:t}))return n}function EC(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 PC(e){return e instanceof HTMLInputElement&&"select"in e}function Mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PC(e)&&t&&e.select()}}var um=TC();function TC(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cm(e,t),e.unshift(t)},remove(t){var n;e=cm(e,t),(n=e[0])==null||n.resume()}}}function cm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function AC(e){return e.filter(t=>t.tagName!=="A")}var tt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},_C=Qc[" useId ".trim().toString()]||(()=>{}),IC=0;function qn(e){const[t,n]=g.useState(_C());return tt(()=>{e||n(r=>r??String(IC++))},[e]),e||(t?`radix-${t}`:"")}const RC=["top","right","bottom","left"],tr=Math.min,wt=Math.max,_s=Math.round,wl=Math.floor,pn=e=>({x:e,y:e}),MC={left:"right",right:"left",bottom:"top",top:"bottom"},LC={start:"end",end:"start"};function wc(e,t,n){return wt(e,tr(t,n))}function En(e,t){return typeof e=="function"?e(t):e}function Pn(e){return e.split("-")[0]}function Ri(e){return e.split("-")[1]}function Xd(e){return e==="x"?"y":"x"}function qd(e){return e==="y"?"height":"width"}const OC=new Set(["top","bottom"]);function cn(e){return OC.has(Pn(e))?"y":"x"}function Jd(e){return Xd(cn(e))}function DC(e,t,n){n===void 0&&(n=!1);const r=Ri(e),i=Jd(e),o=qd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Is(l)),[l,Is(l)]}function zC(e){const t=Is(e);return[Sc(e),t,Sc(t)]}function Sc(e){return e.replace(/start|end/g,t=>LC[t])}const dm=["left","right"],fm=["right","left"],FC=["top","bottom"],BC=["bottom","top"];function $C(e,t,n){switch(e){case"top":case"bottom":return n?t?fm:dm:t?dm:fm;case"left":case"right":return t?FC:BC;default:return[]}}function UC(e,t,n,r){const i=Ri(e);let o=$C(Pn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Sc)))),o}function Is(e){return e.replace(/left|right|bottom|top/g,t=>MC[t])}function VC(e){return{top:0,right:0,bottom:0,left:0,...e}}function fy(e){return typeof e!="number"?VC(e):{top:e,right:e,bottom:e,left:e}}function Rs(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 pm(e,t,n){let{reference:r,floating:i}=e;const o=cn(t),l=Jd(t),a=qd(l),u=Pn(t),c=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ri(t)){case"start":m[l]-=p*(n&&c?-1:1);break;case"end":m[l]+=p*(n&&c?-1:1);break}return m}const HC=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=o.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=pm(c,r,u),p=r,m={},w=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=En(e,t)||{};if(c==null)return{};const d=fy(f),p={x:n,y:r},m=Jd(i),w=qd(m),x=await l.getDimensions(c),S=m==="y",y=S?"top":"left",h=S?"bottom":"right",v=S?"clientHeight":"clientWidth",k=o.reference[w]+o.reference[m]-p[m]-o.floating[w],j=p[m]-o.reference[m],C=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let E=C?C[v]:0;(!E||!await(l.isElement==null?void 0:l.isElement(C)))&&(E=a.floating[v]||o.floating[w]);const T=k/2-j/2,z=E/2-x[w]/2-1,L=tr(d[y],z),I=tr(d[h],z),P=L,R=E-x[w]-I,W=E/2-x[w]/2+T,M=wc(P,W,R),O=!u.arrow&&Ri(i)!=null&&W!==M&&o.reference[w]/2-(WW<=0)){var I,P;const W=(((I=o.flip)==null?void 0:I.index)||0)+1,M=E[W];if(M&&(!(d==="alignment"?h!==cn(M):!1)||L.every(A=>cn(A.placement)===h?A.overflows[0]>0:!0)))return{data:{index:W,overflows:L},reset:{placement:M}};let O=(P=L.filter($=>$.overflows[0]<=0).sort(($,A)=>$.overflows[1]-A.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(m){case"bestFit":{var R;const $=(R=L.filter(A=>{if(C){const F=cn(A.placement);return F===h||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,b)=>F+b,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:R[0];$&&(O=$);break}case"initialPlacement":O=a;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function mm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hm(e){return RC.some(t=>e[t]>=0)}const KC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=En(e,t);switch(r){case"referenceHidden":{const o=await Lo(t,{...i,elementContext:"reference"}),l=mm(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:hm(l)}}}case"escaped":{const o=await Lo(t,{...i,altBoundary:!0}),l=mm(o,n.floating);return{data:{escapedOffsets:l,escaped:hm(l)}}}default:return{}}}}},py=new Set(["left","top"]);async function QC(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Pn(n),a=Ri(n),u=cn(n)==="y",c=py.has(l)?-1:1,f=o&&u?-1:1,d=En(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(m=a==="end"?w*-1:w),u?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const YC=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:a}=t,u=await QC(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:l}}}}},XC=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:a={fn:S=>{let{x:y,y:h}=S;return{x:y,y:h}}},...u}=En(e,t),c={x:n,y:r},f=await Lo(t,u),d=cn(Pn(i)),p=Xd(d);let m=c[p],w=c[d];if(o){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",h=m+f[S],v=m-f[y];m=wc(h,m,v)}if(l){const S=d==="y"?"top":"left",y=d==="y"?"bottom":"right",h=w+f[S],v=w-f[y];w=wc(h,w,v)}const x=a.fn({...t,[p]:m,[d]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[d]:l}}}}}},qC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=En(e,t),f={x:n,y:r},d=cn(i),p=Xd(d);let m=f[p],w=f[d];const x=En(a,t),S=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const v=p==="y"?"height":"width",k=o.reference[p]-o.floating[v]+S.mainAxis,j=o.reference[p]+o.reference[v]-S.mainAxis;mj&&(m=j)}if(c){var y,h;const v=p==="y"?"width":"height",k=py.has(Pn(i)),j=o.reference[d]-o.floating[v]+(k&&((y=l.offset)==null?void 0:y[d])||0)+(k?0:S.crossAxis),C=o.reference[d]+o.reference[v]+(k?0:((h=l.offset)==null?void 0:h[d])||0)-(k?S.crossAxis:0);wC&&(w=C)}return{[p]:m,[d]:w}}}},JC=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:a}=t,{apply:u=()=>{},...c}=En(e,t),f=await Lo(t,c),d=Pn(i),p=Ri(i),m=cn(i)==="y",{width:w,height:x}=o.floating;let S,y;d==="top"||d==="bottom"?(S=d,y=p===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,S=p==="end"?"top":"bottom");const h=x-f.top-f.bottom,v=w-f.left-f.right,k=tr(x-f[S],h),j=tr(w-f[y],v),C=!t.middlewareData.shift;let E=k,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=h),C&&!p){const L=wt(f.left,0),I=wt(f.right,0),P=wt(f.top,0),R=wt(f.bottom,0);m?T=w-2*(L!==0||I!==0?L+I:wt(f.left,f.right)):E=x-2*(P!==0||R!==0?P+R:wt(f.top,f.bottom))}await u({...t,availableWidth:T,availableHeight:E});const z=await l.getDimensions(a.floating);return w!==z.width||x!==z.height?{reset:{rects:!0}}:{}}}};function la(){return typeof window<"u"}function Mi(e){return my(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gn(e){var t;return(t=(my(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function my(e){return la()?e instanceof Node||e instanceof Ct(e).Node:!1}function Xt(e){return la()?e instanceof Element||e instanceof Ct(e).Element:!1}function mn(e){return la()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function gm(e){return!la()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}const ZC=new Set(["inline","contents"]);function Qo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ZC.has(i)}const ej=new Set(["table","td","th"]);function tj(e){return ej.has(Mi(e))}const nj=[":popover-open",":modal"];function sa(e){return nj.some(t=>{try{return e.matches(t)}catch{return!1}})}const rj=["transform","translate","scale","rotate","perspective"],ij=["transform","translate","scale","rotate","perspective","filter"],oj=["paint","layout","strict","content"];function Zd(e){const t=ef(),n=Xt(e)?qt(e):e;return rj.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)||ij.some(r=>(n.willChange||"").includes(r))||oj.some(r=>(n.contain||"").includes(r))}function lj(e){let t=nr(e);for(;mn(t)&&!Ni(t);){if(Zd(t))return t;if(sa(t))return null;t=nr(t)}return null}function ef(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sj=new Set(["html","body","#document"]);function Ni(e){return sj.has(Mi(e))}function qt(e){return Ct(e).getComputedStyle(e)}function aa(e){return Xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nr(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gm(e)&&e.host||gn(e);return gm(t)?t.host:t}function hy(e){const t=nr(e);return Ni(t)?e.ownerDocument?e.ownerDocument.body:e.body:mn(t)&&Qo(t)?t:hy(t)}function Oo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hy(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Ct(i);if(o){const a=bc(l);return t.concat(l,l.visualViewport||[],Qo(i)?i:[],a&&n?Oo(a):[])}return t.concat(i,Oo(i,[],n))}function bc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gy(e){const t=qt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=mn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=_s(n)!==o||_s(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function tf(e){return Xt(e)?e:e.contextElement}function ci(e){const t=tf(e);if(!mn(t))return pn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gy(t);let l=(o?_s(n.width):n.width)/r,a=(o?_s(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const aj=pn(0);function xy(e){const t=Ct(e);return!ef()||!t.visualViewport?aj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ct(e)?!1:t}function Pr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=tf(e);let l=pn(1);t&&(r?Xt(r)&&(l=ci(r)):l=ci(e));const a=uj(o,n,r)?xy(o):pn(0);let u=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=Ct(o),m=r&&Xt(r)?Ct(r):r;let w=p,x=bc(w);for(;x&&r&&m!==w;){const S=ci(x),y=x.getBoundingClientRect(),h=qt(x),v=y.left+(x.clientLeft+parseFloat(h.paddingLeft))*S.x,k=y.top+(x.clientTop+parseFloat(h.paddingTop))*S.y;u*=S.x,c*=S.y,f*=S.x,d*=S.y,u+=v,c+=k,w=Ct(x),x=bc(w)}}return Rs({width:f,height:d,x:u,y:c})}function ua(e,t){const n=aa(e).scrollLeft;return t?t.left+n:Pr(gn(e)).left+n}function yy(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ua(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function cj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=gn(r),a=t?sa(t.floating):!1;if(r===l||a&&o)return n;let u={scrollLeft:0,scrollTop:0},c=pn(1);const f=pn(0),d=mn(r);if((d||!d&&!o)&&((Mi(r)!=="body"||Qo(l))&&(u=aa(r)),mn(r))){const m=Pr(r);c=ci(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=l&&!d&&!o?yy(l,u):pn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-u.scrollTop*c.y+f.y+p.y}}function dj(e){return Array.from(e.getClientRects())}function fj(e){const t=gn(e),n=aa(e),r=e.ownerDocument.body,i=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ua(e);const a=-n.scrollTop;return qt(r).direction==="rtl"&&(l+=wt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}const xm=25;function pj(e,t){const n=Ct(e),r=gn(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,a=0,u=0;if(i){o=i.width,l=i.height;const f=ef();(!f||f&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}const c=ua(r);if(c<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-m);w<=xm&&(o-=w)}else c<=xm&&(o+=c);return{width:o,height:l,x:a,y:u}}const mj=new Set(["absolute","fixed"]);function hj(e,t){const n=Pr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=mn(e)?ci(e):pn(1),l=e.clientWidth*o.x,a=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:l,height:a,x:u,y:c}}function ym(e,t,n){let r;if(t==="viewport")r=pj(e,n);else if(t==="document")r=fj(gn(e));else if(Xt(t))r=hj(t,n);else{const i=xy(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Rs(r)}function vy(e,t){const n=nr(e);return n===t||!Xt(n)||Ni(n)?!1:qt(n).position==="fixed"||vy(n,t)}function gj(e,t){const n=t.get(e);if(n)return n;let r=Oo(e,[],!1).filter(a=>Xt(a)&&Mi(a)!=="body"),i=null;const o=qt(e).position==="fixed";let l=o?nr(e):e;for(;Xt(l)&&!Ni(l);){const a=qt(l),u=Zd(l);!u&&a.position==="fixed"&&(i=null),(o?!u&&!i:!u&&a.position==="static"&&!!i&&mj.has(i.position)||Qo(l)&&!u&&vy(e,l))?r=r.filter(f=>f!==l):i=a,l=nr(l)}return t.set(e,r),r}function xj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?sa(t)?[]:gj(t,this._c):[].concat(n),r],a=l[0],u=l.reduce((c,f)=>{const d=ym(t,f,i);return c.top=wt(d.top,c.top),c.right=tr(d.right,c.right),c.bottom=tr(d.bottom,c.bottom),c.left=wt(d.left,c.left),c},ym(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function yj(e){const{width:t,height:n}=gy(e);return{width:t,height:n}}function vj(e,t,n){const r=mn(t),i=gn(t),o=n==="fixed",l=Pr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=pn(0);function c(){u.x=ua(i)}if(r||!r&&!o)if((Mi(t)!=="body"||Qo(i))&&(a=aa(t)),r){const m=Pr(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?yy(i,a):pn(0),d=l.left+a.scrollLeft-u.x-f.x,p=l.top+a.scrollTop-u.y-f.y;return{x:d,y:p,width:l.width,height:l.height}}function Za(e){return qt(e).position==="static"}function vm(e,t){if(!mn(e)||qt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gn(e)===n&&(n=n.ownerDocument.body),n}function wy(e,t){const n=Ct(e);if(sa(e))return n;if(!mn(e)){let i=nr(e);for(;i&&!Ni(i);){if(Xt(i)&&!Za(i))return i;i=nr(i)}return n}let r=vm(e,t);for(;r&&tj(r)&&Za(r);)r=vm(r,t);return r&&Ni(r)&&Za(r)&&!Zd(r)?n:r||lj(e)||n}const wj=async function(e){const t=this.getOffsetParent||wy,n=this.getDimensions,r=await n(e.floating);return{reference:vj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sj(e){return qt(e).direction==="rtl"}const bj={convertOffsetParentRelativeRectToViewportRelativeRect:cj,getDocumentElement:gn,getClippingRect:xj,getOffsetParent:wy,getElementRects:wj,getClientRects:dj,getDimensions:yj,getScale:ci,isElement:Xt,isRTL:Sj};function Sy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kj(e,t){let n=null,r;const i=gn(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=c;if(a||t(),!p||!m)return;const w=wl(d),x=wl(i.clientWidth-(f+p)),S=wl(i.clientHeight-(d+m)),y=wl(f),v={rootMargin:-w+"px "+-x+"px "+-S+"px "+-y+"px",threshold:wt(0,tr(1,u))||1};let k=!0;function j(C){const E=C[0].intersectionRatio;if(E!==u){if(!k)return l();E?l(!1,E):r=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!Sy(c,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(j,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,v)}n.observe(e)}return l(!0),o}function Nj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=tf(e),f=i||o?[...c?Oo(c):[],...Oo(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=c&&a?kj(c,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let w,x=u?Pr(e):null;u&&S();function S(){const y=Pr(e);x&&!Sy(x,y)&&n(),x=y,w=requestAnimationFrame(S)}return n(),()=>{var y;f.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(w)}}const Cj=YC,jj=XC,Ej=GC,Pj=JC,Tj=KC,wm=WC,Aj=qC,_j=(e,t,n)=>{const r=new Map,i={platform:bj,...n},o={...i.platform,_c:r};return HC(e,t,{...i,platform:o})};var Ij=typeof document<"u",Rj=function(){},$l=Ij?g.useLayoutEffect:Rj;function Ms(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(!Ms(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)&&!Ms(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function by(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sm(e,t){const n=by(e);return Math.round(t*n)/n}function eu(e){const t=g.useRef(e);return $l(()=>{t.current=e}),t}function Mj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);Ms(p,r)||m(r);const[w,x]=g.useState(null),[S,y]=g.useState(null),h=g.useCallback(A=>{A!==C.current&&(C.current=A,x(A))},[]),v=g.useCallback(A=>{A!==E.current&&(E.current=A,y(A))},[]),k=o||w,j=l||S,C=g.useRef(null),E=g.useRef(null),T=g.useRef(f),z=u!=null,L=eu(u),I=eu(i),P=eu(c),R=g.useCallback(()=>{if(!C.current||!E.current)return;const A={placement:t,strategy:n,middleware:p};I.current&&(A.platform=I.current),_j(C.current,E.current,A).then(F=>{const b={...F,isPositioned:P.current!==!1};W.current&&!Ms(T.current,b)&&(T.current=b,_i.flushSync(()=>{d(b)}))})},[p,t,n,I,P]);$l(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[c]);const W=g.useRef(!1);$l(()=>(W.current=!0,()=>{W.current=!1}),[]),$l(()=>{if(k&&(C.current=k),j&&(E.current=j),k&&j){if(L.current)return L.current(k,j,R);R()}},[k,j,R,L,z]);const M=g.useMemo(()=>({reference:C,floating:E,setReference:h,setFloating:v}),[h,v]),O=g.useMemo(()=>({reference:k,floating:j}),[k,j]),$=g.useMemo(()=>{const A={position:n,left:0,top:0};if(!O.floating)return A;const F=Sm(O.floating,f.x),b=Sm(O.floating,f.y);return a?{...A,transform:"translate("+F+"px, "+b+"px)",...by(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:b}},[n,a,O.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:R,refs:M,elements:O,floatingStyles:$}),[f,R,M,O,$])}const Lj=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?wm({element:r.current,padding:i}).fn(n):{}:r?wm({element:r,padding:i}).fn(n):{}}}},Oj=(e,t)=>({...Cj(e),options:[e,t]}),Dj=(e,t)=>({...jj(e),options:[e,t]}),zj=(e,t)=>({...Aj(e),options:[e,t]}),Fj=(e,t)=>({...Ej(e),options:[e,t]}),Bj=(e,t)=>({...Pj(e),options:[e,t]}),$j=(e,t)=>({...Tj(e),options:[e,t]}),Uj=(e,t)=>({...Lj(e),options:[e,t]});var Vj="Arrow",ky=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return s.jsx(le.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});ky.displayName=Vj;var Hj=ky;function Ny(e){const[t,n]=g.useState(void 0);return tt(()=>{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,a;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;l=c.inlineSize,a=c.blockSize}else l=e.offsetWidth,a=e.offsetHeight;n({width:l,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var nf="Popper",[Cy,jy]=sr(nf),[Wj,Ey]=Cy(nf),Py=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return s.jsx(Wj,{scope:t,anchor:r,onAnchorChange:i,children:n})};Py.displayName=nf;var Ty="PopperAnchor",Ay=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Ey(Ty,n),l=g.useRef(null),a=ve(t,l),u=g.useRef(null);return g.useEffect(()=>{const c=u.current;u.current=(r==null?void 0:r.current)||l.current,c!==u.current&&o.onAnchorChange(u.current)}),r?null:s.jsx(le.div,{...i,ref:a})});Ay.displayName=Ty;var rf="PopperContent",[Gj,Kj]=Cy(rf),_y=g.forwardRef((e,t)=>{var K,ne,he,oe,de,me;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...x}=e,S=Ey(rf,n),[y,h]=g.useState(null),v=ve(t,He=>h(He)),[k,j]=g.useState(null),C=Ny(k),E=(C==null?void 0:C.width)??0,T=(C==null?void 0:C.height)??0,z=r+(o!=="center"?"-"+o:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(c)?c:[c],P=I.length>0,R={padding:L,boundary:I.filter(Yj),altBoundary:P},{refs:W,floatingStyles:M,placement:O,isPositioned:$,middlewareData:A}=Mj({strategy:"fixed",placement:z,whileElementsMounted:(...He)=>Nj(...He,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[Oj({mainAxis:i+T,alignmentAxis:l}),u&&Dj({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?zj():void 0,...R}),u&&Fj({...R}),Bj({...R,apply:({elements:He,rects:rt,availableWidth:Zt,availableHeight:zt})=>{const{width:en,height:Fi}=rt.reference,xn=He.floating.style;xn.setProperty("--radix-popper-available-width",`${Zt}px`),xn.setProperty("--radix-popper-available-height",`${zt}px`),xn.setProperty("--radix-popper-anchor-width",`${en}px`),xn.setProperty("--radix-popper-anchor-height",`${Fi}px`)}}),k&&Uj({element:k,padding:a}),Xj({arrowWidth:E,arrowHeight:T}),p&&$j({strategy:"referenceHidden",...R})]}),[F,b]=My(O),V=er(w);tt(()=>{$&&(V==null||V())},[$,V]);const Y=(K=A.arrow)==null?void 0:K.x,N=(ne=A.arrow)==null?void 0:ne.y,re=((he=A.arrow)==null?void 0:he.centerOffset)!==0,[fe,ie]=g.useState();return tt(()=>{y&&ie(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:$?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(oe=A.transformOrigin)==null?void 0:oe.x,(de=A.transformOrigin)==null?void 0:de.y].join(" "),...((me=A.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Gj,{scope:n,placedSide:F,onArrowChange:j,arrowX:Y,arrowY:N,shouldHideArrow:re,children:s.jsx(le.div,{"data-side":F,"data-align":b,...x,ref:v,style:{...x.style,animation:$?void 0:"none"}})})})});_y.displayName=rf;var Iy="PopperArrow",Qj={top:"bottom",right:"left",bottom:"top",left:"right"},Ry=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Kj(Iy,r),l=Qj[o.placedSide];return s.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:s.jsx(Hj,{...i,ref:n,style:{...i.style,display:"block"}})})});Ry.displayName=Iy;function Yj(e){return e!==null}var Xj=e=>({name:"transformOrigin",options:e,fn(t){var S,y,h;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,a=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[c,f]=My(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((y=i.arrow)==null?void 0:y.x)??0)+a/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+u/2;let w="",x="";return c==="bottom"?(w=l?d:`${p}px`,x=`${-u}px`):c==="top"?(w=l?d:`${p}px`,x=`${r.floating.height+u}px`):c==="right"?(w=`${-u}px`,x=l?d:`${m}px`):c==="left"&&(w=`${r.floating.width+u}px`,x=l?d:`${m}px`),{data:{x:w,y:x}}}});function My(e){const[t,n="center"]=e.split("-");return[t,n]}var qj=Py,Jj=Ay,Zj=_y,e2=Ry,t2="Portal",of=g.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=g.useState(!1);tt(()=>o(!0),[]);const l=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?ab.createPortal(s.jsx(le.div,{...r,ref:t}),l):null});of.displayName=t2;var n2=Qc[" useInsertionEffect ".trim().toString()]||tt;function Ci({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=r2({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:i;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"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.`),f.current=a},[a,r])}const c=g.useCallback(f=>{var d;if(a){const p=i2(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[a,e,o,l]);return[u,c]}function r2({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return n2(()=>{o.current=t},[t]),g.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function i2(e){return typeof e=="function"}function Ly(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy=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"}),o2="VisuallyHidden",l2=g.forwardRef((e,t)=>s.jsx(le.span,{...e,ref:t,style:{...Oy,...e.style}}));l2.displayName=o2;var s2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fr=new WeakMap,Sl=new WeakMap,bl={},tu=0,Dy=function(e){return e&&(e.host||Dy(e.parentNode))},a2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Dy(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})},u2=function(e,t,n,r){var i=a2(t,Array.isArray(e)?e:[e]);bl[n]||(bl[n]=new WeakMap);var o=bl[n],l=[],a=new Set,u=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))f(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",x=(Fr.get(p)||0)+1,S=(o.get(p)||0)+1;Fr.set(p,x),o.set(p,S),l.push(p),x===1&&w&&Sl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),a.clear(),tu++,function(){l.forEach(function(d){var p=Fr.get(d)-1,m=o.get(d)-1;Fr.set(d,p),o.set(d,m),p||(Sl.has(d)||d.removeAttribute(r),Sl.delete(d)),m||d.removeAttribute(n)}),tu--,tu||(Fr=new WeakMap,Fr=new WeakMap,Sl=new WeakMap,bl={})}},zy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||s2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),u2(r,i,n,"aria-hidden")):function(){return null}},an=function(){return an=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return j2;var t=E2(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])}},T2=Uy(),di="data-scroll-locked",A2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(d2,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(di,`] { 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(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Ul,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(Vl,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat(Ul," .").concat(Ul,` { right: 0 `).concat(r,`; } .`).concat(Vl," .").concat(Vl,` { margin-right: 0 `).concat(r,`; } body[`).concat(di,`] { `).concat(f2,": ").concat(a,`px; } `)},Nm=function(){var e=parseInt(document.body.getAttribute(di)||"0",10);return isFinite(e)?e:0},_2=function(){g.useEffect(function(){return document.body.setAttribute(di,(Nm()+1).toString()),function(){var e=Nm()-1;e<=0?document.body.removeAttribute(di):document.body.setAttribute(di,e.toString())}},[])},I2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;_2();var o=g.useMemo(function(){return P2(i)},[i]);return g.createElement(T2,{styles:A2(o,!t,i,n?"":"!important")})},kc=!1;if(typeof window<"u")try{var kl=Object.defineProperty({},"passive",{get:function(){return kc=!0,!0}});window.addEventListener("test",kl,kl),window.removeEventListener("test",kl,kl)}catch{kc=!1}var Br=kc?{passive:!1}:!1,R2=function(e){return e.tagName==="TEXTAREA"},Vy=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!R2(e)&&n[t]==="visible")},M2=function(e){return Vy(e,"overflowY")},L2=function(e){return Vy(e,"overflowX")},Cm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Hy(e,r);if(i){var o=Wy(e,r),l=o[1],a=o[2];if(l>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},O2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},D2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Hy=function(e,t){return e==="v"?M2(t):L2(t)},Wy=function(e,t){return e==="v"?O2(t):D2(t)},z2=function(e,t){return e==="h"&&t==="rtl"?-1:1},F2=function(e,t,n,r,i){var o=z2(e,window.getComputedStyle(t).direction),l=o*r,a=n.target,u=t.contains(a),c=!1,f=l>0,d=0,p=0;do{if(!a)break;var m=Wy(e,a),w=m[0],x=m[1],S=m[2],y=x-S-o*w;(w||y)&&Hy(e,a)&&(d+=y,p+=w);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(p)<1||!i&&-l>p))&&(c=!0),c},Nl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jm=function(e){return[e.deltaX,e.deltaY]},Em=function(e){return e&&"current"in e?e.current:e},B2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$2=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},U2=0,$r=[];function V2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(U2++)[0],o=g.useState(Uy)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=c2([e.lockRef.current],(e.shards||[]).map(Em),!0).filter(Boolean);return x.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(x,S){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var y=Nl(x),h=n.current,v="deltaX"in x?x.deltaX:h[0]-y[0],k="deltaY"in x?x.deltaY:h[1]-y[1],j,C=x.target,E=Math.abs(v)>Math.abs(k)?"h":"v";if("touches"in x&&E==="h"&&C.type==="range")return!1;var T=Cm(E,C);if(!T)return!0;if(T?j=E:(j=E==="v"?"h":"v",T=Cm(E,C)),!T)return!1;if(!r.current&&"changedTouches"in x&&(v||k)&&(r.current=j),!j)return!0;var z=r.current||j;return F2(z,S,x,z==="h"?v:k,!0)},[]),u=g.useCallback(function(x){var S=x;if(!(!$r.length||$r[$r.length-1]!==o)){var y="deltaY"in S?jm(S):Nl(S),h=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&B2(j.delta,y)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var v=(l.current.shards||[]).map(Em).filter(Boolean).filter(function(j){return j.contains(S.target)}),k=v.length>0?a(S,v[0]):!l.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(x,S,y,h){var v={name:x,delta:S,target:y,should:h,shadowParent:H2(y)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(k){return k!==v})},1)},[]),f=g.useCallback(function(x){n.current=Nl(x),r.current=void 0},[]),d=g.useCallback(function(x){c(x.type,jm(x),x.target,a(x,e.lockRef.current))},[]),p=g.useCallback(function(x){c(x.type,Nl(x),x.target,a(x,e.lockRef.current))},[]);g.useEffect(function(){return $r.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Br),document.addEventListener("touchmove",u,Br),document.addEventListener("touchstart",f,Br),function(){$r=$r.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,Br),document.removeEventListener("touchmove",u,Br),document.removeEventListener("touchstart",f,Br)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:$2(i)}):null,m?g.createElement(I2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const W2=v2($y,V2);var Gy=g.forwardRef(function(e,t){return g.createElement(ca,an({},e,{ref:t,sideCar:W2}))});Gy.classNames=ca.classNames;const Ky=Gy;var G2=[" ","Enter","ArrowUp","ArrowDown"],K2=[" ","Enter"],Tr="Select",[da,fa,Q2]=Kd(Tr),[Li,MR]=sr(Tr,[Q2,jy]),pa=jy(),[Y2,ar]=Li(Tr),[X2,q2]=Li(Tr),Qy=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:a,onValueChange:u,dir:c,name:f,autoComplete:d,disabled:p,required:m,form:w}=e,x=pa(t),[S,y]=g.useState(null),[h,v]=g.useState(null),[k,j]=g.useState(!1),C=oa(c),[E,T]=Ci({prop:r,defaultProp:i??!1,onChange:o,caller:Tr}),[z,L]=Ci({prop:l,defaultProp:a,onChange:u,caller:Tr}),I=g.useRef(null),P=S?w||!!S.closest("form"):!0,[R,W]=g.useState(new Set),M=Array.from(R).map(O=>O.props.value).join(";");return s.jsx(qj,{...x,children:s.jsxs(Y2,{required:m,scope:t,trigger:S,onTriggerChange:y,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:qn(),value:z,onValueChange:L,open:E,onOpenChange:T,dir:C,triggerPointerDownPosRef:I,disabled:p,children:[s.jsx(da.Provider,{scope:t,children:s.jsx(X2,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(O=>{W($=>new Set($).add(O))},[]),onNativeOptionRemove:g.useCallback(O=>{W($=>{const A=new Set($);return A.delete(O),A})},[]),children:n})}),P?s.jsxs(vv,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:z,onChange:O=>L(O.target.value),disabled:p,form:w,children:[z===void 0?s.jsx("option",{value:""}):null,Array.from(R)]},M):null]})})};Qy.displayName=Tr;var Yy="SelectTrigger",Xy=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=pa(n),l=ar(Yy,n),a=l.disabled||r,u=ve(t,l.onTriggerChange),c=fa(n),f=g.useRef("touch"),[d,p,m]=Sv(x=>{const S=c().filter(v=>!v.disabled),y=S.find(v=>v.value===l.value),h=bv(S,x,y);h!==void 0&&l.onValueChange(h.value)}),w=x=>{a||(l.onOpenChange(!0),m()),x&&(l.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return s.jsx(Jj,{asChild:!0,...o,children:s.jsx(le.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:a,"data-disabled":a?"":void 0,"data-placeholder":wv(l.value)?"":void 0,...i,ref:u,onClick:ee(i.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&w(x)}),onPointerDown:ee(i.onPointerDown,x=>{f.current=x.pointerType;const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:ee(i.onKeyDown,x=>{const S=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(S&&x.key===" ")&&G2.includes(x.key)&&(w(),x.preventDefault())})})})});Xy.displayName=Yy;var qy="SelectValue",Jy=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...a}=e,u=ar(qy,n),{onValueNodeHasChildrenChange:c}=u,f=o!==void 0,d=ve(t,u.onValueNodeChange);return tt(()=>{c(f)},[c,f]),s.jsx(le.span,{...a,ref:d,style:{pointerEvents:"none"},children:wv(u.value)?s.jsx(s.Fragment,{children:l}):o})});Jy.displayName=qy;var J2="SelectIcon",Zy=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return s.jsx(le.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Zy.displayName=J2;var Z2="SelectPortal",ev=e=>s.jsx(of,{asChild:!0,...e});ev.displayName=Z2;var Ar="SelectContent",tv=g.forwardRef((e,t)=>{const n=ar(Ar,e.__scopeSelect),[r,i]=g.useState();if(tt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?_i.createPortal(s.jsx(nv,{scope:e.__scopeSelect,children:s.jsx(da.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),o):null}return s.jsx(rv,{...e,ref:t})});tv.displayName=Ar;var Ut=10,[nv,ur]=Li(Ar),eE="SelectContentImpl",tE=ki("SelectContent.RemoveScroll"),rv=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S,...y}=e,h=ar(Ar,n),[v,k]=g.useState(null),[j,C]=g.useState(null),E=ve(t,K=>k(K)),[T,z]=g.useState(null),[L,I]=g.useState(null),P=fa(n),[R,W]=g.useState(!1),M=g.useRef(!1);g.useEffect(()=>{if(v)return zy(v)},[v]),cy();const O=g.useCallback(K=>{const[ne,...he]=P().map(me=>me.ref.current),[oe]=he.slice(-1),de=document.activeElement;for(const me of K)if(me===de||(me==null||me.scrollIntoView({block:"nearest"}),me===ne&&j&&(j.scrollTop=0),me===oe&&j&&(j.scrollTop=j.scrollHeight),me==null||me.focus(),document.activeElement!==de))return},[P,j]),$=g.useCallback(()=>O([T,v]),[O,T,v]);g.useEffect(()=>{R&&$()},[R,$]);const{onOpenChange:A,triggerPointerDownPosRef:F}=h;g.useEffect(()=>{if(v){let K={x:0,y:0};const ne=oe=>{var de,me;K={x:Math.abs(Math.round(oe.pageX)-(((de=F.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((me=F.current)==null?void 0:me.y)??0))}},he=oe=>{K.x<=10&&K.y<=10?oe.preventDefault():v.contains(oe.target)||A(!1),document.removeEventListener("pointermove",ne),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",he,{capture:!0})}}},[v,A,F]),g.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[b,V]=Sv(K=>{const ne=P().filter(de=>!de.disabled),he=ne.find(de=>de.ref.current===document.activeElement),oe=bv(ne,K,he);oe&&setTimeout(()=>oe.ref.current.focus())}),Y=g.useCallback((K,ne,he)=>{const oe=!M.current&&!he;(h.value!==void 0&&h.value===ne||oe)&&(z(K),oe&&(M.current=!0))},[h.value]),N=g.useCallback(()=>v==null?void 0:v.focus(),[v]),re=g.useCallback((K,ne,he)=>{const oe=!M.current&&!he;(h.value!==void 0&&h.value===ne||oe)&&I(K)},[h.value]),fe=r==="popper"?Nc:iv,ie=fe===Nc?{side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S}:{};return s.jsx(nv,{scope:n,content:v,viewport:j,onViewportChange:C,itemRefCallback:Y,selectedItem:T,onItemLeave:N,itemTextRefCallback:re,focusSelectedItem:$,selectedItemText:L,position:r,isPositioned:R,searchRef:b,children:s.jsx(Ky,{as:tE,allowPinchZoom:!0,children:s.jsx(Yd,{asChild:!0,trapped:h.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:ee(i,K=>{var ne;(ne=h.trigger)==null||ne.focus({preventScroll:!0}),K.preventDefault()}),children:s.jsx(Qd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:s.jsx(fe,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:K=>K.preventDefault(),...y,...ie,onPlaced:()=>W(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,K=>{const ne=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ne&&K.key.length===1&&V(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let oe=P().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(K.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const de=K.target,me=oe.indexOf(de);oe=oe.slice(me+1)}setTimeout(()=>O(oe)),K.preventDefault()}})})})})})})});rv.displayName=eE;var nE="SelectItemAlignedPosition",iv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ar(Ar,n),l=ur(Ar,n),[a,u]=g.useState(null),[c,f]=g.useState(null),d=ve(t,E=>f(E)),p=fa(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:x,selectedItem:S,selectedItemText:y,focusSelectedItem:h}=l,v=g.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&x&&S&&y){const E=o.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(o.dir!=="rtl"){const de=L.left-T.left,me=z.left-de,He=E.left-me,rt=E.width+He,Zt=Math.max(rt,T.width),zt=window.innerWidth-Ut,en=As(me,[Ut,Math.max(Ut,zt-Zt)]);a.style.minWidth=rt+"px",a.style.left=en+"px"}else{const de=T.right-L.right,me=window.innerWidth-z.right-de,He=window.innerWidth-E.right-me,rt=E.width+He,Zt=Math.max(rt,T.width),zt=window.innerWidth-Ut,en=As(me,[Ut,Math.max(Ut,zt-Zt)]);a.style.minWidth=rt+"px",a.style.right=en+"px"}const I=p(),P=window.innerHeight-Ut*2,R=x.scrollHeight,W=window.getComputedStyle(c),M=parseInt(W.borderTopWidth,10),O=parseInt(W.paddingTop,10),$=parseInt(W.borderBottomWidth,10),A=parseInt(W.paddingBottom,10),F=M+O+R+A+$,b=Math.min(S.offsetHeight*5,F),V=window.getComputedStyle(x),Y=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),re=E.top+E.height/2-Ut,fe=P-re,ie=S.offsetHeight/2,K=S.offsetTop+ie,ne=M+O+K,he=F-ne;if(ne<=re){const de=I.length>0&&S===I[I.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-x.offsetTop-x.offsetHeight,He=Math.max(fe,ie+(de?N:0)+me+$),rt=ne+He;a.style.height=rt+"px"}else{const de=I.length>0&&S===I[0].ref.current;a.style.top="0px";const He=Math.max(re,M+x.offsetTop+(de?Y:0)+ie)+he;a.style.height=He+"px",x.scrollTop=ne-re+x.offsetTop}a.style.margin=`${Ut}px 0`,a.style.minHeight=b+"px",a.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,x,S,y,o.dir,r]);tt(()=>v(),[v]);const[k,j]=g.useState();tt(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(E=>{E&&w.current===!0&&(v(),h==null||h(),w.current=!1)},[v,h]);return s.jsx(iE,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:s.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:s.jsx(le.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});iv.displayName=nE;var rE="SelectPopperPosition",Nc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ut,...o}=e,l=pa(n);return s.jsx(Zj,{...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)"}})});Nc.displayName=rE;var[iE,lf]=Li(Ar,{}),Cc="SelectViewport",ov=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ur(Cc,n),l=lf(Cc,n),a=ve(t,o.onViewportChange),u=g.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(da.Slot,{scope:n,children:s.jsx(le.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ee(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const m=Math.abs(u.current-f.scrollTop);if(m>0){const w=window.innerHeight-Ut*2,x=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),y=Math.max(x,S);if(y0?k:0,d.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});ov.displayName=Cc;var lv="SelectGroup",[oE,lE]=Li(lv),sv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qn();return s.jsx(oE,{scope:n,id:i,children:s.jsx(le.div,{role:"group","aria-labelledby":i,...r,ref:t})})});sv.displayName=lv;var av="SelectLabel",uv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=lE(av,n);return s.jsx(le.div,{id:i.id,...r,ref:t})});uv.displayName=av;var Ls="SelectItem",[sE,cv]=Li(Ls),dv=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,a=ar(Ls,n),u=ur(Ls,n),c=a.value===r,[f,d]=g.useState(o??""),[p,m]=g.useState(!1),w=ve(t,h=>{var v;return(v=u.itemRefCallback)==null?void 0:v.call(u,h,r,i)}),x=qn(),S=g.useRef("touch"),y=()=>{i||(a.onValueChange(r),a.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 s.jsx(sE,{scope:n,value:r,disabled:i,textId:x,isSelected:c,onItemTextChange:g.useCallback(h=>{d(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:s.jsx(da.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:s.jsx(le.div,{role:"option","aria-labelledby":x,"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"&&y()}),onPointerUp:ee(l.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:ee(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:ee(l.onPointerMove,h=>{var v;S.current=h.pointerType,i?(v=u.onItemLeave)==null||v.call(u):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(l.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=u.onItemLeave)==null||v.call(u))}),onKeyDown:ee(l.onKeyDown,h=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&h.key===" "||(K2.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});dv.displayName=Ls;var no="SelectItemText",fv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ar(no,n),a=ur(no,n),u=cv(no,n),c=q2(no,n),[f,d]=g.useState(null),p=ve(t,y=>d(y),u.onItemTextChange,y=>{var h;return(h=a.itemTextRefCallback)==null?void 0:h.call(a,y,u.value,u.disabled)}),m=f==null?void 0:f.textContent,w=g.useMemo(()=>s.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=c;return tt(()=>(x(w),()=>S(w)),[x,S,w]),s.jsxs(s.Fragment,{children:[s.jsx(le.span,{id:u.textId,...o,ref:p}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?_i.createPortal(o.children,l.valueNode):null]})});fv.displayName=no;var pv="SelectItemIndicator",mv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return cv(pv,n).isSelected?s.jsx(le.span,{"aria-hidden":!0,...r,ref:t}):null});mv.displayName=pv;var jc="SelectScrollUpButton",hv=g.forwardRef((e,t)=>{const n=ur(jc,e.__scopeSelect),r=lf(jc,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?s.jsx(xv,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});hv.displayName=jc;var Ec="SelectScrollDownButton",gv=g.forwardRef((e,t)=>{const n=ur(Ec,e.__scopeSelect),r=lf(Ec,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?s.jsx(xv,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});gv.displayName=Ec;var xv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ur("SelectScrollButton",n),l=g.useRef(null),a=fa(n),u=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),tt(()=>{var f;const c=a().find(d=>d.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),s.jsx(le.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,()=>{u()})})}),aE="SelectSeparator",yv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(le.div,{"aria-hidden":!0,...r,ref:t})});yv.displayName=aE;var Pc="SelectArrow",uE=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pa(n),o=ar(Pc,n),l=ur(Pc,n);return o.open&&l.position==="popper"?s.jsx(e2,{...i,...r,ref:t}):null});uE.displayName=Pc;var cE="SelectBubbleInput",vv=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(r,i),l=Ly(t);return g.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[l,t]),s.jsx(le.select,{...n,style:{...Oy,...n.style},ref:o,defaultValue:t})});vv.displayName=cE;function wv(e){return e===""||e===void 0}function Sv(e){const t=er(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const a=n.current+l;t(a),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function bv(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=dE(e,Math.max(o,0));i.length===1&&(l=l.filter(c=>c!==n));const u=l.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function dE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fE=Qy,kv=Xy,pE=Jy,mE=Zy,hE=ev,Nv=tv,gE=ov,xE=sv,Cv=uv,jv=dv,yE=fv,vE=mv,Ev=hv,Pv=gv,Tv=yv;const Do=fE,fi=xE,zo=pE,ji=g.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(kv,{ref:r,className:ce("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,s.jsx(mE,{asChild:!0,children:s.jsx(Xx,{className:"h-4 w-4 opacity-50"})})]}));ji.displayName=kv.displayName;const Av=g.forwardRef(({className:e,...t},n)=>s.jsx(Ev,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(lN,{className:"h-4 w-4"})}));Av.displayName=Ev.displayName;const _v=g.forwardRef(({className:e,...t},n)=>s.jsx(Pv,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Xx,{className:"h-4 w-4"})}));_v.displayName=Pv.displayName;const Ei=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>s.jsx(hE,{children:s.jsxs(Nv,{ref:i,className:ce("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:[s.jsx(Av,{}),s.jsx(gE,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(_v,{})]})}));Ei.displayName=Nv.displayName;const Sr=g.forwardRef(({className:e,...t},n)=>s.jsx(Cv,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Sr.displayName=Cv.displayName;const St=g.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(jv,{ref:r,className:ce("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(vE,{children:s.jsx(tN,{className:"h-4 w-4"})})}),s.jsx(yE,{children:t})]}));St.displayName=jv.displayName;const wE=g.forwardRef(({className:e,...t},n)=>s.jsx(Tv,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",e),...t}));wE.displayName=Tv.displayName;var Iv=["PageUp","PageDown"],Rv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Mv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Oi="Slider",[Tc,SE,bE]=Kd(Oi),[Lv,LR]=sr(Oi,[bE]),[kE,ma]=Lv(Oi),Ov=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...x}=e,S=g.useRef(new Set),y=g.useRef(0),v=l==="horizontal"?NE:CE,[k=[],j]=Ci({prop:f,defaultProp:c,onChange:I=>{var R;(R=[...S.current][y.current])==null||R.focus(),d(I)}}),C=g.useRef(k);function E(I){const P=AE(k,I);L(I,P)}function T(I){L(I,y.current)}function z(){const I=C.current[y.current];k[y.current]!==I&&p(k)}function L(I,P,{commit:R}={commit:!1}){const W=ME(o),M=LE(Math.round((I-r)/o)*o+r,W),O=As(M,[r,i]);j(($=[])=>{const A=PE($,O,P);if(RE(A,u*o)){y.current=A.indexOf(O);const F=String(A)!==String($);return F&&R&&p(A),F?A:$}else return $})}return s.jsx(kE,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:y,thumbs:S.current,values:k,orientation:l,form:w,children:s.jsx(Tc.Provider,{scope:e.__scopeSlider,children:s.jsx(Tc.Slot,{scope:e.__scopeSlider,children:s.jsx(v,{"aria-disabled":a,"data-disabled":a?"":void 0,...x,ref:t,onPointerDown:ee(x.onPointerDown,()=>{a||(C.current=k)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:E,onSlideMove:a?void 0:T,onSlideEnd:a?void 0:z,onHomeKeyDown:()=>!a&&L(r,0,{commit:!0}),onEndKeyDown:()=>!a&&L(i,k.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:P})=>{if(!a){const M=Iv.includes(I.key)||I.shiftKey&&Rv.includes(I.key)?10:1,O=y.current,$=k[O],A=o*M*P;L($+A,O,{commit:!0})}}})})})})});Ov.displayName=Oi;var[Dv,zv]=Lv(Oi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),NE=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:a,onSlideEnd:u,onStepKeyDown:c,...f}=e,[d,p]=g.useState(null),m=ve(t,v=>p(v)),w=g.useRef(void 0),x=oa(i),S=x==="ltr",y=S&&!o||!S&&o;function h(v){const k=w.current||d.getBoundingClientRect(),j=[0,k.width],E=sf(j,y?[n,r]:[r,n]);return w.current=k,E(v-k.left)}return s.jsx(Dv,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:s.jsx(Fv,{dir:x,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const k=h(v.clientX);l==null||l(k)},onSlideMove:v=>{const k=h(v.clientX);a==null||a(k)},onSlideEnd:()=>{w.current=void 0,u==null||u()},onStepKeyDown:v=>{const j=Mv[y?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:j?-1:1})}})})}),CE=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:a,onStepKeyDown:u,...c}=e,f=g.useRef(null),d=ve(t,f),p=g.useRef(void 0),m=!i;function w(x){const S=p.current||f.current.getBoundingClientRect(),y=[0,S.height],v=sf(y,m?[r,n]:[n,r]);return p.current=S,v(x-S.top)}return s.jsx(Dv,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:s.jsx(Fv,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const S=w(x.clientY);o==null||o(S)},onSlideMove:x=>{const S=w(x.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,a==null||a()},onStepKeyDown:x=>{const y=Mv[m?"from-bottom":"from-top"].includes(x.key);u==null||u({event:x,direction:y?-1:1})}})})}),Fv=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:a,onStepKeyDown:u,...c}=e,f=ma(Oi,n);return s.jsx(le.span,{...c,ref:t,onKeyDown:ee(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(a(d),d.preventDefault()):Iv.concat(Rv).includes(d.key)&&(u(d),d.preventDefault())}),onPointerDown:ee(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:ee(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:ee(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),Bv="SliderTrack",$v=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ma(Bv,n);return s.jsx(le.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});$v.displayName=Bv;var Ac="SliderRange",Uv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ma(Ac,n),o=zv(Ac,n),l=g.useRef(null),a=ve(t,l),u=i.values.length,c=i.values.map(p=>Wv(p,i.min,i.max)),f=u>1?Math.min(...c):0,d=100-Math.max(...c);return s.jsx(le.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});Uv.displayName=Ac;var _c="SliderThumb",Vv=g.forwardRef((e,t)=>{const n=SE(e.__scopeSlider),[r,i]=g.useState(null),o=ve(t,a=>i(a)),l=g.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return s.jsx(jE,{...e,ref:o,index:l})}),jE=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=ma(_c,n),a=zv(_c,n),[u,c]=g.useState(null),f=ve(t,h=>c(h)),d=u?l.form||!!u.closest("form"):!0,p=Ny(u),m=l.values[r],w=m===void 0?0:Wv(m,l.min,l.max),x=TE(r,l.values.length),S=p==null?void 0:p[a.size],y=S?_E(S,w,a.direction):0;return g.useEffect(()=>{if(u)return l.thumbs.add(u),()=>{l.thumbs.delete(u)}},[u,l.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${y}px)`},children:[s.jsx(Tc.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(le.span,{role:"slider","aria-label":e["aria-label"]||x,"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:f,style:m===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&s.jsx(Hv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});Vv.displayName=_c;var EE="RadioBubbleInput",Hv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(i,r),l=Ly(t);return g.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(a,t),a.dispatchEvent(d)}},[l,t]),s.jsx(le.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Hv.displayName=EE;function PE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function Wv(e,t,n){const o=100/(n-t)*(e-t);return As(o,[0,100])}function TE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function AE(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 _E(e,t,n){const r=e/2,o=sf([0,50],[0,r]);return(r-o(t)*n)*n}function IE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function RE(e,t){if(t>0){const n=IE(e);return Math.min(...n)>=t}return!0}function sf(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 ME(e){return(String(e).split(".")[1]||"").length}function LE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Gv=Ov,OE=$v,DE=Uv,zE=Vv;const Fo=g.forwardRef(({className:e,...t},n)=>s.jsxs(Gv,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(OE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(DE,{className:"absolute h-full bg-primary"})}),s.jsx(zE,{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"})]}));Fo.displayName=Gv.displayName;const af=[{id:"outdoor-rescue",name:"🏔️ Outdoor Rescue",description:"Offline AI that guides survival in extreme environments",category:"Emergency & Safety",tags:["survival","outdoor","emergency","rescue"],icon:"🏔️",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are an expert outdoor survival guide and emergency responder. When hikers, travelers, or drivers lose connection in mountains, forests, or rural roads, you provide real-time survival guidance, first aid tips, and emergency signaling advice. You are their reliable voice of calm and safety in extreme environments. Provide step-by-step instructions for survival scenarios, prioritize immediate safety needs, and offer practical solutions using available resources.",temperature:.3,maxTokens:1e3,isOfficial:!0,usageCount:2847,rating:4.9,createdAt:"2024-01-15",author:"EdgeLLM Team"},{id:"offline-healthcare",name:"🏥 Offline Healthcare",description:"A simple device for seniors to access trusted medical guidance",category:"Healthcare",tags:["healthcare","seniors","medical","guidance"],icon:"🏥",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a trusted medical assistant designed specifically for elderly users. You provide clear, step-by-step medical advice through simple voice interactions. Users can press a button or speak a request to get guidance on everyday health concerns. Offer practical, easy-to-understand health advice while always emphasizing when professional medical attention is needed. Keep responses simple, clear, and actionable. No internet required, no accounts needed, no complicated setup.",temperature:.2,maxTokens:800,isOfficial:!0,usageCount:1934,rating:4.8,createdAt:"2024-01-20",author:"EdgeLLM Team"},{id:"ai-companion",name:"🧸 AI Companion",description:"A private, always-available conversational partner",category:"Companion & Support",tags:["companion","emotional support","conversation","private"],icon:"🧸",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a warm, empathetic AI companion designed to provide emotional support and practical assistance. You can be embedded in a plush toy or device to serve as a private, always-available friend. You listen actively, engage in meaningful conversations, tell stories, and provide comfort during stressful or lonely times. You offer warmth, reassurance, and practical help while maintaining complete privacy - all processing stays local without uploading data to the cloud. Be supportive, understanding, and genuinely caring in all interactions.",temperature:.7,maxTokens:1e3,isOfficial:!0,usageCount:3421,rating:4.9,createdAt:"2024-01-25",author:"EdgeLLM Team"}];function FE(){return af.map(e=>({id:e.id,name:e.name.replace(/🏔️|🏥|🧸/g,"").trim(),description:e.description,author:e.author,category:e.category,tags:e.tags,model:e.model,systemPrompt:e.systemPrompt,temperature:e.temperature,maxTokens:e.maxTokens,isOfficial:e.isOfficial,createdAt:e.createdAt,icon:e.icon,usageCount:e.usageCount,rating:e.rating}))}function BE(){return af.map(e=>({name:e.name,prompt:e.systemPrompt}))}const nn={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function Kv(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function $E(){return Kv()}class UE{getAllSessions(){const t=localStorage.getItem(nn.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:Kv(),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(nn.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(nn.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(nn.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(nn.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:$E(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(nn.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(nn.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(nn.currentSession,t)}clear(){localStorage.removeItem(nn.sessions),localStorage.removeItem(nn.currentSession)}}const Oe=new UE;function Qv(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,a]=g.useState(null),[u,c]=g.useState(""),[f,d]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,x]=g.useState(r),[S,y]=g.useState(.7),[h,v]=g.useState(1024),k=Ht.useMemo(()=>{var O;const M=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!M,messageCount:((O=M==null?void 0:M.messages)==null?void 0:O.length)||0,sessionTitle:(M==null?void 0:M.title)||"No session"}),M},[i,l]),j=Ht.useMemo(()=>{const M=(k==null?void 0:k.messages)||[];return console.log("useChat - messages computed:",M.length,M.map(O=>({id:O.id,role:O.role}))),M},[k==null?void 0:k.messages]);g.useEffect(()=>{const M=Oe.getAllSessions();o(M);const O=Oe.getCurrentSession();O&&a(O.id)},[]);const C=g.useCallback(()=>{const M=Oe.createSession(void 0,p,w),O=Oe.getAllSessions();return o([...O]),a(M.id),Oe.setCurrentSession(M.id),M.id},[p,w]),E=g.useCallback(M=>{console.log("selectSession called with:",M),a(M),Oe.setCurrentSession(M),console.log("currentSessionId updated to:",M)},[]),T=g.useCallback(M=>{Oe.deleteSession(M);const O=Oe.getAllSessions();o([...O]),l===M&&(O.length>0?(a(O[0].id),Oe.setCurrentSession(O[0].id)):a(null))},[l]),z=g.useCallback((M,O)=>{Oe.updateSession(M,{title:O});const $=Oe.getAllSessions();o([...$])},[]),L=g.useCallback(M=>{if(!l)return;Oe.addMessageToSession(l,M);const O=Oe.getAllSessions();o([...O])},[l]),I=g.useCallback(async(M,O)=>{var F,b;if(!u.trim()||f.isLoading)return;let $=l;$||($=C());const A=u.trim();if(c(""),d({isLoading:!0,error:null}),$){Oe.addMessageToSession($,{role:"user",content:A});const V=Oe.getAllSessions();o([...V])}try{const V=Oe.getSession($),Y=((b=(F=V==null?void 0:V.messages)==null?void 0:F.filter(fe=>fe.role!=="system"))==null?void 0:b.map(fe=>({role:fe.role,content:fe.content})))||[],N=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:A,messages:Y,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h,use_rag:(O==null?void 0:O.useRag)||!1,retrieval_count:(O==null?void 0:O.retrievalCount)||3})});if(!N.ok){const fe=await N.json();throw new Error(fe.detail||`HTTP error! status: ${N.status}`)}const re=await N.json();if($){Oe.addMessageToSession($,{role:"assistant",content:re.content,thinking_content:re.thinking_content,model_used:re.model_used,supports_thinking:re.supports_thinking,assistantInfo:M});const fe=Oe.getAllSessions();o([...fe])}d({isLoading:!1,error:null})}catch(V){const Y=V instanceof Error?V.message:"An error occurred";if(d({isLoading:!1,error:Y}),$){Oe.addMessageToSession($,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`,assistantInfo:M});const N=Oe.getAllSessions();o([...N])}}},[u,f.isLoading,l,C,L,w,j.length,t,p,S,h]),P=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),R=g.useCallback(()=>{Oe.clear(),o([]),a(null)},[]),W=g.useCallback(()=>{a(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:k,currentSessionId:l,createNewSession:C,selectSession:E,deleteSession:T,renameSession:z,clearAllSessions:R,clearCurrentSession:W,messages:j,input:u,setInput:c,sendMessage:I,stopGeneration:P,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:x,temperature:S,setTemperature:y,maxTokens:h,setMaxTokens:v}}function Yv({isLoading:e,ragEnabled:t,setRagEnabled:n,retrievalCount:r,setRetrievalCount:i,currentAssistant:o}){const[l,a]=g.useState([]),[u,c]=g.useState(!1);g.useEffect(()=>{(async()=>{if(!o){a([]);return}try{const m=await fetch("/rag/documents");if(m.ok){const w=await m.json();if(w.documents){const x=Object.entries(w.documents).map(([S,y])=>({id:S,name:y.filename,size:0,type:y.file_type,uploadedAt:new Date().toISOString(),status:y.status,chunks:y.chunks,assistantId:y.assistant_id||null}));a(x)}}}catch(m){console.error("Error loading documents:",m)}})()},[o]);const f=async p=>{const m=p.target.files;if(!(!m||!o)){c(!0);try{const w=new FormData;w.append("assistant_id",o.id);for(const S of Array.from(m))w.append("files",S);const x=await fetch("/rag/upload",{method:"POST",body:w});if(x.ok){const S=await x.json(),y=S.results.filter(v=>v.success).map(v=>({id:v.doc_id,name:v.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:v.chunks,assistantId:o==null?void 0:o.id}));a(v=>[...v,...y]);const h=S.results.filter(v=>!v.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",x.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{c(!1)}}},d=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?a(w=>w.filter(x=>x.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),a(w=>w.filter(x=>x.id!==p))}};return s.jsx("div",{className:"space-y-4 pb-6",children:o?s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Vd,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{children:o.name}),s.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${o.type==="user"?"bg-blue-100 text-blue-700":o.type==="template"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-700"}`,children:o.type==="user"?"My Assistant":o.type==="template"?"Template":"New Assistant"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Te,{className:"text-xs text-muted-foreground",children:"RAG"}),s.jsx("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked),className:"rounded",disabled:e||l.length===0}),t&&l.length>0&&s.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[s.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),s.jsx("span",{className:"text-xs font-medium",children:"Active"})]})]})]})}),s.jsxs(Ye,{className:"space-y-4",children:[t&&s.jsxs("div",{className:"border-l-2 border-blue-200 pl-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{className:"text-xs font-medium",children:"Retrieval Depth"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," chunks"]})]}),s.jsx(Fo,{value:[r],onValueChange:p=>i(p[0]),max:10,min:1,step:1,className:"w-full"})]}),s.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-4 text-center hover:border-gray-300 transition-colors",children:[s.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:f,className:"hidden",disabled:u||e}),s.jsxs(Te,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[s.jsx(UN,{className:"h-6 w-6 text-gray-400"}),s.jsx("span",{className:"text-sm",children:u?"Uploading...":"Drop files or click to upload"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Te,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),t&&s.jsxs("span",{className:"text-xs text-green-600",children:["Using ",Math.min(r,l.length)," for context"]})]}),s.jsx("div",{className:"space-y-1",children:l.map(p=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[s.jsx(gN,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),s.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&s.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),s.jsx(J,{size:"sm",variant:"ghost",onClick:()=>d(p.id),disabled:e,className:"h-6 w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:s.jsx(ry,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&s.jsx("div",{className:"text-center py-3",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]}):s.jsx(Ie,{children:s.jsxs(Ye,{className:"pt-6 text-center",children:[s.jsx(ra,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an assistant to manage documents"})]})})})}function VE(){const e=Lr(),[t,n]=g.useState(1),[r,i]=g.useState({assistantId:"",model:"Qwen/Qwen3-30B-A3B",temperature:.7,maxTokens:1024,role:"",goal:"",description:"",document:""}),[o,l]=g.useState(!1),[a,u]=g.useState(3),[c,f]=g.useState(null),d=P=>{if(P==="create-new")i(R=>({...R,assistantId:"create-new",model:"Qwen/Qwen3-30B-A3B",temperature:.7,maxTokens:1024,role:"",goal:"",description:""})),v("Qwen/Qwen3-30B-A3B"),S(""),y(.7),h(1024),f({id:"create-new",name:"New Custom Assistant",type:"new"});else{const R=C.find(W=>W.id===P);R&&(i(W=>({...W,assistantId:P,model:R.model,temperature:R.temperature,maxTokens:R.maxTokens,role:R.description,goal:R.category,description:R.systemPrompt})),v(R.model),S(R.systemPrompt),y(R.temperature),h(R.maxTokens),f({id:P,name:R.name,type:"template"}))}};g.useEffect(()=>{const P=localStorage.getItem("selectedUseCase");P&&(d(P),localStorage.removeItem("selectedUseCase"))},[]);const{currentSession:p,createNewSession:m,sendMessage:w,isLoading:x,setSystemPrompt:S,setTemperature:y,setMaxTokens:h,setSelectedModel:v,input:k,setInput:j}=Qv(),C=af,E=(p==null?void 0:p.messages)||[];g.useEffect(()=>{v(r.model),S(r.description),y(r.temperature),h(r.maxTokens)},[r,v,S,y,h]);const T=()=>s.jsxs("div",{className:"flex items-center justify-between mb-8 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=1?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=1?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"1"}),s.jsx("span",{className:"ml-2 font-medium",children:"Configuration"})]}),s.jsx("div",{className:`w-32 h-0.5 mx-4 ${t>=2?"bg-purple-600":"bg-gray-300"}`})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=2?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=2?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"2"}),s.jsx("span",{className:"ml-2 font-medium",children:"Test performance"})]}),s.jsx("div",{className:`w-32 h-0.5 mx-4 ${t>=3?"bg-purple-600":"bg-gray-300"}`})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=3?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=3?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"3"}),s.jsx("span",{className:"ml-2 font-medium",children:"Connect to device"})]}),s.jsx(J,{className:"ml-8 bg-purple-600 hover:bg-purple-700 text-white px-8",onClick:()=>n(3),disabled:t<2,children:"Connect"})]})]}),z=()=>s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsx(Ie,{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Load Assistant"}),s.jsxs(Do,{onValueChange:d,value:r.assistantId,children:[s.jsx(ji,{children:s.jsx(zo,{placeholder:"Select an assistant or create new"})}),s.jsxs(Ei,{children:[s.jsx(St,{value:"create-new",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:"✨"}),s.jsx("span",{children:"Create New Assistant"})]})}),s.jsx("div",{className:"border-b my-1"}),C.map(P=>s.jsx(St,{value:P.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:P.icon}),s.jsx("span",{children:P.name.replace(/🏔️|🏥|🧸/g,"").trim()})]})},P.id))]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Parameters"}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select a model"}),s.jsxs(Do,{value:r.model,onValueChange:P=>i(R=>({...R,model:P})),children:[s.jsx(ji,{children:s.jsx(zo,{})}),s.jsxs(Ei,{children:[s.jsx(St,{value:"Qwen/Qwen3-30B-A3B",children:"Qwen3-30B-A3B"}),s.jsx(St,{value:"Qwen/Qwen2.5-32B-Instruct",children:"Qwen2.5-32B-Instruct"}),s.jsx(St,{value:"deepseek-ai/DeepSeek-V2.5",children:"DeepSeek-V2.5"})]})]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Temperature: ",r.temperature]}),s.jsx(Fo,{value:[r.temperature],onValueChange:P=>i(R=>({...R,temperature:P[0]})),max:1,min:0,step:.1,className:"w-full"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Max Tokens"}),s.jsx(ni,{type:"number",value:r.maxTokens,onChange:P=>i(R=>({...R,maxTokens:parseInt(P.target.value)||1024})),min:1,max:4096})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Description"}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Which role do you want your assistant to be? (Senior data researcher, journalist, lawyer, etc.)"}),s.jsx(ni,{value:r.role,onChange:P=>i(R=>({...R,role:P.target.value})),placeholder:"e.g., Senior data researcher, journalist, lawyer"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Which goal would you expect your assistant to achieve"}),s.jsx(ni,{value:r.goal,onChange:P=>i(R=>({...R,goal:P.target.value})),placeholder:"Describe the main goal or objective"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Description (Tasks, outputs)"}),s.jsx(Gd,{value:r.description,onChange:P=>i(R=>({...R,description:P.target.value})),placeholder:"Describe the tasks and expected outputs...",rows:4})]})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Documents & Knowledge Base"}),s.jsx(Yv,{isLoading:x,ragEnabled:o,setRagEnabled:l,retrievalCount:a,setRetrievalCount:u,currentAssistant:c})]}),s.jsx(J,{onClick:()=>n(2),className:"w-full bg-purple-600 hover:bg-purple-700 text-white",disabled:!r.assistantId||r.assistantId==="create-new"&&!r.description.trim(),children:"Continue to Test Performance"})]})})}),L=()=>{var P;return s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-[600px]",children:[s.jsx("div",{className:"lg:col-span-1",children:s.jsxs(Ie,{className:"h-full p-4",children:[s.jsx("h3",{className:"font-semibold mb-4",children:"Chat sessions"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(J,{variant:"ghost",className:"w-full justify-start text-left",onClick:m,children:"New Chat"}),E.length>0&&s.jsxs("div",{className:"p-2 bg-gray-50 rounded text-sm",children:["Current Session (",E.length," messages)"]})]})]})}),s.jsx("div",{className:"lg:col-span-3",children:s.jsxs(Ie,{className:"h-full flex flex-col",children:[s.jsx("div",{className:"p-4 border-b",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold",children:"Test Performance"}),s.jsx(xe,{variant:"secondary",children:r.assistantId==="create-new"?"Custom Assistant":r.assistantId?(P=C.find(R=>R.id===r.assistantId))==null?void 0:P.name.replace(/🏔️|🏥|🧸/g,"").trim():"No Assistant"})]})}),s.jsxs("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:[E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"mb-2",children:"Start testing your assistant configuration"}),s.jsx("p",{className:"text-sm",children:"Send a message to see how your assistant responds"})]})}):E.map((R,W)=>s.jsx("div",{className:`flex ${R.role==="user"?"justify-end":"justify-start"}`,children:s.jsx("div",{className:`max-w-[80%] p-3 rounded-lg ${R.role==="user"?"bg-purple-600 text-white":"bg-gray-100 text-gray-900"}`,children:s.jsx("p",{className:"whitespace-pre-wrap",children:R.content})})},W)),x&&s.jsx("div",{className:"flex justify-start",children:s.jsx("div",{className:"bg-gray-100 p-3 rounded-lg",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce"}),s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})})]}),s.jsx("div",{className:"p-4 border-t",children:s.jsxs("div",{className:"flex space-x-2",children:[s.jsx(ni,{placeholder:"Type your message...",value:k,onChange:R=>j(R.target.value),onKeyPress:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),k.trim()&&w(void 0,{useRag:o,retrievalCount:a}))}}),s.jsx(J,{onClick:()=>{k.trim()&&w(void 0,{useRag:o,retrievalCount:a})},disabled:x,className:"bg-purple-600 hover:bg-purple-700",children:"Send"})]})})]})})]}),s.jsxs("div",{className:"mt-6 flex justify-between max-w-6xl mx-auto",children:[s.jsx(J,{variant:"outline",onClick:()=>n(1),children:"Back to Configuration"}),s.jsx(J,{onClick:()=>n(3),className:"bg-purple-600 hover:bg-purple-700 text-white",children:"Continue to Connect Device"})]})]})},I=()=>{var P;return s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsxs(Ie,{className:"p-8 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.212 0"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Connect to Device"}),s.jsx("p",{className:"text-gray-600",children:"Your assistant configuration is ready to be deployed to your edge device."})]}),s.jsxs("div",{className:"space-y-4 text-left mb-8",children:[s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"Configuration Summary"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Assistant:"})," ",r.assistantId==="create-new"?"Custom Assistant":((P=C.find(R=>R.id===r.assistantId))==null?void 0:P.name.replace(/🏔️|🏥|🧸/g,"").trim())||"None"]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Model:"})," ",r.model]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Temperature:"})," ",r.temperature]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Max Tokens:"})," ",r.maxTokens]}),r.role&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Role:"})," ",r.role]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"RAG Enabled:"})," ",o?"Yes":"No"]}),o&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Retrieval Count:"})," ",a]})]})]}),s.jsx("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("svg",{className:"w-5 h-5 text-blue-600 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),s.jsxs("p",{className:"text-blue-800 text-sm",children:[s.jsx("span",{className:"font-medium",children:"Ready to deploy:"})," Your assistant configuration has been optimized for edge deployment."]})]})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{className:"w-full bg-purple-600 hover:bg-purple-700 text-white py-3",children:"Deploy to Edge Device"}),s.jsx(J,{variant:"outline",className:"w-full",onClick:()=>n(2),children:"Back to Testing"})]})]})})};return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("header",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex items-center justify-between h-20",children:[s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-16 w-16",onError:P=>{console.error("Logo failed to load"),P.currentTarget.style.display="none"}})}),s.jsxs("nav",{className:"flex space-x-8",children:[s.jsx("button",{onClick:()=>e("/"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Technology"}),s.jsx("button",{onClick:()=>e("/usecases"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Use Case"}),s.jsx("button",{className:"bg-purple-600 text-white px-4 py-2 text-sm font-medium rounded",children:"My Device"})]})]})})}),s.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[T(),t===1&&z(),t===2&&L(),t===3&&I()]})]})}function HE(){return FE()}function WE(){const e=Lr(),[t,n]=g.useState(!1),[r]=g.useState(HE()),[i,o]=g.useState([]),[l,a]=g.useState(""),[u,c]=g.useState("All");g.useEffect(()=>{f(),d()},[]);const f=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,v=await fetch(`${h}/models`);n(v.ok)}catch{n(!1)}},d=()=>{try{const h=JSON.parse(localStorage.getItem("likedTemplates")||"[]");o(h)}catch(h){console.error("Failed to load liked templates:",h)}},p=h=>{const v=i.includes(h)?i.filter(k=>k!==h):[...i,h];o(v),localStorage.setItem("likedTemplates",JSON.stringify(v))},m=h=>{const v={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(v)),e("/playground")},w=r.filter(h=>{const v=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(j=>j.toLowerCase().includes(l.toLowerCase())),k=u==="All"||h.category===u;return v&&k}),x=w.filter(h=>h.isOfficial),S=[...w].sort((h,v)=>v.usageCount-h.usageCount).slice(0,6),y=["All",...Array.from(new Set(r.map(h=>h.category)))];return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:s.jsx(Er,{className:"h-5 w-5 text-white"})}),s.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),s.jsx(xe,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),s.jsxs(J,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),s.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),s.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),s.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[s.jsx(Zp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),s.jsx(ni,{type:"text",placeholder:"Search assistants...",value:l,onChange:h=>a(h.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),s.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:y.map(h=>s.jsx(J,{variant:u===h?"default":"outline",size:"sm",onClick:()=>c(h),className:"rounded-full",children:h},h))})]}),u==="All"&&x.length>0&&s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(qx,{className:"h-5 w-5 text-yellow-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:x.slice(0,3).map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),u==="All"&&s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(ny,{className:"h-5 w-5 text-green-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(WN,{className:"h-5 w-5 text-blue-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:u==="All"?"All Templates":u}),s.jsxs(xe,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):s.jsx(Ie,{className:"p-12 text-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(Zp,{className:"h-12 w-12 text-gray-400"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),s.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),s.jsx(J,{variant:"outline",onClick:()=>{a(""),c("All")},children:"Clear filters"})]})})]})]})]})}function ou({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return s.jsxs(Ie,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&s.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[s.jsx(qx,{className:"h-3 w-3"}),"Featured"]}),o&&s.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[s.jsx(ny,{className:"h-3 w-3"}),"Trending"]}),s.jsx(Mt,{className:"pb-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),s.jsxs("div",{children:[s.jsx(Lt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&s.jsxs(xe,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[s.jsx(Qk,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),s.jsx(J,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:s.jsx(vN,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),s.jsxs(Ye,{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>s.jsx(xe,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(mN,{className:"h-4 w-4"}),s.jsx("span",{children:e.usageCount.toLocaleString()})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(zN,{className:"h-4 w-4 text-yellow-500 fill-current"}),s.jsx("span",{children:e.rating})]})]}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.category})]}),s.jsx("div",{className:"pt-2",children:s.jsxs(J,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[s.jsx(ia,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}var lu="rovingFocusGroup.onEntryFocus",GE={bubbles:!1,cancelable:!0},Yo="RovingFocusGroup",[Ic,Xv,KE]=Kd(Yo),[QE,qv]=sr(Yo,[KE]),[YE,XE]=QE(Yo),Jv=g.forwardRef((e,t)=>s.jsx(Ic.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Ic.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(qE,{...e,ref:t})})}));Jv.displayName=Yo;var qE=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=e,p=g.useRef(null),m=ve(t,p),w=oa(o),[x,S]=Ci({prop:l,defaultProp:a??null,onChange:u,caller:Yo}),[y,h]=g.useState(!1),v=er(c),k=Xv(n),j=g.useRef(!1),[C,E]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(lu,v),()=>T.removeEventListener(lu,v)},[v]),s.jsx(YE,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>E(T=>T-1),[]),children:s.jsx(le.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{j.current=!0}),onFocus:ee(e.onFocus,T=>{const z=!j.current;if(T.target===T.currentTarget&&z&&!y){const L=new CustomEvent(lu,GE);if(T.currentTarget.dispatchEvent(L),!L.defaultPrevented){const I=k().filter(O=>O.focusable),P=I.find(O=>O.active),R=I.find(O=>O.id===x),M=[P,R,...I].filter(Boolean).map(O=>O.ref.current);t0(M,f)}}j.current=!1}),onBlur:ee(e.onBlur,()=>h(!1))})})}),Zv="RovingFocusGroupItem",e0=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...a}=e,u=qn(),c=o||u,f=XE(Zv,n),d=f.currentTabStopId===c,p=Xv(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:x}=f;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),s.jsx(Ic.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:s.jsx(le.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:ee(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:ee(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=eP(S,f.orientation,f.dir);if(y!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")v.reverse();else if(y==="prev"||y==="next"){y==="prev"&&v.reverse();const k=v.indexOf(S.currentTarget);v=f.loop?tP(v,k+1):v.slice(k+1)}setTimeout(()=>t0(v))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:x!=null}):l})})});e0.displayName=Zv;var JE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eP(e,t,n){const r=ZE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JE[r]}function t0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nP=Jv,rP=e0;function iP(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Xo=e=>{const{present:t,children:n}=e,r=oP(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ve(r.ref,lP(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Xo.displayName="Presence";function oP(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[a,u]=iP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Cl(r.current);o.current=a==="mounted"?c:"none"},[a]),tt(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=Cl(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),tt(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,d=m=>{const x=Cl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&x&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=Cl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Cl(e){return(e==null?void 0:e.animationName)||"none"}function lP(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 ha="Tabs",[sP,OR]=sr(ha,[qv]),n0=qv(),[aP,uf]=sP(ha),r0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=oa(a),[d,p]=Ci({prop:r,onChange:i,defaultProp:o??"",caller:ha});return s.jsx(aP,{scope:n,baseId:qn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:u,children:s.jsx(le.div,{dir:f,"data-orientation":l,...c,ref:t})})});r0.displayName=ha;var i0="TabsList",o0=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=uf(i0,n),l=n0(n);return s.jsx(nP,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:s.jsx(le.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});o0.displayName=i0;var l0="TabsTrigger",s0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=uf(l0,n),a=n0(n),u=c0(l.baseId,r),c=d0(l.baseId,r),f=r===l.value;return s.jsx(rP,{asChild:!0,...a,focusable:!i,active:f,children:s.jsx(le.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:ee(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:ee(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});s0.displayName=l0;var a0="TabsContent",u0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,a=uf(a0,n),u=c0(a.baseId,r),c=d0(a.baseId,r),f=r===a.value,d=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),s.jsx(Xo,{present:i||f,children:({present:p})=>s.jsx(le.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});u0.displayName=a0;function c0(e,t){return`${e}-trigger-${t}`}function d0(e,t){return`${e}-content-${t}`}var uP=r0,f0=o0,p0=s0,m0=u0;const cP=uP,h0=g.forwardRef(({className:e,...t},n)=>s.jsx(f0,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));h0.displayName=f0.displayName;const Hl=g.forwardRef(({className:e,...t},n)=>s.jsx(p0,{ref:n,className:ce("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}));Hl.displayName=p0.displayName;const Wl=g.forwardRef(({className:e,...t},n)=>s.jsx(m0,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Wl.displayName=m0.displayName;var ga="Dialog",[g0,x0]=sr(ga),[dP,Jt]=g0(ga),y0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,a=g.useRef(null),u=g.useRef(null),[c,f]=Ci({prop:r,defaultProp:i??!1,onChange:o,caller:ga});return s.jsx(dP,{scope:t,triggerRef:a,contentRef:u,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};y0.displayName=ga;var v0="DialogTrigger",w0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(v0,n),o=ve(t,i.triggerRef);return s.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ff(i.open),...r,ref:o,onClick:ee(e.onClick,i.onOpenToggle)})});w0.displayName=v0;var cf="DialogPortal",[fP,S0]=g0(cf,{forceMount:void 0}),b0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Jt(cf,t);return s.jsx(fP,{scope:t,forceMount:n,children:g.Children.map(r,l=>s.jsx(Xo,{present:n||o.open,children:s.jsx(of,{asChild:!0,container:i,children:l})}))})};b0.displayName=cf;var Os="DialogOverlay",k0=g.forwardRef((e,t)=>{const n=S0(Os,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jt(Os,e.__scopeDialog);return o.modal?s.jsx(Xo,{present:r||o.open,children:s.jsx(mP,{...i,ref:t})}):null});k0.displayName=Os;var pP=ki("DialogOverlay.RemoveScroll"),mP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(Os,n);return s.jsx(Ky,{as:pP,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(le.div,{"data-state":ff(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),_r="DialogContent",N0=g.forwardRef((e,t)=>{const n=S0(_r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jt(_r,e.__scopeDialog);return s.jsx(Xo,{present:r||o.open,children:o.modal?s.jsx(hP,{...i,ref:t}):s.jsx(gP,{...i,ref:t})})});N0.displayName=_r;var hP=g.forwardRef((e,t)=>{const n=Jt(_r,e.__scopeDialog),r=g.useRef(null),i=ve(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return zy(o)},[]),s.jsx(C0,{...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,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,o=>o.preventDefault())})}),gP=g.forwardRef((e,t)=>{const n=Jt(_r,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return s.jsx(C0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.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()}})}),C0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,a=Jt(_r,n),u=g.useRef(null),c=ve(t,u);return cy(),s.jsxs(s.Fragment,{children:[s.jsx(Yd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:s.jsx(Qd,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ff(a.open),...l,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(yP,{titleId:a.titleId}),s.jsx(wP,{contentRef:u,descriptionId:a.descriptionId})]})]})}),df="DialogTitle",j0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(df,n);return s.jsx(le.h2,{id:i.titleId,...r,ref:t})});j0.displayName=df;var E0="DialogDescription",P0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(E0,n);return s.jsx(le.p,{id:i.descriptionId,...r,ref:t})});P0.displayName=E0;var T0="DialogClose",A0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(T0,n);return s.jsx(le.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});A0.displayName=T0;function ff(e){return e?"open":"closed"}var _0="DialogTitleWarning",[xP,I0]=pC(_0,{contentName:_r,titleName:df,docsSlug:"dialog"}),yP=({titleId:e})=>{const t=I0(_0),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 g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vP="DialogDescriptionWarning",wP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I0(vP).contentName}}.`;return g.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},SP=y0,bP=w0,kP=b0,NP=k0,CP=N0,jP=j0,EP=P0,R0=A0,M0="AlertDialog",[PP,DR]=sr(M0,[x0]),An=x0(),L0=e=>{const{__scopeAlertDialog:t,...n}=e,r=An(t);return s.jsx(SP,{...r,...n,modal:!0})};L0.displayName=M0;var TP="AlertDialogTrigger",AP=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(bP,{...i,...r,ref:t})});AP.displayName=TP;var _P="AlertDialogPortal",O0=e=>{const{__scopeAlertDialog:t,...n}=e,r=An(t);return s.jsx(kP,{...r,...n})};O0.displayName=_P;var IP="AlertDialogOverlay",D0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(NP,{...i,...r,ref:t})});D0.displayName=IP;var pi="AlertDialogContent",[RP,MP]=PP(pi),LP=ZN("AlertDialogContent"),z0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=An(n),l=g.useRef(null),a=ve(t,l),u=g.useRef(null);return s.jsx(xP,{contentName:pi,titleName:F0,docsSlug:"alert-dialog",children:s.jsx(RP,{scope:n,cancelRef:u,children:s.jsxs(CP,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:ee(i.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=u.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[s.jsx(LP,{children:r}),s.jsx(DP,{contentRef:l})]})})})});z0.displayName=pi;var F0="AlertDialogTitle",B0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(jP,{...i,...r,ref:t})});B0.displayName=F0;var $0="AlertDialogDescription",U0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(EP,{...i,...r,ref:t})});U0.displayName=$0;var OP="AlertDialogAction",V0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(R0,{...i,...r,ref:t})});V0.displayName=OP;var H0="AlertDialogCancel",W0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=MP(H0,n),o=An(n),l=ve(t,i);return s.jsx(R0,{...o,...r,ref:l})});W0.displayName=H0;var DP=({contentRef:e})=>{const t=`\`${pi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${pi}\` by passing a \`${$0}\` 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 \`${pi}\`. 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 g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},zP=L0,FP=O0,G0=D0,K0=z0,Q0=V0,Y0=W0,X0=B0,q0=U0;const su=zP,BP=FP,J0=g.forwardRef(({className:e,...t},n)=>s.jsx(G0,{className:ce("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}));J0.displayName=G0.displayName;const Gl=g.forwardRef(({className:e,...t},n)=>s.jsxs(BP,{children:[s.jsx(J0,{}),s.jsx(K0,{ref:n,className:ce("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})]}));Gl.displayName=K0.displayName;const Kl=({className:e,...t})=>s.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});Kl.displayName="AlertDialogHeader";const Ql=({className:e,...t})=>s.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ql.displayName="AlertDialogFooter";const Yl=g.forwardRef(({className:e,...t},n)=>s.jsx(X0,{ref:n,className:ce("text-lg font-semibold",e),...t}));Yl.displayName=X0.displayName;const Xl=g.forwardRef(({className:e,...t},n)=>s.jsx(q0,{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));Xl.displayName=q0.displayName;const ql=g.forwardRef(({className:e,...t},n)=>s.jsx(Q0,{ref:n,className:ce(Wd(),e),...t}));ql.displayName=Q0.displayName;const Jl=g.forwardRef(({className:e,...t},n)=>s.jsx(Y0,{ref:n,className:ce(Wd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Jl.displayName=Y0.displayName;function $P(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const UP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HP={};function Pm(e,t){return((t||HP).jsx?VP:UP).test(e)}const WP=/[ \t\n\f\r]/g;function GP(e){return typeof e=="object"?e.type==="text"?Tm(e.value):!1:Tm(e)}function Tm(e){return e.replace(WP,"")===""}class qo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qo.prototype.normal={};qo.prototype.property={};qo.prototype.space=void 0;function Z0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qo(n,r,t)}function Rc(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let KP=0;const Z=Dr(),Fe=Dr(),Mc=Dr(),U=Dr(),ke=Dr(),mi=Dr(),yt=Dr();function Dr(){return 2**++KP}const Lc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:Fe,commaOrSpaceSeparated:yt,commaSeparated:mi,number:U,overloadedBoolean:Mc,spaceSeparated:ke},Symbol.toStringTag,{value:"Module"})),au=Object.keys(Lc);class pf extends gt{constructor(t,n,r,i){let o=-1;if(super(t,n),Am(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&JP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_m,tT);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_m.test(o)){let l=o.replace(qP,eT);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=pf}return new i(r,t)}function eT(e){return"-"+e.toLowerCase()}function tT(e){return e.charAt(1).toUpperCase()}const nT=Z0([e1,QP,r1,i1,o1],"html"),mf=Z0([e1,YP,r1,i1,o1],"svg");function rT(e){return e.join(" ").trim()}var hf={},Im=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,iT=/\n/g,oT=/^\s*/,lT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sT=/^:\s*/,aT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uT=/^[;\s]*/,cT=/^\s+|\s+$/g,dT=` `,Rm="/",Mm="*",mr="",fT="comment",pT="declaration",mT=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 x=w.match(iT);x&&(n+=x.length);var S=w.lastIndexOf(dT);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(x){return x.position=new l(w),c(),x}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(w){var x=new Error(t.source+":"+n+":"+r+": "+w);if(x.reason=w,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(w){var x=w.exec(e);if(x){var S=x[0];return i(S),e=e.slice(S.length),x}}function c(){u(oT)}function f(w){var x;for(w=w||[];x=d();)x!==!1&&w.push(x);return w}function d(){var w=o();if(!(Rm!=e.charAt(0)||Mm!=e.charAt(1))){for(var x=2;mr!=e.charAt(x)&&(Mm!=e.charAt(x)||Rm!=e.charAt(x+1));)++x;if(x+=2,mr===e.charAt(x-1))return a("End of comment missing");var S=e.slice(2,x-2);return r+=2,i(S),e=e.slice(x),r+=2,w({type:fT,comment:S})}}function p(){var w=o(),x=u(lT);if(x){if(d(),!u(sT))return a("property missing ':'");var S=u(aT),y=w({type:pT,property:Lm(x[0].replace(Im,mr)),value:S?Lm(S[0].replace(Im,mr)):mr});return u(uT),y}}function m(){var w=[];f(w);for(var x;x=p();)x!==!1&&(w.push(x),f(w));return w}return c(),m()};function Lm(e){return e?e.replace(cT,mr):mr}var hT=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hf,"__esModule",{value:!0});hf.default=xT;var gT=hT(mT);function xT(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,gT.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,a=o.value;i?t(l,a,o):a&&(n=n||{},n[l]=a)}}),n}var xa={};Object.defineProperty(xa,"__esModule",{value:!0});xa.camelCase=void 0;var yT=/^--[a-zA-Z0-9_-]+$/,vT=/-([a-z])/g,wT=/^[^-]+$/,ST=/^-(webkit|moz|ms|o|khtml)-/,bT=/^-(ms)-/,kT=function(e){return!e||wT.test(e)||yT.test(e)},NT=function(e,t){return t.toUpperCase()},Om=function(e,t){return"".concat(t,"-")},CT=function(e,t){return t===void 0&&(t={}),kT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(bT,Om):e=e.replace(ST,Om),e.replace(vT,NT))};xa.camelCase=CT;var jT=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ET=jT(hf),PT=xa;function Oc(e,t){var n={};return!e||typeof e!="string"||(0,ET.default)(e,function(r,i){r&&i&&(n[(0,PT.camelCase)(r,t)]=i)}),n}Oc.default=Oc;var TT=Oc;const AT=Fs(TT),l1=s1("end"),gf=s1("start");function s1(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 _T(e){const t=gf(e),n=l1(e);if(t&&n)return{start:t,end:n}}function po(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dm(e.position):"start"in e||"end"in e?Dm(e):"line"in e||"column"in e?Dc(e):""}function Dc(e){return zm(e&&e.line)+":"+zm(e&&e.column)}function Dm(e){return Dc(e&&e.start)+"-"+Dc(e&&e.end)}function zm(e){return e&&typeof e=="number"?e:1}class nt 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 u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=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=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=po(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}}nt.prototype.file="";nt.prototype.name="";nt.prototype.reason="";nt.prototype.message="";nt.prototype.stack="";nt.prototype.column=void 0;nt.prototype.line=void 0;nt.prototype.ancestors=void 0;nt.prototype.cause=void 0;nt.prototype.fatal=void 0;nt.prototype.place=void 0;nt.prototype.ruleId=void 0;nt.prototype.source=void 0;const xf={}.hasOwnProperty,IT=new Map,RT=/[A-Z]/g,MT=new Set(["table","tbody","thead","tfoot","tr"]),LT=new Set(["td","th"]),a1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OT(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=HT(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=VT(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"?mf:nT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=u1(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function u1(e,t,n){if(t.type==="element")return DT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BT(e,t,n);if(t.type==="mdxjsEsm")return FT(e,t);if(t.type==="root")return $T(e,t,n);if(t.type==="text")return UT(e,t)}function DT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=mf,e.schema=i),e.ancestors.push(t);const o=d1(e,t.tagName,!1),l=WT(e,t);let a=vf(e,t);return MT.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!GP(u):!0})),c1(e,l,o,t),yf(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zT(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)}Bo(e,t.position)}function FT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bo(e,t.position)}function BT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=mf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:d1(e,t.name,!0),l=GT(e,t),a=vf(e,t);return c1(e,l,o,t),yf(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function $T(e,t,n){const r={};return yf(r,vf(e,t)),e.create(t,e.Fragment,r,n)}function UT(e,t){return t.value}function c1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VT(e,t,n){return r;function r(i,o,l,a){const c=Array.isArray(l.children)?n:t;return a?c(o,l,a):c(o,l)}}function HT(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=gf(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function WT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&xf.call(t.properties,i)){const o=KT(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&<.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function GT(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 a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Bo(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 a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Bo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function vf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:IT;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?(hn(e,e.length,0,t),e):t}const $m={}.hasOwnProperty;function tA(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 hi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=cr(/[A-Za-z]/),kt=cr(/[\dA-Za-z]/),iA=cr(/[#-'*+\--9=?A-Z^-~]/);function zc(e){return e!==null&&(e<32||e===127)}const Fc=cr(/\d/),oA=cr(/[\dA-Fa-f]/),lA=cr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const sA=cr(/\p{P}|\p{S}/u),aA=cr(/\s/);function cr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zi(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),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 Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return ye(u)?(e.enter(n),a(u)):t(u)}function a(u){return ye(u)&&o++l))return;const E=t.events.length;let T=E,z,L;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(z){L=t.events[T][1].end;break}z=!0}for(y(r),C=E;Cv;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=v}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pA(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vm(e){if(e===null||ht(e)||aA(e))return 1;if(sA(e))return 2}function Sf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Hm(d,-u),Hm(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=_t(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=_t(c,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=_t(c,Sf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=_t(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=_t(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,hn(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n0&&ye(C)?Ce(e,h,"linePrefix",o+1)(C):h(C)}function h(C){return C===null||X(C)?e.check(Wm,x,k)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||X(C)?(e.exit("codeFlowValue"),h(C)):(e.consume(C),v)}function k(C){return e.exit("codeFenced"),t(C)}function j(C,E,T){let z=0;return L;function L(M){return C.enter("lineEnding"),C.consume(M),C.exit("lineEnding"),I}function I(M){return C.enter("codeFencedFence"),ye(M)?Ce(C,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):P(M)}function P(M){return M===a?(C.enter("codeFencedFenceSequence"),R(M)):T(M)}function R(M){return M===a?(z++,C.consume(M),R):z>=l?(C.exit("codeFencedFenceSequence"),ye(M)?Ce(C,W,"whitespace")(M):W(M)):T(M)}function W(M){return M===null||X(M)?(C.exit("codeFencedFence"),E(M)):T(M)}}}function CA(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 cu={name:"codeIndented",tokenize:EA},jA={partial:!0,tokenize:PA};function EA(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ce(e,o,"linePrefix",4+1)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?u(c):X(c)?e.attempt(jA,l,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||X(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function PA(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):Ce(e,o,"linePrefix",4+1)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const TA={name:"codeText",previous:_A,resolve:AA,tokenize:IA};function AA(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&&Xi(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),Xi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xi(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 y1(e,t,n,r,i,o,l,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||zc(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||X(y)?n(y):(e.consume(y),y===92?w:m)}function w(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!f&&(y===null||y===41||ht(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f999||m===null||m===91||m===93&&!u||m===94&&!a&&"_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"),f):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||X(m)||a++>999?(e.exit("chunkString"),f(m)):(e.consume(m),u||(u=!ye(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function w1(e,t,n,r,i,o){let l;return a;function a(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,u):n(p)}function u(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),u(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ce(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||X(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function mo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const BA={name:"definition",tokenize:UA},$A={partial:!0,tokenize:VA};function UA(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return v1.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=hi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return ht(m)?mo(e,c)(m):c(m)}function c(m){return y1(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt($A,d,d)(m)}function d(m){return ye(m)?Ce(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 VA(e,t,n){return r;function r(a){return ht(a)?mo(e,i)(a):n(a)}function i(a){return w1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ye(a)?Ce(e,l,"whitespace")(a):l(a)}function l(a){return a===null||X(a)?t(a):n(a)}}const HA={name:"hardBreakEscape",tokenize:WA};function WA(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 GA={name:"headingAtx",resolve:KA,tokenize:QA};function KA(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"},hn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function QA(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||ht(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||X(f)?(e.exit("atxHeading"),t(f)):ye(f)?Ce(e,a,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||ht(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),c)}}const YA=["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"],Km=["pre","script","style","textarea"],XA={concrete:!0,name:"htmlFlow",resolveTo:ZA,tokenize:e_},qA={partial:!0,tokenize:n_},JA={partial:!0,tokenize:t_};function ZA(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 e_(e,t,n){const r=this;let i,o,l,a,u;return c;function c(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),o=!0,x):N===63?(e.consume(N),i=3,r.interrupt?t:b):un(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,a=0,w):un(N)?(e.consume(N),i=4,r.interrupt?t:b):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:b):n(N)}function w(N){const re="CDATA[";return N===re.charCodeAt(a++)?(e.consume(N),a===re.length?r.interrupt?t:P:w):n(N)}function x(N){return un(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||ht(N)){const re=N===47,fe=l.toLowerCase();return!re&&!o&&Km.includes(fe)?(i=1,r.interrupt?t(N):P(N)):YA.includes(l.toLowerCase())?(i=6,re?(e.consume(N),y):r.interrupt?t(N):P(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?h(N):v(N))}return N===45||kt(N)?(e.consume(N),l+=String.fromCharCode(N),S):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:P):n(N)}function h(N){return ye(N)?(e.consume(N),h):L(N)}function v(N){return N===47?(e.consume(N),L):N===58||N===95||un(N)?(e.consume(N),k):ye(N)?(e.consume(N),v):L(N)}function k(N){return N===45||N===46||N===58||N===95||kt(N)?(e.consume(N),k):j(N)}function j(N){return N===61?(e.consume(N),C):ye(N)?(e.consume(N),j):v(N)}function C(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):ye(N)?(e.consume(N),C):T(N)}function E(N){return N===u?(e.consume(N),u=null,z):N===null||X(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ht(N)?j(N):(e.consume(N),T)}function z(N){return N===47||N===62||ye(N)?v(N):n(N)}function L(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||X(N)?P(N):ye(N)?(e.consume(N),I):n(N)}function P(N){return N===45&&i===2?(e.consume(N),O):N===60&&i===1?(e.consume(N),$):N===62&&i===4?(e.consume(N),V):N===63&&i===3?(e.consume(N),b):N===93&&i===5?(e.consume(N),F):X(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qA,Y,R)(N)):N===null||X(N)?(e.exit("htmlFlowData"),R(N)):(e.consume(N),P)}function R(N){return e.check(JA,W,Y)(N)}function W(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),M}function M(N){return N===null||X(N)?R(N):(e.enter("htmlFlowData"),P(N))}function O(N){return N===45?(e.consume(N),b):P(N)}function $(N){return N===47?(e.consume(N),l="",A):P(N)}function A(N){if(N===62){const re=l.toLowerCase();return Km.includes(re)?(e.consume(N),V):P(N)}return un(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),A):P(N)}function F(N){return N===93?(e.consume(N),b):P(N)}function b(N){return N===62?(e.consume(N),V):N===45&&i===2?(e.consume(N),b):P(N)}function V(N){return N===null||X(N)?(e.exit("htmlFlowData"),Y(N)):(e.consume(N),V)}function Y(N){return e.exit("htmlFlow"),t(N)}}function t_(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 n_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ya,t,n)}}const r_={name:"htmlText",tokenize:i_};function i_(e,t,n){const r=this;let i,o,l;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),j):b===63?(e.consume(b),v):un(b)?(e.consume(b),T):n(b)}function c(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,w):un(b)?(e.consume(b),h):n(b)}function f(b){return b===45?(e.consume(b),m):n(b)}function d(b){return b===null?n(b):b===45?(e.consume(b),p):X(b)?(l=d,$(b)):(e.consume(b),d)}function p(b){return b===45?(e.consume(b),m):d(b)}function m(b){return b===62?O(b):b===45?p(b):d(b)}function w(b){const V="CDATA[";return b===V.charCodeAt(o++)?(e.consume(b),o===V.length?x:w):n(b)}function x(b){return b===null?n(b):b===93?(e.consume(b),S):X(b)?(l=x,$(b)):(e.consume(b),x)}function S(b){return b===93?(e.consume(b),y):x(b)}function y(b){return b===62?O(b):b===93?(e.consume(b),y):x(b)}function h(b){return b===null||b===62?O(b):X(b)?(l=h,$(b)):(e.consume(b),h)}function v(b){return b===null?n(b):b===63?(e.consume(b),k):X(b)?(l=v,$(b)):(e.consume(b),v)}function k(b){return b===62?O(b):v(b)}function j(b){return un(b)?(e.consume(b),C):n(b)}function C(b){return b===45||kt(b)?(e.consume(b),C):E(b)}function E(b){return X(b)?(l=E,$(b)):ye(b)?(e.consume(b),E):O(b)}function T(b){return b===45||kt(b)?(e.consume(b),T):b===47||b===62||ht(b)?z(b):n(b)}function z(b){return b===47?(e.consume(b),O):b===58||b===95||un(b)?(e.consume(b),L):X(b)?(l=z,$(b)):ye(b)?(e.consume(b),z):O(b)}function L(b){return b===45||b===46||b===58||b===95||kt(b)?(e.consume(b),L):I(b)}function I(b){return b===61?(e.consume(b),P):X(b)?(l=I,$(b)):ye(b)?(e.consume(b),I):z(b)}function P(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,R):X(b)?(l=P,$(b)):ye(b)?(e.consume(b),P):(e.consume(b),W)}function R(b){return b===i?(e.consume(b),i=void 0,M):b===null?n(b):X(b)?(l=R,$(b)):(e.consume(b),R)}function W(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||ht(b)?z(b):(e.consume(b),W)}function M(b){return b===47||b===62||ht(b)?z(b):n(b)}function O(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function $(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),A}function A(b){return ye(b)?Ce(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):F(b)}function F(b){return e.enter("htmlTextData"),l(b)}}const bf={name:"labelEnd",resolveAll:a_,resolveTo:u_,tokenize:c_},o_={tokenize:d_},l_={tokenize:f_},s_={tokenize:p_};function a_(e){let t=-1;const n=[];for(;++t=3&&(c===null||X(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ye(c)?Ce(e,a,"whitespace")(c):a(c))}}const ut={continuation:{tokenize:k_},exit:C_,name:"list",tokenize:b_},w_={partial:!0,tokenize:j_},S_={partial:!0,tokenize:N_};function b_(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 a;function a(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Fc(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(Zl,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Fc(m)&&++l<10?(e.consume(m),u):(!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(ya,r.interrupt?n:f,e.attempt(w_,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ye(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 k_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ya,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ye(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(S_,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function N_(e,t,n){const r=this;return Ce(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 C_(e){e.exit(this.containerState.type)}function j_(e,t,n){const r=this;return Ce(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!ye(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Qm={name:"setextUnderline",resolveTo:E_,tokenize:P_};function E_(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 P_(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ye(c)?Ce(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||X(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const T_={tokenize:A_};function A_(e){const t=this,n=e.attempt(ya,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(LA,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 __={resolveAll:b1()},I_=S1("string"),R_=S1("text");function S1(e){return{resolveAll:b1(e==="text"?M_:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return c(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function K_(e,t){let n=-1;const r=[];let i;for(;++n0){const xt=q.tokenStack[q.tokenStack.length-1];(xt[1]||Xm).call(q,void 0,xt[0])}for(H.position={start:Rn(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Rn(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function cI(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 dI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function C1(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 fI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return C1(e,t);const i={src:zi(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 pI(e,t){const n={src:zi(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 mI(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 hI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return C1(e,t);const i={href:zi(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 gI(e,t){const n={href:zi(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 xI(e,t,n){const r=e.all(t),i=n?yI(n):j1(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function vI(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)},a=gf(t.children[1]),u=l1(t.children[t.children.length-1]);a&&u&&(l.position={start:a,end:u}),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 NI(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,a=l?l.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Zm(t.slice(i),i>0,!1)),o.join("")}function Zm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===qm||o===Jm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===qm||o===Jm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function EI(e,t){const n={type:"text",value:jI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TI={blockquote:iI,break:oI,code:lI,delete:sI,emphasis:aI,footnoteReference:uI,heading:cI,html:dI,imageReference:fI,image:pI,inlineCode:mI,linkReference:hI,link:gI,listItem:xI,list:vI,paragraph:wI,root:SI,strong:bI,table:kI,tableCell:CI,tableRow:NI,text:EI,thematicBreak:PI,toml:jl,yaml:jl,definition:jl,footnoteDefinition:jl};function jl(){}const E1=-1,va=0,ho=1,Ds=2,kf=3,Nf=4,Cf=5,jf=6,P1=7,T1=8,eh=typeof self=="object"?self:globalThis,AI=(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 va:case E1:return n(l,i);case ho:{const a=n([],i);for(const u of l)a.push(r(u));return a}case Ds:{const a=n({},i);for(const[u,c]of l)a[r(u)]=r(c);return a}case kf:return n(new Date(l),i);case Nf:{const{source:a,flags:u}=l;return n(new RegExp(a,u),i)}case Cf:{const a=n(new Map,i);for(const[u,c]of l)a.set(r(u),r(c));return a}case jf:{const a=n(new Set,i);for(const u of l)a.add(r(u));return a}case P1:{const{name:a,message:u}=l;return n(new eh[a](u),i)}case T1: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:a}=new Uint8Array(l);return n(new DataView(a),l)}}return n(new eh[o](l),i)};return r},th=e=>AI(new Map,e)(0),Ur="",{toString:_I}={},{keys:II}=Object,qi=e=>{const t=typeof e;if(t!=="object"||!e)return[va,t];const n=_I.call(e).slice(8,-1);switch(n){case"Array":return[ho,Ur];case"Object":return[Ds,Ur];case"Date":return[kf,Ur];case"RegExp":return[Nf,Ur];case"Map":return[Cf,Ur];case"Set":return[jf,Ur];case"DataView":return[ho,n]}return n.includes("Array")?[ho,n]:n.includes("Error")?[P1,n]:[Ds,n]},El=([e,t])=>e===va&&(t==="function"||t==="symbol"),RI=(e,t,n,r)=>{const i=(l,a)=>{const u=r.push(l)-1;return n.set(a,u),u},o=l=>{if(n.has(l))return n.get(l);let[a,u]=qi(l);switch(a){case va:{let f=l;switch(u){case"bigint":a=T1,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([E1],l)}return i([a,f],l)}case ho:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const f=[],d=i([a,f],l);for(const p of l)f.push(o(p));return d}case Ds:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([a,f],l);for(const p of II(l))(e||!El(qi(l[p])))&&f.push([o(p),o(l[p])]);return d}case kf:return i([a,l.toISOString()],l);case Nf:{const{source:f,flags:d}=l;return i([a,{source:f,flags:d}],l)}case Cf:{const f=[],d=i([a,f],l);for(const[p,m]of l)(e||!(El(qi(p))||El(qi(m))))&&f.push([o(p),o(m)]);return d}case jf:{const f=[],d=i([a,f],l);for(const p of l)(e||!El(qi(p)))&&f.push(o(p));return d}}const{message:c}=l;return i([a,{name:u,message:c}],l)};return o},nh=(e,{json:t,lossy:n}={})=>{const r=[];return RI(!(t||n),!!t,new Map,r)(e),r},zs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?th(nh(e,t)):structuredClone(e):(e,t)=>th(nh(e,t));function MI(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 LI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function OI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||MI,r=e.options.footnoteBackLabel||LI,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&w.push({type:"text",value:" "});let h=typeof n=="string"?n:n(u,m);typeof h=="string"&&(h={type:"text",value:h}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(h)?h:[h]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const h=S.children[S.children.length-1];h&&h.type==="text"?h.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else f.push(...w);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` `}]}}const A1=function(e){if(e==null)return BI;if(typeof e=="function")return wa(e);if(typeof e=="object")return Array.isArray(e)?DI(e):zI(e);if(typeof e=="string")return FI(e);throw new Error("Expected function, string, or object as test")};function DI(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=_1,w,x,S;if((!t||o(u,c,f[f.length-1]||void 0))&&(m=WI(n(u,f)),m[0]===rh))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==VI)for(x=(r?y.children.length:-1)+l,S=f.concat(y);x>-1&&x0&&n.push({type:"text",value:` `}),n}function ih(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function oh(e,t){const n=KI(e,t),r=n.one(e,void 0),i=OI(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` `},i),o}function JI(e,t){return e&&"run"in e?async function(n,r){const i=oh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return oh(n,{file:r,...e||t})}}function lh(e){if(e)throw e}var es=Object.prototype.hasOwnProperty,R1=Object.prototype.toString,sh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,uh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):R1.call(t)==="[object Array]"},ch=function(t){if(!t||R1.call(t)!=="[object Object]")return!1;var n=es.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&es.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||es.call(t,i)},dh=function(t,n){sh&&n.name==="__proto__"?sh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},fh=function(t,n){if(n==="__proto__")if(es.call(t,n)){if(ah)return ah(t,n).value}else return;return t[n]},ZI=function e(){var t,n,r,i,o,l,a=arguments[0],u=1,c=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ul.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const ln={basename:nR,dirname:rR,extname:iR,join:oR,sep:"/"};function nR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jo(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,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function rR(e){if(Jo(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 iR(e){Jo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===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 oR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function sR(e,t){let n="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),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 a===46&&o>-1?o++:o=-1}return n}function Jo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aR={cwd:uR};function uR(){return"/"}function Vc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cR(e){if(typeof e=="string")e=new URL(e);else if(!Vc(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 dR(e)}function dR(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]=f;const x=r[p][1];Uc(x)&&Uc(m)&&(m=fu(!0,x,m)),r[p]=[c,m,...w]}}}}const hR=new Ef().freeze();function gu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yu(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 mh(e){if(!Uc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pl(e){return gR(e)?e:new M1(e)}function gR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xR(e){return typeof e=="string"||yR(e)}function yR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gh=[],xh={allowDangerousHtml:!0},wR=/^(https?|ircs?|mailto|xmpp)$/i,SR=[{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 bR(e){const t=kR(e),n=NR(e);return CR(t.runSync(t.parse(n),n),e)}function kR(e){const t=e.rehypePlugins||gh,n=e.remarkPlugins||gh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xh}:xh;return hR().use(rI).use(n).use(JI,r).use(t)}function NR(e){const t=e.children||"",n=new M1;return typeof t=="string"&&(n.value=t),n}function CR(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||jR;for(const f of SR)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+vR+f.id,void 0);return I1(e,c),OT(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function c(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in uu)if(Object.hasOwn(uu,m)&&Object.hasOwn(f.properties,m)){const w=f.properties[m],x=uu[m];(x===null||x.includes(f.tagName))&&(f.properties[m]=u(String(w||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(f,d,p)),m&&p&&typeof d=="number")return a&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function jR(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||wR.test(e.slice(0,t))?e:""}const L1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...a},u)=>{const c=g.useRef(null),f=()=>{var d;(d=c.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),s.jsxs("div",{className:ce("flex h-full flex-col",e),ref:u,...a,children:[s.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:s.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>s.jsxs("div",{className:ce("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&s.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:s.jsx(ti,{className:"h-4 w-4 text-primary-foreground"})}),s.jsxs("div",{className:ce("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[s.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[s.jsx("span",{children:d.role==="user"?"You":d.assistantInfo?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:d.assistantInfo.name}),d.assistantInfo.type!=="default"&&s.jsx("span",{className:ce("inline-block px-1.5 py-0.5 rounded text-[10px] font-medium ml-1",d.assistantInfo.type==="user"&&"bg-blue-100 text-blue-700",d.assistantInfo.type==="template"&&"bg-gray-100 text-gray-700",d.assistantInfo.type==="new"&&"bg-green-100 text-green-700"),children:d.assistantInfo.type==="user"?"Mine":d.assistantInfo.type==="template"?"Template":"New"}),d.assistantInfo.originalTemplate&&s.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",d.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),s.jsx("span",{children:"•"}),s.jsxs("span",{children:["#",p+1]})]}),s.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:s.jsx(bR,{components:{p:({children:m})=>s.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>s.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>s.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>s.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?s.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):s.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>s.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>s.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>s.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>s.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>s.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>s.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>s.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:d.content})})]}),d.role==="user"&&s.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:s.jsx(Vd,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),s.jsx("div",{ref:c})]}),s.jsx("div",{className:"border-t p-4",children:s.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[s.jsx(Gd,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?s.jsx(J,{type:"button",onClick:l,variant:"outline",size:"icon",children:s.jsx(ON,{className:"h-4 w-4"})}):s.jsx(J,{type:"submit",disabled:!n.trim(),size:"icon",children:s.jsx(PN,{className:"h-4 w-4"})})]})})]})});L1.displayName="Chat";function ER({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:a}){return s.jsxs(s.Fragment,{children:[s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsx(Lt,{className:"text-base",children:"Model"})}),s.jsx(Ye,{className:"space-y-4",children:s.jsx("div",{children:s.jsxs(Do,{value:t||"",onValueChange:n,children:[s.jsx(ji,{className:"w-full",children:s.jsx(zo,{placeholder:"Select a model...",children:t&&(()=>{const u=e.find(f=>f.model_name===t);if(!u)return t;const c=u.type==="api";return s.jsxs("div",{className:"flex items-center gap-2",children:[c?s.jsx(Ps,{className:"h-4 w-4 text-blue-500"}):u.supports_thinking?s.jsx(Er,{className:"h-4 w-4 text-purple-500"}):s.jsx(yc,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{className:"truncate",children:u.name}),r===t?s.jsx(xe,{variant:"outline",className:"text-xs",children:"Loading..."}):s.jsx(xe,{variant:"outline",className:"text-xs",children:c?"API":u.is_loaded?"Loaded":"Available"})]})})()})}),s.jsxs(Ei,{children:[s.jsxs(fi,{children:[s.jsx(Sr,{children:"🌐 API Models"}),e.filter(u=>u.type==="api").map(u=>s.jsx(St,{value:u.model_name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ps,{className:"h-4 w-4 text-blue-500"}),s.jsx("span",{children:u.name}),s.jsx(xe,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},u.model_name))]}),s.jsxs(fi,{children:[s.jsx(Sr,{children:"💻 Local Models"}),e.filter(u=>u.type==="local").map(u=>s.jsx(St,{value:u.model_name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[u.supports_thinking?s.jsx(Er,{className:"h-4 w-4 text-purple-500"}):s.jsx(yc,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:u.name}),r===u.model_name?s.jsx(xe,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):u.is_loaded?s.jsx(xe,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):s.jsx(xe,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},u.model_name))]})]})]})})})]}),s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsx(Lt,{className:"text-base",children:"Parameters"})}),s.jsxs(Ye,{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(Te,{className:"text-sm font-medium",children:"Temperature"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:i})]}),s.jsx(Fo,{value:[i],onValueChange:u=>o(u[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[s.jsx("span",{children:"0.0 (Focused)"}),s.jsx("span",{children:"1.0 (Balanced)"}),s.jsx("span",{children:"2.0 (Creative)"})]}),s.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:i<=.3?"🎯 Very focused and deterministic responses":i<=.7?"⚖️ Balanced creativity and consistency":i<=1.2?"🎨 More creative and varied responses":"🚀 Highly creative, unpredictable responses"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(Te,{className:"text-sm font-medium",children:"Max Tokens"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:l})]}),s.jsx(Fo,{value:[l],onValueChange:u=>a(u[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[s.jsx("span",{children:"50 (Short)"}),s.jsx("span",{children:"1024 (Medium)"}),s.jsx("span",{children:"4000 (Long)"})]}),s.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:l<=200?"📝 Brief responses, good for quick answers":l<=1e3?"📄 Medium responses, balanced length":l<=2e3?"📋 Long responses, detailed explanations":"📚 Very long responses, comprehensive content"})]})]})]})]})}function PR({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:a,clearCurrentAssistant:u,openRenameDialog:c,systemPrompt:f}){const d=x=>{if(x==="create_new")a();else if(x==="clear_current")u();else if(x.startsWith("user_")){const S=x.replace("user_","");t(S)}else i(x)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=x=>{switch(x){case"user":return{variant:"secondary",text:"Mine"};case"template":return{variant:"outline",text:"Template"};case"new":return{variant:"default",text:"New",className:"bg-green-100 text-green-700"}}},w=e.length+r.length;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),s.jsxs(Do,{value:p(),onValueChange:d,children:[s.jsx(ji,{className:"w-full",children:s.jsx(zo,{placeholder:`Choose assistant (${w} available)`,children:l?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),s.jsx("span",{children:l.name}),l.originalTemplate&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),s.jsx(xe,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),s.jsx("span",{children:"Choose assistant"}),s.jsx(xe,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),s.jsxs(Ei,{children:[s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Ts,{className:"h-4 w-4"}),"Actions"]}),s.jsx(St,{value:"create_new",children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(Ts,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),s.jsx(xe,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&s.jsx(St,{value:"clear_current",children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ry,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Vd,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(x=>s.jsx(St,{value:`user_${x.id}`,children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ti,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{className:"truncate flex-1",children:x.name}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${x.id}`))]}),r.length>0&&s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(qk,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(x=>s.jsx(St,{value:x.name,children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ti,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"truncate flex-1",children:x.name}),s.jsx(xe,{variant:"outline",className:"text-xs",children:"Template"})]})},x.name))]}),w===0&&s.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&s.jsxs(J,{onClick:c,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[s.jsx(ui,{className:"h-4 w-4 mr-2"}),"Rename"]}),s.jsxs(J,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!f.trim(),children:[s.jsx(ey,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function TR({systemPrompt:e,setSystemPrompt:t,isLoading:n}){const r=[{title:"Helpful Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses. If you're unsure about something, say so."},{title:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include helpful comments."},{title:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{title:"Teacher/Tutor",prompt:"You are a patient and knowledgeable teacher. Break down complex concepts into simple, understandable parts. Use examples and analogies to help explain ideas."}],i=["Be specific about the assistant's role and expertise","Include desired communication style and tone","Specify output format if needed (lists, paragraphs, etc.)","Add ethical guidelines and behavior expectations"];return s.jsxs("div",{className:"space-y-4 pb-6",children:[s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsx(Lt,{className:"text-base",children:"System Instructions"})}),s.jsx(Ye,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(Te,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),s.jsx("textarea",{value:e,onChange:o=>t(o.target.value),placeholder:"Define your AI assistant's role, personality, and behavior...",className:"w-full 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-none overflow-y-auto",disabled:n}),s.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"text-sm flex items-center",children:[s.jsx(Er,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),s.jsx(Ye,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsx(Te,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),s.jsxs(Do,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[s.jsx(ji,{className:"w-full h-10",children:s.jsx(zo,{placeholder:"Select example prompt..."})}),s.jsx(Ei,{children:s.jsxs(fi,{children:[s.jsx(Sr,{children:"Example Prompts"}),r.map((o,l)=>s.jsx(St,{value:l.toString(),children:s.jsxs("div",{className:"flex flex-col items-start",children:[s.jsx("span",{className:"font-medium text-sm",children:o.title}),s.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"text-sm flex items-center",children:[s.jsx(ia,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),s.jsx(Ye,{children:s.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"inline-block w-1.5 h-1.5 bg-blue-400 rounded-full mt-1.5 mr-2 flex-shrink-0"}),o]},l))})})]})]})}function AR(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:a,sendMessage:u,stopGeneration:c,isLoading:f,selectedModel:d,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:x,setTemperature:S,maxTokens:y,setMaxTokens:h}=Qv(),[v,k]=g.useState(!1),[j,C]=g.useState(3),[E,T]=g.useState(!1),[z,L]=g.useState(!1),[I,P]=g.useState(null),[R,W]=g.useState(!1),[M,O]=g.useState(null),[$,A]=g.useState([]),[F,b]=g.useState([]),[V,Y]=g.useState(null),[N,re]=g.useState(!1),[fe,ie]=g.useState(""),[K,ne]=g.useState(!1),[he,oe]=g.useState(""),de=()=>{try{const D=JSON.parse(localStorage.getItem("savedAssistants")||"[]");b(D)}catch(D){console.error("Failed to load saved assistants:",D)}},me=()=>{if(!m.trim())return;let D="My Assistant";V&&(V.type==="new"?D=V.name:V.type==="template"?D=`My ${V.name}`:D=V.name+" Copy"),ie(D),re(!0)},He=()=>{if(!fe.trim()||!m.trim())return;const D={id:Date.now().toString(),name:fe.trim(),systemPrompt:m,temperature:x,maxTokens:y,model:d,ragEnabled:v,retrievalCount:j,documents:[],createdAt:new Date().toISOString()},Q=[...F,D];b(Q),localStorage.setItem("savedAssistants",JSON.stringify(Q)),Y({id:D.id,name:D.name,type:"user"}),re(!1),ie("")},rt=()=>{re(!1),ie("")},Zt=D=>{const Q=F.find(ge=>ge.id===D);Q&&(w(Q.systemPrompt),S(Q.temperature),h(Q.maxTokens),k(Q.ragEnabled||!1),C(Q.retrievalCount||3),Q.model&&p(Q.model),Y({id:Q.id,name:Q.name,type:"user"}))},zt=BE(),en=D=>{const Q=zt.find(ge=>ge.name===D);Q&&(w(Q.prompt),k(!1),C(3),Y({id:D,name:Q.name,type:"template"}))},Fi=()=>{w(""),S(.7),h(1024),k(!1),C(3),Y({id:"new_assistant",name:"New Assistant",type:"new"})},xn=()=>{Y(null)},Zo=()=>{V&&(oe(V.name),ne(!0))},el=()=>{if(!V||!he.trim())return;const D={...V,name:he.trim()};if(Y(D),V.type==="user"){const Q=F.map(ge=>ge.id===V.id?{...ge,name:he.trim()}:ge);b(Q),localStorage.setItem("savedAssistants",JSON.stringify(Q))}ne(!1),oe("")},tl=()=>{ne(!1),oe("")},Sa=()=>({name:(V==null?void 0:V.name)||"Default Assistant",type:(V==null?void 0:V.type)||"default",systemPrompt:m,temperature:x,maxTokens:y,originalTemplate:V==null?void 0:V.originalTemplate}),dr=()=>{V&&V.type==="template"&&Y({id:"new_assistant",name:`Custom ${V.name}`,type:"new",originalTemplate:V.name})},ba=D=>{w(D),dr()},_=D=>{S(D),dr()},H=D=>{h(D),dr()},q=D=>{k(D),dr()},se=D=>{C(D),dr()};g.useEffect(()=>{Ft(),de();const D=localStorage.getItem("loadAssistantConfig");if(D)try{const Q=JSON.parse(D);w(Q.systemPrompt||""),S(Q.temperature||.7),h(Q.maxTokens||1024),Q.model&&p(Q.model),Y({id:"loaded_template",name:Q.name||"Loaded Template",type:"template"}),localStorage.removeItem("loadAssistantConfig")}catch(Q){console.error("Failed to load assistant config:",Q),localStorage.removeItem("loadAssistantConfig")}},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:E,configCollapsed:z,sessionsCount:e.length,currentSessionId:t})},[E,z,e.length,t]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(D=>({id:D.id,title:D.title})))},[e]),g.useEffect(()=>{if(d&&!$.find(D=>D.model_name===d)){const D=$[0];D&&p(D.model_name)}},[$,d,p]),g.useEffect(()=>{(async()=>{if(!d||!$.length)return;const Q=$.find(ze=>ze.model_name===d);if(!Q)return;const ge=`${window.location.protocol}//${window.location.host}`;if(Q.type==="local"&&!Q.is_loaded){O(Q),W(!0);return}const be=$.filter(ze=>ze.type==="local"&&ze.is_loaded&&ze.model_name!==d);for(const ze of be)try{(await fetch(`${ge}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ze.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ze.model_name}`)}catch(at){console.error(`Error auto-unloading model ${ze.model_name}:`,at)}be.length>0&&Ft()})()},[d,$]);const we=async()=>{if(M){W(!1),P(M.model_name);try{const D=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${D}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:M.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${M.model_name}`),Ft();else{console.error(`❌ Failed to load model: ${M.model_name}`);const ge=$.find(be=>be.type==="api");ge&&p(ge.model_name)}}catch(D){console.error("Error loading model:",D);const Q=$.find(ge=>ge.type==="api");Q&&p(Q.model_name)}finally{P(null),O(null)}}},xt=()=>{W(!1),O(null);const D=$.find(Q=>Q.type==="api");D&&p(D.model_name)};g.useEffect(()=>{const D=async()=>{const Q=`${window.location.protocol}//${window.location.host}`,ge=$.filter(be=>be.type==="local"&&be.is_loaded);for(const be of ge)try{await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:be.model_name})}),console.log(`✅ Cleanup: unloaded ${be.model_name}`)}catch(ze){console.error(`Error cleaning up model ${be.model_name}:`,ze)}};return()=>{D()}},[$]);const Ft=async()=>{try{const D=`${window.location.protocol}//${window.location.host}`,Q=await fetch(`${D}/models`);if(Q.ok){const ge=await Q.json();if(A(ge.models),ge.current_model&&d!==ge.current_model)p(ge.current_model);else if(!d&&ge.models.length>0){const ze=ge.models.find(at=>at.type==="api")||ge.models[0];p(ze.model_name)}}}catch(D){console.error("Failed to fetch models:",D)}};return s.jsxs("div",{className:"h-screen bg-background flex",children:[s.jsx("div",{className:` bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out ${E?"w-12":"w-80"} `,children:s.jsxs("div",{className:"p-4 space-y-4 h-full",children:[s.jsxs("div",{className:`flex items-center ${E?"justify-center":"justify-between"}`,children:[!E&&s.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),s.jsxs("div",{className:"flex gap-1",children:[!E&&s.jsxs(J,{onClick:i,size:"sm",children:[s.jsx(Ts,{className:"h-4 w-4 mr-1"}),"New"]}),s.jsx(J,{onClick:()=>T(!E),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:E?"Expand Sessions":"Collapse Sessions",children:E?s.jsx(Jp,{className:"h-4 w-4"}):s.jsx(qp,{className:"h-4 w-4"})})]})]}),E&&s.jsx(J,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:s.jsx(Ts,{className:"h-4 w-4"})}),s.jsxs("div",{className:"space-y-2",children:[!E&&e.map(D=>s.jsxs(Ie,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===D.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",D.id,D.title),n(D.id)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium truncate",children:D.title}),s.jsx(J,{size:"sm",variant:"ghost",onClick:Q=>{Q.stopPropagation(),r(D.id)},className:"h-6 w-6 p-0",children:s.jsx(ty,{className:"h-3 w-3"})})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[D.messages.length," messages"]})]},D.id)),E&&e.map(D=>s.jsxs(J,{variant:t===D.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:D.title,onClick:()=>{console.log("Session icon clicked:",D.id,D.title),n(D.id)},children:[s.jsx(ia,{className:"h-4 w-4"}),D.messages&&D.messages.length>0&&s.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(D.messages.length,9)})]},D.id))]})]})}),s.jsx("div",{className:"flex-1 flex flex-col h-full",children:s.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[s.jsx("div",{className:"flex-1 flex flex-col",children:s.jsx(L1,{messages:o.map(D=>({id:D.id,role:D.role,content:D.content,createdAt:new Date(D.timestamp),assistantInfo:D.assistantInfo})),input:l,handleInputChange:D=>a(D.target.value),handleSubmit:async D=>{if(D.preventDefault(),!d||!$.find(be=>be.model_name===d))return;const Q=Sa();await u(Q,{useRag:v,retrievalCount:j})},isGenerating:f,stop:c,className:"flex-1"})}),s.jsx("div",{className:` border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out ${z?"w-12":"w-[480px] xl:w-[520px]"} `,children:s.jsxs("div",{className:"p-4 space-y-4 h-full",children:[s.jsxs("div",{className:`flex items-center ${z?"justify-center":"justify-between"}`,children:[!z&&s.jsx("h2",{className:"font-semibold",children:"Configuration"}),s.jsx("div",{className:"flex gap-1",children:s.jsx(J,{onClick:()=>L(!z),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:z?"Expand Configuration":"Collapse Configuration",children:z?s.jsx(qp,{className:"h-4 w-4"}):s.jsx(Jp,{className:"h-4 w-4"})})})]}),z&&s.jsx(J,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:s.jsx(ui,{className:"h-4 w-4"})}),s.jsx("div",{className:"space-y-2",children:!z&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:s.jsx(PR,{savedAssistants:F,loadSavedAssistant:Zt,openSaveDialog:me,presets:zt,onPresetSelect:en,isLoading:f,selectedAssistant:V,createNewAssistant:Fi,clearCurrentAssistant:xn,openRenameDialog:Zo,systemPrompt:m})}),s.jsxs(cP,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[s.jsxs(h0,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[s.jsxs(Hl,{value:"parameters",className:"flex items-center gap-2",children:[s.jsx(MN,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),s.jsxs(Hl,{value:"instructions",className:"flex items-center gap-2",children:[s.jsx(ui,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),s.jsxs(Hl,{value:"documents",className:"flex items-center gap-2",children:[s.jsx(ra,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),s.jsxs("div",{className:"flex-1 overflow-hidden",children:[s.jsx(Wl,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(ER,{models:$,selectedModel:d,setSelectedModel:p,autoLoadingModel:I,temperature:x,setTemperature:_,maxTokens:y,setMaxTokens:H})}),s.jsx(Wl,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(TR,{systemPrompt:m,setSystemPrompt:ba,isLoading:f})}),s.jsx(Wl,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(Yv,{isLoading:f,ragEnabled:v,setRagEnabled:q,retrievalCount:j,setRetrievalCount:se,currentAssistant:V})})]})]})]})})]})})]})}),s.jsx(su,{open:R,onOpenChange:W,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Load Local Model"}),s.jsxs(Xl,{children:["Loading ",s.jsx("strong",{children:M==null?void 0:M.name})," will use approximately ",s.jsx("strong",{children:M==null?void 0:M.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:xt,children:"Cancel"}),s.jsx(ql,{onClick:we,children:"Load Model"})]})]})}),s.jsx(su,{open:N,onOpenChange:re,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Save Assistant"}),s.jsx(Xl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),s.jsxs("div",{className:"py-4",children:[s.jsx(Te,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),s.jsx("input",{id:"assistant-name",type:"text",value:fe,onChange:D=>ie(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter a name for your assistant...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&fe.trim()&&He(),D.key==="Escape"&&rt()}}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[fe.length,"/100 characters"]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:rt,children:"Cancel"}),s.jsxs(ql,{onClick:He,disabled:!fe.trim(),children:[s.jsx(ey,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),s.jsx(su,{open:K,onOpenChange:ne,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Rename Assistant"}),s.jsxs(Xl,{children:['Enter a new name for "',V==null?void 0:V.name,'".']})]}),s.jsxs("div",{className:"py-4",children:[s.jsx(Te,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),s.jsx("input",{id:"rename-assistant-name",type:"text",value:he,onChange:D=>oe(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter new assistant name...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&he.trim()&&el(),D.key==="Escape"&&tl()}}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[he.length,"/100 characters"]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:tl,children:"Cancel"}),s.jsxs(ql,{onClick:el,disabled:!he.trim(),children:[s.jsx(ui,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function _R(){const e=Lr(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,l]=g.useState(null);g.useEffect(()=>{a()},[]);const a=async()=>{try{const f=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${f}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const p=await d.json();n(p.models)}catch(f){console.error("Error fetching models:",f)}finally{i(!1)}},u=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);a()}catch(d){console.error("Error loading model:",d)}finally{l(null)}},c=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);a()}catch(d){console.error("Error unloading model:",d)}finally{l(null)}};return r?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx(xc,{className:"h-8 w-8 animate-spin"})}):s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:s.jsx(ra,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),s.jsxs(J,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[s.jsx(yc,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),s.jsx("div",{className:"flex-1 p-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[s.jsx(Ie,{className:"bg-blue-50 border-blue-200",children:s.jsx(Ye,{className:"pt-6",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Zx,{className:"h-5 w-5 text-blue-600 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),s.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."})]})]})})}),s.jsxs("div",{children:[s.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[s.jsx(Ps,{className:"h-5 w-5"}),"API Models",s.jsx(xe,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(f=>f.type==="api").map(f=>s.jsx(yh,{model:f,modelLoading:o,onLoad:u,onUnload:c},f.model_name))})]}),s.jsxs("div",{children:[s.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[s.jsx(Jx,{className:"h-5 w-5"}),"Local Models",s.jsx(xe,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(f=>f.type==="local").map(f=>s.jsx(yh,{model:f,modelLoading:o,onLoad:u,onUnload:c},f.model_name))})]})]})})]})}function yh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return s.jsxs(Ie,{className:"hover:shadow-md transition-shadow",children:[s.jsx(Mt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs(Lt,{className:"text-base flex items-center gap-2",children:[i?s.jsx(Ps,{className:"h-4 w-4 text-blue-600"}):s.jsx(Jx,{className:"h-4 w-4 text-green-600"}),e.name]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&s.jsx(aN,{className:"h-5 w-5 text-green-600"})]})}),s.jsxs(Ye,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Size:"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.size_gb})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Type:"}),s.jsx(xe,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Features:"}),s.jsxs(xe,{variant:"outline",className:"text-xs",children:[s.jsx(Er,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),s.jsx("div",{className:"pt-2",children:l?s.jsxs(J,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?s.jsx(xc,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(ty,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):s.jsxs(J,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?s.jsx(xc,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(fN,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function IR(){return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto p-6",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:s.jsx(ui,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),s.jsx("div",{className:"flex-1 p-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"flex items-center gap-2",children:[s.jsx(AN,{className:"h-5 w-5"}),"Server Configuration"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium",children:"Backend URL"}),s.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium",children:"Frontend URL"}),s.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"flex items-center gap-2",children:[s.jsx(em,{className:"h-5 w-5"}),"Privacy & Security"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(em,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),s.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),s.jsxs(Ie,{children:[s.jsx(Mt,{children:s.jsxs(Lt,{className:"flex items-center gap-2",children:[s.jsx(Zx,{className:"h-5 w-5"}),"System Information"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium",children:"Platform"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(xe,{variant:"outline",children:"Local"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-sm font-medium",children:"Status"}),s.jsx("div",{className:"mt-1",children:s.jsx(xe,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function RR(){return s.jsx(ak,{children:s.jsxs(tk,{children:[s.jsx(rn,{path:"/",element:s.jsx(rC,{})}),s.jsx(rn,{path:"/technology",element:s.jsx(sC,{})}),s.jsx(rn,{path:"/usecases",element:s.jsx(aC,{})}),s.jsx(rn,{path:"/mydevice",element:s.jsx(VE,{})}),s.jsxs(rn,{path:"/",element:s.jsx(XN,{}),children:[s.jsx(rn,{path:"templates",element:s.jsx(WE,{})}),s.jsx(rn,{path:"playground",element:s.jsx(AR,{})}),s.jsx(rn,{path:"models",element:s.jsx(_R,{})}),s.jsx(rn,{path:"settings",element:s.jsx(IR,{})})]})]})})}vu.createRoot(document.getElementById("root")).render(s.jsx(Ht.StrictMode,{children:s.jsx(RR,{})})); //# sourceMappingURL=index-0da51a3f.js.map