diff --git "a/static/assets/index-7b7fcf98.js" "b/static/assets/index-7b7fcf98.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-7b7fcf98.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 Ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ys(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zh={exports:{}},vs={},em={exports:{}},Z={};/** + * @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 ji=Symbol.for("react.element"),N1=Symbol.for("react.portal"),P1=Symbol.for("react.fragment"),j1=Symbol.for("react.strict_mode"),_1=Symbol.for("react.profiler"),T1=Symbol.for("react.provider"),A1=Symbol.for("react.context"),R1=Symbol.for("react.forward_ref"),I1=Symbol.for("react.suspense"),M1=Symbol.for("react.memo"),O1=Symbol.for("react.lazy"),uf=Symbol.iterator;function L1(e){return e===null||typeof e!="object"?null:(e=uf&&e[uf]||e["@@iterator"],typeof e=="function"?e:null)}var tm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nm=Object.assign,rm={};function vo(e,t,n){this.props=e,this.context=t,this.refs=rm,this.updater=n||tm}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 om(){}om.prototype=vo.prototype;function Ec(e,t,n){this.props=e,this.context=t,this.refs=rm,this.updater=n||tm}var Nc=Ec.prototype=new om;Nc.constructor=Ec;nm(Nc,vo.prototype);Nc.isPureReactComponent=!0;var cf=Array.isArray,im=Object.prototype.hasOwnProperty,Pc={current:null},lm={key:!0,ref:!0,__self:!0,__source:!0};function sm(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)im.call(t,r)&&!lm.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,K=N[H];if(0>>1;Ho(Le,k))oeo(G,Le)?(N[H]=G,N[oe]=k,H=oe):(N[H]=Le,N[pe]=k,H=pe);else if(oeo(G,k))N[H]=G,N[oe]=k,H=oe;else break e}}return R}function o(N,R){var k=N.sortIndex-R.sortIndex;return k!==0?k:N.id-R.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(N){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=N)r(u),R.sortIndex=R.expirationTime,t(a,R);else break;R=n(u)}}function C(N){if(y=!1,x(N),!w)if(n(a)!==null)w=!0,B(P);else{var R=n(u);R!==null&&V(C,R.startTime-N)}}function P(N,R){w=!1,y&&(y=!1,m(T),T=-1),h=!0;var k=p;try{for(x(R),c=n(a);c!==null&&(!(c.expirationTime>R)||N&&!M());){var H=c.callback;if(typeof H=="function"){c.callback=null,p=c.priorityLevel;var K=H(c.expirationTime<=R);R=e.unstable_now(),typeof K=="function"?c.callback=K:c===n(a)&&r(a),x(R)}else r(a);c=n(a)}if(c!==null)var b=!0;else{var pe=n(u);pe!==null&&V(C,pe.startTime-R),b=!1}return b}finally{c=null,p=k,h=!1}}var E=!1,j=null,T=-1,L=5,A=-1;function M(){return!(e.unstable_now()-AN||125H?(N.sortIndex=k,t(u,N),n(a)===null&&N===n(u)&&(y?(m(T),T=-1):y=!0,V(C,k-H))):(N.sortIndex=K,t(a,N),w||h||(w=!0,B(P))),N},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(N){var R=p;return function(){var k=p;p=R;try{return N.apply(this,arguments)}finally{p=k}}}})(fm);dm.exports=fm;var G1=dm.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 Y1=g,gt=G1;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qa=Object.prototype.hasOwnProperty,Q1=/^[: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]*$/,ff={},pf={};function X1(e){return qa.call(pf,e)?!0:qa.call(ff,e)?!1:Q1.test(e)?pf[e]=!0:(ff[e]=!0,!1)}function q1(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 J1(e,t,n,r){if(t===null||typeof t>"u"||q1(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 Ze(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Ze(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){$e[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tc=/[\-:]([a-z])/g;function Ac(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(Tc,Ac);$e[t]=new Ze(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(Tc,Ac);$e[t]=new Ze(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(Tc,Ac);$e[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rc(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[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 Z1(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 tu(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 Dr:return"Fragment";case Lr:return"Portal";case Ja:return"Profiler";case Ic:return"StrictMode";case Za:return"Suspense";case eu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mm:return(e.displayName||"Context")+".Consumer";case hm:return(e._context.displayName||"Context")+".Provider";case Mc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oc:return t=e.displayName||null,t!==null?t:tu(e.type)||"Memo";case jn:t=e._payload,e=e._init;try{return tu(e(t))}catch{}}return null}function ew(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 tu(t);case 8:return t===Ic?"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 ym(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tw(e){var t=ym(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 Ui(e){e._valueTracker||(e._valueTracker=tw(e))}function vm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ym(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ol(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 nu(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=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 xm(e,t){t=t.checked,t!=null&&Rc(e,"checked",t,!1)}function ru(e,t){xm(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")?ou(e,t.type,n):t.hasOwnProperty("defaultValue")&&ou(e,t.type,Wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gf(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 ou(e,t,n){(t!=="number"||Ol(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function Yr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Vi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function si(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yo={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},nw=["Webkit","ms","Moz","O"];Object.keys(Yo).forEach(function(e){nw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yo[t]=Yo[e]})});function Cm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yo.hasOwnProperty(e)&&Yo[e]?(""+t).trim():t+"px"}function bm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Cm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var rw=Ee({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 su(e,t){if(t){if(rw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function au(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 uu=null;function Lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cu=null,Qr=null,Xr=null;function xf(e){if(e=Ai(e)){if(typeof cu!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Cs(t),cu(e.stateNode,e.type,t))}}function Em(e){Qr?Xr?Xr.push(e):Xr=[e]:Qr=e}function Nm(){if(Qr){var e=Qr,t=Xr;if(Xr=Qr=null,xf(e),t)for(e=0;e>>=0,e===0?32:31-(hw(e)/mw|0)|0}var Hi=64,Wi=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 Fl(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 _i(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=n}function xw(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=Xo),jf=String.fromCharCode(32),_f=!1;function Km(e,t){switch(e){case"keyup":return Gw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function Qw(e,t){switch(e){case"compositionend":return Gm(t);case"keypress":return t.which!==32?null:(_f=!0,jf);case"textInput":return e=t.data,e===jf&&_f?null:e;default:return null}}function Xw(e,t){if(zr)return e==="compositionend"||!Hc&&Km(e,t)?(e=Hm(),gl=$c=Rn=null,zr=!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=If(n)}}function qm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jm(){for(var e=window,t=Ol();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ol(e.document)}return t}function Wc(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 iS(e){var t=Jm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qm(n.ownerDocument.documentElement,n)){if(r!==null&&Wc(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=Mf(n,i);var l=Mf(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,Fr=null,gu=null,Jo=null,yu=!1;function Of(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yu||Fr==null||Fr!==Ol(r)||(r=Fr,"selectionStart"in r&&Wc(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}),Jo&&pi(Jo,r)||(Jo=r,r=Ul(gu,"onSelect"),0Ur||(e.current=Cu[Ur],Cu[Ur]=null,Ur--)}function ge(e,t){Ur++,Cu[Ur]=e.current,e.current=t}var Kn={},We=qn(Kn),rt=qn(!1),gr=Kn;function lo(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 ot(e){return e=e.childContextTypes,e!=null}function Hl(){we(rt),we(We)}function Uf(e,t,n){if(We.current!==Kn)throw Error(z(168));ge(We,t),ge(rt,n)}function sg(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(z(108,ew(e)||"Unknown",o));return Ee({},n,r)}function Wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,gr=We.current,ge(We,e),ge(rt,rt.current),!0}function Vf(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=sg(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,we(rt),we(We),ge(We,e)):we(rt),ge(rt,n)}var un=null,bs=!1,ya=!1;function ag(e){un===null?un=[e]:un.push(e)}function yS(e){bs=!0,ag(e)}function Jn(){if(!ya&&un!==null){ya=!0;var e=0,t=fe;try{var n=un;for(fe=1;e>=l,o-=l,cn=1<<32-Ot(t)+o|n<T?(L=j,j=null):L=j.sibling;var A=p(m,j,x[T],C);if(A===null){j===null&&(j=L);break}e&&j&&A.alternate===null&&t(m,j),v=i(A,v,T),E===null?P=A:E.sibling=A,E=A,j=L}if(T===x.length)return n(m,j),Se&&lr(m,T),P;if(j===null){for(;TT?(L=j,j=null):L=j.sibling;var M=p(m,j,A.value,C);if(M===null){j===null&&(j=L);break}e&&j&&M.alternate===null&&t(m,j),v=i(M,v,T),E===null?P=M:E.sibling=M,E=M,j=L}if(A.done)return n(m,j),Se&&lr(m,T),P;if(j===null){for(;!A.done;T++,A=x.next())A=c(m,A.value,C),A!==null&&(v=i(A,v,T),E===null?P=A:E.sibling=A,E=A);return Se&&lr(m,T),P}for(j=r(m,j);!A.done;T++,A=x.next())A=h(j,m,T,A.value,C),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?T:A.key),v=i(A,v,T),E===null?P=A:E.sibling=A,E=A);return e&&j.forEach(function(_){return t(m,_)}),Se&&lr(m,T),P}function S(m,v,x,C){if(typeof x=="object"&&x!==null&&x.type===Dr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case $i:e:{for(var P=x.key,E=v;E!==null;){if(E.key===P){if(P=x.type,P===Dr){if(E.tag===7){n(m,E.sibling),v=o(E,x.props.children),v.return=m,m=v;break e}}else if(E.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===jn&&Kf(P)===E.type){n(m,E.sibling),v=o(E,x.props),v.ref=Lo(m,E,x),v.return=m,m=v;break e}n(m,E);break}else t(m,E);E=E.sibling}x.type===Dr?(v=mr(x.props.children,m.mode,C,x.key),v.return=m,m=v):(C=bl(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 Lr:e:{for(E=x.key;v!==null;){if(v.key===E)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=Ea(x,m.mode,C),v.return=m,m=v}return l(m);case jn:return E=x._init,S(m,v,E(x._payload),C)}if(Ho(x))return w(m,v,x,C);if(Ao(x))return y(m,v,x,C);Ji(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=ba(x,m.mode,C),v.return=m,m=v),l(m)):n(m,v)}return S}var ao=fg(!0),pg=fg(!1),Yl=qn(null),Ql=null,Wr=null,Qc=null;function Xc(){Qc=Wr=Ql=null}function qc(e){var t=Yl.current;we(Yl),e._currentValue=t}function Nu(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 Jr(e,t){Ql=e,Qc=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Qc!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(Ql===null)throw Error(z(308));Wr=e,Ql.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var dr=null;function Jc(e){dr===null?dr=[e]:dr.push(e)}function hg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Jc(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 _n=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mg(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 fn(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,se&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,Jc(r)):(t.next=o.next,o.next=t),r.interleaved=t,mn(e,n)}function vl(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,zc(e,n)}}function Gf(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 Xl(e,t,n,r){var o=e.updateQueue;_n=!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=Ee({},c,p);break e;case 2:_n=!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);xr|=l,e.lanes=l,e.memoizedState=c}}function Yf(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{fe=n,xa.transition=r}}function Rg(){return Nt().memoizedState}function SS(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ig(e))Mg(t,n);else if(n=hg(e,t,n,r),n!==null){var o=qe();Lt(n,e,r,o),Og(n,t,r)}}function kS(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ig(e))Mg(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,Jc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=hg(e,t,o,r),n!==null&&(o=qe(),Lt(n,e,r,o),Og(n,t,r))}}function Ig(e){var t=e.alternate;return e===be||t!==null&&t===be}function Mg(e,t){Zo=Jl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Og(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zc(e,n)}}var Zl={readContext:Et,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},CS={readContext:Et,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Xf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wl(4194308,4,Pg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wl(4194308,4,e,t)},useInsertionEffect:function(e,t){return wl(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=SS.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:Qf,useDebugValue:sd,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=Qf(!1),t=e[0];return e=wS.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,o=Ht();if(Se){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),ze===null)throw Error(z(349));vr&30||xg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Xf(Sg.bind(null,r,i,e),[e]),r.flags|=2048,Si(9,wg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ht(),t=ze.identifierPrefix;if(Se){var n=dn,r=cn;n=(r&~(1<<32-Ot(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xi++,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[gi]=r,Wg(e,t,!1,!1),t.stateNode=e;e:{switch(l=au(n,r),n){case"dialog":xe("cancel",e),xe("close",e),o=r;break;case"iframe":case"object":case"embed":xe("load",e),o=r;break;case"video":case"audio":for(o=0;ofo&&(t.flags|=128,r=!0,Do(i,!1),t.lanes=4194304)}else{if(!r)if(e=ql(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&&!Se)return Ve(t),null}else 2*je()-i.renderingStartTime>fo&&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=je(),t.sibling=null,n=Ce.current,ge(Ce,r?n&1|2:n&1),t):(Ve(t),null);case 22:case 23:return pd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function AS(e,t){switch(Gc(t),t.tag){case 1:return ot(t.type)&&Hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),we(rt),we(We),nd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return td(t),null;case 13:if(we(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ce),null;case 4:return uo(),null;case 10:return qc(t.type._context),null;case 22:case 23:return pd(),null;case 24:return null;default:return null}}var el=!1,He=!1,RS=typeof WeakSet=="function"?WeakSet:Set,W=null;function Kr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function Ou(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var sp=!1;function IS(e,t){if(vu=Bl,e=Jm(),Wc(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(xu={focusedElem:e,selectionRange:n},Bl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;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:At(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(z(163))}}catch(C){Pe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=sp,sp=!1,w}function ei(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&&Ou(t,n,i)}o=o.next}while(o!==r)}}function Ps(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 Lu(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 Yg(e){var t=e.alternate;t!==null&&(e.alternate=null,Yg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[gi],delete t[ku],delete t[mS],delete t[gS])),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 Qg(e){return e.tag===5||e.tag===3||e.tag===4}function ap(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qg(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 Du(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=Vl));else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}function zu(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(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}var Fe=null,It=!1;function bn(e,t,n){for(n=n.child;n!==null;)Xg(e,t,n),n=n.sibling}function Xg(e,t,n){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(xs,n)}catch{}switch(n.tag){case 5:He||Kr(n,t);case 6:var r=Fe,o=It;Fe=null,bn(e,t,n),Fe=r,It=o,Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?ga(e.parentNode,n):e.nodeType===1&&ga(e,n),di(e)):ga(Fe,n.stateNode));break;case 4:r=Fe,o=It,Fe=n.stateNode.containerInfo,It=!0,bn(e,t,n),Fe=r,It=o;break;case 0:case 11:case 14:case 15:if(!He&&(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)&&Ou(n,t,l),o=o.next}while(o!==r)}bn(e,t,n);break;case 1:if(!He&&(Kr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Pe(n,t,s)}bn(e,t,n);break;case 21:bn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,bn(e,t,n),He=r):bn(e,t,n);break;default:bn(e,t,n)}}function up(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=US.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*OS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,ns=0,se&6)throw Error(z(331));var o=se;for(se|=4,W=e.current;W!==null;){var i=W,l=i.child;if(W.flags&16){var s=i.deletions;if(s!==null){for(var a=0;aje()-dd?hr(e,0):cd|=n),it(e,t)}function oy(e,t){t===0&&(e.mode&1?(t=Wi,Wi<<=1,!(Wi&130023424)&&(Wi=4194304)):t=1);var n=qe();e=mn(e,t),e!==null&&(_i(e,t,n),it(e,n))}function $S(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oy(e,n)}function US(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(z(314))}r!==null&&r.delete(t),oy(e,n)}var iy;iy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,_S(e,t,n);nt=!!(e.flags&131072)}else nt=!1,Se&&t.flags&1048576&&ug(t,Gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sl(e,t),e=t.pendingProps;var o=lo(t,We.current);Jr(t,n),o=od(null,t,r,e,o,n);var i=id();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,ot(r)?(i=!0,Wl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Zc(t),o.updater=Ns,t.stateNode=o,o._reactInternals=t,ju(t,r,e,n),t=Au(null,t,r,!0,i,n)):(t.tag=0,Se&&i&&Kc(t),Qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Sl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=HS(r),e=At(r,e),o){case 0:t=Tu(null,t,r,e,n);break e;case 1:t=op(null,t,r,e,n);break e;case 11:t=np(null,t,r,e,n);break e;case 14:t=rp(null,t,r,At(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Tu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),op(e,t,r,o,n);case 3:e:{if(Ug(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,mg(e,t),Xl(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=co(Error(z(423)),t),t=ip(e,t,r,n,o);break e}else if(r!==o){o=co(Error(z(424)),t),t=ip(e,t,r,n,o);break e}else for(ft=zn(t.stateNode.containerInfo.firstChild),ht=t,Se=!0,Mt=null,n=pg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=gn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return gg(t),e===null&&Eu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,wu(r,o)?l=null:i!==null&&wu(r,i)&&(t.flags|=32),$g(e,t),Qe(e,t,l,n),t.child;case 6:return e===null&&Eu(t),null;case 13:return Vg(e,t,n);case 4:return ed(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),np(e,t,r,o,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(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,ge(Yl,r._currentValue),r._currentValue=l,i!==null)if(zt(i.value,l)){if(i.children===o.children&&!rt.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=fn(-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),Nu(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(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Nu(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}Qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jr(t,n),o=Et(o),r=r(o),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,o=At(r,t.pendingProps),o=At(r.type,o),rp(e,t,r,o,n);case 15:return Fg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Sl(e,t),t.tag=1,ot(r)?(e=!0,Wl(t)):e=!1,Jr(t,n),Lg(t,r,o),ju(t,r,o,n),Au(null,t,r,!0,e,n);case 19:return Hg(e,t,n);case 22:return Bg(e,t,n)}throw Error(z(156,t.tag))};function ly(e,t){return Im(e,t)}function VS(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 VS(e,t,n,r)}function md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function HS(e){if(typeof e=="function")return md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mc)return 11;if(e===Oc)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 bl(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")md(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Dr:return mr(n.children,o,i,t);case Ic:l=8,o|=8;break;case Ja:return e=Ct(12,n,t,o|2),e.elementType=Ja,e.lanes=i,e;case Za:return e=Ct(13,n,t,o),e.elementType=Za,e.lanes=i,e;case eu:return e=Ct(19,n,t,o),e.elementType=eu,e.lanes=i,e;case gm:return _s(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case hm:l=10;break e;case mm:l=9;break e;case Mc:l=11;break e;case Oc:l=14;break e;case jn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Ct(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function mr(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function _s(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=gm,e.lanes=n,e.stateNode={isHidden:!1},e}function ba(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function Ea(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 WS(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 gd(e,t,n,r,o,i,l,s,a){return e=new WS(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},Zc(i),e}function KS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cy)}catch(e){console.error(e)}}cy(),cm.exports=yt;var So=cm.exports;const qS=ys(So);var yp=So;Xa.createRoot=yp.createRoot,Xa.hydrateRoot=yp.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 Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function dy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZS(){return Math.random().toString(36).substr(2,8)}function xp(e,t){return{usr:e.state,key:e.key,idx:t}}function Vu(e,t,n,r){return n===void 0&&(n=null),Ci({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ko(t):t,{state:n,key:t&&t.key||r||ZS()})}function is(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 ek(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(Ci({},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=Vu(y.location,S,m);n&&n(v,S),u=d()+1;let x=xp(v,u),C=y.createHref(v);try{l.pushState(x,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&a&&a({action:s,location:y.location,delta:1})}function h(S,m){s=Mn.Replace;let v=Vu(y.location,S,m);n&&n(v,S),u=d();let x=xp(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:is(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(vp,c),a=S,()=>{o.removeEventListener(vp,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 wp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wp||(wp={}));function tk(e,t,n){return n===void 0&&(n="/"),nk(e,t,n,!1)}function nk(e,t,n,r){let o=typeof t=="string"?ko(t):t,i=wd(o.pathname||"/",n);if(i==null)return null;let l=fy(e);rk(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+'".')),fy(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ck(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 py(i.path))o(i,l,a)}),t}function py(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=py(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 rk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ok=/^:[\w-]+$/,ik=3,lk=2,sk=1,ak=10,uk=-2,Sp=e=>e==="*";function ck(e,t){let n=e.split("/"),r=n.length;return n.some(Sp)&&(r+=uk),t&&(r+=lk),n.filter(o=>!Sp(o)).reduce((o,i)=>o+(ok.test(i)?ik:i===""?sk:ak),r)}function dk(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 fk(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 pk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dy(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 hk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dy(!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 wd(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 mk(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:gk(n,t):t,search:xk(r),hash:wk(o)}}function gk(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 yk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hy(e,t){let n=yk(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function my(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ko(e):(o=Ci({},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=mk(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,"/"),vk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Sk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gy=["post","put","patch","delete"];new Set(gy);const kk=["get",...gy];new Set(kk);/** + * 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=my(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 Nk=g.createContext(null);function Pk(e){let t=g.useContext(Zn).outlet;return t&&g.createElement(Nk.Provider,{value:e},t)}function xy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Pr),{matches:o}=g.useContext(Zn),{pathname:i}=Mi(),l=JSON.stringify(hy(o,r.v7_relativeSplatPath));return g.useMemo(()=>my(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function jk(e,t){return _k(e,t)}function _k(e,t,n,r){Ii()||Ae(!1);let{navigator:o}=g.useContext(Pr),{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=Mi(),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=tk(e,{pathname:h}),y=Mk(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(Ms.Provider,{value:{location:bi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Mn.Pop}},y):y}function Tk(){let e=zk(),t=Sk(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 Ak=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(yy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ik(e){let{routeContext:t,match:n,children:r}=e,o=g.useContext(Sd);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 Mk(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||Ak,a&&(u<0&&p===0?(Bk("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(Ik,{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 wy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(wy||{}),ls=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}(ls||{});function Ok(e){let t=g.useContext(Sd);return t||Ae(!1),t}function Lk(e){let t=g.useContext(Ck);return t||Ae(!1),t}function Dk(e){let t=g.useContext(Zn);return t||Ae(!1),t}function Sy(e){let t=Dk(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function zk(){var e;let t=g.useContext(yy),n=Lk(ls.UseRouteError),r=Sy(ls.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Fk(){let{router:e}=Ok(wy.UseNavigateStable),t=Sy(ls.UseNavigateStable),n=g.useRef(!1);return vy(()=>{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 Cp={};function Bk(e,t,n){!t&&!Cp[e]&&(Cp[e]=!0)}function $k(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 Uk(e){return Pk(e.context)}function ar(e){Ae(!1)}function Vk(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Mn.Pop,navigator:i,static:l=!1,future:s}=e;Ii()&&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=wd(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(Pr.Provider,{value:u},g.createElement(Ms.Provider,{children:n,value:y}))}function Hk(e){let{children:t,location:n}=e;return jk(Hu(t),n)}new Promise(()=>{});function Hu(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,Hu(r.props.children,i));return}r.type!==ar&&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=Hu(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 Wu(){return Wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Kk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gk(e,t){return e.button===0&&(!t||t==="_self")&&!Kk(e)}const Yk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Qk="6";try{window.__reactRouterVersion=Qk}catch{}const Xk="startTransition",bp=_c[Xk];function qk(e){let{basename:t,children:n,future:r,window:o}=e,i=g.useRef();i.current==null&&(i.current=JS({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&&bp?bp(()=>a(c)):a(c)},[a,u]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>$k(r),[r]),g.createElement(Vk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const Jk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ky=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=Wk(t,Yk),{basename:h}=g.useContext(Pr),w,y=!1;if(typeof u=="string"&&Zk.test(u)&&(w=u,Jk))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),P=wd(C.pathname,h);C.origin===x.origin&&P!=null?u=P+C.search+C.hash:y=!0}catch{}let S=bk(u,{relative:o}),m=eC(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",Wu({},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 Np;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Np||(Np={}));function eC(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s}=t===void 0?{}:t,a=Os(),u=Mi(),d=xy(e,{relative:l});return g.useCallback(c=>{if(Gk(c,n)){c.preventDefault();let p=r!==void 0?r:is(u)===is(d);a(e,{replace:p,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[u,a,d,r,o,n,e,i,l,s])}function Cy(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 Py="!";function aC(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 uC(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 cC(e){return{cache:sC(e.cacheSize),splitModifiers:aC(e),...nC(e)}}var dC=/\s+/;function fC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(dC).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=uC(a).join(":"),y=u?w+Py: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 pC(){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)},Ty=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),AC=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 IC=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:Ty("lucide",o),...!i&&!AC(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 ue=(e,t)=>{const n=g.forwardRef(({className:r,...o},i)=>g.createElement(IC,{ref:i,iconNode:t,className:Ty(`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 MC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],OC=ue("arrow-right",MC);/** + * @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 LC=[["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"}]],DC=ue("award",LC);/** + * @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 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"}]],Cd=ue("book-open",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 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"}]],po=ue("bot",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:"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=ue("brain",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 $C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],UC=ue("check",$C);/** + * @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:"m6 9 6 6 6-6",key:"qrunsl"}]],Ay=ue("chevron-down",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],WC=ue("chevron-up",HC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],GC=ue("circle-check-big",KC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ss=ue("cloud",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 QC=[["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"}]],XC=ue("download",QC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["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"}]],Ry=ue("hard-drive",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:"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"}]],Iy=ue("heart",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZC=[["path",{d:"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"}]],eb=ue("history",ZC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"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"}]],nb=ue("house",tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],My=ue("info",rb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ob=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Yu=ue("loader-circle",ob);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["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"}]],Ls=ue("message-square",ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qu=ue("plus",lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["path",{d:"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"}]],ab=ue("rotate-ccw",sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["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"}]],cb=ue("send",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const db=[["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"}]],fb=ue("server",db);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pb=[["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"}]],bd=ue("settings",pb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],mb=ue("share",hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["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"}]],Ap=ue("shield",gb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],vb=ue("square",yb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["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"}]],Oy=ue("star",xb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=[["path",{d:"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"}]],Ed=ue("trash-2",wb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["path",{d:"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"}]],kb=ue("user",Sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cb=[["path",{d:"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=ue("users",Cb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=[["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=ue("zap",bb),Eb=[{name:"Home",href:"/",icon:nb,description:"Overview and AI assistant templates"},{name:"Chat Playground",href:"/playground",icon:Ls,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:Cd,description:"Browse and manage AI models"},{name:"My Assistants",href:"/assistants",icon:po,description:"Manage your custom AI assistants"},{name:"Settings",href:"/settings",icon:bd,description:"Application settings"}];function Nb(){const e=Mi();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:Eb.map(t=>{const n=e.pathname===t.href;return f.jsxs(ky,{to:t.href,className:re("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 Pb(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(Nb,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(Uk,{})})]})}const Ip=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mp=by,Nd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Mp(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=Ip(d)||Ip(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 Mp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},jb=Nd("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 Ie({className:e,variant:t,...n}){return f.jsx("div",{className:re(jb({variant:t}),e),...n})}function Op(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ly(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Op(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(Rb);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 _b=mo("Slot");function Tb(e){const t=g.forwardRef((n,r)=>{const{children:o,...i}=n;if(g.isValidElement(o)){const l=Mb(o),s=Ib(i,o.props);return o.type!==g.Fragment&&(s.ref=r?Ly(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 Dy=Symbol("radix.slottable");function Ab(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Dy,t}function Rb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dy}function Ib(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 Mb(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 Pd=Nd("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Me=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const l=r?_b:"button";return f.jsx(l,{className:re(Pd({variant:t,size:n,className:e})),ref:i,...o})});Me.displayName="Button";const Xe=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Xe.displayName="Card";const Zt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));Zt.displayName="CardHeader";const en=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));en.displayName="CardTitle";const Ob=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));Ob.displayName="CardDescription";const Dt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("p-6 pt-0",e),...t}));Dt.displayName="CardContent";const Lb=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));Lb.displayName="CardFooter";function q(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 Db(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,zb(o,...t)]}function zb(...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 jd(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=Rt.useRef(null),x=Rt.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=Rt.forwardRef((y,S)=>{const{scope:m,children:v}=y,x=i(s,m),C=de(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=Rt.forwardRef((y,S)=>{const{scope:m,children:v,...x}=y,C=Rt.useRef(null),P=de(S,C),E=i(d,m);return Rt.useEffect(()=>(E.itemMap.set(C,{ref:C,...x}),()=>void E.itemMap.delete(C))),f.jsx(p,{[c]:"",ref:P,children:v})});h.displayName=d;function w(y){const S=i(e+"CollectionConsumer",y);return Rt.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${c}]`));return Array.from(S.itemMap.values()).sort((E,j)=>x.indexOf(E.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},w,r]}var Ke=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Fb=_c[" useId ".trim().toString()]||(()=>{}),Bb=0;function Hn(e){const[t,n]=g.useState(Fb());return Ke(()=>{e||n(r=>r??String(Bb++))},[e]),e||(t?`radix-${t}`:"")}var $b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J=$b.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 Ub(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 Vb=_c[" useInsertionEffect ".trim().toString()]||Ke;function go({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=Hb({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=Wb(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 Hb({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),i=g.useRef(t);return Vb(()=>{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 Wb(e){return typeof e=="function"}var Kb=g.createContext(void 0);function Ds(e){const t=g.useContext(Kb);return e||t||"ltr"}var Pa="rovingFocusGroup.onEntryFocus",Gb={bubbles:!1,cancelable:!0},Oi="RovingFocusGroup",[qu,zy,Yb]=jd(Oi),[Qb,Fy]=er(Oi,[Yb]),[Xb,qb]=Qb(Oi),By=g.forwardRef((e,t)=>f.jsx(qu.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(qu.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Jb,{...e,ref:t})})}));By.displayName=Oi;var Jb=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=de(t,p),w=Ds(i),[y,S]=go({prop:l,defaultProp:s??null,onChange:a,caller:Oi}),[m,v]=g.useState(!1),x=Gn(u),C=zy(n),P=g.useRef(!1),[E,j]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Pa,x),()=>T.removeEventListener(Pa,x)},[x]),f.jsx(Xb,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:y,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>j(T=>T-1),[]),children:f.jsx(J.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...c,ref:h,style:{outline:"none",...e.style},onMouseDown:q(e.onMouseDown,()=>{P.current=!0}),onFocus:q(e.onFocus,T=>{const L=!P.current;if(T.target===T.currentTarget&&L&&!m){const A=new CustomEvent(Pa,Gb);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=C().filter(B=>B.focusable),_=M.find(B=>B.active),U=M.find(B=>B.id===y),D=[_,U,...M].filter(Boolean).map(B=>B.ref.current);Vy(D,d)}}P.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})}),$y="RovingFocusGroupItem",Uy=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=qb($y,n),c=d.currentTabStopId===u,p=zy(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(J.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,S=>{r?d.onItemFocus(u):S.preventDefault()}),onFocus:q(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:q(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const m=tE(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?nE(x,C+1):x.slice(C+1)}setTimeout(()=>Vy(x))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:y!=null}):l})})});Uy.displayName=$y;var Zb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tE(e,t,n){const r=eE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zb[r]}function Vy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rE=By,oE=Uy;function iE(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Li=e=>{const{present:t,children:n}=e,r=lE(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=de(r.ref,sE(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};Li.displayName="Presence";function lE(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=iE(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=ol(r.current);i.current=s==="mounted"?u:"none"},[s]),Ke(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=ol(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]),Ke(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=h=>{const y=ol(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=ol(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 ol(e){return(e==null?void 0:e.animationName)||"none"}function sE(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",[aE,lI]=er(zs,[Fy]),Hy=Fy(),[uE,_d]=aE(zs),Wy=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(uE,{scope:n,baseId:Hn(),value:c,onValueChange:p,orientation:l,dir:d,activationMode:a,children:f.jsx(J.div,{dir:d,"data-orientation":l,...u,ref:t})})});Wy.displayName=zs;var Ky="TabsList",Gy=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=_d(Ky,n),l=Hy(n);return f.jsx(rE,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(J.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Gy.displayName=Ky;var Yy="TabsTrigger",Qy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,l=_d(Yy,n),s=Hy(n),a=Jy(l.baseId,r),u=Zy(l.baseId,r),d=r===l.value;return f.jsx(oE,{asChild:!0,...s,focusable:!o,active:d,children:f.jsx(J.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:q(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?l.onValueChange(r):c.preventDefault()}),onKeyDown:q(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&l.onValueChange(r)}),onFocus:q(e.onFocus,()=>{const c=l.activationMode!=="manual";!d&&!o&&c&&l.onValueChange(r)})})})});Qy.displayName=Yy;var Xy="TabsContent",qy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...l}=e,s=_d(Xy,n),a=Jy(s.baseId,r),u=Zy(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(Li,{present:o||d,children:({present:p})=>f.jsx(J.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})})});qy.displayName=Xy;function Jy(e,t){return`${e}-trigger-${t}`}function Zy(e,t){return`${e}-content-${t}`}var cE=Wy,ev=Gy,tv=Qy,nv=qy;const dE=cE,rv=g.forwardRef(({className:e,...t},n)=>f.jsx(ev,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));rv.displayName=ev.displayName;const El=g.forwardRef(({className:e,...t},n)=>f.jsx(tv,{ref:n,className:re("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}));El.displayName=tv.displayName;const Nl=g.forwardRef(({className:e,...t},n)=>f.jsx(nv,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Nl.displayName=nv.displayName;function fE(){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 pE(){const e=Os(),[t,n]=g.useState(!1),[r]=g.useState(fE()),[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(Ie,{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(Me,{size:"lg",onClick:()=>e("/playground"),className:"flex items-center gap-2 px-8 py-3 text-lg",children:[f.jsx(Ls,{className:"h-5 w-5"}),"Start Conversation",f.jsx(OC,{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(dE,{defaultValue:"all",className:"space-y-6",children:[f.jsxs(rv,{className:"grid w-full grid-cols-3",children:[f.jsxs(El,{value:"all",className:"flex items-center gap-2",children:[f.jsx(Rp,{className:"h-4 w-4"}),"All Templates"]}),f.jsxs(El,{value:"featured",className:"flex items-center gap-2",children:[f.jsx(Oy,{className:"h-4 w-4"}),"Featured"]}),f.jsxs(El,{value:"liked",className:"flex items-center gap-2",children:[f.jsx(Iy,{className:"h-4 w-4"}),"My Likes"]})]}),f.jsx(Nl,{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(ja,{template:c,isLiked:o.includes(c.id),onLike:()=>a(c.id),onUse:()=>u(c)},c.id))})}),f.jsxs(Nl,{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(ja,{template:c,isLiked:o.includes(c.id),onLike:()=>a(c.id),onUse:()=>u(c),featured:!0},c.id))}),d.length===0&&f.jsx(Xe,{className:"p-8 text-center",children:f.jsx("p",{className:"text-muted-foreground",children:"No featured templates available."})})]}),f.jsxs(Nl,{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(ja,{template:c,isLiked:!0,onLike:()=>a(c.id),onUse:()=>u(c)},c.id))}),o.length===0&&f.jsx(Xe,{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 ja({template:e,isLiked:t,onLike:n,onUse:r,featured:o=!1}){return f.jsxs(Xe,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${o?"ring-2 ring-yellow-200 shadow-md":""}`,children:[f.jsx(Zt,{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(en,{className:"text-base",children:e.name}),e.isOfficial&&f.jsxs(Ie,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[f.jsx(DC,{className:"h-3 w-3 mr-1"}),"Official"]}),o&&f.jsx(Oy,{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(Me,{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(Iy,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(Dt,{className:"space-y-4",children:[f.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(i=>f.jsx(Ie,{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(Me,{size:"sm",onClick:r,children:"Use Template"})})]})]})}function as(e,[t,n]){return Math.min(n,Math.max(t,e))}function ov(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 iv(e){const[t,n]=g.useState(void 0);return Ke(()=>{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 lv=["PageUp","PageDown"],sv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],av={"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,hE,mE]=jd(Co),[uv,sI]=er(Co,[mE]),[gE,Fs]=uv(Co),cv=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"?yE:vE,[C=[],P]=go({prop:d,defaultProp:u,onChange:M=>{var U;(U=[...S.current][m.current])==null||U.focus(),c(M)}}),E=g.useRef(C);function j(M){const _=CE(C,M);A(M,_)}function T(M){A(M,m.current)}function L(){const M=E.current[m.current];C[m.current]!==M&&p(C)}function A(M,_,{commit:U}={commit:!1}){const O=PE(i),D=jE(Math.round((M-r)/i)*i+r,O),B=as(D,[r,o]);P((V=[])=>{const N=SE(V,B,_);if(NE(N,a*i)){m.current=N.indexOf(B);const R=String(N)!==String(V);return R&&U&&p(N),R?N:V}else return V})}return f.jsx(gE,{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:q(y.onPointerDown,()=>{s||(E.current=C)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:j,onSlideMove:s?void 0:T,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:_})=>{if(!s){const D=lv.includes(M.key)||M.shiftKey&&sv.includes(M.key)?10:1,B=m.current,V=C[B],N=i*D*_;A(V+N,B,{commit:!0})}}})})})})});cv.displayName=Co;var[dv,fv]=uv(Co,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yE=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=de(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(),P=[0,C.width],j=Td(P,m?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return f.jsx(dv,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:f.jsx(pv,{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 P=av[m?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:P?-1:1})}})})}),vE=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=de(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(dv,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(pv,{"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=av[h?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:m?-1:1})}})})}),pv=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(J.span,{...u,ref:t,onKeyDown:q(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):lv.concat(sv).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:q(e.onPointerDown,c=>{const p=c.target;p.setPointerCapture(c.pointerId),c.preventDefault(),d.thumbs.has(p)?p.focus():r(c)}),onPointerMove:q(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&o(c)}),onPointerUp:q(e.onPointerUp,c=>{const p=c.target;p.hasPointerCapture(c.pointerId)&&(p.releasePointerCapture(c.pointerId),i(c))})})}),hv="SliderTrack",mv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Fs(hv,n);return f.jsx(J.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});mv.displayName=hv;var Zu="SliderRange",gv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Fs(Zu,n),i=fv(Zu,n),l=g.useRef(null),s=de(t,l),a=o.values.length,u=o.values.map(p=>xv(p,o.min,o.max)),d=a>1?Math.min(...u):0,c=100-Math.max(...u);return f.jsx(J.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:c+"%"}})});gv.displayName=Zu;var ec="SliderThumb",yv=g.forwardRef((e,t)=>{const n=hE(e.__scopeSlider),[r,o]=g.useState(null),i=de(t,s=>o(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(xE,{...e,ref:i,index:l})}),xE=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,l=Fs(ec,n),s=fv(ec,n),[a,u]=g.useState(null),d=de(t,v=>u(v)),c=a?l.form||!!a.closest("form"):!0,p=iv(a),h=l.values[r],w=h===void 0?0:xv(h,l.min,l.max),y=kE(r,l.values.length),S=p==null?void 0:p[s.size],m=S?bE(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(J.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:q(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),c&&f.jsx(vv,{name:o??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:h},r)]})});yv.displayName=ec;var wE="RadioBubbleInput",vv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=g.useRef(null),i=de(o,r),l=ov(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(J.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});vv.displayName=wE;function SE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function xv(e,t,n){const i=100/(n-t)*(e-t);return as(i,[0,100])}function kE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function CE(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 bE(e,t,n){const r=e/2,i=Td([0,50],[0,r]);return(r-i(t)*n)*n}function EE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function NE(e,t){if(t>0){const n=EE(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 PE(e){return(String(e).split(".")[1]||"").length}function jE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var wv=cv,_E=mv,TE=gv,AE=yv;const tc=g.forwardRef(({className:e,...t},n)=>f.jsxs(wv,{ref:n,className:re("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(_E,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(TE,{className:"absolute h-full bg-primary"})}),f.jsx(AE,{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=wv.displayName;var RE="Label",Sv=g.forwardRef((e,t)=>f.jsx(J.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())}}));Sv.displayName=RE;var kv=Sv;const IE=Nd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Gt=g.forwardRef(({className:e,...t},n)=>f.jsx(kv,{ref:n,className:re(IE(),e),...t}));Gt.displayName=kv.displayName;function ME(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 OE="DismissableLayer",nc="dismissableLayer.update",LE="dismissableLayer.pointerDownOutside",DE="dismissableLayer.focusOutside",Lp,Cv=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ad=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(Cv),[d,c]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),w=de(t,j=>c(j)),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,P=BE(j=>{const T=j.target,L=[...u.branches].some(A=>A.contains(T));!C||L||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),E=$E(j=>{const T=j.target;[...u.branches].some(A=>A.contains(T))||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return ME(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Dp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Lp)}},[d,p,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Dp())},[d,u]),g.useEffect(()=>{const j=()=>h({});return document.addEventListener(nc,j),()=>document.removeEventListener(nc,j)},[]),f.jsx(J.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,E.onFocusCapture),onBlurCapture:q(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,P.onPointerDownCapture)})});Ad.displayName=OE;var zE="DismissableLayerBranch",FE=g.forwardRef((e,t)=>{const n=g.useContext(Cv),r=g.useRef(null),o=de(t,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(J.div,{...e,ref:o})});FE.displayName=zE;function BE(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(){bv(LE,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 $E(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&&bv(DE,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 Dp(){const e=new CustomEvent(nc);document.dispatchEvent(e)}function bv(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?Ub(o,i):o.dispatchEvent(i)}var _a=0;function Ev(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zp()),document.body.insertAdjacentElement("beforeend",e[1]??zp()),_a++,()=>{_a===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_a--}},[])}function zp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ta="focusScope.autoFocusOnMount",Aa="focusScope.autoFocusOnUnmount",Fp={bubbles:!1,cancelable:!0},UE="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=de(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 P of x)P.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){$p.add(h);const y=document.activeElement;if(!s.contains(y)){const m=new CustomEvent(Ta,Fp);s.addEventListener(Ta,u),s.dispatchEvent(m),m.defaultPrevented||(VE(YE(Nv(s)),{select:!0}),document.activeElement===y&&Pn(s))}return()=>{s.removeEventListener(Ta,u),setTimeout(()=>{const m=new CustomEvent(Aa,Fp);s.addEventListener(Aa,d),s.dispatchEvent(m),m.defaultPrevented||Pn(y??document.body,{select:!0}),s.removeEventListener(Aa,d),$p.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]=HE(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(J.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Rd.displayName=UE;function VE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function HE(e){const t=Nv(e),n=Bp(t,e),r=Bp(t.reverse(),e);return[n,r]}function Nv(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 Bp(e,t){for(const n of e)if(!WE(n,{upTo:t}))return n}function WE(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 KE(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&&KE(e)&&t&&e.select()}}var $p=GE();function GE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Up(e,t),e.unshift(t)},remove(t){var n;e=Up(e,t),(n=e[0])==null||n.resume()}}}function Up(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YE(e){return e.filter(t=>t.tagName!=="A")}const QE=["top","right","bottom","left"],Yn=Math.min,dt=Math.max,us=Math.round,il=Math.floor,tn=e=>({x:e,y:e}),XE={left:"right",right:"left",bottom:"top",top:"bottom"},qE={start:"end",end:"start"};function rc(e,t,n){return dt(e,Yn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function bo(e){return e.split("-")[1]}function Id(e){return e==="x"?"y":"x"}function Md(e){return e==="y"?"height":"width"}const JE=new Set(["top","bottom"]);function Xt(e){return JE.has(vn(e))?"y":"x"}function Od(e){return Id(Xt(e))}function ZE(e,t,n){n===void 0&&(n=!1);const r=bo(e),o=Od(e),i=Md(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=cs(l)),[l,cs(l)]}function eN(e){const t=cs(e);return[oc(e),t,oc(t)]}function oc(e){return e.replace(/start|end/g,t=>qE[t])}const Vp=["left","right"],Hp=["right","left"],tN=["top","bottom"],nN=["bottom","top"];function rN(e,t,n){switch(e){case"top":case"bottom":return n?t?Hp:Vp:t?Vp:Hp;case"left":case"right":return t?tN:nN;default:return[]}}function oN(e,t,n,r){const o=bo(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 cs(e){return e.replace(/left|right|bottom|top/g,t=>XE[t])}function iN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pv(e){return typeof e!="number"?iN(e):{top:e,right:e,bottom:e,left:e}}function ds(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 Wp(e,t,n){let{reference:r,floating:o}=e;const i=Xt(t),l=Od(t),s=Md(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(bo(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}=Wp(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=Pv(d),p={x:n,y:r},h=Od(o),w=Md(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],P=p[h]-i.reference[h],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=E?E[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(E)))&&(j=s.floating[x]||i.floating[w]);const T=C/2-P/2,L=j/2-y[w]/2-1,A=Yn(c[m],L),M=Yn(c[v],L),_=A,U=j-y[w]-M,O=j/2-y[w]/2+T,D=rc(_,O,U),B=!a.arrow&&bo(o)!=null&&O!==D&&i.reference[w]/2-(O<_?A:M)-y[w]/2<0,V=B?O<_?O-_:O-U:0;return{[h]:p[h]+V,data:{[h]:D,centerOffset:O-D-V,...B&&{alignmentOffset:V}},reset:B}}}),aN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...S}=yn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const m=vn(o),v=Xt(s),x=vn(s)===s,C=await(a.isRTL==null?void 0:a.isRTL(u.floating)),P=p||(x||!y?[cs(s)]:eN(s)),E=w!=="none";!p&&E&&P.push(...oN(s,y,w,C));const j=[s,...P],T=await Ei(t,S),L=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&L.push(T[m]),c){const O=ZE(o,l,C);L.push(T[O[0]],T[O[1]])}if(A=[...A,{placement:o,overflows:L}],!L.every(O=>O<=0)){var M,_;const O=(((M=i.flip)==null?void 0:M.index)||0)+1,D=j[O];if(D&&(!(c==="alignment"?v!==Xt(D):!1)||A.every(N=>Xt(N.placement)===v?N.overflows[0]>0:!0)))return{data:{index:O,overflows:A},reset:{placement:D}};let B=(_=A.filter(V=>V.overflows[0]<=0).sort((V,N)=>V.overflows[1]-N.overflows[1])[0])==null?void 0:_.placement;if(!B)switch(h){case"bestFit":{var U;const V=(U=A.filter(N=>{if(E){const R=Xt(N.placement);return R===v||R==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(R=>R>0).reduce((R,k)=>R+k,0)]).sort((N,R)=>N[1]-R[1])[0])==null?void 0:U[0];V&&(B=V);break}case"initialPlacement":B=s;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function Kp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gp(e){return QE.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 Ei(t,{...o,elementContext:"reference"}),l=Kp(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Gp(l)}}}case"escaped":{const i=await Ei(t,{...o,altBoundary:!0}),l=Kp(i,n.floating);return{data:{escapedOffsets:l,escaped:Gp(l)}}}default:return{}}}}},jv=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=bo(n),a=Xt(n)==="y",u=jv.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 Ei(t,a),c=Xt(vn(o)),p=Id(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=Xt(o),p=Id(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,P=i.reference[p]+i.reference[x]-S.mainAxis;hP&&(h=P)}if(u){var m,v;const x=p==="y"?"width":"height",C=jv.has(vn(o)),P=i.reference[c]-i.floating[x]+(C&&((m=l.offset)==null?void 0:m[c])||0)+(C?0:S.crossAxis),E=i.reference[c]+i.reference[x]+(C?0:((v=l.offset)==null?void 0:v[c])||0)-(C?S.crossAxis:0);wE&&(w=E)}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 Ei(t,u),c=vn(o),p=bo(o),h=Xt(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),P=Yn(w-d[m],x),E=!t.middlewareData.shift;let j=C,T=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),E&&!p){const A=dt(d.left,0),M=dt(d.right,0),_=dt(d.top,0),U=dt(d.bottom,0);h?T=w-2*(A!==0||M!==0?A+M:dt(d.left,d.right)):j=y-2*(_!==0||U!==0?_+U:dt(d.top,d.bottom))}await a({...t,availableWidth:T,availableHeight:j});const L=await l.getDimensions(s.floating);return w!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Bs(){return typeof window<"u"}function Eo(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 on(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 nn(e){return Bs()?e instanceof HTMLElement||e instanceof mt(e).HTMLElement:!1}function Yp(e){return!Bs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot}const mN=new Set(["inline","contents"]);function Di(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(Eo(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 Ld(e){const t=Dd(),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(;nn(t)&&!yo(t);){if(Ld(t))return t;if($s(t))return null;t=Qn(t)}return null}function Dd(){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(Eo(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(Eo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yp(e)&&e.host||on(e);return Yp(t)?t.host:t}function Tv(e){const t=Qn(e);return yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&Di(t)?t:Tv(t)}function Ni(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||[],Di(o)?o:[],s&&n?Ni(s):[])}return t.concat(o,Ni(o,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Av(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nn(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=us(n)!==i||us(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function zd(e){return Ft(e)?e:e.contextElement}function eo(e){const t=zd(e);if(!nn(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Av(t);let l=(i?us(n.width):n.width)/r,s=(i?us(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const bN=tn(0);function Rv(e){const t=mt(e);return!Dd()||!t.visualViewport?bN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function EN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mt(e)?!1:t}function Sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zd(e);let l=tn(1);t&&(r?Ft(r)&&(l=eo(r)):l=eo(e));const s=EN(i,n,r)?Rv(i):tn(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=eo(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 ds({width:d,height:c,x:a,y:u})}function Vs(e,t){const n=Us(e).scrollLeft;return t?t.left+n:Sr(on(e)).left+n}function Iv(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=on(r),s=t?$s(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=tn(1);const d=tn(0),c=nn(r);if((c||!c&&!i)&&((Eo(r)!=="body"||Di(l))&&(a=Us(r)),nn(r))){const h=Sr(r);u=eo(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=l&&!c&&!i?Iv(l,a):tn(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 jN(e){const t=on(e),n=Us(e),r=e.ownerDocument.body,o=dt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=dt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Vs(e);const s=-n.scrollTop;return Bt(r).direction==="rtl"&&(l+=dt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}const Qp=25;function _N(e,t){const n=mt(e),r=on(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=Dd();(!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<=Qp&&(i-=w)}else u<=Qp&&(i+=u);return{width:i,height:l,x:s,y:a}}const TN=new Set(["absolute","fixed"]);function AN(e,t){const n=Sr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=nn(e)?eo(e):tn(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 Xp(e,t,n){let r;if(t==="viewport")r=_N(e,n);else if(t==="document")r=jN(on(e));else if(Ft(t))r=AN(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 ds(r)}function Mv(e,t){const n=Qn(e);return n===t||!Ft(n)||yo(n)?!1:Bt(n).position==="fixed"||Mv(n,t)}function RN(e,t){const n=t.get(e);if(n)return n;let r=Ni(e,[],!1).filter(s=>Ft(s)&&Eo(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=Ld(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&TN.has(o.position)||Di(l)&&!a&&Mv(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)?[]:RN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,d)=>{const c=Xp(t,d,o);return u.top=dt(c.top,u.top),u.right=Yn(c.right,u.right),u.bottom=Yn(c.bottom,u.bottom),u.left=dt(c.left,u.left),u},Xp(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}=Av(e);return{width:t,height:n}}function ON(e,t,n){const r=nn(t),o=on(t),i=n==="fixed",l=Sr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=tn(0);function u(){a.x=Vs(o)}if(r||!r&&!i)if((Eo(t)!=="body"||Di(o))&&(s=Us(t)),r){const h=Sr(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?Iv(o,s):tn(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 Ra(e){return Bt(e).position==="static"}function qp(e,t){if(!nn(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return on(e)===n&&(n=n.ownerDocument.body),n}function Ov(e,t){const n=mt(e);if($s(e))return n;if(!nn(e)){let o=Qn(e);for(;o&&!yo(o);){if(Ft(o)&&!Ra(o))return o;o=Qn(o)}return n}let r=qp(e,t);for(;r&&yN(r)&&Ra(r);)r=qp(r,t);return r&&yo(r)&&Ra(r)&&!Ld(r)?n:r||kN(e)||n}const LN=async function(e){const t=this.getOffsetParent||Ov,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:on,getClippingRect:IN,getOffsetParent:Ov,getElementRects:LN,getClientRects:PN,getDimensions:MN,getScale:eo,isElement:Ft,isRTL:DN};function Lv(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=on(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=il(c),y=il(o.clientWidth-(d+p)),S=il(o.clientHeight-(c+h)),m=il(d),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-m+"px",threshold:dt(0,Yn(1,a))||1};let C=!0;function P(E){const j=E[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!Lv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(P,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,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=zd(e),d=o||i?[...u?Ni(u):[],...Ni(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?Sr(e):null;a&&S();function S(){const m=Sr(e);y&&!Lv(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,Jp=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(){},Pl=YN?g.useLayoutEffect:QN;function fs(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(!fs(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)&&!fs(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Dv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zp(e,t){const n=Dv(e);return Math.round(t*n)/n}function Ia(e){const t=g.useRef(e);return Pl(()=>{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);fs(p,r)||h(r);const[w,y]=g.useState(null),[S,m]=g.useState(null),v=g.useCallback(N=>{N!==E.current&&(E.current=N,y(N))},[]),x=g.useCallback(N=>{N!==j.current&&(j.current=N,m(N))},[]),C=i||w,P=l||S,E=g.useRef(null),j=g.useRef(null),T=g.useRef(d),L=a!=null,A=Ia(a),M=Ia(o),_=Ia(u),U=g.useCallback(()=>{if(!E.current||!j.current)return;const N={placement:t,strategy:n,middleware:p};M.current&&(N.platform=M.current),GN(E.current,j.current,N).then(R=>{const k={...R,isPositioned:_.current!==!1};O.current&&!fs(T.current,k)&&(T.current=k,So.flushSync(()=>{c(k)}))})},[p,t,n,M,_]);Pl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,c(N=>({...N,isPositioned:!1})))},[u]);const O=g.useRef(!1);Pl(()=>(O.current=!0,()=>{O.current=!1}),[]),Pl(()=>{if(C&&(E.current=C),P&&(j.current=P),C&&P){if(A.current)return A.current(C,P,U);U()}},[C,P,U,A,L]);const D=g.useMemo(()=>({reference:E,floating:j,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:C,floating:P}),[C,P]),V=g.useMemo(()=>{const N={position:n,left:0,top:0};if(!B.floating)return N;const R=Zp(B.floating,d.x),k=Zp(B.floating,d.y);return s?{...N,transform:"translate("+R+"px, "+k+"px)",...Dv(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:k}},[n,s,B.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:U,refs:D,elements:B,floatingStyles:V}),[d,U,D,B,V])}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?Jp({element:r.current,padding:o}).fn(n):{}:r?Jp({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",zv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(J.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"})})});zv.displayName=i2;var l2=zv,Fd="Popper",[Fv,Bv]=er(Fd),[s2,$v]=Fv(Fd),Uv=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return f.jsx(s2,{scope:t,anchor:r,onAnchorChange:o,children:n})};Uv.displayName=Fd;var Vv="PopperAnchor",Hv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=$v(Vv,n),l=g.useRef(null),s=de(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(J.div,{...o,ref:s})});Hv.displayName=Vv;var Bd="PopperContent",[a2,u2]=Fv(Bd),Wv=g.forwardRef((e,t)=>{var G,ne,ke,ie,le,ce;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=$v(Bd,n),[m,v]=g.useState(null),x=de(t,Ye=>v(Ye)),[C,P]=g.useState(null),E=iv(C),j=(E==null?void 0:E.width)??0,T=(E==null?void 0:E.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],_=M.length>0,U={padding:A,boundary:M.filter(d2),altBoundary:_},{refs:O,floatingStyles:D,placement:B,isPositioned:V,middlewareData:N}=XN({strategy:"fixed",placement:L,whileElementsMounted:(...Ye)=>BN(...Ye,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[JN({mainAxis:o+T,alignmentAxis:l}),a&&ZN({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?e2():void 0,...U}),a&&t2({...U}),n2({...U,apply:({elements:Ye,rects:xt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:Zs}=xt.reference,or=Ye.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:j,arrowHeight:T}),p&&r2({strategy:"referenceHidden",...U})]}),[R,k]=Yv(B),H=Gn(w);Ke(()=>{V&&(H==null||H())},[V,H]);const K=(G=N.arrow)==null?void 0:G.x,b=(ne=N.arrow)==null?void 0:ne.y,pe=((ke=N.arrow)==null?void 0:ke.centerOffset)!==0,[Le,oe]=g.useState();return Ke(()=>{m&&oe(window.getComputedStyle(m).zIndex)},[m]),f.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:V?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Le,"--radix-popper-transform-origin":[(ie=N.transformOrigin)==null?void 0:ie.x,(le=N.transformOrigin)==null?void 0:le.y].join(" "),...((ce=N.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(a2,{scope:n,placedSide:R,onArrowChange:P,arrowX:K,arrowY:b,shouldHideArrow:pe,children:f.jsx(J.div,{"data-side":R,"data-align":k,...y,ref:x,style:{...y.style,animation:V?void 0:"none"}})})})});Wv.displayName=Bd;var Kv="PopperArrow",c2={top:"bottom",right:"left",bottom:"top",left:"right"},Gv=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=u2(Kv,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"}})})});Gv.displayName=Kv;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]=Yv(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 Yv(e){const[t,n="center"]=e.split("-");return[t,n]}var p2=Uv,h2=Hv,m2=Wv,g2=Gv,y2="Portal",$d=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=g.useState(!1);Ke(()=>i(!0),[]);const l=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?qS.createPortal(f.jsx(J.div,{...r,ref:t}),l):null});$d.displayName=y2;var Qv=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(J.span,{...e,ref:t,style:{...Qv,...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,ll=new WeakMap,sl={},Ma=0,Xv=function(e){return e&&(e.host||Xv(e.parentNode))},S2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Xv(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]);sl[n]||(sl[n]=new WeakMap);var i=sl[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&&ll.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||(ll.has(c)||c.removeAttribute(r),ll.delete(c)),h||c.removeAttribute(n)}),Ma--,Ma||(Rr=new WeakMap,Rr=new WeakMap,ll=new WeakMap,sl={})}},qv=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}},Yt=function(){return Yt=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=tx(),to="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(b2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(to,`] { + 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(_l,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jl," .").concat(jl,` { + right: 0 `).concat(r,`; + } + + .`).concat(_l," .").concat(_l,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(to,`] { + `).concat(E2,": ").concat(s,`px; + } +`)},nh=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},H2=function(){g.useEffect(function(){return document.body.setAttribute(to,(nh()+1).toString()),function(){var e=nh()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,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 al=Object.defineProperty({},"passive",{get:function(){return lc=!0,!0}});window.addEventListener("test",al,al),window.removeEventListener("test",al,al)}catch{lc=!1}var Ir=lc?{passive:!1}:!1,K2=function(e){return e.tagName==="TEXTAREA"},nx=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 nx(e,"overflowY")},Y2=function(e){return nx(e,"overflowX")},rh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=rx(e,r);if(o){var i=ox(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]},rx=function(e,t){return e==="v"?G2(t):Y2(t)},ox=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=ox(e,s),w=h[0],y=h[1],S=h[2],m=y-S-i*w;(w||m)&&rx(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},ul=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oh=function(e){return[e.deltaX,e.deltaY]},ih=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,Mr=[];function nP(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(tP++)[0],i=g.useState(tx)[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(ih),!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=ul(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-m[0],C="deltaY"in y?y.deltaY:v[1]-m[1],P,E=y.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in y&&j==="h"&&E.type==="range")return!1;var T=rh(j,E);if(!T)return!0;if(T?P=j:(P=j==="v"?"h":"v",T=rh(j,E)),!T)return!1;if(!r.current&&"changedTouches"in y&&(x||C)&&(r.current=P),!P)return!0;var L=r.current||P;return J2(L,S,y,L==="h"?x:C,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Mr.length||Mr[Mr.length-1]!==i)){var m="deltaY"in S?oh(S):ul(S),v=t.current.filter(function(P){return P.name===S.type&&(P.target===S.target||S.target===P.shadowParent)&&Z2(P.delta,m)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(ih).filter(Boolean).filter(function(P){return P.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=ul(y),r.current=void 0},[]),c=g.useCallback(function(y){u(y.type,oh(y),y.target,s(y,e.lockRef.current))},[]),p=g.useCallback(function(y){u(y.type,ul(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Mr.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Ir),document.addEventListener("touchmove",a,Ir),document.addEventListener("touchstart",d,Ir),function(){Mr=Mr.filter(function(y){return y!==i}),document.removeEventListener("wheel",a,Ir),document.removeEventListener("touchmove",a,Ir),document.removeEventListener("touchstart",d,Ir)}},[]);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=R2(ex,nP);var ix=g.forwardRef(function(e,t){return g.createElement(Hs,Yt({},e,{ref:t,sideCar:oP}))});ix.classNames=Hs.classNames;const lx=ix;var iP=[" ","Enter","ArrowUp","ArrowDown"],lP=[" ","Enter"],kr="Select",[Ws,Ks,sP]=jd(kr),[No,aI]=er(kr,[sP,Bv]),Gs=Bv(),[aP,tr]=No(kr),[uP,cP]=No(kr),sx=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,P]=g.useState(!1),E=Ds(u),[j,T]=go({prop:r,defaultProp:o??!1,onChange:i,caller:kr}),[L,A]=go({prop:l,defaultProp:s,onChange:a,caller:kr}),M=g.useRef(null),_=S?w||!!S.closest("form"):!0,[U,O]=g.useState(new Set),D=Array.from(U).map(B=>B.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:P,contentId:Hn(),value:L,onValueChange:A,open:j,onOpenChange:T,dir:E,triggerPointerDownPosRef:M,disabled:p,children:[f.jsx(Ws.Provider,{scope:t,children:f.jsx(uP,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(B=>{O(V=>new Set(V).add(B))},[]),onNativeOptionRemove:g.useCallback(B=>{O(V=>{const N=new Set(V);return N.delete(B),N})},[]),children:n})}),_?f.jsxs(Rx,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:c,value:L,onChange:B=>A(B.target.value),disabled:p,form:w,children:[L===void 0?f.jsx("option",{value:""}):null,Array.from(U)]},D):null]})})};sx.displayName=kr;var ax="SelectTrigger",ux=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Gs(n),l=tr(ax,n),s=l.disabled||r,a=de(t,l.onTriggerChange),u=Ks(n),d=g.useRef("touch"),[c,p,h]=Mx(y=>{const S=u().filter(x=>!x.disabled),m=S.find(x=>x.value===l.value),v=Ox(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(J.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":Ix(l.value)?"":void 0,...o,ref:a,onClick:q(o.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&w(y)}),onPointerDown:q(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:q(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())})})})});ux.displayName=ax;var cx="SelectValue",dx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...s}=e,a=tr(cx,n),{onValueNodeHasChildrenChange:u}=a,d=i!==void 0,c=de(t,a.onValueNodeChange);return Ke(()=>{u(d)},[u,d]),f.jsx(J.span,{...s,ref:c,style:{pointerEvents:"none"},children:Ix(a.value)?f.jsx(f.Fragment,{children:l}):i})});dx.displayName=cx;var dP="SelectIcon",fx=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(J.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});fx.displayName=dP;var fP="SelectPortal",px=e=>f.jsx($d,{asChild:!0,...e});px.displayName=fP;var Cr="SelectContent",hx=g.forwardRef((e,t)=>{const n=tr(Cr,e.__scopeSelect),[r,o]=g.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?So.createPortal(f.jsx(mx,{scope:e.__scopeSelect,children:f.jsx(Ws.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(gx,{...e,ref:t})});hx.displayName=Cr;var Tt=10,[mx,nr]=No(Cr),pP="SelectContentImpl",hP=mo("SelectContent.RemoveScroll"),gx=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(Cr,n),[x,C]=g.useState(null),[P,E]=g.useState(null),j=de(t,G=>C(G)),[T,L]=g.useState(null),[A,M]=g.useState(null),_=Ks(n),[U,O]=g.useState(!1),D=g.useRef(!1);g.useEffect(()=>{if(x)return qv(x)},[x]),Ev();const B=g.useCallback(G=>{const[ne,...ke]=_().map(ce=>ce.ref.current),[ie]=ke.slice(-1),le=document.activeElement;for(const ce of G)if(ce===le||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===ne&&P&&(P.scrollTop=0),ce===ie&&P&&(P.scrollTop=P.scrollHeight),ce==null||ce.focus(),document.activeElement!==le))return},[_,P]),V=g.useCallback(()=>B([T,x]),[B,T,x]);g.useEffect(()=>{U&&V()},[U,V]);const{onOpenChange:N,triggerPointerDownPosRef:R}=v;g.useEffect(()=>{if(x){let G={x:0,y:0};const ne=ie=>{var le,ce;G={x:Math.abs(Math.round(ie.pageX)-(((le=R.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((ce=R.current)==null?void 0:ce.y)??0))}},ke=ie=>{G.x<=10&&G.y<=10?ie.preventDefault():x.contains(ie.target)||N(!1),document.removeEventListener("pointermove",ne),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",ke,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",ke,{capture:!0})}}},[x,N,R]),g.useEffect(()=>{const G=()=>N(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[N]);const[k,H]=Mx(G=>{const ne=_().filter(le=>!le.disabled),ke=ne.find(le=>le.ref.current===document.activeElement),ie=Ox(ne,G,ke);ie&&setTimeout(()=>ie.ref.current.focus())}),K=g.useCallback((G,ne,ke)=>{const ie=!D.current&&!ke;(v.value!==void 0&&v.value===ne||ie)&&(L(G),ie&&(D.current=!0))},[v.value]),b=g.useCallback(()=>x==null?void 0:x.focus(),[x]),pe=g.useCallback((G,ne,ke)=>{const ie=!D.current&&!ke;(v.value!==void 0&&v.value===ne||ie)&&M(G)},[v.value]),Le=r==="popper"?sc:yx,oe=Le===sc?{side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return f.jsx(mx,{scope:n,content:x,viewport:P,onViewportChange:E,itemRefCallback:K,selectedItem:T,onItemLeave:b,itemTextRefCallback:pe,focusSelectedItem:V,selectedItemText:A,position:r,isPositioned:U,searchRef:k,children:f.jsx(lx,{as:hP,allowPinchZoom:!0,children:f.jsx(Rd,{asChild:!0,trapped:v.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:q(o,G=>{var ne;(ne=v.trigger)==null||ne.focus({preventScroll:!0}),G.preventDefault()}),children:f.jsx(Ad,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(Le,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:G=>G.preventDefault(),...m,...oe,onPlaced:()=>O(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:q(m.onKeyDown,G=>{const ne=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ne&&G.key.length===1&&H(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ie=_().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const le=G.target,ce=ie.indexOf(le);ie=ie.slice(ce+1)}setTimeout(()=>B(ie)),G.preventDefault()}})})})})})})});gx.displayName=pP;var mP="SelectItemAlignedPosition",yx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tr(Cr,n),l=nr(Cr,n),[s,a]=g.useState(null),[u,d]=g.useState(null),c=de(t,j=>d(j)),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 j=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),A=m.getBoundingClientRect();if(i.dir!=="rtl"){const le=A.left-T.left,ce=L.left-le,Ye=j.left-ce,xt=j.width+Ye,Sn=Math.max(xt,T.width),kn=window.innerWidth-Tt,Cn=as(ce,[Tt,Math.max(Tt,kn-Sn)]);s.style.minWidth=xt+"px",s.style.left=Cn+"px"}else{const le=T.right-A.right,ce=window.innerWidth-L.right-le,Ye=window.innerWidth-j.right-ce,xt=j.width+Ye,Sn=Math.max(xt,T.width),kn=window.innerWidth-Tt,Cn=as(ce,[Tt,Math.max(Tt,kn-Sn)]);s.style.minWidth=xt+"px",s.style.right=Cn+"px"}const M=p(),_=window.innerHeight-Tt*2,U=y.scrollHeight,O=window.getComputedStyle(u),D=parseInt(O.borderTopWidth,10),B=parseInt(O.paddingTop,10),V=parseInt(O.borderBottomWidth,10),N=parseInt(O.paddingBottom,10),R=D+B+U+N+V,k=Math.min(S.offsetHeight*5,R),H=window.getComputedStyle(y),K=parseInt(H.paddingTop,10),b=parseInt(H.paddingBottom,10),pe=j.top+j.height/2-Tt,Le=_-pe,oe=S.offsetHeight/2,G=S.offsetTop+oe,ne=D+B+G,ke=R-ne;if(ne<=pe){const le=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const ce=u.clientHeight-y.offsetTop-y.offsetHeight,Ye=Math.max(Le,oe+(le?b:0)+ce+V),xt=ne+Ye;s.style.height=xt+"px"}else{const le=M.length>0&&S===M[0].ref.current;s.style.top="0px";const Ye=Math.max(pe,D+y.offsetTop+(le?K:0)+oe)+ke;s.style.height=Ye+"px",y.scrollTop=ne-pe+y.offsetTop}s.style.margin=`${Tt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,s,u,y,S,m,i.dir,r]);Ke(()=>x(),[x]);const[C,P]=g.useState();Ke(()=>{u&&P(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(j=>{j&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return f.jsx(yP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(J.div,{...o,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});yx.displayName=mP;var gP="SelectPopperPosition",sc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Tt,...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,Ud]=No(Cr,{}),ac="SelectViewport",vx=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nr(ac,n),l=Ud(ac,n),s=de(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(J.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:q(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-Tt*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})})})]})});vx.displayName=ac;var xx="SelectGroup",[vP,xP]=No(xx),wx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hn();return f.jsx(vP,{scope:n,id:o,children:f.jsx(J.div,{role:"group","aria-labelledby":o,...r,ref:t})})});wx.displayName=xx;var Sx="SelectLabel",kx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xP(Sx,n);return f.jsx(J.div,{id:o.id,...r,ref:t})});kx.displayName=Sx;var ps="SelectItem",[wP,Cx]=No(ps),bx=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,s=tr(ps,n),a=nr(ps,n),u=s.value===r,[d,c]=g.useState(i??""),[p,h]=g.useState(!1),w=de(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(J.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:q(l.onFocus,()=>h(!0)),onBlur:q(l.onBlur,()=>h(!1)),onClick:q(l.onClick,()=>{S.current!=="mouse"&&m()}),onPointerUp:q(l.onPointerUp,()=>{S.current==="mouse"&&m()}),onPointerDown:q(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:q(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:q(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:q(l.onKeyDown,v=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(lP.includes(v.key)&&m(),v.key===" "&&v.preventDefault())})})})})});bx.displayName=ps;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=Cx(Go,n),u=cP(Go,n),[d,c]=g.useState(null),p=de(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 Ke(()=>(y(w),()=>S(w)),[y,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(J.span,{id:a.textId,...i,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?So.createPortal(i.children,l.valueNode):null]})});Ex.displayName=Go;var Nx="SelectItemIndicator",Px=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cx(Nx,n).isSelected?f.jsx(J.span,{"aria-hidden":!0,...r,ref:t}):null});Px.displayName=Nx;var uc="SelectScrollUpButton",jx=g.forwardRef((e,t)=>{const n=nr(uc,e.__scopeSelect),r=Ud(uc,e.__scopeSelect),[o,i]=g.useState(!1),l=de(t,r.onScrollButtonChange);return Ke(()=>{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});jx.displayName=uc;var cc="SelectScrollDownButton",_x=g.forwardRef((e,t)=>{const n=nr(cc,e.__scopeSelect),r=Ud(cc,e.__scopeSelect),[o,i]=g.useState(!1),l=de(t,r.onScrollButtonChange);return Ke(()=>{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]),Ke(()=>{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(J.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:q(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:q(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:q(o.onPointerLeave,()=>{a()})})}),SP="SelectSeparator",Ax=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(J.div,{"aria-hidden":!0,...r,ref:t})});Ax.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=de(r,o),l=ov(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(J.select,{...n,style:{...Qv,...n.style},ref:i,defaultValue:t})});Rx.displayName=CP;function Ix(e){return e===""||e===void 0}function Mx(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 Ox(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=bP(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 bP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EP=sx,Lx=ux,NP=dx,PP=fx,jP=px,Dx=hx,_P=vx,TP=wx,zx=kx,Fx=bx,AP=Ex,RP=Px,Bx=jx,$x=_x,Ux=Ax;const lh=EP,za=TP,sh=NP,fc=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Lx,{ref:r,className:re("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(Ay,{className:"h-4 w-4 opacity-50"})})]}));fc.displayName=Lx.displayName;const Vx=g.forwardRef(({className:e,...t},n)=>f.jsx(Bx,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(WC,{className:"h-4 w-4"})}));Vx.displayName=Bx.displayName;const Hx=g.forwardRef(({className:e,...t},n)=>f.jsx($x,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Ay,{className:"h-4 w-4"})}));Hx.displayName=$x.displayName;const pc=g.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>f.jsx(jP,{children:f.jsxs(Dx,{ref:o,className:re("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(Vx,{}),f.jsx(_P,{className:re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(Hx,{})]})}));pc.displayName=Dx.displayName;const Tl=g.forwardRef(({className:e,...t},n)=>f.jsx(zx,{ref:n,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tl.displayName=zx.displayName;const Al=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Fx,{ref:r,className:re("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(RP,{children:f.jsx(UC,{className:"h-4 w-4"})})}),f.jsx(AP,{children:t})]}));Al.displayName=Fx.displayName;const IP=g.forwardRef(({className:e,...t},n)=>f.jsx(Ux,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));IP.displayName=Ux.displayName;var Ys="Dialog",[Wx,Kx]=er(Ys),[MP,$t]=Wx(Ys),Gx=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})};Gx.displayName=Ys;var Yx="DialogTrigger",Qx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Yx,n),i=de(t,o.triggerRef);return f.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wd(o.open),...r,ref:i,onClick:q(e.onClick,o.onOpenToggle)})});Qx.displayName=Yx;var Vd="DialogPortal",[OP,Xx]=Wx(Vd,{forceMount:void 0}),qx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=$t(Vd,t);return f.jsx(OP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(Li,{present:n||i.open,children:f.jsx($d,{asChild:!0,container:o,children:l})}))})};qx.displayName=Vd;var hs="DialogOverlay",Jx=g.forwardRef((e,t)=>{const n=Xx(hs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$t(hs,e.__scopeDialog);return i.modal?f.jsx(Li,{present:r||i.open,children:f.jsx(DP,{...o,ref:t})}):null});Jx.displayName=hs;var LP=mo("DialogOverlay.RemoveScroll"),DP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(hs,n);return f.jsx(lx,{as:LP,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(J.div,{"data-state":Wd(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),br="DialogContent",Zx=g.forwardRef((e,t)=>{const n=Xx(br,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$t(br,e.__scopeDialog);return f.jsx(Li,{present:r||i.open,children:i.modal?f.jsx(zP,{...o,ref:t}):f.jsx(FP,{...o,ref:t})})});Zx.displayName=br;var zP=g.forwardRef((e,t)=>{const n=$t(br,e.__scopeDialog),r=g.useRef(null),o=de(t,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return qv(i)},[]),f.jsx(e0,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&i.preventDefault()}),onFocusOutside:q(e.onFocusOutside,i=>i.preventDefault())})}),FP=g.forwardRef((e,t)=>{const n=$t(br,e.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return f.jsx(e0,{...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()}})}),e0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,s=$t(br,n),a=g.useRef(null),u=de(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(Ad,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Wd(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})]})]})}),Hd="DialogTitle",t0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(Hd,n);return f.jsx(J.h2,{id:o.titleId,...r,ref:t})});t0.displayName=Hd;var n0="DialogDescription",r0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(n0,n);return f.jsx(J.p,{id:o.descriptionId,...r,ref:t})});r0.displayName=n0;var o0="DialogClose",i0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$t(o0,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:q(e.onClick,()=>o.onOpenChange(!1))})});i0.displayName=o0;function Wd(e){return e?"open":"closed"}var l0="DialogTitleWarning",[BP,s0]=Db(l0,{contentName:br,titleName:Hd,docsSlug:"dialog"}),$P=({titleId:e})=>{const t=s0(l0),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 {${s0(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=Gx,WP=Qx,KP=qx,GP=Jx,YP=Zx,QP=t0,XP=r0,a0=i0,u0="AlertDialog",[qP,uI]=er(u0,[Kx]),wn=Kx(),c0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(HP,{...r,...n,modal:!0})};c0.displayName=u0;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 ej="AlertDialogPortal",d0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(KP,{...r,...n})};d0.displayName=ej;var tj="AlertDialogOverlay",f0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(GP,{...o,...r,ref:t})});f0.displayName=tj;var no="AlertDialogContent",[nj,rj]=qP(no),oj=Ab("AlertDialogContent"),p0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=wn(n),l=g.useRef(null),s=de(t,l),a=g.useRef(null);return f.jsx(BP,{contentName:no,titleName:h0,docsSlug:"alert-dialog",children:f.jsx(nj,{scope:n,cancelRef:a,children:f.jsxs(YP,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:q(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(oj,{children:r}),f.jsx(lj,{contentRef:l})]})})})});p0.displayName=no;var h0="AlertDialogTitle",m0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(QP,{...o,...r,ref:t})});m0.displayName=h0;var g0="AlertDialogDescription",y0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(XP,{...o,...r,ref:t})});y0.displayName=g0;var ij="AlertDialogAction",v0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(a0,{...o,...r,ref:t})});v0.displayName=ij;var x0="AlertDialogCancel",w0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=rj(x0,n),i=wn(n),l=de(t,o);return f.jsx(a0,{...i,...r,ref:l})});w0.displayName=x0;var lj=({contentRef:e})=>{const t=`\`${no}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${no}\` by passing a \`${g0}\` 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 \`${no}\`. 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},sj=c0,aj=d0,S0=f0,k0=p0,C0=v0,b0=w0,E0=m0,N0=y0;const uj=sj,cj=aj,P0=g.forwardRef(({className:e,...t},n)=>f.jsx(S0,{className:re("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}));P0.displayName=S0.displayName;const j0=g.forwardRef(({className:e,...t},n)=>f.jsxs(cj,{children:[f.jsx(P0,{}),f.jsx(k0,{ref:n,className:re("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})]}));j0.displayName=k0.displayName;const _0=({className:e,...t})=>f.jsx("div",{className:re("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:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});T0.displayName="AlertDialogFooter";const A0=g.forwardRef(({className:e,...t},n)=>f.jsx(E0,{ref:n,className:re("text-lg font-semibold",e),...t}));A0.displayName=E0.displayName;const R0=g.forwardRef(({className:e,...t},n)=>f.jsx(N0,{ref:n,className:re("text-sm text-muted-foreground",e),...t}));R0.displayName=N0.displayName;const I0=g.forwardRef(({className:e,...t},n)=>f.jsx(C0,{ref:n,className:re(Pd(),e),...t}));I0.displayName=C0.displayName;const M0=g.forwardRef(({className:e,...t},n)=>f.jsx(b0,{ref:n,className:re(Pd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));M0.displayName=b0.displayName;const O0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:re("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}));O0.displayName="Textarea";function dj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const fj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hj={};function ah(e,t){return((t||hj).jsx?pj:fj).test(e)}const mj=/[ \t\n\f\r]/g;function gj(e){return typeof e=="object"?e.type==="text"?uh(e.value):!1:uh(e)}function uh(e){return e.replace(mj,"")===""}class zi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}zi.prototype.normal={};zi.prototype.property={};zi.prototype.space=void 0;function L0(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new zi(n,r,t)}function hc(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let yj=0;const X=_r(),_e=_r(),mc=_r(),F=_r(),me=_r(),ro=_r(),ut=_r();function _r(){return 2**++yj}const gc=Object.freeze(Object.defineProperty({__proto__:null,boolean:X,booleanish:_e,commaOrSpaceSeparated:ut,commaSeparated:ro,number:F,overloadedBoolean:mc,spaceSeparated:me},Symbol.toStringTag,{value:"Module"})),Fa=Object.keys(gc);class Kd extends st{constructor(t,n,r,o){let i=-1;if(super(t,n),ch(this,"space",o),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&kj.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(dh,Ej);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!dh.test(i)){let l=i.replace(Sj,bj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Kd}return new o(r,t)}function bj(e){return"-"+e.toLowerCase()}function Ej(e){return e.charAt(1).toUpperCase()}const Nj=L0([D0,vj,B0,$0,U0],"html"),Gd=L0([D0,xj,B0,$0,U0],"svg");function Pj(e){return e.join(" ").trim()}var Yd={},fh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,jj=/\n/g,_j=/^\s*/,Tj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Aj=/^:\s*/,Rj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ij=/^[;\s]*/,Mj=/^\s+|\s+$/g,Oj=` +`,ph="/",hh="*",ur="",Lj="comment",Dj="declaration",zj=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(jj);y&&(n+=y.length);var S=w.lastIndexOf(Oj);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(_j)}function d(w){var y;for(w=w||[];y=c();)y!==!1&&w.push(y);return w}function c(){var w=i();if(!(ph!=e.charAt(0)||hh!=e.charAt(1))){for(var y=2;ur!=e.charAt(y)&&(hh!=e.charAt(y)||ph!=e.charAt(y+1));)++y;if(y+=2,ur===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:Lj,comment:S})}}function p(){var w=i(),y=a(Tj);if(y){if(c(),!a(Aj))return s("property missing ':'");var S=a(Rj),m=w({type:Dj,property:mh(y[0].replace(fh,ur)),value:S?mh(S[0].replace(fh,ur)):ur});return a(Ij),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 mh(e){return e?e.replace(Mj,ur):ur}var Fj=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yd,"__esModule",{value:!0});Yd.default=$j;var Bj=Fj(zj);function $j(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Bj.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 Uj=/^--[a-zA-Z0-9_-]+$/,Vj=/-([a-z])/g,Hj=/^[^-]+$/,Wj=/^-(webkit|moz|ms|o|khtml)-/,Kj=/^-(ms)-/,Gj=function(e){return!e||Hj.test(e)||Uj.test(e)},Yj=function(e,t){return t.toUpperCase()},gh=function(e,t){return"".concat(t,"-")},Qj=function(e,t){return t===void 0&&(t={}),Gj(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Kj,gh):e=e.replace(Wj,gh),e.replace(Vj,Yj))};Qs.camelCase=Qj;var Xj=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qj=Xj(Yd),Jj=Qs;function yc(e,t){var n={};return!e||typeof e!="string"||(0,qj.default)(e,function(r,o){r&&o&&(n[(0,Jj.camelCase)(r,t)]=o)}),n}yc.default=yc;var Zj=yc;const e_=ys(Zj),V0=H0("end"),Qd=H0("start");function H0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function t_(e){const t=Qd(e),n=V0(e);if(t&&n)return{start:t,end:n}}function ri(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yh(e.position):"start"in e||"end"in e?yh(e):"line"in e||"column"in e?vc(e):""}function vc(e){return vh(e&&e.line)+":"+vh(e&&e.column)}function yh(e){return vc(e&&e.start)+"-"+vc(e&&e.end)}function vh(e){return e&&typeof e=="number"?e:1}class Ge 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=ri(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}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Xd={}.hasOwnProperty,n_=new Map,r_=/[A-Z]/g,o_=new Set(["table","tbody","thead","tfoot","tr"]),i_=new Set(["td","th"]),W0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l_(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=h_(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=p_(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"?Gd:Nj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=K0(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function K0(e,t,n){if(t.type==="element")return s_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return a_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return c_(e,t,n);if(t.type==="mdxjsEsm")return u_(e,t);if(t.type==="root")return d_(e,t,n);if(t.type==="text")return f_(e,t)}function s_(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Gd,e.schema=o),e.ancestors.push(t);const i=Y0(e,t.tagName,!1),l=m_(e,t);let s=Jd(e,t);return o_.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!gj(a):!0})),G0(e,l,i,t),qd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function a_(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)}Pi(e,t.position)}function u_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pi(e,t.position)}function c_(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Gd,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Y0(e,t.name,!0),l=g_(e,t),s=Jd(e,t);return G0(e,l,i,t),qd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function d_(e,t,n){const r={};return qd(r,Jd(e,t)),e.create(t,e.Fragment,r,n)}function f_(e,t){return t.value}function G0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p_(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 h_(e,t){return n;function n(r,o,i,l){const s=Array.isArray(i.children),a=Qd(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 m_(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Xd.call(t.properties,o)){const i=y_(e,o,t.properties[o]);if(i){const[l,s]=i;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&i_.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 g_(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 Pi(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 Pi(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Jd(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:n_;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?(rn(e,e.length,0,t),e):t}const Sh={}.hasOwnProperty;function E_(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 oo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qt=rr(/[A-Za-z]/),pt=rr(/[\dA-Za-z]/),j_=rr(/[#-'*+\--9=?A-Z^-~]/);function xc(e){return e!==null&&(e<32||e===127)}const wc=rr(/\d/),__=rr(/[\dA-Fa-f]/),T_=rr(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const A_=rr(/\p{P}|\p{S}/u),R_=rr(/\s/);function rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jo(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 ye(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(a){return ae(a)?(e.enter(n),s(a)):t(a)}function s(a){return ae(a)&&i++l))return;const j=t.events.length;let T=j,L,A;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(L){A=t.events[T][1].end;break}L=!0}for(m(r),E=j;Ex;){const P=n[C];t.containerState=P[1],P[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 D_(e,t,n){return ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ch(e){if(e===null||lt(e)||R_(e))return 1;if(A_(e))return 2}function ef(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};bh(c,-a),bh(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,ef(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,rn(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&ae(E)?ye(e,v,"linePrefix",i+1)(E):v(E)}function v(E){return E===null||Y(E)?e.check(Eh,y,C)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||Y(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),x)}function C(E){return e.exit("codeFenced"),t(E)}function P(E,j,T){let L=0;return A;function A(D){return E.enter("lineEnding"),E.consume(D),E.exit("lineEnding"),M}function M(D){return E.enter("codeFencedFence"),ae(D)?ye(E,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):_(D)}function _(D){return D===s?(E.enter("codeFencedFenceSequence"),U(D)):T(D)}function U(D){return D===s?(L++,E.consume(D),U):L>=l?(E.exit("codeFencedFenceSequence"),ae(D)?ye(E,O,"whitespace")(D):O(D)):T(D)}function O(D){return D===null||Y(D)?(E.exit("codeFencedFence"),j(D)):T(D)}}}function Q_(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 $a={name:"codeIndented",tokenize:q_},X_={partial:!0,tokenize:J_};function q_(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),ye(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(X_,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 J_(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):ye(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 Z_={name:"codeText",previous:tT,resolve:eT,tokenize:nT};function eT(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 t1(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||xc(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||lt(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=!ae(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function r1(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"),ye(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 oi(e,t){let n;return r;function r(o){return Y(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ae(o)?ye(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const cT={name:"definition",tokenize:fT},dT={partial:!0,tokenize:pT};function fT(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),l(h)}function l(h){return n1.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=oo(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 lt(h)?oi(e,u)(h):u(h)}function u(h){return t1(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(dT,c,c)(h)}function c(h){return ae(h)?ye(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 pT(e,t,n){return r;function r(s){return lt(s)?oi(e,o)(s):n(s)}function o(s){return r1(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return ae(s)?ye(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const hT={name:"hardBreakEscape",tokenize:mT};function mT(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 gT={name:"headingAtx",resolve:yT,tokenize:vT};function yT(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"},rn(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function vT(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||lt(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)):ae(d)?ye(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||lt(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const xT=["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"],Ph=["pre","script","style","textarea"],wT={concrete:!0,name:"htmlFlow",resolveTo:CT,tokenize:bT},ST={partial:!0,tokenize:NT},kT={partial:!0,tokenize:ET};function CT(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 bT(e,t,n){const r=this;let o,i,l,s,a;return u;function u(b){return d(b)}function d(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),i=!0,y):b===63?(e.consume(b),o=3,r.interrupt?t:k):Qt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),o=2,h):b===91?(e.consume(b),o=5,s=0,w):Qt(b)?(e.consume(b),o=4,r.interrupt?t:k):n(b)}function h(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const pe="CDATA[";return b===pe.charCodeAt(s++)?(e.consume(b),s===pe.length?r.interrupt?t:_:w):n(b)}function y(b){return Qt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||lt(b)){const pe=b===47,Le=l.toLowerCase();return!pe&&!i&&Ph.includes(Le)?(o=1,r.interrupt?t(b):_(b)):xT.includes(l.toLowerCase())?(o=6,pe?(e.consume(b),m):r.interrupt?t(b):_(b)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):i?v(b):x(b))}return b===45||pt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function m(b){return b===62?(e.consume(b),r.interrupt?t:_):n(b)}function v(b){return ae(b)?(e.consume(b),v):A(b)}function x(b){return b===47?(e.consume(b),A):b===58||b===95||Qt(b)?(e.consume(b),C):ae(b)?(e.consume(b),x):A(b)}function C(b){return b===45||b===46||b===58||b===95||pt(b)?(e.consume(b),C):P(b)}function P(b){return b===61?(e.consume(b),E):ae(b)?(e.consume(b),P):x(b)}function E(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,j):ae(b)?(e.consume(b),E):T(b)}function j(b){return b===a?(e.consume(b),a=null,L):b===null||Y(b)?n(b):(e.consume(b),j)}function T(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||lt(b)?P(b):(e.consume(b),T)}function L(b){return b===47||b===62||ae(b)?x(b):n(b)}function A(b){return b===62?(e.consume(b),M):n(b)}function M(b){return b===null||Y(b)?_(b):ae(b)?(e.consume(b),M):n(b)}function _(b){return b===45&&o===2?(e.consume(b),B):b===60&&o===1?(e.consume(b),V):b===62&&o===4?(e.consume(b),H):b===63&&o===3?(e.consume(b),k):b===93&&o===5?(e.consume(b),R):Y(b)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ST,K,U)(b)):b===null||Y(b)?(e.exit("htmlFlowData"),U(b)):(e.consume(b),_)}function U(b){return e.check(kT,O,K)(b)}function O(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),D}function D(b){return b===null||Y(b)?U(b):(e.enter("htmlFlowData"),_(b))}function B(b){return b===45?(e.consume(b),k):_(b)}function V(b){return b===47?(e.consume(b),l="",N):_(b)}function N(b){if(b===62){const pe=l.toLowerCase();return Ph.includes(pe)?(e.consume(b),H):_(b)}return Qt(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),N):_(b)}function R(b){return b===93?(e.consume(b),k):_(b)}function k(b){return b===62?(e.consume(b),H):b===45&&o===2?(e.consume(b),k):_(b)}function H(b){return b===null||Y(b)?(e.exit("htmlFlowData"),K(b)):(e.consume(b),H)}function K(b){return e.exit("htmlFlow"),t(b)}}function ET(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 NT(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Xs,t,n)}}const PT={name:"htmlText",tokenize:jT};function jT(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),P):k===63?(e.consume(k),x):Qt(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),i=0,w):Qt(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,V(k)):(e.consume(k),c)}function p(k){return k===45?(e.consume(k),h):c(k)}function h(k){return k===62?B(k):k===45?p(k):c(k)}function w(k){const H="CDATA[";return k===H.charCodeAt(i++)?(e.consume(k),i===H.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):Y(k)?(l=y,V(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),m):y(k)}function m(k){return k===62?B(k):k===93?(e.consume(k),m):y(k)}function v(k){return k===null||k===62?B(k):Y(k)?(l=v,V(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):Y(k)?(l=x,V(k)):(e.consume(k),x)}function C(k){return k===62?B(k):x(k)}function P(k){return Qt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||pt(k)?(e.consume(k),E):j(k)}function j(k){return Y(k)?(l=j,V(k)):ae(k)?(e.consume(k),j):B(k)}function T(k){return k===45||pt(k)?(e.consume(k),T):k===47||k===62||lt(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),B):k===58||k===95||Qt(k)?(e.consume(k),A):Y(k)?(l=L,V(k)):ae(k)?(e.consume(k),L):B(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),_):Y(k)?(l=M,V(k)):ae(k)?(e.consume(k),M):L(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,U):Y(k)?(l=_,V(k)):ae(k)?(e.consume(k),_):(e.consume(k),O)}function U(k){return k===o?(e.consume(k),o=void 0,D):k===null?n(k):Y(k)?(l=U,V(k)):(e.consume(k),U)}function O(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||lt(k)?L(k):(e.consume(k),O)}function D(k){return k===47||k===62||lt(k)?L(k):n(k)}function B(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function V(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),N}function N(k){return ae(k)?ye(e,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):R(k)}function R(k){return e.enter("htmlTextData"),l(k)}}const tf={name:"labelEnd",resolveAll:RT,resolveTo:IT,tokenize:MT},_T={tokenize:OT},TT={tokenize:LT},AT={tokenize:DT};function RT(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"),ae(u)?ye(e,s,"whitespace")(u):s(u))}}const et={continuation:{tokenize:GT},exit:QT,name:"list",tokenize:KT},HT={partial:!0,tokenize:XT},WT={partial:!0,tokenize:YT};function KT(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:wc(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(Rl,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 wc(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(HT,p,c))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function c(h){return ae(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 GT(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,ye(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!ae(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(WT,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ye(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function YT(e,t,n){const r=this;return ye(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 QT(e){e.exit(this.containerState.type)}function XT(e,t,n){const r=this;return ye(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!ae(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const jh={name:"setextUnderline",resolveTo:qT,tokenize:JT};function qT(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 JT(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"),ae(u)?ye(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ZT={tokenize:eA};function eA(e){const t=this,n=e.attempt(Xs,r,e.attempt(this.parser.constructs.flowInitial,o,ye(e,e.attempt(this.parser.constructs.flow,o,e.attempt(iT,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 tA={resolveAll:i1()},nA=o1("string"),rA=o1("text");function o1(e){return{resolveAll:i1(e==="text"?oA: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 yA(e,t){let n=-1;const r=[];let o;for(;++n0){const Pt=Q.tokenStack[Q.tokenStack.length-1];(Pt[1]||Th).call(Q,void 0,Pt[0])}for($.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})},he=-1;++he1?"-"+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 MA(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 OA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function a1(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 LA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a1(e,t);const o={src:jo(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 DA(e,t){const n={src:jo(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 zA(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 FA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a1(e,t);const o={href:jo(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 BA(e,t){const n={href:jo(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 $A(e,t,n){const r=e.all(t),o=n?UA(n):u1(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 VA(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=Qd(t.children[1]),a=V0(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 YA(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(Ih(t.slice(o),o>0,!1)),i.join("")}function Ih(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Ah||i===Rh;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Ah||i===Rh;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function qA(e,t){const n={type:"text",value:XA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZA={blockquote:jA,break:_A,code:TA,delete:AA,emphasis:RA,footnoteReference:IA,heading:MA,html:OA,imageReference:LA,image:DA,inlineCode:zA,linkReference:FA,link:BA,listItem:$A,list:VA,paragraph:HA,root:WA,strong:KA,table:GA,tableCell:QA,tableRow:YA,text:qA,thematicBreak:JA,toml:cl,yaml:cl,definition:cl,footnoteDefinition:cl};function cl(){}const c1=-1,qs=0,ii=1,ms=2,nf=3,rf=4,of=5,lf=6,d1=7,f1=8,Mh=typeof self=="object"?self:globalThis,eR=(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 c1:return n(l,o);case ii:{const s=n([],o);for(const a of l)s.push(r(a));return s}case ms:{const s=n({},o);for(const[a,u]of l)s[r(a)]=r(u);return s}case nf:return n(new Date(l),o);case rf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),o)}case of:{const s=n(new Map,o);for(const[a,u]of l)s.set(r(a),r(u));return s}case lf:{const s=n(new Set,o);for(const a of l)s.add(r(a));return s}case d1:{const{name:s,message:a}=l;return n(new Mh[s](a),o)}case f1: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 Mh[i](l),o)};return r},Oh=e=>eR(new Map,e)(0),Or="",{toString:tR}={},{keys:nR}=Object,Uo=e=>{const t=typeof e;if(t!=="object"||!e)return[qs,t];const n=tR.call(e).slice(8,-1);switch(n){case"Array":return[ii,Or];case"Object":return[ms,Or];case"Date":return[nf,Or];case"RegExp":return[rf,Or];case"Map":return[of,Or];case"Set":return[lf,Or];case"DataView":return[ii,n]}return n.includes("Array")?[ii,n]:n.includes("Error")?[d1,n]:[ms,n]},dl=([e,t])=>e===qs&&(t==="function"||t==="symbol"),rR=(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=f1,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return o([c1],l)}return o([s,d],l)}case ii:{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 ms:{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 nR(l))(e||!dl(Uo(l[p])))&&d.push([i(p),i(l[p])]);return c}case nf:return o([s,l.toISOString()],l);case rf:{const{source:d,flags:c}=l;return o([s,{source:d,flags:c}],l)}case of:{const d=[],c=o([s,d],l);for(const[p,h]of l)(e||!(dl(Uo(p))||dl(Uo(h))))&&d.push([i(p),i(h)]);return c}case lf:{const d=[],c=o([s,d],l);for(const p of l)(e||!dl(Uo(p)))&&d.push(i(p));return c}}const{message:u}=l;return o([s,{name:a,message:u}],l)};return i},Lh=(e,{json:t,lossy:n}={})=>{const r=[];return rR(!(t||n),!!t,new Map,r)(e),r},gs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Oh(Lh(e,t)):structuredClone(e):(e,t)=>Oh(Lh(e,t));function oR(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 iR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oR,r=e.options.footnoteBackLabel||iR,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:{...gs(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 p1=function(e){if(e==null)return cR;if(typeof e=="function")return Js(e);if(typeof e=="object")return Array.isArray(e)?sR(e):aR(e);if(typeof e=="string")return uR(e);throw new Error("Expected function, string, or object as test")};function sR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=h1,w,y,S;if((!t||i(a,u,d[d.length-1]||void 0))&&(h=mR(n(a,d)),h[0]===Dh))return h;if("children"in a&&a.children){const m=a;if(m.children&&h[0]!==pR)for(y=(r?m.children.length:-1)+l,S=d.concat(m);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function zh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Fh(e,t){const n=yR(e,t),r=n.one(e,void 0),o=lR(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:` +`},o),i}function kR(e,t){return e&&"run"in e?async function(n,r){const o=Fh(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Fh(n,{file:r,...e||t})}}function Bh(e){if(e)throw e}var Il=Object.prototype.hasOwnProperty,g1=Object.prototype.toString,$h=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,Vh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):g1.call(t)==="[object Array]"},Hh=function(t){if(!t||g1.call(t)!=="[object Object]")return!1;var n=Il.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Il.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Il.call(t,o)},Wh=function(t,n){$h&&n.name==="__proto__"?$h(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Kh=function(t,n){if(n==="__proto__")if(Il.call(t,n)){if(Uh)return Uh(t,n).value}else return;return t[n]},CR=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:NR,dirname:PR,extname:jR,join:_R,sep:"/"};function NR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fi(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 PR(e){if(Fi(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 jR(e){Fi(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 _R(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function AR(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 Fi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RR={cwd:IR};function IR(){return"/"}function bc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function MR(e){if(typeof e=="string")e=new URL(e);else if(!bc(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 OR(e)}function OR(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];Cc(y)&&Cc(h)&&(h=Va(!0,y,h)),r[p]=[u,h,...w]}}}}const FR=new sf().freeze();function Ga(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ya(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qa(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yh(e){if(!Cc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fl(e){return BR(e)?e:new y1(e)}function BR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $R(e){return typeof e=="string"||UR(e)}function UR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xh=[],qh={allowDangerousHtml:!0},HR=/^(https?|ircs?|mailto|xmpp)$/i,WR=[{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 KR(e){const t=GR(e),n=YR(e);return QR(t.runSync(t.parse(n),n),e)}function GR(e){const t=e.rehypePlugins||Xh,n=e.remarkPlugins||Xh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qh}:qh;return FR().use(PA).use(n).use(kR,r).use(t)}function YR(e){const t=e.children||"",n=new y1;return typeof t=="string"&&(n.value=t),n}function QR(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||XR;for(const d of WR)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+VR+d.id,void 0);return m1(e,u),l_(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 Ba)if(Object.hasOwn(Ba,h)&&Object.hasOwn(d.properties,h)){const w=d.properties[h],y=Ba[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 XR(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||HR.test(e.slice(0,t))?e:""}const v1=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:re("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:re("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(po,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:re("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(KR,{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(kb,{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(O0,{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(Me,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(vb,{className:"h-4 w-4"})}):f.jsx(Me,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(cb,{className:"h-4 w-4"})})]})})]})});v1.displayName="Chat";const Vt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function x1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function qR(){return x1()}class JR{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:x1(),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:qR(),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 Ne=new JR;function ZR(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=Rt.useMemo(()=>{var D;const O=o.find(B=>B.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]),P=Rt.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=Ne.getAllSessions();i(O);const D=Ne.getCurrentSession();D?s(D.id):O.length>0&&(s(O[0].id),Ne.setCurrentSession(O[0].id))},[]);const E=g.useCallback(()=>{const O=Ne.createSession(void 0,p,w),D=Ne.getAllSessions();return i([...D]),s(O.id),Ne.setCurrentSession(O.id),O.id},[p,w]),j=g.useCallback(O=>{s(O),Ne.setCurrentSession(O)},[]),T=g.useCallback(O=>{Ne.deleteSession(O);const D=Ne.getAllSessions();i([...D]),l===O&&(D.length>0?(s(D[0].id),Ne.setCurrentSession(D[0].id)):s(null))},[l]),L=g.useCallback((O,D)=>{Ne.updateSession(O,{title:D});const B=Ne.getAllSessions();i([...B])},[]),A=g.useCallback(O=>{if(!l)return;Ne.addMessageToSession(l,O);const D=Ne.getAllSessions();i([...D])},[l]),M=g.useCallback(async()=>{var B,V;if(!a.trim()||d.isLoading)return;let O=l;O||(O=E());const D=a.trim();if(u(""),c({isLoading:!0,error:null}),O){Ne.addMessageToSession(O,{role:"user",content:D});const N=Ne.getAllSessions();i([...N])}try{const N=Ne.getSession(O),R=((V=(B=N==null?void 0:N.messages)==null?void 0:B.filter(K=>K.role!=="system"))==null?void 0:V.map(K=>({role:K.role,content:K.content})))||[],k=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:R,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:v})});if(!k.ok){const K=await k.json();throw new Error(K.detail||`HTTP error! status: ${k.status}`)}const H=await k.json();if(O){Ne.addMessageToSession(O,{role:"assistant",content:H.content,thinking_content:H.thinking_content,model_used:H.model_used,supports_thinking:H.supports_thinking});const K=Ne.getAllSessions();i([...K])}c({isLoading:!1,error:null})}catch(N){const R=N instanceof Error?N.message:"An error occurred";if(c({isLoading:!1,error:R}),O){Ne.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${R}`});const k=Ne.getAllSessions();i([...k])}}},[a,d.isLoading,l,E,A,w,P.length,t,p,S,v]),_=g.useCallback(()=>{c({isLoading:!1,error:null})},[]),U=g.useCallback(()=>{Ne.clear(),i([]),s(null)},[]);return{sessions:o,currentSession:C,currentSessionId:l,createNewSession:E,selectSession:j,deleteSession:T,renameSession:L,clearAllSessions:U,messages:P,input:a,setInput:u,sendMessage:M,stopGeneration:_,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}=ZR(),[C,P]=g.useState(!1),[E,j]=g.useState(null),[T,L]=g.useState(!1),[A,M]=g.useState(null),[_,U]=g.useState([]),O=[{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(()=>{V()},[]),g.useEffect(()=>{if(p&&!_.find(N=>N.model_name===p)){const N=_[0];N&&h(N.model_name)}},[_,p,h]),g.useEffect(()=>{(async()=>{if(!p||!_.length)return;const R=_.find(K=>K.model_name===p);if(!R)return;const k=`${window.location.protocol}//${window.location.host}`;if(R.type==="local"&&!R.is_loaded){M(R),L(!0);return}const H=_.filter(K=>K.type==="local"&&K.is_loaded&&K.model_name!==p);for(const K of H)try{(await fetch(`${k}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:K.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${K.model_name}`)}catch(b){console.error(`Error auto-unloading model ${K.model_name}:`,b)}H.length>0&&V()})()},[p,_]);const D=async()=>{if(A){L(!1),j(A.model_name);try{const N=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${N}/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}`),V();else{console.error(`❌ Failed to load model: ${A.model_name}`);const k=_.find(H=>H.type==="api");k&&h(k.model_name)}}catch(N){console.error("Error loading model:",N);const R=_.find(k=>k.type==="api");R&&h(R.model_name)}finally{j(null),M(null)}}},B=()=>{L(!1),M(null);const N=_.find(R=>R.type==="api");N&&h(N.model_name)};g.useEffect(()=>{const N=async()=>{const R=`${window.location.protocol}//${window.location.host}`,k=_.filter(H=>H.type==="local"&&H.is_loaded);for(const H of k)try{await fetch(`${R}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:H.model_name})}),console.log(`✅ Cleanup: unloaded ${H.model_name}`)}catch(K){console.error(`Error cleaning up model ${H.model_name}:`,K)}};return()=>{N()}},[_]);const V=async()=>{try{const N=`${window.location.protocol}//${window.location.host}`,R=await fetch(`${N}/models`);if(R.ok){const k=await R.json();if(U(k.models),k.current_model&&p!==k.current_model)h(k.current_model);else if(!p&&k.models.length>0){const K=k.models.find(b=>b.type==="api")||k.models[0];h(K.model_name)}}}catch(N){console.error("Failed to fetch models:",N)}};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(Me,{onClick:r,size:"sm",children:[f.jsx(Qu,{className:"h-4 w-4 mr-1"}),"New"]})]}),f.jsx("div",{className:"space-y-2",children:e.map(N=>f.jsxs(Xe,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===N.id?"bg-accent border-primary":""}`,onClick:()=>o(N.id),children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:N.title}),f.jsx(Me,{size:"sm",variant:"ghost",onClick:R=>{R.stopPropagation(),i(N.id)},className:"h-6 w-6 p-0",children:f.jsx(Ed,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[N.messages.length," messages"]})]},N.id))})]})}),C&&f.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>P(!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(Ls,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&f.jsxs(Ie,{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(Me,{variant:"outline",size:"sm",onClick:()=>P(!C),className:"flex-shrink-0",children:[f.jsx(eb,{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(v1,{messages:l.map(N=>({id:N.id,role:N.role,content:N.content,createdAt:new Date(N.timestamp)})),input:s,handleInputChange:N=>a(N.target.value),handleSubmit:async N=>{N.preventDefault(),!(!p||!_.find(R=>R.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(bd,{className:"h-6 w-6"}),f.jsx("h2",{className:"font-semibold text-xl",children:"Assistant Configuration"})]}),f.jsxs(Xe,{children:[f.jsx(Zt,{children:f.jsx(en,{className:"text-base",children:"Model Selection"})}),f.jsxs(Dt,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Gt,{className:"text-sm font-medium mb-3 block",children:"Active Model"}),f.jsxs(lh,{value:p||"",onValueChange:h,children:[f.jsx(fc,{className:"w-full",children:f.jsx(sh,{placeholder:"Select a model...",children:p&&(()=>{const N=_.find(k=>k.model_name===p);if(!N)return p;const R=N.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[R?f.jsx(ss,{className:"h-4 w-4 text-blue-500"}):N.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:N.name}),E===p?f.jsx(Ie,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(Ie,{variant:"outline",className:"text-xs",children:R?"API":N.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(pc,{children:[f.jsxs(za,{children:[f.jsx(Tl,{children:"🌐 API Models"}),_.filter(N=>N.type==="api").map(N=>f.jsx(Al,{value:N.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ss,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:N.name}),f.jsx(Ie,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},N.model_name))]}),f.jsxs(za,{children:[f.jsx(Tl,{children:"💻 Local Models"}),_.filter(N=>N.type==="local").map(N=>f.jsx(Al,{value:N.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[N.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:N.name}),E===N.model_name?f.jsx(Ie,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):N.is_loaded?f.jsx(Ie,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(Ie,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},N.model_name))]})]})]})]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsx(Me,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:f.jsxs(ky,{to:"/models",className:"flex items-center gap-2",children:[f.jsx(Cd,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),f.jsxs(Xe,{children:[f.jsx(Zt,{children:f.jsx(en,{className:"text-base",children:"Generation Parameters"})}),f.jsxs(Dt,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs(Gt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),f.jsx(tc,{value:[S],onValueChange:N=>m(N[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(Gt,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),f.jsx(tc,{value:[v],onValueChange:N=>x(N[0]),min:100,max:4096,step:100,className:"mt-2",disabled:c})]})]})]}),f.jsxs(Xe,{className:"border-2 border-blue-200 bg-blue-50/50",children:[f.jsx(Zt,{children:f.jsxs(en,{className:"text-sm flex items-center gap-2",children:[f.jsx(po,{className:"h-4 w-4 text-blue-600"}),"Assistant Configuration",w&&f.jsx(Ie,{variant:"default",className:"text-xs bg-blue-600",children:"Custom"})]})}),f.jsxs(Dt,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Gt,{className:"text-base font-medium text-muted-foreground mb-4 block",children:"Quick Presets"}),f.jsxs(lh,{value:"",onValueChange:N=>{const R=O.find(k=>k.name===N);R&&y(R.prompt)},children:[f.jsx(fc,{className:"w-full h-12",children:f.jsx(sh,{placeholder:"Choose a preset..."})}),f.jsx(pc,{children:f.jsxs(za,{children:[f.jsx(Tl,{children:"Assistant Presets"}),O.map(N=>f.jsx(Al,{value:N.name,children:f.jsxs("div",{className:"flex flex-col items-start",children:[f.jsx("span",{className:"font-medium",children:N.name}),f.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:[N.prompt.slice(0,60),"..."]})]})},N.name))]})})]})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-5",children:[f.jsx(Gt,{htmlFor:"system-prompt",className:"text-lg font-semibold",children:"System Instructions"}),w&&f.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-8 px-3 text-sm",disabled:c,children:[f.jsx(ab,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),f.jsx("textarea",{id:"system-prompt",value:w,onChange:N=>y(N.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(uj,{open:T,onOpenChange:L,children:f.jsxs(j0,{children:[f.jsxs(_0,{children:[f.jsx(A0,{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(M0,{onClick:B,children:"Cancel"}),f.jsx(I0,{onClick:D,children:"Load Model"})]})]})})]})}function tI(){const e=Os(),[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(Yu,{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(Cd,{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(Me,{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(Xe,{className:"bg-blue-50 border-blue-200",children:f.jsx(Dt,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(My,{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(ss,{className:"h-5 w-5"}),"API Models",f.jsx(Ie,{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(Jh,{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(Ry,{className:"h-5 w-5"}),"Local Models",f.jsx(Ie,{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(Jh,{model:d,modelLoading:i,onLoad:a,onUnload:u},d.model_name))})]})]})})]})}function Jh({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(Xe,{className:"hover:shadow-md transition-shadow",children:[f.jsx(Zt,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(en,{className:"text-base flex items-center gap-2",children:[o?f.jsx(ss,{className:"h-4 w-4 text-blue-600"}):f.jsx(Ry,{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(GC,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(Dt,{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(Ie,{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(Ie,{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(Ie,{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(Ie,{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(Me,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Yu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(Ed,{className:"h-4 w-4 mr-2"}),i?"Unloading...":"Unload Model"]}):f.jsxs(Me,{size:"sm",onClick:()=>n(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Yu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(XC,{className:"h-4 w-4 mr-2"}),i?"Loading...":"Load Model"]})})]})]})}function nI(){const e=Os(),[t,n]=g.useState([]);g.useEffect(()=>{r()},[]);const r=()=>{try{const a=JSON.parse(localStorage.getItem("savedAssistants")||"[]");n(a)}catch(a){console.error("Failed to load assistants:",a)}},o=a=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(a)),e("/playground")},i=a=>{const u=t.filter(d=>d.id!==a);n(u),localStorage.setItem("savedAssistants",JSON.stringify(u))},l=a=>{console.log(`Shared "${a.name}" to community`)},s=()=>{e("/playground")};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.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-purple-600 rounded-lg flex items-center justify-center",children:f.jsx(po,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"My Assistants"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your custom AI assistants and configurations"})]})]}),f.jsxs(Me,{onClick:s,className:"flex items-center gap-2",children:[f.jsx(Qu,{className:"h-4 w-4"}),"Create New Assistant"]})]})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsx("div",{className:"max-w-6xl mx-auto space-y-6",children:t.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(a=>f.jsx(rI,{assistant:a,onUse:()=>o(a),onDelete:()=>i(a.id),onShare:()=>l(a)},a.id))}):f.jsxs(Xe,{className:"text-center py-16",children:[f.jsx(po,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),f.jsx("h3",{className:"text-xl font-medium mb-3",children:"No assistants yet"}),f.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Create your first AI assistant by configuring parameters and prompts in the Playground, then saving your configuration for future use."}),f.jsxs(Me,{onClick:s,size:"lg",className:"flex items-center gap-2 mx-auto",children:[f.jsx(Qu,{className:"h-5 w-5"}),"Create Your First Assistant"]})]})})})]})}function rI({assistant:e,onUse:t,onDelete:n,onShare:r}){return f.jsxs(Xe,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[f.jsx(Zt,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(en,{className:"text-base flex items-center gap-2",children:[f.jsx(po,{className:"h-4 w-4 text-purple-600"}),e.name]}),f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description provided"})]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx(Me,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Share to community",children:f.jsx(mb,{className:"h-4 w-4"})}),f.jsx(Me,{variant:"ghost",size:"sm",onClick:n,className:"text-red-500 hover:text-red-600 hover:bg-red-50",title:"Delete assistant",children:f.jsx(Ed,{className:"h-4 w-4"})})]})]})}),f.jsxs(Dt,{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Model:"}),f.jsx("p",{className:"text-gray-800 truncate",children:e.model})]}),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.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Created:"}),f.jsx("p",{className:"text-gray-800",children:new Date(e.createdAt).toLocaleDateString()})]})]}),e.systemPrompt&&f.jsxs("div",{className:"bg-blue-50 rounded p-2",children:[f.jsx("span",{className:"text-xs font-medium text-blue-700",children:"System Prompt:"}),f.jsx("p",{className:"text-xs text-blue-600 mt-1 line-clamp-2",children:e.systemPrompt})]}),f.jsxs(Me,{onClick:t,className:"w-full flex items-center gap-2",children:[f.jsx(Ls,{className:"h-4 w-4"}),"Use Assistant"]})]})]})}function oI(){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(bd,{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(Xe,{children:[f.jsx(Zt,{children:f.jsxs(en,{className:"flex items-center gap-2",children:[f.jsx(fb,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(Dt,{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(Gt,{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(Gt,{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(Xe,{children:[f.jsx(Zt,{children:f.jsxs(en,{className:"flex items-center gap-2",children:[f.jsx(Ap,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(Dt,{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(Ap,{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(Xe,{children:[f.jsx(Zt,{children:f.jsxs(en,{className:"flex items-center gap-2",children:[f.jsx(My,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(Dt,{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(Gt,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(Ie,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(Gt,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(Ie,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function iI(){return f.jsx(qk,{children:f.jsx(Hk,{children:f.jsxs(ar,{path:"/",element:f.jsx(Pb,{}),children:[f.jsx(ar,{index:!0,element:f.jsx(pE,{})}),f.jsx(ar,{path:"playground",element:f.jsx(eI,{})}),f.jsx(ar,{path:"models",element:f.jsx(tI,{})}),f.jsx(ar,{path:"assistants",element:f.jsx(nI,{})}),f.jsx(ar,{path:"settings",element:f.jsx(oI,{})})]})})})}Xa.createRoot(document.getElementById("root")).render(f.jsx(Rt.StrictMode,{children:f.jsx(iI,{})})); +//# sourceMappingURL=index-7b7fcf98.js.map