diff --git "a/static/assets/index-0547e203.js" "b/static/assets/index-0547e203.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-0547e203.js" @@ -0,0 +1,337 @@ +function j1(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Rl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qh={exports:{}},xs={},Jh={exports:{}},re={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var _i=Symbol.for("react.element"),T1=Symbol.for("react.portal"),_1=Symbol.for("react.fragment"),A1=Symbol.for("react.strict_mode"),R1=Symbol.for("react.profiler"),I1=Symbol.for("react.provider"),M1=Symbol.for("react.context"),L1=Symbol.for("react.forward_ref"),O1=Symbol.for("react.suspense"),D1=Symbol.for("react.memo"),z1=Symbol.for("react.lazy"),lf=Symbol.iterator;function F1(e){return e===null||typeof e!="object"?null:(e=lf&&e[lf]||e["@@iterator"],typeof e=="function"?e:null)}var Zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},em=Object.assign,tm={};function go(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}go.prototype.isReactComponent={};go.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")};go.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nm(){}nm.prototype=go.prototype;function kc(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}var Cc=kc.prototype=new nm;Cc.constructor=kc;em(Cc,go.prototype);Cc.isPureReactComponent=!0;var sf=Array.isArray,rm=Object.prototype.hasOwnProperty,bc={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function im(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)rm.call(t,r)&&!om.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,Q=j[G];if(0>>1;Go(Pe,k))oeo(M,Pe)?(j[G]=M,j[oe]=k,G=oe):(j[G]=Pe,j[fe]=k,G=fe);else if(oeo(M,k))j[G]=M,j[oe]=k,G=oe;else break e}}return D}function o(j,D){var k=j.sortIndex-D.sortIndex;return k!==0?k:j.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],c=1,d=null,p=3,h=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=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(j){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=j)r(u),D.sortIndex=D.expirationTime,t(a,D);else break;D=n(u)}}function C(j){if(v=!1,x(j),!w)if(n(a)!==null)w=!0,$(N);else{var D=n(u);D!==null&&H(C,D.startTime-j)}}function N(j,D){w=!1,v&&(v=!1,y(T),T=-1),h=!0;var k=p;try{for(x(D),d=n(a);d!==null&&(!(d.expirationTime>D)||j&&!R());){var G=d.callback;if(typeof G=="function"){d.callback=null,p=d.priorityLevel;var Q=G(d.expirationTime<=D);D=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(a)&&r(a),x(D)}else r(a);d=n(a)}if(d!==null)var E=!0;else{var fe=n(u);fe!==null&&H(C,fe.startTime-D),E=!1}return E}finally{d=null,p=k,h=!1}}var b=!1,P=null,T=-1,F=5,L=-1;function R(){return!(e.unstable_now()-Lj||125G?(j.sortIndex=k,t(u,j),n(a)===null&&j===n(u)&&(v?(y(T),T=-1):v=!0,H(C,k-G))):(j.sortIndex=Q,t(a,j),w||h||(w=!0,$(N))),j},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(j){var D=p;return function(){var k=p;p=D;try{return j.apply(this,arguments)}finally{p=k}}}})(cm);um.exports=cm;var X1=um.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,mt=X1;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"),Ya=Object.prototype.hasOwnProperty,J1=/^[: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]*$/,uf={},cf={};function Z1(e){return Ya.call(cf,e)?!0:Ya.call(uf,e)?!1:J1.test(e)?cf[e]=!0:(uf[e]=!0,!1)}function ew(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 tw(e,t,n,r){if(t===null||typeof t>"u"||ew(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Je(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Je(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pc=/[\-:]([a-z])/g;function jc(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(Pc,jc);$e[t]=new Je(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pc,jc);$e[t]=new Je(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pc,jc);$e[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tc(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var a=` +`+o[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{ta=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$o(e):""}function nw(e){switch(e.tag){case 5:return $o(e.type);case 16:return $o("Lazy");case 13:return $o("Suspense");case 19:return $o("SuspenseList");case 0:case 2:case 15:return e=na(e.type,!1),e;case 11:return e=na(e.type.render,!1),e;case 1:return e=na(e.type,!0),e;default:return""}}function Za(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 Or:return"Portal";case Xa:return"Profiler";case _c:return"StrictMode";case qa:return"Suspense";case Ja:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pm:return(e.displayName||"Context")+".Consumer";case fm:return(e._context.displayName||"Context")+".Provider";case Ac:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rc:return t=e.displayName||null,t!==null?t:Za(e.type)||"Memo";case jn:t=e._payload,e=e._init;try{return Za(e(t))}catch{}}return null}function rw(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 Za(t);case 8:return t===_c?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ow(e){var t=mm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hi(e){e._valueTracker||(e._valueTracker=ow(e))}function gm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Il(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 eu(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ym(e,t){t=t.checked,t!=null&&Tc(e,"checked",t,!1)}function tu(e,t){ym(e,t);var n=Wn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&nu(e,t.type,Wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nu(e,t,n){(t!=="number"||Il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uo=Array.isArray;function Qr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Wi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ko={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(Ko).forEach(function(e){iw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ko[t]=Ko[e]})});function Sm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ko.hasOwnProperty(e)&&Ko[e]?(""+t).trim():t+"px"}function km(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Sm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lw=Ne({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function iu(e,t){if(t){if(lw[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 lu(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 su=null;function Ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var au=null,Yr=null,Xr=null;function gf(e){if(e=Ii(e)){if(typeof au!="function")throw Error(z(280));var t=e.stateNode;t&&(t=bs(t),au(e.stateNode,e.type,t))}}function Cm(e){Yr?Xr?Xr.push(e):Xr=[e]:Yr=e}function bm(){if(Yr){var e=Yr,t=Xr;if(Xr=Yr=null,gf(e),t)for(e=0;e>>=0,e===0?32:31-(yw(e)/vw|0)|0}var Ki=64,Gi=4194304;function Vo(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 Dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=Vo(s):(i&=l,i!==0&&(r=Vo(i)))}else l=n&~o,l!==0?r=Vo(l):i!==0&&(r=Vo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ai(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 kw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Qo),Ef=String.fromCharCode(32),Nf=!1;function Hm(e,t){switch(e){case"keyup":return Xw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function Jw(e,t){switch(e){case"compositionend":return Wm(t);case"keypress":return t.which!==32?null:(Nf=!0,Ef);case"textInput":return e=t.data,e===Ef&&Nf?null:e;default:return null}}function Zw(e,t){if(zr)return e==="compositionend"||!$c&&Hm(e,t)?(e=Um(),vl=zc=Rn=null,zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_f(n)}}function Ym(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ym(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xm(){for(var e=window,t=Il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Il(e.document)}return t}function Uc(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 aS(e){var t=Xm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ym(n.ownerDocument.documentElement,n)){if(r!==null&&Uc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Af(n,i);var l=Af(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Fr=null,hu=null,Xo=null,mu=!1;function Rf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mu||Fr==null||Fr!==Il(r)||(r=Fr,"selectionStart"in r&&Uc(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}),Xo&&fi(Xo,r)||(Xo=r,r=Bl(hu,"onSelect"),0Ur||(e.current=Su[Ur],Su[Ur]=null,Ur--)}function ve(e,t){Ur++,Su[Ur]=e.current,e.current=t}var Kn={},We=qn(Kn),nt=qn(!1),mr=Kn;function lo(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function Ul(){ke(nt),ke(We)}function Ff(e,t,n){if(We.current!==Kn)throw Error(z(168));ve(We,t),ve(nt,n)}function ig(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,rw(e)||"Unknown",o));return Ne({},n,r)}function Vl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,mr=We.current,ve(We,e),ve(nt,nt.current),!0}function Bf(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=ig(e,t,mr),r.__reactInternalMemoizedMergedChildContext=e,ke(nt),ke(We),ve(We,e)):ke(nt),ve(nt,n)}var ln=null,Es=!1,ga=!1;function lg(e){ln===null?ln=[e]:ln.push(e)}function wS(e){Es=!0,lg(e)}function Jn(){if(!ga&&ln!==null){ga=!0;var e=0,t=he;try{var n=ln;for(he=1;e>=l,o-=l,sn=1<<32-Lt(t)+o|n<T?(F=P,P=null):F=P.sibling;var L=p(y,P,x[T],C);if(L===null){P===null&&(P=F);break}e&&P&&L.alternate===null&&t(y,P),m=i(L,m,T),b===null?N=L:b.sibling=L,b=L,P=F}if(T===x.length)return n(y,P),Ce&&lr(y,T),N;if(P===null){for(;TT?(F=P,P=null):F=P.sibling;var R=p(y,P,L.value,C);if(R===null){P===null&&(P=F);break}e&&P&&R.alternate===null&&t(y,P),m=i(R,m,T),b===null?N=R:b.sibling=R,b=R,P=F}if(L.done)return n(y,P),Ce&&lr(y,T),N;if(P===null){for(;!L.done;T++,L=x.next())L=d(y,L.value,C),L!==null&&(m=i(L,m,T),b===null?N=L:b.sibling=L,b=L);return Ce&&lr(y,T),N}for(P=r(y,P);!L.done;T++,L=x.next())L=h(P,y,T,L.value,C),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?T:L.key),m=i(L,m,T),b===null?N=L:b.sibling=L,b=L);return e&&P.forEach(function(_){return t(y,_)}),Ce&&lr(y,T),N}function S(y,m,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 Vi:e:{for(var N=x.key,b=m;b!==null;){if(b.key===N){if(N=x.type,N===Dr){if(b.tag===7){n(y,b.sibling),m=o(b,x.props.children),m.return=y,y=m;break e}}else if(b.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===jn&&Vf(N)===b.type){n(y,b.sibling),m=o(b,x.props),m.ref=Mo(y,b,x),m.return=y,y=m;break e}n(y,b);break}else t(y,b);b=b.sibling}x.type===Dr?(m=hr(x.props.children,y.mode,C,x.key),m.return=y,y=m):(C=Nl(x.type,x.key,x.props,null,y.mode,C),C.ref=Mo(y,m,x),C.return=y,y=C)}return l(y);case Or:e:{for(b=x.key;m!==null;){if(m.key===b)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(y,m.sibling),m=o(m,x.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=ba(x,y.mode,C),m.return=y,y=m}return l(y);case jn:return b=x._init,S(y,m,b(x._payload),C)}if(Uo(x))return w(y,m,x,C);if(To(x))return v(y,m,x,C);el(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(y,m.sibling),m=o(m,x),m.return=y,y=m):(n(y,m),m=Ca(x,y.mode,C),m.return=y,y=m),l(y)):n(y,m)}return S}var ao=cg(!0),dg=cg(!1),Kl=qn(null),Gl=null,Wr=null,Kc=null;function Gc(){Kc=Wr=Gl=null}function Qc(e){var t=Kl.current;ke(Kl),e._currentValue=t}function bu(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){Gl=e,Kc=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(tt=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Kc!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(Gl===null)throw Error(z(308));Wr=e,Gl.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var cr=null;function Yc(e){cr===null?cr=[e]:cr.push(e)}function fg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yc(t)):(n.next=o.next,o.next=n),t.interleaved=n,mn(e,r)}function mn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tn=!1;function Xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mn(e,n)}return o=r.interleaved,o===null?(t.next=t,Yc(r)):(t.next=o.next,o.next=t),r.interleaved=t,mn(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lc(e,n)}}function Hf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ql(e,t,n,r){var o=e.updateQueue;Tn=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?i=u:l.next=u,l=a;var 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(i!==null){var d=o.baseState;l=0,c=u=a=null,s=i;do{var p=s.lane,h=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,v=s;switch(p=t,h=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(h,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,p=typeof w=="function"?w.call(h,d,p):w,p==null)break e;d=Ne({},d,p);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,l|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;p=s,s=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);vr|=l,e.lanes=l,e.memoizedState=d}}function Wf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=va.transition;va.transition={};try{e(!1),t()}finally{he=n,va.transition=r}}function _g(){return Nt().memoizedState}function bS(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ag(e))Rg(t,n);else if(n=fg(e,t,n,r),n!==null){var o=Xe();Ot(n,e,r,o),Ig(n,t,r)}}function ES(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ag(e))Rg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,Dt(s,l)){var a=t.interleaved;a===null?(o.next=o,Yc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=fg(e,t,o,r),n!==null&&(o=Xe(),Ot(n,e,r,o),Ig(n,t,r))}}function Ag(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Rg(e,t){qo=Xl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ig(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Lc(e,n)}}var ql={readContext:Et,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},NS={readContext:Et,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Gf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,kl(4194308,4,Eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();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=bS.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:Kf,useDebugValue:od,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=Kf(!1),t=e[0];return e=CS.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,o=Vt();if(Ce){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),ze===null)throw Error(z(349));yr&30||yg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Gf(xg.bind(null,r,i,e),[e]),r.flags|=2048,wi(9,vg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vt(),t=ze.identifierPrefix;if(Ce){var n=an,r=sn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vi++,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[Wt]=t,e[mi]=r,Vg(e,t,!1,!1),t.stateNode=e;e:{switch(l=lu(n,r),n){case"dialog":Se("cancel",e),Se("close",e),o=r;break;case"iframe":case"object":case"embed":Se("load",e),o=r;break;case"video":case"audio":for(o=0;ofo&&(t.flags|=128,r=!0,Lo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Yl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Ce)return Ve(t),null}else 2*_e()-i.renderingStartTime>fo&&n!==1073741824&&(t.flags|=128,r=!0,Lo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=_e(),t.sibling=null,n=be.current,ve(be,r?n&1|2:n&1),t):(Ve(t),null);case 22:case 23:return cd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ut&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 MS(e,t){switch(Hc(t),t.tag){case 1:return rt(t.type)&&Ul(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),ke(nt),ke(We),Zc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jc(t),null;case 13:if(ke(be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(be),null;case 4:return uo(),null;case 10:return Qc(t.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var nl=!1,He=!1,LS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Kr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Iu(e,t,n){try{n()}catch(r){Te(e,t,r)}}var op=!1;function OS(e,t){if(gu=zl,e=Xm(),Uc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(s=l+o),d!==i||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===o&&(s=l),p===i&&++c===r&&(a=l),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},zl=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,S=w.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:At(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(C){Te(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=op,op=!1,w}function Jo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Iu(t,n,i)}o=o.next}while(o!==r)}}function js(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 Mu(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 Kg(e){var t=e.alternate;t!==null&&(e.alternate=null,Kg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[mi],delete t[wu],delete t[vS],delete t[xS])),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 Gg(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(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 Lu(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=$l));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Ou(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(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}var Fe=null,It=!1;function bn(e,t,n){for(n=n.child;n!==null;)Qg(e,t,n),n=n.sibling}function Qg(e,t,n){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(ws,n)}catch{}switch(n.tag){case 5:He||Kr(n,t);case 6:var r=Fe,o=It;Fe=null,bn(e,t,n),Fe=r,It=o,Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(It?(e=Fe,n=n.stateNode,e.nodeType===8?ma(e.parentNode,n):e.nodeType===1&&ma(e,n),ci(e)):ma(Fe,n.stateNode));break;case 4:r=Fe,o=It,Fe=n.stateNode.containerInfo,It=!0,bn(e,t,n),Fe=r,It=o;break;case 0:case 11:case 14:case 15:if(!He&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Iu(n,t,l),o=o.next}while(o!==r)}bn(e,t,n);break;case 1:if(!He&&(Kr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Te(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 lp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new LS),t.forEach(function(r){var o=WS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,es=0,ce&6)throw Error(z(331));var o=ce;for(ce|=4,K=e.current;K!==null;){var i=K,l=i.child;if(K.flags&16){var s=i.deletions;if(s!==null){for(var a=0;a_e()-ad?pr(e,0):sd|=n),ot(e,t)}function ny(e,t){t===0&&(e.mode&1?(t=Gi,Gi<<=1,!(Gi&130023424)&&(Gi=4194304)):t=1);var n=Xe();e=mn(e,t),e!==null&&(Ai(e,t,n),ot(e,n))}function HS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ny(e,n)}function WS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),ny(e,n)}var ry;ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)tt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return tt=!1,RS(e,t,n);tt=!!(e.flags&131072)}else tt=!1,Ce&&t.flags&1048576&&sg(t,Wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cl(e,t),e=t.pendingProps;var o=lo(t,We.current);Jr(t,n),o=td(null,t,r,e,o,n);var i=nd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(i=!0,Vl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xc(t),o.updater=Ps,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Tu(null,t,r,!0,i,n)):(t.tag=0,Ce&&i&&Vc(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=GS(r),e=At(r,e),o){case 0:t=ju(null,t,r,e,n);break e;case 1:t=tp(null,t,r,e,n);break e;case 11:t=Zf(null,t,r,e,n);break e;case 14:t=ep(null,t,r,At(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),ju(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),tp(e,t,r,o,n);case 3:e:{if(Bg(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,pg(e,t),Ql(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=co(Error(z(423)),t),t=np(e,t,r,n,o);break e}else if(r!==o){o=co(Error(z(424)),t),t=np(e,t,r,n,o);break e}else for(dt=zn(t.stateNode.containerInfo.firstChild),pt=t,Ce=!0,Mt=null,n=dg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=gn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return hg(t),e===null&&Cu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,vu(r,o)?l=null:i!==null&&vu(r,i)&&(t.flags|=32),Fg(e,t),Ye(e,t,l,n),t.child;case 6:return e===null&&Cu(t),null;case 13:return $g(e,t,n);case 4:return qc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Zf(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,ve(Kl,r._currentValue),r._currentValue=l,i!==null)if(Dt(i.value,l)){if(i.children===o.children&&!nt.current){t=gn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=cn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),bu(i.return,n,t),s.lanes|=n;break}a=a.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),bu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jr(t,n),o=Et(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=At(r,t.pendingProps),o=At(r.type,o),ep(e,t,r,o,n);case 15:return Dg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Cl(e,t),t.tag=1,rt(r)?(e=!0,Vl(t)):e=!1,Jr(t,n),Mg(t,r,o),Nu(t,r,o,n),Tu(null,t,r,!0,e,n);case 19:return Ug(e,t,n);case 22:return zg(e,t,n)}throw Error(z(156,t.tag))};function oy(e,t){return Am(e,t)}function KS(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 kt(e,t,n,r){return new KS(e,t,n,r)}function fd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function GS(e){if(typeof e=="function")return fd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ac)return 11;if(e===Rc)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nl(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")fd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Dr:return hr(n.children,o,i,t);case _c:l=8,o|=8;break;case Xa:return e=kt(12,n,t,o|2),e.elementType=Xa,e.lanes=i,e;case qa:return e=kt(13,n,t,o),e.elementType=qa,e.lanes=i,e;case Ja:return e=kt(19,n,t,o),e.elementType=Ja,e.lanes=i,e;case hm:return _s(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fm:l=10;break e;case pm:l=9;break e;case Ac:l=11;break e;case Rc:l=14;break e;case jn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=kt(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function _s(e,t,n,r){return e=kt(22,e,r,t),e.elementType=hm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ca(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function ba(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function QS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oa(0),this.expirationTimes=oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pd(e,t,n,r,o,i,l,s,a){return e=new QS(e,t,n,s,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xc(i),e}function YS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ay)}catch(e){console.error(e)}}ay(),am.exports=gt;var xo=am.exports;const ek=vs(xo);var hp=xo;Qa.createRoot=hp.createRoot,Qa.hydrateRoot=hp.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 ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function uy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nk(){return Math.random().toString(36).substr(2,8)}function gp(e,t){return{usr:e.state,key:e.key,idx:t}}function $u(e,t,n,r){return n===void 0&&(n=null),ki({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?wo(t):t,{state:n,key:t&&t.key||r||nk()})}function rs(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 wo(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 rk(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,s=Mn.Pop,a=null,u=c();u==null&&(u=0,l.replaceState(ki({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function d(){s=Mn.Pop;let S=c(),y=S==null?null:S-u;u=S,a&&a({action:s,location:v.location,delta:y})}function p(S,y){s=Mn.Push;let m=$u(v.location,S,y);n&&n(m,S),u=c()+1;let x=gp(m,u),C=v.createHref(m);try{l.pushState(x,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(C)}i&&a&&a({action:s,location:v.location,delta:1})}function h(S,y){s=Mn.Replace;let m=$u(v.location,S,y);n&&n(m,S),u=c();let x=gp(m,u),C=v.createHref(m);l.replaceState(x,"",C),i&&a&&a({action:s,location:v.location,delta:0})}function w(S){let y=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof S=="string"?S:rs(S);return m=m.replace(/ $/,"%20"),Ie(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let v={get action(){return s},get location(){return e(o,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(mp,d),a=S,()=>{o.removeEventListener(mp,d),a=null}},createHref(S){return t(o,S)},createURL:w,encodeLocation(S){let y=w(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(S){return l.go(S)}};return v}var yp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(yp||(yp={}));function ok(e,t,n){return n===void 0&&(n="/"),ik(e,t,n,!1)}function ik(e,t,n,r){let o=typeof t=="string"?wo(t):t,i=yd(o.pathname||"/",n);if(i==null)return null;let l=cy(e);lk(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};a.relativePath.startsWith("/")&&(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=Vn([r,a.relativePath]),c=n.concat(a);i.children&&i.children.length>0&&(Ie(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),cy(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:pk(u,i.index),routesMeta:c})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let a of dy(i.path))o(i,l,a)}),t}function dy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=dy(r.join("/")),s=[];return s.push(...l.map(a=>a===""?i:[i,a].join("/"))),o&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function lk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const sk=/^:[\w-]+$/,ak=3,uk=2,ck=1,dk=10,fk=-2,vp=e=>e==="*";function pk(e,t){let n=e.split("/"),r=n.length;return n.some(vp)&&(r+=fk),t&&(r+=uk),n.filter(o=>!vp(o)).reduce((o,i)=>o+(sk.test(i)?ak:i===""?ck:dk),r)}function hk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function mk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",l=[];for(let s=0;s{let{paramName:p,isOptional:h}=c;if(p==="*"){let v=s[d]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=s[d];return h&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function gk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return uy(!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 yd(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 vk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?wo(e):e;return{pathname:n?n.startsWith("/")?n:xk(n,t):t,search:kk(r),hash:Ck(o)}}function xk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ea(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 wk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fy(e,t){let n=wk(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function py(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=wo(e):(o=ki({},e),Ie(!o.pathname||!o.pathname.includes("?"),Ea("?","pathname","search",o)),Ie(!o.pathname||!o.pathname.includes("#"),Ea("#","pathname","hash",o)),Ie(!o.search||!o.search.includes("#"),Ea("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.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;o.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=vk(o,s),u=l&&l!=="/"&&l.endsWith("/"),c=(i||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const Vn=e=>e.join("/").replace(/\/\/+/g,"/"),Sk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ck=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function bk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const hy=["post","put","patch","delete"];new Set(hy);const Ek=["get",...hy];new Set(Ek);/** + * 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 Ci(){return Ci=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=py(u,JSON.parse(l),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Vn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,l,i,e])}const Tk=g.createContext(null);function _k(e){let t=g.useContext(Zn).outlet;return t&&g.createElement(Tk.Provider,{value:e},t)}function yy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Nr),{matches:o}=g.useContext(Zn),{pathname:i}=Oi(),l=JSON.stringify(fy(o,r.v7_relativeSplatPath));return g.useMemo(()=>py(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Ak(e,t){return Rk(e,t)}function Rk(e,t,n,r){Li()||Ie(!1);let{navigator:o}=g.useContext(Nr),{matches:i}=g.useContext(Zn),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Oi(),c;if(t){var d;let S=typeof t=="string"?wo(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Ie(!1),c=S}else c=u;let p=c.pathname||"/",h=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=ok(e,{pathname:h}),v=Dk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Vn([a,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Vn([a,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?g.createElement(Ls.Provider,{value:{location:Ci({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Mn.Pop}},v):v}function Ik(){let e=$k(),t=bk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:o},n):null,i)}const Mk=g.createElement(Ik,null);class Lk extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(Zn.Provider,{value:this.props.routeContext},g.createElement(my.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ok(e){let{routeContext:t,match:n,children:r}=e,o=g.useContext(vd);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Zn.Provider,{value:t},r)}function Dk(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(o=n)==null?void 0:o.errors;if(s!=null){let 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 h,w=!1,v=null,S=null;n&&(h=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||Mk,a&&(u<0&&p===0?(Vk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),m=()=>{let x;return h?x=v: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:y,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Lk,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):m()},null)}var vy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vy||{}),os=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}(os||{});function zk(e){let t=g.useContext(vd);return t||Ie(!1),t}function Fk(e){let t=g.useContext(Nk);return t||Ie(!1),t}function Bk(e){let t=g.useContext(Zn);return t||Ie(!1),t}function xy(e){let t=Bk(),n=t.matches[t.matches.length-1];return n.route.id||Ie(!1),n.route.id}function $k(){var e;let t=g.useContext(my),n=Fk(os.UseRouteError),r=xy(os.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Uk(){let{router:e}=zk(vy.UseNavigateStable),t=xy(os.UseNavigateStable),n=g.useRef(!1);return gy(()=>{n.current=!0}),g.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ci({fromRouteId:t},i)))},[e,t])}const wp={};function Vk(e,t,n){!t&&!wp[e]&&(wp[e]=!0)}function Hk(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 Wk(e){return _k(e.context)}function Lr(e){Ie(!1)}function Kk(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Mn.Pop,navigator:i,static:l=!1,future:s}=e;Li()&&Ie(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:i,static:l,future:Ci({v7_relativeSplatPath:!1},s)}),[a,s,i,l]);typeof r=="string"&&(r=wo(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:w="default"}=r,v=g.useMemo(()=>{let S=yd(c,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:h,key:w},navigationType:o}},[a,c,d,p,h,w,o]);return v==null?null:g.createElement(Nr.Provider,{value:u},g.createElement(Ls.Provider,{children:n,value:v}))}function Gk(e){let{children:t,location:n}=e;return Ak(Uu(t),n)}new Promise(()=>{});function Uu(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,o)=>{if(!g.isValidElement(r))return;let i=[...t,o];if(r.type===g.Fragment){n.push.apply(n,Uu(r.props.children,i));return}r.type!==Lr&&Ie(!1),!r.props.index||!r.props.children||Ie(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Uu(r.props.children,i)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Vu(){return Vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Yk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xk(e,t){return e.button===0&&(!t||t==="_self")&&!Yk(e)}const qk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jk="6";try{window.__reactRouterVersion=Jk}catch{}const Zk="startTransition",Sp=Nc[Zk];function eC(e){let{basename:t,children:n,future:r,window:o}=e,i=g.useRef();i.current==null&&(i.current=tk({window:o,v5Compat:!0}));let l=i.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Sp?Sp(()=>a(d)):a(d)},[a,u]);return g.useLayoutEffect(()=>l.listen(c),[l,c]),g.useEffect(()=>Hk(r),[r]),g.createElement(Kk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const tC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rC=g.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:s,target:a,to:u,preventScrollReset:c,viewTransition:d}=t,p=Qk(t,qk),{basename:h}=g.useContext(Nr),w,v=!1;if(typeof u=="string"&&nC.test(u)&&(w=u,tC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=yd(C.pathname,h);C.origin===x.origin&&N!=null?u=N+C.search+C.hash:v=!0}catch{}let S=Pk(u,{relative:o}),y=oC(u,{replace:l,state:s,target:a,preventScrollReset:c,relative:o,viewTransition:d});function m(x){r&&r(x),x.defaultPrevented||y(x)}return g.createElement("a",Vu({},p,{href:w||S,onClick:v||i?r:m,ref:n,target:a}))});var kp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kp||(kp={}));var Cp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cp||(Cp={}));function oC(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s}=t===void 0?{}:t,a=xd(),u=Oi(),c=yy(e,{relative:l});return g.useCallback(d=>{if(Xk(d,n)){d.preventDefault();let p=r!==void 0?r:rs(u)===rs(c);a(e,{replace:p,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[u,a,c,r,o,n,e,i,l,s])}function wy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return o(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):o(l,s)}}}var by="!";function fC(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var s=[],a=0,u=0,c,d=0;du?c-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:S}}}function pC(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function hC(e){return{cache:dC(e.cacheSize),splitModifiers:fC(e),...lC(e)}}var mC=/\s+/;function gC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(mC).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),h=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(c),!p)return{isTailwindClass:!1,originalClassName:l};h=!1}var w=pC(a).join(":"),v=u?w+by:w;return{isTailwindClass:!0,modifierId:v,classGroupId:p,originalClassName:l,hasPostfixModifier:h}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,c=s+a;return i.has(c)?!1:(i.add(c),o(a,u).forEach(function(d){return i.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function yC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pp=e=>{const t=MC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Py=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),LC=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 OC={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 DC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...OC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Py("lucide",o),...!i&&!LC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,c])=>g.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const le=(e,t)=>{const n=g.forwardRef(({className:r,...o},i)=>g.createElement(DC,{ref:i,iconNode:t,className:Py(`lucide-${IC(Pp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pp(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 zC=[["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"}]],FC=le("award",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 BC=[["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"}]],jy=le("book-open",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:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],UC=le("bookmark",$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:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ti=le("bot",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:"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"}]],bi=le("brain",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 WC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],KC=le("check",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ty=le("chevron-down",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QC=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],jp=le("chevron-left",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 YC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tp=le("chevron-right",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qC=le("chevron-up",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:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ZC=le("circle-check-big",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],is=le("cloud",eb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],_y=le("crown",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 nb=[["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"}]],rb=le("download",nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ob=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ib=le("eye",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=[["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"}]],Ay=le("hard-drive",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:"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"}]],ab=le("heart",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:"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"}]],cb=le("house",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ry=le("info",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 fb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ku=le("loader-circle",fb);/** + * @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:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ls=le("message-square",pb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_p=le("plus",hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],gb=le("save",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 yb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ap=le("search",yb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vb=[["path",{d:"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"}]],xb=le("send",vb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=[["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"}]],Sb=le("server",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 kb=[["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"}]],ss=le("settings",kb);/** + * @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:"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"}]],Rp=le("shield",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=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],Eb=le("sliders-vertical",bb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pb=le("square",Nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["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"}]],Tb=le("star",jb);/** + * @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 _b=[["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"}]],Iy=le("trash-2",_b);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],My=le("trending-up",Ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=[["path",{d:"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"}]],Ly=le("user",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:"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"}]],Mb=le("users",Ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["path",{d:"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"}]],Gu=le("zap",Lb),Ob=[{name:"Templates",href:"/",icon:cb,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:ls,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:jy,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:ss,description:"Application settings"}];function Db(){const e=Oi();return f.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[f.jsx("div",{className:"p-6 border-b",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:f.jsx(bi,{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:Ob.map(t=>{const n=e.pathname===t.href;return f.jsxs(rC,{to:t.href,className:ue("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 zb(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(Db,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(Wk,{})})]})}const Ip=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mp=Sy,Sd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Mp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=Ip(c)||Ip(d);return o[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,...h}=c;return Object.entries(h).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...i,...s}[v]):{...i,...s}[v]===S})?[...u,d,p]:u},[]);return Mp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Fb=Sd("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 ye({className:e,variant:t,...n}){return f.jsx("div",{className:ue(Fb({variant:t}),e),...n})}function Lp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oy(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Lp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:i,...l}=r,s=g.Children.toArray(i),a=s.find(Vb);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:o,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return f.jsx(t,{...l,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var Bb=po("Slot");function $b(e){const t=g.forwardRef((n,r)=>{const{children:o,...i}=n;if(g.isValidElement(o)){const l=Wb(o),s=Hb(i,o.props);return o.type!==g.Fragment&&(s.ref=r?Oy(r,l):l),g.cloneElement(o,s)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dy=Symbol("radix.slottable");function Ub(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Dy,t}function Vb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dy}function Hb(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const a=i(...s);return o(...s),a}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Wb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const kd=Sd("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"}}),De=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const l=r?Bb:"button";return f.jsx(l,{className:ue(kd({variant:t,size:n,className:e})),ref:i,...o})});De.displayName="Button";const bt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bt.displayName="Card";const dn=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));dn.displayName="CardHeader";const fn=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));fn.displayName="CardTitle";const Kb=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Kb.displayName="CardDescription";const qt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));qt.displayName="CardContent";const Gb=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));Gb.displayName="CardFooter";const zy=g.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));zy.displayName="Input";function Qb(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions. Helps identify bugs, security issues, and performance optimizations.",author:"EdgeLLM Team",category:"Developer Tools",tags:["code review","programming","debugging"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15",icon:"🔍",usageCount:1247,rating:4.8},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements. Perfect for essays, articles, and professional documents.",author:"Community",category:"Writing",tags:["writing","editing","grammar"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a writing tutor. Help improve writing through structure, clarity, grammar, and style suggestions. Provide specific feedback and examples.",temperature:.4,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"📝",usageCount:892,rating:4.6},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters. Great for fiction writers and storytellers.",author:"Community",category:"Writing",tags:["creative","storytelling","fiction"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30",icon:"✨",usageCount:634,rating:4.7},{id:"data-analyst",name:"Data Analysis Expert",description:"Helps analyze data patterns, create insights, and generate comprehensive reports with statistical analysis.",author:"EdgeLLM Team",category:"Data & Analytics",tags:["data","analytics","statistics"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a data analysis expert. Help users understand data patterns, create visualizations, and provide statistical insights.",temperature:.2,maxTokens:1200,isOfficial:!0,createdAt:"2024-01-18",icon:"📊",usageCount:567,rating:4.9},{id:"language-tutor",name:"Language Learning Tutor",description:"Interactive language tutor for vocabulary, grammar, and conversation practice. Supports multiple languages.",author:"Community",category:"Education",tags:["language","learning","education"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a friendly language tutor. Help users learn languages through interactive exercises, explanations, and conversation practice.",temperature:.6,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"🌐",usageCount:423,rating:4.5},{id:"business-advisor",name:"Business Strategy Advisor",description:"Provides strategic business advice, market analysis, and growth recommendations for entrepreneurs and businesses.",author:"EdgeLLM Team",category:"Business",tags:["strategy","business","consulting"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a business strategy consultant. Provide strategic advice, market insights, and growth recommendations based on business principles.",temperature:.4,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-22",icon:"💼",usageCount:789,rating:4.7},{id:"research-assistant",name:"Research Assistant",description:"Helps with academic and professional research, source analysis, and comprehensive report writing.",author:"Community",category:"Research",tags:["research","academic","analysis"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a research assistant. Help users conduct thorough research, analyze sources, and organize findings into comprehensive reports.",temperature:.3,maxTokens:1200,isOfficial:!1,createdAt:"2024-01-25",icon:"📚",usageCount:356,rating:4.4},{id:"math-tutor",name:"Math & Science Tutor",description:"Expert tutor for mathematics, physics, chemistry, and other STEM subjects with step-by-step explanations.",author:"EdgeLLM Team",category:"Education",tags:["math","science","tutoring"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a math and science tutor. Provide clear, step-by-step explanations for mathematical and scientific concepts.",temperature:.2,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-28",icon:"🔬",usageCount:678,rating:4.8}]}function Yb(){const e=xd(),[t,n]=g.useState(!1),[r]=g.useState(Qb()),[o,i]=g.useState([]),[l,s]=g.useState(""),[a,u]=g.useState("All");g.useEffect(()=>{c(),d()},[]);const c=async()=>{try{const m=`${window.location.protocol}//${window.location.host}`,x=await fetch(`${m}/models`);n(x.ok)}catch{n(!1)}},d=()=>{try{const m=JSON.parse(localStorage.getItem("likedTemplates")||"[]");i(m)}catch(m){console.error("Failed to load liked templates:",m)}},p=m=>{const x=o.includes(m)?o.filter(C=>C!==m):[...o,m];i(x),localStorage.setItem("likedTemplates",JSON.stringify(x))},h=m=>{const x={name:m.name,description:m.description,model:m.model,systemPrompt:m.systemPrompt,temperature:m.temperature,maxTokens:m.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),e("/playground")},w=r.filter(m=>{const x=m.name.toLowerCase().includes(l.toLowerCase())||m.description.toLowerCase().includes(l.toLowerCase())||m.tags.some(N=>N.toLowerCase().includes(l.toLowerCase())),C=a==="All"||m.category===a;return x&&C}),v=w.filter(m=>m.isOfficial),S=[...w].sort((m,x)=>x.usageCount-m.usageCount).slice(0,6),y=["All",...Array.from(new Set(r.map(m=>m.category)))];return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-4",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(bi,{className:"h-5 w-5 text-white"})}),f.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),f.jsx(ye,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),f.jsxs(De,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(ti,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),f.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),f.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),f.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[f.jsx(Ap,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),f.jsx(zy,{type:"text",placeholder:"Search assistants...",value:l,onChange:m=>s(m.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),f.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:y.map(m=>f.jsx(De,{variant:a===m?"default":"outline",size:"sm",onClick:()=>u(m),className:"rounded-full",children:m},m))})]}),a==="All"&&v.length>0&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(_y,{className:"h-5 w-5 text-yellow-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),f.jsx(ye,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:v.slice(0,3).map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m),featured:!0},m.id))})]}),a==="All"&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(My,{className:"h-5 w-5 text-green-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),f.jsx(ye,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m),trending:!0},m.id))})]}),f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(Mb,{className:"h-5 w-5 text-blue-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),f.jsxs(ye,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m)},m.id))}):f.jsx(bt,{className:"p-12 text-center",children:f.jsxs("div",{className:"flex flex-col items-center gap-4",children:[f.jsx(Ap,{className:"h-12 w-12 text-gray-400"}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),f.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),f.jsx(De,{variant:"outline",onClick:()=>{s(""),u("All")},children:"Clear filters"})]})})]})]})]})}function Na({template:e,isLiked:t,onLike:n,onUse:r,featured:o=!1,trending:i=!1}){return f.jsxs(bt,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[o&&f.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[f.jsx(_y,{className:"h-3 w-3"}),"Featured"]}),i&&f.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[f.jsx(My,{className:"h-3 w-3"}),"Trending"]}),f.jsx(dn,{className:"pb-4",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),f.jsxs("div",{children:[f.jsx(fn,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&f.jsxs(ye,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[f.jsx(FC,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),f.jsx(De,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:f.jsx(ab,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(qt,{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),f.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>f.jsx(ye,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),f.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(ib,{className:"h-4 w-4"}),f.jsx("span",{children:e.usageCount.toLocaleString()})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Tb,{className:"h-4 w-4 text-yellow-500 fill-current"}),f.jsx("span",{children:e.rating})]})]}),f.jsx(ye,{variant:"outline",className:"text-xs",children:e.category})]}),f.jsx("div",{className:"pt-2",children:f.jsxs(De,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[f.jsx(ls,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Xb(e,t){const n=g.createContext(t),r=i=>{const{children:l,...s}=i,a=g.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function o(i){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function er(e,t=[]){let n=[];function r(i,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=d=>{var y;const{scope:p,children:h,...w}=d,v=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,S=g.useMemo(()=>w,Object.values(w));return f.jsx(v.Provider,{value:S,children:h})};u.displayName=i+"Provider";function c(d,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,w=g.useContext(h);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,qb(o,...t)]}function qb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(i)[`__scope${u}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Cd(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:S,children:y}=v,m=Rt.useRef(null),x=Rt.useRef(new Map).current;return f.jsx(o,{scope:S,itemMap:x,collectionRef:m,children:y})};l.displayName=t;const s=e+"CollectionSlot",a=po(s),u=Rt.forwardRef((v,S)=>{const{scope:y,children:m}=v,x=i(s,y),C=pe(S,x.collectionRef);return f.jsx(a,{ref:C,children:m})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",p=po(c),h=Rt.forwardRef((v,S)=>{const{scope:y,children:m,...x}=v,C=Rt.useRef(null),N=pe(S,C),b=i(c,y);return Rt.useEffect(()=>(b.itemMap.set(C,{ref:C,...x}),()=>void b.itemMap.delete(C))),f.jsx(p,{[d]:"",ref:N,children:m})});h.displayName=c;function w(v){const S=i(e+"CollectionConsumer",v);return Rt.useCallback(()=>{const m=S.collectionRef.current;if(!m)return[];const x=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((b,P)=>x.indexOf(b.ref.current)-x.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},w,r]}var Ke=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Jb=Nc[" useId ".trim().toString()]||(()=>{}),Zb=0;function Hn(e){const[t,n]=g.useState(Jb());return Ke(()=>{e||n(r=>r??String(Zb++))},[e]),e||(t?`radix-${t}`:"")}var eE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=eE.reduce((e,t)=>{const n=po(`Primitive.${t}`),r=g.forwardRef((o,i)=>{const{asChild:l,...s}=o,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tE(e,t){e&&xo.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var nE=Nc[" useInsertionEffect ".trim().toString()]||Ke;function ho({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=rE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{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=oE(c)?c(e):c;p!==e&&((d=l.current)==null||d.call(l,p))}else i(c)},[s,e,i,l]);return[a,u]}function rE({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),i=g.useRef(t);return nE(()=>{i.current=t},[t]),g.useEffect(()=>{var l;o.current!==n&&((l=i.current)==null||l.call(i,n),o.current=n)},[n,o]),[n,r,i]}function oE(e){return typeof e=="function"}var iE=g.createContext(void 0);function Os(e){const t=g.useContext(iE);return e||t||"ltr"}var Pa="rovingFocusGroup.onEntryFocus",lE={bubbles:!1,cancelable:!0},Di="RovingFocusGroup",[Qu,Fy,sE]=Cd(Di),[aE,By]=er(Di,[sE]),[uE,cE]=aE(Di),$y=g.forwardRef((e,t)=>f.jsx(Qu.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Qu.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(dE,{...e,ref:t})})}));$y.displayName=Di;var dE=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=g.useRef(null),h=pe(t,p),w=Os(i),[v,S]=ho({prop:l,defaultProp:s??null,onChange:a,caller:Di}),[y,m]=g.useState(!1),x=Gn(u),C=Fy(n),N=g.useRef(!1),[b,P]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Pa,x),()=>T.removeEventListener(Pa,x)},[x]),f.jsx(uE,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:v,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>m(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>P(T=>T-1),[]),children:f.jsx(ne.div,{tabIndex:y||b===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{N.current=!0}),onFocus:te(e.onFocus,T=>{const F=!N.current;if(T.target===T.currentTarget&&F&&!y){const L=new CustomEvent(Pa,lE);if(T.currentTarget.dispatchEvent(L),!L.defaultPrevented){const R=C().filter($=>$.focusable),_=R.find($=>$.active),V=R.find($=>$.id===v),O=[_,V,...R].filter(Boolean).map($=>$.ref.current);Hy(O,c)}}N.current=!1}),onBlur:te(e.onBlur,()=>m(!1))})})}),Uy="RovingFocusGroupItem",Vy=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:l,...s}=e,a=Hn(),u=i||a,c=cE(Uy,n),d=c.currentTabStopId===u,p=Fy(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=c;return g.useEffect(()=>{if(r)return h(),()=>w()},[r,h,w]),f.jsx(Qu.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:f.jsx(ne.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?c.onItemFocus(u):S.preventDefault()}),onFocus:te(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){c.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=hE(S,c.orientation,c.dir);if(y!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=c.loop?mE(x,C+1):x.slice(C+1)}setTimeout(()=>Hy(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:v!=null}):l})})});Vy.displayName=Uy;var fE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function hE(e,t,n){const r=pE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fE[r]}function Hy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gE=$y,yE=Vy;function vE(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var zi=e=>{const{present:t,children:n}=e,r=xE(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=pe(r.ref,wE(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};zi.displayName="Presence";function xE(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=vE(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=ll(r.current);i.current=s==="mounted"?u:"none"},[s]),Ke(()=>{const u=r.current,c=o.current;if(c!==e){const p=i.current,h=ll(u);e?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),Ke(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=h=>{const v=ll(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(a("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=h=>{h.target===t&&(i.current=ll(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 ll(e){return(e==null?void 0:e.animationName)||"none"}function wE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ds="Tabs",[SE,vI]=er(Ds,[By]),Wy=By(),[kE,bd]=SE(Ds),Ky=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,c=Os(s),[d,p]=ho({prop:r,onChange:o,defaultProp:i??"",caller:Ds});return f.jsx(kE,{scope:n,baseId:Hn(),value:d,onValueChange:p,orientation:l,dir:c,activationMode:a,children:f.jsx(ne.div,{dir:c,"data-orientation":l,...u,ref:t})})});Ky.displayName=Ds;var Gy="TabsList",Qy=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=bd(Gy,n),l=Wy(n);return f.jsx(gE,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(ne.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Qy.displayName=Gy;var Yy="TabsTrigger",Xy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,l=bd(Yy,n),s=Wy(n),a=Zy(l.baseId,r),u=ev(l.baseId,r),c=r===l.value;return f.jsx(yE,{asChild:!0,...s,focusable:!o,active:c,children:f.jsx(ne.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":u,"data-state":c?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:t,onMouseDown:te(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:te(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:te(e.onFocus,()=>{const d=l.activationMode!=="manual";!c&&!o&&d&&l.onValueChange(r)})})})});Xy.displayName=Yy;var qy="TabsContent",Jy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...l}=e,s=bd(qy,n),a=Zy(s.baseId,r),u=ev(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(zi,{present:o||c,children:({present:p})=>f.jsx(ne.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&&i})})});Jy.displayName=qy;function Zy(e,t){return`${e}-trigger-${t}`}function ev(e,t){return`${e}-content-${t}`}var CE=Ky,tv=Qy,nv=Xy,rv=Jy;const bE=CE,ov=g.forwardRef(({className:e,...t},n)=>f.jsx(tv,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ov.displayName=tv.displayName;const Yu=g.forwardRef(({className:e,...t},n)=>f.jsx(nv,{ref:n,className:ue("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}));Yu.displayName=nv.displayName;const Xu=g.forwardRef(({className:e,...t},n)=>f.jsx(rv,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Xu.displayName=rv.displayName;function as(e,[t,n]){return Math.min(n,Math.max(t,e))}function iv(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 lv(e){const[t,n]=g.useState(void 0);return Ke(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var sv=["PageUp","PageDown"],av=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},So="Slider",[qu,EE,NE]=Cd(So),[cv,xI]=er(So,[NE]),[PE,zs]=cv(So),dv=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:c,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:h=!1,form:w,...v}=e,S=g.useRef(new Set),y=g.useRef(0),x=l==="horizontal"?jE:TE,[C=[],N]=ho({prop:c,defaultProp:u,onChange:R=>{var V;(V=[...S.current][y.current])==null||V.focus(),d(R)}}),b=g.useRef(C);function P(R){const _=ME(C,R);L(R,_)}function T(R){L(R,y.current)}function F(){const R=b.current[y.current];C[y.current]!==R&&p(C)}function L(R,_,{commit:V}={commit:!1}){const A=zE(i),O=FE(Math.round((R-r)/i)*i+r,A),$=as(O,[r,o]);N((H=[])=>{const j=RE(H,$,_);if(DE(j,a*i)){y.current=j.indexOf($);const D=String(j)!==String(H);return D&&V&&p(j),D?j:H}else return H})}return f.jsx(PE,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:y,thumbs:S.current,values:C,orientation:l,form:w,children:f.jsx(qu.Provider,{scope:e.__scopeSlider,children:f.jsx(qu.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:t,onPointerDown:te(v.onPointerDown,()=>{s||(b.current=C)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:P,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:F,onHomeKeyDown:()=>!s&&L(r,0,{commit:!0}),onEndKeyDown:()=>!s&&L(o,C.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:_})=>{if(!s){const O=sv.includes(R.key)||R.shiftKey&&av.includes(R.key)?10:1,$=y.current,H=C[$],j=i*O*_;L(H+j,$,{commit:!0})}}})})})})});dv.displayName=So;var[fv,pv]=cv(So,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jE=g.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...c}=e,[d,p]=g.useState(null),h=pe(t,x=>p(x)),w=g.useRef(void 0),v=Os(o),S=v==="ltr",y=S&&!i||!S&&i;function m(x){const C=w.current||d.getBoundingClientRect(),N=[0,C.width],P=Ed(N,y?[n,r]:[r,n]);return w.current=C,P(x-C.left)}return f.jsx(fv,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:f.jsx(hv,{dir:v,"data-orientation":"horizontal",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=m(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=m(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=uv[y?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),TE=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,c=g.useRef(null),d=pe(t,c),p=g.useRef(void 0),h=!o;function w(v){const S=p.current||c.current.getBoundingClientRect(),y=[0,S.height],x=Ed(y,h?[r,n]:[n,r]);return p.current=S,x(v-S.top)}return f.jsx(fv,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(hv,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=w(v.clientY);i==null||i(S)},onSlideMove:v=>{const S=w(v.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:v=>{const y=uv[h?"from-bottom":"from-top"].includes(v.key);a==null||a({event:v,direction:y?-1:1})}})})}),hv=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,c=zs(So,n);return f.jsx(ne.span,{...u,ref:t,onKeyDown:te(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):sv.concat(av).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:te(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),c.thumbs.has(p)?p.focus():r(d)}),onPointerMove:te(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:te(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),i(d))})})}),mv="SliderTrack",gv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=zs(mv,n);return f.jsx(ne.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});gv.displayName=mv;var Ju="SliderRange",yv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=zs(Ju,n),i=pv(Ju,n),l=g.useRef(null),s=pe(t,l),a=o.values.length,u=o.values.map(p=>wv(p,o.min,o.max)),c=a>1?Math.min(...u):0,d=100-Math.max(...u);return f.jsx(ne.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:c+"%",[i.endEdge]:d+"%"}})});yv.displayName=Ju;var Zu="SliderThumb",vv=g.forwardRef((e,t)=>{const n=EE(e.__scopeSlider),[r,o]=g.useState(null),i=pe(t,s=>o(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(_E,{...e,ref:i,index:l})}),_E=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,l=zs(Zu,n),s=pv(Zu,n),[a,u]=g.useState(null),c=pe(t,m=>u(m)),d=a?l.form||!!a.closest("form"):!0,p=lv(a),h=l.values[r],w=h===void 0?0:wv(h,l.min,l.max),v=IE(r,l.values.length),S=p==null?void 0:p[s.size],y=S?LE(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${y}px)`},children:[f.jsx(qu.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":h,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:c,style:h===void 0?{display:"none"}:e.style,onFocus:te(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&f.jsx(xv,{name:o??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:h},r)]})});vv.displayName=Zu;var AE="RadioBubbleInput",xv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=g.useRef(null),i=pe(o,r),l=iv(t);return g.useEffect(()=>{const s=o.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(ne.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});xv.displayName=AE;function RE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function wv(e,t,n){const i=100/(n-t)*(e-t);return as(i,[0,100])}function IE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ME(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function LE(e,t,n){const r=e/2,i=Ed([0,50],[0,r]);return(r-i(t)*n)*n}function OE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function DE(e,t){if(t>0){const n=OE(e);return Math.min(...n)>=t}return!0}function Ed(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 zE(e){return(String(e).split(".")[1]||"").length}function FE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Sv=dv,BE=gv,$E=yv,UE=vv;const ec=g.forwardRef(({className:e,...t},n)=>f.jsxs(Sv,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(BE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx($E,{className:"absolute h-full bg-primary"})}),f.jsx(UE,{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"})]}));ec.displayName=Sv.displayName;var VE="Label",kv=g.forwardRef((e,t)=>f.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kv.displayName=VE;var Cv=kv;const HE=Sd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),un=g.forwardRef(({className:e,...t},n)=>f.jsx(Cv,{ref:n,className:ue(HE(),e),...t}));un.displayName=Cv.displayName;function WE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var KE="DismissableLayer",tc="dismissableLayer.update",GE="dismissableLayer.pointerDownOutside",QE="dismissableLayer.focusOutside",Op,bv=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(bv),[c,d]=g.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),w=pe(t,P=>d(P)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(S),m=c?v.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=y,N=qE(P=>{const T=P.target,F=[...u.branches].some(L=>L.contains(T));!C||F||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},p),b=JE(P=>{const T=P.target;[...u.branches].some(L=>L.contains(T))||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},p);return WE(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Op=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Dp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Op)}},[c,p,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Dp())},[c,u]),g.useEffect(()=>{const P=()=>h({});return document.addEventListener(tc,P),()=>document.removeEventListener(tc,P)},[]),f.jsx(ne.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,b.onFocusCapture),onBlurCapture:te(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,N.onPointerDownCapture)})});Nd.displayName=KE;var YE="DismissableLayerBranch",XE=g.forwardRef((e,t)=>{const n=g.useContext(bv),r=g.useRef(null),o=pe(t,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(ne.div,{...e,ref:o})});XE.displayName=YE;function qE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let a=function(){Ev(GE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function JE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ev(QE,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Dp(){const e=new CustomEvent(tc);document.dispatchEvent(e)}function Ev(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?tE(o,i):o.dispatchEvent(i)}var ja=0;function Nv(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zp()),document.body.insertAdjacentElement("beforeend",e[1]??zp()),ja++,()=>{ja===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ja--}},[])}function zp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ta="focusScope.autoFocusOnMount",_a="focusScope.autoFocusOnUnmount",Fp={bubbles:!1,cancelable:!0},ZE="FocusScope",Pd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[s,a]=g.useState(null),u=Gn(o),c=Gn(i),d=g.useRef(null),p=pe(t,v=>a(v)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let v=function(x){if(h.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:Pn(d.current,{select:!0})},S=function(x){if(h.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Pn(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Pn(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const m=new MutationObserver(y);return s&&m.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),m.disconnect()}}},[r,s,h.paused]),g.useEffect(()=>{if(s){$p.add(h);const v=document.activeElement;if(!s.contains(v)){const y=new CustomEvent(Ta,Fp);s.addEventListener(Ta,u),s.dispatchEvent(y),y.defaultPrevented||(eN(iN(Pv(s)),{select:!0}),document.activeElement===v&&Pn(s))}return()=>{s.removeEventListener(Ta,u),setTimeout(()=>{const y=new CustomEvent(_a,Fp);s.addEventListener(_a,c),s.dispatchEvent(y),y.defaultPrevented||Pn(v??document.body,{select:!0}),s.removeEventListener(_a,c),$p.remove(h)},0)}}},[s,u,c,h]);const w=g.useCallback(v=>{if(!n&&!r||h.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(S&&y){const m=v.currentTarget,[x,C]=tN(m);x&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&Pn(x,{select:!0})):v.shiftKey&&y===x&&(v.preventDefault(),n&&Pn(C,{select:!0})):y===m&&v.preventDefault()}},[n,r,h.paused]);return f.jsx(ne.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Pd.displayName=ZE;function eN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function tN(e){const t=Pv(e),n=Bp(t,e),r=Bp(t.reverse(),e);return[n,r]}function Pv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bp(e,t){for(const n of e)if(!nN(n,{upTo:t}))return n}function nN(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 rN(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rN(e)&&t&&e.select()}}var $p=oN();function oN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Up(e,t),e.unshift(t)},remove(t){var n;e=Up(e,t),(n=e[0])==null||n.resume()}}}function Up(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iN(e){return e.filter(t=>t.tagName!=="A")}const lN=["top","right","bottom","left"],Qn=Math.min,ct=Math.max,us=Math.round,sl=Math.floor,Jt=e=>({x:e,y:e}),sN={left:"right",right:"left",bottom:"top",top:"bottom"},aN={start:"end",end:"start"};function nc(e,t,n){return ct(e,Qn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function jd(e){return e==="x"?"y":"x"}function Td(e){return e==="y"?"height":"width"}const uN=new Set(["top","bottom"]);function Qt(e){return uN.has(vn(e))?"y":"x"}function _d(e){return jd(Qt(e))}function cN(e,t,n){n===void 0&&(n=!1);const r=ko(e),o=_d(e),i=Td(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=cs(l)),[l,cs(l)]}function dN(e){const t=cs(e);return[rc(e),t,rc(t)]}function rc(e){return e.replace(/start|end/g,t=>aN[t])}const Vp=["left","right"],Hp=["right","left"],fN=["top","bottom"],pN=["bottom","top"];function hN(e,t,n){switch(e){case"top":case"bottom":return n?t?Hp:Vp:t?Vp:Hp;case"left":case"right":return t?fN:pN;default:return[]}}function mN(e,t,n,r){const o=ko(e);let i=hN(vn(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(rc)))),i}function cs(e){return e.replace(/left|right|bottom|top/g,t=>sN[t])}function gN(e){return{top:0,right:0,bottom:0,left:0,...e}}function jv(e){return typeof e!="number"?gN(e):{top:e,right:e,bottom:e,left:e}}function ds(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Wp(e,t,n){let{reference:r,floating:o}=e;const i=Qt(t),l=_d(t),s=Td(l),a=vn(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(a){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ko(t)){case"start":h[l]-=p*(n&&u?-1:1);break;case"end":h[l]+=p*(n&&u?-1:1);break}return h}const yN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Wp(u,r,a),p=r,h={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:c=0}=yn(e,t)||{};if(u==null)return{};const d=jv(c),p={x:n,y:r},h=_d(o),w=Td(h),v=await l.getDimensions(u),S=h==="y",y=S?"top":"left",m=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=i.reference[w]+i.reference[h]-p[h]-i.floating[w],N=p[h]-i.reference[h],b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=b?b[x]:0;(!P||!await(l.isElement==null?void 0:l.isElement(b)))&&(P=s.floating[x]||i.floating[w]);const T=C/2-N/2,F=P/2-v[w]/2-1,L=Qn(d[y],F),R=Qn(d[m],F),_=L,V=P-v[w]-R,A=P/2-v[w]/2+T,O=nc(_,A,V),$=!a.arrow&&ko(o)!=null&&A!==O&&i.reference[w]/2-(A<_?L:R)-v[w]/2<0,H=$?A<_?A-_:A-V:0;return{[h]:p[h]+H,data:{[h]:O,centerOffset:A-O-H,...$&&{alignmentOffset:H}},reset:$}}}),xN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...S}=yn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=vn(o),m=Qt(s),x=vn(s)===s,C=await(a.isRTL==null?void 0:a.isRTL(u.floating)),N=p||(x||!v?[cs(s)]:dN(s)),b=w!=="none";!p&&b&&N.push(...mN(s,v,w,C));const P=[s,...N],T=await Ei(t,S),F=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&F.push(T[y]),d){const A=cN(o,l,C);F.push(T[A[0]],T[A[1]])}if(L=[...L,{placement:o,overflows:F}],!F.every(A=>A<=0)){var R,_;const A=(((R=i.flip)==null?void 0:R.index)||0)+1,O=P[A];if(O&&(!(d==="alignment"?m!==Qt(O):!1)||L.every(j=>Qt(j.placement)===m?j.overflows[0]>0:!0)))return{data:{index:A,overflows:L},reset:{placement:O}};let $=(_=L.filter(H=>H.overflows[0]<=0).sort((H,j)=>H.overflows[1]-j.overflows[1])[0])==null?void 0:_.placement;if(!$)switch(h){case"bestFit":{var V;const H=(V=L.filter(j=>{if(b){const D=Qt(j.placement);return D===m||D==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(D=>D>0).reduce((D,k)=>D+k,0)]).sort((j,D)=>j[1]-D[1])[0])==null?void 0:V[0];H&&($=H);break}case"initialPlacement":$=s;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Kp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gp(e){return lN.some(t=>e[t]>=0)}const wN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yn(e,t);switch(r){case"referenceHidden":{const i=await Ei(t,{...o,elementContext:"reference"}),l=Kp(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Gp(l)}}}case"escaped":{const i=await Ei(t,{...o,altBoundary:!0}),l=Kp(i,n.floating);return{data:{escapedOffsets:l,escaped:Gp(l)}}}default:return{}}}}},Tv=new Set(["left","top"]);async function SN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=vn(n),s=ko(n),a=Qt(n)==="y",u=Tv.has(l)?-1:1,c=i&&a?-1:1,d=yn(t,e);let{mainAxis:p,crossAxis:h,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"&&(h=s==="end"?w*-1:w),a?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const kN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await SN(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},CN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:y,y:m}=S;return{x:y,y:m}}},...a}=yn(e,t),u={x:n,y:r},c=await Ei(t,a),d=Qt(vn(o)),p=jd(d);let h=u[p],w=u[d];if(i){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",m=h+c[S],x=h-c[y];h=nc(m,h,x)}if(l){const S=d==="y"?"top":"left",y=d==="y"?"bottom":"right",m=w+c[S],x=w-c[y];w=nc(m,w,x)}const v=s.fn({...t,[p]:h,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:l}}}}}},bN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=yn(e,t),c={x:n,y:r},d=Qt(o),p=jd(d);let h=c[p],w=c[d];const v=yn(s,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const x=p==="y"?"height":"width",C=i.reference[p]-i.floating[x]+S.mainAxis,N=i.reference[p]+i.reference[x]-S.mainAxis;hN&&(h=N)}if(u){var y,m;const x=p==="y"?"width":"height",C=Tv.has(vn(o)),N=i.reference[d]-i.floating[x]+(C&&((y=l.offset)==null?void 0:y[d])||0)+(C?0:S.crossAxis),b=i.reference[d]+i.reference[x]+(C?0:((m=l.offset)==null?void 0:m[d])||0)-(C?S.crossAxis:0);wb&&(w=b)}return{[p]:h,[d]:w}}}},EN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...u}=yn(e,t),c=await Ei(t,u),d=vn(o),p=ko(o),h=Qt(o)==="y",{width:w,height:v}=i.floating;let S,y;d==="top"||d==="bottom"?(S=d,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,S=p==="end"?"top":"bottom");const m=v-c.top-c.bottom,x=w-c.left-c.right,C=Qn(v-c[S],m),N=Qn(w-c[y],x),b=!t.middlewareData.shift;let P=C,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),b&&!p){const L=ct(c.left,0),R=ct(c.right,0),_=ct(c.top,0),V=ct(c.bottom,0);h?T=w-2*(L!==0||R!==0?L+R:ct(c.left,c.right)):P=v-2*(_!==0||V!==0?_+V:ct(c.top,c.bottom))}await a({...t,availableWidth:T,availableHeight:P});const F=await l.getDimensions(s.floating);return w!==F.width||v!==F.height?{reset:{rects:!0}}:{}}}};function Fs(){return typeof window<"u"}function Co(e){return _v(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tn(e){var t;return(t=(_v(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _v(e){return Fs()?e instanceof Node||e instanceof ht(e).Node:!1}function zt(e){return Fs()?e instanceof Element||e instanceof ht(e).Element:!1}function Zt(e){return Fs()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function Qp(e){return!Fs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}const NN=new Set(["inline","contents"]);function Fi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!NN.has(o)}const PN=new Set(["table","td","th"]);function jN(e){return PN.has(Co(e))}const TN=[":popover-open",":modal"];function Bs(e){return TN.some(t=>{try{return e.matches(t)}catch{return!1}})}const _N=["transform","translate","scale","rotate","perspective"],AN=["transform","translate","scale","rotate","perspective","filter"],RN=["paint","layout","strict","content"];function Ad(e){const t=Rd(),n=zt(e)?Ft(e):e;return _N.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)||AN.some(r=>(n.willChange||"").includes(r))||RN.some(r=>(n.contain||"").includes(r))}function IN(e){let t=Yn(e);for(;Zt(t)&&!mo(t);){if(Ad(t))return t;if(Bs(t))return null;t=Yn(t)}return null}function Rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MN=new Set(["html","body","#document"]);function mo(e){return MN.has(Co(e))}function Ft(e){return ht(e).getComputedStyle(e)}function $s(e){return zt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yn(e){if(Co(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qp(e)&&e.host||tn(e);return Qp(t)?t.host:t}function Av(e){const t=Yn(e);return mo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&Fi(t)?t:Av(t)}function Ni(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Av(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=ht(o);if(i){const s=oc(l);return t.concat(l,l.visualViewport||[],Fi(o)?o:[],s&&n?Ni(s):[])}return t.concat(o,Ni(o,[],n))}function oc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rv(e){const t=Ft(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Zt(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=us(n)!==i||us(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Id(e){return zt(e)?e:e.contextElement}function eo(e){const t=Id(e);if(!Zt(t))return Jt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Rv(t);let l=(i?us(n.width):n.width)/r,s=(i?us(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const LN=Jt(0);function Iv(e){const t=ht(e);return!Rd()||!t.visualViewport?LN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ON(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ht(e)?!1:t}function wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Id(e);let l=Jt(1);t&&(r?zt(r)&&(l=eo(r)):l=eo(e));const s=ON(i,n,r)?Iv(i):Jt(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const p=ht(i),h=r&&zt(r)?ht(r):r;let w=p,v=oc(w);for(;v&&r&&h!==w;){const S=eo(v),y=v.getBoundingClientRect(),m=Ft(v),x=y.left+(v.clientLeft+parseFloat(m.paddingLeft))*S.x,C=y.top+(v.clientTop+parseFloat(m.paddingTop))*S.y;a*=S.x,u*=S.y,c*=S.x,d*=S.y,a+=x,u+=C,w=ht(v),v=oc(w)}}return ds({width:c,height:d,x:a,y:u})}function Us(e,t){const n=$s(e).scrollLeft;return t?t.left+n:wr(tn(e)).left+n}function Mv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Us(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function DN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=tn(r),s=t?Bs(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=Jt(1);const c=Jt(0),d=Zt(r);if((d||!d&&!i)&&((Co(r)!=="body"||Fi(l))&&(a=$s(r)),Zt(r))){const h=wr(r);u=eo(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=l&&!d&&!i?Mv(l,a):Jt(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 zN(e){return Array.from(e.getClientRects())}function FN(e){const t=tn(e),n=$s(e),r=e.ownerDocument.body,o=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Us(e);const s=-n.scrollTop;return Ft(r).direction==="rtl"&&(l+=ct(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}const Yp=25;function BN(e,t){const n=ht(e),r=tn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const c=Rd();(!c||c&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}const u=Us(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-h);w<=Yp&&(i-=w)}else u<=Yp&&(i+=u);return{width:i,height:l,x:s,y:a}}const $N=new Set(["absolute","fixed"]);function UN(e,t){const n=wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Zt(e)?eo(e):Jt(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,u=r*i.y;return{width:l,height:s,x:a,y:u}}function Xp(e,t,n){let r;if(t==="viewport")r=BN(e,n);else if(t==="document")r=FN(tn(e));else if(zt(t))r=UN(t,n);else{const o=Iv(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ds(r)}function Lv(e,t){const n=Yn(e);return n===t||!zt(n)||mo(n)?!1:Ft(n).position==="fixed"||Lv(n,t)}function VN(e,t){const n=t.get(e);if(n)return n;let r=Ni(e,[],!1).filter(s=>zt(s)&&Co(s)!=="body"),o=null;const i=Ft(e).position==="fixed";let l=i?Yn(e):e;for(;zt(l)&&!mo(l);){const s=Ft(l),a=Ad(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&$N.has(o.position)||Fi(l)&&!a&&Lv(e,l))?r=r.filter(c=>c!==l):o=s,l=Yn(l)}return t.set(e,r),r}function HN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Bs(t)?[]:VN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,c)=>{const d=Xp(t,c,o);return u.top=ct(d.top,u.top),u.right=Qn(d.right,u.right),u.bottom=Qn(d.bottom,u.bottom),u.left=ct(d.left,u.left),u},Xp(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function WN(e){const{width:t,height:n}=Rv(e);return{width:t,height:n}}function KN(e,t,n){const r=Zt(t),o=tn(t),i=n==="fixed",l=wr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=Jt(0);function u(){a.x=Us(o)}if(r||!r&&!i)if((Co(t)!=="body"||Fi(o))&&(s=$s(t)),r){const h=wr(t,!0,i,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=o&&!r&&!i?Mv(o,s):Jt(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 Ft(e).position==="static"}function qp(e,t){if(!Zt(e)||Ft(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return tn(e)===n&&(n=n.ownerDocument.body),n}function Ov(e,t){const n=ht(e);if(Bs(e))return n;if(!Zt(e)){let o=Yn(e);for(;o&&!mo(o);){if(zt(o)&&!Aa(o))return o;o=Yn(o)}return n}let r=qp(e,t);for(;r&&jN(r)&&Aa(r);)r=qp(r,t);return r&&mo(r)&&Aa(r)&&!Ad(r)?n:r||IN(e)||n}const GN=async function(e){const t=this.getOffsetParent||Ov,n=this.getDimensions,r=await n(e.floating);return{reference:KN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QN(e){return Ft(e).direction==="rtl"}const YN={convertOffsetParentRelativeRectToViewportRelativeRect:DN,getDocumentElement:tn,getClippingRect:HN,getOffsetParent:Ov,getElementRects:GN,getClientRects:zN,getDimensions:WN,getScale:eo,isElement:zt,isRTL:QN};function Dv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XN(e,t){let n=null,r;const o=tn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:h}=u;if(s||t(),!p||!h)return;const w=sl(d),v=sl(o.clientWidth-(c+p)),S=sl(o.clientHeight-(d+h)),y=sl(c),x={rootMargin:-w+"px "+-v+"px "+-S+"px "+-y+"px",threshold:ct(0,Qn(1,a))||1};let C=!0;function N(b){const P=b[0].intersectionRatio;if(P!==a){if(!C)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!Dv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),i}function qN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Id(e),c=o||i?[...u?Ni(u):[],...Ni(t)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&s?XN(u,n):null;let p=-1,h=null;l&&(h=new ResizeObserver(y=>{let[m]=y;m&&m.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let w,v=a?wr(e):null;a&&S();function S(){const y=wr(e);v&&!Dv(v,y)&&n(),v=y,w=requestAnimationFrame(S)}return n(),()=>{var y;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,a&&cancelAnimationFrame(w)}}const JN=kN,ZN=CN,e2=xN,t2=EN,n2=wN,Jp=vN,r2=bN,o2=(e,t,n)=>{const r=new Map,o={platform:YN,...n},i={...o.platform,_c:r};return yN(e,t,{...o,platform:i})};var i2=typeof document<"u",l2=function(){},Pl=i2?g.useLayoutEffect:l2;function fs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!fs(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zp(e,t){const n=zv(e);return Math.round(t*n)/n}function Ra(e){const t=g.useRef(e);return Pl(()=>{t.current=e}),t}function s2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[c,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=g.useState(r);fs(p,r)||h(r);const[w,v]=g.useState(null),[S,y]=g.useState(null),m=g.useCallback(j=>{j!==b.current&&(b.current=j,v(j))},[]),x=g.useCallback(j=>{j!==P.current&&(P.current=j,y(j))},[]),C=i||w,N=l||S,b=g.useRef(null),P=g.useRef(null),T=g.useRef(c),F=a!=null,L=Ra(a),R=Ra(o),_=Ra(u),V=g.useCallback(()=>{if(!b.current||!P.current)return;const j={placement:t,strategy:n,middleware:p};R.current&&(j.platform=R.current),o2(b.current,P.current,j).then(D=>{const k={...D,isPositioned:_.current!==!1};A.current&&!fs(T.current,k)&&(T.current=k,xo.flushSync(()=>{d(k)}))})},[p,t,n,R,_]);Pl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[u]);const A=g.useRef(!1);Pl(()=>(A.current=!0,()=>{A.current=!1}),[]),Pl(()=>{if(C&&(b.current=C),N&&(P.current=N),C&&N){if(L.current)return L.current(C,N,V);V()}},[C,N,V,L,F]);const O=g.useMemo(()=>({reference:b,floating:P,setReference:m,setFloating:x}),[m,x]),$=g.useMemo(()=>({reference:C,floating:N}),[C,N]),H=g.useMemo(()=>{const j={position:n,left:0,top:0};if(!$.floating)return j;const D=Zp($.floating,c.x),k=Zp($.floating,c.y);return s?{...j,transform:"translate("+D+"px, "+k+"px)",...zv($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:k}},[n,s,$.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:V,refs:O,elements:$,floatingStyles:H}),[c,V,O,$,H])}const a2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Jp({element:r.current,padding:o}).fn(n):{}:r?Jp({element:r,padding:o}).fn(n):{}}}},u2=(e,t)=>({...JN(e),options:[e,t]}),c2=(e,t)=>({...ZN(e),options:[e,t]}),d2=(e,t)=>({...r2(e),options:[e,t]}),f2=(e,t)=>({...e2(e),options:[e,t]}),p2=(e,t)=>({...t2(e),options:[e,t]}),h2=(e,t)=>({...n2(e),options:[e,t]}),m2=(e,t)=>({...a2(e),options:[e,t]});var g2="Arrow",Fv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(ne.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fv.displayName=g2;var y2=Fv,Md="Popper",[Bv,$v]=er(Md),[v2,Uv]=Bv(Md),Vv=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return f.jsx(v2,{scope:t,anchor:r,onAnchorChange:o,children:n})};Vv.displayName=Md;var Hv="PopperAnchor",Wv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Uv(Hv,n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&i.onAnchorChange(a.current)}),r?null:f.jsx(ne.div,{...o,ref:s})});Wv.displayName=Hv;var Ld="PopperContent",[x2,w2]=Bv(Ld),Kv=g.forwardRef((e,t)=>{var M,W,J,q,Y,se;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,S=Uv(Ld,n),[y,m]=g.useState(null),x=pe(t,Qe=>m(Qe)),[C,N]=g.useState(null),b=lv(C),P=(b==null?void 0:b.width)??0,T=(b==null?void 0:b.height)??0,F=r+(i!=="center"?"-"+i:""),L=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},R=Array.isArray(u)?u:[u],_=R.length>0,V={padding:L,boundary:R.filter(k2),altBoundary:_},{refs:A,floatingStyles:O,placement:$,isPositioned:H,middlewareData:j}=s2({strategy:"fixed",placement:F,whileElementsMounted:(...Qe)=>qN(...Qe,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[u2({mainAxis:o+T,alignmentAxis:l}),a&&c2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?d2():void 0,...V}),a&&f2({...V}),p2({...V,apply:({elements:Qe,rects:vt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:Js}=vt.reference,or=Qe.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",`${Js}px`)}}),C&&m2({element:C,padding:s}),C2({arrowWidth:P,arrowHeight:T}),p&&h2({strategy:"referenceHidden",...V})]}),[D,k]=Yv($),G=Gn(w);Ke(()=>{H&&(G==null||G())},[H,G]);const Q=(M=j.arrow)==null?void 0:M.x,E=(W=j.arrow)==null?void 0:W.y,fe=((J=j.arrow)==null?void 0:J.centerOffset)!==0,[Pe,oe]=g.useState();return Ke(()=>{y&&oe(window.getComputedStyle(y).zIndex)},[y]),f.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:H?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(q=j.transformOrigin)==null?void 0:q.x,(Y=j.transformOrigin)==null?void 0:Y.y].join(" "),...((se=j.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(x2,{scope:n,placedSide:D,onArrowChange:N,arrowX:Q,arrowY:E,shouldHideArrow:fe,children:f.jsx(ne.div,{"data-side":D,"data-align":k,...v,ref:x,style:{...v.style,animation:H?void 0:"none"}})})})});Kv.displayName=Ld;var Gv="PopperArrow",S2={top:"bottom",right:"left",bottom:"top",left:"right"},Qv=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=w2(Gv,r),l=S2[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(y2,{...o,ref:n,style:{...o.style,display:"block"}})})});Qv.displayName=Gv;function k2(e){return e!==null}var C2=e=>({name:"transformOrigin",options:e,fn(t){var S,y,m;const{placement:n,rects:r,middlewareData:o}=t,l=((S=o.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,c]=Yv(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((y=o.arrow)==null?void 0:y.x)??0)+s/2,h=(((m=o.arrow)==null?void 0:m.y)??0)+a/2;let w="",v="";return u==="bottom"?(w=l?d:`${p}px`,v=`${-a}px`):u==="top"?(w=l?d:`${p}px`,v=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,v=l?d:`${h}px`):u==="left"&&(w=`${r.floating.width+a}px`,v=l?d:`${h}px`),{data:{x:w,y:v}}}});function Yv(e){const[t,n="center"]=e.split("-");return[t,n]}var b2=Vv,E2=Wv,N2=Kv,P2=Qv,j2="Portal",Od=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=g.useState(!1);Ke(()=>i(!0),[]);const l=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ek.createPortal(f.jsx(ne.div,{...r,ref:t}),l):null});Od.displayName=j2;var Xv=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"}),T2="VisuallyHidden",_2=g.forwardRef((e,t)=>f.jsx(ne.span,{...e,ref:t,style:{...Xv,...e.style}}));_2.displayName=T2;var A2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ar=new WeakMap,al=new WeakMap,ul={},Ia=0,qv=function(e){return e&&(e.host||qv(e.parentNode))},R2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},I2=function(e,t,n,r){var o=R2(t,Array.isArray(e)?e:[e]);ul[n]||(ul[n]=new WeakMap);var i=ul[n],l=[],s=new Set,a=new Set(o),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};o.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 h=p.getAttribute(r),w=h!==null&&h!=="false",v=(Ar.get(p)||0)+1,S=(i.get(p)||0)+1;Ar.set(p,v),i.set(p,S),l.push(p),v===1&&w&&al.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return c(t),s.clear(),Ia++,function(){l.forEach(function(d){var p=Ar.get(d)-1,h=i.get(d)-1;Ar.set(d,p),i.set(d,h),p||(al.has(d)||d.removeAttribute(r),al.delete(d)),h||d.removeAttribute(n)}),Ia--,Ia||(Ar=new WeakMap,Ar=new WeakMap,al=new WeakMap,ul={})}},Jv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||A2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),I2(r,o,n,"aria-hidden")):function(){return null}},Kt=function(){return Kt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return X2;var t=q2(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])}},Z2=nx(),to="data-scroll-locked",eP=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(L2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(to,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(jl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Tl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jl," .").concat(jl,` { + right: 0 `).concat(r,`; + } + + .`).concat(Tl," .").concat(Tl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(to,`] { + `).concat(O2,": ").concat(s,`px; + } +`)},nh=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},tP=function(){g.useEffect(function(){return document.body.setAttribute(to,(nh()+1).toString()),function(){var e=nh()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},nP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;tP();var i=g.useMemo(function(){return J2(o)},[o]);return g.createElement(Z2,{styles:eP(i,!t,o,n?"":"!important")})},ic=!1;if(typeof window<"u")try{var cl=Object.defineProperty({},"passive",{get:function(){return ic=!0,!0}});window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{ic=!1}var Rr=ic?{passive:!1}:!1,rP=function(e){return e.tagName==="TEXTAREA"},rx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rP(e)&&n[t]==="visible")},oP=function(e){return rx(e,"overflowY")},iP=function(e){return rx(e,"overflowX")},rh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ox(e,r);if(o){var i=ix(e,r),l=i[1],s=i[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ox=function(e,t){return e==="v"?oP(t):iP(t)},ix=function(e,t){return e==="v"?lP(t):sP(t)},aP=function(e,t){return e==="h"&&t==="rtl"?-1:1},uP=function(e,t,n,r,o){var i=aP(e,window.getComputedStyle(t).direction),l=i*r,s=n.target,a=t.contains(s),u=!1,c=l>0,d=0,p=0;do{if(!s)break;var h=ix(e,s),w=h[0],v=h[1],S=h[2],y=v-S-i*w;(w||y)&&ox(e,s)&&(d+=y,p+=w);var m=s.parentNode;s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&(o&&Math.abs(d)<1||!o&&l>d)||!c&&(o&&Math.abs(p)<1||!o&&-l>p))&&(u=!0),u},dl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oh=function(e){return[e.deltaX,e.deltaY]},ih=function(e){return e&&"current"in e?e.current:e},cP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dP=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},fP=0,Ir=[];function pP(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(fP++)[0],i=g.useState(nx)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=M2([e.lockRef.current],(e.shards||[]).map(ih),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var y=dl(v),m=n.current,x="deltaX"in v?v.deltaX:m[0]-y[0],C="deltaY"in v?v.deltaY:m[1]-y[1],N,b=v.target,P=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in v&&P==="h"&&b.type==="range")return!1;var T=rh(P,b);if(!T)return!0;if(T?N=P:(N=P==="v"?"h":"v",T=rh(P,b)),!T)return!1;if(!r.current&&"changedTouches"in v&&(x||C)&&(r.current=N),!N)return!0;var F=r.current||N;return uP(F,S,v,F==="h"?x:C,!0)},[]),a=g.useCallback(function(v){var S=v;if(!(!Ir.length||Ir[Ir.length-1]!==i)){var y="deltaY"in S?oh(S):dl(S),m=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&cP(N.delta,y)})[0];if(m&&m.should){S.cancelable&&S.preventDefault();return}if(!m){var x=(l.current.shards||[]).map(ih).filter(Boolean).filter(function(N){return N.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(v,S,y,m){var x={name:v,delta:S,target:y,should:m,shadowParent:hP(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),c=g.useCallback(function(v){n.current=dl(v),r.current=void 0},[]),d=g.useCallback(function(v){u(v.type,oh(v),v.target,s(v,e.lockRef.current))},[]),p=g.useCallback(function(v){u(v.type,dl(v),v.target,s(v,e.lockRef.current))},[]);g.useEffect(function(){return Ir.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Rr),document.addEventListener("touchmove",a,Rr),document.addEventListener("touchstart",c,Rr),function(){Ir=Ir.filter(function(v){return v!==i}),document.removeEventListener("wheel",a,Rr),document.removeEventListener("touchmove",a,Rr),document.removeEventListener("touchstart",c,Rr)}},[]);var h=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:dP(o)}):null,h?g.createElement(nP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mP=V2(tx,pP);var lx=g.forwardRef(function(e,t){return g.createElement(Vs,Kt({},e,{ref:t,sideCar:mP}))});lx.classNames=Vs.classNames;const sx=lx;var gP=[" ","Enter","ArrowUp","ArrowDown"],yP=[" ","Enter"],Sr="Select",[Hs,Ws,vP]=Cd(Sr),[bo,wI]=er(Sr,[vP,$v]),Ks=$v(),[xP,tr]=bo(Sr),[wP,SP]=bo(Sr),ax=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:l,defaultValue:s,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:p,required:h,form:w}=e,v=Ks(t),[S,y]=g.useState(null),[m,x]=g.useState(null),[C,N]=g.useState(!1),b=Os(u),[P,T]=ho({prop:r,defaultProp:o??!1,onChange:i,caller:Sr}),[F,L]=ho({prop:l,defaultProp:s,onChange:a,caller:Sr}),R=g.useRef(null),_=S?w||!!S.closest("form"):!0,[V,A]=g.useState(new Set),O=Array.from(V).map($=>$.props.value).join(";");return f.jsx(b2,{...v,children:f.jsxs(xP,{required:h,scope:t,trigger:S,onTriggerChange:y,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Hn(),value:F,onValueChange:L,open:P,onOpenChange:T,dir:b,triggerPointerDownPosRef:R,disabled:p,children:[f.jsx(Hs.Provider,{scope:t,children:f.jsx(wP,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback($=>{A(H=>new Set(H).add($))},[]),onNativeOptionRemove:g.useCallback($=>{A(H=>{const j=new Set(H);return j.delete($),j})},[]),children:n})}),_?f.jsxs(Ix,{"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:F,onChange:$=>L($.target.value),disabled:p,form:w,children:[F===void 0?f.jsx("option",{value:""}):null,Array.from(V)]},O):null]})})};ax.displayName=Sr;var ux="SelectTrigger",cx=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Ks(n),l=tr(ux,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=Ws(n),c=g.useRef("touch"),[d,p,h]=Lx(v=>{const S=u().filter(x=>!x.disabled),y=S.find(x=>x.value===l.value),m=Ox(S,v,y);m!==void 0&&l.onValueChange(m.value)}),w=v=>{s||(l.onOpenChange(!0),h()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return f.jsx(E2,{asChild:!0,...i,children:f.jsx(ne.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Mx(l.value)?"":void 0,...o,ref:a,onClick:te(o.onClick,v=>{v.currentTarget.focus(),c.current!=="mouse"&&w(v)}),onPointerDown:te(o.onPointerDown,v=>{c.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:te(o.onKeyDown,v=>{const S=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(S&&v.key===" ")&&gP.includes(v.key)&&(w(),v.preventDefault())})})})});cx.displayName=ux;var dx="SelectValue",fx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...s}=e,a=tr(dx,n),{onValueNodeHasChildrenChange:u}=a,c=i!==void 0,d=pe(t,a.onValueNodeChange);return Ke(()=>{u(c)},[u,c]),f.jsx(ne.span,{...s,ref:d,style:{pointerEvents:"none"},children:Mx(a.value)?f.jsx(f.Fragment,{children:l}):i})});fx.displayName=dx;var kP="SelectIcon",px=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});px.displayName=kP;var CP="SelectPortal",hx=e=>f.jsx(Od,{asChild:!0,...e});hx.displayName=CP;var kr="SelectContent",mx=g.forwardRef((e,t)=>{const n=tr(kr,e.__scopeSelect),[r,o]=g.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?xo.createPortal(f.jsx(gx,{scope:e.__scopeSelect,children:f.jsx(Hs.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(yx,{...e,ref:t})});mx.displayName=kr;var _t=10,[gx,nr]=bo(kr),bP="SelectContentImpl",EP=po("SelectContent.RemoveScroll"),yx=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S,...y}=e,m=tr(kr,n),[x,C]=g.useState(null),[N,b]=g.useState(null),P=pe(t,M=>C(M)),[T,F]=g.useState(null),[L,R]=g.useState(null),_=Ws(n),[V,A]=g.useState(!1),O=g.useRef(!1);g.useEffect(()=>{if(x)return Jv(x)},[x]),Nv();const $=g.useCallback(M=>{const[W,...J]=_().map(se=>se.ref.current),[q]=J.slice(-1),Y=document.activeElement;for(const se of M)if(se===Y||(se==null||se.scrollIntoView({block:"nearest"}),se===W&&N&&(N.scrollTop=0),se===q&&N&&(N.scrollTop=N.scrollHeight),se==null||se.focus(),document.activeElement!==Y))return},[_,N]),H=g.useCallback(()=>$([T,x]),[$,T,x]);g.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:j,triggerPointerDownPosRef:D}=m;g.useEffect(()=>{if(x){let M={x:0,y:0};const W=q=>{var Y,se;M={x:Math.abs(Math.round(q.pageX)-(((Y=D.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(q.pageY)-(((se=D.current)==null?void 0:se.y)??0))}},J=q=>{M.x<=10&&M.y<=10?q.preventDefault():x.contains(q.target)||j(!1),document.removeEventListener("pointermove",W),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",J,{capture:!0})}}},[x,j,D]),g.useEffect(()=>{const M=()=>j(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[j]);const[k,G]=Lx(M=>{const W=_().filter(Y=>!Y.disabled),J=W.find(Y=>Y.ref.current===document.activeElement),q=Ox(W,M,J);q&&setTimeout(()=>q.ref.current.focus())}),Q=g.useCallback((M,W,J)=>{const q=!O.current&&!J;(m.value!==void 0&&m.value===W||q)&&(F(M),q&&(O.current=!0))},[m.value]),E=g.useCallback(()=>x==null?void 0:x.focus(),[x]),fe=g.useCallback((M,W,J)=>{const q=!O.current&&!J;(m.value!==void 0&&m.value===W||q)&&R(M)},[m.value]),Pe=r==="popper"?lc:vx,oe=Pe===lc?{side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S}:{};return f.jsx(gx,{scope:n,content:x,viewport:N,onViewportChange:b,itemRefCallback:Q,selectedItem:T,onItemLeave:E,itemTextRefCallback:fe,focusSelectedItem:H,selectedItemText:L,position:r,isPositioned:V,searchRef:k,children:f.jsx(sx,{as:EP,allowPinchZoom:!0,children:f.jsx(Pd,{asChild:!0,trapped:m.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:te(o,M=>{var W;(W=m.trigger)==null||W.focus({preventScroll:!0}),M.preventDefault()}),children:f.jsx(Nd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:f.jsx(Pe,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:M=>M.preventDefault(),...y,...oe,onPlaced:()=>A(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,M=>{const W=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!W&&M.key.length===1&&G(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let q=_().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(M.key)&&(q=q.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const Y=M.target,se=q.indexOf(Y);q=q.slice(se+1)}setTimeout(()=>$(q)),M.preventDefault()}})})})})})})});yx.displayName=bP;var NP="SelectItemAlignedPosition",vx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tr(kr,n),l=nr(kr,n),[s,a]=g.useState(null),[u,c]=g.useState(null),d=pe(t,P=>c(P)),p=Ws(n),h=g.useRef(!1),w=g.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:y,focusSelectedItem:m}=l,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&v&&S&&y){const P=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(i.dir!=="rtl"){const Y=L.left-T.left,se=F.left-Y,Qe=P.left-se,vt=P.width+Qe,Sn=Math.max(vt,T.width),kn=window.innerWidth-_t,Cn=as(se,[_t,Math.max(_t,kn-Sn)]);s.style.minWidth=vt+"px",s.style.left=Cn+"px"}else{const Y=T.right-L.right,se=window.innerWidth-F.right-Y,Qe=window.innerWidth-P.right-se,vt=P.width+Qe,Sn=Math.max(vt,T.width),kn=window.innerWidth-_t,Cn=as(se,[_t,Math.max(_t,kn-Sn)]);s.style.minWidth=vt+"px",s.style.right=Cn+"px"}const R=p(),_=window.innerHeight-_t*2,V=v.scrollHeight,A=window.getComputedStyle(u),O=parseInt(A.borderTopWidth,10),$=parseInt(A.paddingTop,10),H=parseInt(A.borderBottomWidth,10),j=parseInt(A.paddingBottom,10),D=O+$+V+j+H,k=Math.min(S.offsetHeight*5,D),G=window.getComputedStyle(v),Q=parseInt(G.paddingTop,10),E=parseInt(G.paddingBottom,10),fe=P.top+P.height/2-_t,Pe=_-fe,oe=S.offsetHeight/2,M=S.offsetTop+oe,W=O+$+M,J=D-W;if(W<=fe){const Y=R.length>0&&S===R[R.length-1].ref.current;s.style.bottom="0px";const se=u.clientHeight-v.offsetTop-v.offsetHeight,Qe=Math.max(Pe,oe+(Y?E:0)+se+H),vt=W+Qe;s.style.height=vt+"px"}else{const Y=R.length>0&&S===R[0].ref.current;s.style.top="0px";const Qe=Math.max(fe,O+v.offsetTop+(Y?Q:0)+oe)+J;s.style.height=Qe+"px",v.scrollTop=W-fe+v.offsetTop}s.style.margin=`${_t}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,s,u,v,S,y,i.dir,r]);Ke(()=>x(),[x]);const[C,N]=g.useState();Ke(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const b=g.useCallback(P=>{P&&w.current===!0&&(x(),m==null||m(),w.current=!1)},[x,m]);return f.jsx(jP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(ne.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});vx.displayName=NP;var PP="SelectPopperPosition",lc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_t,...i}=e,l=Ks(n);return f.jsx(N2,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});lc.displayName=PP;var[jP,Dd]=bo(kr,{}),sc="SelectViewport",xx=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nr(sc,n),l=Dd(sc,n),s=pe(t,i.onViewportChange),a=g.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Hs.Slot,{scope:n,children:f.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const h=Math.abs(a.current-c.scrollTop);if(h>0){const w=window.innerHeight-_t*2,v=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),y=Math.max(v,S);if(y0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});xx.displayName=sc;var wx="SelectGroup",[TP,_P]=bo(wx),Sx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hn();return f.jsx(TP,{scope:n,id:o,children:f.jsx(ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Sx.displayName=wx;var kx="SelectLabel",Cx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_P(kx,n);return f.jsx(ne.div,{id:o.id,...r,ref:t})});Cx.displayName=kx;var ps="SelectItem",[AP,bx]=bo(ps),Ex=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,s=tr(ps,n),a=nr(ps,n),u=s.value===r,[c,d]=g.useState(i??""),[p,h]=g.useState(!1),w=pe(t,m=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,m,r,o)}),v=Hn(),S=g.useRef("touch"),y=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(AP,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:g.useCallback(m=>{d(x=>x||((m==null?void 0:m.textContent)??"").trim())},[]),children:f.jsx(Hs.ItemSlot,{scope:n,value:r,disabled:o,textValue:c,children:f.jsx(ne.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:w,onFocus:te(l.onFocus,()=>h(!0)),onBlur:te(l.onBlur,()=>h(!1)),onClick:te(l.onClick,()=>{S.current!=="mouse"&&y()}),onPointerUp:te(l.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:te(l.onPointerDown,m=>{S.current=m.pointerType}),onPointerMove:te(l.onPointerMove,m=>{var x;S.current=m.pointerType,o?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(l.onPointerLeave,m=>{var x;m.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:te(l.onKeyDown,m=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(yP.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});Ex.displayName=ps;var Wo="SelectItemText",Nx=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,l=tr(Wo,n),s=nr(Wo,n),a=bx(Wo,n),u=SP(Wo,n),[c,d]=g.useState(null),p=pe(t,y=>d(y),a.onItemTextChange,y=>{var m;return(m=s.itemTextRefCallback)==null?void 0:m.call(s,y,a.value,a.disabled)}),h=c==null?void 0:c.textContent,w=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:h},a.value),[a.disabled,a.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=u;return Ke(()=>(v(w),()=>S(w)),[v,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(ne.span,{id:a.textId,...i,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?xo.createPortal(i.children,l.valueNode):null]})});Nx.displayName=Wo;var Px="SelectItemIndicator",jx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return bx(Px,n).isSelected?f.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});jx.displayName=Px;var ac="SelectScrollUpButton",Tx=g.forwardRef((e,t)=>{const n=nr(ac,e.__scopeSelect),r=Dd(ac,e.__scopeSelect),[o,i]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;i(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Ax,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Tx.displayName=ac;var uc="SelectScrollDownButton",_x=g.forwardRef((e,t)=>{const n=nr(uc,e.__scopeSelect),r=Dd(uc,e.__scopeSelect),[o,i]=g.useState(!1),l=pe(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]),o?f.jsx(Ax,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});_x.displayName=uc;var Ax=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nr("SelectScrollButton",n),l=g.useRef(null),s=Ws(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(ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{a()})})}),RP="SelectSeparator",Rx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});Rx.displayName=RP;var cc="SelectArrow",IP=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ks(n),i=tr(cc,n),l=nr(cc,n);return i.open&&l.position==="popper"?f.jsx(P2,{...o,...r,ref:t}):null});IP.displayName=cc;var MP="SelectBubbleInput",Ix=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=g.useRef(null),i=pe(r,o),l=iv(t);return g.useEffect(()=>{const s=o.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(ne.select,{...n,style:{...Xv,...n.style},ref:i,defaultValue:t})});Ix.displayName=MP;function Mx(e){return e===""||e===void 0}function Lx(e){const t=Gn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Ox(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=LP(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function LP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OP=ax,Dx=cx,DP=fx,zP=px,FP=hx,zx=mx,BP=xx,$P=Sx,Fx=Cx,Bx=Ex,UP=Nx,VP=jx,$x=Tx,Ux=_x,Vx=Rx;const Hx=OP,hs=$P,Wx=DP,zd=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Dx,{ref:r,className:ue("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(zP,{asChild:!0,children:f.jsx(Ty,{className:"h-4 w-4 opacity-50"})})]}));zd.displayName=Dx.displayName;const Kx=g.forwardRef(({className:e,...t},n)=>f.jsx($x,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(qC,{className:"h-4 w-4"})}));Kx.displayName=$x.displayName;const Gx=g.forwardRef(({className:e,...t},n)=>f.jsx(Ux,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Ty,{className:"h-4 w-4"})}));Gx.displayName=Ux.displayName;const Fd=g.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>f.jsx(FP,{children:f.jsxs(zx,{ref:o,className:ue("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(Kx,{}),f.jsx(BP,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(Gx,{})]})}));Fd.displayName=zx.displayName;const Pi=g.forwardRef(({className:e,...t},n)=>f.jsx(Fx,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Pi.displayName=Fx.displayName;const ji=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Bx,{ref:r,className:ue("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(VP,{children:f.jsx(KC,{className:"h-4 w-4"})})}),f.jsx(UP,{children:t})]}));ji.displayName=Bx.displayName;const HP=g.forwardRef(({className:e,...t},n)=>f.jsx(Vx,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));HP.displayName=Vx.displayName;var Gs="Dialog",[Qx,Yx]=er(Gs),[WP,Bt]=Qx(Gs),Xx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,c]=ho({prop:r,defaultProp:o??!1,onChange:i,caller:Gs});return f.jsx(WP,{scope:t,triggerRef:s,contentRef:a,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:l,children:n})};Xx.displayName=Gs;var qx="DialogTrigger",Jx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Bt(qx,n),i=pe(t,o.triggerRef);return f.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ud(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)})});Jx.displayName=qx;var Bd="DialogPortal",[KP,Zx]=Qx(Bd,{forceMount:void 0}),e0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Bt(Bd,t);return f.jsx(KP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(zi,{present:n||i.open,children:f.jsx(Od,{asChild:!0,container:o,children:l})}))})};e0.displayName=Bd;var ms="DialogOverlay",t0=g.forwardRef((e,t)=>{const n=Zx(ms,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Bt(ms,e.__scopeDialog);return i.modal?f.jsx(zi,{present:r||i.open,children:f.jsx(QP,{...o,ref:t})}):null});t0.displayName=ms;var GP=po("DialogOverlay.RemoveScroll"),QP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Bt(ms,n);return f.jsx(sx,{as:GP,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(ne.div,{"data-state":Ud(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cr="DialogContent",n0=g.forwardRef((e,t)=>{const n=Zx(Cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Bt(Cr,e.__scopeDialog);return f.jsx(zi,{present:r||i.open,children:i.modal?f.jsx(YP,{...o,ref:t}):f.jsx(XP,{...o,ref:t})})});n0.displayName=Cr;var YP=g.forwardRef((e,t)=>{const n=Bt(Cr,e.__scopeDialog),r=g.useRef(null),o=pe(t,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return Jv(i)},[]),f.jsx(r0,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&i.preventDefault()}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault())})}),XP=g.forwardRef((e,t)=>{const n=Bt(Cr,e.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return f.jsx(r0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),r0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,s=Bt(Cr,n),a=g.useRef(null),u=pe(t,a);return Nv(),f.jsxs(f.Fragment,{children:[f.jsx(Pd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(Nd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ud(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(JP,{titleId:s.titleId}),f.jsx(ej,{contentRef:a,descriptionId:s.descriptionId})]})]})}),$d="DialogTitle",o0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Bt($d,n);return f.jsx(ne.h2,{id:o.titleId,...r,ref:t})});o0.displayName=$d;var i0="DialogDescription",l0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Bt(i0,n);return f.jsx(ne.p,{id:o.descriptionId,...r,ref:t})});l0.displayName=i0;var s0="DialogClose",a0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Bt(s0,n);return f.jsx(ne.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});a0.displayName=s0;function Ud(e){return e?"open":"closed"}var u0="DialogTitleWarning",[qP,c0]=Xb(u0,{contentName:Cr,titleName:$d,docsSlug:"dialog"}),JP=({titleId:e})=>{const t=c0(u0),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},ZP="DialogDescriptionWarning",ej=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c0(ZP).contentName}}.`;return g.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},tj=Xx,nj=Jx,rj=e0,oj=t0,ij=n0,lj=o0,sj=l0,d0=a0,f0="AlertDialog",[aj,SI]=er(f0,[Yx]),wn=Yx(),p0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(tj,{...r,...n,modal:!0})};p0.displayName=f0;var uj="AlertDialogTrigger",cj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(nj,{...o,...r,ref:t})});cj.displayName=uj;var dj="AlertDialogPortal",h0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(rj,{...r,...n})};h0.displayName=dj;var fj="AlertDialogOverlay",m0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(oj,{...o,...r,ref:t})});m0.displayName=fj;var no="AlertDialogContent",[pj,hj]=aj(no),mj=Ub("AlertDialogContent"),g0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=wn(n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return f.jsx(qP,{contentName:no,titleName:y0,docsSlug:"alert-dialog",children:f.jsx(pj,{scope:n,cancelRef:a,children:f.jsxs(ij,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:te(o.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(mj,{children:r}),f.jsx(yj,{contentRef:l})]})})})});g0.displayName=no;var y0="AlertDialogTitle",v0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(lj,{...o,...r,ref:t})});v0.displayName=y0;var x0="AlertDialogDescription",w0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(sj,{...o,...r,ref:t})});w0.displayName=x0;var gj="AlertDialogAction",S0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(d0,{...o,...r,ref:t})});S0.displayName=gj;var k0="AlertDialogCancel",C0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=hj(k0,n),i=wn(n),l=pe(t,o);return f.jsx(d0,{...i,...r,ref:l})});C0.displayName=k0;var yj=({contentRef:e})=>{const t=`\`${no}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${no}\` by passing a \`${x0}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${no}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},vj=p0,xj=h0,b0=m0,E0=g0,N0=S0,P0=C0,j0=v0,T0=w0;const wj=vj,Sj=xj,_0=g.forwardRef(({className:e,...t},n)=>f.jsx(b0,{className:ue("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}));_0.displayName=b0.displayName;const A0=g.forwardRef(({className:e,...t},n)=>f.jsxs(Sj,{children:[f.jsx(_0,{}),f.jsx(E0,{ref:n,className:ue("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})]}));A0.displayName=E0.displayName;const R0=({className:e,...t})=>f.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});R0.displayName="AlertDialogHeader";const I0=({className:e,...t})=>f.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});I0.displayName="AlertDialogFooter";const M0=g.forwardRef(({className:e,...t},n)=>f.jsx(j0,{ref:n,className:ue("text-lg font-semibold",e),...t}));M0.displayName=j0.displayName;const L0=g.forwardRef(({className:e,...t},n)=>f.jsx(T0,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));L0.displayName=T0.displayName;const O0=g.forwardRef(({className:e,...t},n)=>f.jsx(N0,{ref:n,className:ue(kd(),e),...t}));O0.displayName=N0.displayName;const D0=g.forwardRef(({className:e,...t},n)=>f.jsx(P0,{ref:n,className:ue(kd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));D0.displayName=P0.displayName;const z0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:ue("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}));z0.displayName="Textarea";function kj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Cj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ej={};function lh(e,t){return((t||Ej).jsx?bj:Cj).test(e)}const Nj=/[ \t\n\f\r]/g;function Pj(e){return typeof e=="object"?e.type==="text"?sh(e.value):!1:sh(e)}function sh(e){return e.replace(Nj,"")===""}class Bi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bi.prototype.normal={};Bi.prototype.property={};Bi.prototype.space=void 0;function F0(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Bi(n,r,t)}function dc(e){return e.toLowerCase()}class lt{constructor(t,n){this.attribute=n,this.property=t}}lt.prototype.attribute="";lt.prototype.booleanish=!1;lt.prototype.boolean=!1;lt.prototype.commaOrSpaceSeparated=!1;lt.prototype.commaSeparated=!1;lt.prototype.defined=!1;lt.prototype.mustUseProperty=!1;lt.prototype.number=!1;lt.prototype.overloadedBoolean=!1;lt.prototype.property="";lt.prototype.spaceSeparated=!1;lt.prototype.space=void 0;let jj=0;const ee=jr(),Ae=jr(),fc=jr(),B=jr(),ge=jr(),ro=jr(),at=jr();function jr(){return 2**++jj}const pc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Ae,commaOrSpaceSeparated:at,commaSeparated:ro,number:B,overloadedBoolean:fc,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Da=Object.keys(pc);class Vd extends lt{constructor(t,n,r,o){let i=-1;if(super(t,n),ah(this,"space",o),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&Ij.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(uh,Oj);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!uh.test(i)){let l=i.replace(Rj,Lj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Vd}return new o(r,t)}function Lj(e){return"-"+e.toLowerCase()}function Oj(e){return e.charAt(1).toUpperCase()}const Dj=F0([B0,Tj,V0,H0,W0],"html"),Hd=F0([B0,_j,V0,H0,W0],"svg");function zj(e){return e.join(" ").trim()}var Wd={},ch=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Fj=/\n/g,Bj=/^\s*/,$j=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Uj=/^:\s*/,Vj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Hj=/^[;\s]*/,Wj=/^\s+|\s+$/g,Kj=` +`,dh="/",fh="*",ar="",Gj="comment",Qj="declaration",Yj=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(w){var v=w.match(Fj);v&&(n+=v.length);var S=w.lastIndexOf(Kj);r=~S?w.length-S:r+w.length}function i(){var w={line:n,column:r};return function(v){return v.position=new l(w),u(),v}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var v=new Error(t.source+":"+n+":"+r+": "+w);if(v.reason=w,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(w){var v=w.exec(e);if(v){var S=v[0];return o(S),e=e.slice(S.length),v}}function u(){a(Bj)}function c(w){var v;for(w=w||[];v=d();)v!==!1&&w.push(v);return w}function d(){var w=i();if(!(dh!=e.charAt(0)||fh!=e.charAt(1))){for(var v=2;ar!=e.charAt(v)&&(fh!=e.charAt(v)||dh!=e.charAt(v+1));)++v;if(v+=2,ar===e.charAt(v-1))return s("End of comment missing");var S=e.slice(2,v-2);return r+=2,o(S),e=e.slice(v),r+=2,w({type:Gj,comment:S})}}function p(){var w=i(),v=a($j);if(v){if(d(),!a(Uj))return s("property missing ':'");var S=a(Vj),y=w({type:Qj,property:ph(v[0].replace(ch,ar)),value:S?ph(S[0].replace(ch,ar)):ar});return a(Hj),y}}function h(){var w=[];c(w);for(var v;v=p();)v!==!1&&(w.push(v),c(w));return w}return u(),h()};function ph(e){return e?e.replace(Wj,ar):ar}var Xj=Rl&&Rl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wd,"__esModule",{value:!0});Wd.default=Jj;var qj=Xj(Yj);function Jj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,qj.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var l=i.property,s=i.value;o?t(l,s,i):s&&(n=n||{},n[l]=s)}}),n}var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.camelCase=void 0;var Zj=/^--[a-zA-Z0-9_-]+$/,eT=/-([a-z])/g,tT=/^[^-]+$/,nT=/^-(webkit|moz|ms|o|khtml)-/,rT=/^-(ms)-/,oT=function(e){return!e||tT.test(e)||Zj.test(e)},iT=function(e,t){return t.toUpperCase()},hh=function(e,t){return"".concat(t,"-")},lT=function(e,t){return t===void 0&&(t={}),oT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rT,hh):e=e.replace(nT,hh),e.replace(eT,iT))};Qs.camelCase=lT;var sT=Rl&&Rl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},aT=sT(Wd),uT=Qs;function hc(e,t){var n={};return!e||typeof e!="string"||(0,aT.default)(e,function(r,o){r&&o&&(n[(0,uT.camelCase)(r,t)]=o)}),n}hc.default=hc;var cT=hc;const dT=vs(cT),K0=G0("end"),Kd=G0("start");function G0(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 fT(e){const t=Kd(e),n=K0(e);if(t&&n)return{start:t,end:n}}function ni(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mh(e.position):"start"in e||"end"in e?mh(e):"line"in e||"column"in e?mc(e):""}function mc(e){return gh(e&&e.line)+":"+gh(e&&e.column)}function mh(e){return mc(e&&e.start)+"-"+mc(e&&e.end)}function gh(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(l=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?i.ruleId=r:(i.source=r.slice(0,a),i.ruleId=r.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=ni(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Gd={}.hasOwnProperty,pT=new Map,hT=/[A-Z]/g,mT=new Set(["table","tbody","thead","tfoot","tr"]),gT=new Set(["td","th"]),Q0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yT(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=ET(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=bT(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hd:Dj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Y0(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Y0(e,t,n){if(t.type==="element")return vT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return xT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ST(e,t,n);if(t.type==="mdxjsEsm")return wT(e,t);if(t.type==="root")return kT(e,t,n);if(t.type==="text")return CT(e,t)}function vT(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const i=q0(e,t.tagName,!1),l=NT(e,t);let s=Yd(e,t);return mT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!Pj(a):!0})),X0(e,l,i,t),Qd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function xT(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)}Ti(e,t.position)}function wT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ti(e,t.position)}function ST(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Hd,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:q0(e,t.name,!0),l=PT(e,t),s=Yd(e,t);return X0(e,l,i,t),Qd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function kT(e,t,n){const r={};return Qd(r,Yd(e,t)),e.create(t,e.Fragment,r,n)}function CT(e,t){return t.value}function X0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bT(e,t,n){return r;function r(o,i,l,s){const u=Array.isArray(l.children)?n:t;return s?u(i,l,s):u(i,l)}}function ET(e,t){return n;function n(r,o,i,l){const s=Array.isArray(i.children),a=Kd(r);return t(o,i,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function NT(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Gd.call(t.properties,o)){const i=jT(e,o,t.properties[o]);if(i){const[l,s]=i;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&gT.has(t.tagName)?r=s:n[l]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function PT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Ti(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else Ti(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Yd(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:pT;for(;++ro?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i0?(en(e,e.length,0,t),e):t}const xh={}.hasOwnProperty;function OT(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function oo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Gt=rr(/[A-Za-z]/),ft=rr(/[\dA-Za-z]/),FT=rr(/[#-'*+\--9=?A-Z^-~]/);function gc(e){return e!==null&&(e<32||e===127)}const yc=rr(/\d/),BT=rr(/[\dA-Fa-f]/),$T=rr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const UT=rr(/\p{P}|\p{S}/u),VT=rr(/\s/);function rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function No(e){const t=[];let n=-1,r=0,o=0;for(;++n55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(l=String.fromCharCode(i,s),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function xe(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(a){return de(a)?(e.enter(n),s(a)):t(a)}function s(a){return de(a)&&i++l))return;const P=t.events.length;let T=P,F,L;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(F){L=t.events[T][1].end;break}F=!0}for(y(r),b=P;bx;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function m(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function QT(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sh(e){if(e===null||it(e)||VT(e))return 1;if(UT(e))return 2}function qd(e,t,n){const r=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};kh(d,-a),kh(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},i={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),u=St(u,qd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,en(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&de(b)?xe(e,m,"linePrefix",i+1)(b):m(b)}function m(b){return b===null||X(b)?e.check(Ch,v,C)(b):(e.enter("codeFlowValue"),x(b))}function x(b){return b===null||X(b)?(e.exit("codeFlowValue"),m(b)):(e.consume(b),x)}function C(b){return e.exit("codeFenced"),t(b)}function N(b,P,T){let F=0;return L;function L(O){return b.enter("lineEnding"),b.consume(O),b.exit("lineEnding"),R}function R(O){return b.enter("codeFencedFence"),de(O)?xe(b,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_(O)}function _(O){return O===s?(b.enter("codeFencedFenceSequence"),V(O)):T(O)}function V(O){return O===s?(F++,b.consume(O),V):F>=l?(b.exit("codeFencedFenceSequence"),de(O)?xe(b,A,"whitespace")(O):A(O)):T(O)}function A(O){return O===null||X(O)?(b.exit("codeFencedFence"),P(O)):T(O)}}}function l_(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Fa={name:"codeIndented",tokenize:a_},s_={partial:!0,tokenize:u_};function a_(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),xe(e,i,"linePrefix",4+1)(u)}function i(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):X(u)?e.attempt(s_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function u_(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):xe(e,i,"linePrefix",4+1)(l)}function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?o(l):n(l)}}const c_={name:"codeText",previous:f_,resolve:d_,tokenize:p_};function d_(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Fo(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fo(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 o1(e,t,n,r,o,i,l,s,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(y),e.exit(i),p):y===null||y===32||y===41||gc(y)?n(y):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(y))}function p(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||X(y)?n(y):(e.consume(y),y===92?w:h)}function w(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function v(y){return!c&&(y===null||y===41||it(y))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):X(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||X(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!de(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function l1(e,t,n,r,o,i){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===l?(e.exit(i),a(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===l||p===null||X(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 ri(e,t){let n;return r;function r(o){return X(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):de(o)?xe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const S_={name:"definition",tokenize:C_},k_={partial:!0,tokenize:b_};function C_(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),l(h)}function l(h){return i1.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=oo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return it(h)?ri(e,u)(h):u(h)}function u(h){return o1(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(k_,d,d)(h)}function d(h){return de(h)?xe(e,p,"whitespace")(h):p(h)}function p(h){return h===null||X(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function b_(e,t,n){return r;function r(s){return it(s)?ri(e,o)(s):n(s)}function o(s){return l1(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return de(s)?xe(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const E_={name:"hardBreakEscape",tokenize:N_};function N_(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return X(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const P_={name:"headingAtx",resolve:j_,tokenize:T_};function j_(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},en(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function T_(e,t,n){let r=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&r++<6?(e.consume(c),l):c===null||it(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||X(c)?(e.exit("atxHeading"),t(c)):de(c)?xe(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||it(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const __=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Eh=["pre","script","style","textarea"],A_={concrete:!0,name:"htmlFlow",resolveTo:M_,tokenize:L_},R_={partial:!0,tokenize:D_},I_={partial:!0,tokenize:O_};function M_(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 L_(e,t,n){const r=this;let o,i,l,s,a;return u;function u(E){return c(E)}function c(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),p):E===47?(e.consume(E),i=!0,v):E===63?(e.consume(E),o=3,r.interrupt?t:k):Gt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function p(E){return E===45?(e.consume(E),o=2,h):E===91?(e.consume(E),o=5,s=0,w):Gt(E)?(e.consume(E),o=4,r.interrupt?t:k):n(E)}function h(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function w(E){const fe="CDATA[";return E===fe.charCodeAt(s++)?(e.consume(E),s===fe.length?r.interrupt?t:_:w):n(E)}function v(E){return Gt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||it(E)){const fe=E===47,Pe=l.toLowerCase();return!fe&&!i&&Eh.includes(Pe)?(o=1,r.interrupt?t(E):_(E)):__.includes(l.toLowerCase())?(o=6,fe?(e.consume(E),y):r.interrupt?t(E):_(E)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):i?m(E):x(E))}return E===45||ft(E)?(e.consume(E),l+=String.fromCharCode(E),S):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:_):n(E)}function m(E){return de(E)?(e.consume(E),m):L(E)}function x(E){return E===47?(e.consume(E),L):E===58||E===95||Gt(E)?(e.consume(E),C):de(E)?(e.consume(E),x):L(E)}function C(E){return E===45||E===46||E===58||E===95||ft(E)?(e.consume(E),C):N(E)}function N(E){return E===61?(e.consume(E),b):de(E)?(e.consume(E),N):x(E)}function b(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,P):de(E)?(e.consume(E),b):T(E)}function P(E){return E===a?(e.consume(E),a=null,F):E===null||X(E)?n(E):(e.consume(E),P)}function T(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||it(E)?N(E):(e.consume(E),T)}function F(E){return E===47||E===62||de(E)?x(E):n(E)}function L(E){return E===62?(e.consume(E),R):n(E)}function R(E){return E===null||X(E)?_(E):de(E)?(e.consume(E),R):n(E)}function _(E){return E===45&&o===2?(e.consume(E),$):E===60&&o===1?(e.consume(E),H):E===62&&o===4?(e.consume(E),G):E===63&&o===3?(e.consume(E),k):E===93&&o===5?(e.consume(E),D):X(E)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(R_,Q,V)(E)):E===null||X(E)?(e.exit("htmlFlowData"),V(E)):(e.consume(E),_)}function V(E){return e.check(I_,A,Q)(E)}function A(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),O}function O(E){return E===null||X(E)?V(E):(e.enter("htmlFlowData"),_(E))}function $(E){return E===45?(e.consume(E),k):_(E)}function H(E){return E===47?(e.consume(E),l="",j):_(E)}function j(E){if(E===62){const fe=l.toLowerCase();return Eh.includes(fe)?(e.consume(E),G):_(E)}return Gt(E)&&l.length<8?(e.consume(E),l+=String.fromCharCode(E),j):_(E)}function D(E){return E===93?(e.consume(E),k):_(E)}function k(E){return E===62?(e.consume(E),G):E===45&&o===2?(e.consume(E),k):_(E)}function G(E){return E===null||X(E)?(e.exit("htmlFlowData"),Q(E)):(e.consume(E),G)}function Q(E){return e.exit("htmlFlow"),t(E)}}function O_(e,t,n){const r=this;return o;function o(l){return X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function D_(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ys,t,n)}}const z_={name:"htmlText",tokenize:F_};function F_(e,t,n){const r=this;let o,i,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),N):k===63?(e.consume(k),x):Gt(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,w):Gt(k)?(e.consume(k),m):n(k)}function c(k){return k===45?(e.consume(k),h):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):X(k)?(l=d,H(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),h):d(k)}function h(k){return k===62?$(k):k===45?p(k):d(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(i++)?(e.consume(k),i===G.length?v:w):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(l=v,H(k)):(e.consume(k),v)}function S(k){return k===93?(e.consume(k),y):v(k)}function y(k){return k===62?$(k):k===93?(e.consume(k),y):v(k)}function m(k){return k===null||k===62?$(k):X(k)?(l=m,H(k)):(e.consume(k),m)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):X(k)?(l=x,H(k)):(e.consume(k),x)}function C(k){return k===62?$(k):x(k)}function N(k){return Gt(k)?(e.consume(k),b):n(k)}function b(k){return k===45||ft(k)?(e.consume(k),b):P(k)}function P(k){return X(k)?(l=P,H(k)):de(k)?(e.consume(k),P):$(k)}function T(k){return k===45||ft(k)?(e.consume(k),T):k===47||k===62||it(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),$):k===58||k===95||Gt(k)?(e.consume(k),L):X(k)?(l=F,H(k)):de(k)?(e.consume(k),F):$(k)}function L(k){return k===45||k===46||k===58||k===95||ft(k)?(e.consume(k),L):R(k)}function R(k){return k===61?(e.consume(k),_):X(k)?(l=R,H(k)):de(k)?(e.consume(k),R):F(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,V):X(k)?(l=_,H(k)):de(k)?(e.consume(k),_):(e.consume(k),A)}function V(k){return k===o?(e.consume(k),o=void 0,O):k===null?n(k):X(k)?(l=V,H(k)):(e.consume(k),V)}function A(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||it(k)?F(k):(e.consume(k),A)}function O(k){return k===47||k===62||it(k)?F(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),j}function j(k){return de(k)?xe(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):D(k)}function D(k){return e.enter("htmlTextData"),l(k)}}const Jd={name:"labelEnd",resolveAll:V_,resolveTo:H_,tokenize:W_},B_={tokenize:K_},$_={tokenize:G_},U_={tokenize:Q_};function V_(e){let t=-1;const n=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),de(u)?xe(e,s,"whitespace")(u):s(u))}}const Ze={continuation:{tokenize:oA},exit:lA,name:"list",tokenize:rA},tA={partial:!0,tokenize:sA},nA={partial:!0,tokenize:iA};function rA(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return s;function s(h){const w=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:yc(h)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(_l,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return yc(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ys,r.interrupt?n:c,e.attempt(tA,p,d))}function c(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function d(h){return de(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function oA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ys,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!de(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(nA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(Ze,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function iA(e,t,n){const r=this;return xe(e,o,"listItemIndent",r.containerState.size+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function lA(e){e.exit(this.containerState.type)}function sA(e,t,n){const r=this;return xe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function o(i){const l=r.events[r.events.length-1];return!de(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Nh={name:"setextUnderline",resolveTo:aA,tokenize:uA};function aA(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function uA(e,t,n){const r=this;let o;return i;function i(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"),o=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===o?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),de(u)?xe(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const cA={tokenize:dA};function dA(e){const t=this,n=e.attempt(Ys,r,e.attempt(this.parser.constructs.flowInitial,o,xe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(g_,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const fA={resolveAll:a1()},pA=s1("string"),hA=s1("text");function s1(e){return{resolveAll:a1(e==="text"?mA:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,s);return l;function l(c){return u(c)?i(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"),i(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let p=-1;if(d)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function jA(e,t){let n=-1;const r=[];let o;for(;++n0){const Pt=Z.tokenStack[Z.tokenStack.length-1];(Pt[1]||jh).call(Z,void 0,Pt[0])}for(U.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 WA(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 KA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function d1(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function GA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d1(e,t);const o={src:No(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function QA(e,t){const n={src:No(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 YA(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 XA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d1(e,t);const o={href:No(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function qA(e,t){const n={href:No(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 JA(e,t,n){const r=e.all(t),o=n?ZA(n):f1(t),i={},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:[]}),i.className=["task-list-item"]}let s=-1;for(;++s1}function eR(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Kd(t.children[1]),a=K0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function iR(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Ah(t.slice(o),o>0,!1)),i.join("")}function Ah(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Th||i===_h;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Th||i===_h;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function aR(e,t){const n={type:"text",value:sR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cR={blockquote:FA,break:BA,code:$A,delete:UA,emphasis:VA,footnoteReference:HA,heading:WA,html:KA,imageReference:GA,image:QA,inlineCode:YA,linkReference:XA,link:qA,listItem:JA,list:eR,paragraph:tR,root:nR,strong:rR,table:oR,tableCell:lR,tableRow:iR,text:aR,thematicBreak:uR,toml:fl,yaml:fl,definition:fl,footnoteDefinition:fl};function fl(){}const p1=-1,Xs=0,oi=1,gs=2,Zd=3,ef=4,tf=5,nf=6,h1=7,m1=8,Rh=typeof self=="object"?self:globalThis,dR=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case Xs:case p1:return n(l,o);case oi:{const s=n([],o);for(const a of l)s.push(r(a));return s}case gs:{const s=n({},o);for(const[a,u]of l)s[r(a)]=r(u);return s}case Zd:return n(new Date(l),o);case ef:{const{source:s,flags:a}=l;return n(new RegExp(s,a),o)}case tf:{const s=n(new Map,o);for(const[a,u]of l)s.set(r(a),r(u));return s}case nf:{const s=n(new Set,o);for(const a of l)s.add(r(a));return s}case h1:{const{name:s,message:a}=l;return n(new Rh[s](a),o)}case m1:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Rh[i](l),o)};return r},Ih=e=>dR(new Map,e)(0),Mr="",{toString:fR}={},{keys:pR}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[Xs,t];const n=fR.call(e).slice(8,-1);switch(n){case"Array":return[oi,Mr];case"Object":return[gs,Mr];case"Date":return[Zd,Mr];case"RegExp":return[ef,Mr];case"Map":return[tf,Mr];case"Set":return[nf,Mr];case"DataView":return[oi,n]}return n.includes("Array")?[oi,n]:n.includes("Error")?[h1,n]:[gs,n]},pl=([e,t])=>e===Xs&&(t==="function"||t==="symbol"),hR=(e,t,n,r)=>{const o=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},i=l=>{if(n.has(l))return n.get(l);let[s,a]=Bo(l);switch(s){case Xs:{let c=l;switch(a){case"bigint":s=m1,c=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return o([p1],l)}return o([s,c],l)}case oi:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),o([a,[...p]],l)}const c=[],d=o([s,c],l);for(const p of l)c.push(i(p));return d}case gs:{if(a)switch(a){case"BigInt":return o([a,l.toString()],l);case"Boolean":case"Number":case"String":return o([a,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const c=[],d=o([s,c],l);for(const p of pR(l))(e||!pl(Bo(l[p])))&&c.push([i(p),i(l[p])]);return d}case Zd:return o([s,l.toISOString()],l);case ef:{const{source:c,flags:d}=l;return o([s,{source:c,flags:d}],l)}case tf:{const c=[],d=o([s,c],l);for(const[p,h]of l)(e||!(pl(Bo(p))||pl(Bo(h))))&&c.push([i(p),i(h)]);return d}case nf:{const c=[],d=o([s,c],l);for(const p of l)(e||!pl(Bo(p)))&&c.push(i(p));return d}}const{message:u}=l;return o([s,{name:a,message:u}],l)};return i},Mh=(e,{json:t,lossy:n}={})=>{const r=[];return hR(!(t||n),!!t,new Map,r)(e),r},ys=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ih(Mh(e,t)):structuredClone(e):(e,t)=>Ih(Mh(e,t));function mR(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 gR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mR,r=e.options.footnoteBackLabel||gR,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let m=typeof n=="string"?n:n(a,h);typeof m=="string"&&(m={type:"text",value:m}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const m=S.children[S.children.length-1];m&&m.type==="text"?m.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else c.push(...w);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ys(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const g1=function(e){if(e==null)return SR;if(typeof e=="function")return qs(e);if(typeof e=="object")return Array.isArray(e)?vR(e):xR(e);if(typeof e=="string")return wR(e);throw new Error("Expected function, string, or object as test")};function vR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=y1,w,v,S;if((!t||i(a,u,c[c.length-1]||void 0))&&(h=NR(n(a,c)),h[0]===Lh))return h;if("children"in a&&a.children){const y=a;if(y.children&&h[0]!==bR)for(v=(r?y.children.length:-1)+l,S=c.concat(y);v>-1&&v0&&n.push({type:"text",value:` +`}),n}function Oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Dh(e,t){const n=jR(e,t),r=n.one(e,void 0),o=yR(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:` +`},o),i}function IR(e,t){return e&&"run"in e?async function(n,r){const o=Dh(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Dh(n,{file:r,...e||t})}}function zh(e){if(e)throw e}var Al=Object.prototype.hasOwnProperty,x1=Object.prototype.toString,Fh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,$h=function(t){return typeof Array.isArray=="function"?Array.isArray(t):x1.call(t)==="[object Array]"},Uh=function(t){if(!t||x1.call(t)!=="[object Object]")return!1;var n=Al.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Al.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Al.call(t,o)},Vh=function(t,n){Fh&&n.name==="__proto__"?Fh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Hh=function(t,n){if(n==="__proto__")if(Al.call(t,n)){if(Bh)return Bh(t,n).value}else return;return t[n]},MR=function e(){var t,n,r,o,i,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(o);try{a=e.apply(this,l)}catch(u){const c=u;if(s&&n)throw c;return o(c)}s||(a&&a.then&&typeof a.then=="function"?a.then(i,o):a instanceof Error?o(a):i(a))}function o(l,...s){n||(n=!0,t(l,...s))}function i(l){o(null,l)}}const Ht={basename:DR,dirname:zR,extname:FR,join:BR,sep:"/"};function DR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$i(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function zR(e){if($i(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 FR(e){$i(e);let t=e.length,n=-1,r=0,o=-1,i=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function BR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function UR(e,t){let n="",r=0,o=-1,i=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else s===46&&i>-1?i++:i=-1}return n}function $i(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VR={cwd:HR};function HR(){return"/"}function Sc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function WR(e){if(typeof e=="string")e=new URL(e);else if(!Sc(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 KR(e)}function KR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...w]=c;const v=r[p][1];wc(v)&&wc(h)&&(h=$a(!0,v,h)),r[p]=[u,h,...w]}}}}const XR=new rf().freeze();function Wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ga(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 Kh(e){if(!wc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return qR(e)?e:new w1(e)}function qR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function JR(e){return typeof e=="string"||ZR(e)}function ZR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Qh=[],Yh={allowDangerousHtml:!0},tI=/^(https?|ircs?|mailto|xmpp)$/i,nI=[{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 rI(e){const t=oI(e),n=iI(e);return lI(t.runSync(t.parse(n),n),e)}function oI(e){const t=e.rehypePlugins||Qh,n=e.remarkPlugins||Qh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yh}:Yh;return XR().use(zA).use(n).use(IR,r).use(t)}function iI(e){const t=e.children||"",n=new w1;return typeof t=="string"&&(n.value=t),n}function lI(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||sI;for(const c of nI)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+eI+c.id,void 0);return v1(e,u),yT(e,{Fragment:f.Fragment,components:o,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 h;for(h in za)if(Object.hasOwn(za,h)&&Object.hasOwn(c.properties,h)){const w=c.properties[h],v=za[h];(v===null||v.includes(c.tagName))&&(c.properties[h]=a(String(w||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):i?i.includes(c.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(c,d,p)),h&&p&&typeof d=="number")return s&&c.children?p.children.splice(d,1,...c.children):p.children.splice(d,1),d}}}function sI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||tI.test(e.slice(0,t))?e:""}const S1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:o,isGenerating:i,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:ue("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:ue("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(ti,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:ue("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(rI,{components:{p:({children:h})=>f.jsx("p",{className:"mb-2 last:mb-0",children:h}),ul:({children:h})=>f.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:h}),ol:({children:h})=>f.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:h}),li:({children:h})=>f.jsx("li",{className:"mb-1",children:h}),code:({children:h,className:w})=>!w?f.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:h}):f.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:h}),pre:({children:h})=>f.jsx("div",{className:"mb-2 last:mb-0",children:h}),strong:({children:h})=>f.jsx("strong",{className:"font-semibold",children:h}),em:({children:h})=>f.jsx("em",{className:"italic",children:h}),blockquote:({children:h})=>f.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:h}),h1:({children:h})=>f.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:h}),h2:({children:h})=>f.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:h}),h3:({children:h})=>f.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:h})},children: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(Ly,{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:o,className:"flex gap-2",children:[f.jsx(z0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),o(d))}}),i?f.jsx(De,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(Pb,{className:"h-4 w-4"})}):f.jsx(De,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(xb,{className:"h-4 w-4"})})]})})]})});S1.displayName="Chat";const Ut={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function k1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function aI(){return k1()}class uI{getAllSessions(){const t=localStorage.getItem(Ut.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const o={id:k1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},i=this.getAllSessions();return i.unshift(o),localStorage.setItem(Ut.sessions,JSON.stringify(i)),o}updateSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);o!==-1&&(r[o]={...r[o],...n,updatedAt:Date.now()},localStorage.setItem(Ut.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(o=>o.id!==t);localStorage.setItem(Ut.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Ut.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);if(o!==-1){const i={...n,id:aI(),timestamp:Date.now()};r[o].messages.push(i),r[o].updatedAt=Date.now(),localStorage.setItem(Ut.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Ut.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Ut.currentSession,t)}clear(){localStorage.removeItem(Ut.sessions),localStorage.removeItem(Ut.currentSession)}}const je=new uI;function cI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[o,i]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[c,d]=g.useState({isLoading:!1,error:null}),[p,h]=g.useState(n),[w,v]=g.useState(r),[S,y]=g.useState(.7),[m,x]=g.useState(1024),C=Rt.useMemo(()=>{var O;const A=o.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!A,messageCount:((O=A==null?void 0:A.messages)==null?void 0:O.length)||0,sessionTitle:(A==null?void 0:A.title)||"No session"}),A},[o,l]),N=Rt.useMemo(()=>{const A=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",A.length,A.map(O=>({id:O.id,role:O.role}))),A},[C==null?void 0:C.messages]);g.useEffect(()=>{const A=je.getAllSessions();i(A);const O=je.getCurrentSession();O?s(O.id):A.length>0&&(s(A[0].id),je.setCurrentSession(A[0].id))},[]);const b=g.useCallback(()=>{const A=je.createSession(void 0,p,w),O=je.getAllSessions();return i([...O]),s(A.id),je.setCurrentSession(A.id),A.id},[p,w]),P=g.useCallback(A=>{console.log("selectSession called with:",A),s(A),je.setCurrentSession(A),console.log("currentSessionId updated to:",A)},[]),T=g.useCallback(A=>{je.deleteSession(A);const O=je.getAllSessions();i([...O]),l===A&&(O.length>0?(s(O[0].id),je.setCurrentSession(O[0].id)):s(null))},[l]),F=g.useCallback((A,O)=>{je.updateSession(A,{title:O});const $=je.getAllSessions();i([...$])},[]),L=g.useCallback(A=>{if(!l)return;je.addMessageToSession(l,A);const O=je.getAllSessions();i([...O])},[l]),R=g.useCallback(async()=>{var $,H;if(!a.trim()||c.isLoading)return;let A=l;A||(A=b());const O=a.trim();if(u(""),d({isLoading:!0,error:null}),A){je.addMessageToSession(A,{role:"user",content:O});const j=je.getAllSessions();i([...j])}try{const j=je.getSession(A),D=((H=($=j==null?void 0:j.messages)==null?void 0:$.filter(Q=>Q.role!=="system"))==null?void 0:H.map(Q=>({role:Q.role,content:Q.content})))||[],k=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:O,messages:D,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:m})});if(!k.ok){const Q=await k.json();throw new Error(Q.detail||`HTTP error! status: ${k.status}`)}const G=await k.json();if(A){je.addMessageToSession(A,{role:"assistant",content:G.content,thinking_content:G.thinking_content,model_used:G.model_used,supports_thinking:G.supports_thinking});const Q=je.getAllSessions();i([...Q])}d({isLoading:!1,error:null})}catch(j){const D=j instanceof Error?j.message:"An error occurred";if(d({isLoading:!1,error:D}),A){je.addMessageToSession(A,{role:"assistant",content:`Sorry, I encountered an error: ${D}`});const k=je.getAllSessions();i([...k])}}},[a,c.isLoading,l,b,L,w,N.length,t,p,S,m]),_=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),V=g.useCallback(()=>{je.clear(),i([]),s(null)},[]);return{sessions:o,currentSession:C,currentSessionId:l,createNewSession:b,selectSession:P,deleteSession:T,renameSession:F,clearAllSessions:V,messages:N,input:a,setInput:u,sendMessage:R,stopGeneration:_,isLoading:c.isLoading,error:c.error,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:y,maxTokens:m,setMaxTokens:x}}function dI(){var oe;const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:o,deleteSession:i,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:c,isLoading:d,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:y,maxTokens:m,setMaxTokens:x}=cI(),[C,N]=g.useState(!1),[b,P]=g.useState(!1),[T,F]=g.useState(null),[L,R]=g.useState(!1),[_,V]=g.useState(null),[A,O]=g.useState([]),[$,H]=g.useState([]),j=()=>{try{const M=JSON.parse(localStorage.getItem("savedAssistants")||"[]");H(M)}catch(M){console.error("Failed to load saved assistants:",M)}},D=()=>{if(!w.trim())return;const M={id:Date.now().toString(),name:w.substring(0,50)+(w.length>50?"...":""),systemPrompt:w,temperature:S,maxTokens:m,model:p,createdAt:new Date().toISOString()},W=[...$,M];H(W),localStorage.setItem("savedAssistants",JSON.stringify(W))},k=M=>{const W=$.find(J=>J.id===M);W&&(v(W.systemPrompt),y(W.temperature),x(W.maxTokens),W.model&&h(W.model))},G=[{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."}],Q=M=>{const W=G.find(J=>J.name===M);W&&v(W.prompt)};g.useEffect(()=>{Pe(),j()},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:C,configCollapsed:b,sessionsCount:e.length,currentSessionId:n})},[C,b,e.length,n]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(M=>({id:M.id,title:M.title})))},[e]),g.useEffect(()=>{if(p&&!A.find(M=>M.model_name===p)){const M=A[0];M&&h(M.model_name)}},[A,p,h]),g.useEffect(()=>{(async()=>{if(!p||!A.length)return;const W=A.find(Y=>Y.model_name===p);if(!W)return;const J=`${window.location.protocol}//${window.location.host}`;if(W.type==="local"&&!W.is_loaded){V(W),R(!0);return}const q=A.filter(Y=>Y.type==="local"&&Y.is_loaded&&Y.model_name!==p);for(const Y of q)try{(await fetch(`${J}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Y.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Y.model_name}`)}catch(se){console.error(`Error auto-unloading model ${Y.model_name}:`,se)}q.length>0&&Pe()})()},[p,A]);const E=async()=>{if(_){R(!1),F(_.model_name);try{const M=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${M}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:_.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${_.model_name}`),Pe();else{console.error(`❌ Failed to load model: ${_.model_name}`);const J=A.find(q=>q.type==="api");J&&h(J.model_name)}}catch(M){console.error("Error loading model:",M);const W=A.find(J=>J.type==="api");W&&h(W.model_name)}finally{F(null),V(null)}}},fe=()=>{R(!1),V(null);const M=A.find(W=>W.type==="api");M&&h(M.model_name)};g.useEffect(()=>{const M=async()=>{const W=`${window.location.protocol}//${window.location.host}`,J=A.filter(q=>q.type==="local"&&q.is_loaded);for(const q of J)try{await fetch(`${W}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:q.model_name})}),console.log(`✅ Cleanup: unloaded ${q.model_name}`)}catch(Y){console.error(`Error cleaning up model ${q.model_name}:`,Y)}};return()=>{M()}},[A]);const Pe=async()=>{try{const M=`${window.location.protocol}//${window.location.host}`,W=await fetch(`${M}/models`);if(W.ok){const J=await W.json();if(O(J.models),J.current_model&&p!==J.current_model)h(J.current_model);else if(!p&&J.models.length>0){const Y=J.models.find(se=>se.type==="api")||J.models[0];h(Y.model_name)}}}catch(M){console.error("Failed to fetch models:",M)}};return f.jsxs("div",{className:"h-screen bg-background flex",children:[f.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${C?"w-12":"w-80"} + `,children:f.jsxs("div",{className:"p-4 space-y-4 h-full",children:[f.jsxs("div",{className:`flex items-center ${C?"justify-center":"justify-between"}`,children:[!C&&f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs("div",{className:"flex gap-1",children:[!C&&f.jsxs(De,{onClick:r,size:"sm",children:[f.jsx(_p,{className:"h-4 w-4 mr-1"}),"New"]}),f.jsx(De,{onClick:()=>N(!C),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:C?"Expand Sessions":"Collapse Sessions",children:C?f.jsx(Tp,{className:"h-4 w-4"}):f.jsx(jp,{className:"h-4 w-4"})})]})]}),C&&f.jsx(De,{onClick:r,size:"sm",variant:"ghost",className:"w-full p-2",children:f.jsx(_p,{className:"h-4 w-4"})}),f.jsxs("div",{className:"space-y-2",children:[!C&&e.map(M=>f.jsxs(bt,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===M.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",M.id,M.title),o(M.id)},children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:M.title}),f.jsx(De,{size:"sm",variant:"ghost",onClick:W=>{W.stopPropagation(),i(M.id)},className:"h-6 w-6 p-0",children:f.jsx(Iy,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[M.messages.length," messages"]})]},M.id)),C&&e.map(M=>f.jsxs(De,{variant:n===M.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:M.title,onClick:()=>{console.log("Session icon clicked:",M.id,M.title),o(M.id)},children:[f.jsx(ls,{className:"h-4 w-4"}),M.messages&&M.messages.length>0&&f.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(M.messages.length,9)})]},M.id))]})]})}),f.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 flex-shrink-0",children:f.jsxs("div",{className:"flex h-14 items-center justify-between px-6",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(ls,{className:"h-5 w-5 text-blue-600"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Assistant Studio"}),t&&f.jsxs(ye,{variant:"secondary",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[p&&f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:((oe=p.split("/").pop())==null?void 0:oe.split("-")[0])||p})]}),f.jsxs(ye,{variant:"outline",className:"text-xs",children:[e.length," Sessions"]})]})]})}),f.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:f.jsx(S1,{messages:l.map(M=>({id:M.id,role:M.role,content:M.content,createdAt:new Date(M.timestamp)})),input:s,handleInputChange:M=>a(M.target.value),handleSubmit:async M=>{M.preventDefault(),!(!p||!A.find(W=>W.model_name===p))&&await u()},isGenerating:d,stop:c,className:"flex-1"})}),f.jsxs("div",{className:` + border-l bg-muted/30 flex flex-col h-full flex-shrink-0 transition-all duration-300 ease-in-out + ${b?"w-12":"w-[480px] xl:w-[520px]"} + `,children:[f.jsxs("div",{className:`flex items-center gap-3 p-6 border-b ${b?"justify-center":""}`,children:[!b&&f.jsxs(f.Fragment,{children:[f.jsx(ss,{className:"h-6 w-6"}),f.jsx("h2",{className:"font-semibold text-xl",children:"Configuration"})]}),f.jsx(De,{onClick:()=>P(!b),size:"sm",variant:"ghost",className:`h-8 w-8 p-0 hover:bg-gray-100 ${b?"":"ml-auto"}`,title:b?"Expand Configuration":"Collapse Configuration",children:b?f.jsx(jp,{className:"h-4 w-4"}):f.jsx(Tp,{className:"h-4 w-4"})})]}),!b&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"p-4 border-b bg-white",children:f.jsx(pI,{savedAssistants:$,loadSavedAssistant:k,saveAssistant:D,presets:G,onPresetSelect:Q,isLoading:d})}),f.jsxs(bE,{defaultValue:"parameters",className:"flex-1 flex flex-col",children:[f.jsxs(ov,{className:"grid w-full grid-cols-2 m-4 mb-0",children:[f.jsxs(Yu,{value:"parameters",className:"flex items-center gap-2",children:[f.jsx(Eb,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),f.jsxs(Yu,{value:"instructions",className:"flex items-center gap-2",children:[f.jsx(ss,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsx(Xu,{value:"parameters",className:"p-6 space-y-6 m-0",children:f.jsx(fI,{models:A,selectedModel:p,setSelectedModel:h,autoLoadingModel:T,temperature:S,setTemperature:y,maxTokens:m,setMaxTokens:x})}),f.jsx(Xu,{value:"instructions",className:"p-6 space-y-6 m-0",children:f.jsx(hI,{systemPrompt:w,setSystemPrompt:v,isLoading:d})})]})]})]})]})]})]}),f.jsx(wj,{open:L,onOpenChange:R,children:f.jsxs(A0,{children:[f.jsxs(R0,{children:[f.jsx(M0,{children:"Load Local Model"}),f.jsxs(L0,{children:["Loading ",f.jsx("strong",{children:_==null?void 0:_.name})," will use approximately ",f.jsx("strong",{children:_==null?void 0:_.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),f.jsxs(I0,{children:[f.jsx(D0,{onClick:fe,children:"Cancel"}),f.jsx(O0,{onClick:E,children:"Load Model"})]})]})})]})}function fI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:o,setTemperature:i,maxTokens:l,setMaxTokens:s}){return f.jsxs(f.Fragment,{children:[f.jsxs(bt,{children:[f.jsx(dn,{children:f.jsx(fn,{className:"text-base",children:"Model"})}),f.jsx(qt,{className:"space-y-4",children:f.jsx("div",{children:f.jsxs(Hx,{value:t||"",onValueChange:n,children:[f.jsx(zd,{className:"w-full",children:f.jsx(Wx,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(c=>c.model_name===t);if(!a)return t;const u=a.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[u?f.jsx(is,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?f.jsx(bi,{className:"h-4 w-4 text-purple-500"}):f.jsx(Gu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:a.name}),r===t?f.jsx(ye,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(ye,{variant:"outline",className:"text-xs",children:u?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(Fd,{children:[f.jsxs(hs,{children:[f.jsx(Pi,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>f.jsx(ji,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(is,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:a.name}),f.jsx(ye,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),f.jsxs(hs,{children:[f.jsx(Pi,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>f.jsx(ji,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?f.jsx(bi,{className:"h-4 w-4 text-purple-500"}):f.jsx(Gu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:a.name}),r===a.model_name?f.jsx(ye,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?f.jsx(ye,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(ye,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})})})]}),f.jsxs(bt,{children:[f.jsx(dn,{children:f.jsx(fn,{className:"text-base",children:"Parameters"})}),f.jsxs(qt,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs(un,{className:"text-sm font-medium mb-3 block",children:["Temperature: ",o]}),f.jsx(ec,{value:[o],onValueChange:a=>i(a[0]),max:2,min:0,step:.1,className:"w-full"}),f.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mt-1",children:[f.jsx("span",{children:"Lower = more focused"}),f.jsx("span",{children:"Higher = more creative"})]})]}),f.jsxs("div",{children:[f.jsxs(un,{className:"text-sm font-medium mb-3 block",children:["Max Tokens: ",l]}),f.jsx(ec,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full"})]})]})]})]})}function pI({savedAssistants:e,loadSavedAssistant:t,saveAssistant:n,presets:r,onPresetSelect:o,isLoading:i}){const l=a=>{if(a.startsWith("user_")){const u=a.replace("user_","");t(u)}else o(a)},s=e.length+r.length;return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(un,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),f.jsxs(Hx,{value:"",onValueChange:l,children:[f.jsx(zd,{className:"w-full",children:f.jsx(Wx,{placeholder:`Choose assistant (${s} available)`,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ti,{className:"h-4 w-4"}),f.jsx("span",{children:"Choose assistant"}),f.jsx(ye,{variant:"outline",className:"text-xs ml-auto",children:s})]})})}),f.jsxs(Fd,{children:[e.length>0&&f.jsxs(hs,{children:[f.jsxs(Pi,{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(Ly,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(a=>f.jsx(ji,{value:`user_${a.id}`,children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(ti,{className:"h-4 w-4 text-blue-600"}),f.jsx("span",{className:"truncate flex-1",children:a.name}),f.jsx(ye,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${a.id}`))]}),r.length>0&&f.jsxs(hs,{children:[f.jsxs(Pi,{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(UC,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(a=>f.jsx(ji,{value:a.name,children:f.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f.jsx(ti,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"truncate flex-1",children:a.name}),f.jsx(ye,{variant:"outline",className:"text-xs",children:"Template"})]})},a.name))]}),s===0&&f.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),f.jsxs(De,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:i,children:[f.jsx(gb,{className:"h-4 w-4 mr-2"}),"Save Current Assistant"]})]})}function hI({systemPrompt:e,setSystemPrompt:t,isLoading:n}){return f.jsxs(bt,{children:[f.jsx(dn,{children:f.jsx(fn,{className:"text-base",children:"Instructions"})}),f.jsx(qt,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsx(un,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),f.jsx("textarea",{value:e,onChange:r=>t(r.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-[300px] 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:n})]})})]})}function mI(){const e=xd(),[t,n]=g.useState([]),[r,o]=g.useState(!0),[i,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{o(!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(Ku,{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(jy,{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(De,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(Gu,{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(bt,{className:"bg-blue-50 border-blue-200",children:f.jsx(qt,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Ry,{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(is,{className:"h-5 w-5"}),"API Models",f.jsx(ye,{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(Xh,{model:c,modelLoading:i,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(Ay,{className:"h-5 w-5"}),"Local Models",f.jsx(ye,{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(Xh,{model:c,modelLoading:i,onLoad:a,onUnload:u},c.model_name))})]})]})})]})}function Xh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const o=e.type==="api",i=t===e.model_name,l=e.is_loaded;return f.jsxs(bt,{className:"hover:shadow-md transition-shadow",children:[f.jsx(dn,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(fn,{className:"text-base flex items-center gap-2",children:[o?f.jsx(is,{className:"h-4 w-4 text-blue-600"}):f.jsx(Ay,{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(ZC,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(qt,{className:"space-y-3",children:[f.jsxs("div",{className:"space-y-2 text-sm",children:[!o&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Size:"}),f.jsx(ye,{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(ye,{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(ye,{variant:o?"default":"secondary",className:"text-xs",children:o?"API":"Local"})]}),e.supports_thinking&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Features:"}),f.jsxs(ye,{variant:"outline",className:"text-xs",children:[f.jsx(bi,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),f.jsx("div",{className:"pt-2",children:l?f.jsxs(De,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Ku,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(Iy,{className:"h-4 w-4 mr-2"}),i?"Unloading...":"Unload Model"]}):f.jsxs(De,{size:"sm",onClick:()=>n(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Ku,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(rb,{className:"h-4 w-4 mr-2"}),i?"Loading...":"Load Model"]})})]})]})}function gI(){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(ss,{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(bt,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(Sb,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(qt,{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(un,{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(un,{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(bt,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(Rp,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(qt,{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(Rp,{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(bt,{children:[f.jsx(dn,{children:f.jsxs(fn,{className:"flex items-center gap-2",children:[f.jsx(Ry,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(qt,{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(un,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(ye,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(un,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(ye,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function yI(){return f.jsx(eC,{children:f.jsx(Gk,{children:f.jsxs(Lr,{path:"/",element:f.jsx(zb,{}),children:[f.jsx(Lr,{index:!0,element:f.jsx(Yb,{})}),f.jsx(Lr,{path:"playground",element:f.jsx(dI,{})}),f.jsx(Lr,{path:"models",element:f.jsx(mI,{})}),f.jsx(Lr,{path:"settings",element:f.jsx(gI,{})})]})})})}Qa.createRoot(document.getElementById("root")).render(f.jsx(Rt.StrictMode,{children:f.jsx(yI,{})})); +//# sourceMappingURL=index-0547e203.js.map