function P1(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 Dl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var th={exports:{}},Ss={},nh={exports:{}},Z={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var To=Symbol.for("react.element"),j1=Symbol.for("react.portal"),T1=Symbol.for("react.fragment"),_1=Symbol.for("react.strict_mode"),A1=Symbol.for("react.profiler"),R1=Symbol.for("react.provider"),I1=Symbol.for("react.context"),M1=Symbol.for("react.forward_ref"),O1=Symbol.for("react.suspense"),L1=Symbol.for("react.memo"),D1=Symbol.for("react.lazy"),df=Symbol.iterator;function z1(e){return e===null||typeof e!="object"?null:(e=df&&e[df]||e["@@iterator"],typeof e=="function"?e:null)}var rh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ih=Object.assign,oh={};function yi(e,t,n){this.props=e,this.context=t,this.refs=oh,this.updater=n||rh}yi.prototype.isReactComponent={};yi.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")};yi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lh(){}lh.prototype=yi.prototype;function Pc(e,t,n){this.props=e,this.context=t,this.refs=oh,this.updater=n||rh}var jc=Pc.prototype=new lh;jc.constructor=Pc;ih(jc,yi.prototype);jc.isPureReactComponent=!0;var ff=Array.isArray,sh=Object.prototype.hasOwnProperty,Tc={current:null},ah={key:!0,ref:!0,__self:!0,__source:!0};function uh(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)sh.call(t,r)&&!ah.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,K=N[H];if(0>>1;Hi(Le,k))iei(G,Le)?(N[H]=G,N[ie]=k,H=ie):(N[H]=Le,N[pe]=k,H=pe);else if(iei(G,k))N[H]=G,N[ie]=k,H=ie;else break e}}return R}function i(N,R){var k=N.sortIndex-R.sortIndex;return k!==0?k:N.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var 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=[],c=1,d=null,p=3,m=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(N){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=N)r(u),R.sortIndex=R.expirationTime,t(a,R);else break;R=n(u)}}function C(N){if(y=!1,x(N),!w)if(n(a)!==null)w=!0,B(P);else{var R=n(u);R!==null&&V(C,R.startTime-N)}}function P(N,R){w=!1,y&&(y=!1,h(_),_=-1),m=!0;var k=p;try{for(x(R),d=n(a);d!==null&&(!(d.expirationTime>R)||N&&!M());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var K=H(d.expirationTime<=R);R=e.unstable_now(),typeof K=="function"?d.callback=K:d===n(a)&&r(a),x(R)}else r(a);d=n(a)}if(d!==null)var b=!0;else{var pe=n(u);pe!==null&&V(C,pe.startTime-R),b=!1}return b}finally{d=null,p=k,m=!1}}var E=!1,j=null,_=-1,L=5,A=-1;function M(){return!(e.unstable_now()-AN||125H?(N.sortIndex=k,t(u,N),n(a)===null&&N===n(u)&&(y?(h(_),_=-1):y=!0,V(C,k-H))):(N.sortIndex=K,t(a,N),w||m||(w=!0,B(P))),N},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(N){var R=p;return function(){var k=p;p=R;try{return N.apply(this,arguments)}finally{p=k}}}})(mh);ph.exports=mh;var Q1=ph.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 q1=g,gt=Q1;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"),Ja=Object.prototype.hasOwnProperty,X1=/^[: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]*$/,mf={},hf={};function J1(e){return Ja.call(hf,e)?!0:Ja.call(mf,e)?!1:X1.test(e)?hf[e]=!0:(mf[e]=!0,!1)}function Z1(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 ew(e,t,n,r){if(t===null||typeof t>"u"||Z1(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rc=/[\-:]([a-z])/g;function Ic(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(Rc,Ic);$e[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Rc,Ic);$e[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Rc,Ic);$e[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Mc(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[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{ra=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ui(e):""}function tw(e){switch(e.tag){case 5:return Ui(e.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 2:case 15:return e=ia(e.type,!1),e;case 11:return e=ia(e.type.render,!1),e;case 1:return e=ia(e.type,!0),e;default:return""}}function nu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dr:return"Fragment";case Lr:return"Portal";case Za:return"Profiler";case Oc:return"StrictMode";case eu:return"Suspense";case tu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yh:return(e.displayName||"Context")+".Consumer";case gh:return(e._context.displayName||"Context")+".Provider";case Lc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dc:return t=e.displayName||null,t!==null?t:nu(e.type)||"Memo";case Tn:t=e._payload,e=e._init;try{return nu(e(t))}catch{}}return null}function nw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nu(t);case 8:return t===Oc?"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 Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rw(e){var t=xh(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 Wo(e){e._valueTracker||(e._valueTracker=rw(e))}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ru(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(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 Sh(e,t){t=t.checked,t!=null&&Mc(e,"checked",t,!1)}function iu(e,t){Sh(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ou(e,t.type,n):t.hasOwnProperty("defaultValue")&&ou(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ou(e,t,n){(t!=="number"||zl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function Yr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function lo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gi={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},iw=["Webkit","ms","Moz","O"];Object.keys(Gi).forEach(function(e){iw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gi[t]=Gi[e]})});function Eh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gi.hasOwnProperty(e)&&Gi[e]?(""+t).trim():t+"px"}function Nh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Eh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var ow=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function au(e,t){if(t){if(ow[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 uu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cu=null;function zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var du=null,Qr=null,qr=null;function Sf(e){if(e=Ro(e)){if(typeof du!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Ns(t),du(e.stateNode,e.type,t))}}function Ph(e){Qr?qr?qr.push(e):qr=[e]:Qr=e}function jh(){if(Qr){var e=Qr,t=qr;if(qr=Qr=null,Sf(e),t)for(e=0;e>>=0,e===0?32:31-(gw(e)/yw|0)|0}var Go=64,Yo=4194304;function Hi(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 Ul(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=Hi(s):(o&=l,o!==0&&(r=Hi(o)))}else l=n&~i,l!==0?r=Hi(l):o!==0&&(r=Hi(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 _o(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function Sw(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=Qi),_f=String.fromCharCode(32),Af=!1;function Yh(e,t){switch(e){case"keyup":return Qw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function Xw(e,t){switch(e){case"compositionend":return Qh(t);case"keypress":return t.which!==32?null:(Af=!0,_f);case"textInput":return e=t.data,e===_f&&Af?null:e;default:return null}}function Jw(e,t){if(zr)return e==="compositionend"||!Kc&&Yh(e,t)?(e=Kh(),xl=Vc=In=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Of(n)}}function Zh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eg(){for(var e=window,t=zl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zl(e.document)}return t}function Gc(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 sS(e){var t=eg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zh(n.ownerDocument.documentElement,n)){if(r!==null&&Gc(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=Lf(n,o);var l=Lf(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,Fr=null,yu=null,Xi=null,vu=!1;function Df(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vu||Fr==null||Fr!==zl(r)||(r=Fr,"selectionStart"in r&&Gc(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}),Xi&&po(Xi,r)||(Xi=r,r=Wl(yu,"onSelect"),0Ur||(e.current=bu[Ur],bu[Ur]=null,Ur--)}function ge(e,t){Ur++,bu[Ur]=e.current,e.current=t}var Gn={},We=Jn(Gn),rt=Jn(!1),gr=Gn;function li(e,t){var n=e.type.contextTypes;if(!n)return Gn;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 it(e){return e=e.childContextTypes,e!=null}function Gl(){we(rt),we(We)}function Hf(e,t,n){if(We.current!==Gn)throw Error(z(168));ge(We,t),ge(rt,n)}function ug(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,nw(e)||"Unknown",i));return Ee({},n,r)}function Yl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gn,gr=We.current,ge(We,e),ge(rt,rt.current),!0}function Wf(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=ug(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,we(rt),we(We),ge(We,e)):we(rt),ge(rt,n)}var un=null,Ps=!1,va=!1;function cg(e){un===null?un=[e]:un.push(e)}function xS(e){Ps=!0,cg(e)}function Zn(){if(!va&&un!==null){va=!0;var e=0,t=fe;try{var n=un;for(fe=1;e>=l,i-=l,cn=1<<32-Lt(t)+i|n<_?(L=j,j=null):L=j.sibling;var A=p(h,j,x[_],C);if(A===null){j===null&&(j=L);break}e&&j&&A.alternate===null&&t(h,j),v=o(A,v,_),E===null?P=A:E.sibling=A,E=A,j=L}if(_===x.length)return n(h,j),Se&&sr(h,_),P;if(j===null){for(;__?(L=j,j=null):L=j.sibling;var M=p(h,j,A.value,C);if(M===null){j===null&&(j=L);break}e&&j&&M.alternate===null&&t(h,j),v=o(M,v,_),E===null?P=M:E.sibling=M,E=M,j=L}if(A.done)return n(h,j),Se&&sr(h,_),P;if(j===null){for(;!A.done;_++,A=x.next())A=d(h,A.value,C),A!==null&&(v=o(A,v,_),E===null?P=A:E.sibling=A,E=A);return Se&&sr(h,_),P}for(j=r(h,j);!A.done;_++,A=x.next())A=m(j,h,_,A.value,C),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?_:A.key),v=o(A,v,_),E===null?P=A:E.sibling=A,E=A);return e&&j.forEach(function(T){return t(h,T)}),Se&&sr(h,_),P}function S(h,v,x,C){if(typeof x=="object"&&x!==null&&x.type===Dr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ho:e:{for(var P=x.key,E=v;E!==null;){if(E.key===P){if(P=x.type,P===Dr){if(E.tag===7){n(h,E.sibling),v=i(E,x.props.children),v.return=h,h=v;break e}}else if(E.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Tn&&Yf(P)===E.type){n(h,E.sibling),v=i(E,x.props),v.ref=Oi(h,E,x),v.return=h,h=v;break e}n(h,E);break}else t(h,E);E=E.sibling}x.type===Dr?(v=hr(x.props.children,h.mode,C,x.key),v.return=h,h=v):(C=Pl(x.type,x.key,x.props,null,h.mode,C),C.ref=Oi(h,v,x),C.return=h,h=C)}return l(h);case Lr:e:{for(E=x.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(h,v.sibling),v=i(v,x.children||[]),v.return=h,h=v;break e}else{n(h,v);break}else t(h,v);v=v.sibling}v=Na(x,h.mode,C),v.return=h,h=v}return l(h);case Tn:return E=x._init,S(h,v,E(x._payload),C)}if(Vi(x))return w(h,v,x,C);if(_i(x))return y(h,v,x,C);tl(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(h,v.sibling),v=i(v,x),v.return=h,h=v):(n(h,v),v=Ea(x,h.mode,C),v.return=h,h=v),l(h)):n(h,v)}return S}var ai=mg(!0),hg=mg(!1),Xl=Jn(null),Jl=null,Wr=null,Xc=null;function Jc(){Xc=Wr=Jl=null}function Zc(e){var t=Xl.current;we(Xl),e._currentValue=t}function Pu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Jr(e,t){Jl=e,Xc=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(Xc!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(Jl===null)throw Error(z(308));Wr=e,Jl.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var dr=null;function ed(e){dr===null?dr=[e]:dr.push(e)}function gg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ed(t)):(n.next=i.next,i.next=n),t.interleaved=n,hn(e,r)}function hn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function td(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,hn(e,n)}return i=r.interleaved,i===null?(t.next=t,ed(r)):(t.next=i.next,i.next=t),r.interleaved=t,hn(e,n)}function Sl(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,Bc(e,n)}}function Qf(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 Zl(e,t,n,r){var i=e.updateQueue;_n=!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 c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,c=u=a=null,s=o;do{var p=s.lane,m=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(p=t,m=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){d=w.call(m,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Ee({},d,p);break e;case 2:_n=!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},c===null?(u=c=m,a=d):c=c.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(c===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,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=d}}function qf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{fe=n,wa.transition=r}}function Mg(){return Pt().memoizedState}function CS(e,t,n){var r=Un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Og(e))Lg(t,n);else if(n=gg(e,t,n,r),n!==null){var i=Xe();Dt(n,e,r,i),Dg(n,t,r)}}function bS(e,t,n){var r=Un(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Og(e))Lg(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,Bt(s,l)){var a=t.interleaved;a===null?(i.next=i,ed(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=gg(e,t,i,r),n!==null&&(i=Xe(),Dt(n,e,r,i),Dg(n,t,r))}}function Og(e){var t=e.alternate;return e===be||t!==null&&t===be}function Lg(e,t){Ji=ts=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bc(e,n)}}var ns={readContext:Nt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},ES={readContext:Nt,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:Jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Cl(4194308,4,Tg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cl(4,2,e,t)},useMemo:function(e,t){var n=Kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kt();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=CS.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:Xf,useDebugValue:ud,useDeferredValue:function(e){return Kt().memoizedState=e},useTransition:function(){var e=Xf(!1),t=e[0];return e=kS.bind(null,e[1]),Kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=be,i=Kt();if(Se){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),ze===null)throw Error(z(349));vr&30||Sg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Jf(Cg.bind(null,r,o,e),[e]),r.flags|=2048,So(9,kg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Kt(),t=ze.identifierPrefix;if(Se){var n=dn,r=cn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xo++,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[Yt]=t,e[go]=r,Gg(e,t,!1,!1),t.stateNode=e;e:{switch(l=uu(n,r),n){case"dialog":xe("cancel",e),xe("close",e),i=r;break;case"iframe":case"object":case"embed":xe("load",e),i=r;break;case"video":case"audio":for(i=0;idi&&(t.flags|=128,r=!0,Li(o,!1),t.lanes=4194304)}else{if(!r)if(e=es(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Li(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Se)return Ve(t),null}else 2*Te()-o.renderingStartTime>di&&n!==1073741824&&(t.flags|=128,r=!0,Li(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=Te(),t.sibling=null,n=Ce.current,ge(Ce,r?n&1|2:n&1),t):(Ve(t),null);case 22:case 23:return hd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function IS(e,t){switch(Qc(t),t.tag){case 1:return it(t.type)&&Gl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ui(),we(rt),we(We),id(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rd(t),null;case 13:if(we(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return we(Ce),null;case 4:return ui(),null;case 10:return Zc(t.type._context),null;case 22:case 23:return hd(),null;case 24:return null;default:return null}}var rl=!1,He=!1,MS=typeof WeakSet=="function"?WeakSet:Set,W=null;function Kr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(e,t,r)}else n.current=null}function Lu(e,t,n){try{n()}catch(r){Pe(e,t,r)}}var up=!1;function OS(e,t){if(xu=Vl,e=eg(),Gc(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,c=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++u===i&&(s=l),p===o&&++c===r&&(a=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(wu={focusedElem:e,selectionRange:n},Vl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,S=w.memoizedState,h=t.stateNode,v=h.getSnapshotBeforeUpdate(t.elementType===t.type?y:Rt(t.type,y),S);h.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(C){Pe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=up,up=!1,w}function Zi(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&&Lu(t,n,o)}i=i.next}while(i!==r)}}function _s(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Du(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function qg(e){var t=e.alternate;t!==null&&(e.alternate=null,qg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[go],delete t[Cu],delete t[yS],delete t[vS])),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 Xg(e){return e.tag===5||e.tag===3||e.tag===4}function cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kl));else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}function Fu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fu(e,t,n),e=e.sibling;e!==null;)Fu(e,t,n),e=e.sibling}var Fe=null,Mt=!1;function bn(e,t,n){for(n=n.child;n!==null;)Jg(e,t,n),n=n.sibling}function Jg(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(ks,n)}catch{}switch(n.tag){case 5:He||Kr(n,t);case 6:var r=Fe,i=Mt;Fe=null,bn(e,t,n),Fe=r,Mt=i,Fe!==null&&(Mt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Mt?(e=Fe,n=n.stateNode,e.nodeType===8?ya(e.parentNode,n):e.nodeType===1&&ya(e,n),co(e)):ya(Fe,n.stateNode));break;case 4:r=Fe,i=Mt,Fe=n.stateNode.containerInfo,Mt=!0,bn(e,t,n),Fe=r,Mt=i;break;case 0:case 11:case 14:case 15:if(!He&&(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)&&Lu(n,t,l),i=i.next}while(i!==r)}bn(e,t,n);break;case 1:if(!He&&(Kr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Pe(n,t,s)}bn(e,t,n);break;case 21:bn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,bn(e,t,n),He=r):bn(e,t,n);break;default:bn(e,t,n)}}function dp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new MS),t.forEach(function(r){var i=HS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Tt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DS(r/1960))-r,10e?16:e,Mn===null)var r=!1;else{if(e=Mn,Mn=null,os=0,se&6)throw Error(z(331));var i=se;for(se|=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;aTe()-pd?mr(e,0):fd|=n),ot(e,t)}function ly(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Xe();e=hn(e,t),e!==null&&(_o(e,t,n),ot(e,n))}function VS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ly(e,n)}function HS(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),ly(e,n)}var sy;sy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,AS(e,t,n);nt=!!(e.flags&131072)}else nt=!1,Se&&t.flags&1048576&&dg(t,ql,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bl(e,t),e=t.pendingProps;var i=li(t,We.current);Jr(t,n),i=ld(null,t,r,e,i,n);var o=sd();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,it(r)?(o=!0,Yl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,td(t),i.updater=Ts,t.stateNode=i,i._reactInternals=t,Tu(t,r,e,n),t=Ru(null,t,r,!0,o,n)):(t.tag=0,Se&&o&&Yc(t),Qe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=KS(r),e=Rt(r,e),i){case 0:t=Au(null,t,r,e,n);break e;case 1:t=lp(null,t,r,e,n);break e;case 11:t=ip(null,t,r,e,n);break e;case 14:t=op(null,t,r,Rt(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:Rt(r,i),Au(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rt(r,i),lp(e,t,r,i,n);case 3:e:{if(Hg(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,yg(e,t),Zl(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=ci(Error(z(423)),t),t=sp(e,t,r,n,i);break e}else if(r!==i){i=ci(Error(z(424)),t),t=sp(e,t,r,n,i);break e}else for(ft=Fn(t.stateNode.containerInfo.firstChild),mt=t,Se=!0,Ot=null,n=hg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(si(),r===i){t=gn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return vg(t),e===null&&Nu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Su(r,i)?l=null:o!==null&&Su(r,o)&&(t.flags|=32),Vg(e,t),Qe(e,t,l,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return Wg(e,t,n);case 4:return nd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ai(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rt(r,i),ip(e,t,r,i,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,ge(Xl,r._currentValue),r._currentValue=l,o!==null)if(Bt(o.value,l)){if(o.children===i.children&&!rt.current){t=gn(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=fn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Pu(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),Pu(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}Qe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Jr(t,n),i=Nt(i),r=r(i),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,i=Rt(r,t.pendingProps),i=Rt(r.type,i),op(e,t,r,i,n);case 15:return $g(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rt(r,i),bl(e,t),t.tag=1,it(r)?(e=!0,Yl(t)):e=!1,Jr(t,n),zg(t,r,i),Tu(t,r,i,n),Ru(null,t,r,!0,e,n);case 19:return Kg(e,t,n);case 22:return Ug(e,t,n)}throw Error(z(156,t.tag))};function ay(e,t){return Oh(e,t)}function WS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,n,r){return new WS(e,t,n,r)}function yd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function KS(e){if(typeof e=="function")return yd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Lc)return 11;if(e===Dc)return 14}return 2}function Vn(e,t){var n=e.alternate;return n===null?(n=Ct(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")yd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Dr:return hr(n.children,i,o,t);case Oc:l=8,i|=8;break;case Za:return e=Ct(12,n,t,i|2),e.elementType=Za,e.lanes=o,e;case eu:return e=Ct(13,n,t,i),e.elementType=eu,e.lanes=o,e;case tu:return e=Ct(19,n,t,i),e.elementType=tu,e.lanes=o,e;case vh:return Rs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gh:l=10;break e;case yh:l=9;break e;case Lc:l=11;break e;case Dc:l=14;break e;case Tn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Ct(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function hr(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function Rs(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=vh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ea(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function Na(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GS(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=la(0),this.expirationTimes=la(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=la(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vd(e,t,n,r,i,o,l,s,a){return e=new GS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ct(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(o),e}function YS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fy)}catch(e){console.error(e)}}fy(),fh.exports=yt;var wi=fh.exports;const ZS=ws(wi);var xp=wi;Xa.createRoot=xp.createRoot,Xa.hydrateRoot=xp.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 Co(){return Co=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function py(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tk(){return Math.random().toString(36).substr(2,8)}function Sp(e,t){return{usr:e.state,key:e.key,idx:t}}function Hu(e,t,n,r){return n===void 0&&(n=null),Co({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Si(t):t,{state:n,key:t&&t.key||r||tk()})}function as(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 Si(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 nk(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=c();u==null&&(u=0,l.replaceState(Co({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function d(){s=On.Pop;let S=c(),h=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:h})}function p(S,h){s=On.Push;let v=Hu(y.location,S,h);n&&n(v,S),u=c()+1;let x=Sp(v,u),C=y.createHref(v);try{l.pushState(x,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(C)}o&&a&&a({action:s,location:y.location,delta:1})}function m(S,h){s=On.Replace;let v=Hu(y.location,S,h);n&&n(v,S),u=c();let x=Sp(v,u),C=y.createHref(v);l.replaceState(x,"",C),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let h=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof S=="string"?S:as(S);return v=v.replace(/ $/,"%20"),Ie(h,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,h)}let y={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(wp,d),a=S,()=>{i.removeEventListener(wp,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let h=w(S);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:p,replace:m,go(S){return l.go(S)}};return y}var kp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kp||(kp={}));function rk(e,t,n){return n===void 0&&(n="/"),ik(e,t,n,!1)}function ik(e,t,n,r){let i=typeof t=="string"?Si(t):t,o=kd(i.pathname||"/",n);if(o==null)return null;let l=my(e);ok(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("/")&&(Ie(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=Hn([r,a.relativePath]),c=n.concat(a);o.children&&o.children.length>0&&(Ie(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),my(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:fk(u,o.index),routesMeta:c})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of hy(o.path))i(o,l,a)}),t}function hy(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=hy(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 ok(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:pk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const lk=/^:[\w-]+$/,sk=3,ak=2,uk=1,ck=10,dk=-2,Cp=e=>e==="*";function fk(e,t){let n=e.split("/"),r=n.length;return n.some(Cp)&&(r+=dk),t&&(r+=ak),n.filter(i=>!Cp(i)).reduce((i,o)=>i+(lk.test(o)?sk:o===""?uk:ck),r)}function pk(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 mk(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}=c;if(p==="*"){let y=s[d]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[d];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function hk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),py(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 gk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return py(!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 kd(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 yk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Si(e):e;return{pathname:n?n.startsWith("/")?n:vk(n,t):t,search:Sk(r),hash:kk(i)}}function vk(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 Pa(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 xk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gy(e,t){let n=xk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function yy(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Si(e):(i=Co({},e),Ie(!i.pathname||!i.pathname.includes("?"),Pa("?","pathname","search",i)),Ie(!i.pathname||!i.pathname.includes("#"),Pa("#","pathname","hash",i)),Ie(!i.search||!i.search.includes("#"),Pa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=yk(i,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const Hn=e=>e.join("/").replace(/\/\/+/g,"/"),wk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Sk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ck(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vy=["post","put","patch","delete"];new Set(vy);const bk=["get",...vy];new Set(bk);/** * 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 bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=yy(u,JSON.parse(l),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Hn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,l,o,e])}const jk=g.createContext(null);function Tk(e){let t=g.useContext(er).outlet;return t&&g.createElement(jk.Provider,{value:e},t)}function Sy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Pr),{matches:i}=g.useContext(er),{pathname:o}=Oo(),l=JSON.stringify(gy(i,r.v7_relativeSplatPath));return g.useMemo(()=>yy(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function _k(e,t){return Ak(e,t)}function Ak(e,t,n,r){Mo()||Ie(!1);let{navigator:i}=g.useContext(Pr),{matches:o}=g.useContext(er),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Oo(),c;if(t){var d;let S=typeof t=="string"?Si(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Ie(!1),c=S}else c=u;let p=c.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=rk(e,{pathname:m}),y=Lk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Hn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Hn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?g.createElement(Ds.Provider,{value:{location:bo({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:On.Pop}},y):y}function Rk(){let e=Bk(),t=Ck(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 Ik=g.createElement(Rk,null);class Mk 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(er.Provider,{value:this.props.routeContext},g.createElement(xy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ok(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Cd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(er.Provider,{value:t},r)}function Lk(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 c=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);c>=0||Ie(!1),l=l.slice(0,Math.min(l.length,c+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((c,d,p)=>{let m,w=!1,y=null,S=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||Ik,a&&(u<0&&p===0?(Uk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,p+1)),v=()=>{let x;return m?x=y:w?x=S:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,g.createElement(Ok,{match:d,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Mk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:v(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):v()},null)}var ky=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ky||{}),us=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}(us||{});function Dk(e){let t=g.useContext(Cd);return t||Ie(!1),t}function zk(e){let t=g.useContext(Ek);return t||Ie(!1),t}function Fk(e){let t=g.useContext(er);return t||Ie(!1),t}function Cy(e){let t=Fk(),n=t.matches[t.matches.length-1];return n.route.id||Ie(!1),n.route.id}function Bk(){var e;let t=g.useContext(xy),n=zk(us.UseRouteError),r=Cy(us.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $k(){let{router:e}=Dk(ky.UseNavigateStable),t=Cy(us.UseNavigateStable),n=g.useRef(!1);return wy(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,bo({fromRouteId:t},o)))},[e,t])}const Ep={};function Uk(e,t,n){!t&&!Ep[e]&&(Ep[e]=!0)}function Vk(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 Hk(e){return Tk(e.context)}function Pn(e){Ie(!1)}function Wk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=On.Pop,navigator:o,static:l=!1,future:s}=e;Mo()&&Ie(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:o,static:l,future:bo({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Si(r));let{pathname:c="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,y=g.useMemo(()=>{let S=kd(c,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:w},navigationType:i}},[a,c,d,p,m,w,i]);return y==null?null:g.createElement(Pr.Provider,{value:u},g.createElement(Ds.Provider,{children:n,value:y}))}function Kk(e){let{children:t,location:n}=e;return _k(Wu(t),n)}new Promise(()=>{});function Wu(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,Wu(r.props.children,o));return}r.type!==Pn&&Ie(!1),!r.props.index||!r.props.children||Ie(!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=Wu(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 Ku(){return Ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Yk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qk(e,t){return e.button===0&&(!t||t==="_self")&&!Yk(e)}const qk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Xk="6";try{window.__reactRouterVersion=Xk}catch{}const Jk="startTransition",Np=Ac[Jk];function Zk(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=ek({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Np?Np(()=>a(d)):a(d)},[a,u]);return g.useLayoutEffect(()=>l.listen(c),[l,c]),g.useEffect(()=>Vk(r),[r]),g.createElement(Wk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const eC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,by=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:c,viewTransition:d}=t,p=Gk(t,qk),{basename:m}=g.useContext(Pr),w,y=!1;if(typeof u=="string"&&tC.test(u)&&(w=u,eC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),P=kd(C.pathname,m);C.origin===x.origin&&P!=null?u=P+C.search+C.hash:y=!0}catch{}let S=Nk(u,{relative:i}),h=nC(u,{replace:l,state:s,target:a,preventScrollReset:c,relative:i,viewTransition:d});function v(x){r&&r(x),x.defaultPrevented||h(x)}return g.createElement("a",Ku({},p,{href:w||S,onClick:y||o?r:v,ref:n,target:a}))});var Pp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Pp||(Pp={}));var jp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jp||(jp={}));function nC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Lo(),u=Oo(),c=Sy(e,{relative:l});return g.useCallback(d=>{if(Qk(d,n)){d.preventDefault();let p=r!==void 0?r:as(u)===as(c);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,c,r,i,n,e,o,l,s])}function Ey(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 Ty="!";function cC(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,c,d=0;du?c-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function dC(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 fC(e){return{cache:uC(e.cacheSize),splitModifiers:cC(e),...iC(e)}}var pC=/\s+/;function mC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(pC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,c=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?c.substring(0,d):c),m=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(c),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=dC(a).join(":"),y=u?w+Ty:w;return{isTailwindClass:!0,modifierId:y,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,c=s+a;return o.has(c)?!1:(o.add(c),i(a,u).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function hC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),RC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Rp=e=>{const t=RC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ry=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),IC=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 MC={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 OC=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,...MC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ry("lucide",i),...!o&&!IC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,c])=>g.createElement(u,c)),...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 ue=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(OC,{ref:o,iconNode:t,className:Ry(`lucide-${AC(Rp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Rp(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 LC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ip=ue("arrow-right",LC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DC=[["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"}]],Iy=ue("award",DC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zC=[["path",{d:"M12 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"}]],Ed=ue("book-open",zC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FC=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],fi=ue("bot",FC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BC=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],pi=ue("brain",BC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],UC=ue("check",$C);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],My=ue("chevron-down",VC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],WC=ue("chevron-up",HC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],GC=ue("circle-check-big",KC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],cs=ue("cloud",YC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QC=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],qC=ue("download",QC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XC=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Oy=ue("hard-drive",XC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JC=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Qu=ue("heart",JC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],eb=ue("history",ZC);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],nb=ue("house",tb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ly=ue("info",rb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ib=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qu=ue("loader-circle",ib);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ob=[["path",{d:"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"}]],Do=ue("message-square",ob);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xu=ue("plus",lb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ab=ue("rotate-ccw",sb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ub=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cb=ue("send",ub);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const db=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],fb=ue("server",db);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pb=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Nd=ue("settings",pb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mb=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],hb=ue("share",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 gb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Mp=ue("shield",gb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],vb=ue("square",yb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xb=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Dy=ue("star",xb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wb=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Pd=ue("trash-2",wb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],kb=ue("user",Sb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Eo=ue("users",Cb);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ju=ue("zap",bb),Eb=[{name:"Home",href:"/",icon:nb,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:Do,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:Ed,description:"Browse and manage AI models"},{name:"My Assistants",href:"/assistants",icon:fi,description:"Manage your custom AI assistants"},{name:"Community",href:"/community",icon:Eo,description:"Discover and share assistant templates"},{name:"Settings",href:"/settings",icon:Nd,description:"Application settings"}];function Nb(){const e=Oo();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(pi,{className:"h-5 w-5 text-primary-foreground"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),f.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:f.jsxs("div",{children:[f.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),f.jsx("nav",{className:"space-y-1",children:Eb.map(t=>{const n=e.pathname===t.href;return f.jsxs(by,{to:t.href,className:re("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[f.jsx(t.icon,{className:"h-4 w-4"}),f.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Pb(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(Nb,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(Hk,{})})]})}const Op=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Lp=Ny,jd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Lp(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 c=n==null?void 0:n[u],d=o==null?void 0:o[u];if(c===null)return null;const p=Op(c)||Op(d);return i[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...m}=c;return Object.entries(m).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...u,d,p]:u},[]);return Lp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},jb=jd("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 je({className:e,variant:t,...n}){return f.jsx("div",{className:re(jb({variant:t}),e),...n})}function Dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Dp(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(Rb);if(a){const u=a.props.children,c=s.map(d=>d===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return f.jsx(t,{...l,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return f.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Tb=mi("Slot");function _b(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=Mb(i),s=Ib(o,i.props);return i.type!==g.Fragment&&(s.ref=r?zy(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 Fy=Symbol("radix.slottable");function Ab(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Fy,t}function Rb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fy}function Ib(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 Mb(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 Td=jd("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"}}),_e=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Tb:"button";return f.jsx(l,{className:re(Td({variant:t,size:n,className:e})),ref:o,...i})});_e.displayName="Button";const qe=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));qe.displayName="Card";const zt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",e),...t}));zt.displayName="CardHeader";const Ft=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ft.displayName="CardTitle";const Ob=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:re("text-sm text-muted-foreground",e),...t}));Ob.displayName="CardDescription";const Et=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("p-6 pt-0",e),...t}));Et.displayName="CardContent";const Lb=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",e),...t}));Lb.displayName="CardFooter";function Db(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions.",author:"EdgeLLM Team",category:"coding",tags:["code review","programming"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15"},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters.",author:"EdgeLLM Team",category:"creative",tags:["creative","storytelling"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30"}]}function zb(){const e=Lo(),[t,n]=g.useState(!1);g.useEffect(()=>{r()},[]);const r=async()=>{try{const l=`${window.location.protocol}//${window.location.host}`,s=await fetch(`${l}/models`);n(s.ok)}catch{n(!1)}},i=l=>{const s={name:l.name,description:l.description,model:l.model,systemPrompt:l.systemPrompt,temperature:l.temperature,maxTokens:l.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(s)),e("/playground")},o=Db();return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-100 border-b",children:f.jsx("div",{className:"max-w-6xl mx-auto px-6 py-16",children:f.jsxs("div",{className:"text-center space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[f.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:f.jsx(pi,{className:"h-7 w-7 text-white"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Edge LLM"}),f.jsx(je,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})]}),f.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Professional AI platform for local and cloud language models. Complete privacy, advanced features, industrial-grade performance."}),f.jsxs("div",{className:"flex flex-col items-center gap-4 mt-8",children:[f.jsxs(_e,{size:"lg",onClick:()=>e("/playground"),className:"flex items-center gap-2 px-8 py-3 text-lg",children:[f.jsx(Do,{className:"h-5 w-5"}),"Start Conversation",f.jsx(Ip,{className:"h-4 w-4"})]}),f.jsxs("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:[f.jsxs("span",{className:"flex items-center gap-1",children:[f.jsx(pi,{className:"h-4 w-4"}),"Local & Cloud Models"]}),f.jsx("span",{children:"•"}),f.jsx("span",{children:"Privacy First"}),f.jsx("span",{children:"•"}),f.jsx("span",{children:"Easy to Use"})]})]})]})})}),f.jsx("div",{className:"py-16 bg-background",children:f.jsxs("div",{className:"max-w-6xl mx-auto px-6",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[f.jsx(Eo,{className:"h-6 w-6 text-blue-600"}),f.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Featured Templates"})]}),f.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Get started quickly with pre-configured AI assistants created by our team"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-8",children:o.map(l=>f.jsx(Fb,{template:l,onUse:()=>i(l)},l.id))}),f.jsx("div",{className:"text-center",children:f.jsxs(_e,{variant:"outline",onClick:()=>e("/community"),className:"flex items-center gap-2",children:[f.jsx(Eo,{className:"h-4 w-4"}),"View All Templates",f.jsx(Ip,{className:"h-4 w-4"})]})})]})})]})}function Fb({template:e,onUse:t}){return f.jsxs(qe,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[f.jsx(zt,{className:"pb-3",children:f.jsx("div",{className:"flex items-start justify-between",children:f.jsxs("div",{className:"flex-1",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(Ft,{className:"text-lg",children:e.name}),f.jsxs(je,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[f.jsx(Iy,{className:"h-3 w-3 mr-1"}),"Official"]})]}),f.jsxs("p",{className:"text-xs text-blue-600 font-medium mb-2",children:["by ",e.author]}),f.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(n=>f.jsx(je,{variant:"secondary",className:"text-xs",children:n},n))}),f.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),f.jsx("p",{className:"text-gray-800",children:e.temperature})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),f.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),f.jsxs(_e,{onClick:t,className:"w-full flex items-center gap-2",children:[f.jsx(Do,{className:"h-4 w-4"}),"Try This Template"]})]})]})}function ds(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(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 Bb(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 tr(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=d=>{var h;const{scope:p,children:m,...w}=d,y=((h=p==null?void 0:p[e])==null?void 0:h[a])||s,S=g.useMemo(()=>w,Object.values(w));return f.jsx(y.Provider,{value:S,children:m})};u.displayName=o+"Provider";function c(d,p){var y;const m=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,c]}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,$b(i,...t)]}function $b(...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 d=a(o)[`__scope${u}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ke=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Ub=Ac[" useInsertionEffect ".trim().toString()]||Ke;function hi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=Vb({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const c=g.useRef(e!==void 0);g.useEffect(()=>{const d=c.current;d!==s&&console.warn(`${r} is changing from ${d?"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.`),c.current=s},[s,r])}const u=g.useCallback(c=>{var d;if(s){const p=Hb(c)?c(e):c;p!==e&&((d=l.current)==null||d.call(l,p))}else o(c)},[s,e,o,l]);return[a,u]}function Vb({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return Ub(()=>{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 Hb(e){return typeof e=="function"}var Wb=g.createContext(void 0);function zs(e){const t=g.useContext(Wb);return e||t||"ltr"}function By(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 $y(e){const[t,n]=g.useState(void 0);return Ke(()=>{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 Kb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],J=Kb.reduce((e,t)=>{const n=mi(`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 Gb(e,t){e&&wi.flushSync(()=>e.dispatchEvent(t))}function _d(e){const t=e+"CollectionProvider",[n,r]=tr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:h}=y,v=It.useRef(null),x=It.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:x,collectionRef:v,children:h})};l.displayName=t;const s=e+"CollectionSlot",a=mi(s),u=It.forwardRef((y,S)=>{const{scope:h,children:v}=y,x=o(s,h),C=de(S,x.collectionRef);return f.jsx(a,{ref:C,children:v})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",p=mi(c),m=It.forwardRef((y,S)=>{const{scope:h,children:v,...x}=y,C=It.useRef(null),P=de(S,C),E=o(c,h);return It.useEffect(()=>(E.itemMap.set(C,{ref:C,...x}),()=>void E.itemMap.delete(C))),f.jsx(p,{[d]:"",ref:P,children:v})});m.displayName=c;function w(y){const S=o(e+"CollectionConsumer",y);return It.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((E,j)=>x.indexOf(E.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},w,r]}var Uy=["PageUp","PageDown"],Vy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Hy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ki="Slider",[Zu,Yb,Qb]=_d(ki),[Wy,uI]=tr(ki,[Qb]),[qb,Fs]=Wy(ki),Ky=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:c,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...y}=e,S=g.useRef(new Set),h=g.useRef(0),x=l==="horizontal"?Xb:Jb,[C=[],P]=hi({prop:c,defaultProp:u,onChange:M=>{var U;(U=[...S.current][h.current])==null||U.focus(),d(M)}}),E=g.useRef(C);function j(M){const T=rE(C,M);A(M,T)}function _(M){A(M,h.current)}function L(){const M=E.current[h.current];C[h.current]!==M&&p(C)}function A(M,T,{commit:U}={commit:!1}){const O=sE(o),D=aE(Math.round((M-r)/o)*o+r,O),B=ds(D,[r,i]);P((V=[])=>{const N=tE(V,B,T);if(lE(N,a*o)){h.current=N.indexOf(B);const R=String(N)!==String(V);return R&&U&&p(N),R?N:V}else return V})}return f.jsx(qb,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:h,thumbs:S.current,values:C,orientation:l,form:w,children:f.jsx(Zu.Provider,{scope:e.__scopeSlider,children:f.jsx(Zu.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:X(y.onPointerDown,()=>{s||(E.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:_,onSlideEnd:s?void 0:L,onHomeKeyDown:()=>!s&&A(r,0,{commit:!0}),onEndKeyDown:()=>!s&&A(i,C.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:T})=>{if(!s){const D=Uy.includes(M.key)||M.shiftKey&&Vy.includes(M.key)?10:1,B=h.current,V=C[B],N=o*D*T;A(V+N,B,{commit:!0})}}})})})})});Ky.displayName=ki;var[Gy,Yy]=Wy(ki,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Xb=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...c}=e,[d,p]=g.useState(null),m=de(t,x=>p(x)),w=g.useRef(void 0),y=zs(i),S=y==="ltr",h=S&&!o||!S&&o;function v(x){const C=w.current||d.getBoundingClientRect(),P=[0,C.width],j=Ad(P,h?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return f.jsx(Gy,{scope:e.__scopeSlider,startEdge:h?"left":"right",endEdge:h?"right":"left",direction:h?1:-1,size:"width",children:f.jsx(Qy,{dir:y,"data-orientation":"horizontal",...c,ref:m,style:{...c.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=v(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=v(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const P=Hy[h?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:P?-1:1})}})})}),Jb=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,c=g.useRef(null),d=de(t,c),p=g.useRef(void 0),m=!i;function w(y){const S=p.current||c.current.getBoundingClientRect(),h=[0,S.height],x=Ad(h,m?[r,n]:[n,r]);return p.current=S,x(y-S.top)}return f.jsx(Gy,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:f.jsx(Qy,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);o==null||o(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:y=>{const h=Hy[m?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:h?-1:1})}})})}),Qy=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,c=Fs(ki,n);return f.jsx(J.span,{...u,ref:t,onKeyDown:X(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Uy.concat(Vy).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:X(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),c.thumbs.has(p)?p.focus():r(d)}),onPointerMove:X(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:X(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),qy="SliderTrack",Xy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Fs(qy,n);return f.jsx(J.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Xy.displayName=qy;var ec="SliderRange",Jy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Fs(ec,n),o=Yy(ec,n),l=g.useRef(null),s=de(t,l),a=i.values.length,u=i.values.map(p=>tv(p,i.min,i.max)),c=a>1?Math.min(...u):0,d=100-Math.max(...u);return f.jsx(J.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:c+"%",[o.endEdge]:d+"%"}})});Jy.displayName=ec;var tc="SliderThumb",Zy=g.forwardRef((e,t)=>{const n=Yb(e.__scopeSlider),[r,i]=g.useState(null),o=de(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(Zb,{...e,ref:o,index:l})}),Zb=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Fs(tc,n),s=Yy(tc,n),[a,u]=g.useState(null),c=de(t,v=>u(v)),d=a?l.form||!!a.closest("form"):!0,p=$y(a),m=l.values[r],w=m===void 0?0:tv(m,l.min,l.max),y=nE(r,l.values.length),S=p==null?void 0:p[s.size],h=S?iE(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}% + ${h}px)`},children:[f.jsx(Zu.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(J.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:c,style:m===void 0?{display:"none"}:e.style,onFocus:X(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&f.jsx(ev,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});Zy.displayName=tc;var eE="RadioBubbleInput",ev=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=de(i,r),l=By(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&c){const d=new Event("input",{bubbles:!0});c.call(s,t),s.dispatchEvent(d)}},[l,t]),f.jsx(J.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});ev.displayName=eE;function tE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function tv(e,t,n){const o=100/(n-t)*(e-t);return ds(o,[0,100])}function nE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function rE(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 iE(e,t,n){const r=e/2,o=Ad([0,50],[0,r]);return(r-o(t)*n)*n}function oE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function lE(e,t){if(t>0){const n=oE(e);return Math.min(...n)>=t}return!0}function Ad(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 sE(e){return(String(e).split(".")[1]||"").length}function aE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var nv=Ky,uE=Xy,cE=Jy,dE=Zy;const nc=g.forwardRef(({className:e,...t},n)=>f.jsxs(nv,{ref:n,className:re("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(uE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(cE,{className:"absolute h-full bg-primary"})}),f.jsx(dE,{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"})]}));nc.displayName=nv.displayName;var fE="Label",rv=g.forwardRef((e,t)=>f.jsx(J.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())}}));rv.displayName=fE;var iv=rv;const pE=jd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qt=g.forwardRef(({className:e,...t},n)=>f.jsx(iv,{ref:n,className:re(pE(),e),...t}));Qt.displayName=iv.displayName;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)},[])}function mE(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 hE="DismissableLayer",rc="dismissableLayer.update",gE="dismissableLayer.pointerDownOutside",yE="dismissableLayer.focusOutside",zp,ov=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(ov),[c,d]=g.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=de(t,j=>d(j)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=y.indexOf(S),v=c?y.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=h,P=wE(j=>{const _=j.target,L=[...u.branches].some(A=>A.contains(_));!C||L||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),E=SE(j=>{const _=j.target;[...u.branches].some(A=>A.contains(_))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return mE(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Fp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=zp)}},[c,p,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Fp())},[c,u]),g.useEffect(()=>{const j=()=>m({});return document.addEventListener(rc,j),()=>document.removeEventListener(rc,j)},[]),f.jsx(J.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,E.onFocusCapture),onBlurCapture:X(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,P.onPointerDownCapture)})});Rd.displayName=hE;var vE="DismissableLayerBranch",xE=g.forwardRef((e,t)=>{const n=g.useContext(ov),r=g.useRef(null),i=de(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(J.div,{...e,ref:i})});xE.displayName=vE;function wE(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(){lv(gE,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 SE(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&&lv(yE,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 Fp(){const e=new CustomEvent(rc);document.dispatchEvent(e)}function lv(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?Gb(i,o):i.dispatchEvent(o)}var ja=0;function sv(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bp()),document.body.insertAdjacentElement("beforeend",e[1]??Bp()),ja++,()=>{ja===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ja--}},[])}function Bp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ta="focusScope.autoFocusOnMount",_a="focusScope.autoFocusOnUnmount",$p={bubbles:!1,cancelable:!0},kE="FocusScope",Id=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),c=Yn(o),d=g.useRef(null),p=de(t,y=>a(y)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:jn(d.current,{select:!0})},S=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||jn(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const P of x)P.removedNodes.length>0&&jn(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const v=new MutationObserver(h);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){Vp.add(m);const y=document.activeElement;if(!s.contains(y)){const h=new CustomEvent(Ta,$p);s.addEventListener(Ta,u),s.dispatchEvent(h),h.defaultPrevented||(CE(jE(av(s)),{select:!0}),document.activeElement===y&&jn(s))}return()=>{s.removeEventListener(Ta,u),setTimeout(()=>{const h=new CustomEvent(_a,$p);s.addEventListener(_a,c),s.dispatchEvent(h),h.defaultPrevented||jn(y??document.body,{select:!0}),s.removeEventListener(_a,c),Vp.remove(m)},0)}}},[s,u,c,m]);const w=g.useCallback(y=>{if(!n&&!r||m.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,h=document.activeElement;if(S&&h){const v=y.currentTarget,[x,C]=bE(v);x&&C?!y.shiftKey&&h===C?(y.preventDefault(),n&&jn(x,{select:!0})):y.shiftKey&&h===x&&(y.preventDefault(),n&&jn(C,{select:!0})):h===v&&y.preventDefault()}},[n,r,m.paused]);return f.jsx(J.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Id.displayName=kE;function CE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jn(r,{select:t}),document.activeElement!==n)return}function bE(e){const t=av(e),n=Up(t,e),r=Up(t.reverse(),e);return[n,r]}function av(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 Up(e,t){for(const n of e)if(!EE(n,{upTo:t}))return n}function EE(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 NE(e){return e instanceof HTMLInputElement&&"select"in e}function jn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&NE(e)&&t&&e.select()}}var Vp=PE();function PE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Hp(e,t),e.unshift(t)},remove(t){var n;e=Hp(e,t),(n=e[0])==null||n.resume()}}}function Hp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jE(e){return e.filter(t=>t.tagName!=="A")}var TE=Ac[" useId ".trim().toString()]||(()=>{}),_E=0;function Wn(e){const[t,n]=g.useState(TE());return Ke(()=>{e||n(r=>r??String(_E++))},[e]),e||(t?`radix-${t}`:"")}const AE=["top","right","bottom","left"],Qn=Math.min,dt=Math.max,fs=Math.round,sl=Math.floor,tn=e=>({x:e,y:e}),RE={left:"right",right:"left",bottom:"top",top:"bottom"},IE={start:"end",end:"start"};function ic(e,t,n){return dt(e,Qn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function Ci(e){return e.split("-")[1]}function Md(e){return e==="x"?"y":"x"}function Od(e){return e==="y"?"height":"width"}const ME=new Set(["top","bottom"]);function Jt(e){return ME.has(vn(e))?"y":"x"}function Ld(e){return Md(Jt(e))}function OE(e,t,n){n===void 0&&(n=!1);const r=Ci(e),i=Ld(e),o=Od(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ps(l)),[l,ps(l)]}function LE(e){const t=ps(e);return[oc(e),t,oc(t)]}function oc(e){return e.replace(/start|end/g,t=>IE[t])}const Wp=["left","right"],Kp=["right","left"],DE=["top","bottom"],zE=["bottom","top"];function FE(e,t,n){switch(e){case"top":case"bottom":return n?t?Kp:Wp:t?Wp:Kp;case"left":case"right":return t?DE:zE;default:return[]}}function BE(e,t,n,r){const i=Ci(e);let o=FE(vn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(oc)))),o}function ps(e){return e.replace(/left|right|bottom|top/g,t=>RE[t])}function $E(e){return{top:0,right:0,bottom:0,left:0,...e}}function uv(e){return typeof e!="number"?$E(e):{top:e,right:e,bottom:e,left:e}}function ms(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 Gp(e,t,n){let{reference:r,floating:i}=e;const o=Jt(t),l=Ld(t),s=Od(l),a=vn(t),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(a){case"top":m={x:c,y:r.y-i.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ci(t)){case"start":m[l]-=p*(n&&u?-1:1);break;case"end":m[l]+=p*(n&&u?-1:1);break}return m}const UE=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:c,y:d}=Gp(u,r,a),p=r,m={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:c=0}=yn(e,t)||{};if(u==null)return{};const d=uv(c),p={x:n,y:r},m=Ld(i),w=Od(m),y=await l.getDimensions(u),S=m==="y",h=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[m]-p[m]-o.floating[w],P=p[m]-o.reference[m],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=E?E[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(E)))&&(j=s.floating[x]||o.floating[w]);const _=C/2-P/2,L=j/2-y[w]/2-1,A=Qn(d[h],L),M=Qn(d[v],L),T=A,U=j-y[w]-M,O=j/2-y[w]/2+_,D=ic(T,O,U),B=!a.arrow&&Ci(i)!=null&&O!==D&&o.reference[w]/2-(OO<=0)){var M,T;const O=(((M=o.flip)==null?void 0:M.index)||0)+1,D=j[O];if(D&&(!(d==="alignment"?v!==Jt(D):!1)||A.every(N=>Jt(N.placement)===v?N.overflows[0]>0:!0)))return{data:{index:O,overflows:A},reset:{placement:D}};let B=(T=A.filter(V=>V.overflows[0]<=0).sort((V,N)=>V.overflows[1]-N.overflows[1])[0])==null?void 0:T.placement;if(!B)switch(m){case"bestFit":{var U;const V=(U=A.filter(N=>{if(E){const R=Jt(N.placement);return R===v||R==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(R=>R>0).reduce((R,k)=>R+k,0)]).sort((N,R)=>N[1]-R[1])[0])==null?void 0:U[0];V&&(B=V);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function Yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qp(e){return AE.some(t=>e[t]>=0)}const WE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=yn(e,t);switch(r){case"referenceHidden":{const o=await No(t,{...i,elementContext:"reference"}),l=Yp(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Qp(l)}}}case"escaped":{const o=await No(t,{...i,altBoundary:!0}),l=Yp(o,n.floating);return{data:{escapedOffsets:l,escaped:Qp(l)}}}default:return{}}}}},cv=new Set(["left","top"]);async function KE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=vn(n),s=Ci(n),a=Jt(n)==="y",u=cv.has(l)?-1:1,c=o&&a?-1:1,d=yn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),a?{x:m*c,y:p*u}:{x:p*u,y:m*c}}const GE=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 KE(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}}}}},YE=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:h,y:v}=S;return{x:h,y:v}}},...a}=yn(e,t),u={x:n,y:r},c=await No(t,a),d=Jt(vn(i)),p=Md(d);let m=u[p],w=u[d];if(o){const S=p==="y"?"top":"left",h=p==="y"?"bottom":"right",v=m+c[S],x=m-c[h];m=ic(v,m,x)}if(l){const S=d==="y"?"top":"left",h=d==="y"?"bottom":"right",v=w+c[S],x=w-c[h];w=ic(v,w,x)}const y=s.fn({...t,[p]:m,[d]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[d]:l}}}}}},QE=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}=yn(e,t),c={x:n,y:r},d=Jt(i),p=Md(d);let m=c[p],w=c[d];const y=yn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,P=o.reference[p]+o.reference[x]-S.mainAxis;mP&&(m=P)}if(u){var h,v;const x=p==="y"?"width":"height",C=cv.has(vn(i)),P=o.reference[d]-o.floating[x]+(C&&((h=l.offset)==null?void 0:h[d])||0)+(C?0:S.crossAxis),E=o.reference[d]+o.reference[x]+(C?0:((v=l.offset)==null?void 0:v[d])||0)-(C?S.crossAxis:0);wE&&(w=E)}return{[p]:m,[d]:w}}}},qE=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}=yn(e,t),c=await No(t,u),d=vn(i),p=Ci(i),m=Jt(i)==="y",{width:w,height:y}=o.floating;let S,h;d==="top"||d==="bottom"?(S=d,h=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(h=d,S=p==="end"?"top":"bottom");const v=y-c.top-c.bottom,x=w-c.left-c.right,C=Qn(y-c[S],v),P=Qn(w-c[h],x),E=!t.middlewareData.shift;let j=C,_=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),E&&!p){const A=dt(c.left,0),M=dt(c.right,0),T=dt(c.top,0),U=dt(c.bottom,0);m?_=w-2*(A!==0||M!==0?A+M:dt(c.left,c.right)):j=y-2*(T!==0||U!==0?T+U:dt(c.top,c.bottom))}await a({...t,availableWidth:_,availableHeight:j});const L=await l.getDimensions(s.floating);return w!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Bs(){return typeof window<"u"}function bi(e){return dv(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function on(e){var t;return(t=(dv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dv(e){return Bs()?e instanceof Node||e instanceof ht(e).Node:!1}function $t(e){return Bs()?e instanceof Element||e instanceof ht(e).Element:!1}function nn(e){return Bs()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function qp(e){return!Bs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}const XE=new Set(["inline","contents"]);function zo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!XE.has(i)}const JE=new Set(["table","td","th"]);function ZE(e){return JE.has(bi(e))}const eN=[":popover-open",":modal"];function $s(e){return eN.some(t=>{try{return e.matches(t)}catch{return!1}})}const tN=["transform","translate","scale","rotate","perspective"],nN=["transform","translate","scale","rotate","perspective","filter"],rN=["paint","layout","strict","content"];function Dd(e){const t=zd(),n=$t(e)?Ut(e):e;return tN.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)||nN.some(r=>(n.willChange||"").includes(r))||rN.some(r=>(n.contain||"").includes(r))}function iN(e){let t=qn(e);for(;nn(t)&&!gi(t);){if(Dd(t))return t;if($s(t))return null;t=qn(t)}return null}function zd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oN=new Set(["html","body","#document"]);function gi(e){return oN.has(bi(e))}function Ut(e){return ht(e).getComputedStyle(e)}function Us(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qn(e){if(bi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qp(e)&&e.host||on(e);return qp(t)?t.host:t}function fv(e){const t=qn(e);return gi(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&zo(t)?t:fv(t)}function Po(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=fv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=ht(i);if(o){const s=lc(l);return t.concat(l,l.visualViewport||[],zo(i)?i:[],s&&n?Po(s):[])}return t.concat(i,Po(i,[],n))}function lc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pv(e){const t=Ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=nn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=fs(n)!==o||fs(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Fd(e){return $t(e)?e:e.contextElement}function ei(e){const t=Fd(e);if(!nn(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=pv(t);let l=(o?fs(n.width):n.width)/r,s=(o?fs(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const lN=tn(0);function mv(e){const t=ht(e);return!zd()||!t.visualViewport?lN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ht(e)?!1:t}function Sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Fd(e);let l=tn(1);t&&(r?$t(r)&&(l=ei(r)):l=ei(e));const s=sN(o,n,r)?mv(o):tn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const p=ht(o),m=r&&$t(r)?ht(r):r;let w=p,y=lc(w);for(;y&&r&&m!==w;){const S=ei(y),h=y.getBoundingClientRect(),v=Ut(y),x=h.left+(y.clientLeft+parseFloat(v.paddingLeft))*S.x,C=h.top+(y.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,c*=S.x,d*=S.y,a+=x,u+=C,w=ht(y),y=lc(w)}}return ms({width:c,height:d,x:a,y:u})}function Vs(e,t){const n=Us(e).scrollLeft;return t?t.left+n:Sr(on(e)).left+n}function hv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Vs(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function aN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=on(r),s=t?$s(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=tn(1);const c=tn(0),d=nn(r);if((d||!d&&!o)&&((bi(r)!=="body"||zo(l))&&(a=Us(r)),nn(r))){const m=Sr(r);u=ei(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}const p=l&&!d&&!o?hv(l,a):tn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-a.scrollTop*u.y+c.y+p.y}}function uN(e){return Array.from(e.getClientRects())}function cN(e){const t=on(e),n=Us(e),r=e.ownerDocument.body,i=dt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=dt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Vs(e);const s=-n.scrollTop;return Ut(r).direction==="rtl"&&(l+=dt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const Xp=25;function dN(e,t){const n=ht(e),r=on(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const c=zd();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Vs(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-m);w<=Xp&&(o-=w)}else u<=Xp&&(o+=u);return{width:o,height:l,x:s,y:a}}const fN=new Set(["absolute","fixed"]);function pN(e,t){const n=Sr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=nn(e)?ei(e):tn(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 Jp(e,t,n){let r;if(t==="viewport")r=dN(e,n);else if(t==="document")r=cN(on(e));else if($t(t))r=pN(t,n);else{const i=mv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ms(r)}function gv(e,t){const n=qn(e);return n===t||!$t(n)||gi(n)?!1:Ut(n).position==="fixed"||gv(n,t)}function mN(e,t){const n=t.get(e);if(n)return n;let r=Po(e,[],!1).filter(s=>$t(s)&&bi(s)!=="body"),i=null;const o=Ut(e).position==="fixed";let l=o?qn(e):e;for(;$t(l)&&!gi(l);){const s=Ut(l),a=Dd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&fN.has(i.position)||zo(l)&&!a&&gv(e,l))?r=r.filter(c=>c!==l):i=s,l=qn(l)}return t.set(e,r),r}function hN(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?$s(t)?[]:mN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,c)=>{const d=Jp(t,c,i);return u.top=dt(d.top,u.top),u.right=Qn(d.right,u.right),u.bottom=Qn(d.bottom,u.bottom),u.left=dt(d.left,u.left),u},Jp(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function gN(e){const{width:t,height:n}=pv(e);return{width:t,height:n}}function yN(e,t,n){const r=nn(t),i=on(t),o=n==="fixed",l=Sr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=tn(0);function u(){a.x=Vs(i)}if(r||!r&&!o)if((bi(t)!=="body"||zo(i))&&(s=Us(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 c=i&&!r&&!o?hv(i,s):tn(0),d=l.left+s.scrollLeft-a.x-c.x,p=l.top+s.scrollTop-a.y-c.y;return{x:d,y:p,width:l.width,height:l.height}}function Aa(e){return Ut(e).position==="static"}function Zp(e,t){if(!nn(e)||Ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return on(e)===n&&(n=n.ownerDocument.body),n}function yv(e,t){const n=ht(e);if($s(e))return n;if(!nn(e)){let i=qn(e);for(;i&&!gi(i);){if($t(i)&&!Aa(i))return i;i=qn(i)}return n}let r=Zp(e,t);for(;r&&ZE(r)&&Aa(r);)r=Zp(r,t);return r&&gi(r)&&Aa(r)&&!Dd(r)?n:r||iN(e)||n}const vN=async function(e){const t=this.getOffsetParent||yv,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 xN(e){return Ut(e).direction==="rtl"}const wN={convertOffsetParentRelativeRectToViewportRelativeRect:aN,getDocumentElement:on,getClippingRect:hN,getOffsetParent:yv,getElementRects:vN,getClientRects:uN,getDimensions:gN,getScale:ei,isElement:$t,isRTL:xN};function vv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SN(e,t){let n=null,r;const i=on(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:c,top:d,width:p,height:m}=u;if(s||t(),!p||!m)return;const w=sl(d),y=sl(i.clientWidth-(c+p)),S=sl(i.clientHeight-(d+m)),h=sl(c),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-h+"px",threshold:dt(0,Qn(1,a))||1};let C=!0;function P(E){const j=E[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!vv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(P,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,x)}n.observe(e)}return l(!0),o}function kN(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=Fd(e),c=i||o?[...u?Po(u):[],...Po(t)]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});const d=u&&s?SN(u,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(h=>{let[v]=h;v&&v.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,y=a?Sr(e):null;a&&S();function S(){const h=Sr(e);y&&!vv(y,h)&&n(),y=h,w=requestAnimationFrame(S)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(h=m)==null||h.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const CN=GE,bN=YE,EN=HE,NN=qE,PN=WE,em=VE,jN=QE,TN=(e,t,n)=>{const r=new Map,i={platform:wN,...n},o={...i.platform,_c:r};return UE(e,t,{...i,platform:o})};var _N=typeof document<"u",AN=function(){},jl=_N?g.useLayoutEffect:AN;function hs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,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(!hs(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)&&!hs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function xv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tm(e,t){const n=xv(e);return Math.round(t*n)/n}function Ra(e){const t=g.useRef(e);return jl(()=>{t.current=e}),t}function RN(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,[c,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);hs(p,r)||m(r);const[w,y]=g.useState(null),[S,h]=g.useState(null),v=g.useCallback(N=>{N!==E.current&&(E.current=N,y(N))},[]),x=g.useCallback(N=>{N!==j.current&&(j.current=N,h(N))},[]),C=o||w,P=l||S,E=g.useRef(null),j=g.useRef(null),_=g.useRef(c),L=a!=null,A=Ra(a),M=Ra(i),T=Ra(u),U=g.useCallback(()=>{if(!E.current||!j.current)return;const N={placement:t,strategy:n,middleware:p};M.current&&(N.platform=M.current),TN(E.current,j.current,N).then(R=>{const k={...R,isPositioned:T.current!==!1};O.current&&!hs(_.current,k)&&(_.current=k,wi.flushSync(()=>{d(k)}))})},[p,t,n,M,T]);jl(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const O=g.useRef(!1);jl(()=>(O.current=!0,()=>{O.current=!1}),[]),jl(()=>{if(C&&(E.current=C),P&&(j.current=P),C&&P){if(A.current)return A.current(C,P,U);U()}},[C,P,U,A,L]);const D=g.useMemo(()=>({reference:E,floating:j,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:C,floating:P}),[C,P]),V=g.useMemo(()=>{const N={position:n,left:0,top:0};if(!B.floating)return N;const R=tm(B.floating,c.x),k=tm(B.floating,c.y);return s?{...N,transform:"translate("+R+"px, "+k+"px)",...xv(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:k}},[n,s,B.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:U,refs:D,elements:B,floatingStyles:V}),[c,U,D,B,V])}const IN=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?em({element:r.current,padding:i}).fn(n):{}:r?em({element:r,padding:i}).fn(n):{}}}},MN=(e,t)=>({...CN(e),options:[e,t]}),ON=(e,t)=>({...bN(e),options:[e,t]}),LN=(e,t)=>({...jN(e),options:[e,t]}),DN=(e,t)=>({...EN(e),options:[e,t]}),zN=(e,t)=>({...NN(e),options:[e,t]}),FN=(e,t)=>({...PN(e),options:[e,t]}),BN=(e,t)=>({...IN(e),options:[e,t]});var $N="Arrow",wv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return f.jsx(J.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"})})});wv.displayName=$N;var UN=wv,Bd="Popper",[Sv,kv]=tr(Bd),[VN,Cv]=Sv(Bd),bv=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return f.jsx(VN,{scope:t,anchor:r,onAnchorChange:i,children:n})};bv.displayName=Bd;var Ev="PopperAnchor",Nv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Cv(Ev,n),l=g.useRef(null),s=de(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:f.jsx(J.div,{...i,ref:s})});Nv.displayName=Ev;var $d="PopperContent",[HN,WN]=Sv($d),Pv=g.forwardRef((e,t)=>{var G,ne,ke,oe,le,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:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,S=Cv($d,n),[h,v]=g.useState(null),x=de(t,Ye=>v(Ye)),[C,P]=g.useState(null),E=$y(C),j=(E==null?void 0:E.width)??0,_=(E==null?void 0:E.height)??0,L=r+(o!=="center"?"-"+o:""),A=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},M=Array.isArray(u)?u:[u],T=M.length>0,U={padding:A,boundary:M.filter(GN),altBoundary:T},{refs:O,floatingStyles:D,placement:B,isPositioned:V,middlewareData:N}=RN({strategy:"fixed",placement:L,whileElementsMounted:(...Ye)=>kN(...Ye,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[MN({mainAxis:i+_,alignmentAxis:l}),a&&ON({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?LN():void 0,...U}),a&&DN({...U}),zN({...U,apply:({elements:Ye,rects:xt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:ea}=xt.reference,or=Ye.floating.style;or.setProperty("--radix-popper-available-width",`${Sn}px`),or.setProperty("--radix-popper-available-height",`${kn}px`),or.setProperty("--radix-popper-anchor-width",`${Cn}px`),or.setProperty("--radix-popper-anchor-height",`${ea}px`)}}),C&&BN({element:C,padding:s}),YN({arrowWidth:j,arrowHeight:_}),p&&FN({strategy:"referenceHidden",...U})]}),[R,k]=_v(B),H=Yn(w);Ke(()=>{V&&(H==null||H())},[V,H]);const K=(G=N.arrow)==null?void 0:G.x,b=(ne=N.arrow)==null?void 0:ne.y,pe=((ke=N.arrow)==null?void 0:ke.centerOffset)!==0,[Le,ie]=g.useState();return Ke(()=>{h&&ie(window.getComputedStyle(h).zIndex)},[h]),f.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:V?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Le,"--radix-popper-transform-origin":[(oe=N.transformOrigin)==null?void 0:oe.x,(le=N.transformOrigin)==null?void 0:le.y].join(" "),...((ce=N.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(HN,{scope:n,placedSide:R,onArrowChange:P,arrowX:K,arrowY:b,shouldHideArrow:pe,children:f.jsx(J.div,{"data-side":R,"data-align":k,...y,ref:x,style:{...y.style,animation:V?void 0:"none"}})})})});Pv.displayName=$d;var jv="PopperArrow",KN={top:"bottom",right:"left",bottom:"top",left:"right"},Tv=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=WN(jv,r),l=KN[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(UN,{...i,ref:n,style:{...i.style,display:"block"}})})});Tv.displayName=jv;function GN(e){return e!==null}var YN=e=>({name:"transformOrigin",options:e,fn(t){var S,h,v;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,c]=_v(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((h=i.arrow)==null?void 0:h.x)??0)+s/2,m=(((v=i.arrow)==null?void 0:v.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?d:`${p}px`,y=`${-a}px`):u==="top"?(w=l?d:`${p}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?d:`${m}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?d:`${m}px`),{data:{x:w,y}}}});function _v(e){const[t,n="center"]=e.split("-");return[t,n]}var QN=bv,qN=Nv,XN=Pv,JN=Tv,ZN="Portal",Ud=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);Ke(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ZS.createPortal(f.jsx(J.div,{...r,ref:t}),l):null});Ud.displayName=ZN;var Av=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"}),e2="VisuallyHidden",t2=g.forwardRef((e,t)=>f.jsx(J.span,{...e,ref:t,style:{...Av,...e.style}}));t2.displayName=e2;var n2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rr=new WeakMap,al=new WeakMap,ul={},Ia=0,Rv=function(e){return e&&(e.host||Rv(e.parentNode))},r2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Rv(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})},i2=function(e,t,n,r){var i=r2(t,Array.isArray(e)?e:[e]);ul[n]||(ul[n]=new WeakMap);var o=ul[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))c(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",y=(Rr.get(p)||0)+1,S=(o.get(p)||0)+1;Rr.set(p,y),o.set(p,S),l.push(p),y===1&&w&&al.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",p,h)}})};return c(t),s.clear(),Ia++,function(){l.forEach(function(d){var p=Rr.get(d)-1,m=o.get(d)-1;Rr.set(d,p),o.set(d,m),p||(al.has(d)||d.removeAttribute(r),al.delete(d)),m||d.removeAttribute(n)}),Ia--,Ia||(Rr=new WeakMap,Rr=new WeakMap,al=new WeakMap,ul={})}},Iv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||n2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),i2(r,i,n,"aria-hidden")):function(){return null}},qt=function(){return qt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return S2;var t=k2(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])}},b2=Dv(),ti="data-scroll-locked",E2=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(l2,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body[`).concat(ti,`] { 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(Tl,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(_l,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(Tl," .").concat(Tl,` { right: 0 `).concat(r,`; } .`).concat(_l," .").concat(_l,` { margin-right: 0 `).concat(r,`; } body[`).concat(ti,`] { `).concat(s2,": ").concat(s,`px; } `)},im=function(){var e=parseInt(document.body.getAttribute(ti)||"0",10);return isFinite(e)?e:0},N2=function(){g.useEffect(function(){return document.body.setAttribute(ti,(im()+1).toString()),function(){var e=im()-1;e<=0?document.body.removeAttribute(ti):document.body.setAttribute(ti,e.toString())}},[])},P2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;N2();var o=g.useMemo(function(){return C2(i)},[i]);return g.createElement(b2,{styles:E2(o,!t,i,n?"":"!important")})},sc=!1;if(typeof window<"u")try{var cl=Object.defineProperty({},"passive",{get:function(){return sc=!0,!0}});window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{sc=!1}var Ir=sc?{passive:!1}:!1,j2=function(e){return e.tagName==="TEXTAREA"},zv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!j2(e)&&n[t]==="visible")},T2=function(e){return zv(e,"overflowY")},_2=function(e){return zv(e,"overflowX")},om=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Fv(e,r);if(i){var o=Bv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},A2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},R2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Fv=function(e,t){return e==="v"?T2(t):_2(t)},Bv=function(e,t){return e==="v"?A2(t):R2(t)},I2=function(e,t){return e==="h"&&t==="rtl"?-1:1},M2=function(e,t,n,r,i){var o=I2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,c=l>0,d=0,p=0;do{if(!s)break;var m=Bv(e,s),w=m[0],y=m[1],S=m[2],h=y-S-o*w;(w||h)&&Fv(e,s)&&(d+=h,p+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&(i&&Math.abs(d)<1||!i&&l>d)||!c&&(i&&Math.abs(p)<1||!i&&-l>p))&&(u=!0),u},dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lm=function(e){return[e.deltaX,e.deltaY]},sm=function(e){return e&&"current"in e?e.current:e},O2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},L2=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},D2=0,Mr=[];function z2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(D2++)[0],o=g.useState(Dv)[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 y=o2([e.lockRef.current],(e.shards||[]).map(sm),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var h=dl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-h[0],C="deltaY"in y?y.deltaY:v[1]-h[1],P,E=y.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in y&&j==="h"&&E.type==="range")return!1;var _=om(j,E);if(!_)return!0;if(_?P=j:(P=j==="v"?"h":"v",_=om(j,E)),!_)return!1;if(!r.current&&"changedTouches"in y&&(x||C)&&(r.current=P),!P)return!0;var L=r.current||P;return M2(L,S,y,L==="h"?x:C,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Mr.length||Mr[Mr.length-1]!==o)){var h="deltaY"in S?lm(S):dl(S),v=t.current.filter(function(P){return P.name===S.type&&(P.target===S.target||S.target===P.shadowParent)&&O2(P.delta,h)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(sm).filter(Boolean).filter(function(P){return P.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(y,S,h,v){var x={name:y,delta:S,target:h,should:v,shadowParent:F2(h)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),c=g.useCallback(function(y){n.current=dl(y),r.current=void 0},[]),d=g.useCallback(function(y){u(y.type,lm(y),y.target,s(y,e.lockRef.current))},[]),p=g.useCallback(function(y){u(y.type,dl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Mr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Ir),document.addEventListener("touchmove",a,Ir),document.addEventListener("touchstart",c,Ir),function(){Mr=Mr.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Ir),document.removeEventListener("touchmove",a,Ir),document.removeEventListener("touchstart",c,Ir)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:L2(i)}):null,m?g.createElement(P2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function F2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const B2=m2(Lv,z2);var $v=g.forwardRef(function(e,t){return g.createElement(Hs,qt({},e,{ref:t,sideCar:B2}))});$v.classNames=Hs.classNames;const Uv=$v;var $2=[" ","Enter","ArrowUp","ArrowDown"],U2=[" ","Enter"],kr="Select",[Ws,Ks,V2]=_d(kr),[Ei,cI]=tr(kr,[V2,kv]),Gs=kv(),[H2,nr]=Ei(kr),[W2,K2]=Ei(kr),Vv=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:p,required:m,form:w}=e,y=Gs(t),[S,h]=g.useState(null),[v,x]=g.useState(null),[C,P]=g.useState(!1),E=zs(u),[j,_]=hi({prop:r,defaultProp:i??!1,onChange:o,caller:kr}),[L,A]=hi({prop:l,defaultProp:s,onChange:a,caller:kr}),M=g.useRef(null),T=S?w||!!S.closest("form"):!0,[U,O]=g.useState(new Set),D=Array.from(U).map(B=>B.props.value).join(";");return f.jsx(QN,{...y,children:f.jsxs(H2,{required:m,scope:t,trigger:S,onTriggerChange:h,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:Wn(),value:L,onValueChange:A,open:j,onOpenChange:_,dir:E,triggerPointerDownPosRef:M,disabled:p,children:[f.jsx(Ws.Provider,{scope:t,children:f.jsx(W2,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(B=>{O(V=>new Set(V).add(B))},[]),onNativeOptionRemove:g.useCallback(B=>{O(V=>{const N=new Set(V);return N.delete(B),N})},[]),children:n})}),T?f.jsxs(mx,{"aria-hidden":!0,required:m,tabIndex:-1,name:c,autoComplete:d,value:L,onChange:B=>A(B.target.value),disabled:p,form:w,children:[L===void 0?f.jsx("option",{value:""}):null,Array.from(U)]},D):null]})})};Vv.displayName=kr;var Hv="SelectTrigger",Wv=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Gs(n),l=nr(Hv,n),s=l.disabled||r,a=de(t,l.onTriggerChange),u=Ks(n),c=g.useRef("touch"),[d,p,m]=gx(y=>{const S=u().filter(x=>!x.disabled),h=S.find(x=>x.value===l.value),v=yx(S,y,h);v!==void 0&&l.onValueChange(v.value)}),w=y=>{s||(l.onOpenChange(!0),m()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return f.jsx(qN,{asChild:!0,...o,children:f.jsx(J.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":hx(l.value)?"":void 0,...i,ref:a,onClick:X(i.onClick,y=>{y.currentTarget.focus(),c.current!=="mouse"&&w(y)}),onPointerDown:X(i.onPointerDown,y=>{c.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:X(i.onKeyDown,y=>{const S=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&$2.includes(y.key)&&(w(),y.preventDefault())})})})});Wv.displayName=Hv;var Kv="SelectValue",Gv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=nr(Kv,n),{onValueNodeHasChildrenChange:u}=a,c=o!==void 0,d=de(t,a.onValueNodeChange);return Ke(()=>{u(c)},[u,c]),f.jsx(J.span,{...s,ref:d,style:{pointerEvents:"none"},children:hx(a.value)?f.jsx(f.Fragment,{children:l}):o})});Gv.displayName=Kv;var G2="SelectIcon",Yv=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(J.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Yv.displayName=G2;var Y2="SelectPortal",Qv=e=>f.jsx(Ud,{asChild:!0,...e});Qv.displayName=Y2;var Cr="SelectContent",qv=g.forwardRef((e,t)=>{const n=nr(Cr,e.__scopeSelect),[r,i]=g.useState();if(Ke(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?wi.createPortal(f.jsx(Xv,{scope:e.__scopeSelect,children:f.jsx(Ws.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(Jv,{...e,ref:t})});qv.displayName=Cr;var At=10,[Xv,rr]=Ei(Cr),Q2="SelectContentImpl",q2=mi("SelectContent.RemoveScroll"),Jv=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S,...h}=e,v=nr(Cr,n),[x,C]=g.useState(null),[P,E]=g.useState(null),j=de(t,G=>C(G)),[_,L]=g.useState(null),[A,M]=g.useState(null),T=Ks(n),[U,O]=g.useState(!1),D=g.useRef(!1);g.useEffect(()=>{if(x)return Iv(x)},[x]),sv();const B=g.useCallback(G=>{const[ne,...ke]=T().map(ce=>ce.ref.current),[oe]=ke.slice(-1),le=document.activeElement;for(const ce of G)if(ce===le||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===ne&&P&&(P.scrollTop=0),ce===oe&&P&&(P.scrollTop=P.scrollHeight),ce==null||ce.focus(),document.activeElement!==le))return},[T,P]),V=g.useCallback(()=>B([_,x]),[B,_,x]);g.useEffect(()=>{U&&V()},[U,V]);const{onOpenChange:N,triggerPointerDownPosRef:R}=v;g.useEffect(()=>{if(x){let G={x:0,y:0};const ne=oe=>{var le,ce;G={x:Math.abs(Math.round(oe.pageX)-(((le=R.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((ce=R.current)==null?void 0:ce.y)??0))}},ke=oe=>{G.x<=10&&G.y<=10?oe.preventDefault():x.contains(oe.target)||N(!1),document.removeEventListener("pointermove",ne),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",ke,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",ke,{capture:!0})}}},[x,N,R]),g.useEffect(()=>{const G=()=>N(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[N]);const[k,H]=gx(G=>{const ne=T().filter(le=>!le.disabled),ke=ne.find(le=>le.ref.current===document.activeElement),oe=yx(ne,G,ke);oe&&setTimeout(()=>oe.ref.current.focus())}),K=g.useCallback((G,ne,ke)=>{const oe=!D.current&&!ke;(v.value!==void 0&&v.value===ne||oe)&&(L(G),oe&&(D.current=!0))},[v.value]),b=g.useCallback(()=>x==null?void 0:x.focus(),[x]),pe=g.useCallback((G,ne,ke)=>{const oe=!D.current&&!ke;(v.value!==void 0&&v.value===ne||oe)&&M(G)},[v.value]),Le=r==="popper"?ac:Zv,ie=Le===ac?{side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return f.jsx(Xv,{scope:n,content:x,viewport:P,onViewportChange:E,itemRefCallback:K,selectedItem:_,onItemLeave:b,itemTextRefCallback:pe,focusSelectedItem:V,selectedItemText:A,position:r,isPositioned:U,searchRef:k,children:f.jsx(Uv,{as:q2,allowPinchZoom:!0,children:f.jsx(Id,{asChild:!0,trapped:v.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:X(i,G=>{var ne;(ne=v.trigger)==null||ne.focus({preventScroll:!0}),G.preventDefault()}),children:f.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(Le,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:G=>G.preventDefault(),...h,...ie,onPlaced:()=>O(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:X(h.onKeyDown,G=>{const ne=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ne&&G.key.length===1&&H(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let oe=T().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(G.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const le=G.target,ce=oe.indexOf(le);oe=oe.slice(ce+1)}setTimeout(()=>B(oe)),G.preventDefault()}})})})})})})});Jv.displayName=Q2;var X2="SelectItemAlignedPosition",Zv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=nr(Cr,n),l=rr(Cr,n),[s,a]=g.useState(null),[u,c]=g.useState(null),d=de(t,j=>c(j)),p=Ks(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:h,focusSelectedItem:v}=l,x=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&y&&S&&h){const j=o.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),A=h.getBoundingClientRect();if(o.dir!=="rtl"){const le=A.left-_.left,ce=L.left-le,Ye=j.left-ce,xt=j.width+Ye,Sn=Math.max(xt,_.width),kn=window.innerWidth-At,Cn=ds(ce,[At,Math.max(At,kn-Sn)]);s.style.minWidth=xt+"px",s.style.left=Cn+"px"}else{const le=_.right-A.right,ce=window.innerWidth-L.right-le,Ye=window.innerWidth-j.right-ce,xt=j.width+Ye,Sn=Math.max(xt,_.width),kn=window.innerWidth-At,Cn=ds(ce,[At,Math.max(At,kn-Sn)]);s.style.minWidth=xt+"px",s.style.right=Cn+"px"}const M=p(),T=window.innerHeight-At*2,U=y.scrollHeight,O=window.getComputedStyle(u),D=parseInt(O.borderTopWidth,10),B=parseInt(O.paddingTop,10),V=parseInt(O.borderBottomWidth,10),N=parseInt(O.paddingBottom,10),R=D+B+U+N+V,k=Math.min(S.offsetHeight*5,R),H=window.getComputedStyle(y),K=parseInt(H.paddingTop,10),b=parseInt(H.paddingBottom,10),pe=j.top+j.height/2-At,Le=T-pe,ie=S.offsetHeight/2,G=S.offsetTop+ie,ne=D+B+G,ke=R-ne;if(ne<=pe){const le=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const ce=u.clientHeight-y.offsetTop-y.offsetHeight,Ye=Math.max(Le,ie+(le?b:0)+ce+V),xt=ne+Ye;s.style.height=xt+"px"}else{const le=M.length>0&&S===M[0].ref.current;s.style.top="0px";const Ye=Math.max(pe,D+y.offsetTop+(le?K:0)+ie)+ke;s.style.height=Ye+"px",y.scrollTop=ne-pe+y.offsetTop}s.style.margin=`${At}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,y,S,h,o.dir,r]);Ke(()=>x(),[x]);const[C,P]=g.useState();Ke(()=>{u&&P(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(j=>{j&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return f.jsx(Z2,{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(J.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Zv.displayName=X2;var J2="SelectPopperPosition",ac=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=At,...o}=e,l=Gs(n);return f.jsx(XN,{...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)"}})});ac.displayName=J2;var[Z2,Vd]=Ei(Cr,{}),uc="SelectViewport",ex=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=rr(uc,n),l=Vd(uc,n),s=de(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(Ws.Slot,{scope:n,children:f.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:X(i.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const m=Math.abs(a.current-c.scrollTop);if(m>0){const w=window.innerHeight-At*2,y=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),h=Math.max(y,S);if(h0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});ex.displayName=uc;var tx="SelectGroup",[eP,tP]=Ei(tx),nx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Wn();return f.jsx(eP,{scope:n,id:i,children:f.jsx(J.div,{role:"group","aria-labelledby":i,...r,ref:t})})});nx.displayName=tx;var rx="SelectLabel",ix=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=tP(rx,n);return f.jsx(J.div,{id:i.id,...r,ref:t})});ix.displayName=rx;var gs="SelectItem",[nP,ox]=Ei(gs),lx=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=nr(gs,n),a=rr(gs,n),u=s.value===r,[c,d]=g.useState(o??""),[p,m]=g.useState(!1),w=de(t,v=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,v,r,i)}),y=Wn(),S=g.useRef("touch"),h=()=>{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(nP,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:g.useCallback(v=>{d(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:f.jsx(Ws.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:f.jsx(J.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:X(l.onFocus,()=>m(!0)),onBlur:X(l.onBlur,()=>m(!1)),onClick:X(l.onClick,()=>{S.current!=="mouse"&&h()}),onPointerUp:X(l.onPointerUp,()=>{S.current==="mouse"&&h()}),onPointerDown:X(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:X(l.onPointerMove,v=>{var x;S.current=v.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:X(l.onKeyDown,v=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(U2.includes(v.key)&&h(),v.key===" "&&v.preventDefault())})})})})});lx.displayName=gs;var Ki="SelectItemText",sx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=nr(Ki,n),s=rr(Ki,n),a=ox(Ki,n),u=K2(Ki,n),[c,d]=g.useState(null),p=de(t,h=>d(h),a.onItemTextChange,h=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,h,a.value,a.disabled)}),m=c==null?void 0:c.textContent,w=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return Ke(()=>(y(w),()=>S(w)),[y,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(J.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?wi.createPortal(o.children,l.valueNode):null]})});sx.displayName=Ki;var ax="SelectItemIndicator",ux=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ox(ax,n).isSelected?f.jsx(J.span,{"aria-hidden":!0,...r,ref:t}):null});ux.displayName=ax;var cc="SelectScrollUpButton",cx=g.forwardRef((e,t)=>{const n=rr(cc,e.__scopeSelect),r=Vd(cc,e.__scopeSelect),[i,o]=g.useState(!1),l=de(t,r.onScrollButtonChange);return Ke(()=>{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(fx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});cx.displayName=cc;var dc="SelectScrollDownButton",dx=g.forwardRef((e,t)=>{const n=rr(dc,e.__scopeSelect),r=Vd(dc,e.__scopeSelect),[i,o]=g.useState(!1),l=de(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,c=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?f.jsx(fx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});dx.displayName=dc;var fx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=rr("SelectScrollButton",n),l=g.useRef(null),s=Ks(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Ke(()=>{var c;const u=s().find(d=>d.ref.current===document.activeElement);(c=u==null?void 0:u.ref.current)==null||c.scrollIntoView({block:"nearest"})},[s]),f.jsx(J.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:X(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:X(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:X(i.onPointerLeave,()=>{a()})})}),rP="SelectSeparator",px=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(J.div,{"aria-hidden":!0,...r,ref:t})});px.displayName=rP;var fc="SelectArrow",iP=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Gs(n),o=nr(fc,n),l=rr(fc,n);return o.open&&l.position==="popper"?f.jsx(JN,{...i,...r,ref:t}):null});iP.displayName=fc;var oP="SelectBubbleInput",mx=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=de(r,i),l=By(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&c){const d=new Event("change",{bubbles:!0});c.call(s,t),s.dispatchEvent(d)}},[l,t]),f.jsx(J.select,{...n,style:{...Av,...n.style},ref:o,defaultValue:t})});mx.displayName=oP;function hx(e){return e===""||e===void 0}function gx(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 yx(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=lP(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 lP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sP=Vv,vx=Wv,aP=Gv,uP=Yv,cP=Qv,xx=qv,dP=ex,fP=nx,wx=ix,Sx=lx,pP=sx,mP=ux,kx=cx,Cx=dx,bx=px;const am=sP,Da=fP,um=aP,pc=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(vx,{ref:r,className:re("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,f.jsx(uP,{asChild:!0,children:f.jsx(My,{className:"h-4 w-4 opacity-50"})})]}));pc.displayName=vx.displayName;const Ex=g.forwardRef(({className:e,...t},n)=>f.jsx(kx,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(WC,{className:"h-4 w-4"})}));Ex.displayName=kx.displayName;const Nx=g.forwardRef(({className:e,...t},n)=>f.jsx(Cx,{ref:n,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(My,{className:"h-4 w-4"})}));Nx.displayName=Cx.displayName;const mc=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>f.jsx(cP,{children:f.jsxs(xx,{ref:i,className:re("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[f.jsx(Ex,{}),f.jsx(dP,{className:re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(Nx,{})]})}));mc.displayName=xx.displayName;const Al=g.forwardRef(({className:e,...t},n)=>f.jsx(wx,{ref:n,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Al.displayName=wx.displayName;const Rl=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Sx,{ref:r,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(mP,{children:f.jsx(UC,{className:"h-4 w-4"})})}),f.jsx(pP,{children:t})]}));Rl.displayName=Sx.displayName;const hP=g.forwardRef(({className:e,...t},n)=>f.jsx(bx,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));hP.displayName=bx.displayName;function gP(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Fo=e=>{const{present:t,children:n}=e,r=yP(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=de(r.ref,vP(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Fo.displayName="Presence";function yP(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=gP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=fl(r.current);o.current=s==="mounted"?u:"none"},[s]),Ke(()=>{const u=r.current,c=i.current;if(c!==e){const p=o.current,m=fl(u);e?a("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Ke(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=m=>{const y=fl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=fl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function fl(e){return(e==null?void 0:e.animationName)||"none"}function vP(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 Ys="Dialog",[Px,jx]=tr(Ys),[xP,Vt]=Px(Ys),Tx=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,c]=hi({prop:r,defaultProp:i??!1,onChange:o,caller:Ys});return f.jsx(xP,{scope:t,triggerRef:s,contentRef:a,contentId:Wn(),titleId:Wn(),descriptionId:Wn(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:l,children:n})};Tx.displayName=Ys;var _x="DialogTrigger",Ax=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(_x,n),o=de(t,i.triggerRef);return f.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Kd(i.open),...r,ref:o,onClick:X(e.onClick,i.onOpenToggle)})});Ax.displayName=_x;var Hd="DialogPortal",[wP,Rx]=Px(Hd,{forceMount:void 0}),Ix=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Vt(Hd,t);return f.jsx(wP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(Fo,{present:n||o.open,children:f.jsx(Ud,{asChild:!0,container:i,children:l})}))})};Ix.displayName=Hd;var ys="DialogOverlay",Mx=g.forwardRef((e,t)=>{const n=Rx(ys,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vt(ys,e.__scopeDialog);return o.modal?f.jsx(Fo,{present:r||o.open,children:f.jsx(kP,{...i,ref:t})}):null});Mx.displayName=ys;var SP=mi("DialogOverlay.RemoveScroll"),kP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(ys,n);return f.jsx(Uv,{as:SP,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(J.div,{"data-state":Kd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),br="DialogContent",Ox=g.forwardRef((e,t)=>{const n=Rx(br,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vt(br,e.__scopeDialog);return f.jsx(Fo,{present:r||o.open,children:o.modal?f.jsx(CP,{...i,ref:t}):f.jsx(bP,{...i,ref:t})})});Ox.displayName=br;var CP=g.forwardRef((e,t)=>{const n=Vt(br,e.__scopeDialog),r=g.useRef(null),i=de(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Iv(o)},[]),f.jsx(Lx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:X(e.onFocusOutside,o=>o.preventDefault())})}),bP=g.forwardRef((e,t)=>{const n=Vt(br,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return f.jsx(Lx,{...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()}})}),Lx=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Vt(br,n),a=g.useRef(null),u=de(t,a);return sv(),f.jsxs(f.Fragment,{children:[f.jsx(Id,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:f.jsx(Rd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Kd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(NP,{titleId:s.titleId}),f.jsx(jP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Wd="DialogTitle",Dx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(Wd,n);return f.jsx(J.h2,{id:i.titleId,...r,ref:t})});Dx.displayName=Wd;var zx="DialogDescription",Fx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(zx,n);return f.jsx(J.p,{id:i.descriptionId,...r,ref:t})});Fx.displayName=zx;var Bx="DialogClose",$x=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(Bx,n);return f.jsx(J.button,{type:"button",...r,ref:t,onClick:X(e.onClick,()=>i.onOpenChange(!1))})});$x.displayName=Bx;function Kd(e){return e?"open":"closed"}var Ux="DialogTitleWarning",[EP,Vx]=Bb(Ux,{contentName:br,titleName:Wd,docsSlug:"dialog"}),NP=({titleId:e})=>{const t=Vx(Ux),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},PP="DialogDescriptionWarning",jP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Vx(PP).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},TP=Tx,_P=Ax,AP=Ix,RP=Mx,IP=Ox,MP=Dx,OP=Fx,Hx=$x,Wx="AlertDialog",[LP,dI]=tr(Wx,[jx]),wn=jx(),Kx=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(TP,{...r,...n,modal:!0})};Kx.displayName=Wx;var DP="AlertDialogTrigger",zP=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(_P,{...i,...r,ref:t})});zP.displayName=DP;var FP="AlertDialogPortal",Gx=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(AP,{...r,...n})};Gx.displayName=FP;var BP="AlertDialogOverlay",Yx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(RP,{...i,...r,ref:t})});Yx.displayName=BP;var ni="AlertDialogContent",[$P,UP]=LP(ni),VP=Ab("AlertDialogContent"),Qx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=wn(n),l=g.useRef(null),s=de(t,l),a=g.useRef(null);return f.jsx(EP,{contentName:ni,titleName:qx,docsSlug:"alert-dialog",children:f.jsx($P,{scope:n,cancelRef:a,children:f.jsxs(IP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:X(i.onOpenAutoFocus,u=>{var c;u.preventDefault(),(c=a.current)==null||c.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[f.jsx(VP,{children:r}),f.jsx(WP,{contentRef:l})]})})})});Qx.displayName=ni;var qx="AlertDialogTitle",Xx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(MP,{...i,...r,ref:t})});Xx.displayName=qx;var Jx="AlertDialogDescription",Zx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(OP,{...i,...r,ref:t})});Zx.displayName=Jx;var HP="AlertDialogAction",e0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(Hx,{...i,...r,ref:t})});e0.displayName=HP;var t0="AlertDialogCancel",n0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=UP(t0,n),o=wn(n),l=de(t,i);return f.jsx(Hx,{...o,...r,ref:l})});n0.displayName=t0;var WP=({contentRef:e})=>{const t=`\`${ni}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${ni}\` by passing a \`${Jx}\` 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 \`${ni}\`. 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},KP=Kx,GP=Gx,r0=Yx,i0=Qx,o0=e0,l0=n0,s0=Xx,a0=Zx;const YP=KP,QP=GP,u0=g.forwardRef(({className:e,...t},n)=>f.jsx(r0,{className:re("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));u0.displayName=r0.displayName;const c0=g.forwardRef(({className:e,...t},n)=>f.jsxs(QP,{children:[f.jsx(u0,{}),f.jsx(i0,{ref:n,className:re("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));c0.displayName=i0.displayName;const d0=({className:e,...t})=>f.jsx("div",{className:re("flex flex-col space-y-2 text-center sm:text-left",e),...t});d0.displayName="AlertDialogHeader";const f0=({className:e,...t})=>f.jsx("div",{className:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});f0.displayName="AlertDialogFooter";const p0=g.forwardRef(({className:e,...t},n)=>f.jsx(s0,{ref:n,className:re("text-lg font-semibold",e),...t}));p0.displayName=s0.displayName;const m0=g.forwardRef(({className:e,...t},n)=>f.jsx(a0,{ref:n,className:re("text-sm text-muted-foreground",e),...t}));m0.displayName=a0.displayName;const h0=g.forwardRef(({className:e,...t},n)=>f.jsx(o0,{ref:n,className:re(Td(),e),...t}));h0.displayName=o0.displayName;const g0=g.forwardRef(({className:e,...t},n)=>f.jsx(l0,{ref:n,className:re(Td({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));g0.displayName=l0.displayName;const y0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));y0.displayName="Textarea";function qP(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const XP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZP={};function cm(e,t){return((t||ZP).jsx?JP:XP).test(e)}const ej=/[ \t\n\f\r]/g;function tj(e){return typeof e=="object"?e.type==="text"?dm(e.value):!1:dm(e)}function dm(e){return e.replace(ej,"")===""}class Bo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bo.prototype.normal={};Bo.prototype.property={};Bo.prototype.space=void 0;function v0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bo(n,r,t)}function hc(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let nj=0;const q=Tr(),Ae=Tr(),gc=Tr(),F=Tr(),he=Tr(),ri=Tr(),ut=Tr();function Tr(){return 2**++nj}const yc=Object.freeze(Object.defineProperty({__proto__:null,boolean:q,booleanish:Ae,commaOrSpaceSeparated:ut,commaSeparated:ri,number:F,overloadedBoolean:gc,spaceSeparated:he},Symbol.toStringTag,{value:"Module"})),za=Object.keys(yc);class Gd extends st{constructor(t,n,r,i){let o=-1;if(super(t,n),fm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&sj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(pm,cj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!pm.test(o)){let l=o.replace(lj,uj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Gd}return new i(r,t)}function uj(e){return"-"+e.toLowerCase()}function cj(e){return e.charAt(1).toUpperCase()}const dj=v0([x0,rj,k0,C0,b0],"html"),Yd=v0([x0,ij,k0,C0,b0],"svg");function fj(e){return e.join(" ").trim()}var Qd={},mm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,pj=/\n/g,mj=/^\s*/,hj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gj=/^:\s*/,yj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vj=/^[;\s]*/,xj=/^\s+|\s+$/g,wj=` `,hm="/",gm="*",ur="",Sj="comment",kj="declaration",Cj=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var y=w.match(pj);y&&(n+=y.length);var S=w.lastIndexOf(wj);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return i(S),e=e.slice(S.length),y}}function u(){a(mj)}function c(w){var y;for(w=w||[];y=d();)y!==!1&&w.push(y);return w}function d(){var w=o();if(!(hm!=e.charAt(0)||gm!=e.charAt(1))){for(var y=2;ur!=e.charAt(y)&&(gm!=e.charAt(y)||hm!=e.charAt(y+1));)++y;if(y+=2,ur===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,i(S),e=e.slice(y),r+=2,w({type:Sj,comment:S})}}function p(){var w=o(),y=a(hj);if(y){if(d(),!a(gj))return s("property missing ':'");var S=a(yj),h=w({type:kj,property:ym(y[0].replace(mm,ur)),value:S?ym(S[0].replace(mm,ur)):ur});return a(vj),h}}function m(){var w=[];c(w);for(var y;y=p();)y!==!1&&(w.push(y),c(w));return w}return u(),m()};function ym(e){return e?e.replace(xj,ur):ur}var bj=Dl&&Dl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qd,"__esModule",{value:!0});Qd.default=Nj;var Ej=bj(Cj);function Nj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Ej.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 Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.camelCase=void 0;var Pj=/^--[a-zA-Z0-9_-]+$/,jj=/-([a-z])/g,Tj=/^[^-]+$/,_j=/^-(webkit|moz|ms|o|khtml)-/,Aj=/^-(ms)-/,Rj=function(e){return!e||Tj.test(e)||Pj.test(e)},Ij=function(e,t){return t.toUpperCase()},vm=function(e,t){return"".concat(t,"-")},Mj=function(e,t){return t===void 0&&(t={}),Rj(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Aj,vm):e=e.replace(_j,vm),e.replace(jj,Ij))};Qs.camelCase=Mj;var Oj=Dl&&Dl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Lj=Oj(Qd),Dj=Qs;function vc(e,t){var n={};return!e||typeof e!="string"||(0,Lj.default)(e,function(r,i){r&&i&&(n[(0,Dj.camelCase)(r,t)]=i)}),n}vc.default=vc;var zj=vc;const Fj=ws(zj),E0=N0("end"),qd=N0("start");function N0(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 Bj(e){const t=qd(e),n=E0(e);if(t&&n)return{start:t,end:n}}function no(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xm(e.position):"start"in e||"end"in e?xm(e):"line"in e||"column"in e?xc(e):""}function xc(e){return wm(e&&e.line)+":"+wm(e&&e.column)}function xm(e){return xc(e&&e.start)+"-"+xc(e&&e.end)}function wm(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let 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=no(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}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Xd={}.hasOwnProperty,$j=new Map,Uj=/[A-Z]/g,Vj=new Set(["table","tbody","thead","tfoot","tr"]),Hj=new Set(["td","th"]),P0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wj(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=Zj(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=Jj(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"?Yd:dj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=j0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function j0(e,t,n){if(t.type==="element")return Kj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Gj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qj(e,t,n);if(t.type==="mdxjsEsm")return Yj(e,t);if(t.type==="root")return qj(e,t,n);if(t.type==="text")return Xj(e,t)}function Kj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yd,e.schema=i),e.ancestors.push(t);const o=_0(e,t.tagName,!1),l=eT(e,t);let s=Zd(e,t);return Vj.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!tj(a):!0})),T0(e,l,o,t),Jd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Gj(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)}jo(e,t.position)}function Yj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jo(e,t.position)}function Qj(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Yd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:_0(e,t.name,!0),l=tT(e,t),s=Zd(e,t);return T0(e,l,o,t),Jd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function qj(e,t,n){const r={};return Jd(r,Zd(e,t)),e.create(t,e.Fragment,r,n)}function Xj(e,t){return t.value}function T0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Jd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Jj(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 Zj(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=qd(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 eT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xd.call(t.properties,i)){const o=nT(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&Hj.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 jo(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 jo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Zd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$j;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?(rn(e,e.length,0,t),e):t}const Cm={}.hasOwnProperty;function cT(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 ii(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xt=ir(/[A-Za-z]/),pt=ir(/[\dA-Za-z]/),pT=ir(/[#-'*+\--9=?A-Z^-~]/);function wc(e){return e!==null&&(e<32||e===127)}const Sc=ir(/\d/),mT=ir(/[\dA-Fa-f]/),hT=ir(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const gT=ir(/\p{P}|\p{S}/u),yT=ir(/\s/);function ir(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pi(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 ye(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return ae(a)?(e.enter(n),s(a)):t(a)}function s(a){return ae(a)&&o++l))return;const j=t.events.length;let _=j,L,A;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(L){A=t.events[_][1].end;break}L=!0}for(h(r),E=j;Ex;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kT(e,t,n){return ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Em(e){if(e===null||lt(e)||yT(e))return 1;if(gT(e))return 2}function tf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Nm(d,-a),Nm(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,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=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=kt(u,tf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,rn(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&ae(E)?ye(e,v,"linePrefix",o+1)(E):v(E)}function v(E){return E===null||Y(E)?e.check(Pm,y,C)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||Y(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),x)}function C(E){return e.exit("codeFenced"),t(E)}function P(E,j,_){let L=0;return A;function A(D){return E.enter("lineEnding"),E.consume(D),E.exit("lineEnding"),M}function M(D){return E.enter("codeFencedFence"),ae(D)?ye(E,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===s?(E.enter("codeFencedFenceSequence"),U(D)):_(D)}function U(D){return D===s?(L++,E.consume(D),U):L>=l?(E.exit("codeFencedFenceSequence"),ae(D)?ye(E,O,"whitespace")(D):O(D)):_(D)}function O(D){return D===null||Y(D)?(E.exit("codeFencedFence"),j(D)):_(D)}}}function MT(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 Ba={name:"codeIndented",tokenize:LT},OT={partial:!0,tokenize:DT};function LT(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ye(e,o,"linePrefix",4+1)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):Y(u)?e.attempt(OT,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Y(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function DT(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ye(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):Y(l)?i(l):n(l)}}const zT={name:"codeText",previous:BT,resolve:FT,tokenize:$T};function FT(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&&Bi(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),Bi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Bi(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 D0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(h){return h===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(h),e.exit(o),p):h===null||h===32||h===41||wc(h)?n(h):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(h))}function p(h){return h===62?(e.enter(o),e.consume(h),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(h))}function m(h){return h===62?(e.exit("chunkString"),e.exit(s),p(h)):h===null||h===60||Y(h)?n(h):(e.consume(h),h===92?w:m)}function w(h){return h===60||h===62||h===92?(e.consume(h),m):m(h)}function y(h){return!c&&(h===null||h===41||lt(h))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(h)):c999||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):Y(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Y(m)||s++>999?(e.exit("chunkString"),c(m)):(e.consume(m),a||(a=!ae(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function F0(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):Y(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ye(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===l||p===null||Y(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===l||p===92?(e.consume(p),c):c(p)}}function ro(e,t){let n;return r;function r(i){return Y(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ae(i)?ye(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const QT={name:"definition",tokenize:XT},qT={partial:!0,tokenize:JT};function XT(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return z0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=ii(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 lt(m)?ro(e,u)(m):u(m)}function u(m){return D0(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(qT,d,d)(m)}function d(m){return ae(m)?ye(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Y(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function JT(e,t,n){return r;function r(s){return lt(s)?ro(e,i)(s):n(s)}function i(s){return F0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ae(s)?ye(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const ZT={name:"hardBreakEscape",tokenize:e_};function e_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Y(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const t_={name:"headingAtx",resolve:n_,tokenize:r_};function n_(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"},rn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function r_(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&r++<6?(e.consume(c),l):c===null||lt(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Y(c)?(e.exit("atxHeading"),t(c)):ae(c)?ye(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||lt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const i_=["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"],Tm=["pre","script","style","textarea"],o_={concrete:!0,name:"htmlFlow",resolveTo:a_,tokenize:u_},l_={partial:!0,tokenize:d_},s_={partial:!0,tokenize:c_};function a_(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 u_(e,t,n){const r=this;let i,o,l,s,a;return u;function u(b){return c(b)}function c(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),o=!0,y):b===63?(e.consume(b),i=3,r.interrupt?t:k):Xt(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):Xt(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 pe="CDATA[";return b===pe.charCodeAt(s++)?(e.consume(b),s===pe.length?r.interrupt?t:T:w):n(b)}function y(b){return Xt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||lt(b)){const pe=b===47,Le=l.toLowerCase();return!pe&&!o&&Tm.includes(Le)?(i=1,r.interrupt?t(b):T(b)):i_.includes(l.toLowerCase())?(i=6,pe?(e.consume(b),h):r.interrupt?t(b):T(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?v(b):x(b))}return b===45||pt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function h(b){return b===62?(e.consume(b),r.interrupt?t:T):n(b)}function v(b){return ae(b)?(e.consume(b),v):A(b)}function x(b){return b===47?(e.consume(b),A):b===58||b===95||Xt(b)?(e.consume(b),C):ae(b)?(e.consume(b),x):A(b)}function C(b){return b===45||b===46||b===58||b===95||pt(b)?(e.consume(b),C):P(b)}function P(b){return b===61?(e.consume(b),E):ae(b)?(e.consume(b),P):x(b)}function E(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,j):ae(b)?(e.consume(b),E):_(b)}function j(b){return b===a?(e.consume(b),a=null,L):b===null||Y(b)?n(b):(e.consume(b),j)}function _(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||lt(b)?P(b):(e.consume(b),_)}function L(b){return b===47||b===62||ae(b)?x(b):n(b)}function A(b){return b===62?(e.consume(b),M):n(b)}function M(b){return b===null||Y(b)?T(b):ae(b)?(e.consume(b),M):n(b)}function T(b){return b===45&&i===2?(e.consume(b),B):b===60&&i===1?(e.consume(b),V):b===62&&i===4?(e.consume(b),H):b===63&&i===3?(e.consume(b),k):b===93&&i===5?(e.consume(b),R):Y(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(l_,K,U)(b)):b===null||Y(b)?(e.exit("htmlFlowData"),U(b)):(e.consume(b),T)}function U(b){return e.check(s_,O,K)(b)}function O(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),D}function D(b){return b===null||Y(b)?U(b):(e.enter("htmlFlowData"),T(b))}function B(b){return b===45?(e.consume(b),k):T(b)}function V(b){return b===47?(e.consume(b),l="",N):T(b)}function N(b){if(b===62){const pe=l.toLowerCase();return Tm.includes(pe)?(e.consume(b),H):T(b)}return Xt(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),N):T(b)}function R(b){return b===93?(e.consume(b),k):T(b)}function k(b){return b===62?(e.consume(b),H):b===45&&i===2?(e.consume(b),k):T(b)}function H(b){return b===null||Y(b)?(e.exit("htmlFlowData"),K(b)):(e.consume(b),H)}function K(b){return e.exit("htmlFlow"),t(b)}}function c_(e,t,n){const r=this;return i;function i(l){return Y(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 d_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qs,t,n)}}const f_={name:"htmlText",tokenize:p_};function p_(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),P):k===63?(e.consume(k),x):Xt(k)?(e.consume(k),_):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),o=0,w):Xt(k)?(e.consume(k),v):n(k)}function c(k){return k===45?(e.consume(k),m):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):Y(k)?(l=d,V(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?B(k):k===45?p(k):d(k)}function w(k){const H="CDATA[";return k===H.charCodeAt(o++)?(e.consume(k),o===H.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):Y(k)?(l=y,V(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),h):y(k)}function h(k){return k===62?B(k):k===93?(e.consume(k),h):y(k)}function v(k){return k===null||k===62?B(k):Y(k)?(l=v,V(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):Y(k)?(l=x,V(k)):(e.consume(k),x)}function C(k){return k===62?B(k):x(k)}function P(k){return Xt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||pt(k)?(e.consume(k),E):j(k)}function j(k){return Y(k)?(l=j,V(k)):ae(k)?(e.consume(k),j):B(k)}function _(k){return k===45||pt(k)?(e.consume(k),_):k===47||k===62||lt(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),B):k===58||k===95||Xt(k)?(e.consume(k),A):Y(k)?(l=L,V(k)):ae(k)?(e.consume(k),L):B(k)}function A(k){return k===45||k===46||k===58||k===95||pt(k)?(e.consume(k),A):M(k)}function M(k){return k===61?(e.consume(k),T):Y(k)?(l=M,V(k)):ae(k)?(e.consume(k),M):L(k)}function T(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,U):Y(k)?(l=T,V(k)):ae(k)?(e.consume(k),T):(e.consume(k),O)}function U(k){return k===i?(e.consume(k),i=void 0,D):k===null?n(k):Y(k)?(l=U,V(k)):(e.consume(k),U)}function O(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||lt(k)?L(k):(e.consume(k),O)}function D(k){return k===47||k===62||lt(k)?L(k):n(k)}function B(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function V(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),N}function N(k){return ae(k)?ye(e,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):R(k)}function R(k){return e.enter("htmlTextData"),l(k)}}const nf={name:"labelEnd",resolveAll:y_,resolveTo:v_,tokenize:x_},m_={tokenize:w_},h_={tokenize:S_},g_={tokenize:k_};function y_(e){let t=-1;const n=[];for(;++t=3&&(u===null||Y(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ae(u)?ye(e,s,"whitespace")(u):s(u))}}const et={continuation:{tokenize:R_},exit:M_,name:"list",tokenize:A_},T_={partial:!0,tokenize:O_},__={partial:!0,tokenize:I_};function A_(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:Sc(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(Il,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 Sc(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(qs,r.interrupt?n:c,e.attempt(T_,p,d))}function c(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ae(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 R_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qs,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ye(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ae(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(__,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ye(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function I_(e,t,n){const r=this;return ye(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 M_(e){e.exit(this.containerState.type)}function O_(e,t,n){const r=this;return ye(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!ae(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const _m={name:"setextUnderline",resolveTo:L_,tokenize:D_};function L_(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 D_(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(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"),ae(u)?ye(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const z_={tokenize:F_};function F_(e){const t=this,n=e.attempt(qs,r,e.attempt(this.parser.constructs.flowInitial,i,ye(e,e.attempt(this.parser.constructs.flow,i,e.attempt(HT,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 B_={resolveAll:$0()},$_=B0("string"),U_=B0("text");function B0(e){return{resolveAll:$0(e==="text"?V_: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(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=i[c];let p=-1;if(d)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 nA(e,t){let n=-1;const r=[];let i;for(;++n0){const jt=Q.tokenStack[Q.tokenStack.length-1];(jt[1]||Rm).call(Q,void 0,jt[0])}for($.position={start:Nn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Nn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function xA(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 wA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function H0(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 SA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return H0(e,t);const i={src:Pi(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 kA(e,t){const n={src:Pi(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 CA(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 bA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return H0(e,t);const i={href:Pi(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 EA(e,t){const n={href:Pi(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 NA(e,t,n){const r=e.all(t),i=n?PA(n):W0(t),o={},l=[];if(typeof t.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function jA(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=qd(t.children[1]),a=E0(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 IA(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(Om(t.slice(i),i>0,!1)),o.join("")}function Om(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Im||o===Mm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Im||o===Mm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function LA(e,t){const n={type:"text",value:OA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function DA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zA={blockquote:pA,break:mA,code:hA,delete:gA,emphasis:yA,footnoteReference:vA,heading:xA,html:wA,imageReference:SA,image:kA,inlineCode:CA,linkReference:bA,link:EA,listItem:NA,list:jA,paragraph:TA,root:_A,strong:AA,table:RA,tableCell:MA,tableRow:IA,text:LA,thematicBreak:DA,toml:pl,yaml:pl,definition:pl,footnoteDefinition:pl};function pl(){}const K0=-1,Xs=0,io=1,vs=2,rf=3,of=4,lf=5,sf=6,G0=7,Y0=8,Lm=typeof self=="object"?self:globalThis,FA=(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 Xs:case K0:return n(l,i);case io:{const s=n([],i);for(const a of l)s.push(r(a));return s}case vs:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case rf:return n(new Date(l),i);case of:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case lf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case sf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case G0:{const{name:s,message:a}=l;return n(new Lm[s](a),i)}case Y0: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 Lm[o](l),i)};return r},Dm=e=>FA(new Map,e)(0),Or="",{toString:BA}={},{keys:$A}=Object,$i=e=>{const t=typeof e;if(t!=="object"||!e)return[Xs,t];const n=BA.call(e).slice(8,-1);switch(n){case"Array":return[io,Or];case"Object":return[vs,Or];case"Date":return[rf,Or];case"RegExp":return[of,Or];case"Map":return[lf,Or];case"Set":return[sf,Or];case"DataView":return[io,n]}return n.includes("Array")?[io,n]:n.includes("Error")?[G0,n]:[vs,n]},ml=([e,t])=>e===Xs&&(t==="function"||t==="symbol"),UA=(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]=$i(l);switch(s){case Xs:{let c=l;switch(a){case"bigint":s=Y0,c=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return i([K0],l)}return i([s,c],l)}case io:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const c=[],d=i([s,c],l);for(const p of l)c.push(o(p));return d}case vs:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const c=[],d=i([s,c],l);for(const p of $A(l))(e||!ml($i(l[p])))&&c.push([o(p),o(l[p])]);return d}case rf:return i([s,l.toISOString()],l);case of:{const{source:c,flags:d}=l;return i([s,{source:c,flags:d}],l)}case lf:{const c=[],d=i([s,c],l);for(const[p,m]of l)(e||!(ml($i(p))||ml($i(m))))&&c.push([o(p),o(m)]);return d}case sf:{const c=[],d=i([s,c],l);for(const p of l)(e||!ml($i(p)))&&c.push(o(p));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},zm=(e,{json:t,lossy:n}={})=>{const r=[];return UA(!(t||n),!!t,new Map,r)(e),r},xs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dm(zm(e,t)):structuredClone(e):(e,t)=>Dm(zm(e,t));function VA(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 HA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||VA,r=e.options.footnoteBackLabel||HA,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 v=typeof n=="string"?n:n(a,m);typeof v=="string"&&(v={type:"text",value:v}),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(v)?v:[v]})}const S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else c.push(...w);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,h),s.push(h)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...xs(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 Q0=function(e){if(e==null)return QA;if(typeof e=="function")return Js(e);if(typeof e=="object")return Array.isArray(e)?KA(e):GA(e);if(typeof e=="string")return YA(e);throw new Error("Expected function, string, or object as test")};function KA(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=q0,w,y,S;if((!t||o(a,u,c[c.length-1]||void 0))&&(m=eR(n(a,c)),m[0]===Fm))return m;if("children"in a&&a.children){const h=a;if(h.children&&m[0]!==JA)for(y=(r?h.children.length:-1)+l,S=c.concat(h);y>-1&&y0&&n.push({type:"text",value:` `}),n}function Bm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $m(e,t){const n=nR(e,t),r=n.one(e,void 0),i=WA(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` `},i),o}function sR(e,t){return e&&"run"in e?async function(n,r){const i=$m(n,{file:r,...t});await e.run(i,r)}:function(n,r){return $m(n,{file:r,...e||t})}}function Um(e){if(e)throw e}var Ml=Object.prototype.hasOwnProperty,J0=Object.prototype.toString,Vm=Object.defineProperty,Hm=Object.getOwnPropertyDescriptor,Wm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):J0.call(t)==="[object Array]"},Km=function(t){if(!t||J0.call(t)!=="[object Object]")return!1;var n=Ml.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ml.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ml.call(t,i)},Gm=function(t,n){Vm&&n.name==="__proto__"?Vm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ym=function(t,n){if(n==="__proto__")if(Ml.call(t,n)){if(Hm)return Hm(t,n).value}else return;return t[n]},aR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=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 c=u;if(s&&n)throw c;return i(c)}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 Gt={basename:dR,dirname:fR,extname:pR,join:mR,sep:"/"};function dR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$o(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 fR(e){if($o(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 pR(e){$o(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 mR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gR(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 $o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const yR={cwd:vR};function vR(){return"/"}function Ec(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xR(e){if(typeof e=="string")e=new URL(e);else if(!Ec(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 wR(e)}function wR(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]=c;const y=r[p][1];bc(y)&&bc(m)&&(m=Ua(!0,y,m)),r[p]=[u,m,...w]}}}}const bR=new af().freeze();function Ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ga(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ya(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 qm(e){if(!bc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return ER(e)?e:new Z0(e)}function ER(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function NR(e){return typeof e=="string"||PR(e)}function PR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Jm=[],Zm={allowDangerousHtml:!0},TR=/^(https?|ircs?|mailto|xmpp)$/i,_R=[{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 AR(e){const t=RR(e),n=IR(e);return MR(t.runSync(t.parse(n),n),e)}function RR(e){const t=e.rehypePlugins||Jm,n=e.remarkPlugins||Jm,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Zm}:Zm;return bR().use(fA).use(n).use(sR,r).use(t)}function IR(e){const t=e.children||"",n=new Z0;return typeof t=="string"&&(n.value=t),n}function MR(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||OR;for(const c of _R)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+jR+c.id,void 0);return X0(e,u),Wj(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,d,p){if(c.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:c.value},d;if(c.type==="element"){let m;for(m in Fa)if(Object.hasOwn(Fa,m)&&Object.hasOwn(c.properties,m)){const w=c.properties[m],y=Fa[m];(y===null||y.includes(c.tagName))&&(c.properties[m]=a(String(w||""),m,c))}}if(c.type==="element"){let m=n?!n.includes(c.tagName):o?o.includes(c.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(c,d,p)),m&&p&&typeof d=="number")return s&&c.children?p.children.splice(d,1,...c.children):p.children.splice(d,1),d}}}function OR(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||TR.test(e.slice(0,t))?e:""}const e1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=g.useRef(null),c=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),c()},[t]),f.jsxs("div",{className:re("flex h-full flex-col",e),ref:a,...s,children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?f.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:f.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>f.jsxs("div",{className:re("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.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(fi,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:re("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[f.jsxs("div",{className:"text-xs opacity-70",children:[d.role==="user"?"You":"Assistant"," • #",p+1]}),f.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:f.jsx(AR,{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:d.content})})]}),d.role==="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:f.jsx(kb,{className:"h-4 w-4"})})]},`${d.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(y0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?f.jsx(_e,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(vb,{className:"h-4 w-4"})}):f.jsx(_e,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(cb,{className:"h-4 w-4"})})]})})]})});e1.displayName="Chat";const Wt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function t1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function LR(){return t1()}class DR{getAllSessions(){const t=localStorage.getItem(Wt.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(Wt.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(Wt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Wt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Wt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:LR(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Wt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Wt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Wt.currentSession,t)}clear(){localStorage.removeItem(Wt.sessions),localStorage.removeItem(Wt.currentSession)}}const Ne=new DR;function zR(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(""),[c,d]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,y]=g.useState(r),[S,h]=g.useState(.7),[v,x]=g.useState(1024),C=It.useMemo(()=>{var D;const O=i.find(B=>B.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((D=O==null?void 0:O.messages)==null?void 0:D.length)||0}),O},[i,l]),P=It.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(D=>({id:D.id,role:D.role}))),O},[C==null?void 0:C.messages]);g.useEffect(()=>{const O=Ne.getAllSessions();o(O);const D=Ne.getCurrentSession();D?s(D.id):O.length>0&&(s(O[0].id),Ne.setCurrentSession(O[0].id))},[]);const E=g.useCallback(()=>{const O=Ne.createSession(void 0,p,w),D=Ne.getAllSessions();return o([...D]),s(O.id),Ne.setCurrentSession(O.id),O.id},[p,w]),j=g.useCallback(O=>{s(O),Ne.setCurrentSession(O)},[]),_=g.useCallback(O=>{Ne.deleteSession(O);const D=Ne.getAllSessions();o([...D]),l===O&&(D.length>0?(s(D[0].id),Ne.setCurrentSession(D[0].id)):s(null))},[l]),L=g.useCallback((O,D)=>{Ne.updateSession(O,{title:D});const B=Ne.getAllSessions();o([...B])},[]),A=g.useCallback(O=>{if(!l)return;Ne.addMessageToSession(l,O);const D=Ne.getAllSessions();o([...D])},[l]),M=g.useCallback(async()=>{var B,V;if(!a.trim()||c.isLoading)return;let O=l;O||(O=E());const D=a.trim();if(u(""),d({isLoading:!0,error:null}),O){Ne.addMessageToSession(O,{role:"user",content:D});const N=Ne.getAllSessions();o([...N])}try{const N=Ne.getSession(O),R=((V=(B=N==null?void 0:N.messages)==null?void 0:B.filter(K=>K.role!=="system"))==null?void 0:V.map(K=>({role:K.role,content:K.content})))||[],k=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:R,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:v})});if(!k.ok){const K=await k.json();throw new Error(K.detail||`HTTP error! status: ${k.status}`)}const H=await k.json();if(O){Ne.addMessageToSession(O,{role:"assistant",content:H.content,thinking_content:H.thinking_content,model_used:H.model_used,supports_thinking:H.supports_thinking});const K=Ne.getAllSessions();o([...K])}d({isLoading:!1,error:null})}catch(N){const R=N instanceof Error?N.message:"An error occurred";if(d({isLoading:!1,error:R}),O){Ne.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${R}`});const k=Ne.getAllSessions();o([...k])}}},[a,c.isLoading,l,E,A,w,P.length,t,p,S,v]),T=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),U=g.useCallback(()=>{Ne.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:E,selectSession:j,deleteSession:_,renameSession:L,clearAllSessions:U,messages:P,input:a,setInput:u,sendMessage:M,stopGeneration:T,isLoading:c.isLoading,error:c.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:h,maxTokens:v,setMaxTokens:x}}function FR(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:c,isLoading:d,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:h,maxTokens:v,setMaxTokens:x}=zR(),[C,P]=g.useState(!1),[E,j]=g.useState(null),[_,L]=g.useState(!1),[A,M]=g.useState(null),[T,U]=g.useState([]),O=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."}];g.useEffect(()=>{V()},[]),g.useEffect(()=>{if(p&&!T.find(N=>N.model_name===p)){const N=T[0];N&&m(N.model_name)}},[T,p,m]),g.useEffect(()=>{(async()=>{if(!p||!T.length)return;const R=T.find(K=>K.model_name===p);if(!R)return;const k=`${window.location.protocol}//${window.location.host}`;if(R.type==="local"&&!R.is_loaded){M(R),L(!0);return}const H=T.filter(K=>K.type==="local"&&K.is_loaded&&K.model_name!==p);for(const K of H)try{(await fetch(`${k}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:K.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${K.model_name}`)}catch(b){console.error(`Error auto-unloading model ${K.model_name}:`,b)}H.length>0&&V()})()},[p,T]);const D=async()=>{if(A){L(!1),j(A.model_name);try{const N=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${N}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:A.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${A.model_name}`),V();else{console.error(`❌ Failed to load model: ${A.model_name}`);const k=T.find(H=>H.type==="api");k&&m(k.model_name)}}catch(N){console.error("Error loading model:",N);const R=T.find(k=>k.type==="api");R&&m(R.model_name)}finally{j(null),M(null)}}},B=()=>{L(!1),M(null);const N=T.find(R=>R.type==="api");N&&m(N.model_name)};g.useEffect(()=>{const N=async()=>{const R=`${window.location.protocol}//${window.location.host}`,k=T.filter(H=>H.type==="local"&&H.is_loaded);for(const H of k)try{await fetch(`${R}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:H.model_name})}),console.log(`✅ Cleanup: unloaded ${H.model_name}`)}catch(K){console.error(`Error cleaning up model ${H.model_name}:`,K)}};return()=>{N()}},[T]);const V=async()=>{try{const N=`${window.location.protocol}//${window.location.host}`,R=await fetch(`${N}/models`);if(R.ok){const k=await R.json();if(U(k.models),k.current_model&&p!==k.current_model)m(k.current_model);else if(!p&&k.models.length>0){const K=k.models.find(b=>b.type==="api")||k.models[0];m(K.model_name)}}}catch(N){console.error("Failed to fetch models:",N)}};return f.jsxs("div",{className:"min-h-screen bg-background flex",children:[f.jsx("div",{className:` ${C?"translate-x-0":"-translate-x-full"} fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out lg:translate-x-0 lg:static lg:inset-0 `,children:f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs(_e,{onClick:r,size:"sm",children:[f.jsx(Xu,{className:"h-4 w-4 mr-1"}),"New"]})]}),f.jsx("div",{className:"space-y-2",children:e.map(N=>f.jsxs(qe,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===N.id?"bg-accent border-primary":""}`,onClick:()=>i(N.id),children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:N.title}),f.jsx(_e,{size:"sm",variant:"ghost",onClick:R=>{R.stopPropagation(),o(N.id)},className:"h-6 w-6 p-0",children:f.jsx(Pd,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[N.messages.length," messages"]})]},N.id))})]})}),C&&f.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>P(!1)}),f.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsxs("div",{className:"flex h-14 items-center px-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Do,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&f.jsxs(je,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),f.jsx("div",{className:"ml-auto flex items-center gap-2",children:f.jsxs(_e,{variant:"outline",size:"sm",onClick:()=>P(!C),className:"flex-shrink-0",children:[f.jsx(eb,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]})})]})}),f.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:f.jsx(e1,{messages:l.map(N=>({id:N.id,role:N.role,content:N.content,createdAt:new Date(N.timestamp)})),input:s,handleInputChange:N=>a(N.target.value),handleSubmit:async N=>{N.preventDefault(),!(!p||!T.find(R=>R.model_name===p))&&await u()},isGenerating:d,stop:c,className:"flex-1"})}),f.jsx("div",{className:"w-[480px] xl:w-[520px] border-l bg-muted/30 overflow-y-auto",children:f.jsxs("div",{className:"p-6 space-y-8",children:[f.jsxs("div",{className:"flex items-center gap-3 pb-6 border-b",children:[f.jsx(Nd,{className:"h-6 w-6"}),f.jsx("h2",{className:"font-semibold text-xl",children:"Assistant Configuration"})]}),f.jsxs(qe,{children:[f.jsx(zt,{children:f.jsx(Ft,{className:"text-base",children:"Model Selection"})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium mb-3 block",children:"Active Model"}),f.jsxs(am,{value:p||"",onValueChange:m,children:[f.jsx(pc,{className:"w-full",children:f.jsx(um,{placeholder:"Select a model...",children:p&&(()=>{const N=T.find(k=>k.model_name===p);if(!N)return p;const R=N.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[R?f.jsx(cs,{className:"h-4 w-4 text-blue-500"}):N.supports_thinking?f.jsx(pi,{className:"h-4 w-4 text-purple-500"}):f.jsx(Ju,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:N.name}),E===p?f.jsx(je,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(je,{variant:"outline",className:"text-xs",children:R?"API":N.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(mc,{children:[f.jsxs(Da,{children:[f.jsx(Al,{children:"🌐 API Models"}),T.filter(N=>N.type==="api").map(N=>f.jsx(Rl,{value:N.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(cs,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:N.name}),f.jsx(je,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},N.model_name))]}),f.jsxs(Da,{children:[f.jsx(Al,{children:"💻 Local Models"}),T.filter(N=>N.type==="local").map(N=>f.jsx(Rl,{value:N.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[N.supports_thinking?f.jsx(pi,{className:"h-4 w-4 text-purple-500"}):f.jsx(Ju,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:N.name}),E===N.model_name?f.jsx(je,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):N.is_loaded?f.jsx(je,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(je,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},N.model_name))]})]})]})]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsx(_e,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:f.jsxs(by,{to:"/models",className:"flex items-center gap-2",children:[f.jsx(Ed,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),f.jsxs(qe,{children:[f.jsx(zt,{children:f.jsx(Ft,{className:"text-base",children:"Generation Parameters"})}),f.jsxs(Et,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs(Qt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),f.jsx(nc,{value:[S],onValueChange:N=>h(N[0]),min:0,max:2,step:.01,className:"mt-2",disabled:d}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),f.jsxs("div",{children:[f.jsxs(Qt,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),f.jsx(nc,{value:[v],onValueChange:N=>x(N[0]),min:100,max:4096,step:100,className:"mt-2",disabled:d})]})]})]}),f.jsxs(qe,{className:"border-2 border-blue-200 bg-blue-50/50",children:[f.jsx(zt,{children:f.jsxs(Ft,{className:"text-sm flex items-center gap-2",children:[f.jsx(fi,{className:"h-4 w-4 text-blue-600"}),"Assistant Configuration",w&&f.jsx(je,{variant:"default",className:"text-xs bg-blue-600",children:"Custom"})]})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-base font-medium text-muted-foreground mb-4 block",children:"Quick Presets"}),f.jsxs(am,{value:"",onValueChange:N=>{const R=O.find(k=>k.name===N);R&&y(R.prompt)},children:[f.jsx(pc,{className:"w-full h-12",children:f.jsx(um,{placeholder:"Choose a preset..."})}),f.jsx(mc,{children:f.jsxs(Da,{children:[f.jsx(Al,{children:"Assistant Presets"}),O.map(N=>f.jsx(Rl,{value:N.name,children:f.jsxs("div",{className:"flex flex-col items-start",children:[f.jsx("span",{className:"font-medium",children:N.name}),f.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:[N.prompt.slice(0,60),"..."]})]})},N.name))]})})]})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-5",children:[f.jsx(Qt,{htmlFor:"system-prompt",className:"text-lg font-semibold",children:"System Instructions"}),w&&f.jsxs(_e,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-8 px-3 text-sm",disabled:d,children:[f.jsx(ab,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),f.jsx("textarea",{id:"system-prompt",value:w,onChange:N=>y(N.target.value),placeholder:"Define your AI assistant's role, personality, and behavior. For example: 'You are a helpful coding assistant that explains concepts clearly and provides practical examples...'",className:"w-full min-h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-y",disabled:d}),f.jsxs("p",{className:"text-base text-blue-600 mt-4 bg-blue-50 p-4 rounded-lg",children:["💡 ",f.jsx("strong",{children:"Tip:"})," Be specific about the assistant's role, tone, and how it should respond to help users."]})]})]})]})]})})]})]}),f.jsx(YP,{open:_,onOpenChange:L,children:f.jsxs(c0,{children:[f.jsxs(d0,{children:[f.jsx(p0,{children:"Load Local Model"}),f.jsxs(m0,{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(f0,{children:[f.jsx(g0,{onClick:B,children:"Cancel"}),f.jsx(h0,{onClick:D,children:"Load Model"})]})]})})]})}function BR(){const e=Lo(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,l]=g.useState(null);g.useEffect(()=>{s()},[]);const s=async()=>{try{const c=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${c}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const p=await d.json();n(p.models)}catch(c){console.error("Error fetching models:",c)}finally{i(!1)}},a=async c=>{l(c);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:c})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);s()}catch(d){console.error("Error loading model:",d)}finally{l(null)}},u=async c=>{l(c);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:c})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);s()}catch(d){console.error("Error unloading model:",d)}finally{l(null)}};return r?f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsx(qu,{className:"h-8 w-8 animate-spin"})}):f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(Ed,{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(_e,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(Ju,{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(qe,{className:"bg-blue-50 border-blue-200",children:f.jsx(Et,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Ly,{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(cs,{className:"h-5 w-5"}),"API Models",f.jsx(je,{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(c=>c.type==="api").map(c=>f.jsx(eh,{model:c,modelLoading:o,onLoad:a,onUnload:u},c.model_name))})]}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(Oy,{className:"h-5 w-5"}),"Local Models",f.jsx(je,{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(c=>c.type==="local").map(c=>f.jsx(eh,{model:c,modelLoading:o,onLoad:a,onUnload:u},c.model_name))})]})]})})]})}function eh({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(qe,{className:"hover:shadow-md transition-shadow",children:[f.jsx(zt,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(Ft,{className:"text-base flex items-center gap-2",children:[i?f.jsx(cs,{className:"h-4 w-4 text-blue-600"}):f.jsx(Oy,{className:"h-4 w-4 text-green-600"}),e.name]}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&f.jsx(GC,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(Et,{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(je,{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(je,{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(je,{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(je,{variant:"outline",className:"text-xs",children:[f.jsx(pi,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),f.jsx("div",{className:"pt-2",children:l?f.jsxs(_e,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?f.jsx(qu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(Pd,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):f.jsxs(_e,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?f.jsx(qu,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(qC,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function $R(){const e=Lo(),[t,n]=g.useState([]);g.useEffect(()=>{r()},[]);const r=()=>{try{const a=JSON.parse(localStorage.getItem("savedAssistants")||"[]");n(a)}catch(a){console.error("Failed to load assistants:",a)}},i=a=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(a)),e("/playground")},o=a=>{const u=t.filter(c=>c.id!==a);n(u),localStorage.setItem("savedAssistants",JSON.stringify(u))},l=a=>{console.log(`Shared "${a.name}" to community`)},s=()=>{e("/playground")};return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:f.jsx(fi,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"My Assistants"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your custom AI assistants and configurations"})]})]}),f.jsxs(_e,{onClick:s,className:"flex items-center gap-2",children:[f.jsx(Xu,{className:"h-4 w-4"}),"Create New Assistant"]})]})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsx("div",{className:"max-w-6xl mx-auto space-y-6",children:t.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(a=>f.jsx(UR,{assistant:a,onUse:()=>i(a),onDelete:()=>o(a.id),onShare:()=>l(a)},a.id))}):f.jsxs(qe,{className:"text-center py-16",children:[f.jsx(fi,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),f.jsx("h3",{className:"text-xl font-medium mb-3",children:"No assistants yet"}),f.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Create your first AI assistant by configuring parameters and prompts in the Playground, then saving your configuration for future use."}),f.jsxs(_e,{onClick:s,size:"lg",className:"flex items-center gap-2 mx-auto",children:[f.jsx(Xu,{className:"h-5 w-5"}),"Create Your First Assistant"]})]})})})]})}function UR({assistant:e,onUse:t,onDelete:n,onShare:r}){return f.jsxs(qe,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[f.jsx(zt,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(Ft,{className:"text-base flex items-center gap-2",children:[f.jsx(fi,{className:"h-4 w-4 text-purple-600"}),e.name]}),f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description provided"})]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx(_e,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Share to community",children:f.jsx(hb,{className:"h-4 w-4"})}),f.jsx(_e,{variant:"ghost",size:"sm",onClick:n,className:"text-red-500 hover:text-red-600 hover:bg-red-50",title:"Delete assistant",children:f.jsx(Pd,{className:"h-4 w-4"})})]})]})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Model:"}),f.jsx("p",{className:"text-gray-800 truncate",children:e.model})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),f.jsx("p",{className:"text-gray-800",children:e.temperature})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),f.jsx("p",{className:"text-gray-800",children:e.maxTokens})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Created:"}),f.jsx("p",{className:"text-gray-800",children:new Date(e.createdAt).toLocaleDateString()})]})]}),e.systemPrompt&&f.jsxs("div",{className:"bg-blue-50 rounded p-2",children:[f.jsx("span",{className:"text-xs font-medium text-blue-700",children:"System Prompt:"}),f.jsx("p",{className:"text-xs text-blue-600 mt-1 line-clamp-2",children:e.systemPrompt})]}),f.jsxs(_e,{onClick:t,className:"w-full flex items-center gap-2",children:[f.jsx(Do,{className:"h-4 w-4"}),"Use Assistant"]})]})]})}var Qa="rovingFocusGroup.onEntryFocus",VR={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[Nc,n1,HR]=_d(Uo),[WR,r1]=tr(Uo,[HR]),[KR,GR]=WR(Uo),i1=g.forwardRef((e,t)=>f.jsx(Nc.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Nc.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(YR,{...e,ref:t})})}));i1.displayName=Uo;var YR=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=g.useRef(null),m=de(t,p),w=zs(o),[y,S]=hi({prop:l,defaultProp:s??null,onChange:a,caller:Uo}),[h,v]=g.useState(!1),x=Yn(u),C=n1(n),P=g.useRef(!1),[E,j]=g.useState(0);return g.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(Qa,x),()=>_.removeEventListener(Qa,x)},[x]),f.jsx(KR,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:y,onItemFocus:g.useCallback(_=>S(_),[S]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:g.useCallback(()=>j(_=>_-1),[]),children:f.jsx(J.div,{tabIndex:h||E===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:X(e.onMouseDown,()=>{P.current=!0}),onFocus:X(e.onFocus,_=>{const L=!P.current;if(_.target===_.currentTarget&&L&&!h){const A=new CustomEvent(Qa,VR);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=C().filter(B=>B.focusable),T=M.find(B=>B.active),U=M.find(B=>B.id===y),D=[T,U,...M].filter(Boolean).map(B=>B.ref.current);s1(D,c)}}P.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})}),o1="RovingFocusGroupItem",l1=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=Wn(),u=o||a,c=GR(o1,n),d=c.currentTabStopId===u,p=n1(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:y}=c;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),f.jsx(Nc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:f.jsx(J.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,S=>{r?c.onItemFocus(u):S.preventDefault()}),onFocus:X(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:X(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){c.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const h=XR(S,c.orientation,c.dir);if(h!==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(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=c.loop?JR(x,C+1):x.slice(C+1)}setTimeout(()=>s1(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});l1.displayName=o1;var QR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function XR(e,t,n){const r=qR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QR[r]}function s1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function JR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZR=i1,eI=l1,Zs="Tabs",[tI,fI]=tr(Zs,[r1]),a1=r1(),[nI,uf]=tI(Zs),u1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,c=zs(s),[d,p]=hi({prop:r,onChange:i,defaultProp:o??"",caller:Zs});return f.jsx(nI,{scope:n,baseId:Wn(),value:d,onValueChange:p,orientation:l,dir:c,activationMode:a,children:f.jsx(J.div,{dir:c,"data-orientation":l,...u,ref:t})})});u1.displayName=Zs;var c1="TabsList",d1=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=uf(c1,n),l=a1(n);return f.jsx(ZR,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:f.jsx(J.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});d1.displayName=c1;var f1="TabsTrigger",p1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=uf(f1,n),s=a1(n),a=g1(l.baseId,r),u=y1(l.baseId,r),c=r===l.value;return f.jsx(eI,{asChild:!0,...s,focusable:!i,active:c,children:f.jsx(J.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":u,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:X(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:X(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:X(e.onFocus,()=>{const d=l.activationMode!=="manual";!c&&!i&&d&&l.onValueChange(r)})})})});p1.displayName=f1;var m1="TabsContent",h1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=uf(m1,n),a=g1(s.baseId,r),u=y1(s.baseId,r),c=r===s.value,d=g.useRef(c);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(Fo,{present:i||c,children:({present:p})=>f.jsx(J.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});h1.displayName=m1;function g1(e,t){return`${e}-trigger-${t}`}function y1(e,t){return`${e}-content-${t}`}var rI=u1,v1=d1,x1=p1,w1=h1;const iI=rI,S1=g.forwardRef(({className:e,...t},n)=>f.jsx(v1,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));S1.displayName=v1.displayName;const Ol=g.forwardRef(({className:e,...t},n)=>f.jsx(x1,{ref:n,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ol.displayName=x1.displayName;const Ll=g.forwardRef(({className:e,...t},n)=>f.jsx(w1,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ll.displayName=w1.displayName;function oI(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions.",author:"EdgeLLM Team",category:"coding",tags:["code review","programming"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15"},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements.",author:"Community",category:"writing",tags:["writing","editing"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a writing tutor. Help improve writing through structure, clarity, grammar, and style suggestions. Provide specific feedback and examples.",temperature:.4,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20"},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters.",author:"Community",category:"creative",tags:["creative","storytelling"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30"}]}function lI(){const e=Lo(),[t]=g.useState(oI()),[n,r]=g.useState([]);g.useEffect(()=>{i()},[]);const i=()=>{try{const a=JSON.parse(localStorage.getItem("likedTemplates")||"[]");r(a)}catch(a){console.error("Failed to load liked templates:",a)}},o=a=>{const u=n.includes(a)?n.filter(c=>c!==a):[...n,a];r(u),localStorage.setItem("likedTemplates",JSON.stringify(u))},l=a=>{const u={name:a.name,description:a.description,model:a.model,systemPrompt:a.systemPrompt,temperature:a.temperature,maxTokens:a.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(u)),e("/playground")},s=t.filter(a=>a.isOfficial);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-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(Eo,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Community Templates"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Discover and share AI assistant templates created by the community"})]})]})})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsx("div",{className:"max-w-6xl mx-auto space-y-6",children:f.jsxs(iI,{defaultValue:"all",className:"space-y-6",children:[f.jsxs(S1,{className:"grid w-full grid-cols-3",children:[f.jsxs(Ol,{value:"all",className:"flex items-center gap-2",children:[f.jsx(Eo,{className:"h-4 w-4"}),"All Templates"]}),f.jsxs(Ol,{value:"featured",className:"flex items-center gap-2",children:[f.jsx(Dy,{className:"h-4 w-4"}),"Featured"]}),f.jsxs(Ol,{value:"liked",className:"flex items-center gap-2",children:[f.jsx(Qu,{className:"h-4 w-4"}),"My Likes"]})]}),f.jsx(Ll,{value:"all",className:"space-y-6",children:f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(a=>f.jsx(qa,{template:a,isLiked:n.includes(a.id),onLike:()=>o(a.id),onUse:()=>l(a)},a.id))})}),f.jsx(Ll,{value:"featured",className:"space-y-6",children:f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.map(a=>f.jsx(qa,{template:a,isLiked:n.includes(a.id),onLike:()=>o(a.id),onUse:()=>l(a),featured:!0},a.id))})}),f.jsx(Ll,{value:"liked",className:"space-y-6",children:n.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.filter(a=>n.includes(a.id)).map(a=>f.jsx(qa,{template:a,isLiked:!0,onLike:()=>o(a.id),onUse:()=>l(a)},a.id))}):f.jsxs(qe,{className:"text-center py-16",children:[f.jsx(Qu,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),f.jsx("h3",{className:"text-xl font-medium mb-3",children:"No liked templates yet"}),f.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Explore the community templates and click the heart icon to save your favorites for easy access."})]})})]})})})]})}function qa({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1}){return f.jsxs(qe,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${i?"ring-2 ring-yellow-200 shadow-md":""}`,children:[f.jsx(zt,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(Ft,{className:"text-base",children:e.name}),e.isOfficial&&f.jsxs(je,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[f.jsx(Iy,{className:"h-3 w-3 mr-1"}),"Official"]}),i&&f.jsx(Dy,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),f.jsxs("p",{className:"text-xs text-blue-600 font-medium",children:["by ",e.author]}),f.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:e.description})]}),f.jsx(_e,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:f.jsx(Qu,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(o=>f.jsx(je,{variant:"secondary",className:"text-xs",children:o},o))}),f.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),f.jsx("p",{className:"text-gray-800",children:e.temperature})]}),f.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[f.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),f.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),f.jsx("div",{className:"flex justify-end",children:f.jsx(_e,{size:"sm",onClick:r,children:"Use Template"})})]})]})}function sI(){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(Nd,{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(qe,{children:[f.jsx(zt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(fb,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(Et,{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(Qt,{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(Qt,{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(qe,{children:[f.jsx(zt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(Mp,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(Et,{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(Mp,{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(qe,{children:[f.jsx(zt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(Ly,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(Et,{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(Qt,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(je,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(je,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function aI(){return f.jsx(Zk,{children:f.jsx(Kk,{children:f.jsxs(Pn,{path:"/",element:f.jsx(Pb,{}),children:[f.jsx(Pn,{index:!0,element:f.jsx(zb,{})}),f.jsx(Pn,{path:"playground",element:f.jsx(FR,{})}),f.jsx(Pn,{path:"models",element:f.jsx(BR,{})}),f.jsx(Pn,{path:"assistants",element:f.jsx($R,{})}),f.jsx(Pn,{path:"community",element:f.jsx(lI,{})}),f.jsx(Pn,{path:"settings",element:f.jsx(sI,{})})]})})})}Xa.createRoot(document.getElementById("root")).render(f.jsx(It.StrictMode,{children:f.jsx(aI,{})})); //# sourceMappingURL=index-19d28edd.js.map