diff --git "a/static/assets/index-b949d73e.js" "b/static/assets/index-b949d73e.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-b949d73e.js" @@ -0,0 +1,310 @@ +function E1(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xh={exports:{}},ws={},qh={exports:{}},te={};/** + * @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 Ti=Symbol.for("react.element"),b1=Symbol.for("react.portal"),N1=Symbol.for("react.fragment"),P1=Symbol.for("react.strict_mode"),_1=Symbol.for("react.profiler"),T1=Symbol.for("react.provider"),j1=Symbol.for("react.context"),R1=Symbol.for("react.forward_ref"),A1=Symbol.for("react.suspense"),I1=Symbol.for("react.memo"),M1=Symbol.for("react.lazy"),af=Symbol.iterator;function O1(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Jh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zh=Object.assign,em={};function vo(e,t,n){this.props=e,this.context=t,this.refs=em,this.updater=n||Jh}vo.prototype.isReactComponent={};vo.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")};vo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tm(){}tm.prototype=vo.prototype;function Cc(e,t,n){this.props=e,this.context=t,this.refs=em,this.updater=n||Jh}var Ec=Cc.prototype=new tm;Ec.constructor=Cc;Zh(Ec,vo.prototype);Ec.isPureReactComponent=!0;var uf=Array.isArray,nm=Object.prototype.hasOwnProperty,bc={current:null},rm={key:!0,ref:!0,__self:!0,__source:!0};function om(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)nm.call(t,r)&&!rm.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,U=_[j];if(0>>1;jo(ue,k))Zo(G,ue)?(_[j]=G,_[Z]=k,j=Z):(_[j]=ue,_[X]=k,j=X);else if(Zo(G,k))_[j]=G,_[Z]=k,j=Z;else break e}}return z}function o(_,z){var k=_.sortIndex-z.sortIndex;return k!==0?k:_.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],d=1,c=null,p=3,h=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(_){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=_)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function C(_){if(y=!1,x(_),!w)if(n(a)!==null)w=!0,$(N);else{var z=n(u);z!==null&&W(C,z.startTime-_)}}function N(_,z){w=!1,y&&(y=!1,m(R),R=-1),h=!0;var k=p;try{for(x(z),c=n(a);c!==null&&(!(c.expirationTime>z)||_&&!M());){var j=c.callback;if(typeof j=="function"){c.callback=null,p=c.priorityLevel;var U=j(c.expirationTime<=z);z=e.unstable_now(),typeof U=="function"?c.callback=U:c===n(a)&&r(a),x(z)}else r(a);c=n(a)}if(c!==null)var E=!0;else{var X=n(u);X!==null&&W(C,X.startTime-z),E=!1}return E}finally{c=null,p=k,h=!1}}var b=!1,P=null,R=-1,L=5,A=-1;function M(){return!(e.unstable_now()-A_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var k=p;p=z;try{return _()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var k=p;p=_;try{return z()}finally{p=k}},e.unstable_scheduleCallback=function(_,z,k){var j=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0j?(_.sortIndex=k,t(u,_),n(a)===null&&_===n(u)&&(y?(m(R),R=-1):y=!0,W(C,k-j))):(_.sortIndex=U,t(a,_),w||h||(w=!0,$(N))),_},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(_){var z=p;return function(){var k=p;p=z;try{return _.apply(this,arguments)}finally{p=k}}}})(um);am.exports=um;var K1=am.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 G1=g,gt=K1;function F(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"),Ja=Object.prototype.hasOwnProperty,Y1=/^[: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]*$/,df={},ff={};function Q1(e){return Ja.call(ff,e)?!0:Ja.call(df,e)?!1:Y1.test(e)?ff[e]=!0:(df[e]=!0,!1)}function X1(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 q1(e,t,n,r){if(t===null||typeof t>"u"||X1(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 Je(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Je(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){Be[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var _c=/[\-:]([a-z])/g;function Tc(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(_c,Tc);Be[t]=new Je(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(_c,Tc);Be[t]=new Je(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(_c,Tc);Be[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function jc(e,t,n,r){var o=Be.hasOwnProperty(t)?Be[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var a=` +`+o[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{na=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Vo(e):""}function J1(e){switch(e.tag){case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return e=ra(e.type,!1),e;case 11:return e=ra(e.type.render,!1),e;case 1:return e=ra(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 zr:return"Fragment";case Dr:return"Portal";case Za:return"Profiler";case Rc:return"StrictMode";case eu:return"Suspense";case tu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fm:return(e.displayName||"Context")+".Consumer";case dm:return(e._context.displayName||"Context")+".Provider";case Ac:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ic:return t=e.displayName||null,t!==null?t:nu(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return nu(e(t))}catch{}}return null}function Z1(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===Rc?"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 Wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ew(e){var t=hm(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.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 Vi(e){e._valueTracker||(e._valueTracker=ew(e))}function mm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=hm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ru(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wn(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 gm(e,t){t=t.checked,t!=null&&jc(e,"checked",t,!1)}function ou(e,t){gm(e,t);var n=Wn(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")?iu(e,t.type,n):t.hasOwnProperty("defaultValue")&&iu(e,t.type,Wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mf(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 iu(e,t,n){(t!=="number"||Dl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function Qr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Hi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ai(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qo={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},tw=["Webkit","ms","Moz","O"];Object.keys(Qo).forEach(function(e){tw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qo[t]=Qo[e]})});function wm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qo.hasOwnProperty(e)&&Qo[e]?(""+t).trim():t+"px"}function Sm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=wm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var nw=Ne({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(nw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function uu(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 cu=null;function Mc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var du=null,Xr=null,qr=null;function vf(e){if(e=Ai(e)){if(typeof du!="function")throw Error(F(280));var t=e.stateNode;t&&(t=bs(t),du(e.stateNode,e.type,t))}}function km(e){Xr?qr?qr.push(e):qr=[e]:Xr=e}function Cm(){if(Xr){var e=Xr,t=qr;if(qr=Xr=null,vf(e),t)for(e=0;e>>=0,e===0?32:31-(pw(e)/hw|0)|0}var Wi=64,Ki=4194304;function Wo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $l(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=Wo(s):(i&=l,i!==0&&(r=Wo(i)))}else l=n&~o,l!==0?r=Wo(l):i!==0&&(r=Wo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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 ji(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function vw(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=qo),Pf=String.fromCharCode(32),_f=!1;function Vm(e,t){switch(e){case"keyup":return Kw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fr=!1;function Yw(e,t){switch(e){case"compositionend":return Hm(t);case"keypress":return t.which!==32?null:(_f=!0,Pf);case"textInput":return e=t.data,e===Pf&&_f?null:e;default:return null}}function Qw(e,t){if(Fr)return e==="compositionend"||!Uc&&Vm(e,t)?(e=$m(),vl=Fc=An=null,Fr=!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=Af(n)}}function Ym(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ym(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qm(){for(var e=window,t=Dl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dl(e.document)}return t}function Vc(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 oS(e){var t=Qm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ym(n.ownerDocument.documentElement,n)){if(r!==null&&Vc(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=If(n,i);var l=If(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>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,Br=null,yu=null,Zo=null,vu=!1;function Mf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vu||Br==null||Br!==Dl(r)||(r=Br,"selectionStart"in r&&Vc(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}),Zo&&hi(Zo,r)||(Zo=r,r=Hl(yu,"onSelect"),0Vr||(e.current=Eu[Vr],Eu[Vr]=null,Vr--)}function ye(e,t){Vr++,Eu[Vr]=e.current,e.current=t}var Kn={},He=qn(Kn),nt=qn(!1),mr=Kn;function so(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function Kl(){Se(nt),Se(He)}function $f(e,t,n){if(He.current!==Kn)throw Error(F(168));ye(He,t),ye(nt,n)}function og(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(F(108,Z1(e)||"Unknown",o));return Ne({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,mr=He.current,ye(He,e),ye(nt,nt.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=og(e,t,mr),r.__reactInternalMemoizedMergedChildContext=e,Se(nt),Se(He),ye(He,e)):Se(nt),ye(nt,n)}var sn=null,Ns=!1,ya=!1;function ig(e){sn===null?sn=[e]:sn.push(e)}function gS(e){Ns=!0,ig(e)}function Jn(){if(!ya&&sn!==null){ya=!0;var e=0,t=he;try{var n=sn;for(he=1;e>=l,o-=l,an=1<<32-Lt(t)+o|n<R?(L=P,P=null):L=P.sibling;var A=p(m,P,x[R],C);if(A===null){P===null&&(P=L);break}e&&P&&A.alternate===null&&t(m,P),v=i(A,v,R),b===null?N=A:b.sibling=A,b=A,P=L}if(R===x.length)return n(m,P),ke&&lr(m,R),N;if(P===null){for(;RR?(L=P,P=null):L=P.sibling;var M=p(m,P,A.value,C);if(M===null){P===null&&(P=L);break}e&&P&&M.alternate===null&&t(m,P),v=i(M,v,R),b===null?N=M:b.sibling=M,b=M,P=L}if(A.done)return n(m,P),ke&&lr(m,R),N;if(P===null){for(;!A.done;R++,A=x.next())A=c(m,A.value,C),A!==null&&(v=i(A,v,R),b===null?N=A:b.sibling=A,b=A);return ke&&lr(m,R),N}for(P=r(m,P);!A.done;R++,A=x.next())A=h(P,m,R,A.value,C),A!==null&&(e&&A.alternate!==null&&P.delete(A.key===null?R:A.key),v=i(A,v,R),b===null?N=A:b.sibling=A,b=A);return e&&P.forEach(function(T){return t(m,T)}),ke&&lr(m,R),N}function S(m,v,x,C){if(typeof x=="object"&&x!==null&&x.type===zr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ui:e:{for(var N=x.key,b=v;b!==null;){if(b.key===N){if(N=x.type,N===zr){if(b.tag===7){n(m,b.sibling),v=o(b,x.props.children),v.return=m,m=v;break e}}else if(b.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===_n&&Wf(N)===b.type){n(m,b.sibling),v=o(b,x.props),v.ref=Lo(m,b,x),v.return=m,m=v;break e}n(m,b);break}else t(m,b);b=b.sibling}x.type===zr?(v=hr(x.props.children,m.mode,C,x.key),v.return=m,m=v):(C=Nl(x.type,x.key,x.props,null,m.mode,C),C.ref=Lo(m,v,x),C.return=m,m=C)}return l(m);case Dr:e:{for(b=x.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(m,v.sibling),v=o(v,x.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=ba(x,m.mode,C),v.return=m,m=v}return l(m);case _n:return b=x._init,S(m,v,b(x._payload),C)}if(Ho(x))return w(m,v,x,C);if(Ro(x))return y(m,v,x,C);Zi(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,x),v.return=m,m=v):(n(m,v),v=Ea(x,m.mode,C),v.return=m,m=v),l(m)):n(m,v)}return S}var uo=ug(!0),cg=ug(!1),Xl=qn(null),ql=null,Kr=null,Gc=null;function Yc(){Gc=Kr=ql=null}function Qc(e){var t=Xl.current;Se(Xl),e._currentValue=t}function Pu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zr(e,t){ql=e,Gc=Kr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(tt=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(Gc!==e)if(e={context:e,memoizedValue:t,next:null},Kr===null){if(ql===null)throw Error(F(308));Kr=e,ql.dependencies={lanes:0,firstContext:e}}else Kr=Kr.next=e;return t}var cr=null;function Xc(e){cr===null?cr=[e]:cr.push(e)}function dg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Xc(t)):(n.next=o.next,o.next=n),t.interleaved=n,mn(e,r)}function mn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tn=!1;function qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fg(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 cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mn(e,n)}return o=r.interleaved,o===null?(t.next=t,Xc(r)):(t.next=o.next,o.next=t),r.interleaved=t,mn(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lc(e,n)}}function Kf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=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};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Jl(e,t,n,r){var o=e.updateQueue;Tn=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?i=u:l.next=u,l=a;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=a))}if(i!==null){var c=o.baseState;l=0,d=u=a=null,s=i;do{var p=s.lane,h=s.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(p=t,h=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){c=w.call(h,c,p);break e}c=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,p=typeof w=="function"?w.call(h,c,p):w,p==null)break e;c=Ne({},c,p);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(u=d=h,a=c):d=d.next=h,l|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;p=s,s=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(d===null&&(a=c),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);vr|=l,e.lanes=l,e.memoizedState=c}}function Gf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=xa.transition;xa.transition={};try{e(!1),t()}finally{he=n,xa.transition=r}}function Tg(){return Nt().memoizedState}function wS(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jg(e))Rg(t,n);else if(n=dg(e,t,n,r),n!==null){var o=Xe();Dt(n,e,r,o),Ag(n,t,r)}}function SS(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jg(e))Rg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,zt(s,l)){var a=t.interleaved;a===null?(o.next=o,Xc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=dg(e,t,o,r),n!==null&&(o=Xe(),Dt(n,e,r,o),Ag(n,t,r))}}function jg(e){var t=e.alternate;return e===be||t!==null&&t===be}function Rg(e,t){ei=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ag(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lc(e,n)}}var ts={readContext:bt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},kS={readContext:bt,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,kl(4194308,4,Eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var n=Ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ht();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=wS.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:Yf,useDebugValue:id,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=Yf(!1),t=e[0];return e=xS.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,o=Ht();if(ke){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),De===null)throw Error(F(349));yr&30||gg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Qf(vg.bind(null,r,i,e),[e]),r.flags|=2048,ki(9,yg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ht(),t=De.identifierPrefix;if(ke){var n=un,r=an;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wi++,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[Kt]=t,e[yi]=r,Ug(e,t,!1,!1),t.stateNode=e;e:{switch(l=uu(n,r),n){case"dialog":we("cancel",e),we("close",e),o=r;break;case"iframe":case"object":case"embed":we("load",e),o=r;break;case"video":case"audio":for(o=0;opo&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304)}else{if(!r)if(e=Zl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Do(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!ke)return Ue(t),null}else 2*Te()-i.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Te(),t.sibling=null,n=Ee.current,ye(Ee,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return dd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ut&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function jS(e,t){switch(Wc(t),t.tag){case 1:return rt(t.type)&&Kl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return co(),Se(nt),Se(He),ed(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zc(t),null;case 13:if(Se(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ee),null;case 4:return co(),null;case 10:return Qc(t.type._context),null;case 22:case 23:return dd(),null;case 24:return null;default:return null}}var tl=!1,Ve=!1,RS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function Lu(e,t,n){try{n()}catch(r){_e(e,t,r)}}var lp=!1;function AS(e,t){if(xu=Ul,e=Qm(),Vc(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,d=0,c=e,p=null;t:for(;;){for(var h;c!==n||o!==0&&c.nodeType!==3||(s=l+o),c!==i||r!==0&&c.nodeType!==3||(a=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(h=c.firstChild)!==null;)p=c,c=h;for(;;){if(c===e)break t;if(p===n&&++u===o&&(s=l),p===i&&++d===r&&(a=l),(h=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(wu={focusedElem:e,selectionRange:n},Ul=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,S=w.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Rt(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(C){_e(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=lp,lp=!1,w}function ti(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Lu(t,n,i)}o=o.next}while(o!==r)}}function Ts(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Du(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 Wg(e){var t=e.alternate;t!==null&&(e.alternate=null,Wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[yi],delete t[Cu],delete t[hS],delete t[mS])),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 Kg(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kg(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 zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wl));else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}function Fu(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(Fu(e,t,n),e=e.sibling;e!==null;)Fu(e,t,n),e=e.sibling}var ze=null,It=!1;function En(e,t,n){for(n=n.child;n!==null;)Gg(e,t,n),n=n.sibling}function Gg(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Ss,n)}catch{}switch(n.tag){case 5:Ve||Gr(n,t);case 6:var r=ze,o=It;ze=null,En(e,t,n),ze=r,It=o,ze!==null&&(It?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(It?(e=ze,n=n.stateNode,e.nodeType===8?ga(e.parentNode,n):e.nodeType===1&&ga(e,n),fi(e)):ga(ze,n.stateNode));break;case 4:r=ze,o=It,ze=n.stateNode.containerInfo,It=!0,En(e,t,n),ze=r,It=o;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Lu(n,t,l),o=o.next}while(o!==r)}En(e,t,n);break;case 1:if(!Ve&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){_e(n,t,s)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,En(e,t,n),Ve=r):En(e,t,n);break;default:En(e,t,n)}}function ap(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new RS),t.forEach(function(r){var o=$S.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function _t(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*MS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,os=0,ae&6)throw Error(F(331));var o=ae;for(ae|=4,K=e.current;K!==null;){var i=K,l=i.child;if(K.flags&16){var s=i.deletions;if(s!==null){for(var a=0;aTe()-ud?pr(e,0):ad|=n),ot(e,t)}function ty(e,t){t===0&&(e.mode&1?(t=Ki,Ki<<=1,!(Ki&130023424)&&(Ki=4194304)):t=1);var n=Xe();e=mn(e,t),e!==null&&(ji(e,t,n),ot(e,n))}function BS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function $S(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),ty(e,n)}var ny;ny=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)tt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return tt=!1,_S(e,t,n);tt=!!(e.flags&131072)}else tt=!1,ke&&t.flags&1048576&&lg(t,Ql,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cl(e,t),e=t.pendingProps;var o=so(t,He.current);Zr(t,n),o=nd(null,t,r,e,o,n);var i=rd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(i=!0,Gl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qc(t),o.updater=_s,t.stateNode=o,o._reactInternals=t,Tu(t,r,e,n),t=Au(null,t,r,!0,i,n)):(t.tag=0,ke&&i&&Hc(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=VS(r),e=Rt(r,e),o){case 0:t=Ru(null,t,r,e,n);break e;case 1:t=rp(null,t,r,e,n);break e;case 11:t=tp(null,t,r,e,n);break e;case 14:t=np(null,t,r,Rt(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),Ru(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),rp(e,t,r,o,n);case 3:e:{if(Fg(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,o=i.element,fg(e,t),Jl(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=fo(Error(F(423)),t),t=op(e,t,r,n,o);break e}else if(r!==o){o=fo(Error(F(424)),t),t=op(e,t,r,n,o);break e}else for(dt=zn(t.stateNode.containerInfo.firstChild),ht=t,ke=!0,Mt=null,n=cg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ao(),r===o){t=gn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return pg(t),e===null&&Nu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Su(r,o)?l=null:i!==null&&Su(r,i)&&(t.flags|=32),zg(e,t),Ye(e,t,l,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return Bg(e,t,n);case 4:return Jc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),tp(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,ye(Xl,r._currentValue),r._currentValue=l,i!==null)if(zt(i.value,l)){if(i.children===o.children&&!nt.current){t=gn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=cn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Pu(i.return,n,t),s.lanes|=n;break}a=a.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(F(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Pu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Zr(t,n),o=bt(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=Rt(r,t.pendingProps),o=Rt(r.type,o),np(e,t,r,o,n);case 15:return Lg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),Cl(e,t),t.tag=1,rt(r)?(e=!0,Gl(t)):e=!1,Zr(t,n),Ig(t,r,o),Tu(t,r,o,n),Au(null,t,r,!0,e,n);case 19:return $g(e,t,n);case 22:return Dg(e,t,n)}throw Error(F(156,t.tag))};function ry(e,t){return jm(e,t)}function US(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 Ct(e,t,n,r){return new US(e,t,n,r)}function pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VS(e){if(typeof e=="function")return pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ac)return 11;if(e===Ic)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Ct(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 Nl(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")pd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case zr:return hr(n.children,o,i,t);case Rc:l=8,o|=8;break;case Za:return e=Ct(12,n,t,o|2),e.elementType=Za,e.lanes=i,e;case eu:return e=Ct(13,n,t,o),e.elementType=eu,e.lanes=i,e;case tu:return e=Ct(19,n,t,o),e.elementType=tu,e.lanes=i,e;case pm:return Rs(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dm:l=10;break e;case fm:l=9;break e;case Ac:l=11;break e;case Ic:l=14;break e;case _n:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Ct(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function Rs(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=pm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ea(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function ba(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HS(e,t,n,r,o){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=ia(0),this.expirationTimes=ia(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ia(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hd(e,t,n,r,o,i,l,s,a){return e=new HS(e,t,n,s,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qc(i),e}function WS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sy)}catch(e){console.error(e)}}sy(),sm.exports=yt;var So=sm.exports;const XS=xs(So);var gp=So;qa.createRoot=gp.createRoot,qa.hydrateRoot=gp.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 Ei(){return Ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ay(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JS(){return Math.random().toString(36).substr(2,8)}function vp(e,t){return{usr:e.state,key:e.key,idx:t}}function Hu(e,t,n,r){return n===void 0&&(n=null),Ei({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ko(t):t,{state:n,key:t&&t.key||r||JS()})}function ss(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ko(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 ZS(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,s=Mn.Pop,a=null,u=d();u==null&&(u=0,l.replaceState(Ei({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function c(){s=Mn.Pop;let S=d(),m=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:m})}function p(S,m){s=Mn.Push;let v=Hu(y.location,S,m);n&&n(v,S),u=d()+1;let x=vp(v,u),C=y.createHref(v);try{l.pushState(x,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(C)}i&&a&&a({action:s,location:y.location,delta:1})}function h(S,m){s=Mn.Replace;let v=Hu(y.location,S,m);n&&n(v,S),u=d();let x=vp(v,u),C=y.createHref(v);l.replaceState(x,"",C),i&&a&&a({action:s,location:y.location,delta:0})}function w(S){let m=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof S=="string"?S:ss(S);return v=v.replace(/ $/,"%20"),Ae(m,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,m)}let y={get action(){return s},get location(){return e(o,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(yp,c),a=S,()=>{o.removeEventListener(yp,c),a=null}},createHref(S){return t(o,S)},createURL:w,encodeLocation(S){let m=w(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:h,go(S){return l.go(S)}};return y}var xp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xp||(xp={}));function ek(e,t,n){return n===void 0&&(n="/"),tk(e,t,n,!1)}function tk(e,t,n,r){let o=typeof t=="string"?ko(t):t,i=vd(o.pathname||"/",n);if(i==null)return null;let l=uy(e);nk(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};a.relativePath.startsWith("/")&&(Ae(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Vn([r,a.relativePath]),d=n.concat(a);i.children&&i.children.length>0&&(Ae(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),uy(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:uk(u,i.index),routesMeta:d})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let a of cy(i.path))o(i,l,a)}),t}function cy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=cy(r.join("/")),s=[];return s.push(...l.map(a=>a===""?i:[i,a].join("/"))),o&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function nk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ck(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const rk=/^:[\w-]+$/,ok=3,ik=2,lk=1,sk=10,ak=-2,wp=e=>e==="*";function uk(e,t){let n=e.split("/"),r=n.length;return n.some(wp)&&(r+=ak),t&&(r+=ik),n.filter(o=>!wp(o)).reduce((o,i)=>o+(rk.test(i)?ok:i===""?lk:sk),r)}function ck(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function dk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",l=[];for(let s=0;s{let{paramName:p,isOptional:h}=d;if(p==="*"){let y=s[c]||"";l=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[c];return h&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function fk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ay(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function pk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ay(!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 vd(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 hk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ko(e):e;return{pathname:n?n.startsWith("/")?n:mk(n,t):t,search:vk(r),hash:xk(o)}}function mk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Na(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 gk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dy(e,t){let n=gk(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function fy(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ko(e):(o=Ei({},e),Ae(!o.pathname||!o.pathname.includes("?"),Na("?","pathname","search",o)),Ae(!o.pathname||!o.pathname.includes("#"),Na("#","pathname","hash",o)),Ae(!o.search||!o.search.includes("#"),Na("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,s;if(l==null)s=n;else{let c=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),c-=1;o.pathname=p.join("/")}s=c>=0?t[c]:"/"}let a=hk(o,s),u=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||d)&&(a.pathname+="/"),a}const Vn=e=>e.join("/").replace(/\/\/+/g,"/"),yk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function wk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const py=["post","put","patch","delete"];new Set(py);const Sk=["get",...py];new Set(Sk);/** + * 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 bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let c=fy(u,JSON.parse(l),i,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Vn([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,l,i,e])}const bk=g.createContext(null);function Nk(e){let t=g.useContext(Zn).outlet;return t&&g.createElement(bk.Provider,{value:e},t)}function gy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Nr),{matches:o}=g.useContext(Zn),{pathname:i}=Oi(),l=JSON.stringify(dy(o,r.v7_relativeSplatPath));return g.useMemo(()=>fy(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Pk(e,t){return _k(e,t)}function _k(e,t,n,r){Mi()||Ae(!1);let{navigator:o}=g.useContext(Nr),{matches:i}=g.useContext(Zn),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Oi(),d;if(t){var c;let S=typeof t=="string"?ko(t):t;a==="/"||(c=S.pathname)!=null&&c.startsWith(a)||Ae(!1),d=S}else d=u;let p=d.pathname||"/",h=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=ek(e,{pathname:h}),y=Ik(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Vn([a,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Vn([a,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&y?g.createElement(Ls.Provider,{value:{location:bi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Mn.Pop}},y):y}function Tk(){let e=Dk(),t=wk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=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:o},n):null,i)}const jk=g.createElement(Tk,null);class Rk 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(Zn.Provider,{value:this.props.routeContext},g.createElement(hy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ak(e){let{routeContext:t,match:n,children:r}=e,o=g.useContext(xd);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Zn.Provider,{value:t},r)}function Ik(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(o=n)==null?void 0:o.errors;if(s!=null){let d=l.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);d>=0||Ae(!1),l=l.slice(0,Math.min(l.length,d+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((d,c,p)=>{let h,w=!1,y=null,S=null;n&&(h=s&&c.route.id?s[c.route.id]:void 0,y=c.route.errorElement||jk,a&&(u<0&&p===0?(Fk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=c.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,p+1)),v=()=>{let x;return h?x=y:w?x=S:c.route.Component?x=g.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=d,g.createElement(Ak,{match:c,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?g.createElement(Rk,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var yy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yy||{}),as=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(as||{});function Mk(e){let t=g.useContext(xd);return t||Ae(!1),t}function Ok(e){let t=g.useContext(kk);return t||Ae(!1),t}function Lk(e){let t=g.useContext(Zn);return t||Ae(!1),t}function vy(e){let t=Lk(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Dk(){var e;let t=g.useContext(hy),n=Ok(as.UseRouteError),r=vy(as.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function zk(){let{router:e}=Mk(yy.UseNavigateStable),t=vy(as.UseNavigateStable),n=g.useRef(!1);return my(()=>{n.current=!0}),g.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,bi({fromRouteId:t},i)))},[e,t])}const kp={};function Fk(e,t,n){!t&&!kp[e]&&(kp[e]=!0)}function Bk(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 $k(e){return Nk(e.context)}function Or(e){Ae(!1)}function Uk(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Mn.Pop,navigator:i,static:l=!1,future:s}=e;Mi()&&Ae(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:i,static:l,future:bi({v7_relativeSplatPath:!1},s)}),[a,s,i,l]);typeof r=="string"&&(r=ko(r));let{pathname:d="/",search:c="",hash:p="",state:h=null,key:w="default"}=r,y=g.useMemo(()=>{let S=vd(d,a);return S==null?null:{location:{pathname:S,search:c,hash:p,state:h,key:w},navigationType:o}},[a,d,c,p,h,w,o]);return y==null?null:g.createElement(Nr.Provider,{value:u},g.createElement(Ls.Provider,{children:n,value:y}))}function Vk(e){let{children:t,location:n}=e;return Pk(Wu(t),n)}new Promise(()=>{});function Wu(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,o)=>{if(!g.isValidElement(r))return;let i=[...t,o];if(r.type===g.Fragment){n.push.apply(n,Wu(r.props.children,i));return}r.type!==Or&&Ae(!1),!r.props.index||!r.props.children||Ae(!1);let l={id:r.props.id||i.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=Wu(r.props.children,i)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ku(){return Ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Wk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kk(e,t){return e.button===0&&(!t||t==="_self")&&!Wk(e)}const Gk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yk="6";try{window.__reactRouterVersion=Yk}catch{}const Qk="startTransition",Cp=Pc[Qk];function Xk(e){let{basename:t,children:n,future:r,window:o}=e,i=g.useRef();i.current==null&&(i.current=qS({window:o,v5Compat:!0}));let l=i.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=g.useCallback(c=>{u&&Cp?Cp(()=>a(c)):a(c)},[a,u]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>Bk(r),[r]),g.createElement(Uk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const qk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xy=g.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:s,target:a,to:u,preventScrollReset:d,viewTransition:c}=t,p=Hk(t,Gk),{basename:h}=g.useContext(Nr),w,y=!1;if(typeof u=="string"&&Jk.test(u)&&(w=u,qk))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=vd(C.pathname,h);C.origin===x.origin&&N!=null?u=N+C.search+C.hash:y=!0}catch{}let S=Ck(u,{relative:o}),m=Zk(u,{replace:l,state:s,target:a,preventScrollReset:d,relative:o,viewTransition:c});function v(x){r&&r(x),x.defaultPrevented||m(x)}return g.createElement("a",Ku({},p,{href:w||S,onClick:y||i?r:v,ref:n,target:a}))});var Ep;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ep||(Ep={}));var bp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(bp||(bp={}));function Zk(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s}=t===void 0?{}:t,a=wd(),u=Oi(),d=gy(e,{relative:l});return g.useCallback(c=>{if(Kk(c,n)){c.preventDefault();let p=r!==void 0?r:ss(u)===ss(d);a(e,{replace:p,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[u,a,d,r,o,n,e,i,l,s])}function wy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return o(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):o(l,s)}}}var Ey="!";function sC(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var s=[],a=0,u=0,d,c=0;cu?d-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function aC(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function uC(e){return{cache:lC(e.cacheSize),splitModifiers:sC(e),...tC(e)}}var cC=/\s+/;function dC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(cC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,d=s.baseClassName,c=s.maybePostfixModifierPosition,p=r(c?d.substring(0,c):d),h=!!c;if(!p){if(!c)return{isTailwindClass:!1,originalClassName:l};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:l};h=!1}var w=aC(a).join(":"),y=u?w+Ey:w;return{isTailwindClass:!0,modifierId:y,classGroupId:p,originalClassName:l,hasPostfixModifier:h}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,d=s+a;return i.has(d)?!1:(i.add(d),o(a,u).forEach(function(c){return i.add(s+c)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function fC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),TC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Tp=e=>{const t=TC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Py=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),jC=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 RC={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 AC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...RC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Py("lucide",o),...!i&&!jC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,d])=>g.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** + * @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 de=(e,t)=>{const n=g.forwardRef(({className:r,...o},i)=>g.createElement(AC,{ref:i,iconNode:t,className:Py(`lucide-${_C(Tp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Tp(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 IC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],MC=de("arrow-right",IC);/** + * @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 OC=[["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"}]],LC=de("award",OC);/** + * @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 DC=[["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"}]],kd=de("book-open",DC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zC=[["path",{d:"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"}]],_y=de("bot",zC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FC=[["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"}]],ho=de("brain",FC);/** + * @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 BC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$C=de("check",BC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ty=de("chevron-down",UC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HC=de("chevron-up",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],KC=de("circle-check-big",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],us=de("cloud",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["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"}]],QC=de("download",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["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"}]],jy=de("hard-drive",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["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"}]],Ry=de("heart",qC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ZC=de("history",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eE=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],tE=de("house",eE);/** + * @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 nE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ay=de("info",nE);/** + * @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 rE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qu=de("loader-circle",rE);/** + * @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 oE=[["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"}]],Cd=de("message-square",oE);/** + * @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 iE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lE=de("plus",iE);/** + * @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 sE=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],aE=de("rotate-ccw",sE);/** + * @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 uE=[["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"}]],cE=de("save",uE);/** + * @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 dE=[["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"}]],fE=de("send",dE);/** + * @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 pE=[["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"}]],hE=de("server",pE);/** + * @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 mE=[["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"}]],Ed=de("settings",mE);/** + * @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 gE=[["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"}]],jp=de("shield",gE);/** + * @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 yE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],vE=de("square",yE);/** + * @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 xE=[["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"}]],Iy=de("star",xE);/** + * @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 wE=[["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"}]],My=de("trash-2",wE);/** + * @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 SE=[["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"}]],kE=de("user",SE);/** + * @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 CE=[["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"}]],Rp=de("users",CE);/** + * @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 EE=[["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"}]],Xu=de("zap",EE),bE=[{name:"Home",href:"/",icon:tE,description:"Overview and AI assistant templates"},{name:"Chat Playground",href:"/playground",icon:Cd,description:"AI chatbot with saved assistants"},{name:"Model Catalog",href:"/models",icon:kd,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:Ed,description:"Application settings"}];function NE(){const e=Oi();return f.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[f.jsx("div",{className:"p-6 border-b",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:f.jsx(ho,{className:"h-5 w-5 text-primary-foreground"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),f.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:f.jsxs("div",{children:[f.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),f.jsx("nav",{className:"space-y-1",children:bE.map(t=>{const n=e.pathname===t.href;return f.jsxs(xy,{to:t.href,className:ie("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:[f.jsx(t.icon,{className:"h-4 w-4"}),f.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function PE(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(NE,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx($k,{})})]})}const Ap=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ip=Sy,bd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ip(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const p=Ap(d)||Ap(c);return o[u][p]}),s=n&&Object.entries(n).reduce((u,d)=>{let[c,p]=d;return p===void 0||(u[c]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:p,...h}=d;return Object.entries(h).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...i,...s}[y]):{...i,...s}[y]===S})?[...u,c,p]:u},[]);return Ip(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},_E=bd("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 Me({className:e,variant:t,...n}){return f.jsx("div",{className:ie(_E({variant:t}),e),...n})}function Mp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oy(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Mp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:i,...l}=r,s=g.Children.toArray(i),a=s.find(AE);if(a){const u=a.props.children,d=s.map(c=>c===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:c);return f.jsx(t,{...l,ref:o,children:g.isValidElement(u)?g.cloneElement(u,void 0,d):null})}return f.jsx(t,{...l,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var TE=mo("Slot");function jE(e){const t=g.forwardRef((n,r)=>{const{children:o,...i}=n;if(g.isValidElement(o)){const l=ME(o),s=IE(i,o.props);return o.type!==g.Fragment&&(s.ref=r?Oy(r,l):l),g.cloneElement(o,s)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ly=Symbol("radix.slottable");function RE(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ly,t}function AE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ly}function IE(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const a=i(...s);return o(...s),a}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ME(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Nd=bd("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"}}),Qe=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const l=r?TE:"button";return f.jsx(l,{className:ie(Nd({variant:t,size:n,className:e})),ref:i,...o})});Qe.displayName="Button";const ft=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ft.displayName="Card";const dn=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));dn.displayName="CardHeader";const fn=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));fn.displayName="CardTitle";const OE=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));OE.displayName="CardDescription";const Jt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ie("p-6 pt-0",e),...t}));Jt.displayName="CardContent";const LE=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",e),...t}));LE.displayName="CardFooter";function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function DE(e,t){const n=g.createContext(t),r=i=>{const{children:l,...s}=i,a=g.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function o(i){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function er(e,t=[]){let n=[];function r(i,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=c=>{var m;const{scope:p,children:h,...w}=c,y=((m=p==null?void 0:p[e])==null?void 0:m[a])||s,S=g.useMemo(()=>w,Object.values(w));return f.jsx(y.Provider,{value:S,children:h})};u.displayName=i+"Provider";function d(c,p){var y;const h=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,w=g.useContext(h);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,zE(o,...t)]}function zE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(i)[`__scope${u}`];return{...s,...c}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Pd(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:m}=y,v=At.useRef(null),x=At.useRef(new Map).current;return f.jsx(o,{scope:S,itemMap:x,collectionRef:v,children:m})};l.displayName=t;const s=e+"CollectionSlot",a=mo(s),u=At.forwardRef((y,S)=>{const{scope:m,children:v}=y,x=i(s,m),C=pe(S,x.collectionRef);return f.jsx(a,{ref:C,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",c="data-radix-collection-item",p=mo(d),h=At.forwardRef((y,S)=>{const{scope:m,children:v,...x}=y,C=At.useRef(null),N=pe(S,C),b=i(d,m);return At.useEffect(()=>(b.itemMap.set(C,{ref:C,...x}),()=>void b.itemMap.delete(C))),f.jsx(p,{[c]:"",ref:N,children:v})});h.displayName=d;function w(y){const S=i(e+"CollectionConsumer",y);return At.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${c}]`));return Array.from(S.itemMap.values()).sort((b,P)=>x.indexOf(b.ref.current)-x.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},w,r]}var We=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},FE=Pc[" useId ".trim().toString()]||(()=>{}),BE=0;function Hn(e){const[t,n]=g.useState(FE());return We(()=>{e||n(r=>r??String(BE++))},[e]),e||(t?`radix-${t}`:"")}var $E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ee=$E.reduce((e,t)=>{const n=mo(`Primitive.${t}`),r=g.forwardRef((o,i)=>{const{asChild:l,...s}=o,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function UE(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function Gn(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)},[])}var VE=Pc[" useInsertionEffect ".trim().toString()]||We;function go({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=HE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{const d=g.useRef(e!==void 0);g.useEffect(()=>{const c=d.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,r])}const u=g.useCallback(d=>{var c;if(s){const p=WE(d)?d(e):d;p!==e&&((c=l.current)==null||c.call(l,p))}else i(d)},[s,e,i,l]);return[a,u]}function HE({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),i=g.useRef(t);return VE(()=>{i.current=t},[t]),g.useEffect(()=>{var l;o.current!==n&&((l=i.current)==null||l.call(i,n),o.current=n)},[n,o]),[n,r,i]}function WE(e){return typeof e=="function"}var KE=g.createContext(void 0);function Ds(e){const t=g.useContext(KE);return e||t||"ltr"}var Pa="rovingFocusGroup.onEntryFocus",GE={bubbles:!1,cancelable:!0},Li="RovingFocusGroup",[qu,Dy,YE]=Pd(Li),[QE,zy]=er(Li,[YE]),[XE,qE]=QE(Li),Fy=g.forwardRef((e,t)=>f.jsx(qu.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(qu.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(JE,{...e,ref:t})})}));Fy.displayName=Li;var JE=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,p=g.useRef(null),h=pe(t,p),w=Ds(i),[y,S]=go({prop:l,defaultProp:s??null,onChange:a,caller:Li}),[m,v]=g.useState(!1),x=Gn(u),C=Dy(n),N=g.useRef(!1),[b,P]=g.useState(0);return g.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Pa,x),()=>R.removeEventListener(Pa,x)},[x]),f.jsx(XE,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:y,onItemFocus:g.useCallback(R=>S(R),[S]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:g.useCallback(()=>P(R=>R-1),[]),children:f.jsx(ee.div,{tabIndex:m||b===0?-1:0,"data-orientation":r,...c,ref:h,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{N.current=!0}),onFocus:J(e.onFocus,R=>{const L=!N.current;if(R.target===R.currentTarget&&L&&!m){const A=new CustomEvent(Pa,GE);if(R.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=C().filter($=>$.focusable),T=M.find($=>$.active),H=M.find($=>$.id===y),D=[T,H,...M].filter(Boolean).map($=>$.ref.current);Uy(D,d)}}N.current=!1}),onBlur:J(e.onBlur,()=>v(!1))})})}),By="RovingFocusGroupItem",$y=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:l,...s}=e,a=Hn(),u=i||a,d=qE(By,n),c=d.currentTabStopId===u,p=Dy(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:y}=d;return g.useEffect(()=>{if(r)return h(),()=>w()},[r,h,w]),f.jsx(qu.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:f.jsx(ee.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:J(e.onMouseDown,S=>{r?d.onItemFocus(u):S.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const m=tb(S,d.orientation,d.dir);if(m!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(m==="last")x.reverse();else if(m==="prev"||m==="next"){m==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=d.loop?nb(x,C+1):x.slice(C+1)}setTimeout(()=>Uy(x))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:y!=null}):l})})});$y.displayName=By;var ZE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tb(e,t,n){const r=eb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ZE[r]}function Uy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rb=Fy,ob=$y;function ib(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Di=e=>{const{present:t,children:n}=e,r=lb(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=pe(r.ref,sb(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};Di.displayName="Presence";function lb(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=ib(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=il(r.current);i.current=s==="mounted"?u:"none"},[s]),We(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=il(u);e?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),We(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=h=>{const y=il(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&y&&(a("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=h=>{h.target===t&&(i.current=il(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function il(e){return(e==null?void 0:e.animationName)||"none"}function sb(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zs="Tabs",[ab,oI]=er(zs,[zy]),Vy=zy(),[ub,_d]=ab(zs),Hy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,d=Ds(s),[c,p]=go({prop:r,onChange:o,defaultProp:i??"",caller:zs});return f.jsx(ub,{scope:n,baseId:Hn(),value:c,onValueChange:p,orientation:l,dir:d,activationMode:a,children:f.jsx(ee.div,{dir:d,"data-orientation":l,...u,ref:t})})});Hy.displayName=zs;var Wy="TabsList",Ky=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=_d(Wy,n),l=Vy(n);return f.jsx(rb,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(ee.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Ky.displayName=Wy;var Gy="TabsTrigger",Yy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,l=_d(Gy,n),s=Vy(n),a=qy(l.baseId,r),u=Jy(l.baseId,r),d=r===l.value;return f.jsx(ob,{asChild:!0,...s,focusable:!o,active:d,children:f.jsx(ee.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:t,onMouseDown:J(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?l.onValueChange(r):c.preventDefault()}),onKeyDown:J(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&l.onValueChange(r)}),onFocus:J(e.onFocus,()=>{const c=l.activationMode!=="manual";!d&&!o&&c&&l.onValueChange(r)})})})});Yy.displayName=Gy;var Qy="TabsContent",Xy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...l}=e,s=_d(Qy,n),a=qy(s.baseId,r),u=Jy(s.baseId,r),d=r===s.value,c=g.useRef(d);return g.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(Di,{present:o||d,children:({present:p})=>f.jsx(ee.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:p&&i})})});Xy.displayName=Qy;function qy(e,t){return`${e}-trigger-${t}`}function Jy(e,t){return`${e}-content-${t}`}var cb=Hy,Zy=Ky,ev=Yy,tv=Xy;const db=cb,nv=g.forwardRef(({className:e,...t},n)=>f.jsx(Zy,{ref:n,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));nv.displayName=Zy.displayName;const Pl=g.forwardRef(({className:e,...t},n)=>f.jsx(ev,{ref:n,className:ie("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}));Pl.displayName=ev.displayName;const _l=g.forwardRef(({className:e,...t},n)=>f.jsx(tv,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_l.displayName=tv.displayName;function fb(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions.",author:"EdgeLLM Team",category:"coding",tags:["code review","programming"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15"},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements.",author:"Community",category:"writing",tags:["writing","editing"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a writing tutor. Help improve writing through structure, clarity, grammar, and style suggestions. Provide specific feedback and examples.",temperature:.4,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20"},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters.",author:"Community",category:"creative",tags:["creative","storytelling"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30"}]}function pb(){const e=wd(),[t,n]=g.useState(!1),[r]=g.useState(fb()),[o,i]=g.useState([]);g.useEffect(()=>{l(),s()},[]);const l=async()=>{try{const c=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${c}/models`);n(p.ok)}catch{n(!1)}},s=()=>{try{const c=JSON.parse(localStorage.getItem("likedTemplates")||"[]");i(c)}catch(c){console.error("Failed to load liked templates:",c)}},a=c=>{const p=o.includes(c)?o.filter(h=>h!==c):[...o,c];i(p),localStorage.setItem("likedTemplates",JSON.stringify(p))},u=c=>{const p={name:c.name,description:c.description,model:c.model,systemPrompt:c.systemPrompt,temperature:c.temperature,maxTokens:c.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(p)),e("/playground")},d=r.filter(c=>c.isOfficial);return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-100 border-b",children:f.jsx("div",{className:"max-w-6xl mx-auto px-6 py-16",children:f.jsxs("div",{className:"text-center space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[f.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:f.jsx(ho,{className:"h-7 w-7 text-white"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Edge LLM"}),f.jsx(Me,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})]}),f.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Professional AI platform for local and cloud language models. Complete privacy, advanced features, industrial-grade performance."}),f.jsxs("div",{className:"flex flex-col items-center gap-4 mt-8",children:[f.jsxs(Qe,{size:"lg",onClick:()=>e("/playground"),className:"flex items-center gap-2 px-8 py-3 text-lg",children:[f.jsx(Cd,{className:"h-5 w-5"}),"Start Conversation",f.jsx(MC,{className:"h-4 w-4"})]}),f.jsxs("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:[f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(ho,{className:"h-4 w-4"}),"Local & Cloud Models"]}),f.jsx("span",{children:"•"}),f.jsx("span",{children:"Privacy First"}),f.jsx("span",{children:"•"}),f.jsx("span",{children:"Easy to Use"})]})]})]})})}),f.jsx("div",{className:"py-16 bg-background",children:f.jsxs("div",{className:"max-w-6xl mx-auto px-6",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[f.jsx(Rp,{className:"h-6 w-6 text-blue-600"}),f.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"AI Assistant Templates"})]}),f.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Discover pre-configured AI assistants for various tasks and workflows"})]}),f.jsxs(db,{defaultValue:"all",className:"space-y-6",children:[f.jsxs(nv,{className:"grid w-full grid-cols-3",children:[f.jsxs(Pl,{value:"all",className:"flex items-center gap-2",children:[f.jsx(Rp,{className:"h-4 w-4"}),"All Templates"]}),f.jsxs(Pl,{value:"featured",className:"flex items-center gap-2",children:[f.jsx(Iy,{className:"h-4 w-4"}),"Featured"]}),f.jsxs(Pl,{value:"liked",className:"flex items-center gap-2",children:[f.jsx(Ry,{className:"h-4 w-4"}),"My Likes"]})]}),f.jsx(_l,{value:"all",children:f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.map(c=>f.jsx(_a,{template:c,isLiked:o.includes(c.id),onLike:()=>a(c.id),onUse:()=>u(c)},c.id))})}),f.jsxs(_l,{value:"featured",children:[f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:d.map(c=>f.jsx(_a,{template:c,isLiked:o.includes(c.id),onLike:()=>a(c.id),onUse:()=>u(c),featured:!0},c.id))}),d.length===0&&f.jsx(ft,{className:"p-8 text-center",children:f.jsx("p",{className:"text-muted-foreground",children:"No featured templates available."})})]}),f.jsxs(_l,{value:"liked",children:[f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.filter(c=>o.includes(c.id)).map(c=>f.jsx(_a,{template:c,isLiked:!0,onLike:()=>a(c.id),onUse:()=>u(c)},c.id))}),o.length===0&&f.jsx(ft,{className:"p-8 text-center",children:f.jsx("p",{className:"text-muted-foreground",children:"You haven't liked any templates yet. Click the heart icon on templates you like!"})})]})]})]})})]})}function _a({template:e,isLiked:t,onLike:n,onUse:r,featured:o=!1}){return f.jsxs(ft,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${o?"ring-2 ring-yellow-200 shadow-md":""}`,children:[f.jsx(dn,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(fn,{className:"text-base",children:e.name}),e.isOfficial&&f.jsxs(Me,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[f.jsx(LC,{className:"h-3 w-3 mr-1"}),"Official"]}),o&&f.jsx(Iy,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),f.jsxs("p",{className:"text-xs text-blue-600 font-medium",children:["by ",e.author]}),f.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:e.description})]}),f.jsx(Qe,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:f.jsx(Ry,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(Jt,{className:"space-y-4",children:[f.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(i=>f.jsx(Me,{variant:"secondary",className:"text-xs",children:i},i))}),f.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),f.jsx("p",{className:"text-gray-800",children:e.temperature})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),f.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),f.jsx("div",{className:"flex justify-end",children:f.jsx(Qe,{size:"sm",onClick:r,children:"Use Template"})})]})]})}function cs(e,[t,n]){return Math.min(n,Math.max(t,e))}function rv(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])}function ov(e){const[t,n]=g.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var iv=["PageUp","PageDown"],lv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Co="Slider",[Ju,hb,mb]=Pd(Co),[av,iI]=er(Co,[mb]),[gb,Fs]=av(Co),uv=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:d,onValueChange:c=()=>{},onValueCommit:p=()=>{},inverted:h=!1,form:w,...y}=e,S=g.useRef(new Set),m=g.useRef(0),x=l==="horizontal"?yb:vb,[C=[],N]=go({prop:d,defaultProp:u,onChange:M=>{var H;(H=[...S.current][m.current])==null||H.focus(),c(M)}}),b=g.useRef(C);function P(M){const T=Cb(C,M);A(M,T)}function R(M){A(M,m.current)}function L(){const M=b.current[m.current];C[m.current]!==M&&p(C)}function A(M,T,{commit:H}={commit:!1}){const O=Pb(i),D=_b(Math.round((M-r)/i)*i+r,O),$=cs(D,[r,o]);N((W=[])=>{const _=Sb(W,$,T);if(Nb(_,a*i)){m.current=_.indexOf($);const z=String(_)!==String(W);return z&&H&&p(_),z?_:W}else return W})}return f.jsx(gb,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:m,thumbs:S.current,values:C,orientation:l,form:w,children:f.jsx(Ju.Provider,{scope:e.__scopeSlider,children:f.jsx(Ju.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:J(y.onPointerDown,()=>{s||(b.current=C)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:P,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:L,onHomeKeyDown:()=>!s&&A(r,0,{commit:!0}),onEndKeyDown:()=>!s&&A(o,C.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:T})=>{if(!s){const D=iv.includes(M.key)||M.shiftKey&&lv.includes(M.key)?10:1,$=m.current,W=C[$],_=i*D*T;A(W+_,$,{commit:!0})}}})})})})});uv.displayName=Co;var[cv,dv]=av(Co,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yb=g.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...d}=e,[c,p]=g.useState(null),h=pe(t,x=>p(x)),w=g.useRef(void 0),y=Ds(o),S=y==="ltr",m=S&&!i||!S&&i;function v(x){const C=w.current||c.getBoundingClientRect(),N=[0,C.width],P=Td(N,m?[n,r]:[r,n]);return w.current=C,P(x-C.left)}return f.jsx(cv,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:f.jsx(fv,{dir:y,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=v(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=v(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=sv[m?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),vb=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,d=g.useRef(null),c=pe(t,d),p=g.useRef(void 0),h=!o;function w(y){const S=p.current||d.current.getBoundingClientRect(),m=[0,S.height],x=Td(m,h?[r,n]:[n,r]);return p.current=S,x(y-S.top)}return f.jsx(cv,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(fv,{"data-orientation":"vertical",...u,ref:c,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);i==null||i(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:y=>{const m=sv[h?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:m?-1:1})}})})}),fv=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,d=Fs(Co,n);return f.jsx(ee.span,{...u,ref:t,onKeyDown:J(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):iv.concat(lv).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:J(e.onPointerDown,c=>{const p=c.target;p.setPointerCapture(c.pointerId),c.preventDefault(),d.thumbs.has(p)?p.focus():r(c)}),onPointerMove:J(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&o(c)}),onPointerUp:J(e.onPointerUp,c=>{const p=c.target;p.hasPointerCapture(c.pointerId)&&(p.releasePointerCapture(c.pointerId),i(c))})})}),pv="SliderTrack",hv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Fs(pv,n);return f.jsx(ee.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});hv.displayName=pv;var Zu="SliderRange",mv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Fs(Zu,n),i=dv(Zu,n),l=g.useRef(null),s=pe(t,l),a=o.values.length,u=o.values.map(p=>vv(p,o.min,o.max)),d=a>1?Math.min(...u):0,c=100-Math.max(...u);return f.jsx(ee.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:c+"%"}})});mv.displayName=Zu;var ec="SliderThumb",gv=g.forwardRef((e,t)=>{const n=hb(e.__scopeSlider),[r,o]=g.useState(null),i=pe(t,s=>o(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(xb,{...e,ref:i,index:l})}),xb=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,l=Fs(ec,n),s=dv(ec,n),[a,u]=g.useState(null),d=pe(t,v=>u(v)),c=a?l.form||!!a.closest("form"):!0,p=ov(a),h=l.values[r],w=h===void 0?0:vv(h,l.min,l.max),y=kb(r,l.values.length),S=p==null?void 0:p[s.size],m=S?Eb(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${m}px)`},children:[f.jsx(Ju.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(ee.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":h,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:d,style:h===void 0?{display:"none"}:e.style,onFocus:J(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),c&&f.jsx(yv,{name:o??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:h},r)]})});gv.displayName=ec;var wb="RadioBubbleInput",yv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=g.useRef(null),i=pe(o,r),l=rv(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const a=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const c=new Event("input",{bubbles:!0});d.call(s,t),s.dispatchEvent(c)}},[l,t]),f.jsx(ee.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});yv.displayName=wb;function Sb(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function vv(e,t,n){const i=100/(n-t)*(e-t);return cs(i,[0,100])}function kb(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Cb(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Eb(e,t,n){const r=e/2,i=Td([0,50],[0,r]);return(r-i(t)*n)*n}function bb(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Nb(e,t){if(t>0){const n=bb(e);return Math.min(...n)>=t}return!0}function Td(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 Pb(e){return(String(e).split(".")[1]||"").length}function _b(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var xv=uv,Tb=hv,jb=mv,Rb=gv;const tc=g.forwardRef(({className:e,...t},n)=>f.jsxs(xv,{ref:n,className:ie("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(Tb,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(jb,{className:"absolute h-full bg-primary"})}),f.jsx(Rb,{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"})]}));tc.displayName=xv.displayName;var Ab="Label",wv=g.forwardRef((e,t)=>f.jsx(ee.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wv.displayName=Ab;var Sv=wv;const Ib=bd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ot=g.forwardRef(({className:e,...t},n)=>f.jsx(Sv,{ref:n,className:ie(Ib(),e),...t}));Ot.displayName=Sv.displayName;function Mb(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ob="DismissableLayer",nc="dismissableLayer.update",Lb="dismissableLayer.pointerDownOutside",Db="dismissableLayer.focusOutside",Op,kv=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(kv),[d,c]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),w=pe(t,P=>c(P)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(S),v=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=m,N=Bb(P=>{const R=P.target,L=[...u.branches].some(A=>A.contains(R));!C||L||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},p),b=$b(P=>{const R=P.target;[...u.branches].some(A=>A.contains(R))||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},p);return Mb(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Op=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Lp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Op)}},[d,p,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Lp())},[d,u]),g.useEffect(()=>{const P=()=>h({});return document.addEventListener(nc,P),()=>document.removeEventListener(nc,P)},[]),f.jsx(ee.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,b.onFocusCapture),onBlurCapture:J(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,N.onPointerDownCapture)})});jd.displayName=Ob;var zb="DismissableLayerBranch",Fb=g.forwardRef((e,t)=>{const n=g.useContext(kv),r=g.useRef(null),o=pe(t,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(ee.div,{...e,ref:o})});Fb.displayName=zb;function Bb(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let a=function(){Cv(Lb,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $b(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!r.current&&Cv(Db,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lp(){const e=new CustomEvent(nc);document.dispatchEvent(e)}function Cv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?UE(o,i):o.dispatchEvent(i)}var Ta=0;function Ev(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dp()),document.body.insertAdjacentElement("beforeend",e[1]??Dp()),Ta++,()=>{Ta===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ta--}},[])}function Dp(){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 ja="focusScope.autoFocusOnMount",Ra="focusScope.autoFocusOnUnmount",zp={bubbles:!1,cancelable:!0},Ub="FocusScope",Rd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[s,a]=g.useState(null),u=Gn(o),d=Gn(i),c=g.useRef(null),p=pe(t,y=>a(y)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(x){if(h.paused||!s)return;const C=x.target;s.contains(C)?c.current=C:Pn(c.current,{select:!0})},S=function(x){if(h.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Pn(c.current,{select:!0}))},m=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Pn(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const v=new MutationObserver(m);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,h.paused]),g.useEffect(()=>{if(s){Bp.add(h);const y=document.activeElement;if(!s.contains(y)){const m=new CustomEvent(ja,zp);s.addEventListener(ja,u),s.dispatchEvent(m),m.defaultPrevented||(Vb(Yb(bv(s)),{select:!0}),document.activeElement===y&&Pn(s))}return()=>{s.removeEventListener(ja,u),setTimeout(()=>{const m=new CustomEvent(Ra,zp);s.addEventListener(Ra,d),s.dispatchEvent(m),m.defaultPrevented||Pn(y??document.body,{select:!0}),s.removeEventListener(Ra,d),Bp.remove(h)},0)}}},[s,u,d,h]);const w=g.useCallback(y=>{if(!n&&!r||h.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(S&&m){const v=y.currentTarget,[x,C]=Hb(v);x&&C?!y.shiftKey&&m===C?(y.preventDefault(),n&&Pn(x,{select:!0})):y.shiftKey&&m===x&&(y.preventDefault(),n&&Pn(C,{select:!0})):m===v&&y.preventDefault()}},[n,r,h.paused]);return f.jsx(ee.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Rd.displayName=Ub;function Vb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function Hb(e){const t=bv(e),n=Fp(t,e),r=Fp(t.reverse(),e);return[n,r]}function bv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fp(e,t){for(const n of e)if(!Wb(n,{upTo:t}))return n}function Wb(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 Kb(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kb(e)&&t&&e.select()}}var Bp=Gb();function Gb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$p(e,t),e.unshift(t)},remove(t){var n;e=$p(e,t),(n=e[0])==null||n.resume()}}}function $p(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Yb(e){return e.filter(t=>t.tagName!=="A")}const Qb=["top","right","bottom","left"],Yn=Math.min,ct=Math.max,ds=Math.round,ll=Math.floor,Zt=e=>({x:e,y:e}),Xb={left:"right",right:"left",bottom:"top",top:"bottom"},qb={start:"end",end:"start"};function rc(e,t,n){return ct(e,Yn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function Eo(e){return e.split("-")[1]}function Ad(e){return e==="x"?"y":"x"}function Id(e){return e==="y"?"height":"width"}const Jb=new Set(["top","bottom"]);function Qt(e){return Jb.has(vn(e))?"y":"x"}function Md(e){return Ad(Qt(e))}function Zb(e,t,n){n===void 0&&(n=!1);const r=Eo(e),o=Md(e),i=Id(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=fs(l)),[l,fs(l)]}function eN(e){const t=fs(e);return[oc(e),t,oc(t)]}function oc(e){return e.replace(/start|end/g,t=>qb[t])}const Up=["left","right"],Vp=["right","left"],tN=["top","bottom"],nN=["bottom","top"];function rN(e,t,n){switch(e){case"top":case"bottom":return n?t?Vp:Up:t?Up:Vp;case"left":case"right":return t?tN:nN;default:return[]}}function oN(e,t,n,r){const o=Eo(e);let i=rN(vn(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(oc)))),i}function fs(e){return e.replace(/left|right|bottom|top/g,t=>Xb[t])}function iN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nv(e){return typeof e!="number"?iN(e):{top:e,right:e,bottom:e,left:e}}function ps(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Hp(e,t,n){let{reference:r,floating:o}=e;const i=Qt(t),l=Md(t),s=Id(l),a=vn(t),u=i==="y",d=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(a){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:c};break;case"left":h={x:r.x-o.width,y:c};break;default:h={x:r.x,y:r.y}}switch(Eo(t)){case"start":h[l]-=p*(n&&u?-1:1);break;case"end":h[l]+=p*(n&&u?-1:1);break}return h}const lN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:c}=Hp(u,r,a),p=r,h={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:d=0}=yn(e,t)||{};if(u==null)return{};const c=Nv(d),p={x:n,y:r},h=Md(o),w=Id(h),y=await l.getDimensions(u),S=h==="y",m=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=i.reference[w]+i.reference[h]-p[h]-i.floating[w],N=p[h]-i.reference[h],b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=b?b[x]:0;(!P||!await(l.isElement==null?void 0:l.isElement(b)))&&(P=s.floating[x]||i.floating[w]);const R=C/2-N/2,L=P/2-y[w]/2-1,A=Yn(c[m],L),M=Yn(c[v],L),T=A,H=P-y[w]-M,O=P/2-y[w]/2+R,D=rc(T,O,H),$=!a.arrow&&Eo(o)!=null&&O!==D&&i.reference[w]/2-(OO<=0)){var M,T;const O=(((M=i.flip)==null?void 0:M.index)||0)+1,D=P[O];if(D&&(!(c==="alignment"?v!==Qt(D):!1)||A.every(_=>Qt(_.placement)===v?_.overflows[0]>0:!0)))return{data:{index:O,overflows:A},reset:{placement:D}};let $=(T=A.filter(W=>W.overflows[0]<=0).sort((W,_)=>W.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(h){case"bestFit":{var H;const W=(H=A.filter(_=>{if(b){const z=Qt(_.placement);return z===v||z==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((_,z)=>_[1]-z[1])[0])==null?void 0:H[0];W&&($=W);break}case"initialPlacement":$=s;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Wp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kp(e){return Qb.some(t=>e[t]>=0)}const uN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yn(e,t);switch(r){case"referenceHidden":{const i=await Ni(t,{...o,elementContext:"reference"}),l=Wp(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Kp(l)}}}case"escaped":{const i=await Ni(t,{...o,altBoundary:!0}),l=Wp(i,n.floating);return{data:{escapedOffsets:l,escaped:Kp(l)}}}default:return{}}}}},Pv=new Set(["left","top"]);async function cN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=vn(n),s=Eo(n),a=Qt(n)==="y",u=Pv.has(l)?-1:1,d=i&&a?-1:1,c=yn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:w}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof w=="number"&&(h=s==="end"?w*-1:w),a?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const dN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await cN(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},fN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:m,y:v}=S;return{x:m,y:v}}},...a}=yn(e,t),u={x:n,y:r},d=await Ni(t,a),c=Qt(vn(o)),p=Ad(c);let h=u[p],w=u[c];if(i){const S=p==="y"?"top":"left",m=p==="y"?"bottom":"right",v=h+d[S],x=h-d[m];h=rc(v,h,x)}if(l){const S=c==="y"?"top":"left",m=c==="y"?"bottom":"right",v=w+d[S],x=w-d[m];w=rc(v,w,x)}const y=s.fn({...t,[p]:h,[c]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:i,[c]:l}}}}}},pN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=yn(e,t),d={x:n,y:r},c=Qt(o),p=Ad(c);let h=d[p],w=d[c];const y=yn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=p==="y"?"height":"width",C=i.reference[p]-i.floating[x]+S.mainAxis,N=i.reference[p]+i.reference[x]-S.mainAxis;hN&&(h=N)}if(u){var m,v;const x=p==="y"?"width":"height",C=Pv.has(vn(o)),N=i.reference[c]-i.floating[x]+(C&&((m=l.offset)==null?void 0:m[c])||0)+(C?0:S.crossAxis),b=i.reference[c]+i.reference[x]+(C?0:((v=l.offset)==null?void 0:v[c])||0)-(C?S.crossAxis:0);wb&&(w=b)}return{[p]:h,[c]:w}}}},hN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...u}=yn(e,t),d=await Ni(t,u),c=vn(o),p=Eo(o),h=Qt(o)==="y",{width:w,height:y}=i.floating;let S,m;c==="top"||c==="bottom"?(S=c,m=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,S=p==="end"?"top":"bottom");const v=y-d.top-d.bottom,x=w-d.left-d.right,C=Yn(y-d[S],v),N=Yn(w-d[m],x),b=!t.middlewareData.shift;let P=C,R=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),b&&!p){const A=ct(d.left,0),M=ct(d.right,0),T=ct(d.top,0),H=ct(d.bottom,0);h?R=w-2*(A!==0||M!==0?A+M:ct(d.left,d.right)):P=y-2*(T!==0||H!==0?T+H:ct(d.top,d.bottom))}await a({...t,availableWidth:R,availableHeight:P});const L=await l.getDimensions(s.floating);return w!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Bs(){return typeof window<"u"}function bo(e){return _v(e)?(e.nodeName||"").toLowerCase():"#document"}function mt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nn(e){var t;return(t=(_v(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _v(e){return Bs()?e instanceof Node||e instanceof mt(e).Node:!1}function Ft(e){return Bs()?e instanceof Element||e instanceof mt(e).Element:!1}function en(e){return Bs()?e instanceof HTMLElement||e instanceof mt(e).HTMLElement:!1}function Gp(e){return!Bs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot}const mN=new Set(["inline","contents"]);function zi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!mN.has(o)}const gN=new Set(["table","td","th"]);function yN(e){return gN.has(bo(e))}const vN=[":popover-open",":modal"];function $s(e){return vN.some(t=>{try{return e.matches(t)}catch{return!1}})}const xN=["transform","translate","scale","rotate","perspective"],wN=["transform","translate","scale","rotate","perspective","filter"],SN=["paint","layout","strict","content"];function Od(e){const t=Ld(),n=Ft(e)?Bt(e):e;return xN.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)||wN.some(r=>(n.willChange||"").includes(r))||SN.some(r=>(n.contain||"").includes(r))}function kN(e){let t=Qn(e);for(;en(t)&&!yo(t);){if(Od(t))return t;if($s(t))return null;t=Qn(t)}return null}function Ld(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CN=new Set(["html","body","#document"]);function yo(e){return CN.has(bo(e))}function Bt(e){return mt(e).getComputedStyle(e)}function Us(e){return Ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qn(e){if(bo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gp(e)&&e.host||nn(e);return Gp(t)?t.host:t}function Tv(e){const t=Qn(e);return yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&zi(t)?t:Tv(t)}function Pi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tv(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=mt(o);if(i){const s=ic(l);return t.concat(l,l.visualViewport||[],zi(o)?o:[],s&&n?Pi(s):[])}return t.concat(o,Pi(o,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jv(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=en(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=ds(n)!==i||ds(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Dd(e){return Ft(e)?e:e.contextElement}function to(e){const t=Dd(e);if(!en(t))return Zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=jv(t);let l=(i?ds(n.width):n.width)/r,s=(i?ds(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const EN=Zt(0);function Rv(e){const t=mt(e);return!Ld()||!t.visualViewport?EN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mt(e)?!1:t}function wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Dd(e);let l=Zt(1);t&&(r?Ft(r)&&(l=to(r)):l=to(e));const s=bN(i,n,r)?Rv(i):Zt(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,d=o.width/l.x,c=o.height/l.y;if(i){const p=mt(i),h=r&&Ft(r)?mt(r):r;let w=p,y=ic(w);for(;y&&r&&h!==w;){const S=to(y),m=y.getBoundingClientRect(),v=Bt(y),x=m.left+(y.clientLeft+parseFloat(v.paddingLeft))*S.x,C=m.top+(y.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,d*=S.x,c*=S.y,a+=x,u+=C,w=mt(y),y=ic(w)}}return ps({width:d,height:c,x:a,y:u})}function Vs(e,t){const n=Us(e).scrollLeft;return t?t.left+n:wr(nn(e)).left+n}function Av(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Vs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function NN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=nn(r),s=t?$s(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=Zt(1);const d=Zt(0),c=en(r);if((c||!c&&!i)&&((bo(r)!=="body"||zi(l))&&(a=Us(r)),en(r))){const h=wr(r);u=to(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=l&&!c&&!i?Av(l,a):Zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-a.scrollTop*u.y+d.y+p.y}}function PN(e){return Array.from(e.getClientRects())}function _N(e){const t=nn(e),n=Us(e),r=e.ownerDocument.body,o=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Vs(e);const s=-n.scrollTop;return Bt(r).direction==="rtl"&&(l+=ct(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}const Yp=25;function TN(e,t){const n=mt(e),r=nn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const d=Ld();(!d||d&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}const u=Vs(r);if(u<=0){const d=r.ownerDocument,c=d.body,p=getComputedStyle(c),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-c.clientWidth-h);w<=Yp&&(i-=w)}else u<=Yp&&(i+=u);return{width:i,height:l,x:s,y:a}}const jN=new Set(["absolute","fixed"]);function RN(e,t){const n=wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=en(e)?to(e):Zt(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,u=r*i.y;return{width:l,height:s,x:a,y:u}}function Qp(e,t,n){let r;if(t==="viewport")r=TN(e,n);else if(t==="document")r=_N(nn(e));else if(Ft(t))r=RN(t,n);else{const o=Rv(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ps(r)}function Iv(e,t){const n=Qn(e);return n===t||!Ft(n)||yo(n)?!1:Bt(n).position==="fixed"||Iv(n,t)}function AN(e,t){const n=t.get(e);if(n)return n;let r=Pi(e,[],!1).filter(s=>Ft(s)&&bo(s)!=="body"),o=null;const i=Bt(e).position==="fixed";let l=i?Qn(e):e;for(;Ft(l)&&!yo(l);){const s=Bt(l),a=Od(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&jN.has(o.position)||zi(l)&&!a&&Iv(e,l))?r=r.filter(d=>d!==l):o=s,l=Qn(l)}return t.set(e,r),r}function IN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?$s(t)?[]:AN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,d)=>{const c=Qp(t,d,o);return u.top=ct(c.top,u.top),u.right=Yn(c.right,u.right),u.bottom=Yn(c.bottom,u.bottom),u.left=ct(c.left,u.left),u},Qp(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function MN(e){const{width:t,height:n}=jv(e);return{width:t,height:n}}function ON(e,t,n){const r=en(t),o=nn(t),i=n==="fixed",l=wr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=Zt(0);function u(){a.x=Vs(o)}if(r||!r&&!i)if((bo(t)!=="body"||zi(o))&&(s=Us(t)),r){const h=wr(t,!0,i,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?Av(o,s):Zt(0),c=l.left+s.scrollLeft-a.x-d.x,p=l.top+s.scrollTop-a.y-d.y;return{x:c,y:p,width:l.width,height:l.height}}function Aa(e){return Bt(e).position==="static"}function Xp(e,t){if(!en(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return nn(e)===n&&(n=n.ownerDocument.body),n}function Mv(e,t){const n=mt(e);if($s(e))return n;if(!en(e)){let o=Qn(e);for(;o&&!yo(o);){if(Ft(o)&&!Aa(o))return o;o=Qn(o)}return n}let r=Xp(e,t);for(;r&&yN(r)&&Aa(r);)r=Xp(r,t);return r&&yo(r)&&Aa(r)&&!Od(r)?n:r||kN(e)||n}const LN=async function(e){const t=this.getOffsetParent||Mv,n=this.getDimensions,r=await n(e.floating);return{reference:ON(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DN(e){return Bt(e).direction==="rtl"}const zN={convertOffsetParentRelativeRectToViewportRelativeRect:NN,getDocumentElement:nn,getClippingRect:IN,getOffsetParent:Mv,getElementRects:LN,getClientRects:PN,getDimensions:MN,getScale:to,isElement:Ft,isRTL:DN};function Ov(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FN(e,t){let n=null,r;const o=nn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const u=e.getBoundingClientRect(),{left:d,top:c,width:p,height:h}=u;if(s||t(),!p||!h)return;const w=ll(c),y=ll(o.clientWidth-(d+p)),S=ll(o.clientHeight-(c+h)),m=ll(d),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-m+"px",threshold:ct(0,Yn(1,a))||1};let C=!0;function N(b){const P=b[0].intersectionRatio;if(P!==a){if(!C)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!Ov(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),i}function BN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Dd(e),d=o||i?[...u?Pi(u):[],...Pi(t)]:[];d.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const c=u&&s?FN(u,n):null;let p=-1,h=null;l&&(h=new ResizeObserver(m=>{let[v]=m;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let w,y=a?wr(e):null;a&&S();function S(){const m=wr(e);y&&!Ov(y,m)&&n(),y=m,w=requestAnimationFrame(S)}return n(),()=>{var m;d.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),c==null||c(),(m=h)==null||m.disconnect(),h=null,a&&cancelAnimationFrame(w)}}const $N=dN,UN=fN,VN=aN,HN=hN,WN=uN,qp=sN,KN=pN,GN=(e,t,n)=>{const r=new Map,o={platform:zN,...n},i={...o.platform,_c:r};return lN(e,t,{...o,platform:i})};var YN=typeof document<"u",QN=function(){},Tl=YN?g.useLayoutEffect:QN;function hs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!hs(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Lv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jp(e,t){const n=Lv(e);return Math.round(t*n)/n}function Ia(e){const t=g.useRef(e);return Tl(()=>{t.current=e}),t}function XN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[d,c]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=g.useState(r);hs(p,r)||h(r);const[w,y]=g.useState(null),[S,m]=g.useState(null),v=g.useCallback(_=>{_!==b.current&&(b.current=_,y(_))},[]),x=g.useCallback(_=>{_!==P.current&&(P.current=_,m(_))},[]),C=i||w,N=l||S,b=g.useRef(null),P=g.useRef(null),R=g.useRef(d),L=a!=null,A=Ia(a),M=Ia(o),T=Ia(u),H=g.useCallback(()=>{if(!b.current||!P.current)return;const _={placement:t,strategy:n,middleware:p};M.current&&(_.platform=M.current),GN(b.current,P.current,_).then(z=>{const k={...z,isPositioned:T.current!==!1};O.current&&!hs(R.current,k)&&(R.current=k,So.flushSync(()=>{c(k)}))})},[p,t,n,M,T]);Tl(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,c(_=>({..._,isPositioned:!1})))},[u]);const O=g.useRef(!1);Tl(()=>(O.current=!0,()=>{O.current=!1}),[]),Tl(()=>{if(C&&(b.current=C),N&&(P.current=N),C&&N){if(A.current)return A.current(C,N,H);H()}},[C,N,H,A,L]);const D=g.useMemo(()=>({reference:b,floating:P,setReference:v,setFloating:x}),[v,x]),$=g.useMemo(()=>({reference:C,floating:N}),[C,N]),W=g.useMemo(()=>{const _={position:n,left:0,top:0};if(!$.floating)return _;const z=Jp($.floating,d.x),k=Jp($.floating,d.y);return s?{..._,transform:"translate("+z+"px, "+k+"px)",...Lv($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,$.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:H,refs:D,elements:$,floatingStyles:W}),[d,H,D,$,W])}const qN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qp({element:r.current,padding:o}).fn(n):{}:r?qp({element:r,padding:o}).fn(n):{}}}},JN=(e,t)=>({...$N(e),options:[e,t]}),ZN=(e,t)=>({...UN(e),options:[e,t]}),e2=(e,t)=>({...KN(e),options:[e,t]}),t2=(e,t)=>({...VN(e),options:[e,t]}),n2=(e,t)=>({...HN(e),options:[e,t]}),r2=(e,t)=>({...WN(e),options:[e,t]}),o2=(e,t)=>({...qN(e),options:[e,t]});var i2="Arrow",Dv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(ee.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dv.displayName=i2;var l2=Dv,zd="Popper",[zv,Fv]=er(zd),[s2,Bv]=zv(zd),$v=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return f.jsx(s2,{scope:t,anchor:r,onAnchorChange:o,children:n})};$v.displayName=zd;var Uv="PopperAnchor",Vv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Bv(Uv,n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&i.onAnchorChange(a.current)}),r?null:f.jsx(ee.div,{...o,ref:s})});Vv.displayName=Uv;var Fd="PopperContent",[a2,u2]=zv(Fd),Hv=g.forwardRef((e,t)=>{var G,oe,Ce,le,se,fe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:w,...y}=e,S=Bv(Fd,n),[m,v]=g.useState(null),x=pe(t,Ge=>v(Ge)),[C,N]=g.useState(null),b=ov(C),P=(b==null?void 0:b.width)??0,R=(b==null?void 0:b.height)??0,L=r+(i!=="center"?"-"+i:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],T=M.length>0,H={padding:A,boundary:M.filter(d2),altBoundary:T},{refs:O,floatingStyles:D,placement:$,isPositioned:W,middlewareData:_}=XN({strategy:"fixed",placement:L,whileElementsMounted:(...Ge)=>BN(...Ge,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[JN({mainAxis:o+R,alignmentAxis:l}),a&&ZN({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?e2():void 0,...H}),a&&t2({...H}),n2({...H,apply:({elements:Ge,rects:xt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:Zs}=xt.reference,or=Ge.floating.style;or.setProperty("--radix-popper-available-width",`${Sn}px`),or.setProperty("--radix-popper-available-height",`${kn}px`),or.setProperty("--radix-popper-anchor-width",`${Cn}px`),or.setProperty("--radix-popper-anchor-height",`${Zs}px`)}}),C&&o2({element:C,padding:s}),f2({arrowWidth:P,arrowHeight:R}),p&&r2({strategy:"referenceHidden",...H})]}),[z,k]=Gv($),j=Gn(w);We(()=>{W&&(j==null||j())},[W,j]);const U=(G=_.arrow)==null?void 0:G.x,E=(oe=_.arrow)==null?void 0:oe.y,X=((Ce=_.arrow)==null?void 0:Ce.centerOffset)!==0,[ue,Z]=g.useState();return We(()=>{m&&Z(window.getComputedStyle(m).zIndex)},[m]),f.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:W?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(le=_.transformOrigin)==null?void 0:le.x,(se=_.transformOrigin)==null?void 0:se.y].join(" "),...((fe=_.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(a2,{scope:n,placedSide:z,onArrowChange:N,arrowX:U,arrowY:E,shouldHideArrow:X,children:f.jsx(ee.div,{"data-side":z,"data-align":k,...y,ref:x,style:{...y.style,animation:W?void 0:"none"}})})})});Hv.displayName=Fd;var Wv="PopperArrow",c2={top:"bottom",right:"left",bottom:"top",left:"right"},Kv=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=u2(Wv,r),l=c2[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(l2,{...o,ref:n,style:{...o.style,display:"block"}})})});Kv.displayName=Wv;function d2(e){return e!==null}var f2=e=>({name:"transformOrigin",options:e,fn(t){var S,m,v;const{placement:n,rects:r,middlewareData:o}=t,l=((S=o.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,d]=Gv(n),c={start:"0%",center:"50%",end:"100%"}[d],p=(((m=o.arrow)==null?void 0:m.x)??0)+s/2,h=(((v=o.arrow)==null?void 0:v.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?c:`${p}px`,y=`${-a}px`):u==="top"?(w=l?c:`${p}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?c:`${h}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?c:`${h}px`),{data:{x:w,y}}}});function Gv(e){const[t,n="center"]=e.split("-");return[t,n]}var p2=$v,h2=Vv,m2=Hv,g2=Kv,y2="Portal",Bd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=g.useState(!1);We(()=>i(!0),[]);const l=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?XS.createPortal(f.jsx(ee.div,{...r,ref:t}),l):null});Bd.displayName=y2;var Yv=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"}),v2="VisuallyHidden",x2=g.forwardRef((e,t)=>f.jsx(ee.span,{...e,ref:t,style:{...Yv,...e.style}}));x2.displayName=v2;var w2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rr=new WeakMap,sl=new WeakMap,al={},Ma=0,Qv=function(e){return e&&(e.host||Qv(e.parentNode))},S2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Qv(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})},k2=function(e,t,n,r){var o=S2(t,Array.isArray(e)?e:[e]);al[n]||(al[n]=new WeakMap);var i=al[n],l=[],s=new Set,a=new Set(o),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||a.has(c)||Array.prototype.forEach.call(c.children,function(p){if(s.has(p))d(p);else try{var h=p.getAttribute(r),w=h!==null&&h!=="false",y=(Rr.get(p)||0)+1,S=(i.get(p)||0)+1;Rr.set(p,y),i.set(p,S),l.push(p),y===1&&w&&sl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",p,m)}})};return d(t),s.clear(),Ma++,function(){l.forEach(function(c){var p=Rr.get(c)-1,h=i.get(c)-1;Rr.set(c,p),i.set(c,h),p||(sl.has(c)||c.removeAttribute(r),sl.delete(c)),h||c.removeAttribute(n)}),Ma--,Ma||(Rr=new WeakMap,Rr=new WeakMap,sl=new WeakMap,al={})}},Xv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||w2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),k2(r,o,n,"aria-hidden")):function(){return null}},Gt=function(){return Gt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return F2;var t=B2(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])}},U2=ex(),no="data-scroll-locked",V2=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(E2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(no,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(jl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Rl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jl," .").concat(jl,` { + right: 0 `).concat(r,`; + } + + .`).concat(Rl," .").concat(Rl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(no,`] { + `).concat(b2,": ").concat(s,`px; + } +`)},th=function(){var e=parseInt(document.body.getAttribute(no)||"0",10);return isFinite(e)?e:0},H2=function(){g.useEffect(function(){return document.body.setAttribute(no,(th()+1).toString()),function(){var e=th()-1;e<=0?document.body.removeAttribute(no):document.body.setAttribute(no,e.toString())}},[])},W2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;H2();var i=g.useMemo(function(){return $2(o)},[o]);return g.createElement(U2,{styles:V2(i,!t,o,n?"":"!important")})},lc=!1;if(typeof window<"u")try{var ul=Object.defineProperty({},"passive",{get:function(){return lc=!0,!0}});window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{lc=!1}var Ar=lc?{passive:!1}:!1,K2=function(e){return e.tagName==="TEXTAREA"},tx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!K2(e)&&n[t]==="visible")},G2=function(e){return tx(e,"overflowY")},Y2=function(e){return tx(e,"overflowX")},nh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nx(e,r);if(o){var i=rx(e,r),l=i[1],s=i[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Q2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},X2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nx=function(e,t){return e==="v"?G2(t):Y2(t)},rx=function(e,t){return e==="v"?Q2(t):X2(t)},q2=function(e,t){return e==="h"&&t==="rtl"?-1:1},J2=function(e,t,n,r,o){var i=q2(e,window.getComputedStyle(t).direction),l=i*r,s=n.target,a=t.contains(s),u=!1,d=l>0,c=0,p=0;do{if(!s)break;var h=rx(e,s),w=h[0],y=h[1],S=h[2],m=y-S-i*w;(w||m)&&nx(e,s)&&(c+=m,p+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(d&&(o&&Math.abs(c)<1||!o&&l>c)||!d&&(o&&Math.abs(p)<1||!o&&-l>p))&&(u=!0),u},cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rh=function(e){return[e.deltaX,e.deltaY]},oh=function(e){return e&&"current"in e?e.current:e},Z2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eP=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},tP=0,Ir=[];function nP(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(tP++)[0],i=g.useState(ex)[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(o));var y=C2([e.lockRef.current],(e.shards||[]).map(oh),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var m=cl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-m[0],C="deltaY"in y?y.deltaY:v[1]-m[1],N,b=y.target,P=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in y&&P==="h"&&b.type==="range")return!1;var R=nh(P,b);if(!R)return!0;if(R?N=P:(N=P==="v"?"h":"v",R=nh(P,b)),!R)return!1;if(!r.current&&"changedTouches"in y&&(x||C)&&(r.current=N),!N)return!0;var L=r.current||N;return J2(L,S,y,L==="h"?x:C,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Ir.length||Ir[Ir.length-1]!==i)){var m="deltaY"in S?rh(S):cl(S),v=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&Z2(N.delta,m)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(oh).filter(Boolean).filter(function(N){return N.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(y,S,m,v){var x={name:y,delta:S,target:m,should:v,shadowParent:rP(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=g.useCallback(function(y){n.current=cl(y),r.current=void 0},[]),c=g.useCallback(function(y){u(y.type,rh(y),y.target,s(y,e.lockRef.current))},[]),p=g.useCallback(function(y){u(y.type,cl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Ir.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Ar),document.addEventListener("touchmove",a,Ar),document.addEventListener("touchstart",d,Ar),function(){Ir=Ir.filter(function(y){return y!==i}),document.removeEventListener("wheel",a,Ar),document.removeEventListener("touchmove",a,Ar),document.removeEventListener("touchstart",d,Ar)}},[]);var h=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:eP(o)}):null,h?g.createElement(W2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oP=A2(Zv,nP);var ox=g.forwardRef(function(e,t){return g.createElement(Hs,Gt({},e,{ref:t,sideCar:oP}))});ox.classNames=Hs.classNames;const ix=ox;var iP=[" ","Enter","ArrowUp","ArrowDown"],lP=[" ","Enter"],Sr="Select",[Ws,Ks,sP]=Pd(Sr),[No,lI]=er(Sr,[sP,Fv]),Gs=Fv(),[aP,tr]=No(Sr),[uP,cP]=No(Sr),lx=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:l,defaultValue:s,onValueChange:a,dir:u,name:d,autoComplete:c,disabled:p,required:h,form:w}=e,y=Gs(t),[S,m]=g.useState(null),[v,x]=g.useState(null),[C,N]=g.useState(!1),b=Ds(u),[P,R]=go({prop:r,defaultProp:o??!1,onChange:i,caller:Sr}),[L,A]=go({prop:l,defaultProp:s,onChange:a,caller:Sr}),M=g.useRef(null),T=S?w||!!S.closest("form"):!0,[H,O]=g.useState(new Set),D=Array.from(H).map($=>$.props.value).join(";");return f.jsx(p2,{...y,children:f.jsxs(aP,{required:h,scope:t,trigger:S,onTriggerChange:m,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Hn(),value:L,onValueChange:A,open:P,onOpenChange:R,dir:b,triggerPointerDownPosRef:M,disabled:p,children:[f.jsx(Ws.Provider,{scope:t,children:f.jsx(uP,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback($=>{O(W=>new Set(W).add($))},[]),onNativeOptionRemove:g.useCallback($=>{O(W=>{const _=new Set(W);return _.delete($),_})},[]),children:n})}),T?f.jsxs(Rx,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:c,value:L,onChange:$=>A($.target.value),disabled:p,form:w,children:[L===void 0?f.jsx("option",{value:""}):null,Array.from(H)]},D):null]})})};lx.displayName=Sr;var sx="SelectTrigger",ax=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Gs(n),l=tr(sx,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=Ks(n),d=g.useRef("touch"),[c,p,h]=Ix(y=>{const S=u().filter(x=>!x.disabled),m=S.find(x=>x.value===l.value),v=Mx(S,y,m);v!==void 0&&l.onValueChange(v.value)}),w=y=>{s||(l.onOpenChange(!0),h()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return f.jsx(h2,{asChild:!0,...i,children:f.jsx(ee.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Ax(l.value)?"":void 0,...o,ref:a,onClick:J(o.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&w(y)}),onPointerDown:J(o.onPointerDown,y=>{d.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:J(o.onKeyDown,y=>{const S=c.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&iP.includes(y.key)&&(w(),y.preventDefault())})})})});ax.displayName=sx;var ux="SelectValue",cx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...s}=e,a=tr(ux,n),{onValueNodeHasChildrenChange:u}=a,d=i!==void 0,c=pe(t,a.onValueNodeChange);return We(()=>{u(d)},[u,d]),f.jsx(ee.span,{...s,ref:c,style:{pointerEvents:"none"},children:Ax(a.value)?f.jsx(f.Fragment,{children:l}):i})});cx.displayName=ux;var dP="SelectIcon",dx=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(ee.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});dx.displayName=dP;var fP="SelectPortal",fx=e=>f.jsx(Bd,{asChild:!0,...e});fx.displayName=fP;var kr="SelectContent",px=g.forwardRef((e,t)=>{const n=tr(kr,e.__scopeSelect),[r,o]=g.useState();if(We(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?So.createPortal(f.jsx(hx,{scope:e.__scopeSelect,children:f.jsx(Ws.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(mx,{...e,ref:t})});px.displayName=kr;var jt=10,[hx,nr]=No(kr),pP="SelectContentImpl",hP=mo("SelectContent.RemoveScroll"),mx=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:y,avoidCollisions:S,...m}=e,v=tr(kr,n),[x,C]=g.useState(null),[N,b]=g.useState(null),P=pe(t,G=>C(G)),[R,L]=g.useState(null),[A,M]=g.useState(null),T=Ks(n),[H,O]=g.useState(!1),D=g.useRef(!1);g.useEffect(()=>{if(x)return Xv(x)},[x]),Ev();const $=g.useCallback(G=>{const[oe,...Ce]=T().map(fe=>fe.ref.current),[le]=Ce.slice(-1),se=document.activeElement;for(const fe of G)if(fe===se||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===oe&&N&&(N.scrollTop=0),fe===le&&N&&(N.scrollTop=N.scrollHeight),fe==null||fe.focus(),document.activeElement!==se))return},[T,N]),W=g.useCallback(()=>$([R,x]),[$,R,x]);g.useEffect(()=>{H&&W()},[H,W]);const{onOpenChange:_,triggerPointerDownPosRef:z}=v;g.useEffect(()=>{if(x){let G={x:0,y:0};const oe=le=>{var se,fe;G={x:Math.abs(Math.round(le.pageX)-(((se=z.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(le.pageY)-(((fe=z.current)==null?void 0:fe.y)??0))}},Ce=le=>{G.x<=10&&G.y<=10?le.preventDefault():x.contains(le.target)||_(!1),document.removeEventListener("pointermove",oe),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[x,_,z]),g.useEffect(()=>{const G=()=>_(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[_]);const[k,j]=Ix(G=>{const oe=T().filter(se=>!se.disabled),Ce=oe.find(se=>se.ref.current===document.activeElement),le=Mx(oe,G,Ce);le&&setTimeout(()=>le.ref.current.focus())}),U=g.useCallback((G,oe,Ce)=>{const le=!D.current&&!Ce;(v.value!==void 0&&v.value===oe||le)&&(L(G),le&&(D.current=!0))},[v.value]),E=g.useCallback(()=>x==null?void 0:x.focus(),[x]),X=g.useCallback((G,oe,Ce)=>{const le=!D.current&&!Ce;(v.value!==void 0&&v.value===oe||le)&&M(G)},[v.value]),ue=r==="popper"?sc:gx,Z=ue===sc?{side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return f.jsx(hx,{scope:n,content:x,viewport:N,onViewportChange:b,itemRefCallback:U,selectedItem:R,onItemLeave:E,itemTextRefCallback:X,focusSelectedItem:W,selectedItemText:A,position:r,isPositioned:H,searchRef:k,children:f.jsx(ix,{as:hP,allowPinchZoom:!0,children:f.jsx(Rd,{asChild:!0,trapped:v.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:J(o,G=>{var oe;(oe=v.trigger)==null||oe.focus({preventScroll:!0}),G.preventDefault()}),children:f.jsx(jd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:G=>G.preventDefault(),...m,...Z,onPlaced:()=>O(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:J(m.onKeyDown,G=>{const oe=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!oe&&G.key.length===1&&j(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let le=T().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(G.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const se=G.target,fe=le.indexOf(se);le=le.slice(fe+1)}setTimeout(()=>$(le)),G.preventDefault()}})})})})})})});mx.displayName=pP;var mP="SelectItemAlignedPosition",gx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tr(kr,n),l=nr(kr,n),[s,a]=g.useState(null),[u,d]=g.useState(null),c=pe(t,P=>d(P)),p=Ks(n),h=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:m,focusSelectedItem:v}=l,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&y&&S&&m){const P=i.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),A=m.getBoundingClientRect();if(i.dir!=="rtl"){const se=A.left-R.left,fe=L.left-se,Ge=P.left-fe,xt=P.width+Ge,Sn=Math.max(xt,R.width),kn=window.innerWidth-jt,Cn=cs(fe,[jt,Math.max(jt,kn-Sn)]);s.style.minWidth=xt+"px",s.style.left=Cn+"px"}else{const se=R.right-A.right,fe=window.innerWidth-L.right-se,Ge=window.innerWidth-P.right-fe,xt=P.width+Ge,Sn=Math.max(xt,R.width),kn=window.innerWidth-jt,Cn=cs(fe,[jt,Math.max(jt,kn-Sn)]);s.style.minWidth=xt+"px",s.style.right=Cn+"px"}const M=p(),T=window.innerHeight-jt*2,H=y.scrollHeight,O=window.getComputedStyle(u),D=parseInt(O.borderTopWidth,10),$=parseInt(O.paddingTop,10),W=parseInt(O.borderBottomWidth,10),_=parseInt(O.paddingBottom,10),z=D+$+H+_+W,k=Math.min(S.offsetHeight*5,z),j=window.getComputedStyle(y),U=parseInt(j.paddingTop,10),E=parseInt(j.paddingBottom,10),X=P.top+P.height/2-jt,ue=T-X,Z=S.offsetHeight/2,G=S.offsetTop+Z,oe=D+$+G,Ce=z-oe;if(oe<=X){const se=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const fe=u.clientHeight-y.offsetTop-y.offsetHeight,Ge=Math.max(ue,Z+(se?E:0)+fe+W),xt=oe+Ge;s.style.height=xt+"px"}else{const se=M.length>0&&S===M[0].ref.current;s.style.top="0px";const Ge=Math.max(X,D+y.offsetTop+(se?U:0)+Z)+Ce;s.style.height=Ge+"px",y.scrollTop=oe-X+y.offsetTop}s.style.margin=`${jt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,s,u,y,S,m,i.dir,r]);We(()=>x(),[x]);const[C,N]=g.useState();We(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const b=g.useCallback(P=>{P&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return f.jsx(yP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(ee.div,{...o,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});gx.displayName=mP;var gP="SelectPopperPosition",sc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=jt,...i}=e,l=Gs(n);return f.jsx(m2,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});sc.displayName=gP;var[yP,$d]=No(kr,{}),ac="SelectViewport",yx=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nr(ac,n),l=$d(ac,n),s=pe(t,i.onViewportChange),a=g.useRef(0);return f.jsxs(f.Fragment,{children:[f.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}),f.jsx(Ws.Slot,{scope:n,children:f.jsx(ee.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&c){const h=Math.abs(a.current-d.scrollTop);if(h>0){const w=window.innerHeight-jt*2,y=parseFloat(c.style.minHeight),S=parseFloat(c.style.height),m=Math.max(y,S);if(m0?C:0,c.style.justifyContent="flex-end")}}}a.current=d.scrollTop})})})]})});yx.displayName=ac;var vx="SelectGroup",[vP,xP]=No(vx),xx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hn();return f.jsx(vP,{scope:n,id:o,children:f.jsx(ee.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xx.displayName=vx;var wx="SelectLabel",Sx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xP(wx,n);return f.jsx(ee.div,{id:o.id,...r,ref:t})});Sx.displayName=wx;var ms="SelectItem",[wP,kx]=No(ms),Cx=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,s=tr(ms,n),a=nr(ms,n),u=s.value===r,[d,c]=g.useState(i??""),[p,h]=g.useState(!1),w=pe(t,v=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,v,r,o)}),y=Hn(),S=g.useRef("touch"),m=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(wP,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:g.useCallback(v=>{c(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:f.jsx(Ws.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:f.jsx(ee.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:w,onFocus:J(l.onFocus,()=>h(!0)),onBlur:J(l.onBlur,()=>h(!1)),onClick:J(l.onClick,()=>{S.current!=="mouse"&&m()}),onPointerUp:J(l.onPointerUp,()=>{S.current==="mouse"&&m()}),onPointerDown:J(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:J(l.onPointerMove,v=>{var x;S.current=v.pointerType,o?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:J(l.onKeyDown,v=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(lP.includes(v.key)&&m(),v.key===" "&&v.preventDefault())})})})})});Cx.displayName=ms;var Go="SelectItemText",Ex=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,l=tr(Go,n),s=nr(Go,n),a=kx(Go,n),u=cP(Go,n),[d,c]=g.useState(null),p=pe(t,m=>c(m),a.onItemTextChange,m=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,m,a.value,a.disabled)}),h=d==null?void 0:d.textContent,w=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:h},a.value),[a.disabled,a.value,h]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return We(()=>(y(w),()=>S(w)),[y,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(ee.span,{id:a.textId,...i,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?So.createPortal(i.children,l.valueNode):null]})});Ex.displayName=Go;var bx="SelectItemIndicator",Nx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kx(bx,n).isSelected?f.jsx(ee.span,{"aria-hidden":!0,...r,ref:t}):null});Nx.displayName=bx;var uc="SelectScrollUpButton",Px=g.forwardRef((e,t)=>{const n=nr(uc,e.__scopeSelect),r=$d(uc,e.__scopeSelect),[o,i]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;i(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Tx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Px.displayName=uc;var cc="SelectScrollDownButton",_x=g.forwardRef((e,t)=>{const n=nr(cc,e.__scopeSelect),r=$d(cc,e.__scopeSelect),[o,i]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Tx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});_x.displayName=cc;var Tx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nr("SelectScrollButton",n),l=g.useRef(null),s=Ks(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),We(()=>{var d;const u=s().find(c=>c.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),f.jsx(ee.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{a()})})}),SP="SelectSeparator",jx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ee.div,{"aria-hidden":!0,...r,ref:t})});jx.displayName=SP;var dc="SelectArrow",kP=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Gs(n),i=tr(dc,n),l=nr(dc,n);return i.open&&l.position==="popper"?f.jsx(g2,{...o,...r,ref:t}):null});kP.displayName=dc;var CP="SelectBubbleInput",Rx=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=g.useRef(null),i=pe(r,o),l=rv(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const a=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const c=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(c)}},[l,t]),f.jsx(ee.select,{...n,style:{...Yv,...n.style},ref:i,defaultValue:t})});Rx.displayName=CP;function Ax(e){return e===""||e===void 0}function Ix(e){const t=Gn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Mx(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=EP(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function EP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bP=lx,Ox=ax,NP=cx,PP=dx,_P=fx,Lx=px,TP=yx,jP=xx,Dx=Sx,zx=Cx,RP=Ex,AP=Nx,Fx=Px,Bx=_x,$x=jx;const za=bP,dl=jP,Fa=NP,Al=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Ox,{ref:r,className:ie("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,f.jsx(PP,{asChild:!0,children:f.jsx(Ty,{className:"h-4 w-4 opacity-50"})})]}));Al.displayName=Ox.displayName;const Ux=g.forwardRef(({className:e,...t},n)=>f.jsx(Fx,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(HC,{className:"h-4 w-4"})}));Ux.displayName=Fx.displayName;const Vx=g.forwardRef(({className:e,...t},n)=>f.jsx(Bx,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Ty,{className:"h-4 w-4"})}));Vx.displayName=Bx.displayName;const Il=g.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>f.jsx(_P,{children:f.jsxs(Lx,{ref:o,className:ie("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:[f.jsx(Ux,{}),f.jsx(TP,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(Vx,{})]})}));Il.displayName=Lx.displayName;const Yo=g.forwardRef(({className:e,...t},n)=>f.jsx(Dx,{ref:n,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Yo.displayName=Dx.displayName;const Lr=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(zx,{ref:r,className:ie("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:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(AP,{children:f.jsx($C,{className:"h-4 w-4"})})}),f.jsx(RP,{children:t})]}));Lr.displayName=zx.displayName;const IP=g.forwardRef(({className:e,...t},n)=>f.jsx($x,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));IP.displayName=$x.displayName;var Ys="Dialog",[Hx,Wx]=er(Ys),[MP,$t]=Hx(Ys),Kx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,d]=go({prop:r,defaultProp:o??!1,onChange:i,caller:Ys});return f.jsx(MP,{scope:t,triggerRef:s,contentRef:a,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(c=>!c),[d]),modal:l,children:n})};Kx.displayName=Ys;var Gx="DialogTrigger",Yx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Gx,n),i=pe(t,o.triggerRef);return f.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Hd(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)})});Yx.displayName=Gx;var Ud="DialogPortal",[OP,Qx]=Hx(Ud,{forceMount:void 0}),Xx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=$t(Ud,t);return f.jsx(OP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(Di,{present:n||i.open,children:f.jsx(Bd,{asChild:!0,container:o,children:l})}))})};Xx.displayName=Ud;var gs="DialogOverlay",qx=g.forwardRef((e,t)=>{const n=Qx(gs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$t(gs,e.__scopeDialog);return i.modal?f.jsx(Di,{present:r||i.open,children:f.jsx(DP,{...o,ref:t})}):null});qx.displayName=gs;var LP=mo("DialogOverlay.RemoveScroll"),DP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(gs,n);return f.jsx(ix,{as:LP,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(ee.div,{"data-state":Hd(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cr="DialogContent",Jx=g.forwardRef((e,t)=>{const n=Qx(Cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$t(Cr,e.__scopeDialog);return f.jsx(Di,{present:r||i.open,children:i.modal?f.jsx(zP,{...o,ref:t}):f.jsx(FP,{...o,ref:t})})});Jx.displayName=Cr;var zP=g.forwardRef((e,t)=>{const n=$t(Cr,e.__scopeDialog),r=g.useRef(null),o=pe(t,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return Xv(i)},[]),f.jsx(Zx,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&i.preventDefault()}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault())})}),FP=g.forwardRef((e,t)=>{const n=$t(Cr,e.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return f.jsx(Zx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Zx=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,s=$t(Cr,n),a=g.useRef(null),u=pe(t,a);return Ev(),f.jsxs(f.Fragment,{children:[f.jsx(Rd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(jd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx($P,{titleId:s.titleId}),f.jsx(VP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Vd="DialogTitle",e0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Vd,n);return f.jsx(ee.h2,{id:o.titleId,...r,ref:t})});e0.displayName=Vd;var t0="DialogDescription",n0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(t0,n);return f.jsx(ee.p,{id:o.descriptionId,...r,ref:t})});n0.displayName=t0;var r0="DialogClose",o0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(r0,n);return f.jsx(ee.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});o0.displayName=r0;function Hd(e){return e?"open":"closed"}var i0="DialogTitleWarning",[BP,l0]=DE(i0,{contentName:Cr,titleName:Vd,docsSlug:"dialog"}),$P=({titleId:e})=>{const t=l0(i0),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},UP="DialogDescriptionWarning",VP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${l0(UP).contentName}}.`;return g.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},HP=Kx,WP=Yx,KP=Xx,GP=qx,YP=Jx,QP=e0,XP=n0,s0=o0,a0="AlertDialog",[qP,sI]=er(a0,[Wx]),wn=Wx(),u0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(HP,{...r,...n,modal:!0})};u0.displayName=a0;var JP="AlertDialogTrigger",ZP=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(WP,{...o,...r,ref:t})});ZP.displayName=JP;var e_="AlertDialogPortal",c0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(KP,{...r,...n})};c0.displayName=e_;var t_="AlertDialogOverlay",d0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(GP,{...o,...r,ref:t})});d0.displayName=t_;var ro="AlertDialogContent",[n_,r_]=qP(ro),o_=RE("AlertDialogContent"),f0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=wn(n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return f.jsx(BP,{contentName:ro,titleName:p0,docsSlug:"alert-dialog",children:f.jsx(n_,{scope:n,cancelRef:a,children:f.jsxs(YP,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:J(o.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=a.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[f.jsx(o_,{children:r}),f.jsx(l_,{contentRef:l})]})})})});f0.displayName=ro;var p0="AlertDialogTitle",h0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(QP,{...o,...r,ref:t})});h0.displayName=p0;var m0="AlertDialogDescription",g0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(XP,{...o,...r,ref:t})});g0.displayName=m0;var i_="AlertDialogAction",y0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(s0,{...o,...r,ref:t})});y0.displayName=i_;var v0="AlertDialogCancel",x0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=r_(v0,n),i=wn(n),l=pe(t,o);return f.jsx(s0,{...i,...r,ref:l})});x0.displayName=v0;var l_=({contentRef:e})=>{const t=`\`${ro}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ro}\` by passing a \`${m0}\` 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 \`${ro}\`. 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},s_=u0,a_=c0,w0=d0,S0=f0,k0=y0,C0=x0,E0=h0,b0=g0;const u_=s_,c_=a_,N0=g.forwardRef(({className:e,...t},n)=>f.jsx(w0,{className:ie("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}));N0.displayName=w0.displayName;const P0=g.forwardRef(({className:e,...t},n)=>f.jsxs(c_,{children:[f.jsx(N0,{}),f.jsx(S0,{ref:n,className:ie("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})]}));P0.displayName=S0.displayName;const _0=({className:e,...t})=>f.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...t});_0.displayName="AlertDialogHeader";const T0=({className:e,...t})=>f.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});T0.displayName="AlertDialogFooter";const j0=g.forwardRef(({className:e,...t},n)=>f.jsx(E0,{ref:n,className:ie("text-lg font-semibold",e),...t}));j0.displayName=E0.displayName;const R0=g.forwardRef(({className:e,...t},n)=>f.jsx(b0,{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));R0.displayName=b0.displayName;const A0=g.forwardRef(({className:e,...t},n)=>f.jsx(k0,{ref:n,className:ie(Nd(),e),...t}));A0.displayName=k0.displayName;const I0=g.forwardRef(({className:e,...t},n)=>f.jsx(C0,{ref:n,className:ie(Nd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));I0.displayName=C0.displayName;const M0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:ie("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}));M0.displayName="Textarea";function d_(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const f_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h_={};function ih(e,t){return((t||h_).jsx?p_:f_).test(e)}const m_=/[ \t\n\f\r]/g;function g_(e){return typeof e=="object"?e.type==="text"?lh(e.value):!1:lh(e)}function lh(e){return e.replace(m_,"")===""}class Fi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fi.prototype.normal={};Fi.prototype.property={};Fi.prototype.space=void 0;function O0(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Fi(n,r,t)}function fc(e){return e.toLowerCase()}class lt{constructor(t,n){this.attribute=n,this.property=t}}lt.prototype.attribute="";lt.prototype.booleanish=!1;lt.prototype.boolean=!1;lt.prototype.commaOrSpaceSeparated=!1;lt.prototype.commaSeparated=!1;lt.prototype.defined=!1;lt.prototype.mustUseProperty=!1;lt.prototype.number=!1;lt.prototype.overloadedBoolean=!1;lt.prototype.property="";lt.prototype.spaceSeparated=!1;lt.prototype.space=void 0;let y_=0;const q=_r(),je=_r(),pc=_r(),B=_r(),ge=_r(),oo=_r(),at=_r();function _r(){return 2**++y_}const hc=Object.freeze(Object.defineProperty({__proto__:null,boolean:q,booleanish:je,commaOrSpaceSeparated:at,commaSeparated:oo,number:B,overloadedBoolean:pc,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Ba=Object.keys(hc);class Wd extends lt{constructor(t,n,r,o){let i=-1;if(super(t,n),sh(this,"space",o),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&k_.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ah,b_);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ah.test(i)){let l=i.replace(S_,E_);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Wd}return new o(r,t)}function E_(e){return"-"+e.toLowerCase()}function b_(e){return e.charAt(1).toUpperCase()}const N_=O0([L0,v_,F0,B0,$0],"html"),Kd=O0([L0,x_,F0,B0,$0],"svg");function P_(e){return e.join(" ").trim()}var Gd={},uh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,__=/\n/g,T_=/^\s*/,j_=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,R_=/^:\s*/,A_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I_=/^[;\s]*/,M_=/^\s+|\s+$/g,O_=` +`,ch="/",dh="*",ar="",L_="comment",D_="declaration",z_=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 o(w){var y=w.match(__);y&&(n+=y.length);var S=w.lastIndexOf(O_);r=~S?w.length-S:r+w.length}function i(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return o(S),e=e.slice(S.length),y}}function u(){a(T_)}function d(w){var y;for(w=w||[];y=c();)y!==!1&&w.push(y);return w}function c(){var w=i();if(!(ch!=e.charAt(0)||dh!=e.charAt(1))){for(var y=2;ar!=e.charAt(y)&&(dh!=e.charAt(y)||ch!=e.charAt(y+1));)++y;if(y+=2,ar===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,o(S),e=e.slice(y),r+=2,w({type:L_,comment:S})}}function p(){var w=i(),y=a(j_);if(y){if(c(),!a(R_))return s("property missing ':'");var S=a(A_),m=w({type:D_,property:fh(y[0].replace(uh,ar)),value:S?fh(S[0].replace(uh,ar)):ar});return a(I_),m}}function h(){var w=[];d(w);for(var y;y=p();)y!==!1&&(w.push(y),d(w));return w}return u(),h()};function fh(e){return e?e.replace(M_,ar):ar}var F_=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=$_;var B_=F_(z_);function $_(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,B_.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var l=i.property,s=i.value;o?t(l,s,i):s&&(n=n||{},n[l]=s)}}),n}var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.camelCase=void 0;var U_=/^--[a-zA-Z0-9_-]+$/,V_=/-([a-z])/g,H_=/^[^-]+$/,W_=/^-(webkit|moz|ms|o|khtml)-/,K_=/^-(ms)-/,G_=function(e){return!e||H_.test(e)||U_.test(e)},Y_=function(e,t){return t.toUpperCase()},ph=function(e,t){return"".concat(t,"-")},Q_=function(e,t){return t===void 0&&(t={}),G_(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(K_,ph):e=e.replace(W_,ph),e.replace(V_,Y_))};Qs.camelCase=Q_;var X_=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},q_=X_(Gd),J_=Qs;function mc(e,t){var n={};return!e||typeof e!="string"||(0,q_.default)(e,function(r,o){r&&o&&(n[(0,J_.camelCase)(r,t)]=o)}),n}mc.default=mc;var Z_=mc;const eT=xs(Z_),U0=V0("end"),Yd=V0("start");function V0(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 tT(e){const t=Yd(e),n=U0(e);if(t&&n)return{start:t,end:n}}function oi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hh(e.position):"start"in e||"end"in e?hh(e):"line"in e||"column"in e?gc(e):""}function gc(e){return mh(e&&e.line)+":"+mh(e&&e.column)}function hh(e){return gc(e&&e.start)+"-"+gc(e&&e.end)}function mh(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(l=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?i.ruleId=r:(i.source=r.slice(0,a),i.ruleId=r.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=oi(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const Qd={}.hasOwnProperty,nT=new Map,rT=/[A-Z]/g,oT=new Set(["table","tbody","thead","tfoot","tr"]),iT=new Set(["td","th"]),H0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lT(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=pT(n,t.jsx,t.jsxs)}const o={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"?Kd:N_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=W0(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function W0(e,t,n){if(t.type==="element")return sT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return cT(e,t,n);if(t.type==="mdxjsEsm")return uT(e,t);if(t.type==="root")return dT(e,t,n);if(t.type==="text")return fT(e,t)}function sT(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Kd,e.schema=o),e.ancestors.push(t);const i=G0(e,t.tagName,!1),l=mT(e,t);let s=qd(e,t);return oT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!g_(a):!0})),K0(e,l,i,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function aT(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)}_i(e,t.position)}function uT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_i(e,t.position)}function cT(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Kd,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:G0(e,t.name,!0),l=gT(e,t),s=qd(e,t);return K0(e,l,i,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function dT(e,t,n){const r={};return Xd(r,qd(e,t)),e.create(t,e.Fragment,r,n)}function fT(e,t){return t.value}function K0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pT(e,t,n){return r;function r(o,i,l,s){const u=Array.isArray(l.children)?n:t;return s?u(i,l,s):u(i,l)}}function hT(e,t){return n;function n(r,o,i,l){const s=Array.isArray(i.children),a=Yd(r);return t(o,i,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function mT(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Qd.call(t.properties,o)){const i=yT(e,o,t.properties[o]);if(i){const[l,s]=i;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&iT.has(t.tagName)?r=s:n[l]=s}}if(r){const i=n.style||(n.style={});i[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 i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else _i(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else _i(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function qd(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:nT;for(;++ro?0:o+t:t=t>o?o: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);i0?(tn(e,e.length,0,t),e):t}const vh={}.hasOwnProperty;function bT(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 io(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yt=rr(/[A-Za-z]/),pt=rr(/[\dA-Za-z]/),_T=rr(/[#-'*+\--9=?A-Z^-~]/);function yc(e){return e!==null&&(e<32||e===127)}const vc=rr(/\d/),TT=rr(/[\dA-Fa-f]/),jT=rr(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const RT=rr(/\p{P}|\p{S}/u),AT=rr(/\s/);function rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _o(e){const t=[];let n=-1,r=0,o=0;for(;++n55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(l=String.fromCharCode(i,s),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(a){return ce(a)?(e.enter(n),s(a)):t(a)}function s(a){return ce(a)&&i++l))return;const P=t.events.length;let R=P,L,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(L){A=t.events[R][1].end;break}L=!0}for(m(r),b=P;bx;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function v(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function DT(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wh(e){if(e===null||it(e)||AT(e))return 1;if(RT(e))return 2}function Zd(e,t,n){const r=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Sh(c,-a),Sh(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),u=kt(u,Zd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,tn(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&ce(b)?ve(e,v,"linePrefix",i+1)(b):v(b)}function v(b){return b===null||Y(b)?e.check(kh,y,C)(b):(e.enter("codeFlowValue"),x(b))}function x(b){return b===null||Y(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),x)}function C(b){return e.exit("codeFenced"),t(b)}function N(b,P,R){let L=0;return A;function A(D){return b.enter("lineEnding"),b.consume(D),b.exit("lineEnding"),M}function M(D){return b.enter("codeFencedFence"),ce(D)?ve(b,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===s?(b.enter("codeFencedFenceSequence"),H(D)):R(D)}function H(D){return D===s?(L++,b.consume(D),H):L>=l?(b.exit("codeFencedFenceSequence"),ce(D)?ve(b,O,"whitespace")(D):O(D)):R(D)}function O(D){return D===null||Y(D)?(b.exit("codeFencedFence"),P(D)):R(D)}}}function QT(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ua={name:"codeIndented",tokenize:qT},XT={partial:!0,tokenize:JT};function qT(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),ve(e,i,"linePrefix",4+1)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):Y(u)?e.attempt(XT,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Y(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function JT(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ve(e,i,"linePrefix",4+1)(l)}function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):Y(l)?o(l):n(l)}}const ZT={name:"codeText",previous:tj,resolve:ej,tokenize:nj};function ej(e){let t=e.length-4,n=3,r,o;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 o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&$o(this.left,r),i.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),$o(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$o(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 e1(e,t,n,r,o,i,l,s,a){const u=a||Number.POSITIVE_INFINITY;let d=0;return c;function c(m){return m===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(m),e.exit(i),p):m===null||m===32||m===41||yc(m)?n(m):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(m))}function p(m){return m===62?(e.enter(i),e.consume(m),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(e.exit("chunkString"),e.exit(s),p(m)):m===null||m===60||Y(m)?n(m):(e.consume(m),m===92?w:h)}function w(m){return m===60||m===62||m===92?(e.consume(m),h):h(m)}function y(m){return!d&&(m===null||m===41||it(m))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(m)):d999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):Y(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||Y(h)||s++>999?(e.exit("chunkString"),d(h)):(e.consume(h),a||(a=!ce(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function n1(e,t,n,r,o,i){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===l?(e.exit(i),a(l)):p===null?n(p):Y(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ve(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||Y(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:d)}function c(p){return p===l||p===92?(e.consume(p),d):d(p)}}function ii(e,t){let n;return r;function r(o){return Y(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ce(o)?ve(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const cj={name:"definition",tokenize:fj},dj={partial:!0,tokenize:pj};function fj(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),l(h)}function l(h){return t1.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=io(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return it(h)?ii(e,u)(h):u(h)}function u(h){return e1(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(dj,c,c)(h)}function c(h){return ce(h)?ve(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Y(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function pj(e,t,n){return r;function r(s){return it(s)?ii(e,o)(s):n(s)}function o(s){return n1(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return ce(s)?ve(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const hj={name:"hardBreakEscape",tokenize:mj};function mj(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Y(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const gj={name:"headingAtx",resolve:yj,tokenize:vj};function yj(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},tn(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function vj(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||it(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),a(d)):d===null||Y(d)?(e.exit("atxHeading"),t(d)):ce(d)?ve(e,s,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),s(d))}function u(d){return d===null||d===35||it(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const xj=["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"],Eh=["pre","script","style","textarea"],wj={concrete:!0,name:"htmlFlow",resolveTo:Cj,tokenize:Ej},Sj={partial:!0,tokenize:Nj},kj={partial:!0,tokenize:bj};function Cj(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 Ej(e,t,n){const r=this;let o,i,l,s,a;return u;function u(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),p):E===47?(e.consume(E),i=!0,y):E===63?(e.consume(E),o=3,r.interrupt?t:k):Yt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function p(E){return E===45?(e.consume(E),o=2,h):E===91?(e.consume(E),o=5,s=0,w):Yt(E)?(e.consume(E),o=4,r.interrupt?t:k):n(E)}function h(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function w(E){const X="CDATA[";return E===X.charCodeAt(s++)?(e.consume(E),s===X.length?r.interrupt?t:T:w):n(E)}function y(E){return Yt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||it(E)){const X=E===47,ue=l.toLowerCase();return!X&&!i&&Eh.includes(ue)?(o=1,r.interrupt?t(E):T(E)):xj.includes(l.toLowerCase())?(o=6,X?(e.consume(E),m):r.interrupt?t(E):T(E)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):i?v(E):x(E))}return E===45||pt(E)?(e.consume(E),l+=String.fromCharCode(E),S):n(E)}function m(E){return E===62?(e.consume(E),r.interrupt?t:T):n(E)}function v(E){return ce(E)?(e.consume(E),v):A(E)}function x(E){return E===47?(e.consume(E),A):E===58||E===95||Yt(E)?(e.consume(E),C):ce(E)?(e.consume(E),x):A(E)}function C(E){return E===45||E===46||E===58||E===95||pt(E)?(e.consume(E),C):N(E)}function N(E){return E===61?(e.consume(E),b):ce(E)?(e.consume(E),N):x(E)}function b(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,P):ce(E)?(e.consume(E),b):R(E)}function P(E){return E===a?(e.consume(E),a=null,L):E===null||Y(E)?n(E):(e.consume(E),P)}function R(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||it(E)?N(E):(e.consume(E),R)}function L(E){return E===47||E===62||ce(E)?x(E):n(E)}function A(E){return E===62?(e.consume(E),M):n(E)}function M(E){return E===null||Y(E)?T(E):ce(E)?(e.consume(E),M):n(E)}function T(E){return E===45&&o===2?(e.consume(E),$):E===60&&o===1?(e.consume(E),W):E===62&&o===4?(e.consume(E),j):E===63&&o===3?(e.consume(E),k):E===93&&o===5?(e.consume(E),z):Y(E)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Sj,U,H)(E)):E===null||Y(E)?(e.exit("htmlFlowData"),H(E)):(e.consume(E),T)}function H(E){return e.check(kj,O,U)(E)}function O(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),D}function D(E){return E===null||Y(E)?H(E):(e.enter("htmlFlowData"),T(E))}function $(E){return E===45?(e.consume(E),k):T(E)}function W(E){return E===47?(e.consume(E),l="",_):T(E)}function _(E){if(E===62){const X=l.toLowerCase();return Eh.includes(X)?(e.consume(E),j):T(E)}return Yt(E)&&l.length<8?(e.consume(E),l+=String.fromCharCode(E),_):T(E)}function z(E){return E===93?(e.consume(E),k):T(E)}function k(E){return E===62?(e.consume(E),j):E===45&&o===2?(e.consume(E),k):T(E)}function j(E){return E===null||Y(E)?(e.exit("htmlFlowData"),U(E)):(e.consume(E),j)}function U(E){return e.exit("htmlFlow"),t(E)}}function bj(e,t,n){const r=this;return o;function o(l){return Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Nj(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Xs,t,n)}}const Pj={name:"htmlText",tokenize:_j};function _j(e,t,n){const r=this;let o,i,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),N):k===63?(e.consume(k),x):Yt(k)?(e.consume(k),R):n(k)}function u(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,w):Yt(k)?(e.consume(k),v):n(k)}function d(k){return k===45?(e.consume(k),h):n(k)}function c(k){return k===null?n(k):k===45?(e.consume(k),p):Y(k)?(l=c,W(k)):(e.consume(k),c)}function p(k){return k===45?(e.consume(k),h):c(k)}function h(k){return k===62?$(k):k===45?p(k):c(k)}function w(k){const j="CDATA[";return k===j.charCodeAt(i++)?(e.consume(k),i===j.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):Y(k)?(l=y,W(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),m):y(k)}function m(k){return k===62?$(k):k===93?(e.consume(k),m):y(k)}function v(k){return k===null||k===62?$(k):Y(k)?(l=v,W(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):Y(k)?(l=x,W(k)):(e.consume(k),x)}function C(k){return k===62?$(k):x(k)}function N(k){return Yt(k)?(e.consume(k),b):n(k)}function b(k){return k===45||pt(k)?(e.consume(k),b):P(k)}function P(k){return Y(k)?(l=P,W(k)):ce(k)?(e.consume(k),P):$(k)}function R(k){return k===45||pt(k)?(e.consume(k),R):k===47||k===62||it(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),$):k===58||k===95||Yt(k)?(e.consume(k),A):Y(k)?(l=L,W(k)):ce(k)?(e.consume(k),L):$(k)}function A(k){return k===45||k===46||k===58||k===95||pt(k)?(e.consume(k),A):M(k)}function M(k){return k===61?(e.consume(k),T):Y(k)?(l=M,W(k)):ce(k)?(e.consume(k),M):L(k)}function T(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,H):Y(k)?(l=T,W(k)):ce(k)?(e.consume(k),T):(e.consume(k),O)}function H(k){return k===o?(e.consume(k),o=void 0,D):k===null?n(k):Y(k)?(l=H,W(k)):(e.consume(k),H)}function O(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||it(k)?L(k):(e.consume(k),O)}function D(k){return k===47||k===62||it(k)?L(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return ce(k)?ve(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return e.enter("htmlTextData"),l(k)}}const ef={name:"labelEnd",resolveAll:Aj,resolveTo:Ij,tokenize:Mj},Tj={tokenize:Oj},jj={tokenize:Lj},Rj={tokenize:Dj};function Aj(e){let t=-1;const n=[];for(;++t=3&&(u===null||Y(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ce(u)?ve(e,s,"whitespace")(u):s(u))}}const Ze={continuation:{tokenize:Gj},exit:Qj,name:"list",tokenize:Kj},Hj={partial:!0,tokenize:Xj},Wj={partial:!0,tokenize:Yj};function Kj(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return s;function s(h){const w=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vc(h)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ml,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return vc(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Xs,r.interrupt?n:d,e.attempt(Hj,p,c))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function c(h){return ce(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Gj(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xs,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!ce(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wj,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(Ze,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Yj(e,t,n){const r=this;return ve(e,o,"listItemIndent",r.containerState.size+1);function o(i){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(i):n(i)}}function Qj(e){e.exit(this.containerState.type)}function Xj(e,t,n){const r=this;return ve(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function o(i){const l=r.events[r.events.length-1];return!ce(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const bh={name:"setextUnderline",resolveTo:qj,tokenize:Jj};function qj(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Jj(e,t,n){const r=this;let o;return i;function i(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),o=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===o?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ce(u)?ve(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Zj={tokenize:eR};function eR(e){const t=this,n=e.attempt(Xs,r,e.attempt(this.parser.constructs.flowInitial,o,ve(e,e.attempt(this.parser.constructs.flow,o,e.attempt(ij,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tR={resolveAll:o1()},nR=r1("string"),rR=r1("text");function r1(e){return{resolveAll:o1(e==="text"?oR:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,s);return l;function l(d){return u(d)?i(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),a}function a(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),a)}function u(d){if(d===null)return!0;const c=o[d];let p=-1;if(c)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function yR(e,t){let n=-1;const r=[];let o;for(;++n0){const Pt=Q.tokenStack[Q.tokenStack.length-1];(Pt[1]||Ph).call(Q,void 0,Pt[0])}for(V.position={start:Nn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Nn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function MR(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 OR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function s1(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function LR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s1(e,t);const o={src:_o(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function DR(e,t){const n={src:_o(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 zR(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 FR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s1(e,t);const o={href:_o(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function BR(e,t){const n={href:_o(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 $R(e,t,n){const r=e.all(t),o=n?UR(n):a1(t),i={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s1}function VR(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Yd(t.children[1]),a=U0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function YR(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(jh(t.slice(o),o>0,!1)),i.join("")}function jh(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===_h||i===Th;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===_h||i===Th;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function qR(e,t){const n={type:"text",value:XR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZR={blockquote:_R,break:TR,code:jR,delete:RR,emphasis:AR,footnoteReference:IR,heading:MR,html:OR,imageReference:LR,image:DR,inlineCode:zR,linkReference:FR,link:BR,listItem:$R,list:VR,paragraph:HR,root:WR,strong:KR,table:GR,tableCell:QR,tableRow:YR,text:qR,thematicBreak:JR,toml:fl,yaml:fl,definition:fl,footnoteDefinition:fl};function fl(){}const u1=-1,qs=0,li=1,ys=2,tf=3,nf=4,rf=5,of=6,c1=7,d1=8,Rh=typeof self=="object"?self:globalThis,eA=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case qs:case u1:return n(l,o);case li:{const s=n([],o);for(const a of l)s.push(r(a));return s}case ys:{const s=n({},o);for(const[a,u]of l)s[r(a)]=r(u);return s}case tf:return n(new Date(l),o);case nf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),o)}case rf:{const s=n(new Map,o);for(const[a,u]of l)s.set(r(a),r(u));return s}case of:{const s=n(new Set,o);for(const a of l)s.add(r(a));return s}case c1:{const{name:s,message:a}=l;return n(new Rh[s](a),o)}case d1:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Rh[i](l),o)};return r},Ah=e=>eA(new Map,e)(0),Mr="",{toString:tA}={},{keys:nA}=Object,Uo=e=>{const t=typeof e;if(t!=="object"||!e)return[qs,t];const n=tA.call(e).slice(8,-1);switch(n){case"Array":return[li,Mr];case"Object":return[ys,Mr];case"Date":return[tf,Mr];case"RegExp":return[nf,Mr];case"Map":return[rf,Mr];case"Set":return[of,Mr];case"DataView":return[li,n]}return n.includes("Array")?[li,n]:n.includes("Error")?[c1,n]:[ys,n]},pl=([e,t])=>e===qs&&(t==="function"||t==="symbol"),rA=(e,t,n,r)=>{const o=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},i=l=>{if(n.has(l))return n.get(l);let[s,a]=Uo(l);switch(s){case qs:{let d=l;switch(a){case"bigint":s=d1,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return o([u1],l)}return o([s,d],l)}case li:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),o([a,[...p]],l)}const d=[],c=o([s,d],l);for(const p of l)d.push(i(p));return c}case ys:{if(a)switch(a){case"BigInt":return o([a,l.toString()],l);case"Boolean":case"Number":case"String":return o([a,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const d=[],c=o([s,d],l);for(const p of nA(l))(e||!pl(Uo(l[p])))&&d.push([i(p),i(l[p])]);return c}case tf:return o([s,l.toISOString()],l);case nf:{const{source:d,flags:c}=l;return o([s,{source:d,flags:c}],l)}case rf:{const d=[],c=o([s,d],l);for(const[p,h]of l)(e||!(pl(Uo(p))||pl(Uo(h))))&&d.push([i(p),i(h)]);return c}case of:{const d=[],c=o([s,d],l);for(const p of l)(e||!pl(Uo(p)))&&d.push(i(p));return c}}const{message:u}=l;return o([s,{name:a,message:u}],l)};return i},Ih=(e,{json:t,lossy:n}={})=>{const r=[];return rA(!(t||n),!!t,new Map,r)(e),r},vs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ah(Ih(e,t)):structuredClone(e):(e,t)=>Ah(Ih(e,t));function oA(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 iA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oA,r=e.options.footnoteBackLabel||iA,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let v=typeof n=="string"?n:n(a,h);typeof v=="string"&&(v={type:"text",value:v}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else d.push(...w);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,m),s.push(m)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...vs(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const f1=function(e){if(e==null)return cA;if(typeof e=="function")return Js(e);if(typeof e=="object")return Array.isArray(e)?sA(e):aA(e);if(typeof e=="string")return uA(e);throw new Error("Expected function, string, or object as test")};function sA(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=p1,w,y,S;if((!t||i(a,u,d[d.length-1]||void 0))&&(h=mA(n(a,d)),h[0]===Mh))return h;if("children"in a&&a.children){const m=a;if(m.children&&h[0]!==pA)for(y=(r?m.children.length:-1)+l,S=d.concat(m);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function Oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lh(e,t){const n=yA(e,t),r=n.one(e,void 0),o=lA(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:` +`},o),i}function kA(e,t){return e&&"run"in e?async function(n,r){const o=Lh(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Lh(n,{file:r,...e||t})}}function Dh(e){if(e)throw e}var Ol=Object.prototype.hasOwnProperty,m1=Object.prototype.toString,zh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,Bh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):m1.call(t)==="[object Array]"},$h=function(t){if(!t||m1.call(t)!=="[object Object]")return!1;var n=Ol.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ol.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Ol.call(t,o)},Uh=function(t,n){zh&&n.name==="__proto__"?zh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Vh=function(t,n){if(n==="__proto__")if(Ol.call(t,n)){if(Fh)return Fh(t,n).value}else return;return t[n]},CA=function e(){var t,n,r,o,i,l,s=arguments[0],a=1,u=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(o);try{a=e.apply(this,l)}catch(u){const d=u;if(s&&n)throw d;return o(d)}s||(a&&a.then&&typeof a.then=="function"?a.then(i,o):a instanceof Error?o(a):i(a))}function o(l,...s){n||(n=!0,t(l,...s))}function i(l){o(null,l)}}const Wt={basename:NA,dirname:PA,extname:_A,join:TA,sep:"/"};function NA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bi(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function PA(e){if(Bi(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 _A(e){Bi(e);let t=e.length,n=-1,r=0,o=-1,i=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function TA(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RA(e,t){let n="",r=0,o=-1,i=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else s===46&&i>-1?i++:i=-1}return n}function Bi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AA={cwd:IA};function IA(){return"/"}function kc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function MA(e){if(typeof e=="string")e=new URL(e);else if(!kc(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 OA(e)}function OA(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[h,...w]=d;const y=r[p][1];Sc(y)&&Sc(h)&&(h=Ha(!0,y,h)),r[p]=[u,h,...w]}}}}const FA=new lf().freeze();function Ya(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wh(e){if(!Sc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Kh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return BA(e)?e:new g1(e)}function BA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $A(e){return typeof e=="string"||UA(e)}function UA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Gh=[],Yh={allowDangerousHtml:!0},HA=/^(https?|ircs?|mailto|xmpp)$/i,WA=[{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 KA(e){const t=GA(e),n=YA(e);return QA(t.runSync(t.parse(n),n),e)}function GA(e){const t=e.rehypePlugins||Gh,n=e.remarkPlugins||Gh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yh}:Yh;return FA().use(PR).use(n).use(kA,r).use(t)}function YA(e){const t=e.children||"",n=new g1;return typeof t=="string"&&(n.value=t),n}function QA(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||XA;for(const d of WA)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+VA+d.id,void 0);return h1(e,u),lT(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(d,c,p){if(d.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let h;for(h in $a)if(Object.hasOwn($a,h)&&Object.hasOwn(d.properties,h)){const w=d.properties[h],y=$a[h];(y===null||y.includes(d.tagName))&&(d.properties[h]=a(String(w||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(d,c,p)),h&&p&&typeof c=="number")return s&&d.children?p.children.splice(c,1,...d.children):p.children.splice(c,1),c}}}function XA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||HA.test(e.slice(0,t))?e:""}const y1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:o,isGenerating:i,stop:l,...s},a)=>{const u=g.useRef(null),d=()=>{var c;(c=u.current)==null||c.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(c=>({id:c.id,role:c.role,content:c.content.slice(0,50)+"..."}))),d()},[t]),f.jsxs("div",{className:ie("flex h-full flex-col",e),ref:a,...s,children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?f.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:f.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((c,p)=>f.jsxs("div",{className:ie("flex gap-3 w-full",c.role==="user"?"justify-end":"justify-start"),children:[c.role!=="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:f.jsx(_y,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:ie("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",c.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[f.jsxs("div",{className:"text-xs opacity-70",children:[c.role==="user"?"You":"Assistant"," • #",p+1]}),f.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:f.jsx(KA,{components:{p:({children:h})=>f.jsx("p",{className:"mb-2 last:mb-0",children:h}),ul:({children:h})=>f.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:h}),ol:({children:h})=>f.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:h}),li:({children:h})=>f.jsx("li",{className:"mb-1",children:h}),code:({children:h,className:w})=>!w?f.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:h}):f.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:h}),pre:({children:h})=>f.jsx("div",{className:"mb-2 last:mb-0",children:h}),strong:({children:h})=>f.jsx("strong",{className:"font-semibold",children:h}),em:({children:h})=>f.jsx("em",{className:"italic",children:h}),blockquote:({children:h})=>f.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:h}),h1:({children:h})=>f.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:h}),h2:({children:h})=>f.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:h}),h3:({children:h})=>f.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:h})},children:c.content})})]}),c.role==="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:f.jsx(kE,{className:"h-4 w-4"})})]},`${c.id}-${p}`)),f.jsx("div",{ref:u})]}),f.jsx("div",{className:"border-t p-4",children:f.jsxs("form",{onSubmit:o,className:"flex gap-2",children:[f.jsx(M0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),o(c))}}),i?f.jsx(Qe,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(vE,{className:"h-4 w-4"})}):f.jsx(Qe,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(fE,{className:"h-4 w-4"})})]})})]})});y1.displayName="Chat";const Vt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function v1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function qA(){return v1()}class JA{getAllSessions(){const t=localStorage.getItem(Vt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const o={id:v1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},i=this.getAllSessions();return i.unshift(o),localStorage.setItem(Vt.sessions,JSON.stringify(i)),o}updateSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);o!==-1&&(r[o]={...r[o],...n,updatedAt:Date.now()},localStorage.setItem(Vt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(o=>o.id!==t);localStorage.setItem(Vt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Vt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);if(o!==-1){const i={...n,id:qA(),timestamp:Date.now()};r[o].messages.push(i),r[o].updatedAt=Date.now(),localStorage.setItem(Vt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Vt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Vt.currentSession,t)}clear(){localStorage.removeItem(Vt.sessions),localStorage.removeItem(Vt.currentSession)}}const Pe=new JA;function ZA(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[o,i]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[d,c]=g.useState({isLoading:!1,error:null}),[p,h]=g.useState(n),[w,y]=g.useState(r),[S,m]=g.useState(.7),[v,x]=g.useState(1024),C=At.useMemo(()=>{var D;const O=o.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((D=O==null?void 0:O.messages)==null?void 0:D.length)||0}),O},[o,l]),N=At.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(D=>({id:D.id,role:D.role}))),O},[C==null?void 0:C.messages]);g.useEffect(()=>{const O=Pe.getAllSessions();i(O);const D=Pe.getCurrentSession();D?s(D.id):O.length>0&&(s(O[0].id),Pe.setCurrentSession(O[0].id))},[]);const b=g.useCallback(()=>{const O=Pe.createSession(void 0,p,w),D=Pe.getAllSessions();return i([...D]),s(O.id),Pe.setCurrentSession(O.id),O.id},[p,w]),P=g.useCallback(O=>{s(O),Pe.setCurrentSession(O)},[]),R=g.useCallback(O=>{Pe.deleteSession(O);const D=Pe.getAllSessions();i([...D]),l===O&&(D.length>0?(s(D[0].id),Pe.setCurrentSession(D[0].id)):s(null))},[l]),L=g.useCallback((O,D)=>{Pe.updateSession(O,{title:D});const $=Pe.getAllSessions();i([...$])},[]),A=g.useCallback(O=>{if(!l)return;Pe.addMessageToSession(l,O);const D=Pe.getAllSessions();i([...D])},[l]),M=g.useCallback(async()=>{var $,W;if(!a.trim()||d.isLoading)return;let O=l;O||(O=b());const D=a.trim();if(u(""),c({isLoading:!0,error:null}),O){Pe.addMessageToSession(O,{role:"user",content:D});const _=Pe.getAllSessions();i([..._])}try{const _=Pe.getSession(O),z=((W=($=_==null?void 0:_.messages)==null?void 0:$.filter(U=>U.role!=="system"))==null?void 0:W.map(U=>({role:U.role,content:U.content})))||[],k=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:z,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:v})});if(!k.ok){const U=await k.json();throw new Error(U.detail||`HTTP error! status: ${k.status}`)}const j=await k.json();if(O){Pe.addMessageToSession(O,{role:"assistant",content:j.content,thinking_content:j.thinking_content,model_used:j.model_used,supports_thinking:j.supports_thinking});const U=Pe.getAllSessions();i([...U])}c({isLoading:!1,error:null})}catch(_){const z=_ instanceof Error?_.message:"An error occurred";if(c({isLoading:!1,error:z}),O){Pe.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${z}`});const k=Pe.getAllSessions();i([...k])}}},[a,d.isLoading,l,b,A,w,N.length,t,p,S,v]),T=g.useCallback(()=>{c({isLoading:!1,error:null})},[]),H=g.useCallback(()=>{Pe.clear(),i([]),s(null)},[]);return{sessions:o,currentSession:C,currentSessionId:l,createNewSession:b,selectSession:P,deleteSession:R,renameSession:L,clearAllSessions:H,messages:N,input:a,setInput:u,sendMessage:M,stopGeneration:T,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}}function eI(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:o,deleteSession:i,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:d,isLoading:c,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}=ZA(),[C,N]=g.useState(!1),[b,P]=g.useState(null),[R,L]=g.useState(!1),[A,M]=g.useState(null),[T,H]=g.useState([]),[O,D]=g.useState([]),$=()=>{try{const j=JSON.parse(localStorage.getItem("savedAssistants")||"[]");D(j)}catch(j){console.error("Failed to load saved assistants:",j)}},W=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."}];g.useEffect(()=>{k(),$()},[]),g.useEffect(()=>{if(p&&!T.find(j=>j.model_name===p)){const j=T[0];j&&h(j.model_name)}},[T,p,h]),g.useEffect(()=>{(async()=>{if(!p||!T.length)return;const U=T.find(ue=>ue.model_name===p);if(!U)return;const E=`${window.location.protocol}//${window.location.host}`;if(U.type==="local"&&!U.is_loaded){M(U),L(!0);return}const X=T.filter(ue=>ue.type==="local"&&ue.is_loaded&&ue.model_name!==p);for(const ue of X)try{(await fetch(`${E}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ue.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ue.model_name}`)}catch(Z){console.error(`Error auto-unloading model ${ue.model_name}:`,Z)}X.length>0&&k()})()},[p,T]);const _=async()=>{if(A){L(!1),P(A.model_name);try{const j=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${j}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:A.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${A.model_name}`),k();else{console.error(`❌ Failed to load model: ${A.model_name}`);const E=T.find(X=>X.type==="api");E&&h(E.model_name)}}catch(j){console.error("Error loading model:",j);const U=T.find(E=>E.type==="api");U&&h(U.model_name)}finally{P(null),M(null)}}},z=()=>{L(!1),M(null);const j=T.find(U=>U.type==="api");j&&h(j.model_name)};g.useEffect(()=>{const j=async()=>{const U=`${window.location.protocol}//${window.location.host}`,E=T.filter(X=>X.type==="local"&&X.is_loaded);for(const X of E)try{await fetch(`${U}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:X.model_name})}),console.log(`✅ Cleanup: unloaded ${X.model_name}`)}catch(ue){console.error(`Error cleaning up model ${X.model_name}:`,ue)}};return()=>{j()}},[T]);const k=async()=>{try{const j=`${window.location.protocol}//${window.location.host}`,U=await fetch(`${j}/models`);if(U.ok){const E=await U.json();if(H(E.models),E.current_model&&p!==E.current_model)h(E.current_model);else if(!p&&E.models.length>0){const ue=E.models.find(Z=>Z.type==="api")||E.models[0];h(ue.model_name)}}}catch(j){console.error("Failed to fetch models:",j)}};return f.jsxs("div",{className:"min-h-screen bg-background flex",children:[f.jsx("div",{className:` + ${C?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs(Qe,{onClick:r,size:"sm",children:[f.jsx(lE,{className:"h-4 w-4 mr-1"}),"New"]})]}),f.jsx("div",{className:"space-y-2",children:e.map(j=>f.jsxs(ft,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===j.id?"bg-accent border-primary":""}`,onClick:()=>o(j.id),children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:j.title}),f.jsx(Qe,{size:"sm",variant:"ghost",onClick:U=>{U.stopPropagation(),i(j.id)},className:"h-6 w-6 p-0",children:f.jsx(My,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[j.messages.length," messages"]})]},j.id))})]})}),C&&f.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>N(!1)}),f.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsxs("div",{className:"flex h-14 items-center px-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Cd,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&f.jsxs(Me,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),f.jsx("div",{className:"ml-auto flex items-center gap-2",children:f.jsxs(Qe,{variant:"outline",size:"sm",onClick:()=>N(!C),className:"flex-shrink-0",children:[f.jsx(ZC,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]})})]})}),f.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:f.jsx(y1,{messages:l.map(j=>({id:j.id,role:j.role,content:j.content,createdAt:new Date(j.timestamp)})),input:s,handleInputChange:j=>a(j.target.value),handleSubmit:async j=>{j.preventDefault(),!(!p||!T.find(U=>U.model_name===p))&&await u()},isGenerating:c,stop:d,className:"flex-1"})}),f.jsx("div",{className:"w-[480px] xl:w-[520px] border-l bg-muted/30 overflow-y-auto",children:f.jsxs("div",{className:"p-6 space-y-8",children:[f.jsxs("div",{className:"flex items-center gap-3 pb-6 border-b",children:[f.jsx(Ed,{className:"h-6 w-6"}),f.jsx("h2",{className:"font-semibold text-xl",children:"Assistant Configuration"})]}),f.jsxs(ft,{children:[f.jsx(dn,{children:f.jsx(fn,{className:"text-base",children:"Model Selection"})}),f.jsxs(Jt,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium mb-3 block",children:"Active Model"}),f.jsxs(za,{value:p||"",onValueChange:h,children:[f.jsx(Al,{className:"w-full",children:f.jsx(Fa,{placeholder:"Select a model...",children:p&&(()=>{const j=T.find(E=>E.model_name===p);if(!j)return p;const U=j.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[U?f.jsx(us,{className:"h-4 w-4 text-blue-500"}):j.supports_thinking?f.jsx(ho,{className:"h-4 w-4 text-purple-500"}):f.jsx(Xu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:j.name}),b===p?f.jsx(Me,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(Me,{variant:"outline",className:"text-xs",children:U?"API":j.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(Il,{children:[f.jsxs(dl,{children:[f.jsx(Yo,{children:"🌐 API Models"}),T.filter(j=>j.type==="api").map(j=>f.jsx(Lr,{value:j.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(us,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:j.name}),f.jsx(Me,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},j.model_name))]}),f.jsxs(dl,{children:[f.jsx(Yo,{children:"💻 Local Models"}),T.filter(j=>j.type==="local").map(j=>f.jsx(Lr,{value:j.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[j.supports_thinking?f.jsx(ho,{className:"h-4 w-4 text-purple-500"}):f.jsx(Xu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:j.name}),b===j.model_name?f.jsx(Me,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):j.is_loaded?f.jsx(Me,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(Me,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},j.model_name))]})]})]})]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsx(Qe,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:f.jsxs(xy,{to:"/models",className:"flex items-center gap-2",children:[f.jsx(kd,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),f.jsxs(ft,{children:[f.jsx(dn,{children:f.jsx(fn,{className:"text-base",children:"Generation Parameters"})}),f.jsxs(Jt,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs(Ot,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),f.jsx(tc,{value:[S],onValueChange:j=>m(j[0]),min:0,max:2,step:.01,className:"mt-2",disabled:c}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),f.jsxs("div",{children:[f.jsxs(Ot,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),f.jsx(tc,{value:[v],onValueChange:j=>x(j[0]),min:100,max:4096,step:100,className:"mt-2",disabled:c})]})]})]}),f.jsxs(ft,{className:"border-2 border-blue-200 bg-blue-50/50",children:[f.jsx(dn,{children:f.jsxs(fn,{className:"text-sm flex items-center gap-2",children:[f.jsx(_y,{className:"h-4 w-4 text-blue-600"}),"Assistant Configuration",w&&f.jsx(Me,{variant:"default",className:"text-xs bg-blue-600",children:"Custom"})]})}),f.jsxs(Jt,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx(Ot,{className:"text-base font-medium text-muted-foreground",children:"My Assistants"}),f.jsx(Qe,{variant:"ghost",size:"sm",onClick:()=>{const j={id:Date.now().toString(),name:`Assistant ${new Date().toLocaleString()}`,description:"Custom configuration",model:p,systemPrompt:w,temperature:S,maxTokens:v,createdAt:new Date().toISOString()},U=JSON.parse(localStorage.getItem("savedAssistants")||"[]");U.push(j),localStorage.setItem("savedAssistants",JSON.stringify(U)),$()},className:"text-xs h-6 px-2",title:"Save current configuration",children:f.jsx(cE,{className:"h-3 w-3"})})]}),f.jsxs(za,{value:"",onValueChange:j=>{const U=O.find(E=>E.id===j);U&&(h(U.model),y(U.systemPrompt),m(U.temperature),x(U.maxTokens))},children:[f.jsx(Al,{className:"w-full h-10",children:f.jsx(Fa,{placeholder:"Load saved assistant..."})}),f.jsx(Il,{children:f.jsxs(dl,{children:[f.jsx(Yo,{children:"Saved Assistants"}),O.length===0?f.jsx(Lr,{value:"empty",disabled:!0,children:"No saved assistants"}):O.map(j=>f.jsx(Lr,{value:j.id,children:f.jsxs("div",{className:"flex flex-col items-start",children:[f.jsx("span",{className:"font-medium",children:j.name}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.model," • ",j.description]})]})},j.id))]})})]})]}),f.jsxs("div",{children:[f.jsx(Ot,{className:"text-base font-medium text-muted-foreground mb-4 block",children:"Quick Presets"}),f.jsxs(za,{value:"",onValueChange:j=>{const U=W.find(E=>E.name===j);U&&y(U.prompt)},children:[f.jsx(Al,{className:"w-full h-12",children:f.jsx(Fa,{placeholder:"Choose a preset..."})}),f.jsx(Il,{children:f.jsxs(dl,{children:[f.jsx(Yo,{children:"Assistant Presets"}),W.map(j=>f.jsx(Lr,{value:j.name,children:f.jsxs("div",{className:"flex flex-col items-start",children:[f.jsx("span",{className:"font-medium",children:j.name}),f.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:[j.prompt.slice(0,60),"..."]})]})},j.name))]})})]})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-5",children:[f.jsx(Ot,{htmlFor:"system-prompt",className:"text-lg font-semibold",children:"System Instructions"}),w&&f.jsxs(Qe,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-8 px-3 text-sm",disabled:c,children:[f.jsx(aE,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),f.jsx("textarea",{id:"system-prompt",value:w,onChange:j=>y(j.target.value),placeholder:"Define your AI assistant's role, personality, and behavior. For example: 'You are a helpful coding assistant that explains concepts clearly and provides practical examples...'",className:"w-full min-h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-y",disabled:c}),f.jsxs("p",{className:"text-base text-blue-600 mt-4 bg-blue-50 p-4 rounded-lg",children:["💡 ",f.jsx("strong",{children:"Tip:"})," Be specific about the assistant's role, tone, and how it should respond to help users."]})]})]})]})]})})]})]}),f.jsx(u_,{open:R,onOpenChange:L,children:f.jsxs(P0,{children:[f.jsxs(_0,{children:[f.jsx(j0,{children:"Load Local Model"}),f.jsxs(R0,{children:["Loading ",f.jsx("strong",{children:A==null?void 0:A.name})," will use approximately ",f.jsx("strong",{children:A==null?void 0:A.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),f.jsxs(T0,{children:[f.jsx(I0,{onClick:z,children:"Cancel"}),f.jsx(A0,{onClick:_,children:"Load Model"})]})]})})]})}function tI(){const e=wd(),[t,n]=g.useState([]),[r,o]=g.useState(!0),[i,l]=g.useState(null);g.useEffect(()=>{s()},[]);const s=async()=>{try{const d=`${window.location.protocol}//${window.location.host}`,c=await fetch(`${d}/models`);if(!c.ok)throw new Error(`Failed to fetch models: ${c.status}`);const p=await c.json();n(p.models)}catch(d){console.error("Error fetching models:",d)}finally{o(!1)}},a=async d=>{l(d);try{const c=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${c}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:d})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);s()}catch(c){console.error("Error loading model:",c)}finally{l(null)}},u=async d=>{l(d);try{const c=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${c}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:d})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);s()}catch(c){console.error("Error unloading model:",c)}finally{l(null)}};return r?f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsx(Qu,{className:"h-8 w-8 animate-spin"})}):f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(kd,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),f.jsxs(Qe,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(Xu,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[f.jsx(ft,{className:"bg-blue-50 border-blue-200",children:f.jsx(Jt,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Ay,{className:"h-5 w-5 text-blue-600 mt-0.5"}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),f.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."})]})]})})}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(us,{className:"h-5 w-5"}),"API Models",f.jsx(Me,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(d=>d.type==="api").map(d=>f.jsx(Qh,{model:d,modelLoading:i,onLoad:a,onUnload:u},d.model_name))})]}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(jy,{className:"h-5 w-5"}),"Local Models",f.jsx(Me,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(d=>d.type==="local").map(d=>f.jsx(Qh,{model:d,modelLoading:i,onLoad:a,onUnload:u},d.model_name))})]})]})})]})}function Qh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const o=e.type==="api",i=t===e.model_name,l=e.is_loaded;return f.jsxs(ft,{className:"hover:shadow-md transition-shadow",children:[f.jsx(dn,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(fn,{className:"text-base flex items-center gap-2",children:[o?f.jsx(us,{className:"h-4 w-4 text-blue-600"}):f.jsx(jy,{className:"h-4 w-4 text-green-600"}),e.name]}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&f.jsx(KC,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(Jt,{className:"space-y-3",children:[f.jsxs("div",{className:"space-y-2 text-sm",children:[!o&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Size:"}),f.jsx(Me,{variant:"outline",className:"text-xs",children:e.size_gb})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),f.jsx(Me,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Type:"}),f.jsx(Me,{variant:o?"default":"secondary",className:"text-xs",children:o?"API":"Local"})]}),e.supports_thinking&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Features:"}),f.jsxs(Me,{variant:"outline",className:"text-xs",children:[f.jsx(ho,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),f.jsx("div",{className:"pt-2",children:l?f.jsxs(Qe,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Qu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(My,{className:"h-4 w-4 mr-2"}),i?"Unloading...":"Unload Model"]}):f.jsxs(Qe,{size:"sm",onClick:()=>n(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Qu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(QC,{className:"h-4 w-4 mr-2"}),i?"Loading...":"Load Model"]})})]})]})}function nI(){return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:f.jsx(Ed,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[f.jsxs(ft,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(hE,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(Jt,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Backend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Frontend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),f.jsxs(ft,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(jp,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(Jt,{className:"space-y-4",children:f.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx(jp,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),f.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),f.jsxs(ft,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(Ay,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(Jt,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(Me,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(Me,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function rI(){return f.jsx(Xk,{children:f.jsx(Vk,{children:f.jsxs(Or,{path:"/",element:f.jsx(PE,{}),children:[f.jsx(Or,{index:!0,element:f.jsx(pb,{})}),f.jsx(Or,{path:"playground",element:f.jsx(eI,{})}),f.jsx(Or,{path:"models",element:f.jsx(tI,{})}),f.jsx(Or,{path:"settings",element:f.jsx(nI,{})})]})})})}qa.createRoot(document.getElementById("root")).render(f.jsx(At.StrictMode,{children:f.jsx(rI,{})})); +//# sourceMappingURL=index-b949d73e.js.map