diff --git "a/static/assets/index-1c66a882.js" "b/static/assets/index-1c66a882.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-1c66a882.js" @@ -0,0 +1,342 @@ +function _1(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Vl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ch={exports:{}},js={},dh={exports:{}},re={};/** + * @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 Mo=Symbol.for("react.element"),A1=Symbol.for("react.portal"),R1=Symbol.for("react.fragment"),I1=Symbol.for("react.strict_mode"),M1=Symbol.for("react.profiler"),L1=Symbol.for("react.provider"),O1=Symbol.for("react.context"),D1=Symbol.for("react.forward_ref"),z1=Symbol.for("react.suspense"),F1=Symbol.for("react.memo"),B1=Symbol.for("react.lazy"),wf=Symbol.iterator;function $1(e){return e===null||typeof e!="object"?null:(e=wf&&e[wf]||e["@@iterator"],typeof e=="function"?e:null)}var fh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ph=Object.assign,mh={};function ki(e,t,n){this.props=e,this.context=t,this.refs=mh,this.updater=n||fh}ki.prototype.isReactComponent={};ki.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")};ki.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hh(){}hh.prototype=ki.prototype;function Dc(e,t,n){this.props=e,this.context=t,this.refs=mh,this.updater=n||fh}var zc=Dc.prototype=new hh;zc.constructor=Dc;ph(zc,ki.prototype);zc.isPureReactComponent=!0;var Sf=Array.isArray,gh=Object.prototype.hasOwnProperty,Fc={current:null},yh={key:!0,ref:!0,__self:!0,__source:!0};function vh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)gh.call(t,r)&&!yh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,Y=T[G];if(0>>1;Gi(ge,k))tei(Q,ge)?(T[G]=Q,T[te]=k,G=te):(T[G]=ge,T[q]=k,G=q);else if(tei(Q,k))T[G]=Q,T[te]=k,G=te;else break e}}return B}function i(T,B){var k=T.sortIndex-B.sortIndex;return k!==0?k:T.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],d=1,c=null,p=3,m=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(T){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=T)r(u),B.sortIndex=B.expirationTime,t(a,B);else break;B=n(u)}}function C(T){if(v=!1,x(T),!w)if(n(a)!==null)w=!0,L(N);else{var B=n(u);B!==null&&D(C,B.startTime-T)}}function N(T,B){w=!1,v&&(v=!1,y(_),_=-1),m=!0;var k=p;try{for(x(B),c=n(a);c!==null&&(!(c.expirationTime>B)||T&&!A());){var G=c.callback;if(typeof G=="function"){c.callback=null,p=c.priorityLevel;var Y=G(c.expirationTime<=B);B=e.unstable_now(),typeof Y=="function"?c.callback=Y:c===n(a)&&r(a),x(B)}else r(a);c=n(a)}if(c!==null)var b=!0;else{var q=n(u);q!==null&&D(C,q.startTime-B),b=!1}return b}finally{c=null,p=k,m=!1}}var E=!1,P=null,_=-1,F=5,M=-1;function A(){return!(e.unstable_now()-MT||125G?(T.sortIndex=k,t(u,T),n(a)===null&&T===n(u)&&(v?(y(_),_=-1):v=!0,D(C,k-G))):(T.sortIndex=Y,t(a,T),w||m||(w=!0,L(N))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var B=p;return function(){var k=p;p=B;try{return T.apply(this,arguments)}finally{p=k}}}})(Ch);kh.exports=Ch;var J1=kh.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 Z1=g,vt=J1;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"),cu=Object.prototype.hasOwnProperty,ew=/^[: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]*$/,Cf={},bf={};function tw(e){return cu.call(bf,e)?!0:cu.call(Cf,e)?!1:ew.test(e)?bf[e]=!0:(Cf[e]=!0,!1)}function nw(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 rw(e,t,n,r){if(t===null||typeof t>"u"||nw(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,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ve[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];Ve[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ve[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ve[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){Ve[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ve[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ve[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ve[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ve[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uc=/[\-:]([a-z])/g;function Vc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uc,Vc);Ve[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(Uc,Vc);Ve[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(Uc,Vc);Ve[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ve[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Ve.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ve[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Hc(e,t,n,r){var i=Ve.hasOwnProperty(t)?Ve[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{ha=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gi(e):""}function iw(e){switch(e.tag){case 5:return Gi(e.type);case 16:return Gi("Lazy");case 13:return Gi("Suspense");case 19:return Gi("SuspenseList");case 0:case 2:case 15:return e=ga(e.type,!1),e;case 11:return e=ga(e.type.render,!1),e;case 1:return e=ga(e.type,!0),e;default:return""}}function mu(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 Br:return"Fragment";case Fr:return"Portal";case du:return"Profiler";case Wc:return"StrictMode";case fu:return"Suspense";case pu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Nh:return(e.displayName||"Context")+".Consumer";case Eh:return(e._context.displayName||"Context")+".Provider";case Kc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gc:return t=e.displayName||null,t!==null?t:mu(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return mu(e(t))}catch{}}return null}function ow(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 mu(t);case 8:return t===Wc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lw(e){var t=jh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qo(e){e._valueTracker||(e._valueTracker=lw(e))}function Th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=jh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hl(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 hu(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Nf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Gn(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 _h(e,t){t=t.checked,t!=null&&Hc(e,"checked",t,!1)}function gu(e,t){_h(e,t);var n=Gn(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")?yu(e,t.type,n):t.hasOwnProperty("defaultValue")&&yu(e,t.type,Gn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pf(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 yu(e,t,n){(t!=="number"||Hl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qi=Array.isArray;function Jr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Yo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ji={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},sw=["Webkit","ms","Moz","O"];Object.keys(Ji).forEach(function(e){sw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ji[t]=Ji[e]})});function Mh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ji.hasOwnProperty(e)&&Ji[e]?(""+t).trim():t+"px"}function Lh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Mh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var aw=je({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 wu(e,t){if(t){if(aw[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 Su(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 ku=null;function Qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cu=null,Zr=null,ei=null;function _f(e){if(e=Do(e)){if(typeof Cu!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Is(t),Cu(e.stateNode,e.type,t))}}function Oh(e){Zr?ei?ei.push(e):ei=[e]:Zr=e}function Dh(){if(Zr){var e=Zr,t=ei;if(ei=Zr=null,_f(e),t)for(e=0;e>>=0,e===0?32:31-(xw(e)/ww|0)|0}var Xo=64,qo=4194304;function Yi(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 Ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Yi(s):(o&=l,o!==0&&(r=Yi(o)))}else l=n&~i,l!==0?r=Yi(l):o!==0&&(r=Yi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function bw(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=eo),Ff=String.fromCharCode(32),Bf=!1;function rg(e,t){switch(e){case"keyup":return Jw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ig(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $r=!1;function eS(e,t){switch(e){case"compositionend":return ig(t);case"keypress":return t.which!==32?null:(Bf=!0,Ff);case"textInput":return e=t.data,e===Ff&&Bf?null:e;default:return null}}function tS(e,t){if($r)return e==="compositionend"||!nd&&rg(e,t)?(e=tg(),kl=Zc=Mn=null,$r=!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=Hf(n)}}function ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ug(){for(var e=window,t=Hl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hl(e.document)}return t}function rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cS(e){var t=ug(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ag(n.ownerDocument.documentElement,n)){if(r!==null&&rd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Wf(n,o);var l=Wf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ur=null,Tu=null,no=null,_u=!1;function Kf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_u||Ur==null||Ur!==Hl(r)||(r=Ur,"selectionStart"in r&&rd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),no&&xo(no,r)||(no=r,r=ql(Tu,"onSelect"),0Wr||(e.current=Ou[Wr],Ou[Wr]=null,Wr--)}function xe(e,t){Wr++,Ou[Wr]=e.current,e.current=t}var Qn={},Ge=Zn(Qn),it=Zn(!1),gr=Qn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Qn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function Zl(){be(it),be(Ge)}function Zf(e,t,n){if(Ge.current!==Qn)throw Error(z(168));xe(Ge,t),xe(it,n)}function vg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(z(108,ow(e)||"Unknown",i));return je({},n,r)}function es(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,gr=Ge.current,xe(Ge,e),xe(it,it.current),!0}function ep(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=vg(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,be(it),be(Ge),xe(Ge,e)):be(it),xe(it,n)}var mn=null,Ms=!1,_a=!1;function xg(e){mn===null?mn=[e]:mn.push(e)}function kS(e){Ms=!0,xg(e)}function er(){if(!_a&&mn!==null){_a=!0;var e=0,t=he;try{var n=mn;for(he=1;e>=l,i-=l,hn=1<<32-Ft(t)+i|n<_?(F=P,P=null):F=P.sibling;var M=p(y,P,x[_],C);if(M===null){P===null&&(P=F);break}e&&P&&M.alternate===null&&t(y,P),h=o(M,h,_),E===null?N=M:E.sibling=M,E=M,P=F}if(_===x.length)return n(y,P),Ee&&lr(y,_),N;if(P===null){for(;__?(F=P,P=null):F=P.sibling;var A=p(y,P,M.value,C);if(A===null){P===null&&(P=F);break}e&&P&&A.alternate===null&&t(y,P),h=o(A,h,_),E===null?N=A:E.sibling=A,E=A,P=F}if(M.done)return n(y,P),Ee&&lr(y,_),N;if(P===null){for(;!M.done;_++,M=x.next())M=c(y,M.value,C),M!==null&&(h=o(M,h,_),E===null?N=M:E.sibling=M,E=M);return Ee&&lr(y,_),N}for(P=r(y,P);!M.done;_++,M=x.next())M=m(P,y,_,M.value,C),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?_:M.key),h=o(M,h,_),E===null?N=M:E.sibling=M,E=M);return e&&P.forEach(function(R){return t(y,R)}),Ee&&lr(y,_),N}function S(y,h,x,C){if(typeof x=="object"&&x!==null&&x.type===Br&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Go:e:{for(var N=x.key,E=h;E!==null;){if(E.key===N){if(N=x.type,N===Br){if(E.tag===7){n(y,E.sibling),h=i(E,x.props.children),h.return=y,y=h;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===_n&&rp(N)===E.type){n(y,E.sibling),h=i(E,x.props),h.ref=Bi(y,E,x),h.return=y,y=h;break e}n(y,E);break}else t(y,E);E=E.sibling}x.type===Br?(h=hr(x.props.children,y.mode,C,x.key),h.return=y,y=h):(C=_l(x.type,x.key,x.props,null,y.mode,C),C.ref=Bi(y,h,x),C.return=y,y=C)}return l(y);case Fr:e:{for(E=x.key;h!==null;){if(h.key===E)if(h.tag===4&&h.stateNode.containerInfo===x.containerInfo&&h.stateNode.implementation===x.implementation){n(y,h.sibling),h=i(h,x.children||[]),h.return=y,y=h;break e}else{n(y,h);break}else t(y,h);h=h.sibling}h=za(x,y.mode,C),h.return=y,y=h}return l(y);case _n:return E=x._init,S(y,h,E(x._payload),C)}if(Qi(x))return w(y,h,x,C);if(Li(x))return v(y,h,x,C);il(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,h!==null&&h.tag===6?(n(y,h.sibling),h=i(h,x),h.return=y,y=h):(n(y,h),h=Da(x,y.mode,C),h.return=y,y=h),l(y)):n(y,h)}return S}var mi=Cg(!0),bg=Cg(!1),rs=Zn(null),is=null,Qr=null,sd=null;function ad(){sd=Qr=is=null}function ud(e){var t=rs.current;be(rs),e._currentValue=t}function Fu(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 ni(e,t){is=e,sd=Qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function jt(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},Qr===null){if(is===null)throw Error(z(308));Qr=e,is.dependencies={lanes:0,firstContext:e}}else Qr=Qr.next=e;return t}var cr=null;function cd(e){cr===null?cr=[e]:cr.push(e)}function Eg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,cd(t)):(n.next=i.next,i.next=n),t.interleaved=n,wn(e,r)}function wn(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 An=!1;function dd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ng(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 yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,wn(e,n)}return i=r.interleaved,i===null?(t.next=t,cd(r)):(t.next=i.next,i.next=t),r.interleaved=t,wn(e,n)}function bl(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,Xc(e,n)}}function ip(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function os(e,t,n,r){var i=e.updateQueue;An=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=a))}if(o!==null){var c=i.baseState;l=0,d=u=a=null,s=o;do{var p=s.lane,m=s.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,v=s;switch(p=t,m=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){c=w.call(m,c,p);break e}c=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,p=typeof w=="function"?w.call(m,c,p):w,p==null)break e;c=je({},c,p);break e;case 2:An=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else m={eventTime:m,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(u=d=m,a=c):d=d.next=m,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(d===null&&(a=c),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);xr|=l,e.lanes=l,e.memoizedState=c}}function op(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ra.transition;Ra.transition={};try{e(!1),t()}finally{he=n,Ra.transition=r}}function Vg(){return Tt().memoizedState}function NS(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hg(e))Wg(t,n);else if(n=Eg(e,t,n,r),n!==null){var i=qe();Bt(n,e,r,i),Kg(n,t,r)}}function PS(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hg(e))Wg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,Vt(s,l)){var a=t.interleaved;a===null?(i.next=i,cd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Eg(e,t,i,r),n!==null&&(i=qe(),Bt(n,e,r,i),Kg(n,t,r))}}function Hg(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function Wg(e,t){ro=ss=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xc(e,n)}}var as={readContext:jt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},jS={readContext:jt,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:sp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nl(4194308,4,zg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nl(4,2,e,t)},useMemo:function(e,t){var n=qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=NS.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:lp,useDebugValue:xd,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=lp(!1),t=e[0];return e=ES.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pe,i=qt();if(Ee){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Fe===null)throw Error(z(349));vr&30||_g(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,sp(Rg.bind(null,r,o,e),[e]),r.flags|=2048,Po(9,Ag.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=qt(),t=Fe.identifierPrefix;if(Ee){var n=gn,r=hn;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Eo++,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[Zt]=t,e[ko]=r,ny(e,t,!1,!1),t.stateNode=e;e:{switch(l=Su(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),i=r;break;case"iframe":case"object":case"embed":Ce("load",e),i=r;break;case"video":case"audio":for(i=0;iyi&&(t.flags|=128,r=!0,$i(o,!1),t.lanes=4194304)}else{if(!r)if(e=ls(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$i(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ee)return We(t),null}else 2*Re()-o.renderingStartTime>yi&&n!==1073741824&&(t.flags|=128,r=!0,$i(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Re(),t.sibling=null,n=Ne.current,xe(Ne,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return Ed(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function OS(e,t){switch(od(t),t.tag){case 1:return ot(t.type)&&Zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),be(it),be(Ge),md(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return pd(t),null;case 13:if(be(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Ne),null;case 4:return hi(),null;case 10:return ud(t.type._context),null;case 22:case 23:return Ed(),null;case 24:return null;default:return null}}var ll=!1,Ke=!1,DS=typeof WeakSet=="function"?WeakSet:Set,W=null;function Yr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Qu(e,t,n){try{n()}catch(r){Te(e,t,r)}}var vp=!1;function zS(e,t){if(Au=Yl,e=ug(),rd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,d=0,c=e,p=null;t:for(;;){for(var m;c!==n||i!==0&&c.nodeType!==3||(s=l+i),c!==o||r!==0&&c.nodeType!==3||(a=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(m=c.firstChild)!==null;)p=c,c=m;for(;;){if(c===e)break t;if(p===n&&++u===i&&(s=l),p===o&&++d===r&&(a=l),(m=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ru={focusedElem:e,selectionRange:n},Yl=!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 v=w.memoizedProps,S=w.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Mt(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=h}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){Te(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=vp,vp=!1,w}function io(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Qu(t,n,o)}i=i.next}while(i!==r)}}function Ds(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 Yu(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 oy(e){var t=e.alternate;t!==null&&(e.alternate=null,oy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[ko],delete t[Lu],delete t[wS],delete t[SS])),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 ly(e){return e.tag===5||e.tag===3||e.tag===4}function xp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ly(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 Xu(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=Jl));else if(r!==4&&(e=e.child,e!==null))for(Xu(e,t,n),e=e.sibling;e!==null;)Xu(e,t,n),e=e.sibling}function qu(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(qu(e,t,n),e=e.sibling;e!==null;)qu(e,t,n),e=e.sibling}var $e=null,Ot=!1;function Nn(e,t,n){for(n=n.child;n!==null;)sy(e,t,n),n=n.sibling}function sy(e,t,n){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Ts,n)}catch{}switch(n.tag){case 5:Ke||Yr(n,t);case 6:var r=$e,i=Ot;$e=null,Nn(e,t,n),$e=r,Ot=i,$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(Ot?(e=$e,n=n.stateNode,e.nodeType===8?Ta(e.parentNode,n):e.nodeType===1&&Ta(e,n),yo(e)):Ta($e,n.stateNode));break;case 4:r=$e,i=Ot,$e=n.stateNode.containerInfo,Ot=!0,Nn(e,t,n),$e=r,Ot=i;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Qu(n,t,l),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Ke&&(Yr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Te(n,t,s)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,Nn(e,t,n),Ke=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function wp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new DS),t.forEach(function(r){var i=GS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BS(r/1960))-r,10e?16:e,Ln===null)var r=!1;else{if(e=Ln,Ln=null,ds=0,de&6)throw Error(z(331));var i=de;for(de|=4,W=e.current;W!==null;){var o=W,l=o.child;if(W.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aRe()-Cd?mr(e,0):kd|=n),lt(e,t)}function hy(e,t){t===0&&(e.mode&1?(t=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):t=1);var n=qe();e=wn(e,t),e!==null&&(Lo(e,t,n),lt(e,n))}function KS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hy(e,n)}function GS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),hy(e,n)}var gy;gy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,MS(e,t,n);rt=!!(e.flags&131072)}else rt=!1,Ee&&t.flags&1048576&&wg(t,ns,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pl(e,t),e=t.pendingProps;var i=fi(t,Ge.current);ni(t,n),i=gd(null,t,r,e,i,n);var o=yd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)?(o=!0,es(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,dd(t),i.updater=Os,t.stateNode=i,i._reactInternals=t,$u(t,r,e,n),t=Hu(null,t,r,!0,o,n)):(t.tag=0,Ee&&o&&id(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=YS(r),e=Mt(r,e),i){case 0:t=Vu(null,t,r,e,n);break e;case 1:t=hp(null,t,r,e,n);break e;case 11:t=pp(null,t,r,e,n);break e;case 14:t=mp(null,t,r,Mt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),Vu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),hp(e,t,r,i,n);case 3:e:{if(Zg(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Ng(e,t),os(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=gi(Error(z(423)),t),t=gp(e,t,r,n,i);break e}else if(r!==i){i=gi(Error(z(424)),t),t=gp(e,t,r,n,i);break e}else for(mt=Bn(t.stateNode.containerInfo.firstChild),gt=t,Ee=!0,Dt=null,n=bg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pi(),r===i){t=Sn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return Pg(t),e===null&&zu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Iu(r,i)?l=null:o!==null&&Iu(r,o)&&(t.flags|=32),Jg(e,t),Xe(e,t,l,n),t.child;case 6:return e===null&&zu(t),null;case 13:return ey(e,t,n);case 4:return fd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mi(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),pp(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,xe(rs,r._currentValue),r._currentValue=l,o!==null)if(Vt(o.value,l)){if(o.children===i.children&&!it.current){t=Sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=yn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Fu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Fu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ni(t,n),i=jt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=Mt(r,t.pendingProps),i=Mt(r.type,i),mp(e,t,r,i,n);case 15:return Xg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),Pl(e,t),t.tag=1,ot(r)?(e=!0,es(t)):e=!1,ni(t,n),Gg(t,r,i),$u(t,r,i,n),Hu(null,t,r,!0,e,n);case 19:return ty(e,t,n);case 22:return qg(e,t,n)}throw Error(z(156,t.tag))};function yy(e,t){return Hh(e,t)}function QS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,r){return new QS(e,t,n,r)}function Pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YS(e){if(typeof e=="function")return Pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kc)return 11;if(e===Gc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function _l(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Pd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Br:return hr(n.children,i,o,t);case Wc:l=8,i|=8;break;case du:return e=Et(12,n,t,i|2),e.elementType=du,e.lanes=o,e;case fu:return e=Et(13,n,t,i),e.elementType=fu,e.lanes=o,e;case pu:return e=Et(19,n,t,i),e.elementType=pu,e.lanes=o,e;case Ph:return Fs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Eh:l=10;break e;case Nh:l=9;break e;case Kc:l=11;break e;case Gc:l=14;break e;case _n:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Et(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function hr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function Fs(e,t,n,r){return e=Et(22,e,r,t),e.elementType=Ph,e.lanes=n,e.stateNode={isHidden:!1},e}function Da(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function za(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=va(0),this.expirationTimes=va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jd(e,t,n,r,i,o,l,s,a){return e=new XS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Et(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dd(o),e}function qS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sy)}catch(e){console.error(e)}}Sy(),Sh.exports=xt;var Ei=Sh.exports;const nk=Ps(Ei);var jp=Ei;uu.createRoot=jp.createRoot,uu.hydrateRoot=jp.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 To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ky(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ik(){return Math.random().toString(36).substr(2,8)}function _p(e,t){return{usr:e.state,key:e.key,idx:t}}function nc(e,t,n,r){return n===void 0&&(n=null),To({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ni(t):t,{state:n,key:t&&t.key||r||ik()})}function ms(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 Ni(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 ok(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=On.Pop,a=null,u=d();u==null&&(u=0,l.replaceState(To({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function c(){s=On.Pop;let S=d(),y=S==null?null:S-u;u=S,a&&a({action:s,location:v.location,delta:y})}function p(S,y){s=On.Push;let h=nc(v.location,S,y);n&&n(h,S),u=d()+1;let x=_p(h,u),C=v.createHref(h);try{l.pushState(x,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(C)}o&&a&&a({action:s,location:v.location,delta:1})}function m(S,y){s=On.Replace;let h=nc(v.location,S,y);n&&n(h,S),u=d();let x=_p(h,u),C=v.createHref(h);l.replaceState(x,"",C),o&&a&&a({action:s,location:v.location,delta:0})}function w(S){let y=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:ms(S);return h=h.replace(/ $/,"%20"),Le(y,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,y)}let v={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(Tp,c),a=S,()=>{i.removeEventListener(Tp,c),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let y=w(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(S){return l.go(S)}};return v}var Ap;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ap||(Ap={}));function lk(e,t,n){return n===void 0&&(n="/"),sk(e,t,n,!1)}function sk(e,t,n,r){let i=typeof t=="string"?Ni(t):t,o=Rd(i.pathname||"/",n);if(o==null)return null;let l=Cy(e);ak(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Le(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=Wn([r,a.relativePath]),d=n.concat(a);o.children&&o.children.length>0&&(Le(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Cy(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:hk(u,o.index),routesMeta:d})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of by(o.path))i(o,l,a)}),t}function by(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=by(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function ak(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uk=/^:[\w-]+$/,ck=3,dk=2,fk=1,pk=10,mk=-2,Rp=e=>e==="*";function hk(e,t){let n=e.split("/"),r=n.length;return n.some(Rp)&&(r+=mk),t&&(r+=dk),n.filter(i=>!Rp(i)).reduce((i,o)=>i+(uk.test(o)?ck:o===""?fk:pk),r)}function gk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function yk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:p,isOptional:m}=d;if(p==="*"){let v=s[c]||"";l=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const w=s[c];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function vk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ky(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function xk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ky(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Rd(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function wk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ni(e):e;return{pathname:n?n.startsWith("/")?n:Sk(n,t):t,search:bk(r),hash:Ek(i)}}function Sk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Fa(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 kk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ey(e,t){let n=kk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ny(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ni(e):(i=To({},e),Le(!i.pathname||!i.pathname.includes("?"),Fa("?","pathname","search",i)),Le(!i.pathname||!i.pathname.includes("#"),Fa("#","pathname","hash",i)),Le(!i.search||!i.search.includes("#"),Fa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.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;i.pathname=p.join("/")}s=c>=0?t[c]:"/"}let a=wk(i,s),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||d)&&(a.pathname+="/"),a}const Wn=e=>e.join("/").replace(/\/\/+/g,"/"),Ck=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ek=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Nk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Py=["post","put","patch","delete"];new Set(Py);const Pk=["get",...Py];new Set(Pk);/** + * 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 _o(){return _o=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=Ny(u,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Wn([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,l,o,e])}const Ak=g.createContext(null);function Rk(e){let t=g.useContext(tr).outlet;return t&&g.createElement(Ak.Provider,{value:e},t)}function _y(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Pr),{matches:i}=g.useContext(tr),{pathname:o}=Bo(),l=JSON.stringify(Ey(i,r.v7_relativeSplatPath));return g.useMemo(()=>Ny(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Ik(e,t){return Mk(e,t)}function Mk(e,t,n,r){Fo()||Le(!1);let{navigator:i}=g.useContext(Pr),{matches:o}=g.useContext(tr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Bo(),d;if(t){var c;let S=typeof t=="string"?Ni(t):t;a==="/"||(c=S.pathname)!=null&&c.startsWith(a)||Le(!1),d=S}else d=u;let p=d.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=lk(e,{pathname:m}),v=Fk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Wn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Wn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&v?g.createElement(Hs.Provider,{value:{location:_o({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:On.Pop}},v):v}function Lk(){let e=Vk(),t=Nk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,o)}const Ok=g.createElement(Lk,null);class Dk 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(tr.Provider,{value:this.props.routeContext},g.createElement(jy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function zk(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Id);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(tr.Provider,{value:t},r)}function Fk(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let d=l.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);d>=0||Le(!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 m,w=!1,v=null,S=null;n&&(m=s&&c.route.id?s[c.route.id]:void 0,v=c.route.errorElement||Ok,a&&(u<0&&p===0?(Wk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=c.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),h=()=>{let x;return m?x=v:w?x=S:c.route.Component?x=g.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=d,g.createElement(zk,{match:c,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?g.createElement(Dk,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:h(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):h()},null)}var Ay=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ay||{}),hs=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}(hs||{});function Bk(e){let t=g.useContext(Id);return t||Le(!1),t}function $k(e){let t=g.useContext(jk);return t||Le(!1),t}function Uk(e){let t=g.useContext(tr);return t||Le(!1),t}function Ry(e){let t=Uk(),n=t.matches[t.matches.length-1];return n.route.id||Le(!1),n.route.id}function Vk(){var e;let t=g.useContext(jy),n=$k(hs.UseRouteError),r=Ry(hs.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Hk(){let{router:e}=Bk(Ay.UseNavigateStable),t=Ry(hs.UseNavigateStable),n=g.useRef(!1);return Ty(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_o({fromRouteId:t},o)))},[e,t])}const Mp={};function Wk(e,t,n){!t&&!Mp[e]&&(Mp[e]=!0)}function Kk(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 Gk(e){return Rk(e.context)}function zr(e){Le(!1)}function Qk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=On.Pop,navigator:o,static:l=!1,future:s}=e;Fo()&&Le(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:o,static:l,future:_o({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Ni(r));let{pathname:d="/",search:c="",hash:p="",state:m=null,key:w="default"}=r,v=g.useMemo(()=>{let S=Rd(d,a);return S==null?null:{location:{pathname:S,search:c,hash:p,state:m,key:w},navigationType:i}},[a,d,c,p,m,w,i]);return v==null?null:g.createElement(Pr.Provider,{value:u},g.createElement(Hs.Provider,{children:n,value:v}))}function Yk(e){let{children:t,location:n}=e;return Ik(rc(t),n)}new Promise(()=>{});function rc(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let o=[...t,i];if(r.type===g.Fragment){n.push.apply(n,rc(r.props.children,o));return}r.type!==zr&&Le(!1),!r.props.index||!r.props.children||Le(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=rc(r.props.children,o)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ic(){return ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function qk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Jk(e,t){return e.button===0&&(!t||t==="_self")&&!qk(e)}const Zk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],eC="6";try{window.__reactRouterVersion=eC}catch{}const tC="startTransition",Lp=$c[tC];function nC(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=rk({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=g.useCallback(c=>{u&&Lp?Lp(()=>a(c)):a(c)},[a,u]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>Kk(r),[r]),g.createElement(Qk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const rC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",iC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oC=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:d,viewTransition:c}=t,p=Xk(t,Zk),{basename:m}=g.useContext(Pr),w,v=!1;if(typeof u=="string"&&iC.test(u)&&(w=u,rC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=Rd(C.pathname,m);C.origin===x.origin&&N!=null?u=N+C.search+C.hash:v=!0}catch{}let S=Tk(u,{relative:i}),y=lC(u,{replace:l,state:s,target:a,preventScrollReset:d,relative:i,viewTransition:c});function h(x){r&&r(x),x.defaultPrevented||y(x)}return g.createElement("a",ic({},p,{href:w||S,onClick:v||o?r:h,ref:n,target:a}))});var Op;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Op||(Op={}));var Dp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dp||(Dp={}));function lC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Md(),u=Bo(),d=_y(e,{relative:l});return g.useCallback(c=>{if(Jk(c,n)){c.preventDefault();let p=r!==void 0?r:ms(u)===ms(d);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,d,r,i,n,e,o,l,s])}function Iy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var Dy="!";function mC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,d,c=0;cu?d-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:S}}}function hC(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var i=r[0]==="[";i?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function gC(e){return{cache:pC(e.cacheSize),splitModifiers:mC(e),...aC(e)}}var yC=/\s+/;function vC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(yC).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),m=!!c;if(!p){if(!c)return{isTailwindClass:!1,originalClassName:l};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=hC(a).join(":"),v=u?w+Dy:w;return{isTailwindClass:!0,modifierId:v,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,d=s+a;return o.has(d)?!1:(o.add(d),i(a,u).forEach(function(c){return o.add(s+c)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function xC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),$p=e=>{const t=OC(e);return t.charAt(0).toUpperCase()+t.slice(1)},By=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),DC=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 zC={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 FC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...zC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:By("lucide",i),...!o&&!DC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ie=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(FC,{ref:o,iconNode:t,className:By(`lucide-${LC($p(e))}`,`lucide-${e}`,r),...i}));return n.displayName=$p(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 BC=[["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"}]],$C=ie("award",BC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UC=[["path",{d:"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"}]],$y=ie("book-open",UC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],HC=ie("bookmark",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WC=[["path",{d:"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"}]],qr=ie("bot",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KC=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],vi=ie("brain",KC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],QC=ie("check",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uy=ie("chevron-down",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Up=ie("chevron-left",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vp=ie("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],ZC=ie("chevron-up",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],tb=ie("circle-check-big",eb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],gs=ie("cloud",nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Vy=ie("crown",rb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["path",{d:"M12 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"}]],ob=ie("download",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:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sb=ie("eye",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 ab=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Hy=ie("hard-drive",ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["path",{d:"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"}]],cb=ie("heart",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const db=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],fb=ie("house",db);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Wy=ie("info",pb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sc=ie("loader-circle",mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ws=ie("message-square",hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ys=ie("plus",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=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ky=ie("save",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 vb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hp=ie("search",vb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["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"}]],wb=ie("send",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 Sb=[["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"}]],kb=ie("server",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:"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"}]],ii=ie("settings",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:"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"}]],Wp=ie("shield",bb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eb=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],Nb=ie("sliders-vertical",Eb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],jb=ie("square",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 Tb=[["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"}]],_b=ie("star",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 Ab=[["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"}]],Gy=ie("trash-2",Ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Qy=ie("trending-up",Rb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ib=[["path",{d:"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"}]],Yy=ie("user",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 Mb=[["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"}]],Lb=ie("users",Mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ob=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Db=ie("x",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 zb=[["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"}]],ac=ie("zap",zb),Fb=[{name:"Templates",href:"/",icon:fb,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:Ws,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:$y,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:ii,description:"Application settings"}];function Bb(){const e=Bo();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(vi,{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:Fb.map(t=>{const n=e.pathname===t.href;return f.jsxs(oC,{to:t.href,className:ae("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 $b(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(Bb,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(Gk,{})})]})}const Kp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gp=My,Od=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Gp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=o==null?void 0:o[u];if(d===null)return null;const p=Kp(d)||Kp(c);return i[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,...m}=d;return Object.entries(m).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...o,...s}[v]):{...o,...s}[v]===S})?[...u,c,p]:u},[]);return Gp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Ub=Od("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...n}){return f.jsx("div",{className:ae(Ub({variant:t}),e),...n})}function Qp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Qp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=g.Children.toArray(o),a=s.find(Kb);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,d):null})}return f.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Vb=xi("Slot");function Hb(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=Qb(i),s=Gb(o,i.props);return i.type!==g.Fragment&&(s.ref=r?Xy(r,l):l),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qy=Symbol("radix.slottable");function Wb(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=qy,t}function Kb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qy}function Gb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Qb(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Dd=Od("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"}}),Ae=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Vb:"button";return f.jsx(l,{className:ae(Dd({variant:t,size:n,className:e})),ref:o,...i})});Ae.displayName="Button";const st=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ae("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));st.displayName="Card";const $t=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ae("flex flex-col space-y-1.5 p-6",e),...t}));$t.displayName="CardHeader";const Ut=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:ae("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ut.displayName="CardTitle";const Yb=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));Yb.displayName="CardDescription";const Pt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ae("p-6 pt-0",e),...t}));Pt.displayName="CardContent";const Xb=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ae("flex items-center p-6 pt-0",e),...t}));Xb.displayName="CardFooter";const Jy=g.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{type:t,className:ae("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Jy.displayName="Input";function qb(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions. Helps identify bugs, security issues, and performance optimizations.",author:"EdgeLLM Team",category:"Developer Tools",tags:["code review","programming","debugging"],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",icon:"🔍",usageCount:1247,rating:4.8},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements. Perfect for essays, articles, and professional documents.",author:"Community",category:"Writing",tags:["writing","editing","grammar"],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",icon:"📝",usageCount:892,rating:4.6},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters. Great for fiction writers and storytellers.",author:"Community",category:"Writing",tags:["creative","storytelling","fiction"],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",icon:"✨",usageCount:634,rating:4.7},{id:"data-analyst",name:"Data Analysis Expert",description:"Helps analyze data patterns, create insights, and generate comprehensive reports with statistical analysis.",author:"EdgeLLM Team",category:"Data & Analytics",tags:["data","analytics","statistics"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a data analysis expert. Help users understand data patterns, create visualizations, and provide statistical insights.",temperature:.2,maxTokens:1200,isOfficial:!0,createdAt:"2024-01-18",icon:"📊",usageCount:567,rating:4.9},{id:"language-tutor",name:"Language Learning Tutor",description:"Interactive language tutor for vocabulary, grammar, and conversation practice. Supports multiple languages.",author:"Community",category:"Education",tags:["language","learning","education"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a friendly language tutor. Help users learn languages through interactive exercises, explanations, and conversation practice.",temperature:.6,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"🌐",usageCount:423,rating:4.5},{id:"business-advisor",name:"Business Strategy Advisor",description:"Provides strategic business advice, market analysis, and growth recommendations for entrepreneurs and businesses.",author:"EdgeLLM Team",category:"Business",tags:["strategy","business","consulting"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a business strategy consultant. Provide strategic advice, market insights, and growth recommendations based on business principles.",temperature:.4,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-22",icon:"💼",usageCount:789,rating:4.7},{id:"research-assistant",name:"Research Assistant",description:"Helps with academic and professional research, source analysis, and comprehensive report writing.",author:"Community",category:"Research",tags:["research","academic","analysis"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a research assistant. Help users conduct thorough research, analyze sources, and organize findings into comprehensive reports.",temperature:.3,maxTokens:1200,isOfficial:!1,createdAt:"2024-01-25",icon:"📚",usageCount:356,rating:4.4},{id:"math-tutor",name:"Math & Science Tutor",description:"Expert tutor for mathematics, physics, chemistry, and other STEM subjects with step-by-step explanations.",author:"EdgeLLM Team",category:"Education",tags:["math","science","tutoring"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a math and science tutor. Provide clear, step-by-step explanations for mathematical and scientific concepts.",temperature:.2,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-28",icon:"🔬",usageCount:678,rating:4.8}]}function Jb(){const e=Md(),[t,n]=g.useState(!1),[r]=g.useState(qb()),[i,o]=g.useState([]),[l,s]=g.useState(""),[a,u]=g.useState("All");g.useEffect(()=>{d(),c()},[]);const d=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,x=await fetch(`${h}/models`);n(x.ok)}catch{n(!1)}},c=()=>{try{const h=JSON.parse(localStorage.getItem("likedTemplates")||"[]");o(h)}catch(h){console.error("Failed to load liked templates:",h)}},p=h=>{const x=i.includes(h)?i.filter(C=>C!==h):[...i,h];o(x),localStorage.setItem("likedTemplates",JSON.stringify(x))},m=h=>{const x={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),e("/playground")},w=r.filter(h=>{const x=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(N=>N.toLowerCase().includes(l.toLowerCase())),C=a==="All"||h.category===a;return x&&C}),v=w.filter(h=>h.isOfficial),S=[...w].sort((h,x)=>x.usageCount-h.usageCount).slice(0,6),y=["All",...Array.from(new Set(r.map(h=>h.category)))];return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-4",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(vi,{className:"h-5 w-5 text-white"})}),f.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),f.jsx(me,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),f.jsxs(Ae,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(qr,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),f.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),f.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),f.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[f.jsx(Hp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),f.jsx(Jy,{type:"text",placeholder:"Search assistants...",value:l,onChange:h=>s(h.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),f.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:y.map(h=>f.jsx(Ae,{variant:a===h?"default":"outline",size:"sm",onClick:()=>u(h),className:"rounded-full",children:h},h))})]}),a==="All"&&v.length>0&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(Vy,{className:"h-5 w-5 text-yellow-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),f.jsx(me,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:v.slice(0,3).map(h=>f.jsx(Ba,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),a==="All"&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(Qy,{className:"h-5 w-5 text-green-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),f.jsx(me,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>f.jsx(Ba,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(Lb,{className:"h-5 w-5 text-blue-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),f.jsxs(me,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>f.jsx(Ba,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):f.jsx(st,{className:"p-12 text-center",children:f.jsxs("div",{className:"flex flex-col items-center gap-4",children:[f.jsx(Hp,{className:"h-12 w-12 text-gray-400"}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),f.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),f.jsx(Ae,{variant:"outline",onClick:()=>{s(""),u("All")},children:"Clear filters"})]})})]})]})]})}function Ba({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return f.jsxs(st,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&f.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[f.jsx(Vy,{className:"h-3 w-3"}),"Featured"]}),o&&f.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[f.jsx(Qy,{className:"h-3 w-3"}),"Trending"]}),f.jsx($t,{className:"pb-4",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),f.jsxs("div",{children:[f.jsx(Ut,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&f.jsxs(me,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[f.jsx($C,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),f.jsx(Ae,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:f.jsx(cb,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(Pt,{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),f.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>f.jsx(me,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),f.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(sb,{className:"h-4 w-4"}),f.jsx("span",{children:e.usageCount.toLocaleString()})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(_b,{className:"h-4 w-4 text-yellow-500 fill-current"}),f.jsx("span",{children:e.rating})]})]}),f.jsx(me,{variant:"outline",className:"text-xs",children:e.category})]}),f.jsx("div",{className:"pt-2",children:f.jsxs(Ae,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[f.jsx(Ws,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Zb(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,a=g.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function nr(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=c=>{var y;const{scope:p,children:m,...w}=c,v=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,S=g.useMemo(()=>w,Object.values(w));return f.jsx(v.Provider,{value:S,children:m})};u.displayName=o+"Provider";function d(c,p){var v;const m=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,d]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,eE(i,...t)]}function eE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(o)[`__scope${u}`];return{...s,...c}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function zd(e){const t=e+"CollectionProvider",[n,r]=nr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:S,children:y}=v,h=Lt.useRef(null),x=Lt.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:x,collectionRef:h,children:y})};l.displayName=t;const s=e+"CollectionSlot",a=xi(s),u=Lt.forwardRef((v,S)=>{const{scope:y,children:h}=v,x=o(s,y),C=pe(S,x.collectionRef);return f.jsx(a,{ref:C,children:h})});u.displayName=s;const d=e+"CollectionItemSlot",c="data-radix-collection-item",p=xi(d),m=Lt.forwardRef((v,S)=>{const{scope:y,children:h,...x}=v,C=Lt.useRef(null),N=pe(S,C),E=o(d,y);return Lt.useEffect(()=>(E.itemMap.set(C,{ref:C,...x}),()=>void E.itemMap.delete(C))),f.jsx(p,{[c]:"",ref:N,children:h})});m.displayName=d;function w(v){const S=o(e+"CollectionConsumer",v);return Lt.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const x=Array.from(h.querySelectorAll(`[${c}]`));return Array.from(S.itemMap.values()).sort((E,P)=>x.indexOf(E.ref.current)-x.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},w,r]}var Qe=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},tE=$c[" useId ".trim().toString()]||(()=>{}),nE=0;function Kn(e){const[t,n]=g.useState(tE());return Qe(()=>{e||n(r=>r??String(nE++))},[e]),e||(t?`radix-${t}`:"")}var rE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=rE.reduce((e,t)=>{const n=xi(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iE(e,t){e&&Ei.flushSync(()=>e.dispatchEvent(t))}function Yn(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 oE=$c[" useInsertionEffect ".trim().toString()]||Qe;function wi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=lE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{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=sE(d)?d(e):d;p!==e&&((c=l.current)==null||c.call(l,p))}else o(d)},[s,e,o,l]);return[a,u]}function lE({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return oE(()=>{o.current=t},[t]),g.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function sE(e){return typeof e=="function"}var aE=g.createContext(void 0);function Ks(e){const t=g.useContext(aE);return e||t||"ltr"}var $a="rovingFocusGroup.onEntryFocus",uE={bubbles:!1,cancelable:!0},$o="RovingFocusGroup",[uc,Zy,cE]=zd($o),[dE,ev]=nr($o,[cE]),[fE,pE]=dE($o),tv=g.forwardRef((e,t)=>f.jsx(uc.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(uc.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(mE,{...e,ref:t})})}));tv.displayName=$o;var mE=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,p=g.useRef(null),m=pe(t,p),w=Ks(o),[v,S]=wi({prop:l,defaultProp:s??null,onChange:a,caller:$o}),[y,h]=g.useState(!1),x=Yn(u),C=Zy(n),N=g.useRef(!1),[E,P]=g.useState(0);return g.useEffect(()=>{const _=p.current;if(_)return _.addEventListener($a,x),()=>_.removeEventListener($a,x)},[x]),f.jsx(fE,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:v,onItemFocus:g.useCallback(_=>S(_),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(_=>_+1),[]),onFocusableItemRemove:g.useCallback(()=>P(_=>_-1),[]),children:f.jsx(ne.div,{tabIndex:y||E===0?-1:0,"data-orientation":r,...c,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{N.current=!0}),onFocus:Z(e.onFocus,_=>{const F=!N.current;if(_.target===_.currentTarget&&F&&!y){const M=new CustomEvent($a,uE);if(_.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=C().filter(L=>L.focusable),R=A.find(L=>L.active),U=A.find(L=>L.id===v),O=[R,U,...A].filter(Boolean).map(L=>L.ref.current);iv(O,d)}}N.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),nv="RovingFocusGroupItem",rv=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=Kn(),u=o||a,d=pE(nv,n),c=d.currentTabStopId===u,p=Zy(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:v}=d;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),f.jsx(uc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:f.jsx(ne.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?d.onItemFocus(u):S.preventDefault()}),onFocus:Z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=yE(S,d.orientation,d.dir);if(y!==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(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=d.loop?vE(x,C+1):x.slice(C+1)}setTimeout(()=>iv(x))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:v!=null}):l})})});rv.displayName=nv;var hE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yE(e,t,n){const r=gE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hE[r]}function iv(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xE=tv,wE=rv;function SE(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Uo=e=>{const{present:t,children:n}=e,r=kE(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=pe(r.ref,CE(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Uo.displayName="Presence";function kE(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=SE(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=cl(r.current);o.current=s==="mounted"?u:"none"},[s]),Qe(()=>{const u=r.current,d=i.current;if(d!==e){const p=o.current,m=cl(u);e?a("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Qe(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=m=>{const v=cl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=cl(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 cl(e){return(e==null?void 0:e.animationName)||"none"}function CE(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gs="Tabs",[bE,wI]=nr(Gs,[ev]),ov=ev(),[EE,Fd]=bE(Gs),lv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,d=Ks(s),[c,p]=wi({prop:r,onChange:i,defaultProp:o??"",caller:Gs});return f.jsx(EE,{scope:n,baseId:Kn(),value:c,onValueChange:p,orientation:l,dir:d,activationMode:a,children:f.jsx(ne.div,{dir:d,"data-orientation":l,...u,ref:t})})});lv.displayName=Gs;var sv="TabsList",av=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Fd(sv,n),l=ov(n);return f.jsx(xE,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:f.jsx(ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});av.displayName=sv;var uv="TabsTrigger",cv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Fd(uv,n),s=ov(n),a=pv(l.baseId,r),u=mv(l.baseId,r),d=r===l.value;return f.jsx(wE,{asChild:!0,...s,focusable:!i,active:d,children:f.jsx(ne.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:Z(e.onMouseDown,c=>{!i&&c.button===0&&c.ctrlKey===!1?l.onValueChange(r):c.preventDefault()}),onKeyDown:Z(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const c=l.activationMode!=="manual";!d&&!i&&c&&l.onValueChange(r)})})})});cv.displayName=uv;var dv="TabsContent",fv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Fd(dv,n),a=pv(s.baseId,r),u=mv(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(Uo,{present:i||d,children:({present:p})=>f.jsx(ne.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:p&&o})})});fv.displayName=dv;function pv(e,t){return`${e}-trigger-${t}`}function mv(e,t){return`${e}-content-${t}`}var NE=lv,hv=av,gv=cv,yv=fv;const PE=NE,vv=g.forwardRef(({className:e,...t},n)=>f.jsx(hv,{ref:n,className:ae("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));vv.displayName=hv.displayName;const cc=g.forwardRef(({className:e,...t},n)=>f.jsx(gv,{ref:n,className:ae("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}));cc.displayName=gv.displayName;const dc=g.forwardRef(({className:e,...t},n)=>f.jsx(yv,{ref:n,className:ae("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));dc.displayName=yv.displayName;function vs(e,[t,n]){return Math.min(n,Math.max(t,e))}function xv(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 wv(e){const[t,n]=g.useState(void 0);return Qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,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 Sv=["PageUp","PageDown"],kv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Cv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pi="Slider",[fc,jE,TE]=zd(Pi),[bv,SI]=nr(Pi,[TE]),[_E,Qs]=bv(Pi),Ev=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:d,onValueChange:c=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...v}=e,S=g.useRef(new Set),y=g.useRef(0),x=l==="horizontal"?AE:RE,[C=[],N]=wi({prop:d,defaultProp:u,onChange:A=>{var U;(U=[...S.current][y.current])==null||U.focus(),c(A)}}),E=g.useRef(C);function P(A){const R=DE(C,A);M(A,R)}function _(A){M(A,y.current)}function F(){const A=E.current[y.current];C[y.current]!==A&&p(C)}function M(A,R,{commit:U}={commit:!1}){const H=$E(o),O=UE(Math.round((A-r)/o)*o+r,H),L=vs(O,[r,i]);N((D=[])=>{const T=LE(D,L,R);if(BE(T,a*o)){y.current=T.indexOf(L);const B=String(T)!==String(D);return B&&U&&p(T),B?T:D}else return D})}return f.jsx(_E,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:S.current,values:C,orientation:l,form:w,children:f.jsx(fc.Provider,{scope:e.__scopeSlider,children:f.jsx(fc.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:t,onPointerDown:Z(v.onPointerDown,()=>{s||(E.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:P,onSlideMove:s?void 0:_,onSlideEnd:s?void 0:F,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,C.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:R})=>{if(!s){const O=Sv.includes(A.key)||A.shiftKey&&kv.includes(A.key)?10:1,L=y.current,D=C[L],T=o*O*R;M(D+T,L,{commit:!0})}}})})})})});Ev.displayName=Pi;var[Nv,Pv]=bv(Pi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),AE=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...d}=e,[c,p]=g.useState(null),m=pe(t,x=>p(x)),w=g.useRef(void 0),v=Ks(i),S=v==="ltr",y=S&&!o||!S&&o;function h(x){const C=w.current||c.getBoundingClientRect(),N=[0,C.width],P=Bd(N,y?[n,r]:[r,n]);return w.current=C,P(x-C.left)}return f.jsx(Nv,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:f.jsx(jv,{dir:v,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=h(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=h(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=Cv[y?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),RE=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,d=g.useRef(null),c=pe(t,d),p=g.useRef(void 0),m=!i;function w(v){const S=p.current||d.current.getBoundingClientRect(),y=[0,S.height],x=Bd(y,m?[r,n]:[n,r]);return p.current=S,x(v-S.top)}return f.jsx(Nv,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:f.jsx(jv,{"data-orientation":"vertical",...u,ref:c,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=w(v.clientY);o==null||o(S)},onSlideMove:v=>{const S=w(v.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:v=>{const y=Cv[m?"from-bottom":"from-top"].includes(v.key);a==null||a({event:v,direction:y?-1:1})}})})}),jv=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,d=Qs(Pi,n);return f.jsx(ne.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):Sv.concat(kv).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:Z(e.onPointerDown,c=>{const p=c.target;p.setPointerCapture(c.pointerId),c.preventDefault(),d.thumbs.has(p)?p.focus():r(c)}),onPointerMove:Z(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&i(c)}),onPointerUp:Z(e.onPointerUp,c=>{const p=c.target;p.hasPointerCapture(c.pointerId)&&(p.releasePointerCapture(c.pointerId),o(c))})})}),Tv="SliderTrack",_v=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Qs(Tv,n);return f.jsx(ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});_v.displayName=Tv;var pc="SliderRange",Av=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Qs(pc,n),o=Pv(pc,n),l=g.useRef(null),s=pe(t,l),a=i.values.length,u=i.values.map(p=>Mv(p,i.min,i.max)),d=a>1?Math.min(...u):0,c=100-Math.max(...u);return f.jsx(ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:c+"%"}})});Av.displayName=pc;var mc="SliderThumb",Rv=g.forwardRef((e,t)=>{const n=jE(e.__scopeSlider),[r,i]=g.useState(null),o=pe(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(IE,{...e,ref:o,index:l})}),IE=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Qs(mc,n),s=Pv(mc,n),[a,u]=g.useState(null),d=pe(t,h=>u(h)),c=a?l.form||!!a.closest("form"):!0,p=wv(a),m=l.values[r],w=m===void 0?0:Mv(m,l.min,l.max),v=OE(r,l.values.length),S=p==null?void 0:p[s.size],y=S?zE(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}% + ${y}px)`},children:[f.jsx(fc.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),c&&f.jsx(Iv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});Rv.displayName=mc;var ME="RadioBubbleInput",Iv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=pe(i,r),l=xv(t);return g.useEffect(()=>{const s=i.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(ne.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Iv.displayName=ME;function LE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function Mv(e,t,n){const o=100/(n-t)*(e-t);return vs(o,[0,100])}function OE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function DE(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function zE(e,t,n){const r=e/2,o=Bd([0,50],[0,r]);return(r-o(t)*n)*n}function FE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function BE(e,t){if(t>0){const n=FE(e);return Math.min(...n)>=t}return!0}function Bd(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 $E(e){return(String(e).split(".")[1]||"").length}function UE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Lv=Ev,VE=_v,HE=Av,WE=Rv;const hc=g.forwardRef(({className:e,...t},n)=>f.jsxs(Lv,{ref:n,className:ae("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(VE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(HE,{className:"absolute h-full bg-primary"})}),f.jsx(WE,{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"})]}));hc.displayName=Lv.displayName;var KE="Label",Ov=g.forwardRef((e,t)=>f.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ov.displayName=KE;var Dv=Ov;const GE=Od("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zt=g.forwardRef(({className:e,...t},n)=>f.jsx(Dv,{ref:n,className:ae(GE(),e),...t}));zt.displayName=Dv.displayName;function QE(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var YE="DismissableLayer",gc="dismissableLayer.update",XE="dismissableLayer.pointerDownOutside",qE="dismissableLayer.focusOutside",Yp,zv=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$d=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(zv),[d,c]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=pe(t,P=>c(P)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(S),h=d?v.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=y,N=eN(P=>{const _=P.target,F=[...u.branches].some(M=>M.contains(_));!C||F||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},p),E=tN(P=>{const _=P.target;[...u.branches].some(M=>M.contains(_))||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},p);return QE(P=>{h===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Xp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yp)}},[d,p,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Xp())},[d,u]),g.useEffect(()=>{const P=()=>m({});return document.addEventListener(gc,P),()=>document.removeEventListener(gc,P)},[]),f.jsx(ne.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,N.onPointerDownCapture)})});$d.displayName=YE;var JE="DismissableLayerBranch",ZE=g.forwardRef((e,t)=>{const n=g.useContext(zv),r=g.useRef(null),i=pe(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(ne.div,{...e,ref:i})});ZE.displayName=JE;function eN(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Fv(XE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tN(e,t=globalThis==null?void 0:globalThis.document){const n=Yn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Fv(qE,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Xp(){const e=new CustomEvent(gc);document.dispatchEvent(e)}function Fv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?iE(i,o):i.dispatchEvent(o)}var Ua=0;function Bv(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qp()),document.body.insertAdjacentElement("beforeend",e[1]??qp()),Ua++,()=>{Ua===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ua--}},[])}function qp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Va="focusScope.autoFocusOnMount",Ha="focusScope.autoFocusOnUnmount",Jp={bubbles:!1,cancelable:!0},nN="FocusScope",Ud=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=g.useState(null),u=Yn(i),d=Yn(o),c=g.useRef(null),p=pe(t,v=>a(v)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let v=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?c.current=C:Tn(c.current,{select:!0})},S=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Tn(c.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Tn(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const h=new MutationObserver(y);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),h.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){em.add(m);const v=document.activeElement;if(!s.contains(v)){const y=new CustomEvent(Va,Jp);s.addEventListener(Va,u),s.dispatchEvent(y),y.defaultPrevented||(rN(aN($v(s)),{select:!0}),document.activeElement===v&&Tn(s))}return()=>{s.removeEventListener(Va,u),setTimeout(()=>{const y=new CustomEvent(Ha,Jp);s.addEventListener(Ha,d),s.dispatchEvent(y),y.defaultPrevented||Tn(v??document.body,{select:!0}),s.removeEventListener(Ha,d),em.remove(m)},0)}}},[s,u,d,m]);const w=g.useCallback(v=>{if(!n&&!r||m.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(S&&y){const h=v.currentTarget,[x,C]=iN(h);x&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&Tn(x,{select:!0})):v.shiftKey&&y===x&&(v.preventDefault(),n&&Tn(C,{select:!0})):y===h&&v.preventDefault()}},[n,r,m.paused]);return f.jsx(ne.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Ud.displayName=nN;function rN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tn(r,{select:t}),document.activeElement!==n)return}function iN(e){const t=$v(e),n=Zp(t,e),r=Zp(t.reverse(),e);return[n,r]}function $v(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zp(e,t){for(const n of e)if(!oN(n,{upTo:t}))return n}function oN(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 lN(e){return e instanceof HTMLInputElement&&"select"in e}function Tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&lN(e)&&t&&e.select()}}var em=sN();function sN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tm(e,t),e.unshift(t)},remove(t){var n;e=tm(e,t),(n=e[0])==null||n.resume()}}}function tm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function aN(e){return e.filter(t=>t.tagName!=="A")}const uN=["top","right","bottom","left"],Xn=Math.min,pt=Math.max,xs=Math.round,dl=Math.floor,ln=e=>({x:e,y:e}),cN={left:"right",right:"left",bottom:"top",top:"bottom"},dN={start:"end",end:"start"};function yc(e,t,n){return pt(e,Xn(t,n))}function kn(e,t){return typeof e=="function"?e(t):e}function Cn(e){return e.split("-")[0]}function ji(e){return e.split("-")[1]}function Vd(e){return e==="x"?"y":"x"}function Hd(e){return e==="y"?"height":"width"}const fN=new Set(["top","bottom"]);function nn(e){return fN.has(Cn(e))?"y":"x"}function Wd(e){return Vd(nn(e))}function pN(e,t,n){n===void 0&&(n=!1);const r=ji(e),i=Wd(e),o=Hd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ws(l)),[l,ws(l)]}function mN(e){const t=ws(e);return[vc(e),t,vc(t)]}function vc(e){return e.replace(/start|end/g,t=>dN[t])}const nm=["left","right"],rm=["right","left"],hN=["top","bottom"],gN=["bottom","top"];function yN(e,t,n){switch(e){case"top":case"bottom":return n?t?rm:nm:t?nm:rm;case"left":case"right":return t?hN:gN;default:return[]}}function vN(e,t,n,r){const i=ji(e);let o=yN(Cn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(vc)))),o}function ws(e){return e.replace(/left|right|bottom|top/g,t=>cN[t])}function xN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uv(e){return typeof e!="number"?xN(e):{top:e,right:e,bottom:e,left:e}}function Ss(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function im(e,t,n){let{reference:r,floating:i}=e;const o=nn(t),l=Wd(t),s=Hd(l),a=Cn(t),u=o==="y",d=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(a){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:c};break;case"left":m={x:r.x-i.width,y:c};break;default:m={x:r.x,y:r.y}}switch(ji(t)){case"start":m[l]-=p*(n&&u?-1:1);break;case"end":m[l]+=p*(n&&u?-1:1);break}return m}const wN=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:c}=im(u,r,a),p=r,m={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:d=0}=kn(e,t)||{};if(u==null)return{};const c=Uv(d),p={x:n,y:r},m=Wd(i),w=Hd(m),v=await l.getDimensions(u),S=m==="y",y=S?"top":"left",h=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[m]-p[m]-o.floating[w],N=p[m]-o.reference[m],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=E?E[x]:0;(!P||!await(l.isElement==null?void 0:l.isElement(E)))&&(P=s.floating[x]||o.floating[w]);const _=C/2-N/2,F=P/2-v[w]/2-1,M=Xn(c[y],F),A=Xn(c[h],F),R=M,U=P-v[w]-A,H=P/2-v[w]/2+_,O=yc(R,H,U),L=!a.arrow&&ji(i)!=null&&H!==O&&o.reference[w]/2-(HH<=0)){var A,R;const H=(((A=o.flip)==null?void 0:A.index)||0)+1,O=P[H];if(O&&(!(c==="alignment"?h!==nn(O):!1)||M.every(T=>nn(T.placement)===h?T.overflows[0]>0:!0)))return{data:{index:H,overflows:M},reset:{placement:O}};let L=(R=M.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:R.placement;if(!L)switch(m){case"bestFit":{var U;const D=(U=M.filter(T=>{if(E){const B=nn(T.placement);return B===h||B==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(B=>B>0).reduce((B,k)=>B+k,0)]).sort((T,B)=>T[1]-B[1])[0])==null?void 0:U[0];D&&(L=D);break}case"initialPlacement":L=s;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function om(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lm(e){return uN.some(t=>e[t]>=0)}const CN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=kn(e,t);switch(r){case"referenceHidden":{const o=await Ao(t,{...i,elementContext:"reference"}),l=om(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:lm(l)}}}case"escaped":{const o=await Ao(t,{...i,altBoundary:!0}),l=om(o,n.floating);return{data:{escapedOffsets:l,escaped:lm(l)}}}default:return{}}}}},Vv=new Set(["left","top"]);async function bN(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Cn(n),s=ji(n),a=nn(n)==="y",u=Vv.has(l)?-1:1,d=o&&a?-1:1,c=kn(t,e);let{mainAxis:p,crossAxis:m,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"&&(m=s==="end"?w*-1:w),a?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const EN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await bN(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},NN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:y,y:h}=S;return{x:y,y:h}}},...a}=kn(e,t),u={x:n,y:r},d=await Ao(t,a),c=nn(Cn(i)),p=Vd(c);let m=u[p],w=u[c];if(o){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",h=m+d[S],x=m-d[y];m=yc(h,m,x)}if(l){const S=c==="y"?"top":"left",y=c==="y"?"bottom":"right",h=w+d[S],x=w-d[y];w=yc(h,w,x)}const v=s.fn({...t,[p]:m,[c]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:o,[c]:l}}}}}},PN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=kn(e,t),d={x:n,y:r},c=nn(i),p=Vd(c);let m=d[p],w=d[c];const v=kn(s,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,N=o.reference[p]+o.reference[x]-S.mainAxis;mN&&(m=N)}if(u){var y,h;const x=p==="y"?"width":"height",C=Vv.has(Cn(i)),N=o.reference[c]-o.floating[x]+(C&&((y=l.offset)==null?void 0:y[c])||0)+(C?0:S.crossAxis),E=o.reference[c]+o.reference[x]+(C?0:((h=l.offset)==null?void 0:h[c])||0)-(C?S.crossAxis:0);wE&&(w=E)}return{[p]:m,[c]:w}}}},jN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=kn(e,t),d=await Ao(t,u),c=Cn(i),p=ji(i),m=nn(i)==="y",{width:w,height:v}=o.floating;let S,y;c==="top"||c==="bottom"?(S=c,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,S=p==="end"?"top":"bottom");const h=v-d.top-d.bottom,x=w-d.left-d.right,C=Xn(v-d[S],h),N=Xn(w-d[y],x),E=!t.middlewareData.shift;let P=C,_=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=h),E&&!p){const M=pt(d.left,0),A=pt(d.right,0),R=pt(d.top,0),U=pt(d.bottom,0);m?_=w-2*(M!==0||A!==0?M+A:pt(d.left,d.right)):P=v-2*(R!==0||U!==0?R+U:pt(d.top,d.bottom))}await a({...t,availableWidth:_,availableHeight:P});const F=await l.getDimensions(s.floating);return w!==F.width||v!==F.height?{reset:{rects:!0}}:{}}}};function Ys(){return typeof window<"u"}function Ti(e){return Hv(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function un(e){var t;return(t=(Hv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hv(e){return Ys()?e instanceof Node||e instanceof yt(e).Node:!1}function Ht(e){return Ys()?e instanceof Element||e instanceof yt(e).Element:!1}function sn(e){return Ys()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function sm(e){return!Ys()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const TN=new Set(["inline","contents"]);function Vo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!TN.has(i)}const _N=new Set(["table","td","th"]);function AN(e){return _N.has(Ti(e))}const RN=[":popover-open",":modal"];function Xs(e){return RN.some(t=>{try{return e.matches(t)}catch{return!1}})}const IN=["transform","translate","scale","rotate","perspective"],MN=["transform","translate","scale","rotate","perspective","filter"],LN=["paint","layout","strict","content"];function Kd(e){const t=Gd(),n=Ht(e)?Wt(e):e;return IN.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)||MN.some(r=>(n.willChange||"").includes(r))||LN.some(r=>(n.contain||"").includes(r))}function ON(e){let t=qn(e);for(;sn(t)&&!Si(t);){if(Kd(t))return t;if(Xs(t))return null;t=qn(t)}return null}function Gd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const DN=new Set(["html","body","#document"]);function Si(e){return DN.has(Ti(e))}function Wt(e){return yt(e).getComputedStyle(e)}function qs(e){return Ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qn(e){if(Ti(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sm(e)&&e.host||un(e);return sm(t)?t.host:t}function Wv(e){const t=qn(e);return Si(t)?e.ownerDocument?e.ownerDocument.body:e.body:sn(t)&&Vo(t)?t:Wv(t)}function Ro(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Wv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=yt(i);if(o){const s=xc(l);return t.concat(l,l.visualViewport||[],Vo(i)?i:[],s&&n?Ro(s):[])}return t.concat(i,Ro(i,[],n))}function xc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Kv(e){const t=Wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=xs(n)!==o||xs(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Qd(e){return Ht(e)?e:e.contextElement}function oi(e){const t=Qd(e);if(!sn(t))return ln(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Kv(t);let l=(o?xs(n.width):n.width)/r,s=(o?xs(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const zN=ln(0);function Gv(e){const t=yt(e);return!Gd()||!t.visualViewport?zN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Qd(e);let l=ln(1);t&&(r?Ht(r)&&(l=oi(r)):l=oi(e));const s=FN(o,n,r)?Gv(o):ln(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,d=i.width/l.x,c=i.height/l.y;if(o){const p=yt(o),m=r&&Ht(r)?yt(r):r;let w=p,v=xc(w);for(;v&&r&&m!==w;){const S=oi(v),y=v.getBoundingClientRect(),h=Wt(v),x=y.left+(v.clientLeft+parseFloat(h.paddingLeft))*S.x,C=y.top+(v.clientTop+parseFloat(h.paddingTop))*S.y;a*=S.x,u*=S.y,d*=S.x,c*=S.y,a+=x,u+=C,w=yt(v),v=xc(w)}}return Ss({width:d,height:c,x:a,y:u})}function Js(e,t){const n=qs(e).scrollLeft;return t?t.left+n:Sr(un(e)).left+n}function Qv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Js(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function BN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=un(r),s=t?Xs(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=ln(1);const d=ln(0),c=sn(r);if((c||!c&&!o)&&((Ti(r)!=="body"||Vo(l))&&(a=qs(r)),sn(r))){const m=Sr(r);u=oi(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=l&&!c&&!o?Qv(l,a):ln(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 $N(e){return Array.from(e.getClientRects())}function UN(e){const t=un(e),n=qs(e),r=e.ownerDocument.body,i=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Js(e);const s=-n.scrollTop;return Wt(r).direction==="rtl"&&(l+=pt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const am=25;function VN(e,t){const n=yt(e),r=un(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const d=Gd();(!d||d&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Js(r);if(u<=0){const d=r.ownerDocument,c=d.body,p=getComputedStyle(c),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-c.clientWidth-m);w<=am&&(o-=w)}else u<=am&&(o+=u);return{width:o,height:l,x:s,y:a}}const HN=new Set(["absolute","fixed"]);function WN(e,t){const n=Sr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=sn(e)?oi(e):ln(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function um(e,t,n){let r;if(t==="viewport")r=VN(e,n);else if(t==="document")r=UN(un(e));else if(Ht(t))r=WN(t,n);else{const i=Gv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ss(r)}function Yv(e,t){const n=qn(e);return n===t||!Ht(n)||Si(n)?!1:Wt(n).position==="fixed"||Yv(n,t)}function KN(e,t){const n=t.get(e);if(n)return n;let r=Ro(e,[],!1).filter(s=>Ht(s)&&Ti(s)!=="body"),i=null;const o=Wt(e).position==="fixed";let l=o?qn(e):e;for(;Ht(l)&&!Si(l);){const s=Wt(l),a=Kd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&HN.has(i.position)||Vo(l)&&!a&&Yv(e,l))?r=r.filter(d=>d!==l):i=s,l=qn(l)}return t.set(e,r),r}function GN(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Xs(t)?[]:KN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,d)=>{const c=um(t,d,i);return u.top=pt(c.top,u.top),u.right=Xn(c.right,u.right),u.bottom=Xn(c.bottom,u.bottom),u.left=pt(c.left,u.left),u},um(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function QN(e){const{width:t,height:n}=Kv(e);return{width:t,height:n}}function YN(e,t,n){const r=sn(t),i=un(t),o=n==="fixed",l=Sr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=ln(0);function u(){a.x=Js(i)}if(r||!r&&!o)if((Ti(t)!=="body"||Vo(i))&&(s=qs(t)),r){const m=Sr(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&u();o&&!r&&i&&u();const d=i&&!r&&!o?Qv(i,s):ln(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 Wa(e){return Wt(e).position==="static"}function cm(e,t){if(!sn(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return un(e)===n&&(n=n.ownerDocument.body),n}function Xv(e,t){const n=yt(e);if(Xs(e))return n;if(!sn(e)){let i=qn(e);for(;i&&!Si(i);){if(Ht(i)&&!Wa(i))return i;i=qn(i)}return n}let r=cm(e,t);for(;r&&AN(r)&&Wa(r);)r=cm(r,t);return r&&Si(r)&&Wa(r)&&!Kd(r)?n:r||ON(e)||n}const XN=async function(e){const t=this.getOffsetParent||Xv,n=this.getDimensions,r=await n(e.floating);return{reference:YN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qN(e){return Wt(e).direction==="rtl"}const JN={convertOffsetParentRelativeRectToViewportRelativeRect:BN,getDocumentElement:un,getClippingRect:GN,getOffsetParent:Xv,getElementRects:XN,getClientRects:$N,getDimensions:QN,getScale:oi,isElement:Ht,isRTL:qN};function qv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ZN(e,t){let n=null,r;const i=un(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:d,top:c,width:p,height:m}=u;if(s||t(),!p||!m)return;const w=dl(c),v=dl(i.clientWidth-(d+p)),S=dl(i.clientHeight-(c+m)),y=dl(d),x={rootMargin:-w+"px "+-v+"px "+-S+"px "+-y+"px",threshold:pt(0,Xn(1,a))||1};let C=!0;function N(E){const P=E[0].intersectionRatio;if(P!==a){if(!C)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!qv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),o}function e2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Qd(e),d=i||o?[...u?Ro(u):[],...Ro(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const c=u&&s?ZN(u,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!a&&m.observe(u),m.observe(t));let w,v=a?Sr(e):null;a&&S();function S(){const y=Sr(e);v&&!qv(v,y)&&n(),v=y,w=requestAnimationFrame(S)}return n(),()=>{var y;d.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),c==null||c(),(y=m)==null||y.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const t2=EN,n2=NN,r2=kN,i2=jN,o2=CN,dm=SN,l2=PN,s2=(e,t,n)=>{const r=new Map,i={platform:JN,...n},o={...i.platform,_c:r};return wN(e,t,{...i,platform:o})};var a2=typeof document<"u",u2=function(){},Al=a2?g.useLayoutEffect:u2;function ks(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ks(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ks(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Jv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fm(e,t){const n=Jv(e);return Math.round(t*n)/n}function Ka(e){const t=g.useRef(e);return Al(()=>{t.current=e}),t}function c2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[d,c]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);ks(p,r)||m(r);const[w,v]=g.useState(null),[S,y]=g.useState(null),h=g.useCallback(T=>{T!==E.current&&(E.current=T,v(T))},[]),x=g.useCallback(T=>{T!==P.current&&(P.current=T,y(T))},[]),C=o||w,N=l||S,E=g.useRef(null),P=g.useRef(null),_=g.useRef(d),F=a!=null,M=Ka(a),A=Ka(i),R=Ka(u),U=g.useCallback(()=>{if(!E.current||!P.current)return;const T={placement:t,strategy:n,middleware:p};A.current&&(T.platform=A.current),s2(E.current,P.current,T).then(B=>{const k={...B,isPositioned:R.current!==!1};H.current&&!ks(_.current,k)&&(_.current=k,Ei.flushSync(()=>{c(k)}))})},[p,t,n,A,R]);Al(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,c(T=>({...T,isPositioned:!1})))},[u]);const H=g.useRef(!1);Al(()=>(H.current=!0,()=>{H.current=!1}),[]),Al(()=>{if(C&&(E.current=C),N&&(P.current=N),C&&N){if(M.current)return M.current(C,N,U);U()}},[C,N,U,M,F]);const O=g.useMemo(()=>({reference:E,floating:P,setReference:h,setFloating:x}),[h,x]),L=g.useMemo(()=>({reference:C,floating:N}),[C,N]),D=g.useMemo(()=>{const T={position:n,left:0,top:0};if(!L.floating)return T;const B=fm(L.floating,d.x),k=fm(L.floating,d.y);return s?{...T,transform:"translate("+B+"px, "+k+"px)",...Jv(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:k}},[n,s,L.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:U,refs:O,elements:L,floatingStyles:D}),[d,U,O,L,D])}const d2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dm({element:r.current,padding:i}).fn(n):{}:r?dm({element:r,padding:i}).fn(n):{}}}},f2=(e,t)=>({...t2(e),options:[e,t]}),p2=(e,t)=>({...n2(e),options:[e,t]}),m2=(e,t)=>({...l2(e),options:[e,t]}),h2=(e,t)=>({...r2(e),options:[e,t]}),g2=(e,t)=>({...i2(e),options:[e,t]}),y2=(e,t)=>({...o2(e),options:[e,t]}),v2=(e,t)=>({...d2(e),options:[e,t]});var x2="Arrow",Zv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return f.jsx(ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Zv.displayName=x2;var w2=Zv,Yd="Popper",[ex,tx]=nr(Yd),[S2,nx]=ex(Yd),rx=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return f.jsx(S2,{scope:t,anchor:r,onAnchorChange:i,children:n})};rx.displayName=Yd;var ix="PopperAnchor",ox=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=nx(ix,n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:f.jsx(ne.div,{...i,ref:s})});ox.displayName=ix;var Xd="PopperContent",[k2,C2]=ex(Xd),lx=g.forwardRef((e,t)=>{var Q,oe,ye,le,ue,ce;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...v}=e,S=nx(Xd,n),[y,h]=g.useState(null),x=pe(t,Be=>h(Be)),[C,N]=g.useState(null),E=wv(C),P=(E==null?void 0:E.width)??0,_=(E==null?void 0:E.height)??0,F=r+(o!=="center"?"-"+o:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],R=A.length>0,U={padding:M,boundary:A.filter(E2),altBoundary:R},{refs:H,floatingStyles:O,placement:L,isPositioned:D,middlewareData:T}=c2({strategy:"fixed",placement:F,whileElementsMounted:(...Be)=>e2(...Be,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[f2({mainAxis:i+_,alignmentAxis:l}),a&&p2({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?m2():void 0,...U}),a&&h2({...U}),g2({...U,apply:({elements:Be,rects:et,availableWidth:Gt,availableHeight:Qt})=>{const{width:_t,height:_r}=et.reference,cn=Be.floating.style;cn.setProperty("--radix-popper-available-width",`${Gt}px`),cn.setProperty("--radix-popper-available-height",`${Qt}px`),cn.setProperty("--radix-popper-anchor-width",`${_t}px`),cn.setProperty("--radix-popper-anchor-height",`${_r}px`)}}),C&&v2({element:C,padding:s}),N2({arrowWidth:P,arrowHeight:_}),p&&y2({strategy:"referenceHidden",...U})]}),[B,k]=ux(L),G=Yn(w);Qe(()=>{D&&(G==null||G())},[D,G]);const Y=(Q=T.arrow)==null?void 0:Q.x,b=(oe=T.arrow)==null?void 0:oe.y,q=((ye=T.arrow)==null?void 0:ye.centerOffset)!==0,[ge,te]=g.useState();return Qe(()=>{y&&te(window.getComputedStyle(y).zIndex)},[y]),f.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:D?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(le=T.transformOrigin)==null?void 0:le.x,(ue=T.transformOrigin)==null?void 0:ue.y].join(" "),...((ce=T.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(k2,{scope:n,placedSide:B,onArrowChange:N,arrowX:Y,arrowY:b,shouldHideArrow:q,children:f.jsx(ne.div,{"data-side":B,"data-align":k,...v,ref:x,style:{...v.style,animation:D?void 0:"none"}})})})});lx.displayName=Xd;var sx="PopperArrow",b2={top:"bottom",right:"left",bottom:"top",left:"right"},ax=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=C2(sx,r),l=b2[o.placedSide];return f.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:f.jsx(w2,{...i,ref:n,style:{...i.style,display:"block"}})})});ax.displayName=sx;function E2(e){return e!==null}var N2=e=>({name:"transformOrigin",options:e,fn(t){var S,y,h;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,d]=ux(n),c={start:"0%",center:"50%",end:"100%"}[d],p=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+a/2;let w="",v="";return u==="bottom"?(w=l?c:`${p}px`,v=`${-a}px`):u==="top"?(w=l?c:`${p}px`,v=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,v=l?c:`${m}px`):u==="left"&&(w=`${r.floating.width+a}px`,v=l?c:`${m}px`),{data:{x:w,y:v}}}});function ux(e){const[t,n="center"]=e.split("-");return[t,n]}var P2=rx,j2=ox,T2=lx,_2=ax,A2="Portal",qd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);Qe(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?nk.createPortal(f.jsx(ne.div,{...r,ref:t}),l):null});qd.displayName=A2;var cx=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"}),R2="VisuallyHidden",I2=g.forwardRef((e,t)=>f.jsx(ne.span,{...e,ref:t,style:{...cx,...e.style}}));I2.displayName=R2;var M2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,fl=new WeakMap,pl={},Ga=0,dx=function(e){return e&&(e.host||dx(e.parentNode))},L2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dx(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})},O2=function(e,t,n,r){var i=L2(t,Array.isArray(e)?e:[e]);pl[n]||(pl[n]=new WeakMap);var o=pl[n],l=[],s=new Set,a=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.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 m=p.getAttribute(r),w=m!==null&&m!=="false",v=(Mr.get(p)||0)+1,S=(o.get(p)||0)+1;Mr.set(p,v),o.set(p,S),l.push(p),v===1&&w&&fl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return d(t),s.clear(),Ga++,function(){l.forEach(function(c){var p=Mr.get(c)-1,m=o.get(c)-1;Mr.set(c,p),o.set(c,m),p||(fl.has(c)||c.removeAttribute(r),fl.delete(c)),m||c.removeAttribute(n)}),Ga--,Ga||(Mr=new WeakMap,Mr=new WeakMap,fl=new WeakMap,pl={})}},fx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||M2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),O2(r,i,n,"aria-hidden")):function(){return null}},en=function(){return en=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return Z2;var t=eP(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])}},nP=gx(),li="data-scroll-locked",rP=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(z2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(li,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Rl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Il,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Rl," .").concat(Rl,` { + right: 0 `).concat(r,`; + } + + .`).concat(Il," .").concat(Il,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(li,`] { + `).concat(F2,": ").concat(s,`px; + } +`)},hm=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},iP=function(){g.useEffect(function(){return document.body.setAttribute(li,(hm()+1).toString()),function(){var e=hm()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},oP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;iP();var o=g.useMemo(function(){return tP(i)},[i]);return g.createElement(nP,{styles:rP(o,!t,i,n?"":"!important")})},wc=!1;if(typeof window<"u")try{var ml=Object.defineProperty({},"passive",{get:function(){return wc=!0,!0}});window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{wc=!1}var Lr=wc?{passive:!1}:!1,lP=function(e){return e.tagName==="TEXTAREA"},yx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lP(e)&&n[t]==="visible")},sP=function(e){return yx(e,"overflowY")},aP=function(e){return yx(e,"overflowX")},gm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=vx(e,r);if(i){var o=xx(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},vx=function(e,t){return e==="v"?sP(t):aP(t)},xx=function(e,t){return e==="v"?uP(t):cP(t)},dP=function(e,t){return e==="h"&&t==="rtl"?-1:1},fP=function(e,t,n,r,i){var o=dP(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,d=l>0,c=0,p=0;do{if(!s)break;var m=xx(e,s),w=m[0],v=m[1],S=m[2],y=v-S-o*w;(w||y)&&vx(e,s)&&(c+=y,p+=w);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(d&&(i&&Math.abs(c)<1||!i&&l>c)||!d&&(i&&Math.abs(p)<1||!i&&-l>p))&&(u=!0),u},hl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ym=function(e){return[e.deltaX,e.deltaY]},vm=function(e){return e&&"current"in e?e.current:e},pP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mP=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},hP=0,Or=[];function gP(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(hP++)[0],o=g.useState(gx)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=D2([e.lockRef.current],(e.shards||[]).map(vm),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var y=hl(v),h=n.current,x="deltaX"in v?v.deltaX:h[0]-y[0],C="deltaY"in v?v.deltaY:h[1]-y[1],N,E=v.target,P=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in v&&P==="h"&&E.type==="range")return!1;var _=gm(P,E);if(!_)return!0;if(_?N=P:(N=P==="v"?"h":"v",_=gm(P,E)),!_)return!1;if(!r.current&&"changedTouches"in v&&(x||C)&&(r.current=N),!N)return!0;var F=r.current||N;return fP(F,S,v,F==="h"?x:C,!0)},[]),a=g.useCallback(function(v){var S=v;if(!(!Or.length||Or[Or.length-1]!==o)){var y="deltaY"in S?ym(S):hl(S),h=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&pP(N.delta,y)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var x=(l.current.shards||[]).map(vm).filter(Boolean).filter(function(N){return N.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(v,S,y,h){var x={name:v,delta:S,target:y,should:h,shadowParent:yP(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=g.useCallback(function(v){n.current=hl(v),r.current=void 0},[]),c=g.useCallback(function(v){u(v.type,ym(v),v.target,s(v,e.lockRef.current))},[]),p=g.useCallback(function(v){u(v.type,hl(v),v.target,s(v,e.lockRef.current))},[]);g.useEffect(function(){return Or.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Lr),document.addEventListener("touchmove",a,Lr),document.addEventListener("touchstart",d,Lr),function(){Or=Or.filter(function(v){return v!==o}),document.removeEventListener("wheel",a,Lr),document.removeEventListener("touchmove",a,Lr),document.removeEventListener("touchstart",d,Lr)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:mP(i)}):null,m?g.createElement(oP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vP=K2(hx,gP);var wx=g.forwardRef(function(e,t){return g.createElement(Zs,en({},e,{ref:t,sideCar:vP}))});wx.classNames=Zs.classNames;const Sx=wx;var xP=[" ","Enter","ArrowUp","ArrowDown"],wP=[" ","Enter"],kr="Select",[ea,ta,SP]=zd(kr),[_i,kI]=nr(kr,[SP,tx]),na=tx(),[kP,rr]=_i(kr),[CP,bP]=_i(kr),kx=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:d,autoComplete:c,disabled:p,required:m,form:w}=e,v=na(t),[S,y]=g.useState(null),[h,x]=g.useState(null),[C,N]=g.useState(!1),E=Ks(u),[P,_]=wi({prop:r,defaultProp:i??!1,onChange:o,caller:kr}),[F,M]=wi({prop:l,defaultProp:s,onChange:a,caller:kr}),A=g.useRef(null),R=S?w||!!S.closest("form"):!0,[U,H]=g.useState(new Set),O=Array.from(U).map(L=>L.props.value).join(";");return f.jsx(P2,{...v,children:f.jsxs(kP,{required:m,scope:t,trigger:S,onTriggerChange:y,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Kn(),value:F,onValueChange:M,open:P,onOpenChange:_,dir:E,triggerPointerDownPosRef:A,disabled:p,children:[f.jsx(ea.Provider,{scope:t,children:f.jsx(CP,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(L=>{H(D=>new Set(D).add(L))},[]),onNativeOptionRemove:g.useCallback(L=>{H(D=>{const T=new Set(D);return T.delete(L),T})},[]),children:n})}),R?f.jsxs(Gx,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:c,value:F,onChange:L=>M(L.target.value),disabled:p,form:w,children:[F===void 0?f.jsx("option",{value:""}):null,Array.from(U)]},O):null]})})};kx.displayName=kr;var Cx="SelectTrigger",bx=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=na(n),l=rr(Cx,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=ta(n),d=g.useRef("touch"),[c,p,m]=Yx(v=>{const S=u().filter(x=>!x.disabled),y=S.find(x=>x.value===l.value),h=Xx(S,v,y);h!==void 0&&l.onValueChange(h.value)}),w=v=>{s||(l.onOpenChange(!0),m()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return f.jsx(j2,{asChild:!0,...o,children:f.jsx(ne.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Qx(l.value)?"":void 0,...i,ref:a,onClick:Z(i.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&w(v)}),onPointerDown:Z(i.onPointerDown,v=>{d.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:Z(i.onKeyDown,v=>{const S=c.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(S&&v.key===" ")&&xP.includes(v.key)&&(w(),v.preventDefault())})})})});bx.displayName=Cx;var Ex="SelectValue",Nx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=rr(Ex,n),{onValueNodeHasChildrenChange:u}=a,d=o!==void 0,c=pe(t,a.onValueNodeChange);return Qe(()=>{u(d)},[u,d]),f.jsx(ne.span,{...s,ref:c,style:{pointerEvents:"none"},children:Qx(a.value)?f.jsx(f.Fragment,{children:l}):o})});Nx.displayName=Ex;var EP="SelectIcon",Px=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Px.displayName=EP;var NP="SelectPortal",jx=e=>f.jsx(qd,{asChild:!0,...e});jx.displayName=NP;var Cr="SelectContent",Tx=g.forwardRef((e,t)=>{const n=rr(Cr,e.__scopeSelect),[r,i]=g.useState();if(Qe(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ei.createPortal(f.jsx(_x,{scope:e.__scopeSelect,children:f.jsx(ea.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(Ax,{...e,ref:t})});Tx.displayName=Cr;var It=10,[_x,ir]=_i(Cr),PP="SelectContentImpl",jP=xi("SelectContent.RemoveScroll"),Ax=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:v,avoidCollisions:S,...y}=e,h=rr(Cr,n),[x,C]=g.useState(null),[N,E]=g.useState(null),P=pe(t,Q=>C(Q)),[_,F]=g.useState(null),[M,A]=g.useState(null),R=ta(n),[U,H]=g.useState(!1),O=g.useRef(!1);g.useEffect(()=>{if(x)return fx(x)},[x]),Bv();const L=g.useCallback(Q=>{const[oe,...ye]=R().map(ce=>ce.ref.current),[le]=ye.slice(-1),ue=document.activeElement;for(const ce of Q)if(ce===ue||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===oe&&N&&(N.scrollTop=0),ce===le&&N&&(N.scrollTop=N.scrollHeight),ce==null||ce.focus(),document.activeElement!==ue))return},[R,N]),D=g.useCallback(()=>L([_,x]),[L,_,x]);g.useEffect(()=>{U&&D()},[U,D]);const{onOpenChange:T,triggerPointerDownPosRef:B}=h;g.useEffect(()=>{if(x){let Q={x:0,y:0};const oe=le=>{var ue,ce;Q={x:Math.abs(Math.round(le.pageX)-(((ue=B.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(le.pageY)-(((ce=B.current)==null?void 0:ce.y)??0))}},ye=le=>{Q.x<=10&&Q.y<=10?le.preventDefault():x.contains(le.target)||T(!1),document.removeEventListener("pointermove",oe),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ye,{capture:!0})}}},[x,T,B]),g.useEffect(()=>{const Q=()=>T(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[T]);const[k,G]=Yx(Q=>{const oe=R().filter(ue=>!ue.disabled),ye=oe.find(ue=>ue.ref.current===document.activeElement),le=Xx(oe,Q,ye);le&&setTimeout(()=>le.ref.current.focus())}),Y=g.useCallback((Q,oe,ye)=>{const le=!O.current&&!ye;(h.value!==void 0&&h.value===oe||le)&&(F(Q),le&&(O.current=!0))},[h.value]),b=g.useCallback(()=>x==null?void 0:x.focus(),[x]),q=g.useCallback((Q,oe,ye)=>{const le=!O.current&&!ye;(h.value!==void 0&&h.value===oe||le)&&A(Q)},[h.value]),ge=r==="popper"?Sc:Rx,te=ge===Sc?{side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:v,avoidCollisions:S}:{};return f.jsx(_x,{scope:n,content:x,viewport:N,onViewportChange:E,itemRefCallback:Y,selectedItem:_,onItemLeave:b,itemTextRefCallback:q,focusSelectedItem:D,selectedItemText:M,position:r,isPositioned:U,searchRef:k,children:f.jsx(Sx,{as:jP,allowPinchZoom:!0,children:f.jsx(Ud,{asChild:!0,trapped:h.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Z(i,Q=>{var oe;(oe=h.trigger)==null||oe.focus({preventScroll:!0}),Q.preventDefault()}),children:f.jsx($d,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:f.jsx(ge,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:Q=>Q.preventDefault(),...y,...te,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,Q=>{const oe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!oe&&Q.key.length===1&&G(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let le=R().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const ue=Q.target,ce=le.indexOf(ue);le=le.slice(ce+1)}setTimeout(()=>L(le)),Q.preventDefault()}})})})})})})});Ax.displayName=PP;var TP="SelectItemAlignedPosition",Rx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=rr(Cr,n),l=ir(Cr,n),[s,a]=g.useState(null),[u,d]=g.useState(null),c=pe(t,P=>d(P)),p=ta(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:y,focusSelectedItem:h}=l,x=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&v&&S&&y){const P=o.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(o.dir!=="rtl"){const ue=M.left-_.left,ce=F.left-ue,Be=P.left-ce,et=P.width+Be,Gt=Math.max(et,_.width),Qt=window.innerWidth-It,_t=vs(ce,[It,Math.max(It,Qt-Gt)]);s.style.minWidth=et+"px",s.style.left=_t+"px"}else{const ue=_.right-M.right,ce=window.innerWidth-F.right-ue,Be=window.innerWidth-P.right-ce,et=P.width+Be,Gt=Math.max(et,_.width),Qt=window.innerWidth-It,_t=vs(ce,[It,Math.max(It,Qt-Gt)]);s.style.minWidth=et+"px",s.style.right=_t+"px"}const A=p(),R=window.innerHeight-It*2,U=v.scrollHeight,H=window.getComputedStyle(u),O=parseInt(H.borderTopWidth,10),L=parseInt(H.paddingTop,10),D=parseInt(H.borderBottomWidth,10),T=parseInt(H.paddingBottom,10),B=O+L+U+T+D,k=Math.min(S.offsetHeight*5,B),G=window.getComputedStyle(v),Y=parseInt(G.paddingTop,10),b=parseInt(G.paddingBottom,10),q=P.top+P.height/2-It,ge=R-q,te=S.offsetHeight/2,Q=S.offsetTop+te,oe=O+L+Q,ye=B-oe;if(oe<=q){const ue=A.length>0&&S===A[A.length-1].ref.current;s.style.bottom="0px";const ce=u.clientHeight-v.offsetTop-v.offsetHeight,Be=Math.max(ge,te+(ue?b:0)+ce+D),et=oe+Be;s.style.height=et+"px"}else{const ue=A.length>0&&S===A[0].ref.current;s.style.top="0px";const Be=Math.max(q,O+v.offsetTop+(ue?Y:0)+te)+ye;s.style.height=Be+"px",v.scrollTop=oe-q+v.offsetTop}s.style.margin=`${It}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,v,S,y,o.dir,r]);Qe(()=>x(),[x]);const[C,N]=g.useState();Qe(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(P=>{P&&w.current===!0&&(x(),h==null||h(),w.current=!1)},[x,h]);return f.jsx(AP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(ne.div,{...i,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Rx.displayName=TP;var _P="SelectPopperPosition",Sc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=It,...o}=e,l=na(n);return f.jsx(T2,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sc.displayName=_P;var[AP,Jd]=_i(Cr,{}),kc="SelectViewport",Ix=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ir(kc,n),l=Jd(kc,n),s=pe(t,o.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(ea.Slot,{scope:n,children:f.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&c){const m=Math.abs(a.current-d.scrollTop);if(m>0){const w=window.innerHeight-It*2,v=parseFloat(c.style.minHeight),S=parseFloat(c.style.height),y=Math.max(v,S);if(y0?C:0,c.style.justifyContent="flex-end")}}}a.current=d.scrollTop})})})]})});Ix.displayName=kc;var Mx="SelectGroup",[RP,IP]=_i(Mx),Lx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Kn();return f.jsx(RP,{scope:n,id:i,children:f.jsx(ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Lx.displayName=Mx;var Ox="SelectLabel",Dx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=IP(Ox,n);return f.jsx(ne.div,{id:i.id,...r,ref:t})});Dx.displayName=Ox;var Cs="SelectItem",[MP,zx]=_i(Cs),Fx=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=rr(Cs,n),a=ir(Cs,n),u=s.value===r,[d,c]=g.useState(o??""),[p,m]=g.useState(!1),w=pe(t,h=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,h,r,i)}),v=Kn(),S=g.useRef("touch"),y=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(MP,{scope:n,value:r,disabled:i,textId:v,isSelected:u,onItemTextChange:g.useCallback(h=>{c(x=>x||((h==null?void 0:h.textContent)??"").trim())},[]),children:f.jsx(ea.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:f.jsx(ne.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>m(!0)),onBlur:Z(l.onBlur,()=>m(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&y()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:Z(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:Z(l.onPointerMove,h=>{var x;S.current=h.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,h=>{var x;h.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Z(l.onKeyDown,h=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&h.key===" "||(wP.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});Fx.displayName=Cs;var qi="SelectItemText",Bx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=rr(qi,n),s=ir(qi,n),a=zx(qi,n),u=bP(qi,n),[d,c]=g.useState(null),p=pe(t,y=>c(y),a.onItemTextChange,y=>{var h;return(h=s.itemTextRefCallback)==null?void 0:h.call(s,y,a.value,a.disabled)}),m=d==null?void 0:d.textContent,w=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=u;return Qe(()=>(v(w),()=>S(w)),[v,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(ne.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ei.createPortal(o.children,l.valueNode):null]})});Bx.displayName=qi;var $x="SelectItemIndicator",Ux=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zx($x,n).isSelected?f.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});Ux.displayName=$x;var Cc="SelectScrollUpButton",Vx=g.forwardRef((e,t)=>{const n=ir(Cc,e.__scopeSelect),r=Jd(Cc,e.__scopeSelect),[i,o]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return Qe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?f.jsx(Wx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Vx.displayName=Cc;var bc="SelectScrollDownButton",Hx=g.forwardRef((e,t)=>{const n=ir(bc,e.__scopeSelect),r=Jd(bc,e.__scopeSelect),[i,o]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return Qe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?f.jsx(Wx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});Hx.displayName=bc;var Wx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ir("SelectScrollButton",n),l=g.useRef(null),s=ta(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Qe(()=>{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(ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Z(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{a()})})}),LP="SelectSeparator",Kx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});Kx.displayName=LP;var Ec="SelectArrow",OP=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=na(n),o=rr(Ec,n),l=ir(Ec,n);return o.open&&l.position==="popper"?f.jsx(_2,{...i,...r,ref:t}):null});OP.displayName=Ec;var DP="SelectBubbleInput",Gx=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=pe(r,i),l=xv(t);return g.useEffect(()=>{const s=i.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(ne.select,{...n,style:{...cx,...n.style},ref:o,defaultValue:t})});Gx.displayName=DP;function Qx(e){return e===""||e===void 0}function Yx(e){const t=Yn(e),n=g.useRef(""),r=g.useRef(0),i=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]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Xx(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=zP(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function zP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FP=kx,qx=bx,BP=Nx,$P=Px,UP=jx,Jx=Tx,VP=Ix,HP=Lx,Zx=Dx,e0=Fx,WP=Bx,KP=Ux,t0=Vx,n0=Hx,r0=Kx;const i0=FP,so=HP,o0=BP,Zd=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(qx,{ref:r,className:ae("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($P,{asChild:!0,children:f.jsx(Uy,{className:"h-4 w-4 opacity-50"})})]}));Zd.displayName=qx.displayName;const l0=g.forwardRef(({className:e,...t},n)=>f.jsx(t0,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(ZC,{className:"h-4 w-4"})}));l0.displayName=t0.displayName;const s0=g.forwardRef(({className:e,...t},n)=>f.jsx(n0,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Uy,{className:"h-4 w-4"})}));s0.displayName=n0.displayName;const ef=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>f.jsx(UP,{children:f.jsxs(Jx,{ref:i,className:ae("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(l0,{}),f.jsx(VP,{className:ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(s0,{})]})}));ef.displayName=Jx.displayName;const si=g.forwardRef(({className:e,...t},n)=>f.jsx(Zx,{ref:n,className:ae("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));si.displayName=Zx.displayName;const pr=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(e0,{ref:r,className:ae("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(KP,{children:f.jsx(QC,{className:"h-4 w-4"})})}),f.jsx(WP,{children:t})]}));pr.displayName=e0.displayName;const GP=g.forwardRef(({className:e,...t},n)=>f.jsx(r0,{ref:n,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));GP.displayName=r0.displayName;var ra="Dialog",[a0,u0]=nr(ra),[QP,Kt]=a0(ra),c0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,d]=wi({prop:r,defaultProp:i??!1,onChange:o,caller:ra});return f.jsx(QP,{scope:t,triggerRef:s,contentRef:a,contentId:Kn(),titleId:Kn(),descriptionId:Kn(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(c=>!c),[d]),modal:l,children:n})};c0.displayName=ra;var d0="DialogTrigger",f0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(d0,n),o=pe(t,i.triggerRef);return f.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rf(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});f0.displayName=d0;var tf="DialogPortal",[YP,p0]=a0(tf,{forceMount:void 0}),m0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Kt(tf,t);return f.jsx(YP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(Uo,{present:n||o.open,children:f.jsx(qd,{asChild:!0,container:i,children:l})}))})};m0.displayName=tf;var bs="DialogOverlay",h0=g.forwardRef((e,t)=>{const n=p0(bs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(bs,e.__scopeDialog);return o.modal?f.jsx(Uo,{present:r||o.open,children:f.jsx(qP,{...i,ref:t})}):null});h0.displayName=bs;var XP=xi("DialogOverlay.RemoveScroll"),qP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(bs,n);return f.jsx(Sx,{as:XP,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(ne.div,{"data-state":rf(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),br="DialogContent",g0=g.forwardRef((e,t)=>{const n=p0(br,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(br,e.__scopeDialog);return f.jsx(Uo,{present:r||o.open,children:o.modal?f.jsx(JP,{...i,ref:t}):f.jsx(ZP,{...i,ref:t})})});g0.displayName=br;var JP=g.forwardRef((e,t)=>{const n=Kt(br,e.__scopeDialog),r=g.useRef(null),i=pe(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return fx(o)},[]),f.jsx(y0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),ZP=g.forwardRef((e,t)=>{const n=Kt(br,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return f.jsx(y0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),y0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Kt(br,n),a=g.useRef(null),u=pe(t,a);return Bv(),f.jsxs(f.Fragment,{children:[f.jsx(Ud,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:f.jsx($d,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rf(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(tj,{titleId:s.titleId}),f.jsx(rj,{contentRef:a,descriptionId:s.descriptionId})]})]})}),nf="DialogTitle",v0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(nf,n);return f.jsx(ne.h2,{id:i.titleId,...r,ref:t})});v0.displayName=nf;var x0="DialogDescription",w0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(x0,n);return f.jsx(ne.p,{id:i.descriptionId,...r,ref:t})});w0.displayName=x0;var S0="DialogClose",k0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(S0,n);return f.jsx(ne.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});k0.displayName=S0;function rf(e){return e?"open":"closed"}var C0="DialogTitleWarning",[ej,b0]=Zb(C0,{contentName:br,titleName:nf,docsSlug:"dialog"}),tj=({titleId:e})=>{const t=b0(C0),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},nj="DialogDescriptionWarning",rj=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b0(nj).contentName}}.`;return g.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ij=c0,oj=f0,lj=m0,sj=h0,aj=g0,uj=v0,cj=w0,E0=k0,N0="AlertDialog",[dj,CI]=nr(N0,[u0]),En=u0(),P0=e=>{const{__scopeAlertDialog:t,...n}=e,r=En(t);return f.jsx(ij,{...r,...n,modal:!0})};P0.displayName=N0;var fj="AlertDialogTrigger",pj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return f.jsx(oj,{...i,...r,ref:t})});pj.displayName=fj;var mj="AlertDialogPortal",j0=e=>{const{__scopeAlertDialog:t,...n}=e,r=En(t);return f.jsx(lj,{...r,...n})};j0.displayName=mj;var hj="AlertDialogOverlay",T0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return f.jsx(sj,{...i,...r,ref:t})});T0.displayName=hj;var ai="AlertDialogContent",[gj,yj]=dj(ai),vj=Wb("AlertDialogContent"),_0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=En(n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return f.jsx(ej,{contentName:ai,titleName:A0,docsSlug:"alert-dialog",children:f.jsx(gj,{scope:n,cancelRef:a,children:f.jsxs(aj,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=a.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[f.jsx(vj,{children:r}),f.jsx(wj,{contentRef:l})]})})})});_0.displayName=ai;var A0="AlertDialogTitle",R0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return f.jsx(uj,{...i,...r,ref:t})});R0.displayName=A0;var I0="AlertDialogDescription",M0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return f.jsx(cj,{...i,...r,ref:t})});M0.displayName=I0;var xj="AlertDialogAction",L0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return f.jsx(E0,{...i,...r,ref:t})});L0.displayName=xj;var O0="AlertDialogCancel",D0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=yj(O0,n),o=En(n),l=pe(t,i);return f.jsx(E0,{...o,...r,ref:l})});D0.displayName=O0;var wj=({contentRef:e})=>{const t=`\`${ai}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ai}\` by passing a \`${I0}\` 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 \`${ai}\`. 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=P0,kj=j0,z0=T0,F0=_0,B0=L0,$0=D0,U0=R0,V0=M0;const qa=Sj,Cj=kj,H0=g.forwardRef(({className:e,...t},n)=>f.jsx(z0,{className:ae("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}));H0.displayName=z0.displayName;const Ml=g.forwardRef(({className:e,...t},n)=>f.jsxs(Cj,{children:[f.jsx(H0,{}),f.jsx(F0,{ref:n,className:ae("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})]}));Ml.displayName=F0.displayName;const Ll=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ll.displayName="AlertDialogHeader";const Ol=({className:e,...t})=>f.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ol.displayName="AlertDialogFooter";const Dl=g.forwardRef(({className:e,...t},n)=>f.jsx(U0,{ref:n,className:ae("text-lg font-semibold",e),...t}));Dl.displayName=U0.displayName;const zl=g.forwardRef(({className:e,...t},n)=>f.jsx(V0,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));zl.displayName=V0.displayName;const Fl=g.forwardRef(({className:e,...t},n)=>f.jsx(B0,{ref:n,className:ae(Dd(),e),...t}));Fl.displayName=B0.displayName;const Bl=g.forwardRef(({className:e,...t},n)=>f.jsx($0,{ref:n,className:ae(Dd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Bl.displayName=$0.displayName;const W0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:ae("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}));W0.displayName="Textarea";function bj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ej=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pj={};function xm(e,t){return((t||Pj).jsx?Nj:Ej).test(e)}const jj=/[ \t\n\f\r]/g;function Tj(e){return typeof e=="object"?e.type==="text"?wm(e.value):!1:wm(e)}function wm(e){return e.replace(jj,"")===""}class Ho{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ho.prototype.normal={};Ho.prototype.property={};Ho.prototype.space=void 0;function K0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ho(n,r,t)}function Nc(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="";ut.prototype.booleanish=!1;ut.prototype.boolean=!1;ut.prototype.commaOrSpaceSeparated=!1;ut.prototype.commaSeparated=!1;ut.prototype.defined=!1;ut.prototype.mustUseProperty=!1;ut.prototype.number=!1;ut.prototype.overloadedBoolean=!1;ut.prototype.property="";ut.prototype.spaceSeparated=!1;ut.prototype.space=void 0;let _j=0;const J=Tr(),Ie=Tr(),Pc=Tr(),$=Tr(),ve=Tr(),ui=Tr(),dt=Tr();function Tr(){return 2**++_j}const jc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Ie,commaOrSpaceSeparated:dt,commaSeparated:ui,number:$,overloadedBoolean:Pc,spaceSeparated:ve},Symbol.toStringTag,{value:"Module"})),Ja=Object.keys(jc);class of extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),Sm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Lj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(km,zj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!km.test(o)){let l=o.replace(Mj,Dj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=of}return new i(r,t)}function Dj(e){return"-"+e.toLowerCase()}function zj(e){return e.charAt(1).toUpperCase()}const Fj=K0([G0,Aj,X0,q0,J0],"html"),lf=K0([G0,Rj,X0,q0,J0],"svg");function Bj(e){return e.join(" ").trim()}var sf={},Cm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$j=/\n/g,Uj=/^\s*/,Vj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hj=/^:\s*/,Wj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Kj=/^[;\s]*/,Gj=/^\s+|\s+$/g,Qj=` +`,bm="/",Em="*",ar="",Yj="comment",Xj="declaration",qj=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var v=w.match($j);v&&(n+=v.length);var S=w.lastIndexOf(Qj);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(v){return v.position=new l(w),u(),v}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var v=new Error(t.source+":"+n+":"+r+": "+w);if(v.reason=w,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(w){var v=w.exec(e);if(v){var S=v[0];return i(S),e=e.slice(S.length),v}}function u(){a(Uj)}function d(w){var v;for(w=w||[];v=c();)v!==!1&&w.push(v);return w}function c(){var w=o();if(!(bm!=e.charAt(0)||Em!=e.charAt(1))){for(var v=2;ar!=e.charAt(v)&&(Em!=e.charAt(v)||bm!=e.charAt(v+1));)++v;if(v+=2,ar===e.charAt(v-1))return s("End of comment missing");var S=e.slice(2,v-2);return r+=2,i(S),e=e.slice(v),r+=2,w({type:Yj,comment:S})}}function p(){var w=o(),v=a(Vj);if(v){if(c(),!a(Hj))return s("property missing ':'");var S=a(Wj),y=w({type:Xj,property:Nm(v[0].replace(Cm,ar)),value:S?Nm(S[0].replace(Cm,ar)):ar});return a(Kj),y}}function m(){var w=[];d(w);for(var v;v=p();)v!==!1&&(w.push(v),d(w));return w}return u(),m()};function Nm(e){return e?e.replace(Gj,ar):ar}var Jj=Vl&&Vl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sf,"__esModule",{value:!0});sf.default=eT;var Zj=Jj(qj);function eT(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Zj.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.camelCase=void 0;var tT=/^--[a-zA-Z0-9_-]+$/,nT=/-([a-z])/g,rT=/^[^-]+$/,iT=/^-(webkit|moz|ms|o|khtml)-/,oT=/^-(ms)-/,lT=function(e){return!e||rT.test(e)||tT.test(e)},sT=function(e,t){return t.toUpperCase()},Pm=function(e,t){return"".concat(t,"-")},aT=function(e,t){return t===void 0&&(t={}),lT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(oT,Pm):e=e.replace(iT,Pm),e.replace(nT,sT))};ia.camelCase=aT;var uT=Vl&&Vl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cT=uT(sf),dT=ia;function Tc(e,t){var n={};return!e||typeof e!="string"||(0,cT.default)(e,function(r,i){r&&i&&(n[(0,dT.camelCase)(r,t)]=i)}),n}Tc.default=Tc;var fT=Tc;const pT=Ps(fT),Z0=e1("end"),af=e1("start");function e1(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 mT(e){const t=af(e),n=Z0(e);if(t&&n)return{start:t,end:n}}function ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?jm(e.position):"start"in e||"end"in e?jm(e):"line"in e||"column"in e?_c(e):""}function _c(e){return Tm(e&&e.line)+":"+Tm(e&&e.column)}function jm(e){return _c(e&&e.start)+"-"+_c(e&&e.end)}function Tm(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ao(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const uf={}.hasOwnProperty,hT=new Map,gT=/[A-Z]/g,yT=new Set(["table","tbody","thead","tfoot","tr"]),vT=new Set(["td","th"]),t1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xT(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=PT(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=NT(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lf:Fj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=n1(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function n1(e,t,n){if(t.type==="element")return wT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ST(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CT(e,t,n);if(t.type==="mdxjsEsm")return kT(e,t);if(t.type==="root")return bT(e,t,n);if(t.type==="text")return ET(e,t)}function wT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lf,e.schema=i),e.ancestors.push(t);const o=i1(e,t.tagName,!1),l=jT(e,t);let s=df(e,t);return yT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!Tj(a):!0})),r1(e,l,o,t),cf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function ST(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)}Io(e,t.position)}function kT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Io(e,t.position)}function CT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:i1(e,t.name,!0),l=TT(e,t),s=df(e,t);return r1(e,l,o,t),cf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function bT(e,t,n){const r={};return cf(r,df(e,t)),e.create(t,e.Fragment,r,n)}function ET(e,t){return t.value}function r1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function NT(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function PT(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=af(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function jT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&uf.call(t.properties,i)){const o=_T(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&vT.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function TT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Io(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Io(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function df(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:hT;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(an(e,e.length,0,t),e):t}const Rm={}.hasOwnProperty;function zT(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 ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tn=or(/[A-Za-z]/),ht=or(/[\dA-Za-z]/),$T=or(/[#-'*+\--9=?A-Z^-~]/);function Ac(e){return e!==null&&(e<32||e===127)}const Rc=or(/\d/),UT=or(/[\dA-Fa-f]/),VT=or(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function fe(e){return e===-2||e===-1||e===32}const HT=or(/\p{P}|\p{S}/u),WT=or(/\s/);function or(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ri(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function we(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return fe(a)?(e.enter(n),s(a)):t(a)}function s(a){return fe(a)&&o++l))return;const P=t.events.length;let _=P,F,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(F){M=t.events[_][1].end;break}F=!0}for(y(r),E=P;Ex;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function XT(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Mm(e){if(e===null||at(e)||WT(e))return 1;if(HT(e))return 2}function pf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Lm(c,-a),Lm(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},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=bt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=bt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=bt(u,pf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=bt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,an(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&fe(E)?we(e,h,"linePrefix",o+1)(E):h(E)}function h(E){return E===null||X(E)?e.check(Om,v,C)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||X(E)?(e.exit("codeFlowValue"),h(E)):(e.consume(E),x)}function C(E){return e.exit("codeFenced"),t(E)}function N(E,P,_){let F=0;return M;function M(O){return E.enter("lineEnding"),E.consume(O),E.exit("lineEnding"),A}function A(O){return E.enter("codeFencedFence"),fe(O)?we(E,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):R(O)}function R(O){return O===s?(E.enter("codeFencedFenceSequence"),U(O)):_(O)}function U(O){return O===s?(F++,E.consume(O),U):F>=l?(E.exit("codeFencedFenceSequence"),fe(O)?we(E,H,"whitespace")(O):H(O)):_(O)}function H(O){return O===null||X(O)?(E.exit("codeFencedFence"),P(O)):_(O)}}}function a_(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const eu={name:"codeIndented",tokenize:c_},u_={partial:!0,tokenize:d_};function c_(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),we(e,o,"linePrefix",4+1)(u)}function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):X(u)?e.attempt(u_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function d_(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):we(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const f_={name:"codeText",previous:m_,resolve:p_,tokenize:h_};function p_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Wi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wi(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 d1(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let d=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||Ac(y)?n(y):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||X(y)?n(y):(e.consume(y),y===92?w:m)}function w(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!d&&(y===null||y===41||at(y))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(y)):d999||m===null||m===91||m===93&&!a||m===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):X(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===null||m===91||m===93||X(m)||s++>999?(e.exit("chunkString"),d(m)):(e.consume(m),a||(a=!fe(m)),m===92?p:c)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,c):c(m)}}function p1(e,t,n,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),we(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||X(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:d)}function c(p){return p===l||p===92?(e.consume(p),d):d(p)}}function uo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):fe(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const C_={name:"definition",tokenize:E_},b_={partial:!0,tokenize:N_};function E_(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return f1.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a):n(m)}function a(m){return at(m)?uo(e,u)(m):u(m)}function u(m){return d1(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(b_,c,c)(m)}function c(m){return fe(m)?we(e,p,"whitespace")(m):p(m)}function p(m){return m===null||X(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function N_(e,t,n){return r;function r(s){return at(s)?uo(e,i)(s):n(s)}function i(s){return p1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return fe(s)?we(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const P_={name:"hardBreakEscape",tokenize:j_};function j_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return X(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const T_={name:"headingAtx",resolve:__,tokenize:A_};function __(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},an(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function A_(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||at(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),a(d)):d===null||X(d)?(e.exit("atxHeading"),t(d)):fe(d)?we(e,s,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),s(d))}function u(d){return d===null||d===35||at(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const R_=["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"],zm=["pre","script","style","textarea"],I_={concrete:!0,name:"htmlFlow",resolveTo:O_,tokenize:D_},M_={partial:!0,tokenize:F_},L_={partial:!0,tokenize:z_};function O_(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 D_(e,t,n){const r=this;let i,o,l,s,a;return u;function u(b){return d(b)}function d(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),o=!0,v):b===63?(e.consume(b),i=3,r.interrupt?t:k):tn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),i=2,m):b===91?(e.consume(b),i=5,s=0,w):tn(b)?(e.consume(b),i=4,r.interrupt?t:k):n(b)}function m(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const q="CDATA[";return b===q.charCodeAt(s++)?(e.consume(b),s===q.length?r.interrupt?t:R:w):n(b)}function v(b){return tn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||at(b)){const q=b===47,ge=l.toLowerCase();return!q&&!o&&zm.includes(ge)?(i=1,r.interrupt?t(b):R(b)):R_.includes(l.toLowerCase())?(i=6,q?(e.consume(b),y):r.interrupt?t(b):R(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?h(b):x(b))}return b===45||ht(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function y(b){return b===62?(e.consume(b),r.interrupt?t:R):n(b)}function h(b){return fe(b)?(e.consume(b),h):M(b)}function x(b){return b===47?(e.consume(b),M):b===58||b===95||tn(b)?(e.consume(b),C):fe(b)?(e.consume(b),x):M(b)}function C(b){return b===45||b===46||b===58||b===95||ht(b)?(e.consume(b),C):N(b)}function N(b){return b===61?(e.consume(b),E):fe(b)?(e.consume(b),N):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,P):fe(b)?(e.consume(b),E):_(b)}function P(b){return b===a?(e.consume(b),a=null,F):b===null||X(b)?n(b):(e.consume(b),P)}function _(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||at(b)?N(b):(e.consume(b),_)}function F(b){return b===47||b===62||fe(b)?x(b):n(b)}function M(b){return b===62?(e.consume(b),A):n(b)}function A(b){return b===null||X(b)?R(b):fe(b)?(e.consume(b),A):n(b)}function R(b){return b===45&&i===2?(e.consume(b),L):b===60&&i===1?(e.consume(b),D):b===62&&i===4?(e.consume(b),G):b===63&&i===3?(e.consume(b),k):b===93&&i===5?(e.consume(b),B):X(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(M_,Y,U)(b)):b===null||X(b)?(e.exit("htmlFlowData"),U(b)):(e.consume(b),R)}function U(b){return e.check(L_,H,Y)(b)}function H(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),O}function O(b){return b===null||X(b)?U(b):(e.enter("htmlFlowData"),R(b))}function L(b){return b===45?(e.consume(b),k):R(b)}function D(b){return b===47?(e.consume(b),l="",T):R(b)}function T(b){if(b===62){const q=l.toLowerCase();return zm.includes(q)?(e.consume(b),G):R(b)}return tn(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),T):R(b)}function B(b){return b===93?(e.consume(b),k):R(b)}function k(b){return b===62?(e.consume(b),G):b===45&&i===2?(e.consume(b),k):R(b)}function G(b){return b===null||X(b)?(e.exit("htmlFlowData"),Y(b)):(e.consume(b),G)}function Y(b){return e.exit("htmlFlow"),t(b)}}function z_(e,t,n){const r=this;return i;function i(l){return X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function F_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(oa,t,n)}}const B_={name:"htmlText",tokenize:$_};function $_(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),N):k===63?(e.consume(k),x):tn(k)?(e.consume(k),_):n(k)}function u(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),o=0,w):tn(k)?(e.consume(k),h):n(k)}function d(k){return k===45?(e.consume(k),m):n(k)}function c(k){return k===null?n(k):k===45?(e.consume(k),p):X(k)?(l=c,D(k)):(e.consume(k),c)}function p(k){return k===45?(e.consume(k),m):c(k)}function m(k){return k===62?L(k):k===45?p(k):c(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(o++)?(e.consume(k),o===G.length?v:w):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(l=v,D(k)):(e.consume(k),v)}function S(k){return k===93?(e.consume(k),y):v(k)}function y(k){return k===62?L(k):k===93?(e.consume(k),y):v(k)}function h(k){return k===null||k===62?L(k):X(k)?(l=h,D(k)):(e.consume(k),h)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):X(k)?(l=x,D(k)):(e.consume(k),x)}function C(k){return k===62?L(k):x(k)}function N(k){return tn(k)?(e.consume(k),E):n(k)}function E(k){return k===45||ht(k)?(e.consume(k),E):P(k)}function P(k){return X(k)?(l=P,D(k)):fe(k)?(e.consume(k),P):L(k)}function _(k){return k===45||ht(k)?(e.consume(k),_):k===47||k===62||at(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),L):k===58||k===95||tn(k)?(e.consume(k),M):X(k)?(l=F,D(k)):fe(k)?(e.consume(k),F):L(k)}function M(k){return k===45||k===46||k===58||k===95||ht(k)?(e.consume(k),M):A(k)}function A(k){return k===61?(e.consume(k),R):X(k)?(l=A,D(k)):fe(k)?(e.consume(k),A):F(k)}function R(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,U):X(k)?(l=R,D(k)):fe(k)?(e.consume(k),R):(e.consume(k),H)}function U(k){return k===i?(e.consume(k),i=void 0,O):k===null?n(k):X(k)?(l=U,D(k)):(e.consume(k),U)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||at(k)?F(k):(e.consume(k),H)}function O(k){return k===47||k===62||at(k)?F(k):n(k)}function L(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function D(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),T}function T(k){return fe(k)?we(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):B(k)}function B(k){return e.enter("htmlTextData"),l(k)}}const mf={name:"labelEnd",resolveAll:W_,resolveTo:K_,tokenize:G_},U_={tokenize:Q_},V_={tokenize:Y_},H_={tokenize:X_};function W_(e){let t=-1;const n=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),fe(u)?we(e,s,"whitespace")(u):s(u))}}const tt={continuation:{tokenize:lA},exit:aA,name:"list",tokenize:oA},rA={partial:!0,tokenize:uA},iA={partial:!0,tokenize:sA};function oA(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Rc(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check($l,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return Rc(m)&&++l<10?(e.consume(m),a):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(oa,r.interrupt?n:d,e.attempt(rA,p,c))}function d(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function c(m){return fe(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function lA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oa,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!fe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function sA(e,t,n){const r=this;return we(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function aA(e){e.exit(this.containerState.type)}function uA(e,t,n){const r=this;return we(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Fm={name:"setextUnderline",resolveTo:cA,tokenize:dA};function cA(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function dA(e,t,n){const r=this;let i;return o;function o(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"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),fe(u)?we(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const fA={tokenize:pA};function pA(e){const t=this,n=e.attempt(oa,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(v_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const mA={resolveAll:h1()},hA=m1("string"),gA=m1("text");function m1(e){return{resolveAll:h1(e==="text"?yA:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(d){return u(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),a}function a(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),a)}function u(d){if(d===null)return!0;const c=i[d];let p=-1;if(c)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function _A(e,t){let n=-1;const r=[];let i;for(;++n0){const Se=V.tokenStack[V.tokenStack.length-1];(Se[1]||$m).call(V,void 0,Se[0])}for(j.position={start:jn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:jn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee1?"-"+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 GA(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 QA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function v1(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function YA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v1(e,t);const i={src:Ri(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function XA(e,t){const n={src:Ri(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 qA(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 JA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v1(e,t);const i={href:Ri(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function ZA(e,t){const n={href:Ri(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 eR(e,t,n){const r=e.all(t),i=n?tR(n):x1(t),o={},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:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function nR(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=af(t.children[1]),a=Z0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function sR(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Hm(t.slice(i),i>0,!1)),o.join("")}function Hm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Um||o===Vm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Um||o===Vm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cR(e,t){const n={type:"text",value:uR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fR={blockquote:$A,break:UA,code:VA,delete:HA,emphasis:WA,footnoteReference:KA,heading:GA,html:QA,imageReference:YA,image:XA,inlineCode:qA,linkReference:JA,link:ZA,listItem:eR,list:nR,paragraph:rR,root:iR,strong:oR,table:lR,tableCell:aR,tableRow:sR,text:cR,thematicBreak:dR,toml:gl,yaml:gl,definition:gl,footnoteDefinition:gl};function gl(){}const w1=-1,la=0,co=1,Es=2,hf=3,gf=4,yf=5,vf=6,S1=7,k1=8,Wm=typeof self=="object"?self:globalThis,pR=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case la:case w1:return n(l,i);case co:{const s=n([],i);for(const a of l)s.push(r(a));return s}case Es:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case hf:return n(new Date(l),i);case gf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case yf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case vf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case S1:{const{name:s,message:a}=l;return n(new Wm[s](a),i)}case k1:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Wm[o](l),i)};return r},Km=e=>pR(new Map,e)(0),Dr="",{toString:mR}={},{keys:hR}=Object,Ki=e=>{const t=typeof e;if(t!=="object"||!e)return[la,t];const n=mR.call(e).slice(8,-1);switch(n){case"Array":return[co,Dr];case"Object":return[Es,Dr];case"Date":return[hf,Dr];case"RegExp":return[gf,Dr];case"Map":return[yf,Dr];case"Set":return[vf,Dr];case"DataView":return[co,n]}return n.includes("Array")?[co,n]:n.includes("Error")?[S1,n]:[Es,n]},yl=([e,t])=>e===la&&(t==="function"||t==="symbol"),gR=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Ki(l);switch(s){case la:{let d=l;switch(a){case"bigint":s=k1,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return i([w1],l)}return i([s,d],l)}case co:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const d=[],c=i([s,d],l);for(const p of l)d.push(o(p));return c}case Es:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const d=[],c=i([s,d],l);for(const p of hR(l))(e||!yl(Ki(l[p])))&&d.push([o(p),o(l[p])]);return c}case hf:return i([s,l.toISOString()],l);case gf:{const{source:d,flags:c}=l;return i([s,{source:d,flags:c}],l)}case yf:{const d=[],c=i([s,d],l);for(const[p,m]of l)(e||!(yl(Ki(p))||yl(Ki(m))))&&d.push([o(p),o(m)]);return c}case vf:{const d=[],c=i([s,d],l);for(const p of l)(e||!yl(Ki(p)))&&d.push(o(p));return c}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Gm=(e,{json:t,lossy:n}={})=>{const r=[];return gR(!(t||n),!!t,new Map,r)(e),r},Ns=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Km(Gm(e,t)):structuredClone(e):(e,t)=>Km(Gm(e,t));function yR(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 vR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function xR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yR,r=e.options.footnoteBackLabel||vR,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let h=typeof n=="string"?n:n(a,m);typeof h=="string"&&(h={type:"text",value:h}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,m),className:["data-footnote-backref"]},children:Array.isArray(h)?h:[h]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const h=S.children[S.children.length-1];h&&h.type==="text"?h.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else d.push(...w);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ns(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const C1=function(e){if(e==null)return CR;if(typeof e=="function")return sa(e);if(typeof e=="object")return Array.isArray(e)?wR(e):SR(e);if(typeof e=="string")return kR(e);throw new Error("Expected function, string, or object as test")};function wR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=b1,w,v,S;if((!t||o(a,u,d[d.length-1]||void 0))&&(m=jR(n(a,d)),m[0]===Qm))return m;if("children"in a&&a.children){const y=a;if(y.children&&m[0]!==NR)for(v=(r?y.children.length:-1)+l,S=d.concat(y);v>-1&&v0&&n.push({type:"text",value:` +`}),n}function Ym(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xm(e,t){const n=_R(e,t),r=n.one(e,void 0),i=xR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function LR(e,t){return e&&"run"in e?async function(n,r){const i=Xm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Xm(n,{file:r,...e||t})}}function qm(e){if(e)throw e}var Ul=Object.prototype.hasOwnProperty,N1=Object.prototype.toString,Jm=Object.defineProperty,Zm=Object.getOwnPropertyDescriptor,eh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):N1.call(t)==="[object Array]"},th=function(t){if(!t||N1.call(t)!=="[object Object]")return!1;var n=Ul.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ul.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ul.call(t,i)},nh=function(t,n){Jm&&n.name==="__proto__"?Jm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rh=function(t,n){if(n==="__proto__")if(Ul.call(t,n)){if(Zm)return Zm(t,n).value}else return;return t[n]},OR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const d=u;if(s&&n)throw d;return i(d)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const Jt={basename:FR,dirname:BR,extname:$R,join:UR,sep:"/"};function FR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function BR(e){if(Wo(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 $R(e){Wo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function UR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HR(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function Wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const WR={cwd:KR};function KR(){return"/"}function Oc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function GR(e){if(typeof e=="string")e=new URL(e);else if(!Oc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return QR(e)}function QR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...w]=d;const v=r[p][1];Lc(v)&&Lc(m)&&(m=nu(!0,v,m)),r[p]=[u,m,...w]}}}}const JR=new xf().freeze();function lu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function su(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function au(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 oh(e){if(!Lc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vl(e){return ZR(e)?e:new P1(e)}function ZR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eI(e){return typeof e=="string"||tI(e)}function tI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sh=[],ah={allowDangerousHtml:!0},rI=/^(https?|ircs?|mailto|xmpp)$/i,iI=[{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 oI(e){const t=lI(e),n=sI(e);return aI(t.runSync(t.parse(n),n),e)}function lI(e){const t=e.rehypePlugins||sh,n=e.remarkPlugins||sh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ah}:ah;return JR().use(BA).use(n).use(LR,r).use(t)}function sI(e){const t=e.children||"",n=new P1;return typeof t=="string"&&(n.value=t),n}function aI(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||uI;for(const d of iI)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+nI+d.id,void 0);return E1(e,u),xT(e,{Fragment:f.Fragment,components:i,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 m;for(m in Za)if(Object.hasOwn(Za,m)&&Object.hasOwn(d.properties,m)){const w=d.properties[m],v=Za[m];(v===null||v.includes(d.tagName))&&(d.properties[m]=a(String(w||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!m&&r&&typeof c=="number"&&(m=!r(d,c,p)),m&&p&&typeof c=="number")return s&&d.children?p.children.splice(c,1,...d.children):p.children.splice(c,1),c}}}function uI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rI.test(e.slice(0,t))?e:""}const j1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,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:ae("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:ae("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(qr,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:ae("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 flex items-center gap-2",children:[f.jsx("span",{children:c.role==="user"?"You":c.assistantInfo?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"font-medium",children:c.assistantInfo.name}),c.assistantInfo.type!=="default"&&f.jsx("span",{className:ae("inline-block px-1.5 py-0.5 rounded text-[10px] font-medium ml-1",c.assistantInfo.type==="user"&&"bg-blue-100 text-blue-700",c.assistantInfo.type==="template"&&"bg-gray-100 text-gray-700",c.assistantInfo.type==="new"&&"bg-green-100 text-green-700"),children:c.assistantInfo.type==="user"?"Mine":c.assistantInfo.type==="template"?"Template":"New"}),c.assistantInfo.originalTemplate&&f.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",c.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),f.jsx("span",{children:"•"}),f.jsxs("span",{children:["#",p+1]})]}),f.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:f.jsx(oI,{components:{p:({children:m})=>f.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>f.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>f.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>f.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?f.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):f.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>f.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>f.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>f.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>f.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>f.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>f.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>f.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},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(Yy,{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:i,className:"flex gap-2",children:[f.jsx(W0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),i(c))}}),o?f.jsx(Ae,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(jb,{className:"h-4 w-4"})}):f.jsx(Ae,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(wb,{className:"h-4 w-4"})})]})})]})});j1.displayName="Chat";const Xt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function T1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function cI(){return T1()}class dI{getAllSessions(){const t=localStorage.getItem(Xt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:T1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},o=this.getAllSessions();return o.unshift(i),localStorage.setItem(Xt.sessions,JSON.stringify(o)),i}updateSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);i!==-1&&(r[i]={...r[i],...n,updatedAt:Date.now()},localStorage.setItem(Xt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Xt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Xt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:cI(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Xt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Xt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Xt.currentSession,t)}clear(){localStorage.removeItem(Xt.sessions),localStorage.removeItem(Xt.currentSession)}}const _e=new dI;function fI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[d,c]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,v]=g.useState(r),[S,y]=g.useState(.7),[h,x]=g.useState(1024),C=Lt.useMemo(()=>{var L;const O=i.find(D=>D.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((L=O==null?void 0:O.messages)==null?void 0:L.length)||0,sessionTitle:(O==null?void 0:O.title)||"No session"}),O},[i,l]),N=Lt.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(L=>({id:L.id,role:L.role}))),O},[C==null?void 0:C.messages]);g.useEffect(()=>{const O=_e.getAllSessions();o(O);const L=_e.getCurrentSession();L&&s(L.id)},[]);const E=g.useCallback(()=>{const O=_e.createSession(void 0,p,w),L=_e.getAllSessions();return o([...L]),s(O.id),_e.setCurrentSession(O.id),O.id},[p,w]),P=g.useCallback(O=>{console.log("selectSession called with:",O),s(O),_e.setCurrentSession(O),console.log("currentSessionId updated to:",O)},[]),_=g.useCallback(O=>{_e.deleteSession(O);const L=_e.getAllSessions();o([...L]),l===O&&(L.length>0?(s(L[0].id),_e.setCurrentSession(L[0].id)):s(null))},[l]),F=g.useCallback((O,L)=>{_e.updateSession(O,{title:L});const D=_e.getAllSessions();o([...D])},[]),M=g.useCallback(O=>{if(!l)return;_e.addMessageToSession(l,O);const L=_e.getAllSessions();o([...L])},[l]),A=g.useCallback(async O=>{var T,B;if(!a.trim()||d.isLoading)return;let L=l;L||(L=E());const D=a.trim();if(u(""),c({isLoading:!0,error:null}),L){_e.addMessageToSession(L,{role:"user",content:D});const k=_e.getAllSessions();o([...k])}try{const k=_e.getSession(L),G=((B=(T=k==null?void 0:k.messages)==null?void 0:T.filter(q=>q.role!=="system"))==null?void 0:B.map(q=>({role:q.role,content:q.content})))||[],Y=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:G,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h})});if(!Y.ok){const q=await Y.json();throw new Error(q.detail||`HTTP error! status: ${Y.status}`)}const b=await Y.json();if(L){_e.addMessageToSession(L,{role:"assistant",content:b.content,thinking_content:b.thinking_content,model_used:b.model_used,supports_thinking:b.supports_thinking,assistantInfo:O});const q=_e.getAllSessions();o([...q])}c({isLoading:!1,error:null})}catch(k){const G=k instanceof Error?k.message:"An error occurred";if(c({isLoading:!1,error:G}),L){_e.addMessageToSession(L,{role:"assistant",content:`Sorry, I encountered an error: ${G}`,assistantInfo:O});const Y=_e.getAllSessions();o([...Y])}}},[a,d.isLoading,l,E,M,w,N.length,t,p,S,h]),R=g.useCallback(()=>{c({isLoading:!1,error:null})},[]),U=g.useCallback(()=>{_e.clear(),o([]),s(null)},[]),H=g.useCallback(()=>{s(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:E,selectSession:P,deleteSession:_,renameSession:F,clearAllSessions:U,clearCurrentSession:H,messages:N,input:a,setInput:u,sendMessage:A,stopGeneration:R,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:y,maxTokens:h,setMaxTokens:x}}function pI(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:s,sendMessage:a,stopGeneration:u,isLoading:d,selectedModel:c,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:v,setTemperature:S,maxTokens:y,setMaxTokens:h}=fI(),[x,C]=g.useState(!1),[N,E]=g.useState(!1),[P,_]=g.useState(null),[F,M]=g.useState(!1),[A,R]=g.useState(null),[U,H]=g.useState([]),[O,L]=g.useState([]),[D,T]=g.useState(null),[B,k]=g.useState(!1),[G,Y]=g.useState(""),[b,q]=g.useState(!1),[ge,te]=g.useState(""),Q=()=>{try{const j=JSON.parse(localStorage.getItem("savedAssistants")||"[]");L(j)}catch(j){console.error("Failed to load saved assistants:",j)}},oe=()=>{if(!m.trim())return;let j="My Assistant";D&&(D.type==="new"?j=D.name:D.type==="template"?j=`My ${D.name}`:j=D.name+" Copy"),Y(j),k(!0)},ye=()=>{if(!G.trim()||!m.trim())return;const j={id:Date.now().toString(),name:G.trim(),systemPrompt:m,temperature:v,maxTokens:y,model:c,createdAt:new Date().toISOString()},V=[...O,j];L(V),localStorage.setItem("savedAssistants",JSON.stringify(V)),T({id:j.id,name:j.name,type:"user"}),k(!1),Y("")},le=()=>{k(!1),Y("")},ue=j=>{const V=O.find(K=>K.id===j);V&&(w(V.systemPrompt),S(V.temperature),h(V.maxTokens),V.model&&p(V.model),T({id:V.id,name:V.name,type:"user"}))},ce=[{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."}],Be=j=>{const V=ce.find(K=>K.name===j);V&&(w(V.prompt),T({id:j,name:V.name,type:"template"}))},et=()=>{w(""),S(.7),h(1024),T({id:"new_assistant",name:"New Assistant",type:"new"})},Gt=()=>{T(null)},Qt=()=>{D&&(te(D.name),q(!0))},_t=()=>{if(!D||!ge.trim())return;const j={...D,name:ge.trim()};if(T(j),D.type==="user"){const V=O.map(K=>K.id===D.id?{...K,name:ge.trim()}:K);L(V),localStorage.setItem("savedAssistants",JSON.stringify(V))}q(!1),te("")},_r=()=>{q(!1),te("")},cn=()=>({name:(D==null?void 0:D.name)||"Default Assistant",type:(D==null?void 0:D.type)||"default",systemPrompt:m,temperature:v,maxTokens:y,originalTemplate:D==null?void 0:D.originalTemplate}),Ar=()=>{D&&D.type==="template"&&T({id:"new_assistant",name:`Custom ${D.name}`,type:"new",originalTemplate:D.name})},aa=j=>{w(j),Ar()},ua=j=>{S(j),Ar()},ca=j=>{h(j),Ar()};g.useEffect(()=>{I(),Q()},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:x,configCollapsed:N,sessionsCount:e.length,currentSessionId:t})},[x,N,e.length,t]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(j=>({id:j.id,title:j.title})))},[e]),g.useEffect(()=>{if(c&&!U.find(j=>j.model_name===c)){const j=U[0];j&&p(j.model_name)}},[U,c,p]),g.useEffect(()=>{(async()=>{if(!c||!U.length)return;const V=U.find(Se=>Se.model_name===c);if(!V)return;const K=`${window.location.protocol}//${window.location.host}`;if(V.type==="local"&&!V.is_loaded){R(V),M(!0);return}const ee=U.filter(Se=>Se.type==="local"&&Se.is_loaded&&Se.model_name!==c);for(const Se of ee)try{(await fetch(`${K}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Se.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Se.model_name}`)}catch(St){console.error(`Error auto-unloading model ${Se.model_name}:`,St)}ee.length>0&&I()})()},[c,U]);const da=async()=>{if(A){M(!1),_(A.model_name);try{const j=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${j}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:A.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${A.model_name}`),I();else{console.error(`❌ Failed to load model: ${A.model_name}`);const K=U.find(ee=>ee.type==="api");K&&p(K.model_name)}}catch(j){console.error("Error loading model:",j);const V=U.find(K=>K.type==="api");V&&p(V.model_name)}finally{_(null),R(null)}}},fa=()=>{M(!1),R(null);const j=U.find(V=>V.type==="api");j&&p(j.model_name)};g.useEffect(()=>{const j=async()=>{const V=`${window.location.protocol}//${window.location.host}`,K=U.filter(ee=>ee.type==="local"&&ee.is_loaded);for(const ee of K)try{await fetch(`${V}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ee.model_name})}),console.log(`✅ Cleanup: unloaded ${ee.model_name}`)}catch(Se){console.error(`Error cleaning up model ${ee.model_name}:`,Se)}};return()=>{j()}},[U]);const I=async()=>{try{const j=`${window.location.protocol}//${window.location.host}`,V=await fetch(`${j}/models`);if(V.ok){const K=await V.json();if(H(K.models),K.current_model&&c!==K.current_model)p(K.current_model);else if(!c&&K.models.length>0){const Se=K.models.find(St=>St.type==="api")||K.models[0];p(Se.model_name)}}}catch(j){console.error("Failed to fetch models:",j)}};return f.jsxs("div",{className:"h-screen bg-background flex",children:[f.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${x?"w-12":"w-80"} + `,children:f.jsxs("div",{className:"p-4 space-y-4 h-full",children:[f.jsxs("div",{className:`flex items-center ${x?"justify-center":"justify-between"}`,children:[!x&&f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs("div",{className:"flex gap-1",children:[!x&&f.jsxs(Ae,{onClick:i,size:"sm",children:[f.jsx(ys,{className:"h-4 w-4 mr-1"}),"New"]}),f.jsx(Ae,{onClick:()=>C(!x),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:x?"Expand Sessions":"Collapse Sessions",children:x?f.jsx(Vp,{className:"h-4 w-4"}):f.jsx(Up,{className:"h-4 w-4"})})]})]}),x&&f.jsx(Ae,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:f.jsx(ys,{className:"h-4 w-4"})}),f.jsxs("div",{className:"space-y-2",children:[!x&&e.map(j=>f.jsxs(st,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===j.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",j.id,j.title),n(j.id)},children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:j.title}),f.jsx(Ae,{size:"sm",variant:"ghost",onClick:V=>{V.stopPropagation(),r(j.id)},className:"h-6 w-6 p-0",children:f.jsx(Gy,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[j.messages.length," messages"]})]},j.id)),x&&e.map(j=>f.jsxs(Ae,{variant:t===j.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:j.title,onClick:()=>{console.log("Session icon clicked:",j.id,j.title),n(j.id)},children:[f.jsx(Ws,{className:"h-4 w-4"}),j.messages&&j.messages.length>0&&f.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(j.messages.length,9)})]},j.id))]})]})}),f.jsx("div",{className:"flex-1 flex flex-col h-full",children:f.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:f.jsx(j1,{messages:o.map(j=>({id:j.id,role:j.role,content:j.content,createdAt:new Date(j.timestamp),assistantInfo:j.assistantInfo})),input:l,handleInputChange:j=>s(j.target.value),handleSubmit:async j=>{if(j.preventDefault(),!c||!U.find(K=>K.model_name===c))return;const V=cn();await a(V)},isGenerating:d,stop:u,className:"flex-1"})}),f.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${N?"w-12":"w-[480px] xl:w-[520px]"} + `,children:f.jsxs("div",{className:"p-4 space-y-4 h-full",children:[f.jsxs("div",{className:`flex items-center ${N?"justify-center":"justify-between"}`,children:[!N&&f.jsx("h2",{className:"font-semibold",children:"Configuration"}),f.jsx("div",{className:"flex gap-1",children:f.jsx(Ae,{onClick:()=>E(!N),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:N?"Expand Configuration":"Collapse Configuration",children:N?f.jsx(Up,{className:"h-4 w-4"}):f.jsx(Vp,{className:"h-4 w-4"})})})]}),N&&f.jsx(Ae,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:f.jsx(ii,{className:"h-4 w-4"})}),f.jsx("div",{className:"space-y-2",children:!N&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:f.jsx(hI,{savedAssistants:O,loadSavedAssistant:ue,openSaveDialog:oe,presets:ce,onPresetSelect:Be,isLoading:d,selectedAssistant:D,createNewAssistant:et,clearCurrentAssistant:Gt,openRenameDialog:Qt,systemPrompt:m})}),f.jsxs(PE,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[f.jsxs(vv,{className:"grid w-full grid-cols-2 m-4 mb-0",children:[f.jsxs(cc,{value:"parameters",className:"flex items-center gap-2",children:[f.jsx(Nb,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),f.jsxs(cc,{value:"instructions",className:"flex items-center gap-2",children:[f.jsx(ii,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsx(dc,{value:"parameters",className:"p-6 space-y-6 m-0",children:f.jsx(mI,{models:U,selectedModel:c,setSelectedModel:p,autoLoadingModel:P,temperature:v,setTemperature:ua,maxTokens:y,setMaxTokens:ca})}),f.jsx(dc,{value:"instructions",className:"p-6 space-y-6 m-0",children:f.jsx(gI,{systemPrompt:m,setSystemPrompt:aa,isLoading:d})})]})]})]})})]})})]})}),f.jsx(qa,{open:F,onOpenChange:M,children:f.jsxs(Ml,{children:[f.jsxs(Ll,{children:[f.jsx(Dl,{children:"Load Local Model"}),f.jsxs(zl,{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(Ol,{children:[f.jsx(Bl,{onClick:fa,children:"Cancel"}),f.jsx(Fl,{onClick:da,children:"Load Model"})]})]})}),f.jsx(qa,{open:B,onOpenChange:k,children:f.jsxs(Ml,{children:[f.jsxs(Ll,{children:[f.jsx(Dl,{children:"Save Assistant"}),f.jsx(zl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),f.jsxs("div",{className:"py-4",children:[f.jsx(zt,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),f.jsx("input",{id:"assistant-name",type:"text",value:G,onChange:j=>Y(j.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter a name for your assistant...",maxLength:100,autoFocus:!0,onKeyDown:j=>{j.key==="Enter"&&G.trim()&&ye(),j.key==="Escape"&&le()}}),f.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[G.length,"/100 characters"]})]}),f.jsxs(Ol,{children:[f.jsx(Bl,{onClick:le,children:"Cancel"}),f.jsxs(Fl,{onClick:ye,disabled:!G.trim(),children:[f.jsx(Ky,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),f.jsx(qa,{open:b,onOpenChange:q,children:f.jsxs(Ml,{children:[f.jsxs(Ll,{children:[f.jsx(Dl,{children:"Rename Assistant"}),f.jsxs(zl,{children:['Enter a new name for "',D==null?void 0:D.name,'".']})]}),f.jsxs("div",{className:"py-4",children:[f.jsx(zt,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),f.jsx("input",{id:"rename-assistant-name",type:"text",value:ge,onChange:j=>te(j.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter new assistant name...",maxLength:100,autoFocus:!0,onKeyDown:j=>{j.key==="Enter"&&ge.trim()&&_t(),j.key==="Escape"&&_r()}}),f.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[ge.length,"/100 characters"]})]}),f.jsxs(Ol,{children:[f.jsx(Bl,{onClick:_r,children:"Cancel"}),f.jsxs(Fl,{onClick:_t,disabled:!ge.trim(),children:[f.jsx(ii,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function mI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:s}){return f.jsxs(f.Fragment,{children:[f.jsxs(st,{children:[f.jsx($t,{children:f.jsx(Ut,{className:"text-base",children:"Model"})}),f.jsx(Pt,{className:"space-y-4",children:f.jsx("div",{children:f.jsxs(i0,{value:t||"",onValueChange:n,children:[f.jsx(Zd,{className:"w-full",children:f.jsx(o0,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(d=>d.model_name===t);if(!a)return t;const u=a.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[u?f.jsx(gs,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?f.jsx(vi,{className:"h-4 w-4 text-purple-500"}):f.jsx(ac,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:a.name}),r===t?f.jsx(me,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(me,{variant:"outline",className:"text-xs",children:u?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(ef,{children:[f.jsxs(so,{children:[f.jsx(si,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>f.jsx(pr,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(gs,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:a.name}),f.jsx(me,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),f.jsxs(so,{children:[f.jsx(si,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>f.jsx(pr,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?f.jsx(vi,{className:"h-4 w-4 text-purple-500"}):f.jsx(ac,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:a.name}),r===a.model_name?f.jsx(me,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?f.jsx(me,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(me,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})})})]}),f.jsxs(st,{children:[f.jsx($t,{children:f.jsx(Ut,{className:"text-base",children:"Parameters"})}),f.jsxs(Pt,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx(zt,{className:"text-sm font-medium",children:"Temperature"}),f.jsx(me,{variant:"outline",className:"text-xs",children:i})]}),f.jsx(hc,{value:[i],onValueChange:a=>o(a[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),f.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[f.jsx("span",{children:"0.0 (Focused)"}),f.jsx("span",{children:"1.0 (Balanced)"}),f.jsx("span",{children:"2.0 (Creative)"})]}),f.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:i<=.3?"🎯 Very focused and deterministic responses":i<=.7?"⚖️ Balanced creativity and consistency":i<=1.2?"🎨 More creative and varied responses":"🚀 Highly creative, unpredictable responses"})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx(zt,{className:"text-sm font-medium",children:"Max Tokens"}),f.jsx(me,{variant:"outline",className:"text-xs",children:l})]}),f.jsx(hc,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),f.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[f.jsx("span",{children:"50 (Short)"}),f.jsx("span",{children:"1024 (Medium)"}),f.jsx("span",{children:"4000 (Long)"})]}),f.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:l<=200?"📝 Brief responses, good for quick answers":l<=1e3?"📄 Medium responses, balanced length":l<=2e3?"📋 Long responses, detailed explanations":"📚 Very long responses, comprehensive content"})]})]})]})]})}function hI({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:s,clearCurrentAssistant:a,openRenameDialog:u,systemPrompt:d}){const c=v=>{if(v==="create_new")s();else if(v==="clear_current")a();else if(v.startsWith("user_")){const S=v.replace("user_","");t(S)}else i(v)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=v=>{switch(v){case"user":return{variant:"secondary",text:"Mine"};case"template":return{variant:"outline",text:"Template"};case"new":return{variant:"default",text:"New",className:"bg-green-100 text-green-700"}}},w=e.length+r.length;return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(zt,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),f.jsxs(i0,{value:p(),onValueChange:c,children:[f.jsx(Zd,{className:"w-full",children:f.jsx(o0,{placeholder:`Choose assistant (${w} available)`,children:l?f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(qr,{className:"h-4 w-4"}),f.jsx("span",{children:l.name}),l.originalTemplate&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),f.jsx(me,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(qr,{className:"h-4 w-4"}),f.jsx("span",{children:"Choose assistant"}),f.jsx(me,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),f.jsxs(ef,{children:[f.jsxs(so,{children:[f.jsxs(si,{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(ys,{className:"h-4 w-4"}),"Actions"]}),f.jsx(pr,{value:"create_new",children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(ys,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),f.jsx(me,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&f.jsx(pr,{value:"clear_current",children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(Db,{className:"h-4 w-4 text-gray-600"}),f.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),f.jsx(me,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&f.jsxs(so,{children:[f.jsxs(si,{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(Yy,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(v=>f.jsx(pr,{value:`user_${v.id}`,children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(qr,{className:"h-4 w-4 text-blue-600"}),f.jsx("span",{className:"truncate flex-1",children:v.name}),f.jsx(me,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${v.id}`))]}),r.length>0&&f.jsxs(so,{children:[f.jsxs(si,{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(HC,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(v=>f.jsx(pr,{value:v.name,children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(qr,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"truncate flex-1",children:v.name}),f.jsx(me,{variant:"outline",className:"text-xs",children:"Template"})]})},v.name))]}),w===0&&f.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&f.jsxs(Ae,{onClick:u,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[f.jsx(ii,{className:"h-4 w-4 mr-2"}),"Rename"]}),f.jsxs(Ae,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!d.trim(),children:[f.jsx(Ky,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function gI({systemPrompt:e,setSystemPrompt:t,isLoading:n}){const r=[{title:"Helpful Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses. If you're unsure about something, say so."},{title:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include helpful comments."},{title:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{title:"Teacher/Tutor",prompt:"You are a patient and knowledgeable teacher. Break down complex concepts into simple, understandable parts. Use examples and analogies to help explain ideas."}],i=["Be specific about the assistant's role and expertise","Include desired communication style and tone","Specify output format if needed (lists, paragraphs, etc.)","Add ethical guidelines and behavior expectations"];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs(st,{children:[f.jsx($t,{children:f.jsx(Ut,{className:"text-base",children:"System Instructions"})}),f.jsx(Pt,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsx(zt,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),f.jsx("textarea",{value:e,onChange:o=>t(o.target.value),placeholder:"Define your AI assistant's role, personality, and behavior...",className:"w-full h-[300px] max-h-[400px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-none overflow-y-auto",disabled:n}),f.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),f.jsxs(st,{children:[f.jsx($t,{children:f.jsxs(Ut,{className:"text-sm flex items-center",children:[f.jsx(vi,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),f.jsx(Pt,{children:f.jsx("div",{className:"grid grid-cols-1 gap-2",children:r.map((o,l)=>f.jsx(Ae,{variant:"ghost",size:"sm",className:"justify-start h-auto p-3 text-left",onClick:()=>t(o.prompt),disabled:n,children:f.jsxs("div",{children:[f.jsx("div",{className:"font-medium text-xs text-blue-600 mb-1",children:o.title}),f.jsxs("div",{className:"text-xs text-muted-foreground line-clamp-2",children:[o.prompt.substring(0,80),"..."]})]})},l))})})]}),f.jsxs(st,{children:[f.jsx($t,{children:f.jsxs(Ut,{className:"text-sm flex items-center",children:[f.jsx(Ws,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),f.jsx(Pt,{children:f.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>f.jsxs("li",{className:"flex items-start",children:[f.jsx("span",{className:"inline-block w-1.5 h-1.5 bg-blue-400 rounded-full mt-1.5 mr-2 flex-shrink-0"}),o]},l))})})]})]})}function yI(){const e=Md(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,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{i(!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(sc,{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($y,{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(Ae,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(ac,{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(st,{className:"bg-blue-50 border-blue-200",children:f.jsx(Pt,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Wy,{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(gs,{className:"h-5 w-5"}),"API Models",f.jsx(me,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(d=>d.type==="api").map(d=>f.jsx(uh,{model:d,modelLoading:o,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(Hy,{className:"h-5 w-5"}),"Local Models",f.jsx(me,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(d=>d.type==="local").map(d=>f.jsx(uh,{model:d,modelLoading:o,onLoad:a,onUnload:u},d.model_name))})]})]})})]})}function uh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return f.jsxs(st,{className:"hover:shadow-md transition-shadow",children:[f.jsx($t,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(Ut,{className:"text-base flex items-center gap-2",children:[i?f.jsx(gs,{className:"h-4 w-4 text-blue-600"}):f.jsx(Hy,{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(tb,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(Pt,{className:"space-y-3",children:[f.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Size:"}),f.jsx(me,{variant:"outline",className:"text-xs",children:e.size_gb})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),f.jsx(me,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Type:"}),f.jsx(me,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Features:"}),f.jsxs(me,{variant:"outline",className:"text-xs",children:[f.jsx(vi,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),f.jsx("div",{className:"pt-2",children:l?f.jsxs(Ae,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?f.jsx(sc,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(Gy,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):f.jsxs(Ae,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?f.jsx(sc,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(ob,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function vI(){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(ii,{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(st,{children:[f.jsx($t,{children:f.jsxs(Ut,{className:"flex items-center gap-2",children:[f.jsx(kb,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(Pt,{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(zt,{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(zt,{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(st,{children:[f.jsx($t,{children:f.jsxs(Ut,{className:"flex items-center gap-2",children:[f.jsx(Wp,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(Pt,{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(Wp,{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(st,{children:[f.jsx($t,{children:f.jsxs(Ut,{className:"flex items-center gap-2",children:[f.jsx(Wy,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(Pt,{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(zt,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(me,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(zt,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(me,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function xI(){return f.jsx(nC,{children:f.jsx(Yk,{children:f.jsxs(zr,{path:"/",element:f.jsx($b,{}),children:[f.jsx(zr,{index:!0,element:f.jsx(Jb,{})}),f.jsx(zr,{path:"playground",element:f.jsx(pI,{})}),f.jsx(zr,{path:"models",element:f.jsx(yI,{})}),f.jsx(zr,{path:"settings",element:f.jsx(vI,{})})]})})})}uu.createRoot(document.getElementById("root")).render(f.jsx(Lt.StrictMode,{children:f.jsx(xI,{})})); +//# sourceMappingURL=index-1c66a882.js.map