diff --git a/dist/assets/index-CQjkNPEp.js b/dist/assets/index-CQjkNPEp.js new file mode 100644 index 0000000..c4f73aa --- /dev/null +++ b/dist/assets/index-CQjkNPEp.js @@ -0,0 +1,73 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vc={exports:{}},Mo={},Qc={exports:{}},Y={};/** + * @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 sl=Symbol.for("react.element"),kh=Symbol.for("react.portal"),Eh=Symbol.for("react.fragment"),Ch=Symbol.for("react.strict_mode"),Nh=Symbol.for("react.profiler"),_h=Symbol.for("react.provider"),Lh=Symbol.for("react.context"),jh=Symbol.for("react.forward_ref"),Ph=Symbol.for("react.suspense"),Th=Symbol.for("react.memo"),Rh=Symbol.for("react.lazy"),hu=Symbol.iterator;function $h(e){return e===null||typeof e!="object"?null:(e=hu&&e[hu]||e["@@iterator"],typeof e=="function"?e:null)}var Kc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yc=Object.assign,Gc={};function cr(e,t,n){this.props=e,this.context=t,this.refs=Gc,this.updater=n||Kc}cr.prototype.isReactComponent={};cr.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")};cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jc(){}Jc.prototype=cr.prototype;function Us(e,t,n){this.props=e,this.context=t,this.refs=Gc,this.updater=n||Kc}var Bs=Us.prototype=new Jc;Bs.constructor=Us;Yc(Bs,cr.prototype);Bs.isPureReactComponent=!0;var mu=Array.isArray,Xc=Object.prototype.hasOwnProperty,Hs={current:null},Zc={key:!0,ref:!0,__self:!0,__source:!0};function qc(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Xc.call(t,r)&&!Zc.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,ee=L[Z];if(0>>1;Zl(Rn,b))Hel(V,Rn)?(L[Z]=V,L[He]=b,Z=He):(L[Z]=Rn,L[yt]=b,Z=yt);else if(Hel(V,b))L[Z]=V,L[He]=b,Z=He;else break e}}return D}function l(L,D){var b=L.sortIndex-D.sortIndex;return b!==0?b:L.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var a=[],u=[],h=1,y=null,w=3,x=!1,E=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(L){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=L)r(u),D.sortIndex=D.expirationTime,t(a,D);else break;D=n(u)}}function C(L){if(N=!1,p(L),!E)if(n(a)!==null)E=!0,M(T);else{var D=n(u);D!==null&&z(C,D.startTime-L)}}function T(L,D){E=!1,N&&(N=!1,m(A),A=-1),x=!0;var b=w;try{for(p(D),y=n(a);y!==null&&(!(y.expirationTime>D)||L&&!ne());){var Z=y.callback;if(typeof Z=="function"){y.callback=null,w=y.priorityLevel;var ee=Z(y.expirationTime<=D);D=e.unstable_now(),typeof ee=="function"?y.callback=ee:y===n(a)&&r(a),p(D)}else r(a);y=n(a)}if(y!==null)var at=!0;else{var yt=n(u);yt!==null&&z(C,yt.startTime-D),at=!1}return at}finally{y=null,w=b,x=!1}}var $=!1,O=null,A=-1,H=5,B=-1;function ne(){return!(e.unstable_now()-BL||125Z?(L.sortIndex=b,t(u,L),n(a)===null&&L===n(u)&&(N?(m(A),A=-1):N=!0,z(C,b-Z))):(L.sortIndex=ee,t(a,L),E||x||(E=!0,M(T))),L},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(L){var D=w;return function(){var b=w;w=D;try{return L.apply(this,arguments)}finally{w=b}}}})(lf);rf.exports=lf;var Wh=rf.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 bh=v,qe=Wh;function P(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"),Hi=Object.prototype.hasOwnProperty,Vh=/^[: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]*$/,vu={},yu={};function Qh(e){return Hi.call(yu,e)?!0:Hi.call(vu,e)?!1:Vh.test(e)?yu[e]=!0:(vu[e]=!0,!1)}function Kh(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 Yh(e,t,n,r){if(t===null||typeof t>"u"||Kh(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 Be(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Be(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){je[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var bs=/[\-:]([a-z])/g;function Vs(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(bs,Vs);je[t]=new Be(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(bs,Vs);je[t]=new Be(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(bs,Vs);je[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qs(e,t,n,r){var l=je.hasOwnProperty(t)?je[t]:null;(l!==null?l.type!==0:r||!(2s||l[i]!==o[s]){var a=` +`+l[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=s);break}}}finally{fi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pr(e):""}function Gh(e){switch(e.tag){case 5:return Pr(e.type);case 16:return Pr("Lazy");case 13:return Pr("Suspense");case 19:return Pr("SuspenseList");case 0:case 2:case 15:return e=di(e.type,!1),e;case 11:return e=di(e.type.render,!1),e;case 1:return e=di(e.type,!0),e;default:return""}}function Qi(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 Un:return"Fragment";case Dn:return"Portal";case Wi:return"Profiler";case Ks:return"StrictMode";case bi:return"Suspense";case Vi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case af:return(e.displayName||"Context")+".Consumer";case sf:return(e._context.displayName||"Context")+".Provider";case Ys:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gs:return t=e.displayName||null,t!==null?t:Qi(e.type)||"Memo";case bt:t=e._payload,e=e._init;try{return Qi(e(t))}catch{}}return null}function Jh(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 Qi(t);case 8:return t===Ks?"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 ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xh(e){var t=cf(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 l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ll(e){e._valueTracker||(e._valueTracker=Xh(e))}function ff(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function io(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 Ki(e,t){var n=t.checked;return pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Su(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(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 df(e,t){t=t.checked,t!=null&&Qs(e,"checked",t,!1)}function Yi(e,t){df(e,t);var n=ln(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")?Gi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gi(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xu(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 Gi(e,t,n){(t!=="number"||io(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tr=Array.isArray;function Xn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=jl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mr={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},Zh=["Webkit","ms","Moz","O"];Object.keys(Mr).forEach(function(e){Zh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mr[t]=Mr[e]})});function gf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mr.hasOwnProperty(e)&&Mr[e]?(""+t).trim():t+"px"}function vf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=gf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var qh=pe({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 Zi(e,t){if(t){if(qh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function qi(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 es=null;function Js(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ts=null,Zn=null,qn=null;function Cu(e){if(e=cl(e)){if(typeof ts!="function")throw Error(P(280));var t=e.stateNode;t&&(t=zo(t),ts(e.stateNode,e.type,t))}}function yf(e){Zn?qn?qn.push(e):qn=[e]:Zn=e}function wf(){if(Zn){var e=Zn,t=qn;if(qn=Zn=null,Cu(e),t)for(e=0;e>>=0,e===0?32:31-(cm(e)/fm|0)|0}var Pl=64,Tl=4194304;function Rr(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 co(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var s=i&~l;s!==0?r=Rr(s):(o&=i,o!==0&&(r=Rr(o)))}else i=n&~l,i!==0?r=Rr(i):o!==0&&(r=Rr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function al(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=n}function mm(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=Ar),Mu=" ",Ou=!1;function Df(e,t){switch(e){case"keyup":return Wm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function Vm(e,t){switch(e){case"compositionend":return Uf(t);case"keypress":return t.which!==32?null:(Ou=!0,Mu);case"textInput":return e=t.data,e===Mu&&Ou?null:e;default:return null}}function Qm(e,t){if(Bn)return e==="compositionend"||!la&&Df(e,t)?(e=Ff(),Yl=ta=Yt=null,Bn=!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=zu(n)}}function bf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vf(){for(var e=window,t=io();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=io(e.document)}return t}function oa(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 tg(e){var t=Vf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bf(n.ownerDocument.documentElement,n)){if(r!==null&&oa(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 l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Du(n,o);var i=Du(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,Hn=null,ss=null,Fr=null,as=!1;function Uu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;as||Hn==null||Hn!==io(r)||(r=Hn,"selectionStart"in r&&oa(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}),Fr&&Gr(Fr,r)||(Fr=r,r=ho(ss,"onSelect"),0Vn||(e.current=hs[Vn],hs[Vn]=null,Vn--)}function le(e,t){Vn++,hs[Vn]=e.current,e.current=t}var on={},Oe=an(on),Ve=an(!1),kn=on;function lr(e,t){var n=e.type.contextTypes;if(!n)return on;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Qe(e){return e=e.childContextTypes,e!=null}function go(){se(Ve),se(Oe)}function Ku(e,t,n){if(Oe.current!==on)throw Error(P(168));le(Oe,t),le(Ve,n)}function ed(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(P(108,Jh(e)||"Unknown",l));return pe({},n,r)}function vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,kn=Oe.current,le(Oe,e),le(Ve,Ve.current),!0}function Yu(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=ed(e,t,kn),r.__reactInternalMemoizedMergedChildContext=e,se(Ve),se(Oe),le(Oe,e)):se(Ve),le(Ve,n)}var jt=null,Do=!1,_i=!1;function td(e){jt===null?jt=[e]:jt.push(e)}function pg(e){Do=!0,td(e)}function un(){if(!_i&&jt!==null){_i=!0;var e=0,t=q;try{var n=jt;for(q=1;e>=i,l-=i,Pt=1<<32-ht(t)+l|n<A?(H=O,O=null):H=O.sibling;var B=w(m,O,p[A],C);if(B===null){O===null&&(O=H);break}e&&O&&B.alternate===null&&t(m,O),d=o(B,d,A),$===null?T=B:$.sibling=B,$=B,O=H}if(A===p.length)return n(m,O),ae&&mn(m,A),T;if(O===null){for(;AA?(H=O,O=null):H=O.sibling;var ne=w(m,O,B.value,C);if(ne===null){O===null&&(O=H);break}e&&O&&ne.alternate===null&&t(m,O),d=o(ne,d,A),$===null?T=ne:$.sibling=ne,$=ne,O=H}if(B.done)return n(m,O),ae&&mn(m,A),T;if(O===null){for(;!B.done;A++,B=p.next())B=y(m,B.value,C),B!==null&&(d=o(B,d,A),$===null?T=B:$.sibling=B,$=B);return ae&&mn(m,A),T}for(O=r(m,O);!B.done;A++,B=p.next())B=x(O,m,A,B.value,C),B!==null&&(e&&B.alternate!==null&&O.delete(B.key===null?A:B.key),d=o(B,d,A),$===null?T=B:$.sibling=B,$=B);return e&&O.forEach(function(he){return t(m,he)}),ae&&mn(m,A),T}function _(m,d,p,C){if(typeof p=="object"&&p!==null&&p.type===Un&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case _l:e:{for(var T=p.key,$=d;$!==null;){if($.key===T){if(T=p.type,T===Un){if($.tag===7){n(m,$.sibling),d=l($,p.props.children),d.return=m,m=d;break e}}else if($.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===bt&&Xu(T)===$.type){n(m,$.sibling),d=l($,p.props),d.ref=Cr(m,$,p),d.return=m,m=d;break e}n(m,$);break}else t(m,$);$=$.sibling}p.type===Un?(d=xn(p.props.children,m.mode,C,p.key),d.return=m,m=d):(C=no(p.type,p.key,p.props,null,m.mode,C),C.ref=Cr(m,d,p),C.return=m,m=C)}return i(m);case Dn:e:{for($=p.key;d!==null;){if(d.key===$)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(m,d.sibling),d=l(d,p.children||[]),d.return=m,m=d;break e}else{n(m,d);break}else t(m,d);d=d.sibling}d=Oi(p,m.mode,C),d.return=m,m=d}return i(m);case bt:return $=p._init,_(m,d,$(p._payload),C)}if(Tr(p))return E(m,d,p,C);if(wr(p))return N(m,d,p,C);Fl(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(m,d.sibling),d=l(d,p),d.return=m,m=d):(n(m,d),d=Mi(p,m.mode,C),d.return=m,m=d),i(m)):n(m,d)}return _}var ir=od(!0),id=od(!1),So=an(null),xo=null,Yn=null,ua=null;function ca(){ua=Yn=xo=null}function fa(e){var t=So.current;se(So),e._currentValue=t}function vs(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 tr(e,t){xo=e,ua=Yn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(be=!0),e.firstContext=null)}function it(e){var t=e._currentValue;if(ua!==e)if(e={context:e,memoizedValue:t,next:null},Yn===null){if(xo===null)throw Error(P(308));Yn=e,xo.dependencies={lanes:0,firstContext:e}}else Yn=Yn.next=e;return t}var yn=null;function da(e){yn===null?yn=[e]:yn.push(e)}function sd(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,da(t)):(n.next=l.next,l.next=n),t.interleaved=n,At(e,r)}function At(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 Vt=!1;function pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ad(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 Rt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,At(e,n)}return l=r.interleaved,l===null?(t.next=t,da(r)):(t.next=l.next,l.next=t),r.interleaved=t,At(e,n)}function Jl(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,Zs(e,n)}}function Zu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ko(e,t,n,r){var l=e.updateQueue;Vt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var a=s,u=a.next;a.next=null,i===null?o=u:i.next=u,i=a;var h=e.alternate;h!==null&&(h=h.updateQueue,s=h.lastBaseUpdate,s!==i&&(s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=a))}if(o!==null){var y=l.baseState;i=0,h=u=a=null,s=o;do{var w=s.lane,x=s.eventTime;if((r&w)===w){h!==null&&(h=h.next={eventTime:x,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var E=e,N=s;switch(w=t,x=n,N.tag){case 1:if(E=N.payload,typeof E=="function"){y=E.call(x,y,w);break e}y=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=N.payload,w=typeof E=="function"?E.call(x,y,w):E,w==null)break e;y=pe({},y,w);break e;case 2:Vt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,w=l.effects,w===null?l.effects=[s]:w.push(s))}else x={eventTime:x,lane:w,tag:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(u=h=x,a=y):h=h.next=x,i|=w;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;w=s,s=w.next,w.next=null,l.lastBaseUpdate=w,l.shared.pending=null}}while(!0);if(h===null&&(a=y),l.baseState=a,l.firstBaseUpdate=u,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nn|=i,e.lanes=i,e.memoizedState=y}}function qu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ji.transition;ji.transition={};try{e(!1),t()}finally{q=n,ji.transition=r}}function Nd(){return st().memoizedState}function vg(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_d(e))Ld(t,n);else if(n=sd(e,t,n,r),n!==null){var l=De();mt(n,e,r,l),jd(n,t,r)}}function yg(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_d(e))Ld(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,s=o(i,n);if(l.hasEagerState=!0,l.eagerState=s,gt(s,i)){var a=t.interleaved;a===null?(l.next=l,da(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=sd(e,t,l,r),n!==null&&(l=De(),mt(n,e,r,l),jd(n,t,r))}}function _d(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Ld(e,t){zr=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zs(e,n)}}var No={readContext:it,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},wg={readContext:it,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:tc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zl(4194308,4,Sd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zl(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();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=vg.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:ec,useDebugValue:xa,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=ec(!1),t=e[0];return e=gg.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=fe,l=St();if(ae){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),Ce===null)throw Error(P(349));Cn&30||dd(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,tc(hd.bind(null,r,o,e),[e]),r.flags|=2048,rl(9,pd.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=St(),t=Ce.identifierPrefix;if(ae){var n=Tt,r=Pt;n=(r&~(1<<32-ht(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=tl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[xt]=t,e[Zr]=r,zd(e,t,!1,!1),t.stateNode=e;e:{switch(i=qi(n,r),n){case"dialog":ie("cancel",e),ie("close",e),l=r;break;case"iframe":case"object":case"embed":ie("load",e),l=r;break;case"video":case"audio":for(l=0;l<$r.length;l++)ie($r[l],e);l=r;break;case"source":ie("error",e),l=r;break;case"img":case"image":case"link":ie("error",e),ie("load",e),l=r;break;case"details":ie("toggle",e),l=r;break;case"input":Su(e,r),l=Ki(e,r),ie("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=pe({},r,{value:void 0}),ie("invalid",e);break;case"textarea":ku(e,r),l=Ji(e,r),ie("invalid",e);break;default:l=r}Zi(n,l),s=l;for(o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="style"?vf(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&mf(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Wr(e,a):typeof a=="number"&&Wr(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Hr.hasOwnProperty(o)?a!=null&&o==="onScroll"&&ie("scroll",e):a!=null&&Qs(e,o,a,i))}switch(n){case"input":Ll(e),xu(e,r,!1);break;case"textarea":Ll(e),Eu(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ln(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Xn(e,!!r.multiple,o,!1):r.defaultValue!=null&&Xn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=mo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)Ud(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=wn(el.current),wn(Et.current),Il(t)){if(r=t.stateNode,n=t.memoizedProps,r[xt]=t,(o=r.nodeValue!==n)&&(e=Ze,e!==null))switch(e.tag){case 3:Al(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Al(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xt]=t,t.stateNode=r}return $e(t),null;case 13:if(se(ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Xe!==null&&t.mode&1&&!(t.flags&128))ld(),or(),t.flags|=98560,o=!1;else if(o=Il(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(P(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(P(317));o[xt]=t}else or(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),o=!1}else pt!==null&&(Ms(pt),pt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ce.current&1?xe===0&&(xe=3):ja())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return sr(),Ns(e,t),e===null&&Jr(t.stateNode.containerInfo),$e(t),null;case 10:return fa(t.type._context),$e(t),null;case 17:return Qe(t.type)&&go(),$e(t),null;case 19:if(se(ce),o=t.memoizedState,o===null)return $e(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Nr(o,!1);else{if(xe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Eo(e),i!==null){for(t.flags|=128,Nr(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return le(ce,ce.current&1|2),t.child}e=e.sibling}o.tail!==null&&ge()>ur&&(t.flags|=128,r=!0,Nr(o,!1),t.lanes=4194304)}else{if(!r)if(e=Eo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!ae)return $e(t),null}else 2*ge()-o.renderingStartTime>ur&&n!==1073741824&&(t.flags|=128,r=!0,Nr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ge(),t.sibling=null,n=ce.current,le(ce,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return La(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Je&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function Lg(e,t){switch(sa(t),t.tag){case 1:return Qe(t.type)&&go(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sr(),se(Ve),se(Oe),ga(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ma(t),null;case 13:if(se(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(ce),null;case 4:return sr(),null;case 10:return fa(t.type._context),null;case 22:case 23:return La(),null;case 24:return null;default:return null}}var Dl=!1,Me=!1,jg=typeof WeakSet=="function"?WeakSet:Set,I=null;function Gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){me(e,t,r)}else n.current=null}function _s(e,t,n){try{n()}catch(r){me(e,t,r)}}var dc=!1;function Pg(e,t){if(us=fo,e=Vf(),oa(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 l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,s=-1,a=-1,u=0,h=0,y=e,w=null;t:for(;;){for(var x;y!==n||l!==0&&y.nodeType!==3||(s=i+l),y!==o||r!==0&&y.nodeType!==3||(a=i+r),y.nodeType===3&&(i+=y.nodeValue.length),(x=y.firstChild)!==null;)w=y,y=x;for(;;){if(y===e)break t;if(w===n&&++u===l&&(s=i),w===o&&++h===r&&(a=i),(x=y.nextSibling)!==null)break;y=w,w=y.parentNode}y=x}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(cs={focusedElem:e,selectionRange:n},fo=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var N=E.memoizedProps,_=E.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?N:ft(t.type,N),_);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(C){me(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return E=dc,dc=!1,E}function Dr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&_s(t,n,o)}l=l.next}while(l!==r)}}function Ho(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 Ls(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 Bd(e){var t=e.alternate;t!==null&&(e.alternate=null,Bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xt],delete t[Zr],delete t[ps],delete t[fg],delete t[dg])),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 Hd(e){return e.tag===5||e.tag===3||e.tag===4}function pc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hd(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 js(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=mo));else if(r!==4&&(e=e.child,e!==null))for(js(e,t,n),e=e.sibling;e!==null;)js(e,t,n),e=e.sibling}function Ps(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(Ps(e,t,n),e=e.sibling;e!==null;)Ps(e,t,n),e=e.sibling}var _e=null,dt=!1;function Wt(e,t,n){for(n=n.child;n!==null;)Wd(e,t,n),n=n.sibling}function Wd(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Oo,n)}catch{}switch(n.tag){case 5:Me||Gn(n,t);case 6:var r=_e,l=dt;_e=null,Wt(e,t,n),_e=r,dt=l,_e!==null&&(dt?(e=_e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_e.removeChild(n.stateNode));break;case 18:_e!==null&&(dt?(e=_e,n=n.stateNode,e.nodeType===8?Ni(e.parentNode,n):e.nodeType===1&&Ni(e,n),Kr(e)):Ni(_e,n.stateNode));break;case 4:r=_e,l=dt,_e=n.stateNode.containerInfo,dt=!0,Wt(e,t,n),_e=r,dt=l;break;case 0:case 11:case 14:case 15:if(!Me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&_s(n,t,i),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!Me&&(Gn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){me(n,t,s)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?(Me=(r=Me)||n.memoizedState!==null,Wt(e,t,n),Me=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function hc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jg),t.forEach(function(r){var l=zg.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ct(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Rg(r/1960))-r,10e?16:e,Gt===null)var r=!1;else{if(e=Gt,Gt=null,jo=0,J&6)throw Error(P(331));var l=J;for(J|=4,I=e.current;I!==null;){var o=I,i=o.child;if(I.flags&16){var s=o.deletions;if(s!==null){for(var a=0;age()-Na?Sn(e,0):Ca|=n),Ke(e,t)}function Xd(e,t){t===0&&(e.mode&1?(t=Tl,Tl<<=1,!(Tl&130023424)&&(Tl=4194304)):t=1);var n=De();e=At(e,t),e!==null&&(al(e,t,n),Ke(e,n))}function Fg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xd(e,n)}function zg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),Xd(e,n)}var Zd;Zd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)be=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return be=!1,Ng(e,t,n);be=!!(e.flags&131072)}else be=!1,ae&&t.flags&1048576&&nd(t,wo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ql(e,t),e=t.pendingProps;var l=lr(t,Oe.current);tr(t,n),l=ya(null,t,r,e,l,n);var o=wa();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qe(r)?(o=!0,vo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,pa(t),l.updater=Bo,t.stateNode=l,l._reactInternals=t,ws(t,r,e,n),t=ks(null,t,r,!0,o,n)):(t.tag=0,ae&&o&&ia(t),ze(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ql(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ug(r),e=ft(r,e),l){case 0:t=xs(null,t,r,e,n);break e;case 1:t=uc(null,t,r,e,n);break e;case 11:t=sc(null,t,r,e,n);break e;case 14:t=ac(null,t,r,ft(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),xs(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),uc(e,t,r,l,n);case 3:e:{if(Ad(t),e===null)throw Error(P(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ad(e,t),ko(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=ar(Error(P(423)),t),t=cc(e,t,r,n,l);break e}else if(r!==l){l=ar(Error(P(424)),t),t=cc(e,t,r,n,l);break e}else for(Xe=qt(t.stateNode.containerInfo.firstChild),Ze=t,ae=!0,pt=null,n=id(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(or(),r===l){t=It(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return ud(t),e===null&&gs(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,fs(r,l)?i=null:o!==null&&fs(r,o)&&(t.flags|=32),Od(e,t),ze(e,t,i,n),t.child;case 6:return e===null&&gs(t),null;case 13:return Id(e,t,n);case 4:return ha(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ir(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),sc(e,t,r,l,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,le(So,r._currentValue),r._currentValue=i,o!==null)if(gt(o.value,i)){if(o.children===l.children&&!Ve.current){t=It(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){i=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Rt(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?a.next=a:(a.next=h.next,h.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vs(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(P(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),vs(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ze(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,tr(t,n),l=it(l),r=r(l),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,l=ft(r,t.pendingProps),l=ft(r.type,l),ac(e,t,r,l,n);case 15:return $d(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ft(r,l),ql(e,t),t.tag=1,Qe(r)?(e=!0,vo(t)):e=!1,tr(t,n),Pd(t,r,l),ws(t,r,l,n),ks(null,t,r,!0,e,n);case 19:return Fd(e,t,n);case 22:return Md(e,t,n)}throw Error(P(156,t.tag))};function qd(e,t){return _f(e,t)}function Dg(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 lt(e,t,n,r){return new Dg(e,t,n,r)}function Pa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ug(e){if(typeof e=="function")return Pa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ys)return 11;if(e===Gs)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=lt(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 no(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Pa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Un:return xn(n.children,l,o,t);case Ks:i=8,l|=8;break;case Wi:return e=lt(12,n,t,l|2),e.elementType=Wi,e.lanes=o,e;case bi:return e=lt(13,n,t,l),e.elementType=bi,e.lanes=o,e;case Vi:return e=lt(19,n,t,l),e.elementType=Vi,e.lanes=o,e;case uf:return bo(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sf:i=10;break e;case af:i=9;break e;case Ys:i=11;break e;case Gs:i=14;break e;case bt:i=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=lt(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function xn(e,t,n,r){return e=lt(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=lt(22,e,r,t),e.elementType=uf,e.lanes=n,e.stateNode={isHidden:!1},e}function Mi(e,t,n){return e=lt(6,e,null,t),e.lanes=n,e}function Oi(e,t,n){return t=lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bg(e,t,n,r,l){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=hi(0),this.expirationTimes=hi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ta(e,t,n,r,l,o,i,s,a){return e=new Bg(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=lt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pa(o),e}function Hg(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rp)}catch(e){console.error(e)}}rp(),nf.exports=et;var lp=nf.exports,op,kc=lp;op=kc.createRoot,kc.hydrateRoot;/** + * react-router v7.8.2 + * + * 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 + */var Ec="popstate";function Kg(e={}){function t(l,o){let{pathname:i="/",search:s="",hash:a=""}=Pn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Os("",{pathname:i,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let a=l.location.href,u=a.indexOf("#");s=u===-1?a:a.slice(0,u)}return s+"#"+(typeof o=="string"?o:ol(o))}function r(l,o){vt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return Gg(t,n,r,e)}function de(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Yg(){return Math.random().toString(36).substring(2,10)}function Cc(e,t){return{usr:e.state,key:e.key,idx:t}}function Os(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Pn(t):t,state:n,key:t&&t.key||r||Yg()}}function ol({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Pn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Gg(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,s="POP",a=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function y(){s="POP";let _=h(),m=_==null?null:_-u;u=_,a&&a({action:s,location:N.location,delta:m})}function w(_,m){s="PUSH";let d=Os(N.location,_,m);n&&n(d,_),u=h()+1;let p=Cc(d,u),C=N.createHref(d);try{i.pushState(p,"",C)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;l.location.assign(C)}o&&a&&a({action:s,location:N.location,delta:1})}function x(_,m){s="REPLACE";let d=Os(N.location,_,m);n&&n(d,_),u=h();let p=Cc(d,u),C=N.createHref(d);i.replaceState(p,"",C),o&&a&&a({action:s,location:N.location,delta:0})}function E(_){return Jg(_)}let N={get action(){return s},get location(){return e(l,i)},listen(_){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(Ec,y),a=_,()=>{l.removeEventListener(Ec,y),a=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let m=E(_);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:w,replace:x,go(_){return i.go(_)}};return N}function Jg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),de(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ol(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function ip(e,t,n="/"){return Xg(e,t,n,!1)}function Xg(e,t,n,r){let l=typeof t=="string"?Pn(t):t,o=Ft(l.pathname||"/",n);if(o==null)return null;let i=sp(e);Zg(i);let s=null;for(let a=0;s==null&&a{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&a)return;de(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let y=$t([r,h.relativePath]),w=n.concat(h);i.children&&i.children.length>0&&(de(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),sp(i.children,t,w,y,a)),!(i.path==null&&!i.index)&&t.push({path:y,score:ov(y,i.index),routesMeta:w})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let u of ap(i.path))o(i,s,!0,u)}),t}function ap(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=ap(r.join("/")),s=[];return s.push(...i.map(a=>a===""?o:[o,a].join("/"))),l&&s.push(...i),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function Zg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:iv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var qg=/^:[\w-]+$/,ev=3,tv=2,nv=1,rv=10,lv=-2,Nc=e=>e==="*";function ov(e,t){let n=e.split("/"),r=n.length;return n.some(Nc)&&(r+=lv),t&&(r+=tv),n.filter(l=>!Nc(l)).reduce((l,o)=>l+(qg.test(o)?ev:o===""?nv:rv),r)}function iv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function sv(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let s=0;s{if(h==="*"){let E=s[w]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const x=s[w];return y&&!x?u[h]=void 0:u[h]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function av(e,t=!1,n=!0){vt(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=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function uv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ft(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 cv(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Pn(e):e;return{pathname:n?n.startsWith("/")?n:fv(n,t):t,search:hv(r),hash:mv(l)}}function fv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ai(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 dv(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function up(e){let t=dv(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function cp(e,t,n,r=!1){let l;typeof e=="string"?l=Pn(e):(l={...e},de(!l.pathname||!l.pathname.includes("?"),Ai("?","pathname","search",l)),de(!l.pathname||!l.pathname.includes("#"),Ai("#","pathname","hash",l)),de(!l.search||!l.search.includes("#"),Ai("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,s;if(i==null)s=n;else{let y=t.length-1;if(!r&&i.startsWith("..")){let w=i.split("/");for(;w[0]==="..";)w.shift(),y-=1;l.pathname=w.join("/")}s=y>=0?t[y]:"/"}let a=cv(l,s),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||h)&&(a.pathname+="/"),a}var $t=e=>e.join("/").replace(/\/\/+/g,"/"),pv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var fp=["POST","PUT","PATCH","DELETE"];new Set(fp);var vv=["GET",...fp];new Set(vv);var pr=v.createContext(null);pr.displayName="DataRouter";var Go=v.createContext(null);Go.displayName="DataRouterState";v.createContext(!1);var dp=v.createContext({isTransitioning:!1});dp.displayName="ViewTransition";var yv=v.createContext(new Map);yv.displayName="Fetchers";var wv=v.createContext(null);wv.displayName="Await";var Ct=v.createContext(null);Ct.displayName="Navigation";var dl=v.createContext(null);dl.displayName="Location";var Dt=v.createContext({outlet:null,matches:[],isDataRoute:!1});Dt.displayName="Route";var Oa=v.createContext(null);Oa.displayName="RouteError";function Sv(e,{relative:t}={}){de(pl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(Ct),{hash:l,pathname:o,search:i}=hl(e,{relative:t}),s=o;return n!=="/"&&(s=o==="/"?n:$t([n,o])),r.createHref({pathname:s,search:i,hash:l})}function pl(){return v.useContext(dl)!=null}function Tn(){return de(pl(),"useLocation() may be used only in the context of a component."),v.useContext(dl).location}var pp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hp(e){v.useContext(Ct).static||v.useLayoutEffect(e)}function xv(){let{isDataRoute:e}=v.useContext(Dt);return e?Ov():kv()}function kv(){de(pl(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(pr),{basename:t,navigator:n}=v.useContext(Ct),{matches:r}=v.useContext(Dt),{pathname:l}=Tn(),o=JSON.stringify(up(r)),i=v.useRef(!1);return hp(()=>{i.current=!0}),v.useCallback((a,u={})=>{if(vt(i.current,pp),!i.current)return;if(typeof a=="number"){n.go(a);return}let h=cp(a,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:$t([t,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[t,n,o,l,e])}v.createContext(null);function hl(e,{relative:t}={}){let{matches:n}=v.useContext(Dt),{pathname:r}=Tn(),l=JSON.stringify(up(n));return v.useMemo(()=>cp(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Ev(e,t){return mp(e,t)}function mp(e,t,n,r,l){var d;de(pl(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=v.useContext(Ct),{matches:i}=v.useContext(Dt),s=i[i.length-1],a=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",y=s&&s.route;{let p=y&&y.path||"";gp(u,!y||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let w=Tn(),x;if(t){let p=typeof t=="string"?Pn(t):t;de(h==="/"||((d=p.pathname)==null?void 0:d.startsWith(h)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${p.pathname}" was given in the \`location\` prop.`),x=p}else x=w;let E=x.pathname||"/",N=E;if(h!=="/"){let p=h.replace(/^\//,"").split("/");N="/"+E.replace(/^\//,"").split("/").slice(p.length).join("/")}let _=ip(e,{pathname:N});vt(y||_!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),vt(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let m=jv(_&&_.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:$t([h,o.encodeLocation?o.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:$t([h,o.encodeLocation?o.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),i,n,r,l);return t&&m?v.createElement(dl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},m):m}function Cv(){let e=Mv(),t=gv(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,i)}var Nv=v.createElement(Cv,null),_v=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(Dt.Provider,{value:this.props.routeContext},v.createElement(Oa.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Lv({routeContext:e,match:t,children:n}){let r=v.useContext(pr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Dt.Provider,{value:e},n)}function jv(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let u=o.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);de(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let s=!1,a=-1;if(n)for(let u=0;u=0?o=o.slice(0,a+1):o=[o[0]];break}}}return o.reduceRight((u,h,y)=>{let w,x=!1,E=null,N=null;n&&(w=i&&h.route.id?i[h.route.id]:void 0,E=h.route.errorElement||Nv,s&&(a<0&&y===0?(gp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,N=null):a===y&&(x=!0,N=h.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,y+1)),m=()=>{let d;return w?d=E:x?d=N:h.route.Component?d=v.createElement(h.route.Component,null):h.route.element?d=h.route.element:d=u,v.createElement(Lv,{match:h,routeContext:{outlet:u,matches:_,isDataRoute:n!=null},children:d})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(_v,{location:n.location,revalidation:n.revalidation,component:E,error:w,children:m(),routeContext:{outlet:null,matches:_,isDataRoute:!0},unstable_onError:r}):m()},null)}function Aa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pv(e){let t=v.useContext(pr);return de(t,Aa(e)),t}function Tv(e){let t=v.useContext(Go);return de(t,Aa(e)),t}function Rv(e){let t=v.useContext(Dt);return de(t,Aa(e)),t}function Ia(e){let t=Rv(e),n=t.matches[t.matches.length-1];return de(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $v(){return Ia("useRouteId")}function Mv(){var r;let e=v.useContext(Oa),t=Tv("useRouteError"),n=Ia("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Ov(){let{router:e}=Pv("useNavigate"),t=Ia("useNavigate"),n=v.useRef(!1);return hp(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{vt(n.current,pp),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var _c={};function gp(e,t,n){!t&&!_c[e]&&(_c[e]=!0,vt(!1,n))}v.memo(Av);function Av({routes:e,future:t,state:n,unstable_onError:r}){return mp(e,void 0,n,r,t)}function vp(e){de(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Iv({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){de(!pl(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=v.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=Pn(n));let{pathname:a="/",search:u="",hash:h="",state:y=null,key:w="default"}=n,x=v.useMemo(()=>{let E=Ft(a,i);return E==null?null:{location:{pathname:E,search:u,hash:h,state:y,key:w},navigationType:r}},[i,a,u,h,y,w,r]);return vt(x!=null,` is not able to match the URL "${a}${u}${h}" because it does not start with the basename, so the won't render anything.`),x==null?null:v.createElement(Ct.Provider,{value:s},v.createElement(dl.Provider,{children:t,value:x}))}function Fv({children:e,location:t}){return Ev(As(e),t)}function As(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,As(r.props.children,o));return}de(r.type===vp,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),de(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=As(r.props.children,o)),n.push(i)}),n}var ro="get",lo="application/x-www-form-urlencoded";function Jo(e){return e!=null&&typeof e.tagName=="string"}function zv(e){return Jo(e)&&e.tagName.toLowerCase()==="button"}function Dv(e){return Jo(e)&&e.tagName.toLowerCase()==="form"}function Uv(e){return Jo(e)&&e.tagName.toLowerCase()==="input"}function Bv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Hv(e,t){return e.button===0&&(!t||t==="_self")&&!Bv(e)}var Hl=null;function Wv(){if(Hl===null)try{new FormData(document.createElement("form"),0),Hl=!1}catch{Hl=!0}return Hl}var bv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ii(e){return e!=null&&!bv.has(e)?(vt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${lo}"`),null):e}function Vv(e,t){let n,r,l,o,i;if(Dv(e)){let s=e.getAttribute("action");r=s?Ft(s,t):null,n=e.getAttribute("method")||ro,l=Ii(e.getAttribute("enctype"))||lo,o=new FormData(e)}else if(zv(e)||Uv(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a `,E=`
${w}
`;return`
${x}${E}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function Jy(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r[\s\S]*?<\/think(?:ing)?>/gi,"").replace(/[*#]/g,"").replace(/\s+/g," ").trim()}function jp(e){if(!e)return{think:null,answer:""};const t=//i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let s=e.substring(l+o);const a=s.match(n);let u=null,h=i;return a?(u=s.substring(0,a.index).trim(),h+=s.substring(a.index+a[0].length)):u=s.trim(),{think:u||null,answer:h.trim()}}function Zy({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=jp(e||""),[o,i]=Fe.useState(!1),s=!!r;return f.jsxs("div",{className:"assistant-message",children:[s&&f.jsxs("div",{className:"assistant-thoughts",children:[f.jsxs("button",{className:"think-toggle",onClick:()=>i(a=>!a),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[f.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&f.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:Dc(r)}})]}),f.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:Dc(l||e||"")}}),Array.isArray(n)&&n.length>0&&f.jsx("div",{className:"msg-sources chips",children:n.map((a,u)=>{let h=a,y=!1;try{const w=new URL(a);if(w.protocol==="file:"){y=!0;const x=w.pathname.split("/").filter(Boolean);h=decodeURIComponent(x[x.length-1]||a)}else h=(w.hostname||a).replace(/^www\./i,"")}catch{}return f.jsx("a",{className:"chip",href:a,target:"_blank",rel:"noreferrer",title:a,onClick:w=>{var x,E;if(y){w.preventDefault();try{const N=new URL(a);(E=(x=window.electronAPI)==null?void 0:x.openPath)==null||E.call(x,decodeURIComponent(N.pathname))}catch{}}},children:h},a+u)})})]})}function Di({attachments:e,className:t="",removable:n=!1,onRemove:r}){return!Array.isArray(e)||e.length===0?null:f.jsx("div",{className:`image-attachment-strip ${t}`.trim(),children:e.map((l,o)=>{const i=l==null?void 0:l.data_url;if(!i)return null;const s=l.id||`${l.name||"image"}-${o}-${i.length}`;return f.jsxs("div",{className:"image-attachment-card",children:[n&&f.jsx("button",{type:"button",className:"image-attachment-remove",onClick:()=>r==null?void 0:r(l.id),"aria-label":`Remove ${l.name||"image"}`,title:"Remove image",children:"×"}),f.jsx("img",{className:"image-attachment-thumb",src:i,alt:l.name||`Attachment ${o+1}`,loading:"lazy"})]},s)})})}const Uc="websearch.searxUrl",Bc="websearch.engines",Hc="chat.libraryBySession",Wc="http://127.0.0.1:8888",Ui=6,Bi=20*1024*1024;let Pp="http://127.0.0.1:8000";const qy=48,e0=24;function t0(e){return e.backendApiUrl||e.ollamaApiUrl||Pp}function n0(e){const t=typeof e=="string"?e.trim():"";return!t||t==="http://localhost:8888"?Wc:t}function bl(e){var n;return Array.from(((n=e==null?void 0:e.dataTransfer)==null?void 0:n.types)||[]).includes("Files")}function Ds(e){return e?typeof e.type=="string"&&e.type.toLowerCase().startsWith("image/")?!0:/\.(png|jpe?g|gif|bmp|webp|tiff?|heic|avif)$/i.test(e.name||""):!1}function bc(e){var r,l;const t=Array.from(((r=e==null?void 0:e.dataTransfer)==null?void 0:r.items)||[]);return t.length>0?t.some(o=>{var i;return o.kind==="file"&&Ds((i=o.getAsFile)==null?void 0:i.call(o))}):Array.from(((l=e==null?void 0:e.dataTransfer)==null?void 0:l.files)||[]).some(Ds)}function r0(e){return new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error||new Error(`Failed to read ${(e==null?void 0:e.name)||"image"}`)),r.onload=()=>t(String(r.result||"")),r.readAsDataURL(e)})}function l0(){var pu;const[e,t]=v.useState([]),[n,r]=v.useState(null),[l,o]=v.useState("chats"),[i,s]=v.useState("General"),[a,u]=v.useState(null),[h,y]=v.useState(null),[w,x]=v.useState([]),[E,N]=v.useState([]),[_,m]=v.useState(null),[d,p]=v.useState(()=>{try{const c=localStorage.getItem(Hc);return c?JSON.parse(c):{}}catch{return{}}}),[C,T]=v.useState(!1),[$,O]=v.useState(""),[A,H]=v.useState(""),[B,ne]=v.useState(!1),[he,Ye]=v.useState(""),[Ne,R]=v.useState(!1),[M,z]=v.useState(""),[L,D]=v.useState([]),[b,Z]=v.useState(!1),ee=v.useRef(null),at=v.useRef(null),yt=v.useRef(null),Rn=v.useRef(null),He=v.useRef(0),[V,Ua]=v.useState(Pp),[Ba,Tp]=v.useState("Default"),[ml,Ha]=v.useState(!1),[Wa,hr]=v.useState(""),[Rp,Xo]=v.useState(!1),[mr,$p]=v.useState(()=>n0(localStorage.getItem(Uc))),[cn,Mp]=v.useState(()=>Yy(localStorage.getItem(Bc)));v.useEffect(()=>{localStorage.setItem(Uc,mr||"")},[mr]),v.useEffect(()=>{try{localStorage.setItem(Bc,JSON.stringify($o(cn)))}catch{}},[cn]);const[gl,Op]=v.useState(!1),[Ut,Zo]=v.useState(!1),[ba,qo]=v.useState(!0),[Ap,$n]=v.useState([]),[vl,Va]=v.useState({}),[Qa,Ip]=v.useState(!1),Ka=v.useRef(!1),[Fp,ei]=v.useState(null),[ti,yl]=v.useState("");function zp(c){const g=c.content||"";if(c.role==="assistant")try{const{answer:S}=jp(g);return(S||g).trim()}catch{return g.trim()}return g}async function Ya(c){try{await navigator.clipboard.writeText(zp(c))}catch(g){console.error("Failed to copy message:",g)}}function fn(c,g,S,k={}){const{removeIfEmpty:j=!1}=k;t(F=>F.map(U=>{if(U.session_id!==c)return U;const W=[];for(const X of U.messages||[]){if(X.id!==g){W.push(X);continue}j&&!S||W.push({...X,content:S})}return{...U,messages:W}}))}function Nt(c){return(c==null?void 0:c.name)==="AbortError"}function gr(c){return c instanceof Error&&c.message?c.message:String(c)}async function wl(c){const g=await c.json().catch(()=>null);if(c.ok)return g;const S=typeof(g==null?void 0:g.detail)=="string"?g.detail:typeof(g==null?void 0:g.message)=="string"?g.message:"";throw new Error(S||`HTTP ${c.status}`)}async function Dp(c,g){const S=await fetch(`${V}/models/capabilities?name=${encodeURIComponent(c)}`,{signal:g});return wl(S)}async function Up(){const c=await fetch(`${V}/ollama/startup-status`);return wl(c)}async function Bp(){const c=await fetch(`${V}/startup/prepare-models`,{method:"POST"});return wl(c)}async function Ga(c,g,S){if(!c)return{contextBlock:null,sources:[]};const j=await(await fetch(`${V}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S,body:JSON.stringify({prompt:g,top_k:5})})).json();return{contextBlock:typeof(j==null?void 0:j.context_block)=="string"&&j.context_block.trim()?j.context_block.trim():null,sources:Array.isArray(j==null?void 0:j.sources)?j.sources:[]}}async function Ja(c){const g=Array.from(c||[]).filter(Ds);if(!g.length||!Ne)return;const S=Math.max(0,Ui-L.length);if(S<=0){window.alert(`You can attach up to ${Ui} images per message.`);return}const k=g.slice(0,S),j=k.filter(U=>Number(U.size)>Bi),F=k.filter(U=>Number(U.size)<=Bi);if(j.length>0&&window.alert(`Images must be ${Math.round(Bi/(1024*1024))} MB or smaller.`),!!F.length)try{const U=await Promise.all(F.map(async(W,X)=>({id:`attachment-${Date.now()}-${X}-${Math.random().toString(36).slice(2)}`,name:W.name||"image",mime_type:W.type||"image/*",data_url:await r0(W)})));D(W=>[...W,...U]),g.length>S&&window.alert(`Only the first ${Ui} images can be attached.`)}catch(U){console.error("Failed to load image attachments",U),window.alert(`Image import failed: ${gr(U)}`)}}function Hp(c){D(g=>g.filter(S=>S.id!==c))}function Wp(){var c;Ne&&((c=Rn.current)==null||c.click())}async function bp(c){var S;const g=(S=c.target)==null?void 0:S.files;try{await Ja(g)}finally{c.target&&(c.target.value="")}}function Vp(c,g){ei(c),yl(g||"")}function Sl(){ei(null),yl("")}async function Qp(c){var F;const g=(((F=In[c])==null?void 0:F.content)||"").trim(),k=(ti??"").trim();if(k.length===0){Sl();return}if(k===g){Sl();return}const j=n;if(j){t(U=>U.map(W=>{if(W.session_id!==j)return W;const ue=(W.messages||[]).slice(0,c+1).map((te,ke)=>ke===c?{...te,content:k}:te);return{...W,messages:ue}})),ei(null),yl(""),requestAnimationFrame(()=>si("auto",j));try{const U=await fetch(`${V}/sessions/${j}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k})});if(!U.ok)throw new Error(`HTTP ${U.status}`)}catch(U){console.error("Failed to update message:",U),t(W=>W.map(X=>{if(X.session_id!==j)return X;const te=(X.messages||[]).map((ke,Te)=>Te===c?{...ke,content:g}:ke);return{...X,messages:te}}));return}await Xa(c,k)}}async function Xa(c,g=null){var ue,te,ke,Te,hn,K;const S=n;if(Ut||!S||typeof c!="number")return;const k=((ue=e.find(G=>G.session_id===S))==null?void 0:ue.messages)||[];let j=c;for(let G=c;G>=0;G--)if(((te=k[G])==null?void 0:te.role)==="user"){j=G;break}t(G=>G.map(oe=>oe.session_id===S?{...oe,messages:(oe.messages||[]).slice(0,j+1)}:oe));const F=ru(S);let U=g??(((ke=k[j])==null?void 0:ke.content)||""),W=[];const X=[];try{const G=su(S),oe=g??(((Te=k[j])==null?void 0:Te.content)||""),we=!!(oe||"").trim();if(we&&((hn=G==null?void 0:G.states)!=null&&hn.is_indexed))try{const Q=await Ga(G.slug,oe,F.signal);Q.contextBlock&&X.push(Q.contextBlock),Array.isArray(Q.sources)&&W.push(...Q.sources)}catch(Q){if(Nt(Q))throw Q;console.warn("local library enrichment (regenerate) failed",Q)}if(we&&gl)try{const Q=k.slice(Math.max(0,j-7),j+1).map(ve=>({role:ve.role,content:ve.content||""}));Q.length>0&&(Q[Q.length-1]={role:"user",content:oe});const re=await(await fetch(`${V}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({prompt:oe,model:he,messages:Q,history_limit:8,searx_url:mr||null,engines:Array.isArray(cn)?cn:null})})).json();re&&typeof re.context_block=="string"&&re.context_block.trim()&&X.push(re.context_block.trim()),Array.isArray(re==null?void 0:re.sources)&&W.push(...re.sources)}catch(Q){if(Nt(Q))throw Q;console.warn("web search enrichment (regenerate) failed",Q)}if(W=[...new Set(W)],we&&X.length>0?U=`${oe} + +${X.join(` + +`)}`:U=null,ml){const Q=`msg-${Date.now()}-${Math.random()}`;let Ge="";t(re=>re.map(ve=>ve.session_id===S?{...ve,messages:[...ve.messages||[],{id:Q,role:"assistant",content:"",sources:W}]}:ve));try{const re=await fetch(`${V}/sessions/${S}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({index:c,model:he,stream:!0,enriched_message:U,sources:W||[]})});if(!re.ok)throw new Error(`HTTP ${re.status}`);const ve=(K=re.body)==null?void 0:K.getReader();if(!ve)throw new Error("Missing response body");const Ht=new TextDecoder;let Cl=!1;for(;;){const{value:Ae,done:wh}=await ve.read();if(wh)break;const Sh=Ht.decode(Ae,{stream:!0});Ge+=Sh,fn(S,Q,Ge),!Cl&&Pe.current!==S&&(Cl=!0,dn(ai=>({...ai,[S]:Q})),$n(ai=>[...new Set([...ai,S])]))}Pe.current!==S?(dn(Ae=>({...Ae,[S]:Q})),$n(Ae=>[...new Set([...Ae,S])])):Mn.current[S]?On(Ae=>({...Ae,[S]:Q})):requestAnimationFrame(()=>Fn(Q,"smooth",S))}catch(re){if(Nt(re)){fn(S,Q,Ge,{removeIfEmpty:!0});return}console.error(re),fn(S,Q,`Error: ${gr(re)}`,{removeIfEmpty:!0});return}}else{const Q=await fetch(`${V}/sessions/${S}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({index:c,model:he,stream:!1,enriched_message:U,sources:W||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const Ge=await Q.json(),re=`msg-${Date.now()}`;t(ve=>ve.map(Ht=>Ht.session_id===S?{...Ht,messages:[...Ht.messages||[],{role:"assistant",content:Ge.reply,id:re,sources:W}]}:Ht)),Pe.current!==S?(dn(ve=>({...ve,[S]:re})),$n(ve=>[...new Set([...ve,S])])):Mn.current[S]?On(ve=>({...ve,[S]:re})):requestAnimationFrame(()=>Fn(re,"smooth",S))}}catch(G){Nt(G)||console.error(G)}finally{ni(F)}}const[Za,Kp]=v.useState({}),Mn=v.useRef({}),[Yp,dn]=v.useState({}),pn=v.useRef({}),qa=v.useRef({}),[eu,On]=v.useState({}),[Gp,tu]=v.useState({}),nu=(c,g,S)=>c!=null&&c.id?c.id:`${S}:${g}`;v.useEffect(()=>{var g;if(!n)return;const c=((g=e.find(S=>S.session_id===n))==null?void 0:g.messages)||[];tu(S=>{const k={};return c.forEach((j,F)=>{if(j.role!=="user")return;const U=nu(j,F,n),X=(j.content||"").split(/\r\n|\r|\n/).length>30;k[U]=X?S[U]??!0:!1}),k})},[e,n]);function Jp(c){tu(g=>({...g,[c]:!(g[c]??!0)}))}const vr=Fe.useCallback((c,g)=>{Kp(S=>{const k={...S,[c]:g};return Mn.current=k,k})},[]),An=v.useRef(null),Xp=v.useRef(!1),Zp=v.useRef(null),Pe=v.useRef(n);v.useEffect(()=>{Pe.current=n},[n]);const ru=Fe.useCallback(c=>{const g=new AbortController;return An.current={controller:g,sessionId:c},Zo(!0),g},[]),ni=Fe.useCallback(c=>{var g;((g=An.current)==null?void 0:g.controller)===c&&(An.current=null,Zo(!1))},[]),qp=Fe.useCallback(()=>{const c=An.current;c&&(An.current=null,c.controller.abort(),Zo(!1))},[]);v.useEffect(()=>()=>{var c;(c=An.current)==null||c.controller.abort()},[]);const Bt=v.useRef(null),[eh,th]=v.useState(230),[xl,lu]=v.useState(!1),nh=Fe.useCallback(c=>{lu(!0)},[]),ri=Fe.useCallback(()=>{lu(!1)},[]),li=Fe.useCallback(c=>{if(xl){const g=Math.max(230,Math.min(500,c.clientX));th(g)}},[xl]);Fe.useEffect(()=>(window.addEventListener("mousemove",li),window.addEventListener("mouseup",ri),()=>{window.removeEventListener("mousemove",li),window.removeEventListener("mouseup",ri)}),[li,ri]),Fe.useEffect(()=>{xl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[xl]),Fe.useEffect(()=>{const c=async g=>{const S=g.target.closest(".codeblock__copy");if(!S)return;const k=S.closest(".codeblock"),j=k==null?void 0:k.querySelector("pre > code");if(j)try{await navigator.clipboard.writeText(j.textContent||""),S.classList.add("copied"),setTimeout(()=>S.classList.remove("copied"),800)}catch(F){console.error("Copy failed:",F)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),v.useEffect(()=>{window.electronAPI.getSettings().then(g=>{Ua(t0(g)),Tp(g.colorScheme||"Default"),Ye(g.chatModel||""),Ha(g.streamOutput||!1),Va(g.scrollPositions||{}),il(g.colorScheme||"Default")}).finally(()=>{Ip(!0)});const c=()=>{var g;l==="chats"&&((g=at.current)==null||g.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),v.useEffect(()=>{let c=!1;const g=new AbortController;return!V||!he?(R(!1),()=>{g.abort()}):((async()=>{try{const S=await Dp(he,g.signal);c||R(!!(S!=null&&S.supports_vision))}catch(S){!c&&!Nt(S)&&(console.warn("Failed to load model capabilities",S),R(!1))}})(),()=>{c=!0,g.abort()})},[V,he]),v.useEffect(()=>{He.current=0,Z(!1)},[Ne,l]),v.useEffect(()=>{if(!Qa||ba||!V||Ka.current)return;Ka.current=!0;let c=!1;const g=window.setTimeout(()=>{(async()=>{let S=!1;try{let k=await Up();if(c)return;if(!(k!=null&&k.ollama_running)&&(k!=null&&k.can_manage_locally)){const U=window.confirm(`Ollama is not running at ${k.ollama_url}. Start it in the background now with "ollama serve"?`);if(c)return;if(U){S=!0,Xo(!0),hr("Starting Ollama in the background...");const W=await fetch(`${V}/ollama/start`,{method:"POST"});if(k=await wl(W),c)return}}const j=!(k!=null&&k.whisper_model_available),F=!!(k!=null&&k.ollama_running&&(k!=null&&k.can_manage_locally)&&!(k!=null&&k.embedding_model_available));if((j||F)&&(S=!0,Xo(!0),hr(j&&F?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"} and ${k.selected_embed_model}. This can take a while on first install.`:j?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"}. This can take a while on first install.`:`Downloading ${k.selected_embed_model} from Ollama. This can take a while on first install.`),await Bp(),c))return}catch(k){c||(console.warn("startup Ollama check failed",k),S&&window.alert(`Startup action failed: ${gr(k)}`))}finally{c||(Xo(!1),hr(""))}})()},1200);return()=>{c=!0,window.clearTimeout(g)}},[V,ba,Qa]),v.useEffect(()=>{il(Ba)},[Ba]);const rh=c=>{!c||!V||fetch(`${V}/history?session_id=${encodeURIComponent(c)}`).then(g=>g.json()).then(g=>{t(S=>S.map(k=>k.session_id===c?{...k,messages:g.messages||[]}:k))}).catch(()=>{})};async function yr(){if(V)try{const g=await(await fetch(`${V}/libraries`)).json(),S=Array.isArray(g.libraries)?g.libraries:[];if(x(S),S.length===0){m(null);return}S.some(k=>k.slug===_)||m(S[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function kl(){if(V)try{const g=await(await fetch(`${V}/jobs`)).json();N(Array.isArray(g.jobs)?g.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function ou(c=null){const S=(typeof c=="string"?c:$).trim();if(!S){H("Name is required.");return}try{H("");const k=await fetch(`${V}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S})});if(!k.ok){const F=await k.text();throw new Error(F||`HTTP ${k.status}`)}const j=await k.json();T(!1),O(""),await yr(),j!=null&&j.slug&&m(j.slug)}catch(k){console.error("Failed to create library",k),H(String((k==null?void 0:k.message)||k))}}async function lh(){x([]),N([]),m(null),y(null),ne(!1),p({}),await yr(),await kl()}v.useEffect(()=>{V&&(qo(!0),fetch(`${V}/sessions`).then(c=>c.json()).then(c=>{const g=c.sessions.map(S=>({...S,messages:[]}));t(g),g.length>0?r(g[0].session_id):r(null),qo(!1)}).catch(()=>{qo(!1)}))},[V]),v.useEffect(()=>{V&&(yr(),kl())},[V]),v.useEffect(()=>{try{localStorage.setItem(Hc,JSON.stringify(d||{}))}catch{}},[d]),v.useEffect(()=>{if(!V)return;const c=setInterval(()=>{yr(),kl()},3e3);return()=>clearInterval(c)},[V,l,_]),v.useEffect(()=>{rh(n)},[n,V]),v.useEffect(()=>{const c=new Set(w.map(g=>g.slug));p(g=>{let S=!1;const k={};for(const[j,F]of Object.entries(g||{}))c.has(F)?k[j]=F:S=!0;return S?k:g})},[w]);const oi=c=>{o(c)},oh=c=>{hh(c)},In=v.useMemo(()=>{var c;return((c=e.find(g=>g.session_id===n))==null?void 0:c.messages)||[]},[n,e]),El=v.useMemo(()=>w.find(c=>c.slug===_)||null,[_,w]),_t=n&&d[n]||null,ut=v.useMemo(()=>w.find(c=>c.slug===_t)||null,[_t,w]),iu=v.useMemo(()=>_t?E.some(c=>c.slug===_t&&(c.status==="queued"||c.status==="running")):!1,[_t,E]),ii=v.useMemo(()=>{var c,g;return ut?(c=ut.files)!=null&&c.length?(g=ut.states)!=null&&g.is_indexed?"":iu?" (syncing)":" (needs sync)":" (empty)":""},[ut,iu]);function ih(c){return c&&d[c]||null}function su(c){const g=ih(c);return g&&w.find(S=>S.slug===g)||null}function au(c){return c?E.some(g=>g.slug===c&&(g.status==="queued"||g.status==="running")):!1}function uu(c,g){c&&p(S=>{const k={...S||{}};return g?k[c]=g:delete k[c],k})}function sh(c){c&&p(g=>{let S=!1;const k={};for(const[j,F]of Object.entries(g||{})){if(F===c){S=!0;continue}k[j]=F}return S?k:g})}v.useEffect(()=>{if(!B)return;const c=g=>{var S;(S=yt.current)!=null&&S.contains(g.target)||ne(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[B]),v.useEffect(()=>{ne(!1)},[n,l]),v.useEffect(()=>{const c=n,g=l;return()=>{if(g==="chats"&&c){const S=typeof pn.current[c]=="number"?pn.current[c]:ee.current?ee.current.scrollTop:0;Va(k=>{const j={...k,[c]:S};return window.electronAPI.updateSettings({scrollPositions:j}),j})}}},[n,l]),v.useEffect(()=>{const c=ee.current;if(!c)return;const g=()=>{const{scrollTop:S,scrollHeight:k,clientHeight:j}=c,F=k-S-j<=e0;if(n){const U=qa.current[n],W=typeof U=="number"&&Sc.removeEventListener("scroll",g)},[n,vr]),v.useEffect(()=>{const c=n;c&&Za[c]===!1&&On(g=>{if(!(c in g))return g;const S={...g};return delete S[c],S})},[n,Za]),v.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=ee.current;if(!c)return;Bt.current=null;const g=()=>{if(Bt.current===n)return;const U=typeof pn.current[n]=="number"?pn.current[n]:void 0,W=typeof U=="number"?U:vl[n];if(typeof W=="number"){c.scrollTop=W,Bt.current=n;return}In.length>0&&(c.scrollTop=c.scrollHeight,Bt.current=n)};g();const S=requestAnimationFrame(g),k=()=>{Bt.current!==n&&requestAnimationFrame(g)},j=new MutationObserver(k);j.observe(c,{childList:!0,subtree:!0});const F=new ResizeObserver(k);return F.observe(c),()=>{cancelAnimationFrame(S),j.disconnect(),F.disconnect()}},[n,l,In.length,vl]),v.useEffect(()=>{if(l!=="chats"||!n||Bt.current===n)return;const c=typeof pn.current[n]=="number"?pn.current[n]:void 0;typeof(typeof c=="number"?c:vl[n])!="number"&&In.length>0&&requestAnimationFrame(()=>{const S=ee.current;S&&(S.scrollTop=S.scrollHeight,Bt.current=n)})},[In.length,n,l,vl]);const si=(c="smooth",g=null)=>{const S=ee.current;if(!S)return;const k=g??Pe.current;Pe.current===k&&(S.scrollTo({top:S.scrollHeight,behavior:c}),vr(k,!1))},Fn=(c,g="auto",S=null)=>{const k=ee.current;if(!k)return;const j=S??Pe.current;if(Pe.current!==j)return;const F=document.getElementById(c);if(F){const U=Math.max(0,F.offsetTop-qy);k.scrollTo({top:U,behavior:g})}},ah=()=>{const c=Pe.current,g=eu[c];g&&(Fn(g,"smooth",c),On(S=>{const{[c]:k,...j}=S;return j}))},uh=c=>{l!=="chats"||!bl(c)||(c.preventDefault(),He.current+=1,Ne&&bc(c)&&Z(!0))},ch=c=>{l!=="chats"||!bl(c)||(c.preventDefault(),c.dataTransfer.dropEffect=Ne?"copy":"none",Ne&&bc(c)&&!b&&Z(!0))},fh=c=>{l!=="chats"||!bl(c)||(He.current=Math.max(0,He.current-1),He.current===0&&Z(!1))},dh=async c=>{var g,S;l!=="chats"||!bl(c)||(c.preventDefault(),He.current=0,Z(!1),Ne&&(await Ja((g=c.dataTransfer)==null?void 0:g.files),(S=at.current)==null||S.focus()))};async function cu(){var U,W,X;const c=M.trim();if(Ut||!c&&L.length===0||!he)return;if(L.length>0&&!Ne){window.alert("The selected model does not support image inputs.");return}let g=n,S=!1;if(g){const ue=e.find(te=>te.session_id===g);S=ue&&ue.name==="New Chat"&&ue.messages.length===0}else{const ue=await fu();await new Promise(te=>setTimeout(te,200)),g=ue.session_id,S=!0}const k=L.map(({id:ue,...te})=>({...te})),j={role:"user",content:c,attachments:k,id:`msg-${Date.now()}-${Math.random()}`};Xp.current=!0,Zp.current=g,vr(g,!1),Pe.current===g&&(Bt.current=Pe.current),lp.flushSync(()=>{t(ue=>ue.map(te=>te.session_id===g?{...te,messages:[...te.messages||[],j]}:te)),z(""),D([])}),requestAnimationFrame(()=>si("auto",g));const F=ru(g);try{let ue=[];if(j.content)try{ue=[...(((U=e.find(oe=>oe.session_id===g))==null?void 0:U.messages)||[]).slice(-8).map(oe=>({role:oe.role,content:oe.content||""})),{role:"user",content:j.content}]}catch{}let te=j.content||null,ke=[];const Te=[],hn=su(g);if(j.content&&((W=hn==null?void 0:hn.states)!=null&&W.is_indexed))try{const K=await Ga(hn.slug,j.content,F.signal);K.contextBlock&&Te.push(K.contextBlock),Array.isArray(K.sources)&&ke.push(...K.sources)}catch(K){if(Nt(K))throw K;console.warn("local library enrichment failed",K)}if(j.content&&gl)try{const G=await(await fetch(`${V}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({prompt:j.content,model:he,messages:ue,history_limit:8,searx_url:mr||null,engines:Array.isArray(cn)?cn:null})})).json();G&&typeof G.context_block=="string"&&G.context_block.trim()&&Te.push(G.context_block.trim()),Array.isArray(G==null?void 0:G.sources)&&ke.push(...G.sources)}catch(K){if(Nt(K))throw K;console.warn("web search enrichment failed",K)}if(ke=[...new Set(ke)],j.content&&Te.length>0&&(te=`${j.content} + +${Te.join(` + +`)}`),ml){const K=`msg-${Date.now()}-${Math.random()}`;let G="";const oe={role:"assistant",content:"",id:K,sources:ke};t(we=>we.map(Q=>Q.session_id===g?{...Q,messages:[...Q.messages||[],oe]}:Q));try{const we=await fetch(`${V}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({session_id:g,model:he,message:j.content,enriched_message:j.content&&Te.length>0?te:null,stream:!0,sources:ke||[],attachments:k})});if(!we.ok)throw new Error(`HTTP ${we.status}`);const Q=(X=we.body)==null?void 0:X.getReader();if(!Q)throw new Error("Missing response body");const Ge=new TextDecoder;let re=!1;for(;;){const{value:ve,done:Ht}=await Q.read();if(Ht){fn(g,K,G),Pe.current===g?Mn.current[g]?On(Ae=>({...Ae,[g]:K})):requestAnimationFrame(()=>Fn(K,"smooth",g)):(dn(Ae=>({...Ae,[g]:K})),$n(Ae=>[...new Set([...Ae,g])]));break}const Cl=Ge.decode(ve,{stream:!0});G+=Cl,fn(g,K,G),Pe.current===g&&!Mn.current[g]&&si("auto",g),Pe.current!==g&&!re&&(dn(Ae=>({...Ae,[g]:K})),re=!0)}}catch(we){if(Nt(we)){fn(g,K,G,{removeIfEmpty:!0});return}console.error("Failed to send message:",we),fn(g,K,"Error: "+gr(we),{removeIfEmpty:!0});return}}else{const K=await fetch(`${V}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:F.signal,body:JSON.stringify({session_id:g,model:he,message:j.content,enriched_message:j.content&&Te.length>0?te:null,stream:!1,sources:ke||[],attachments:k})});if(!K.ok)throw new Error(`HTTP ${K.status}`);const G=await K.json(),oe=`msg-${Date.now()}`,we={role:"assistant",content:G.reply,id:oe,sources:ke};t(Q=>Q.map(Ge=>Ge.session_id===g?{...Ge,messages:[...Ge.messages||[],we]}:Ge)),oe&&(Pe.current===g?Mn.current[g]?On(Q=>({...Q,[g]:oe})):requestAnimationFrame(()=>Fn(oe,"smooth",g)):dn(Q=>({...Q,[g]:oe})))}Pe.current!==g&&$n(K=>[...new Set([...K,g])]),S&&fetch(`${V}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:g,message:j.content||(k.length>0?"Image attachment":j.content),model:he})}).then(K=>K.json()).then(K=>{const G=Xy(K.title);t(oe=>oe.map(we=>we.session_id===g?{...we,name:G}:we))})}catch(ue){if(Nt(ue)){ni(F);return}console.error("Failed to send message:",ue);const te={role:"assistant",content:"Error: "+gr(ue),id:`msg-${Date.now()}-${Math.random()}`};t(ke=>ke.map(Te=>Te.session_id===g?{...Te,messages:[...Te.messages,te]}:Te))}finally{ni(F)}}function ph(){Op(c=>!c)}async function fu(){var j;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),S=await(await fetch(`${V}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),k={...S,messages:[]};return t(F=>[k,...F]),r(S.session_id),(j=at.current)==null||j.focus(),S}function hh(c){r(c),$n(S=>S.filter(k=>k!==c));const g=Yp[c];g&&requestAnimationFrame(()=>{let S=12;const k=()=>{if(!ee.current)return;let F=document.getElementById(g);if(!F){const U=e.find(W=>W.session_id===c);if(U&&Array.isArray(U.messages))for(let W=U.messages.length-1;W>=0;W--){const X=U.messages[W];if(X.role==="assistant"&&X.id){F=document.getElementById(X.id);break}}}F?(Fn(F.id,"smooth",c),dn(U=>{const{[c]:W,...X}=U;return X})):S-- >0&&requestAnimationFrame(k)};requestAnimationFrame(k)})}function mh(c,g){fetch(`${V}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:g})}).then(()=>{t(S=>S.map(k=>k.session_id===c?{...k,name:g}:k)),u(null)})}function gh(c,g){const S=(g||"").trim(),k=w.find(j=>j.slug===c);if(!k){y(null);return}if(!S||S===k.name){y(null);return}fetch(`${V}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:S})}).then(()=>{x(j=>j.map(F=>F.slug===c?{...F,name:S}:F)),y(null)})}function du(c){fetch(`${V}/sessions/${c}`,{method:"DELETE"}).then(()=>{const g=e.filter(S=>S.session_id!==c);t(g),p(S=>{const k={...S||{}};return delete k[c],k}),n===c&&r(g.length>0?g[0].session_id:null)})}function vh(c){fetch(`${V}/libraries/${c}`,{method:"DELETE"}).then(async g=>{var k;if(!g.ok){const j=await g.text();throw new Error(j||`HTTP ${g.status}`)}const S=w.filter(j=>j.slug!==c);x(S),N(j=>j.filter(F=>F.slug!==c)),y(j=>j===c?null:j),_===c&&m(((k=S[0])==null?void 0:k.slug)||null),sh(c)}).catch(g=>{console.error("Failed to delete library",g)})}v.useEffect(()=>{const c=e.filter(g=>g.name==="New Chat"&&g.session_id!==n&&g.messages.length===0);c.length>0&&c.forEach(g=>{du(g.session_id)})},[n,e,V]);const yh=c=>{var S;window.getSelection().toString().length>0||document.activeElement!==at.current&&(c.target.closest(".msg")||(S=at.current)==null||S.focus())};return f.jsxs("div",{className:"app",style:{gridTemplateColumns:`${eh}px 1fr`},children:[f.jsxs("div",{className:"sidebar",children:[f.jsxs("div",{className:"sidebar-header",children:[f.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>oi("chats"),children:"Chats"}),f.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>oi("dbs"),children:"DBs"}),f.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>oi("settings"),children:"Settings"})]}),f.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&f.jsx("div",{className:"chat-list",children:e.map(c=>f.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>oh(c.session_id),children:a===c.session_id?f.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:g=>{g.key==="Enter"?mh(c.session_id,g.target.value):g.key==="Escape"&&u(null)},autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:c.name}),f.jsxs("div",{className:"chat-item-buttons",children:[Ap.includes(c.session_id)&&f.jsx("div",{className:"unread-dot"}),f.jsx("button",{className:"icon-button",onClick:g=>{g.stopPropagation(),u(c.session_id)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:f.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),f.jsx("button",{className:"icon-button",onClick:g=>{g.stopPropagation(),du(c.session_id)},children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&f.jsx("div",{className:"db-list",children:w.length===0?f.jsx("div",{className:"empty-list-message",children:"No databases yet."}):w.map(c=>f.jsx("div",{className:`chat-item ${c.slug===_?"active":""}`,onClick:()=>m(c.slug),children:h===c.slug?f.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>y(null),onKeyDown:g=>{g.key==="Enter"?gh(c.slug,g.target.value):g.key==="Escape"&&y(null)},autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:c.name}),f.jsxs("div",{className:"chat-item-buttons",children:[_t===c.slug&&f.jsx("div",{className:"db-active-badge",children:"Chat"}),au(c.slug)&&f.jsx("div",{className:"db-active-badge",children:"Syncing"}),f.jsx("button",{className:"icon-button",onClick:g=>{g.stopPropagation(),y(c.slug)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:f.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),f.jsx("button",{className:"icon-button",onClick:g=>{g.stopPropagation(),vh(c.slug)},children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.slug))}),l==="settings"&&f.jsxs("div",{className:"settings-list",children:[f.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>s("General"),children:"General"}),f.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>s("Interface"),children:"Interface"}),f.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>s("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&f.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&f.jsx("button",{className:"button new-chat-button",onClick:fu,children:"New Chat"}),l==="dbs"&&(C?f.jsxs("div",{className:"new-db-form",children:[f.jsx("input",{type:"text",className:"rename-input",value:$,onChange:c=>O(c.target.value),onKeyDown:c=>{c.key==="Enter"?ou():c.key==="Escape"&&(T(!1),O(""),H(""))},placeholder:"Database name",autoFocus:!0}),A&&f.jsx("div",{className:"form-error",children:A}),f.jsxs("div",{className:"new-db-actions",children:[f.jsx("button",{className:"button new-db-button",onClick:()=>ou(),children:"Create"}),f.jsx("button",{className:"button ghost",onClick:()=>{T(!1),O(""),H("")},children:"Cancel"})]})]}):f.jsx("button",{className:"button new-db-button",onClick:()=>{T(!0),H("")},children:"New Database"}))]}),f.jsx("div",{className:"resizer",onMouseDown:nh})]}),f.jsxs("div",{className:`main-content${l==="chats"&&b?" main-content--drag-active":""}`,onDragEnter:uh,onDragOver:ch,onDragLeave:fh,onDrop:dh,children:[Wa&&f.jsxs("div",{className:"startup-task-banner",role:"status","aria-live":"polite",children:[Rp&&f.jsx("div",{className:"spinner startup-task-banner__spinner"}),f.jsx("div",{className:"startup-task-banner__text",children:Wa})]}),l==="chats"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"header",children:[f.jsxs("strong",{children:["Chat - ",((pu=e.find(c=>c.session_id===n))==null?void 0:pu.name)||"New Chat"]}),ut&&f.jsx("span",{className:"header-subtle",children:`DB: ${ut.name}${ii}`})]}),f.jsx("div",{className:`chat${b?" chat--drag-active":""}`,ref:ee,onClick:yh,children:In.map((c,g)=>{const S=c.role==="user"&&Fp===g;return f.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(S?" editing":""),children:c.role==="assistant"?f.jsxs("div",{className:"assistant-message-wrapper",children:[f.jsx(Zy,{content:c.content,streamOutput:ml,sources:c.sources}),!Ut&&f.jsxs("div",{className:"message-options-bar assistant-options",children:[f.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ya(c),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),f.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>Xa(g),children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):f.jsxs("div",{className:"user-message-wrapper",children:[S?f.jsxs(f.Fragment,{children:[f.jsx(Di,{attachments:c.attachments,className:"message-attachment-strip"}),f.jsxs("div",{className:"msg-content msg-content--user editing",children:[f.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:ti}),f.jsx(Mc,{className:"edit-message-input edit-overlay",value:ti,onChange:k=>yl(k.target.value),onBlur:Sl,onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),Sl()),k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),Qp(g))},autoFocus:!0,minRows:1})]})]}):(()=>{const k=c.content||"",j=Array.isArray(c.attachments)?c.attachments:[],F=k.split(/\r\n|\r|\n/),U=F.length>30,W=nu(c,g,n),X=U?Gp[W]??!0:!1,ue=X?F.slice(0,30).join(` +`)+` +…`:k,te=!!k.trim();return f.jsxs(f.Fragment,{children:[f.jsx(Di,{attachments:j,className:"message-attachment-strip"}),te&&f.jsx("div",{className:"msg-content msg-content--user",children:ue}),te&&U&&f.jsx("button",{className:"user-msg-expand",onClick:()=>Jp(W),"aria-expanded":X?"false":"true",children:X?"Show entire message":"Collapse"})]})})(),!Ut&&!S&&f.jsxs("div",{className:"message-options-bar user-options",children:[f.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>Vp(g,c.content),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M12 20h9"}),f.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),f.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ya(c),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||g)})},n),eu[n]&&f.jsxs("button",{className:"new-msg-tip",onClick:ah,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",f.jsx("span",{style:{marginLeft:6},children:"↓"})]}),f.jsx("div",{className:"footer",children:f.jsxs("div",{className:`footer-inner${b?" footer-inner--drag-active":""}`,children:[f.jsx("input",{ref:Rn,type:"file",accept:"image/*",multiple:!0,className:"composer-image-input",onChange:bp,tabIndex:-1}),f.jsx(Di,{attachments:L,className:"composer-attachment-strip",removable:!0,onRemove:Hp}),f.jsxs("div",{className:"footer-content-wrapper",children:[f.jsx(Mc,{ref:at,className:"input",value:M,onChange:c=>z(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),cu())},placeholder:"Ask any question...",maxRows:13}),f.jsxs("div",{className:"footer-tool-group",ref:yt,children:[f.jsx("button",{type:"button",className:"db-picker-toggle"+(ut?" active":""),onClick:()=>{n&&ne(c=>!c)},title:ut?`Database: ${ut.name}${ii}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":B,disabled:!n,children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),f.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),f.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),B&&f.jsxs("div",{className:"db-picker-menu",role:"menu",children:[f.jsxs("button",{type:"button",className:"db-picker-option"+(_t?"":" selected"),onClick:()=>{uu(n,null),ne(!1)},children:[f.jsx("span",{children:"No database"}),!_t&&f.jsx("span",{className:"db-picker-status",children:"Selected"})]}),w.length===0?f.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):w.map(c=>{var j,F,U;const g=_t===c.slug,S=au(c.slug),k=(j=c.files)!=null&&j.length?(F=c.states)!=null&&F.is_indexed?"Ready":S?"Syncing":"Needs sync":"Empty";return f.jsxs("button",{type:"button",className:"db-picker-option"+(g?" selected":""),disabled:!((U=c.files)!=null&&U.length),onClick:()=>{uu(n,c.slug),ne(!1)},children:[f.jsx("span",{children:c.name}),f.jsx("span",{className:"db-picker-status",children:g?"Selected":k})]},c.slug)})]})]}),Ne&&f.jsx("button",{type:"button",className:"image-attach-toggle"+(L.length>0?" active":""),onClick:Wp,title:"Attach images","aria-label":"Attach images",children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),f.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),f.jsx("path",{d:"M21 15l-5-5L5 21"})]})}),f.jsx("button",{type:"button",className:"websearch-toggle"+(gl?" active":""),onClick:ph,title:"Toggle web search","aria-pressed":gl,children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),f.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),f.jsx("button",{className:"button",onClick:Ut?qp:cu,title:Ut?"Cancel generation":"Send","aria-label":Ut?"Cancel generation":"Send",children:Ut?f.jsx("div",{className:"spinner"}):"Send"})]})]})})]}),l==="dbs"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"header",children:[f.jsx("strong",{children:(El==null?void 0:El.name)||"Databases"}),ut&&f.jsx("span",{className:"header-subtle",children:`Current chat DB: ${ut.name}${ii}`})]}),f.jsx(Vy,{apiBase:V,library:El,jobs:E,onRefresh:async()=>{await yr(),await kl()}})]}),l==="settings"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"header",children:f.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&f.jsx(zy,{onModelChange:Ye,onBackendApiUrlChange:Ua,streamOutput:ml,onStreamOutputChange:Ha,onLibrariesPurged:lh}),i==="Interface"&&f.jsx(Wy,{}),i==="Websearch"&&f.jsx(Gy,{searxUrl:mr,setSearxUrl:$p,engines:cn,setEngines:c=>Mp($o(c))})]})]})]})}function o0(){return v.useEffect(()=>{window.electronAPI.getSettings().then(e=>{il(e.colorScheme||"Default")})},[]),f.jsx(Fe.StrictMode,{children:f.jsx(iy,{children:f.jsx(Fv,{children:f.jsx(vp,{path:"/",element:f.jsx(l0,{})})})})})}const i0=op(document.getElementById("root"));i0.render(f.jsx(o0,{})); diff --git a/dist/assets/index-CUHp6hE9.js b/dist/assets/index-CUHp6hE9.js deleted file mode 100644 index 1755360..0000000 --- a/dist/assets/index-CUHp6hE9.js +++ /dev/null @@ -1,73 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tc={exports:{}},Po={},$c={exports:{}},Y={};/** - * @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 ol=Symbol.for("react.element"),Zp=Symbol.for("react.portal"),qp=Symbol.for("react.fragment"),eh=Symbol.for("react.strict_mode"),th=Symbol.for("react.profiler"),nh=Symbol.for("react.provider"),rh=Symbol.for("react.context"),lh=Symbol.for("react.forward_ref"),oh=Symbol.for("react.suspense"),ih=Symbol.for("react.memo"),sh=Symbol.for("react.lazy"),tu=Symbol.iterator;function ah(e){return e===null||typeof e!="object"?null:(e=tu&&e[tu]||e["@@iterator"],typeof e=="function"?e:null)}var Mc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Oc=Object.assign,zc={};function cr(e,t,n){this.props=e,this.context=t,this.refs=zc,this.updater=n||Mc}cr.prototype.isReactComponent={};cr.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")};cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fc(){}Fc.prototype=cr.prototype;function $s(e,t,n){this.props=e,this.context=t,this.refs=zc,this.updater=n||Mc}var Ms=$s.prototype=new Fc;Ms.constructor=$s;Oc(Ms,cr.prototype);Ms.isPureReactComponent=!0;var nu=Array.isArray,Ic=Object.prototype.hasOwnProperty,Os={current:null},Dc={key:!0,ref:!0,__self:!0,__source:!0};function Ac(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Ic.call(t,r)&&!Dc.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,pe=R[Z];if(0>>1;Zl(Rn,b))Vel(Tn,Rn)?(R[Z]=Tn,R[Ve]=b,Z=Ve):(R[Z]=Rn,R[ht]=b,Z=ht);else if(Vel(Tn,b))R[Z]=Tn,R[Ve]=b,Z=Ve;else break e}}return O}function l(R,O){var b=R.sortIndex-O.sortIndex;return b!==0?b:R.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var a=[],c=[],h=1,g=null,y=3,S=!1,C=!1,E=!1,L=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(R){for(var O=n(c);O!==null;){if(O.callback===null)r(c);else if(O.startTime<=R)r(c),O.sortIndex=O.expirationTime,t(a,O);else break;O=n(c)}}function N(R){if(E=!1,p(R),!C)if(n(a)!==null)C=!0,T(P);else{var O=n(c);O!==null&&H(N,O.startTime-R)}}function P(R,O){C=!1,E&&(E=!1,m(F),F=-1),S=!0;var b=y;try{for(p(O),g=n(a);g!==null&&(!(g.expirationTime>O)||R&&!q());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var pe=Z(g.expirationTime<=O);O=e.unstable_now(),typeof pe=="function"?g.callback=pe:g===n(a)&&r(a),p(O)}else r(a);g=n(a)}if(g!==null)var kt=!0;else{var ht=n(c);ht!==null&&H(N,ht.startTime-O),kt=!1}return kt}finally{g=null,y=b,S=!1}}var M=!1,z=null,F=-1,B=5,U=-1;function q(){return!(e.unstable_now()-UR||125Z?(R.sortIndex=b,t(c,R),n(a)===null&&R===n(c)&&(E?(m(F),F=-1):E=!0,H(N,b-Z))):(R.sortIndex=pe,t(a,R),C||S||(C=!0,T(P))),R},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(R){var O=y;return function(){var b=y;y=O;try{return R.apply(this,arguments)}finally{y=b}}}})(bc);Wc.exports=bc;var wh=Wc.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 Sh=v,Ge=wh;function j(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"),zi=Object.prototype.hasOwnProperty,xh=/^[: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]*$/,lu={},ou={};function kh(e){return zi.call(ou,e)?!0:zi.call(lu,e)?!1:xh.test(e)?ou[e]=!0:(lu[e]=!0,!1)}function Eh(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 Ch(e,t,n,r){if(t===null||typeof t>"u"||Eh(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 Ie(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ne[e]=new Ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ne[t]=new Ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ne[e]=new Ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ne[e]=new Ie(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){Ne[e]=new Ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ne[e]=new Ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ne[e]=new Ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ne[e]=new Ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ne[e]=new Ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Fs=/[\-:]([a-z])/g;function Is(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(Fs,Is);Ne[t]=new Ie(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(Fs,Is);Ne[t]=new Ie(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(Fs,Is);Ne[t]=new Ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ne[e]=new Ie(e,1,!1,e.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ne[e]=new Ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ds(e,t,n,r){var l=Ne.hasOwnProperty(t)?Ne[t]:null;(l!==null?l.type!==0:r||!(2s||l[i]!==o[s]){var a=` -`+l[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=s);break}}}finally{si=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Lr(e):""}function Nh(e){switch(e.tag){case 5:return Lr(e.type);case 16:return Lr("Lazy");case 13:return Lr("Suspense");case 19:return Lr("SuspenseList");case 0:case 2:case 15:return e=ai(e.type,!1),e;case 11:return e=ai(e.type.render,!1),e;case 1:return e=ai(e.type,!0),e;default:return""}}function Ai(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 Un:return"Fragment";case An:return"Portal";case Fi:return"Profiler";case As:return"StrictMode";case Ii:return"Suspense";case Di:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kc:return(e.displayName||"Context")+".Consumer";case Qc:return(e._context.displayName||"Context")+".Provider";case Us:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bs:return t=e.displayName||null,t!==null?t:Ai(e.type)||"Memo";case Wt:t=e._payload,e=e._init;try{return Ai(e(t))}catch{}}return null}function _h(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 Ai(t);case 8:return t===As?"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 rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lh(e){var t=Gc(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 l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function El(e){e._valueTracker||(e._valueTracker=Lh(e))}function Jc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function to(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 Ui(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function su(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rn(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 Xc(e,t){t=t.checked,t!=null&&Ds(e,"checked",t,!1)}function Bi(e,t){Xc(e,t);var n=rn(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")?Hi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hi(e,t.type,rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function au(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 Hi(e,t,n){(t!=="number"||to(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Pr=Array.isArray;function Xn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Cl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Br(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tr={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},Ph=["Webkit","ms","Moz","O"];Object.keys(Tr).forEach(function(e){Ph.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tr[t]=Tr[e]})});function tf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tr.hasOwnProperty(e)&&Tr[e]?(""+t).trim():t+"px"}function nf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=tf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var jh=ue({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 Vi(e,t){if(t){if(jh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function Qi(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 Ki=null;function Hs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,Zn=null,qn=null;function fu(e){if(e=al(e)){if(typeof Yi!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Mo(t),Yi(e.stateNode,e.type,t))}}function rf(e){Zn?qn?qn.push(e):qn=[e]:Zn=e}function lf(){if(Zn){var e=Zn,t=qn;if(qn=Zn=null,fu(e),t)for(e=0;e>>=0,e===0?32:31-(Uh(e)/Bh|0)|0}var Nl=64,_l=4194304;function jr(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 oo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var s=i&~l;s!==0?r=jr(s):(o&=i,o!==0&&(r=jr(o)))}else i=n&~l,i!==0?r=jr(i):o!==0&&(r=jr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function il(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ct(t),e[t]=n}function Vh(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=Mr),Su=" ",xu=!1;function Nf(e,t){switch(e){case"keyup":return wm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _f(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function xm(e,t){switch(e){case"compositionend":return _f(t);case"keypress":return t.which!==32?null:(xu=!0,Su);case"textInput":return e=t.data,e===Su&&xu?null:e;default:return null}}function km(e,t){if(Bn)return e==="compositionend"||!Js&&Nf(e,t)?(e=Ef(),Wl=Ks=Kt=null,Bn=!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=Nu(n)}}function Rf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tf(){for(var e=window,t=to();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=to(e.document)}return t}function Xs(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 Tm(e){var t=Tf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rf(n.ownerDocument.documentElement,n)){if(r!==null&&Xs(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 l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=_u(n,o);var i=_u(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,Hn=null,es=null,zr=null,ts=!1;function Lu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ts||Hn==null||Hn!==to(r)||(r=Hn,"selectionStart"in r&&Xs(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}),zr&&Kr(zr,r)||(zr=r,r=ao(es,"onSelect"),0Vn||(e.current=ss[Vn],ss[Vn]=null,Vn--)}function ee(e,t){Vn++,ss[Vn]=e.current,e.current=t}var ln={},Te=sn(ln),Ue=sn(!1),xn=ln;function lr(e,t){var n=e.type.contextTypes;if(!n)return ln;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Be(e){return e=e.childContextTypes,e!=null}function co(){re(Ue),re(Te)}function Ou(e,t,n){if(Te.current!==ln)throw Error(j(168));ee(Te,t),ee(Ue,n)}function Uf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,_h(e)||"Unknown",l));return ue({},n,r)}function fo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,xn=Te.current,ee(Te,e),ee(Ue,Ue.current),!0}function zu(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=Uf(e,t,xn),r.__reactInternalMemoizedMergedChildContext=e,re(Ue),re(Te),ee(Te,e)):re(Ue),ee(Ue,n)}var _t=null,Oo=!1,ki=!1;function Bf(e){_t===null?_t=[e]:_t.push(e)}function Wm(e){Oo=!0,Bf(e)}function an(){if(!ki&&_t!==null){ki=!0;var e=0,t=X;try{var n=_t;for(X=1;e>=i,l-=i,Lt=1<<32-ct(t)+l|n<F?(B=z,z=null):B=z.sibling;var U=y(m,z,p[F],N);if(U===null){z===null&&(z=B);break}e&&z&&U.alternate===null&&t(m,z),d=o(U,d,F),M===null?P=U:M.sibling=U,M=U,z=B}if(F===p.length)return n(m,z),le&&hn(m,F),P;if(z===null){for(;FF?(B=z,z=null):B=z.sibling;var q=y(m,z,U.value,N);if(q===null){z===null&&(z=B);break}e&&z&&q.alternate===null&&t(m,z),d=o(q,d,F),M===null?P=q:M.sibling=q,M=q,z=B}if(U.done)return n(m,z),le&&hn(m,F),P;if(z===null){for(;!U.done;F++,U=p.next())U=g(m,U.value,N),U!==null&&(d=o(U,d,F),M===null?P=U:M.sibling=U,M=U);return le&&hn(m,F),P}for(z=r(m,z);!U.done;F++,U=p.next())U=S(z,m,F,U.value,N),U!==null&&(e&&U.alternate!==null&&z.delete(U.key===null?F:U.key),d=o(U,d,F),M===null?P=U:M.sibling=U,M=U);return e&&z.forEach(function(ge){return t(m,ge)}),le&&hn(m,F),P}function L(m,d,p,N){if(typeof p=="object"&&p!==null&&p.type===Un&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case kl:e:{for(var P=p.key,M=d;M!==null;){if(M.key===P){if(P=p.type,P===Un){if(M.tag===7){n(m,M.sibling),d=l(M,p.props.children),d.return=m,m=d;break e}}else if(M.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Wt&&Du(P)===M.type){n(m,M.sibling),d=l(M,p.props),d.ref=kr(m,M,p),d.return=m,m=d;break e}n(m,M);break}else t(m,M);M=M.sibling}p.type===Un?(d=Sn(p.props.children,m.mode,N,p.key),d.return=m,m=d):(N=Xl(p.type,p.key,p.props,null,m.mode,N),N.ref=kr(m,d,p),N.return=m,m=N)}return i(m);case An:e:{for(M=p.key;d!==null;){if(d.key===M)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(m,d.sibling),d=l(d,p.children||[]),d.return=m,m=d;break e}else{n(m,d);break}else t(m,d);d=d.sibling}d=Ri(p,m.mode,N),d.return=m,m=d}return i(m);case Wt:return M=p._init,L(m,d,M(p._payload),N)}if(Pr(p))return C(m,d,p,N);if(vr(p))return E(m,d,p,N);Ml(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(m,d.sibling),d=l(d,p),d.return=m,m=d):(n(m,d),d=ji(p,m.mode,N),d.return=m,m=d),i(m)):n(m,d)}return L}var ir=Vf(!0),Qf=Vf(!1),mo=sn(null),go=null,Yn=null,ta=null;function na(){ta=Yn=go=null}function ra(e){var t=mo.current;re(mo),e._currentValue=t}function cs(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 tr(e,t){go=e,ta=Yn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ae=!0),e.firstContext=null)}function rt(e){var t=e._currentValue;if(ta!==e)if(e={context:e,memoizedValue:t,next:null},Yn===null){if(go===null)throw Error(j(308));Yn=e,go.dependencies={lanes:0,firstContext:e}}else Yn=Yn.next=e;return t}var vn=null;function la(e){vn===null?vn=[e]:vn.push(e)}function Kf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,la(t)):(n.next=l.next,l.next=n),t.interleaved=n,Mt(e,r)}function Mt(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 bt=!1;function oa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yf(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 jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Mt(e,n)}return l=r.interleaved,l===null?(t.next=t,la(r)):(t.next=l.next,l.next=t),r.interleaved=t,Mt(e,n)}function Vl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bs(e,n)}}function Au(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vo(e,t,n,r){var l=e.updateQueue;bt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var a=s,c=a.next;a.next=null,i===null?o=c:i.next=c,i=a;var h=e.alternate;h!==null&&(h=h.updateQueue,s=h.lastBaseUpdate,s!==i&&(s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=a))}if(o!==null){var g=l.baseState;i=0,h=c=a=null,s=o;do{var y=s.lane,S=s.eventTime;if((r&y)===y){h!==null&&(h=h.next={eventTime:S,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var C=e,E=s;switch(y=t,S=n,E.tag){case 1:if(C=E.payload,typeof C=="function"){g=C.call(S,g,y);break e}g=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=E.payload,y=typeof C=="function"?C.call(S,g,y):C,y==null)break e;g=ue({},g,y);break e;case 2:bt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[s]:y.push(s))}else S={eventTime:S,lane:y,tag:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(c=h=S,a=g):h=h.next=S,i|=y;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;y=s,s=y.next,y.next=null,l.lastBaseUpdate=y,l.shared.pending=null}}while(!0);if(h===null&&(a=g),l.baseState=a,l.firstBaseUpdate=c,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Cn|=i,e.lanes=i,e.memoizedState=g}}function Uu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ci.transition;Ci.transition={};try{e(!1),t()}finally{X=n,Ci.transition=r}}function fd(){return lt().memoizedState}function Km(e,t,n){var r=tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dd(e))pd(t,n);else if(n=Kf(e,t,n,r),n!==null){var l=ze();ft(n,e,r,l),hd(n,t,r)}}function Ym(e,t,n){var r=tn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dd(e))pd(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,s=o(i,n);if(l.hasEagerState=!0,l.eagerState=s,dt(s,i)){var a=t.interleaved;a===null?(l.next=l,la(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=Kf(e,t,l,r),n!==null&&(l=ze(),ft(n,e,r,l),hd(n,t,r))}}function dd(e){var t=e.alternate;return e===se||t!==null&&t===se}function pd(e,t){Fr=wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bs(e,n)}}var So={readContext:rt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Gm={readContext:rt,useCallback:function(e,t){return vt().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:Hu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kl(4194308,4,id.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=Km.bind(null,se,e),[r.memoizedState,e]},useRef:function(e){var t=vt();return e={current:e},t.memoizedState=e},useState:Bu,useDebugValue:pa,useDeferredValue:function(e){return vt().memoizedState=e},useTransition:function(){var e=Bu(!1),t=e[0];return e=Qm.bind(null,e[1]),vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=se,l=vt();if(le){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),xe===null)throw Error(j(349));En&30||Zf(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Hu(ed.bind(null,r,o,e),[e]),r.flags|=2048,tl(9,qf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=vt(),t=xe.identifierPrefix;if(le){var n=Pt,r=Lt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[yt]=t,e[Jr]=r,Cd(e,t,!1,!1),t.stateNode=e;e:{switch(i=Qi(n,r),n){case"dialog":ne("cancel",e),ne("close",e),l=r;break;case"iframe":case"object":case"embed":ne("load",e),l=r;break;case"video":case"audio":for(l=0;lur&&(t.flags|=128,r=!0,Er(o,!1),t.lanes=4194304)}else{if(!r)if(e=yo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Er(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!le)return je(t),null}else 2*de()-o.renderingStartTime>ur&&n!==1073741824&&(t.flags|=128,r=!0,Er(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=de(),t.sibling=null,n=ie.current,ee(ie,r?n&1|2:n&1),t):(je(t),null);case 22:case 23:return wa(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function rg(e,t){switch(qs(t),t.tag){case 1:return Be(t.type)&&co(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sr(),re(Ue),re(Te),aa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return sa(t),null;case 13:if(re(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(ie),null;case 4:return sr(),null;case 10:return ra(t.type._context),null;case 22:case 23:return wa(),null;case 24:return null;default:return null}}var zl=!1,Re=!1,lg=typeof WeakSet=="function"?WeakSet:Set,I=null;function Gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ce(e,t,r)}else n.current=null}function ws(e,t,n){try{n()}catch(r){ce(e,t,r)}}var qu=!1;function og(e,t){if(ns=io,e=Tf(),Xs(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 l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,s=-1,a=-1,c=0,h=0,g=e,y=null;t:for(;;){for(var S;g!==n||l!==0&&g.nodeType!==3||(s=i+l),g!==o||r!==0&&g.nodeType!==3||(a=i+r),g.nodeType===3&&(i+=g.nodeValue.length),(S=g.firstChild)!==null;)y=g,g=S;for(;;){if(g===e)break t;if(y===n&&++c===l&&(s=i),y===o&&++h===r&&(a=i),(S=g.nextSibling)!==null)break;g=y,y=g.parentNode}g=S}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(rs={focusedElem:e,selectionRange:n},io=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var E=C.memoizedProps,L=C.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?E:st(t.type,E),L);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(N){ce(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return C=qu,qu=!1,C}function Ir(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&ws(t,n,o)}l=l.next}while(l!==r)}}function Io(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 Ss(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 Ld(e){var t=e.alternate;t!==null&&(e.alternate=null,Ld(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[Jr],delete t[is],delete t[Bm],delete t[Hm])),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 Pd(e){return e.tag===5||e.tag===3||e.tag===4}function ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pd(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 xs(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=uo));else if(r!==4&&(e=e.child,e!==null))for(xs(e,t,n),e=e.sibling;e!==null;)xs(e,t,n),e=e.sibling}function ks(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(ks(e,t,n),e=e.sibling;e!==null;)ks(e,t,n),e=e.sibling}var Ee=null,at=!1;function Ht(e,t,n){for(n=n.child;n!==null;)jd(e,t,n),n=n.sibling}function jd(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(jo,n)}catch{}switch(n.tag){case 5:Re||Gn(n,t);case 6:var r=Ee,l=at;Ee=null,Ht(e,t,n),Ee=r,at=l,Ee!==null&&(at?(e=Ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ee.removeChild(n.stateNode));break;case 18:Ee!==null&&(at?(e=Ee,n=n.stateNode,e.nodeType===8?xi(e.parentNode,n):e.nodeType===1&&xi(e,n),Vr(e)):xi(Ee,n.stateNode));break;case 4:r=Ee,l=at,Ee=n.stateNode.containerInfo,at=!0,Ht(e,t,n),Ee=r,at=l;break;case 0:case 11:case 14:case 15:if(!Re&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&ws(n,t,i),l=l.next}while(l!==r)}Ht(e,t,n);break;case 1:if(!Re&&(Gn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ce(n,t,s)}Ht(e,t,n);break;case 21:Ht(e,t,n);break;case 22:n.mode&1?(Re=(r=Re)||n.memoizedState!==null,Ht(e,t,n),Re=r):Ht(e,t,n);break;default:Ht(e,t,n)}}function tc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lg),t.forEach(function(r){var l=hg.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sg(r/1960))-r,10e?16:e,Yt===null)var r=!1;else{if(e=Yt,Yt=null,Eo=0,G&6)throw Error(j(331));var l=G;for(G|=4,I=e.current;I!==null;){var o=I,i=o.child;if(I.flags&16){var s=o.deletions;if(s!==null){for(var a=0;ade()-va?wn(e,0):ga|=n),He(e,t)}function Id(e,t){t===0&&(e.mode&1?(t=_l,_l<<=1,!(_l&130023424)&&(_l=4194304)):t=1);var n=ze();e=Mt(e,t),e!==null&&(il(e,t,n),He(e,n))}function pg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Id(e,n)}function hg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),Id(e,n)}var Dd;Dd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ue.current)Ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ae=!1,tg(e,t,n);Ae=!!(e.flags&131072)}else Ae=!1,le&&t.flags&1048576&&Hf(t,ho,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yl(e,t),e=t.pendingProps;var l=lr(t,Te.current);tr(t,n),l=ca(null,t,r,e,l,n);var o=fa();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Be(r)?(o=!0,fo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,oa(t),l.updater=Fo,t.stateNode=l,l._reactInternals=t,ds(t,r,e,n),t=ms(null,t,r,!0,o,n)):(t.tag=0,le&&o&&Zs(t),Oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=gg(r),e=st(r,e),l){case 0:t=hs(null,t,r,e,n);break e;case 1:t=Ju(null,t,r,e,n);break e;case 11:t=Yu(null,t,r,e,n);break e;case 14:t=Gu(null,t,r,st(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),hs(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Ju(e,t,r,l,n);case 3:e:{if(xd(t),e===null)throw Error(j(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Yf(e,t),vo(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=ar(Error(j(423)),t),t=Xu(e,t,r,n,l);break e}else if(r!==l){l=ar(Error(j(424)),t),t=Xu(e,t,r,n,l);break e}else for(Ke=Zt(t.stateNode.containerInfo.firstChild),Ye=t,le=!0,ut=null,n=Qf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(or(),r===l){t=Ot(e,t,n);break e}Oe(e,t,r,n)}t=t.child}return t;case 5:return Gf(t),e===null&&us(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,ls(r,l)?i=null:o!==null&&ls(r,o)&&(t.flags|=32),Sd(e,t),Oe(e,t,i,n),t.child;case 6:return e===null&&us(t),null;case 13:return kd(e,t,n);case 4:return ia(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ir(t,null,r,n):Oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Yu(e,t,r,l,n);case 7:return Oe(e,t,t.pendingProps,n),t.child;case 8:return Oe(e,t,t.pendingProps.children,n),t.child;case 12:return Oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,ee(mo,r._currentValue),r._currentValue=i,o!==null)if(dt(o.value,i)){if(o.children===l.children&&!Ue.current){t=Ot(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){i=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=jt(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),cs(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(j(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),cs(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,tr(t,n),l=rt(l),r=r(l),t.flags|=1,Oe(e,t,r,n),t.child;case 14:return r=t.type,l=st(r,t.pendingProps),l=st(r.type,l),Gu(e,t,r,l,n);case 15:return yd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Yl(e,t),t.tag=1,Be(r)?(e=!0,fo(t)):e=!1,tr(t,n),md(t,r,l),ds(t,r,l,n),ms(null,t,r,!0,e,n);case 19:return Ed(e,t,n);case 22:return wd(e,t,n)}throw Error(j(156,t.tag))};function Ad(e,t){return df(e,t)}function mg(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 tt(e,t,n,r){return new mg(e,t,n,r)}function xa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gg(e){if(typeof e=="function")return xa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Us)return 11;if(e===Bs)return 14}return 2}function nn(e,t){var n=e.alternate;return n===null?(n=tt(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 Xl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")xa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Un:return Sn(n.children,l,o,t);case As:i=8,l|=8;break;case Fi:return e=tt(12,n,t,l|2),e.elementType=Fi,e.lanes=o,e;case Ii:return e=tt(13,n,t,l),e.elementType=Ii,e.lanes=o,e;case Di:return e=tt(19,n,t,l),e.elementType=Di,e.lanes=o,e;case Yc:return Ao(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qc:i=10;break e;case Kc:i=9;break e;case Us:i=11;break e;case Bs:i=14;break e;case Wt:i=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=tt(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Sn(e,t,n,r){return e=tt(7,e,r,t),e.lanes=n,e}function Ao(e,t,n,r){return e=tt(22,e,r,t),e.elementType=Yc,e.lanes=n,e.stateNode={isHidden:!1},e}function ji(e,t,n){return e=tt(6,e,null,t),e.lanes=n,e}function Ri(e,t,n){return t=tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vg(e,t,n,r,l){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=ci(0),this.expirationTimes=ci(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ci(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ka(e,t,n,r,l,o,i,s,a){return e=new vg(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=tt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oa(o),e}function yg(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wd)}catch(e){console.error(e)}}Wd(),Hc.exports=Je;var bd=Hc.exports,Vd,uc=bd;Vd=uc.createRoot,uc.hydrateRoot;/** - * react-router v7.8.2 - * - * 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 - */var cc="popstate";function Eg(e={}){function t(l,o){let{pathname:i="/",search:s="",hash:a=""}=Pn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Ls("",{pathname:i,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let a=l.location.href,c=a.indexOf("#");s=c===-1?a:a.slice(0,c)}return s+"#"+(typeof o=="string"?o:rl(o))}function r(l,o){pt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return Ng(t,n,r,e)}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Cg(){return Math.random().toString(36).substring(2,10)}function fc(e,t){return{usr:e.state,key:e.key,idx:t}}function Ls(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Pn(t):t,state:n,key:t&&t.key||r||Cg()}}function rl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Pn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ng(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,s="POP",a=null,c=h();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function h(){return(i.state||{idx:null}).idx}function g(){s="POP";let L=h(),m=L==null?null:L-c;c=L,a&&a({action:s,location:E.location,delta:m})}function y(L,m){s="PUSH";let d=Ls(E.location,L,m);n&&n(d,L),c=h()+1;let p=fc(d,c),N=E.createHref(d);try{i.pushState(p,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(N)}o&&a&&a({action:s,location:E.location,delta:1})}function S(L,m){s="REPLACE";let d=Ls(E.location,L,m);n&&n(d,L),c=h();let p=fc(d,c),N=E.createHref(d);i.replaceState(p,"",N),o&&a&&a({action:s,location:E.location,delta:0})}function C(L){return _g(L)}let E={get action(){return s},get location(){return e(l,i)},listen(L){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(cc,g),a=L,()=>{l.removeEventListener(cc,g),a=null}},createHref(L){return t(l,L)},createURL:C,encodeLocation(L){let m=C(L);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:y,replace:S,go(L){return i.go(L)}};return E}function _g(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ae(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:rl(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Qd(e,t,n="/"){return Lg(e,t,n,!1)}function Lg(e,t,n,r){let l=typeof t=="string"?Pn(t):t,o=zt(l.pathname||"/",n);if(o==null)return null;let i=Kd(e);Pg(i);let s=null;for(let a=0;s==null&&a{let h={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&a)return;ae(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let g=Rt([r,h.relativePath]),y=n.concat(h);i.children&&i.children.length>0&&(ae(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Kd(i.children,t,y,g,a)),!(i.path==null&&!i.index)&&t.push({path:g,score:zg(g,i.index),routesMeta:y})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let c of Yd(i.path))o(i,s,!0,c)}),t}function Yd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=Yd(r.join("/")),s=[];return s.push(...i.map(a=>a===""?o:[o,a].join("/"))),l&&s.push(...i),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function Pg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Fg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var jg=/^:[\w-]+$/,Rg=3,Tg=2,$g=1,Mg=10,Og=-2,dc=e=>e==="*";function zg(e,t){let n=e.split("/"),r=n.length;return n.some(dc)&&(r+=Og),t&&(r+=Tg),n.filter(l=>!dc(l)).reduce((l,o)=>l+(jg.test(o)?Rg:o===""?$g:Mg),r)}function Fg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Ig(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let s=0;s{if(h==="*"){let C=s[y]||"";i=o.slice(0,o.length-C.length).replace(/(.)\/+$/,"$1")}const S=s[y];return g&&!S?c[h]=void 0:c[h]=(S||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function Dg(e,t=!1,n=!0){pt(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=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Ag(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function zt(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 Ug(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Pn(e):e;return{pathname:n?n.startsWith("/")?n:Bg(n,t):t,search:bg(r),hash:Vg(l)}}function Bg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ti(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 Hg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Gd(e){let t=Hg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Jd(e,t,n,r=!1){let l;typeof e=="string"?l=Pn(e):(l={...e},ae(!l.pathname||!l.pathname.includes("?"),Ti("?","pathname","search",l)),ae(!l.pathname||!l.pathname.includes("#"),Ti("#","pathname","hash",l)),ae(!l.search||!l.search.includes("#"),Ti("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,s;if(i==null)s=n;else{let g=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),g-=1;l.pathname=y.join("/")}s=g>=0?t[g]:"/"}let a=Ug(l,s),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(c||h)&&(a.pathname+="/"),a}var Rt=e=>e.join("/").replace(/\/\/+/g,"/"),Wg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Qg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Xd=["POST","PUT","PATCH","DELETE"];new Set(Xd);var Kg=["GET",...Xd];new Set(Kg);var pr=v.createContext(null);pr.displayName="DataRouter";var bo=v.createContext(null);bo.displayName="DataRouterState";v.createContext(!1);var Zd=v.createContext({isTransitioning:!1});Zd.displayName="ViewTransition";var Yg=v.createContext(new Map);Yg.displayName="Fetchers";var Gg=v.createContext(null);Gg.displayName="Await";var xt=v.createContext(null);xt.displayName="Navigation";var cl=v.createContext(null);cl.displayName="Location";var It=v.createContext({outlet:null,matches:[],isDataRoute:!1});It.displayName="Route";var _a=v.createContext(null);_a.displayName="RouteError";function Jg(e,{relative:t}={}){ae(fl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(xt),{hash:l,pathname:o,search:i}=dl(e,{relative:t}),s=o;return n!=="/"&&(s=o==="/"?n:Rt([n,o])),r.createHref({pathname:s,search:i,hash:l})}function fl(){return v.useContext(cl)!=null}function jn(){return ae(fl(),"useLocation() may be used only in the context of a component."),v.useContext(cl).location}var qd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ep(e){v.useContext(xt).static||v.useLayoutEffect(e)}function Xg(){let{isDataRoute:e}=v.useContext(It);return e?cv():Zg()}function Zg(){ae(fl(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(pr),{basename:t,navigator:n}=v.useContext(xt),{matches:r}=v.useContext(It),{pathname:l}=jn(),o=JSON.stringify(Gd(r)),i=v.useRef(!1);return ep(()=>{i.current=!0}),v.useCallback((a,c={})=>{if(pt(i.current,qd),!i.current)return;if(typeof a=="number"){n.go(a);return}let h=Jd(a,JSON.parse(o),l,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Rt([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,l,e])}v.createContext(null);function dl(e,{relative:t}={}){let{matches:n}=v.useContext(It),{pathname:r}=jn(),l=JSON.stringify(Gd(n));return v.useMemo(()=>Jd(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function qg(e,t){return tp(e,t)}function tp(e,t,n,r,l){var d;ae(fl(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=v.useContext(xt),{matches:i}=v.useContext(It),s=i[i.length-1],a=s?s.params:{},c=s?s.pathname:"/",h=s?s.pathnameBase:"/",g=s&&s.route;{let p=g&&g.path||"";np(c,!g||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let y=jn(),S;if(t){let p=typeof t=="string"?Pn(t):t;ae(h==="/"||((d=p.pathname)==null?void 0:d.startsWith(h)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${p.pathname}" was given in the \`location\` prop.`),S=p}else S=y;let C=S.pathname||"/",E=C;if(h!=="/"){let p=h.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let L=Qd(e,{pathname:E});pt(g||L!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),pt(L==null||L[L.length-1].route.element!==void 0||L[L.length-1].route.Component!==void 0||L[L.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let m=lv(L&&L.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:Rt([h,o.encodeLocation?o.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:Rt([h,o.encodeLocation?o.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),i,n,r,l);return t&&m?v.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},m):m}function ev(){let e=uv(),t=Qg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,i)}var tv=v.createElement(ev,null),nv=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(It.Provider,{value:this.props.routeContext},v.createElement(_a.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function rv({routeContext:e,match:t,children:n}){let r=v.useContext(pr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(It.Provider,{value:e},n)}function lv(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let c=o.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);ae(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,c+1))}let s=!1,a=-1;if(n)for(let c=0;c=0?o=o.slice(0,a+1):o=[o[0]];break}}}return o.reduceRight((c,h,g)=>{let y,S=!1,C=null,E=null;n&&(y=i&&h.route.id?i[h.route.id]:void 0,C=h.route.errorElement||tv,s&&(a<0&&g===0?(np("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):a===g&&(S=!0,E=h.route.hydrateFallbackElement||null)));let L=t.concat(o.slice(0,g+1)),m=()=>{let d;return y?d=C:S?d=E:h.route.Component?d=v.createElement(h.route.Component,null):h.route.element?d=h.route.element:d=c,v.createElement(rv,{match:h,routeContext:{outlet:c,matches:L,isDataRoute:n!=null},children:d})};return n&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?v.createElement(nv,{location:n.location,revalidation:n.revalidation,component:C,error:y,children:m(),routeContext:{outlet:null,matches:L,isDataRoute:!0},unstable_onError:r}):m()},null)}function La(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ov(e){let t=v.useContext(pr);return ae(t,La(e)),t}function iv(e){let t=v.useContext(bo);return ae(t,La(e)),t}function sv(e){let t=v.useContext(It);return ae(t,La(e)),t}function Pa(e){let t=sv(e),n=t.matches[t.matches.length-1];return ae(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function av(){return Pa("useRouteId")}function uv(){var r;let e=v.useContext(_a),t=iv("useRouteError"),n=Pa("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function cv(){let{router:e}=ov("useNavigate"),t=Pa("useNavigate"),n=v.useRef(!1);return ep(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{pt(n.current,qd),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var pc={};function np(e,t,n){!t&&!pc[e]&&(pc[e]=!0,pt(!1,n))}v.memo(fv);function fv({routes:e,future:t,state:n,unstable_onError:r}){return tp(e,void 0,n,r,t)}function rp(e){ae(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function dv({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ae(!fl(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=v.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=Pn(n));let{pathname:a="/",search:c="",hash:h="",state:g=null,key:y="default"}=n,S=v.useMemo(()=>{let C=zt(a,i);return C==null?null:{location:{pathname:C,search:c,hash:h,state:g,key:y},navigationType:r}},[i,a,c,h,g,y,r]);return pt(S!=null,` is not able to match the URL "${a}${c}${h}" because it does not start with the basename, so the won't render anything.`),S==null?null:v.createElement(xt.Provider,{value:s},v.createElement(cl.Provider,{children:t,value:S}))}function pv({children:e,location:t}){return qg(Ps(e),t)}function Ps(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,Ps(r.props.children,o));return}ae(r.type===rp,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ae(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ps(r.props.children,o)),n.push(i)}),n}var Zl="get",ql="application/x-www-form-urlencoded";function Vo(e){return e!=null&&typeof e.tagName=="string"}function hv(e){return Vo(e)&&e.tagName.toLowerCase()==="button"}function mv(e){return Vo(e)&&e.tagName.toLowerCase()==="form"}function gv(e){return Vo(e)&&e.tagName.toLowerCase()==="input"}function vv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yv(e,t){return e.button===0&&(!t||t==="_self")&&!vv(e)}var Dl=null;function wv(){if(Dl===null)try{new FormData(document.createElement("form"),0),Dl=!1}catch{Dl=!0}return Dl}var Sv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $i(e){return e!=null&&!Sv.has(e)?(pt(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${ql}"`),null):e}function xv(e,t){let n,r,l,o,i;if(mv(e)){let s=e.getAttribute("action");r=s?zt(s,t):null,n=e.getAttribute("method")||Zl,l=$i(e.getAttribute("enctype"))||ql,o=new FormData(e)}else if(hv(e)||gv(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a
`,C=`
${y}
`;return`
${S}${C}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function _y(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r[\s\S]*?<\/think(?:ing)?>/gi,"").replace(/[*#]/g,"").replace(/\s+/g," ").trim()}function hp(e){if(!e)return{think:null,answer:""};const t=//i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let s=e.substring(l+o);const a=s.match(n);let c=null,h=i;return a?(c=s.substring(0,a.index).trim(),h+=s.substring(a.index+a[0].length)):c=s.trim(),{think:c||null,answer:h.trim()}}function Py({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=hp(e||""),[o,i]=Me.useState(!1),s=!!r;return f.jsxs("div",{className:"assistant-message",children:[s&&f.jsxs("div",{className:"assistant-thoughts",children:[f.jsxs("button",{className:"think-toggle",onClick:()=>i(a=>!a),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[f.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&f.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:_c(r)}})]}),f.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:_c(l||e||"")}}),Array.isArray(n)&&n.length>0&&f.jsx("div",{className:"msg-sources chips",children:n.map((a,c)=>{let h=a,g=!1;try{const y=new URL(a);if(y.protocol==="file:"){g=!0;const S=y.pathname.split("/").filter(Boolean);h=decodeURIComponent(S[S.length-1]||a)}else h=(y.hostname||a).replace(/^www\./i,"")}catch{}return f.jsx("a",{className:"chip",href:a,target:"_blank",rel:"noreferrer",title:a,onClick:y=>{var S,C;if(g){y.preventDefault();try{const E=new URL(a);(C=(S=window.electronAPI)==null?void 0:S.openPath)==null||C.call(S,decodeURIComponent(E.pathname))}catch{}}},children:h},a+c)})})]})}const Lc="websearch.searxUrl",Pc="websearch.engines",jc="chat.libraryBySession",Rc="http://127.0.0.1:8888";let mp="http://127.0.0.1:8000";const jy=48,Ry=24;function Ty(e){return e.backendApiUrl||e.ollamaApiUrl||mp}function $y(e){const t=typeof e=="string"?e.trim():"";return!t||t==="http://localhost:8888"?Rc:t}function My(){var eu;const[e,t]=v.useState([]),[n,r]=v.useState(null),[l,o]=v.useState("chats"),[i,s]=v.useState("General"),[a,c]=v.useState(null),[h,g]=v.useState(null),[y,S]=v.useState([]),[C,E]=v.useState([]),[L,m]=v.useState(null),[d,p]=v.useState(()=>{try{const u=localStorage.getItem(jc);return u?JSON.parse(u):{}}catch{return{}}}),[N,P]=v.useState(!1),[M,z]=v.useState(""),[F,B]=v.useState(""),[U,q]=v.useState(!1),[ge,We]=v.useState(""),[be,_]=v.useState(""),T=v.useRef(null),H=v.useRef(null),R=v.useRef(null),[O,b]=v.useState(mp),[Z,pe]=v.useState("Default"),[kt,ht]=v.useState(!1),[Rn,Ve]=v.useState(""),[Tn,Qo]=v.useState(!1),[hr,gp]=v.useState(()=>$y(localStorage.getItem(Lc))),[un,vp]=v.useState(()=>Cy(localStorage.getItem(Pc)));v.useEffect(()=>{localStorage.setItem(Lc,hr||"")},[hr]),v.useEffect(()=>{try{localStorage.setItem(Pc,JSON.stringify(Lo(un)))}catch{}},[un]);const[pl,yp]=v.useState(!1),[Dt,Ko]=v.useState(!1),[$a,Yo]=v.useState(!0),[wp,$n]=v.useState([]),[hl,Ma]=v.useState({}),[Oa,Sp]=v.useState(!1),za=v.useRef(!1),[xp,Go]=v.useState(null),[Jo,ml]=v.useState("");function kp(u){const w=u.content||"";if(u.role==="assistant")try{const{answer:x}=hp(w);return(x||w).trim()}catch{return w.trim()}return w}async function Fa(u){try{await navigator.clipboard.writeText(kp(u))}catch(w){console.error("Failed to copy message:",w)}}function cn(u,w,x,k={}){const{removeIfEmpty:$=!1}=k;t(D=>D.map(W=>{if(W.session_id!==u)return W;const A=[];for(const V of W.messages||[]){if(V.id!==w){A.push(V);continue}$&&!x||A.push({...V,content:x})}return{...W,messages:A}}))}function At(u){return(u==null?void 0:u.name)==="AbortError"}function gl(u){return u instanceof Error&&u.message?u.message:String(u)}async function Xo(u){const w=await u.json().catch(()=>null);if(u.ok)return w;const x=typeof(w==null?void 0:w.detail)=="string"?w.detail:typeof(w==null?void 0:w.message)=="string"?w.message:"";throw new Error(x||`HTTP ${u.status}`)}async function Ep(){const u=await fetch(`${O}/ollama/startup-status`);return Xo(u)}async function Cp(){const u=await fetch(`${O}/startup/prepare-models`,{method:"POST"});return Xo(u)}async function Ia(u,w,x){if(!u)return{contextBlock:null,sources:[]};const $=await(await fetch(`${O}/libraries/${u}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:x,body:JSON.stringify({prompt:w,top_k:5})})).json();return{contextBlock:typeof($==null?void 0:$.context_block)=="string"&&$.context_block.trim()?$.context_block.trim():null,sources:Array.isArray($==null?void 0:$.sources)?$.sources:[]}}function Np(u,w){Go(u),ml(w||"")}function vl(){Go(null),ml("")}async function _p(u){var D;const w=(((D=Fn[u])==null?void 0:D.content)||"").trim(),k=(Jo??"").trim();if(k.length===0){vl();return}if(k===w){vl();return}const $=n;if($){t(W=>W.map(A=>{if(A.session_id!==$)return A;const Le=(A.messages||[]).slice(0,u+1).map((ve,Ze)=>Ze===u?{...ve,content:k}:ve);return{...A,messages:Le}})),Go(null),ml(""),requestAnimationFrame(()=>ri("auto",$));try{const W=await fetch(`${O}/sessions/${$}/messages/${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k})});if(!W.ok)throw new Error(`HTTP ${W.status}`)}catch(W){console.error("Failed to update message:",W),t(A=>A.map(V=>{if(V.session_id!==$)return V;const ve=(V.messages||[]).map((Ze,Q)=>Q===u?{...Ze,content:w}:Ze);return{...V,messages:ve}}));return}await Da(u,k)}}async function Da(u,w=null){var Le,ve,Ze,Q,fe,ke;const x=n;if(Dt||!x||typeof u!="number")return;const k=((Le=e.find(J=>J.session_id===x))==null?void 0:Le.messages)||[];let $=u;for(let J=u;J>=0;J--)if(((ve=k[J])==null?void 0:ve.role)==="user"){$=J;break}t(J=>J.map(oe=>oe.session_id===x?{...oe,messages:(oe.messages||[]).slice(0,$+1)}:oe));const D=ba(x);let W=w??(((Ze=k[$])==null?void 0:Ze.content)||""),A=[];const V=[];try{const J=Ya(x),oe=w??(((Q=k[$])==null?void 0:Q.content)||"");if((fe=J==null?void 0:J.states)!=null&&fe.is_indexed)try{const K=await Ia(J.slug,oe,D.signal);K.contextBlock&&V.push(K.contextBlock),Array.isArray(K.sources)&&A.push(...K.sources)}catch(K){if(At(K))throw K;console.warn("local library enrichment (regenerate) failed",K)}if(pl)try{const K=k.slice(Math.max(0,$-7),$+1).map(he=>({role:he.role,content:he.content||""}));K.length>0&&(K[K.length-1]={role:"user",content:oe});const te=await(await fetch(`${O}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({prompt:oe,model:ge,messages:K,history_limit:8,searx_url:hr||null,engines:Array.isArray(un)?un:null})})).json();te&&typeof te.context_block=="string"&&te.context_block.trim()&&V.push(te.context_block.trim()),Array.isArray(te==null?void 0:te.sources)&&A.push(...te.sources)}catch(K){if(At(K))throw K;console.warn("web search enrichment (regenerate) failed",K)}if(A=[...new Set(A)],V.length>0?W=`${oe} - -${V.join(` - -`)}`:W=null,kt){const K=`msg-${Date.now()}-${Math.random()}`;let Ct="";t(te=>te.map(he=>he.session_id===x?{...he,messages:[...he.messages||[],{id:K,role:"assistant",content:"",sources:A}]}:he));try{const te=await fetch(`${O}/sessions/${x}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:u,model:ge,stream:!0,enriched_message:W,sources:A||[]})});if(!te.ok)throw new Error(`HTTP ${te.status}`);const he=(ke=te.body)==null?void 0:ke.getReader();if(!he)throw new Error("Missing response body");const Bt=new TextDecoder;let mt=!1;for(;;){const{value:pn,done:Gp}=await he.read();if(Gp)break;const Jp=Bt.decode(pn,{stream:!0});Ct+=Jp,cn(x,K,Ct),!mt&&_e.current!==x&&(mt=!0,fn(li=>({...li,[x]:K})),$n(li=>[...new Set([...li,x])]))}_e.current!==x?(fn(pn=>({...pn,[x]:K})),$n(pn=>[...new Set([...pn,x])])):Mn.current[x]?On(pn=>({...pn,[x]:K})):requestAnimationFrame(()=>In(K,"smooth",x))}catch(te){if(At(te)){cn(x,K,Ct,{removeIfEmpty:!0});return}console.error(te),cn(x,K,`Error: ${gl(te)}`,{removeIfEmpty:!0});return}}else{const K=await fetch(`${O}/sessions/${x}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:u,model:ge,stream:!1,enriched_message:W,sources:A||[]})});if(!K.ok)throw new Error(`HTTP ${K.status}`);const Ct=await K.json(),te=`msg-${Date.now()}`;t(he=>he.map(Bt=>Bt.session_id===x?{...Bt,messages:[...Bt.messages||[],{role:"assistant",content:Ct.reply,id:te,sources:A}]}:Bt)),_e.current!==x?(fn(he=>({...he,[x]:te})),$n(he=>[...new Set([...he,x])])):Mn.current[x]?On(he=>({...he,[x]:te})):requestAnimationFrame(()=>In(te,"smooth",x))}}catch(J){At(J)||console.error(J)}finally{Zo(D)}}const[Aa,Lp]=v.useState({}),Mn=v.useRef({}),[Pp,fn]=v.useState({}),dn=v.useRef({}),Ua=v.useRef({}),[Ba,On]=v.useState({}),[jp,Ha]=v.useState({}),Wa=(u,w,x)=>u!=null&&u.id?u.id:`${x}:${w}`;v.useEffect(()=>{var w;if(!n)return;const u=((w=e.find(x=>x.session_id===n))==null?void 0:w.messages)||[];Ha(x=>{const k={};return u.forEach(($,D)=>{if($.role!=="user")return;const W=Wa($,D,n),V=($.content||"").split(/\r\n|\r|\n/).length>30;k[W]=V?x[W]??!0:!1}),k})},[e,n]);function Rp(u){Ha(w=>({...w,[u]:!(w[u]??!0)}))}const mr=Me.useCallback((u,w)=>{Lp(x=>{const k={...x,[u]:w};return Mn.current=k,k})},[]),zn=v.useRef(null),Tp=v.useRef(!1),$p=v.useRef(null),_e=v.useRef(n);v.useEffect(()=>{_e.current=n},[n]);const ba=Me.useCallback(u=>{const w=new AbortController;return zn.current={controller:w,sessionId:u},Ko(!0),w},[]),Zo=Me.useCallback(u=>{var w;((w=zn.current)==null?void 0:w.controller)===u&&(zn.current=null,Ko(!1))},[]),Mp=Me.useCallback(()=>{const u=zn.current;u&&(zn.current=null,u.controller.abort(),Ko(!1))},[]);v.useEffect(()=>()=>{var u;(u=zn.current)==null||u.controller.abort()},[]);const Ut=v.useRef(null),[Op,zp]=v.useState(230),[yl,Va]=v.useState(!1),Fp=Me.useCallback(u=>{Va(!0)},[]),qo=Me.useCallback(()=>{Va(!1)},[]),ei=Me.useCallback(u=>{if(yl){const w=Math.max(230,Math.min(500,u.clientX));zp(w)}},[yl]);Me.useEffect(()=>(window.addEventListener("mousemove",ei),window.addEventListener("mouseup",qo),()=>{window.removeEventListener("mousemove",ei),window.removeEventListener("mouseup",qo)}),[ei,qo]),Me.useEffect(()=>{yl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[yl]),Me.useEffect(()=>{const u=async w=>{const x=w.target.closest(".codeblock__copy");if(!x)return;const k=x.closest(".codeblock"),$=k==null?void 0:k.querySelector("pre > code");if($)try{await navigator.clipboard.writeText($.textContent||""),x.classList.add("copied"),setTimeout(()=>x.classList.remove("copied"),800)}catch(D){console.error("Copy failed:",D)}};return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[]),v.useEffect(()=>{window.electronAPI.getSettings().then(w=>{b(Ty(w)),pe(w.colorScheme||"Default"),We(w.chatModel||""),ht(w.streamOutput||!1),Ma(w.scrollPositions||{}),ll(w.colorScheme||"Default")}).finally(()=>{Sp(!0)});const u=()=>{var w;l==="chats"&&((w=H.current)==null||w.focus())};return window.electronAPI.onWindowFocus(u),()=>{}},[l]),v.useEffect(()=>{if(!Oa||$a||!O||za.current)return;za.current=!0;let u=!1;const w=window.setTimeout(()=>{(async()=>{let x=!1;try{let k=await Ep();if(u)return;if(!(k!=null&&k.ollama_running)&&(k!=null&&k.can_manage_locally)){const W=window.confirm(`Ollama is not running at ${k.ollama_url}. Start it in the background now with "ollama serve"?`);if(u)return;if(W){x=!0,Qo(!0),Ve("Starting Ollama in the background...");const A=await fetch(`${O}/ollama/start`,{method:"POST"});if(k=await Xo(A),u)return}}const $=!(k!=null&&k.whisper_model_available),D=!!(k!=null&&k.ollama_running&&(k!=null&&k.can_manage_locally)&&!(k!=null&&k.embedding_model_available));if(($||D)&&(x=!0,Qo(!0),Ve($&&D?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"} and ${k.selected_embed_model}. This can take a while on first install.`:$?`Downloading Whisper ${(k==null?void 0:k.whisper_model)||"base"}. This can take a while on first install.`:`Downloading ${k.selected_embed_model} from Ollama. This can take a while on first install.`),await Cp(),u))return}catch(k){u||(console.warn("startup Ollama check failed",k),x&&window.alert(`Startup action failed: ${gl(k)}`))}finally{u||(Qo(!1),Ve(""))}})()},1200);return()=>{u=!0,window.clearTimeout(w)}},[O,$a,Oa]),v.useEffect(()=>{ll(Z)},[Z]);const Ip=u=>{!u||!O||fetch(`${O}/history?session_id=${encodeURIComponent(u)}`).then(w=>w.json()).then(w=>{t(x=>x.map(k=>k.session_id===u?{...k,messages:w.messages||[]}:k))}).catch(()=>{})};async function gr(){if(O)try{const w=await(await fetch(`${O}/libraries`)).json(),x=Array.isArray(w.libraries)?w.libraries:[];if(S(x),x.length===0){m(null);return}x.some(k=>k.slug===L)||m(x[0].slug)}catch(u){console.warn("Failed to load libraries",u)}}async function wl(){if(O)try{const w=await(await fetch(`${O}/jobs`)).json();E(Array.isArray(w.jobs)?w.jobs:[])}catch(u){console.warn("Failed to load library jobs",u)}}async function Qa(u=null){const x=(typeof u=="string"?u:M).trim();if(!x){B("Name is required.");return}try{B("");const k=await fetch(`${O}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x})});if(!k.ok){const D=await k.text();throw new Error(D||`HTTP ${k.status}`)}const $=await k.json();P(!1),z(""),await gr(),$!=null&&$.slug&&m($.slug)}catch(k){console.error("Failed to create library",k),B(String((k==null?void 0:k.message)||k))}}async function Dp(){S([]),E([]),m(null),g(null),q(!1),p({}),await gr(),await wl()}v.useEffect(()=>{O&&(Yo(!0),fetch(`${O}/sessions`).then(u=>u.json()).then(u=>{const w=u.sessions.map(x=>({...x,messages:[]}));t(w),w.length>0?r(w[0].session_id):r(null),Yo(!1)}).catch(()=>{Yo(!1)}))},[O]),v.useEffect(()=>{O&&(gr(),wl())},[O]),v.useEffect(()=>{try{localStorage.setItem(jc,JSON.stringify(d||{}))}catch{}},[d]),v.useEffect(()=>{if(!O)return;const u=setInterval(()=>{gr(),wl()},3e3);return()=>clearInterval(u)},[O,l,L]),v.useEffect(()=>{Ip(n)},[n,O]),v.useEffect(()=>{const u=new Set(y.map(w=>w.slug));p(w=>{let x=!1;const k={};for(const[$,D]of Object.entries(w||{}))u.has(D)?k[$]=D:x=!0;return x?k:w})},[y]);const ti=u=>{o(u)},Ap=u=>{bp(u)},Fn=v.useMemo(()=>{var u;return((u=e.find(w=>w.session_id===n))==null?void 0:u.messages)||[]},[n,e]),Sl=v.useMemo(()=>y.find(u=>u.slug===L)||null,[L,y]),Et=n&&d[n]||null,ot=v.useMemo(()=>y.find(u=>u.slug===Et)||null,[Et,y]),Ka=v.useMemo(()=>Et?C.some(u=>u.slug===Et&&(u.status==="queued"||u.status==="running")):!1,[Et,C]),ni=v.useMemo(()=>{var u,w;return ot?(u=ot.files)!=null&&u.length?(w=ot.states)!=null&&w.is_indexed?"":Ka?" (syncing)":" (needs sync)":" (empty)":""},[ot,Ka]);function Up(u){return u&&d[u]||null}function Ya(u){const w=Up(u);return w&&y.find(x=>x.slug===w)||null}function Ga(u){return u?C.some(w=>w.slug===u&&(w.status==="queued"||w.status==="running")):!1}function Ja(u,w){u&&p(x=>{const k={...x||{}};return w?k[u]=w:delete k[u],k})}function Bp(u){u&&p(w=>{let x=!1;const k={};for(const[$,D]of Object.entries(w||{})){if(D===u){x=!0;continue}k[$]=D}return x?k:w})}v.useEffect(()=>{if(!U)return;const u=w=>{var x;(x=R.current)!=null&&x.contains(w.target)||q(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[U]),v.useEffect(()=>{q(!1)},[n,l]),v.useEffect(()=>{const u=n,w=l;return()=>{if(w==="chats"&&u){const x=typeof dn.current[u]=="number"?dn.current[u]:T.current?T.current.scrollTop:0;Ma(k=>{const $={...k,[u]:x};return window.electronAPI.updateSettings({scrollPositions:$}),$})}}},[n,l]),v.useEffect(()=>{const u=T.current;if(!u)return;const w=()=>{const{scrollTop:x,scrollHeight:k,clientHeight:$}=u,D=k-x-$<=Ry;if(n){const W=Ua.current[n],A=typeof W=="number"&&xu.removeEventListener("scroll",w)},[n,mr]),v.useEffect(()=>{const u=n;u&&Aa[u]===!1&&On(w=>{if(!(u in w))return w;const x={...w};return delete x[u],x})},[n,Aa]),v.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const u=T.current;if(!u)return;Ut.current=null;const w=()=>{if(Ut.current===n)return;const W=typeof dn.current[n]=="number"?dn.current[n]:void 0,A=typeof W=="number"?W:hl[n];if(typeof A=="number"){u.scrollTop=A,Ut.current=n;return}Fn.length>0&&(u.scrollTop=u.scrollHeight,Ut.current=n)};w();const x=requestAnimationFrame(w),k=()=>{Ut.current!==n&&requestAnimationFrame(w)},$=new MutationObserver(k);$.observe(u,{childList:!0,subtree:!0});const D=new ResizeObserver(k);return D.observe(u),()=>{cancelAnimationFrame(x),$.disconnect(),D.disconnect()}},[n,l,Fn.length,hl]),v.useEffect(()=>{if(l!=="chats"||!n||Ut.current===n)return;const u=typeof dn.current[n]=="number"?dn.current[n]:void 0;typeof(typeof u=="number"?u:hl[n])!="number"&&Fn.length>0&&requestAnimationFrame(()=>{const x=T.current;x&&(x.scrollTop=x.scrollHeight,Ut.current=n)})},[Fn.length,n,l,hl]);const ri=(u="smooth",w=null)=>{const x=T.current;if(!x)return;const k=w??_e.current;_e.current===k&&(x.scrollTo({top:x.scrollHeight,behavior:u}),mr(k,!1))},In=(u,w="auto",x=null)=>{const k=T.current;if(!k)return;const $=x??_e.current;if(_e.current!==$)return;const D=document.getElementById(u);if(D){const W=Math.max(0,D.offsetTop-jy);k.scrollTo({top:W,behavior:w})}},Hp=()=>{const u=_e.current,w=Ba[u];w&&(In(w,"smooth",u),On(x=>{const{[u]:k,...$}=x;return $}))};async function Xa(){var $,D,W;if(Dt||!be.trim()||!ge)return;let u=n,w=!1;if(u){const A=e.find(V=>V.session_id===u);w=A&&A.name==="New Chat"&&A.messages.length===0}else{const A=await Za();await new Promise(V=>setTimeout(V,200)),u=A.session_id,w=!0}const x={role:"user",content:be.trim(),id:`msg-${Date.now()}-${Math.random()}`};Tp.current=!0,$p.current=u,mr(u,!1),_e.current===u&&(Ut.current=_e.current),bd.flushSync(()=>{t(A=>A.map(V=>V.session_id===u?{...V,messages:[...V.messages||[],x]}:V)),_("")}),requestAnimationFrame(()=>ri("auto",u));const k=ba(u);try{let A=[];try{A=[...((($=e.find(ke=>ke.session_id===u))==null?void 0:$.messages)||[]).slice(-8).map(ke=>({role:ke.role,content:ke.content||""})),{role:"user",content:x.content}]}catch{}let V=x.content,Le=[];const ve=[],Ze=Ya(u);if((D=Ze==null?void 0:Ze.states)!=null&&D.is_indexed)try{const Q=await Ia(Ze.slug,x.content,k.signal);Q.contextBlock&&ve.push(Q.contextBlock),Array.isArray(Q.sources)&&Le.push(...Q.sources)}catch(Q){if(At(Q))throw Q;console.warn("local library enrichment failed",Q)}if(pl)try{const fe=await(await fetch(`${O}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k.signal,body:JSON.stringify({prompt:x.content,model:ge,messages:A,history_limit:8,searx_url:hr||null,engines:Array.isArray(un)?un:null})})).json();fe&&typeof fe.context_block=="string"&&fe.context_block.trim()&&ve.push(fe.context_block.trim()),Array.isArray(fe==null?void 0:fe.sources)&&Le.push(...fe.sources)}catch(Q){if(At(Q))throw Q;console.warn("web search enrichment failed",Q)}if(Le=[...new Set(Le)],ve.length>0&&(V=`${x.content} - -${ve.join(` - -`)}`),kt){const Q=`msg-${Date.now()}-${Math.random()}`;let fe="";const ke={role:"assistant",content:"",id:Q,sources:Le};t(J=>J.map(oe=>oe.session_id===u?{...oe,messages:[...oe.messages||[],ke]}:oe));try{const J=await fetch(`${O}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k.signal,body:JSON.stringify({session_id:u,model:ge,message:x.content,enriched_message:ve.length>0?V:null,stream:!0,sources:Le||[]})});if(!J.ok)throw new Error(`HTTP ${J.status}`);const oe=(W=J.body)==null?void 0:W.getReader();if(!oe)throw new Error("Missing response body");const K=new TextDecoder;let Ct=!1;for(;;){const{value:te,done:he}=await oe.read();if(he){cn(u,Q,fe),_e.current===u?Mn.current[u]?On(mt=>({...mt,[u]:Q})):requestAnimationFrame(()=>In(Q,"smooth",u)):(fn(mt=>({...mt,[u]:Q})),$n(mt=>[...new Set([...mt,u])]));break}const Bt=K.decode(te,{stream:!0});fe+=Bt,cn(u,Q,fe),_e.current===u&&!Mn.current[u]&&ri("auto",u),_e.current!==u&&!Ct&&(fn(mt=>({...mt,[u]:Q})),Ct=!0)}}catch(J){if(At(J)){cn(u,Q,fe,{removeIfEmpty:!0});return}console.error("Failed to send message:",J),cn(u,Q,"Error: "+gl(J),{removeIfEmpty:!0});return}}else{const Q=await fetch(`${O}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k.signal,body:JSON.stringify({session_id:u,model:ge,message:x.content,enriched_message:ve.length>0?V:null,stream:!1,sources:Le||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const fe=await Q.json(),ke=`msg-${Date.now()}`,J={role:"assistant",content:fe.reply,id:ke,sources:Le};t(oe=>oe.map(K=>K.session_id===u?{...K,messages:[...K.messages||[],J]}:K)),ke&&(_e.current===u?Mn.current[u]?On(oe=>({...oe,[u]:ke})):requestAnimationFrame(()=>In(ke,"smooth",u)):fn(oe=>({...oe,[u]:ke})))}_e.current!==u&&$n(Q=>[...new Set([...Q,u])]),w&&fetch(`${O}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:u,message:x.content,model:ge})}).then(Q=>Q.json()).then(Q=>{const fe=Ly(Q.title);t(ke=>ke.map(J=>J.session_id===u?{...J,name:fe}:J))})}catch(A){if(At(A)){Zo(k);return}console.error("Failed to send message:",A);const V={role:"assistant",content:"Error: "+gl(A),id:`msg-${Date.now()}-${Math.random()}`};t(Le=>Le.map(ve=>ve.session_id===u?{...ve,messages:[...ve.messages,V]}:ve))}finally{Zo(k)}}function Wp(){yp(u=>!u)}async function Za(){var $;const u="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),x=await(await fetch(`${O}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:u})})).json(),k={...x,messages:[]};return t(D=>[k,...D]),r(x.session_id),($=H.current)==null||$.focus(),x}function bp(u){r(u),$n(x=>x.filter(k=>k!==u));const w=Pp[u];w&&requestAnimationFrame(()=>{let x=12;const k=()=>{if(!T.current)return;let D=document.getElementById(w);if(!D){const W=e.find(A=>A.session_id===u);if(W&&Array.isArray(W.messages))for(let A=W.messages.length-1;A>=0;A--){const V=W.messages[A];if(V.role==="assistant"&&V.id){D=document.getElementById(V.id);break}}}D?(In(D.id,"smooth",u),fn(W=>{const{[u]:A,...V}=W;return V})):x-- >0&&requestAnimationFrame(k)};requestAnimationFrame(k)})}function Vp(u,w){fetch(`${O}/sessions/${u}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})}).then(()=>{t(x=>x.map(k=>k.session_id===u?{...k,name:w}:k)),c(null)})}function Qp(u,w){const x=(w||"").trim(),k=y.find($=>$.slug===u);if(!k){g(null);return}if(!x||x===k.name){g(null);return}fetch(`${O}/libraries/${u}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x})}).then(()=>{S($=>$.map(D=>D.slug===u?{...D,name:x}:D)),g(null)})}function qa(u){fetch(`${O}/sessions/${u}`,{method:"DELETE"}).then(()=>{const w=e.filter(x=>x.session_id!==u);t(w),p(x=>{const k={...x||{}};return delete k[u],k}),n===u&&r(w.length>0?w[0].session_id:null)})}function Kp(u){fetch(`${O}/libraries/${u}`,{method:"DELETE"}).then(async w=>{var k;if(!w.ok){const $=await w.text();throw new Error($||`HTTP ${w.status}`)}const x=y.filter($=>$.slug!==u);S(x),E($=>$.filter(D=>D.slug!==u)),g($=>$===u?null:$),L===u&&m(((k=x[0])==null?void 0:k.slug)||null),Bp(u)}).catch(w=>{console.error("Failed to delete library",w)})}v.useEffect(()=>{const u=e.filter(w=>w.name==="New Chat"&&w.session_id!==n&&w.messages.length===0);u.length>0&&u.forEach(w=>{qa(w.session_id)})},[n,e,O]);const Yp=u=>{var x;window.getSelection().toString().length>0||document.activeElement!==H.current&&(u.target.closest(".msg")||(x=H.current)==null||x.focus())};return f.jsxs("div",{className:"app",style:{gridTemplateColumns:`${Op}px 1fr`},children:[f.jsxs("div",{className:"sidebar",children:[f.jsxs("div",{className:"sidebar-header",children:[f.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>ti("chats"),children:"Chats"}),f.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>ti("dbs"),children:"DBs"}),f.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>ti("settings"),children:"Settings"})]}),f.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&f.jsx("div",{className:"chat-list",children:e.map(u=>f.jsx("div",{className:`chat-item ${u.session_id===n?"active":""}`,onClick:()=>Ap(u.session_id),children:a===u.session_id?f.jsx("input",{type:"text",className:"rename-input",defaultValue:u.name,onBlur:()=>c(null),onKeyDown:w=>{w.key==="Enter"?Vp(u.session_id,w.target.value):w.key==="Escape"&&c(null)},autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:u.name}),f.jsxs("div",{className:"chat-item-buttons",children:[wp.includes(u.session_id)&&f.jsx("div",{className:"unread-dot"}),f.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),c(u.session_id)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:f.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),f.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),qa(u.session_id)},children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},u.session_id))}),l==="dbs"&&f.jsx("div",{className:"db-list",children:y.length===0?f.jsx("div",{className:"empty-list-message",children:"No databases yet."}):y.map(u=>f.jsx("div",{className:`chat-item ${u.slug===L?"active":""}`,onClick:()=>m(u.slug),children:h===u.slug?f.jsx("input",{type:"text",className:"rename-input",defaultValue:u.name,onBlur:()=>g(null),onKeyDown:w=>{w.key==="Enter"?Qp(u.slug,w.target.value):w.key==="Escape"&&g(null)},autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:u.name}),f.jsxs("div",{className:"chat-item-buttons",children:[Et===u.slug&&f.jsx("div",{className:"db-active-badge",children:"Chat"}),Ga(u.slug)&&f.jsx("div",{className:"db-active-badge",children:"Syncing"}),f.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),g(u.slug)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:f.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),f.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),Kp(u.slug)},children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},u.slug))}),l==="settings"&&f.jsxs("div",{className:"settings-list",children:[f.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>s("General"),children:"General"}),f.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>s("Interface"),children:"Interface"}),f.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>s("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&f.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&f.jsx("button",{className:"button new-chat-button",onClick:Za,children:"New Chat"}),l==="dbs"&&(N?f.jsxs("div",{className:"new-db-form",children:[f.jsx("input",{type:"text",className:"rename-input",value:M,onChange:u=>z(u.target.value),onKeyDown:u=>{u.key==="Enter"?Qa():u.key==="Escape"&&(P(!1),z(""),B(""))},placeholder:"Database name",autoFocus:!0}),F&&f.jsx("div",{className:"form-error",children:F}),f.jsxs("div",{className:"new-db-actions",children:[f.jsx("button",{className:"button new-db-button",onClick:()=>Qa(),children:"Create"}),f.jsx("button",{className:"button ghost",onClick:()=>{P(!1),z(""),B("")},children:"Cancel"})]})]}):f.jsx("button",{className:"button new-db-button",onClick:()=>{P(!0),B("")},children:"New Database"}))]}),f.jsx("div",{className:"resizer",onMouseDown:Fp})]}),f.jsxs("div",{className:"main-content",children:[Rn&&f.jsxs("div",{className:"startup-task-banner",role:"status","aria-live":"polite",children:[Tn&&f.jsx("div",{className:"spinner startup-task-banner__spinner"}),f.jsx("div",{className:"startup-task-banner__text",children:Rn})]}),l==="chats"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"header",children:[f.jsxs("strong",{children:["Chat - ",((eu=e.find(u=>u.session_id===n))==null?void 0:eu.name)||"New Chat"]}),ot&&f.jsx("span",{className:"header-subtle",children:`DB: ${ot.name}${ni}`})]}),f.jsx("div",{className:"chat",ref:T,onClick:Yp,children:Fn.map((u,w)=>{const x=u.role==="user"&&xp===w;return f.jsx("div",{id:u.id,className:"msg "+(u.role==="user"?"user":"assistant")+(x?" editing":""),children:u.role==="assistant"?f.jsxs("div",{className:"assistant-message-wrapper",children:[f.jsx(Py,{content:u.content,streamOutput:kt,sources:u.sources}),!Dt&&f.jsxs("div",{className:"message-options-bar assistant-options",children:[f.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Fa(u),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),f.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>Da(w),children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):f.jsxs("div",{className:"user-message-wrapper",children:[x?f.jsxs("div",{className:"msg-content msg-content--user editing",children:[f.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Jo}),f.jsx(Sc,{className:"edit-message-input edit-overlay",value:Jo,onChange:k=>ml(k.target.value),onBlur:vl,onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),vl()),k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_p(w))},autoFocus:!0,minRows:1})]}):(()=>{const k=u.content||"",$=k.split(/\r\n|\r|\n/),D=$.length>30,W=Wa(u,w,n),A=D?jp[W]??!0:!1,V=A?$.slice(0,30).join(` -`)+` -…`:k;return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"msg-content msg-content--user",children:V}),D&&f.jsx("button",{className:"user-msg-expand",onClick:()=>Rp(W),"aria-expanded":A?"false":"true",children:A?"Show entire message":"Collapse"})]})})(),!Dt&&!x&&f.jsxs("div",{className:"message-options-bar user-options",children:[f.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>Np(w,u.content),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M12 20h9"}),f.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),f.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Fa(u),children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},u.id||w)})},n),Ba[n]&&f.jsxs("button",{className:"new-msg-tip",onClick:Hp,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",f.jsx("span",{style:{marginLeft:6},children:"↓"})]}),f.jsx("div",{className:"footer",children:f.jsxs("div",{className:"footer-content-wrapper",children:[f.jsx(Sc,{ref:H,className:"input",value:be,onChange:u=>_(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),Xa())},placeholder:"Ask any question...",maxRows:13}),f.jsxs("div",{className:"footer-tool-group",ref:R,children:[f.jsx("button",{type:"button",className:"db-picker-toggle"+(ot?" active":""),onClick:()=>{n&&q(u=>!u)},title:ot?`Database: ${ot.name}${ni}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":U,disabled:!n,children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),f.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),f.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),U&&f.jsxs("div",{className:"db-picker-menu",role:"menu",children:[f.jsxs("button",{type:"button",className:"db-picker-option"+(Et?"":" selected"),onClick:()=>{Ja(n,null),q(!1)},children:[f.jsx("span",{children:"No database"}),!Et&&f.jsx("span",{className:"db-picker-status",children:"Selected"})]}),y.length===0?f.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):y.map(u=>{var $,D,W;const w=Et===u.slug,x=Ga(u.slug),k=($=u.files)!=null&&$.length?(D=u.states)!=null&&D.is_indexed?"Ready":x?"Syncing":"Needs sync":"Empty";return f.jsxs("button",{type:"button",className:"db-picker-option"+(w?" selected":""),disabled:!((W=u.files)!=null&&W.length),onClick:()=>{Ja(n,u.slug),q(!1)},children:[f.jsx("span",{children:u.name}),f.jsx("span",{className:"db-picker-status",children:w?"Selected":k})]},u.slug)})]})]}),f.jsx("button",{type:"button",className:"websearch-toggle"+(pl?" active":""),onClick:Wp,title:"Toggle web search","aria-pressed":pl,children:f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),f.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),f.jsx("button",{className:"button",onClick:Dt?Mp:Xa,title:Dt?"Cancel generation":"Send","aria-label":Dt?"Cancel generation":"Send",children:Dt?f.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"header",children:[f.jsx("strong",{children:(Sl==null?void 0:Sl.name)||"Databases"}),ot&&f.jsx("span",{className:"header-subtle",children:`Current chat DB: ${ot.name}${ni}`})]}),f.jsx(xy,{apiBase:O,library:Sl,jobs:C,onRefresh:async()=>{await gr(),await wl()}})]}),l==="settings"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"header",children:f.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&f.jsx(hy,{onModelChange:We,streamOutput:kt,onStreamOutputChange:ht,onLibrariesPurged:Dp}),i==="Interface"&&f.jsx(wy,{}),i==="Websearch"&&f.jsx(Ny,{searxUrl:hr,setSearxUrl:gp,engines:un,setEngines:u=>vp(Lo(u))})]})]})]})}function Oy(){return v.useEffect(()=>{window.electronAPI.getSettings().then(e=>{ll(e.colorScheme||"Default")})},[]),f.jsx(Me.StrictMode,{children:f.jsx(Fv,{children:f.jsx(pv,{children:f.jsx(rp,{path:"/",element:f.jsx(My,{})})})})})}const zy=Vd(document.getElementById("root"));zy.render(f.jsx(Oy,{})); diff --git a/dist/assets/index-CzQQplJ5.css b/dist/assets/index-CzQQplJ5.css new file mode 100644 index 0000000..4f9955e --- /dev/null +++ b/dist/assets/index-CzQQplJ5.css @@ -0,0 +1 @@ +:root{--bg: #0b1020;--panel: #141b34;--text: #e6e8ef;--muted: #9aa3b2;--accent: #6ea8fe;--border: #24304f}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}.no-select{-webkit-user-select:none;user-select:none;cursor:ew-resize!important}.app{display:grid;grid-template-columns:var(--sidebar-width, 230px) 1fr;grid-template-rows:1fr;height:100%}.sidebar{display:grid;grid-template-rows:auto 1fr auto;background:var(--panel);border-right:1px solid var(--border);height:100vh;overflow:hidden;position:relative}.sidebar span{font-size:14px}.resizer{width:13px;cursor:ew-resize;background:transparent;position:absolute;top:0;right:-5px;bottom:0;z-index:1}.sidebar-header{display:flex;justify-content:space-around;padding:0;background:var(--panel)}.sidebar-tab{flex-grow:1;text-align:center;padding:11px 16px;cursor:pointer;border-bottom:3px solid transparent;transition:background-color .2s ease}.sidebar-tab:hover{background-color:var(--hover-bg)}.sidebar-tab.active{background-color:var(--active-bg);border-bottom-color:var(--accent)}.sidebar-tab.active:hover{background-color:var(--active-bg)}.sidebar-content{flex-grow:1;overflow-y:auto}.db-list,.settings-list{padding:8px 0}.empty-list-message{padding:10px 16px;color:var(--muted);text-align:center}.settings-item{padding:10px 16px;cursor:pointer;border-left:3px solid transparent}.settings-item.active{background:var(--active-bg);border-left-color:var(--accent)}.settings-item.active:hover{background:var(--active-bg)}.settings-item:hover{background:var(--hover-bg)}.settings-footer-placeholder{height:40px;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel)}.new-db-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-db-button:hover{opacity:.9}.chat-list{overflow-y:auto;padding:8px 0}.chat-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;overflow:hidden;white-space:nowrap}.chat-item span{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-buttons{display:flex;gap:8px;align-items:center}.unread-dot{width:8px;height:8px;background-color:red;border-radius:50%;margin-right:4px}.icon-button{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.icon-button svg{width:16px;height:16px;stroke:var(--muted);transition:stroke .2s ease}.icon-button:hover svg{stroke:var(--accent)}.icon-button:hover{color:var(--accent)}.chat-item.active{background:var(--active-bg);border-left-color:var(--accent)}.chat-item:hover{background:var(--hover-bg)}.chat-item.active:hover{background:var(--active-bg)}.rename-input{background:var(--input-bg);border:1px solid var(--accent);color:var(--text);border-radius:10px;padding:8px 12px;outline:none;width:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--muted);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}.sidebar-footer{padding:12px 16px;background:var(--panel)}.new-db-form,.library-inline-form{display:grid;gap:8px}.new-db-actions{display:flex;gap:8px}.form-error{color:#ff9aa8;font-size:12px}.new-chat-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-chat-button:hover{opacity:.9}.main-content{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100vh;overflow:hidden}.header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.select,.input,.button{background:var(--input-bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;outline:none}.footer-content-wrapper .button{flex-shrink:0}.select{min-width:220px}.button{cursor:pointer}.button:hover{border-color:var(--accent)}.button.ghost{background:transparent}.button.danger{border-color:#8f3d49;color:#ffb8c2}.button.danger:hover{border-color:#d86a79}.header-subtle{color:var(--muted);font-size:13px}.chat{display:grid;grid-template-columns:1fr minmax(auto,1000px) 1fr;align-content:start;gap:8px;padding:16px;overflow:auto}.chat>*{grid-column:2}.msg{padding:12px 14px;border-radius:12px;line-height:1.5;white-space:wrap;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}textarea.input{resize:none;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial;overflow-y:auto;flex-grow:1}.msg.user{background:var(--user-msg-bg);margin-left:auto;max-width:80%;border:1px solid var(--border);margin-right:5px;margin-bottom:15px;transition:border-color .15s ease,box-shadow .15s ease}.msg.user.editing{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.msg.user .msg-content--user{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;position:relative}.message-attachment-strip{margin-bottom:10px;justify-content:flex-end}.msg.user .user-msg-expand{margin-top:8px;padding:0;background:transparent;border:none;color:var(--muted);font-weight:700;cursor:pointer;align-self:flex-start;margin-left:0;text-align:left}.msg.assistant{background:transparent;border:none;max-width:none;animation:fadeIn .3s ease-in-out;margin-bottom:30px}.user-message-wrapper{display:flex;flex-direction:column;align-items:flex-end;position:relative}.assistant-message-wrapper{display:flex;flex-direction:column;align-items:flex-start;position:relative}.message-options-bar{display:flex;gap:2px;padding:0;border-radius:8px;background-color:transparent;border:none;position:absolute;bottom:-30px}.user-options{right:-10px;bottom:-40px}.assistant-options{left:0}.message-options-bar .icon-button{padding:4px;border-radius:4px;border:none}.message-options-bar .icon-button:hover{background-color:var(--hover-bg)}.new-msg-tip{position:absolute;right:24px;bottom:84px;padding:8px 12px;border-radius:9999px;background:var(--accent);color:var(--bg);border:none;cursor:pointer;font-weight:600;box-shadow:0 6px 20px #00000059}.new-msg-tip:hover{opacity:.9}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.main-content--drag-active{background:color-mix(in srgb,var(--accent) 3%,transparent)}.footer{display:flex;justify-content:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel);align-items:flex-end}.footer-inner{width:100%;max-width:1000px;display:flex;flex-direction:column;gap:10px;padding:8px 10px;border-radius:14px;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.footer-inner--drag-active{background:color-mix(in srgb,var(--accent) 8%,var(--panel));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 40%,transparent)}.footer-content-wrapper{display:flex;gap:8px;width:100%;align-items:flex-end}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.composer-image-input{display:none}.image-attachment-strip{display:flex;flex-wrap:wrap;gap:10px}.composer-attachment-strip{min-height:0}.image-attachment-card{position:relative;width:72px;height:72px;border-radius:12px;overflow:hidden;border:1px solid var(--border);background:var(--input-bg);flex:0 0 auto}.image-attachment-thumb{width:100%;height:100%;object-fit:cover;display:block}.image-attachment-remove{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:999px;border:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;background:#000000b3;font-size:14px;line-height:1}.image-attachment-remove:hover{background:#000000d9}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.setting-switch-row{display:inline-flex;align-items:center;gap:12px;flex-wrap:wrap}.setting-switch-label{color:var(--muted);font-weight:600;letter-spacing:.01em;transition:color .2s ease}.setting-switch-label.active{color:var(--text)}.toggle-switch--binary-select .slider{background-color:var(--input-bg);border-color:var(--border)}.toggle-switch--binary-select .slider:before{background-color:var(--text)}.toggle-switch--binary-select input:checked+.slider{background-color:var(--input-bg);border-color:var(--border)}.toggle-switch--binary-select input:checked+.slider:before{background-color:var(--text)}.range-input{width:min(360px,100%);accent-color:var(--accent)}.setting-value{min-width:48px;color:var(--text);font-variant-numeric:tabular-nums}.setting-description{margin:10px 0 0;color:var(--muted);line-height:1.5}.setting-status{margin:12px 0 0;line-height:1.5}.setting-status.success{color:#8fd6a3}.setting-status.warning{color:#f1c97a}.setting-status.error{color:#ff9aa8}.setting-status.neutral{color:var(--text)}.setting-meta{margin-top:10px;display:grid;gap:4px;color:var(--muted);font-size:.95em}.msg h1,.msg h2,.msg h3,.msg h4{margin:10px 0;color:var(--accent)}.msg blockquote{border-left:4px solid var(--accent);padding-left:15px;margin-left:0;color:var(--muted)}.msg ul{padding-left:20px}.msg li{margin-bottom:5px}.msg code{background-color:var(--input-bg);padding:2px 4px;border-radius:4px;font-family:monospace}.msg pre{background-color:var(--input-bg);padding:10px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}.msg pre code{padding:0;background-color:transparent}.msg a{color:var(--text);display:inline-flex;align-items:center;gap:4px;position:relative;text-decoration:underline dotted;text-underline-offset:3px}.msg a .tooltip{visibility:hidden;width:auto;background-color:var(--panel);color:var(--text);text-align:center;border-radius:6px;padding:5px 10px;position:absolute;z-index:1;bottom:110%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s;white-space:nowrap}.msg a:hover .tooltip{visibility:visible;opacity:1}.msg a:hover{color:var(--accent)}.msg a svg{width:14px;height:14px;stroke:var(--text);transition:stroke .2s ease}.msg a:hover svg{stroke:var(--accent)}.msg hr{border:none;border-top:1px solid var(--border);margin:20px 0}:root{--outline-w: 1px;--grid-w: 1px;--grid: var(--border)}.msg table.nice{border-collapse:separate;border-spacing:0;width:100%;margin:1rem 0;border-radius:12px;box-shadow:0 0 0 var(--outline-w) var(--border)}.msg table.nice th,.msg table.nice td{border:var(--grid-w) solid var(--grid);border-width:.5px;padding:.6rem .75rem;vertical-align:top}.msg table.nice thead tr:first-child th{border-top:0}.msg table.nice tr th:first-child,.msg table.nice tr td:first-child{border-left:0}.msg table.nice tr th:last-child,.msg table.nice tr td:last-child{border-right:0}.msg table.nice tbody tr:last-child td{border-bottom:0}.msg table.nice thead tr:first-child th{background-color:var(--panel)}.msg table.nice thead tr:first-child th:first-child{border-top-left-radius:12px;background-clip:padding-box}.msg table.nice thead tr:first-child th:last-child{border-top-right-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:first-child{border-bottom-left-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:last-child{border-bottom-right-radius:12px;background-clip:padding-box}.toggle-switch{position:relative;display:inline-block;width:50px;height:28px}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--input-bg);border:1px solid var(--border);transition:.4s;border-radius:28px}.slider:before{position:absolute;content:"";height:20px;width:20px;left:3px;bottom:3px;background-color:var(--muted);transition:.4s;border-radius:50%}input:checked+.slider{background-color:var(--accent)}input:checked+.slider:before{transform:translate(22px);background-color:var(--panel)}.startup-task-banner{position:fixed;top:16px;right:16px;z-index:50;display:flex;align-items:flex-start;gap:12px;max-width:min(420px,calc(100vw - 32px));padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--panel);color:var(--text);line-height:1.5;box-shadow:0 12px 32px #0000003d;pointer-events:none}.startup-task-banner__spinner{width:18px;height:18px;margin:2px 0 0;border-width:2px;flex:0 0 auto}.startup-task-banner__text{flex:1 1 auto}.spinner{border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top:3px solid var(--accent);width:20px;height:20px;animation:spin 1s linear infinite;margin:0 auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.codeblock{border:1px solid var(--grid, #e5e7eb);border-radius:12px;overflow:hidden;margin:1rem 0}.codeblock__header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--panel);border-bottom:1px solid var(--grid);font-weight:600;font-size:.875rem}.codeblock__lang{opacity:.9}.codeblock__copy{display:inline-flex;align-items:center;gap:.25rem;border:0;background:transparent;padding:.25rem;border-radius:8px;cursor:pointer}.codeblock__copy:hover{background:#0000000f}.codeblock__copy.copied .icon-copy{transform:scale(1.05)}.codeblock__pre{margin:0;padding:.75rem;overflow:auto}.codeblock__code{display:block;white-space:pre}.assistant-message{display:block}.assistant-thoughts{margin-bottom:8px}.think-toggle{background:var(--active-bg);color:var(--muted);border:1px solid var(--border);border-radius:10px;font-size:12px;padding:4px 8px;cursor:pointer}.think-toggle:hover{color:var(--text);border-color:var(--accent)}.think-toggle-icon{display:inline-block;margin-right:6px}.think-content{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.edit-message-input{display:block;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none}.edit-message-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.user-edit-shadow{visibility:hidden;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.edit-message-input.edit-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none;box-shadow:none}.websearch-toggle,.db-picker-toggle,.image-attach-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg,.image-attach-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active,.image-attach-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.image-attach-toggle:focus,.image-attach-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.chat--drag-active{outline:1px dashed color-mix(in srgb,var(--accent) 55%,transparent);outline-offset:-10px}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view{height:100%;overflow:auto;padding:20px}.placeholder-view h1{margin-top:0}.library-panel{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.library-panel-scroll{flex:1;min-height:0;overflow:auto;padding:20px}.library-inline-form{margin-bottom:14px;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.danger-zone{border-color:#8f3d49}.library-toast-stack{position:absolute;right:20px;bottom:92px;left:20px;z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}.library-toast{width:min(100%,560px);padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black);box-shadow:0 16px 36px #00000047;line-height:1.45;animation:libraryToastIn .18s ease-out}.library-toast.success{border-color:color-mix(in srgb,#69c4a1 60%,var(--border))}.library-toast.warning{border-color:color-mix(in srgb,#e18282 60%,var(--border))}@keyframes libraryToastIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.library-footer-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding:14px 20px 20px;border-top:1px solid var(--border);background:color-mix(in srgb,var(--panel) 94%,black)}.library-files h2{margin:0 0 12px;font-size:16px}.library-file-list{display:grid;gap:10px}.library-file-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.library-file-meta{min-width:0;flex:1}.library-file-name{font-weight:600;margin-bottom:4px}.library-file-mode{display:inline-flex;align-items:center;margin-top:4px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.library-file-mode.enabled{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border));background:color-mix(in srgb,var(--accent) 12%,transparent)}.library-file-path,.muted-copy{color:var(--muted);font-size:13px;word-break:break-word}.library-file-actions{display:flex;gap:8px;flex-shrink:0}.library-file-sync{margin-top:10px}.library-file-sync-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin-bottom:8px}.library-file-sync-label{font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.library-file-sync-label.ready{color:#69c4a1}.library-file-sync-label.syncing,.library-file-sync-label.pending{color:var(--accent)}.library-file-sync-label.failed{color:#e18282}.library-file-sync-detail{color:var(--muted);font-size:12px;line-height:1.35}.library-file-progress{position:relative;width:100%;height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--panel) 50%,black);border:1px solid color-mix(in srgb,var(--border) 80%,transparent)}.library-file-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 76%,white),var(--accent));transition:width .18s ease}.library-file-progress.ready .library-file-progress-bar{background:linear-gradient(90deg,#5cb48e,#7be1b5)}.library-file-progress.failed .library-file-progress-bar{background:linear-gradient(90deg,#c35d5d,#e18282)}@media (max-width: 760px){.library-toast-stack{right:12px;bottom:124px;left:12px}.library-footer-actions{padding:12px}.library-file-row{flex-direction:column}.library-file-actions{width:100%;justify-content:flex-end}} diff --git a/dist/assets/index-D21amC2P.css b/dist/assets/index-D21amC2P.css deleted file mode 100644 index a03317d..0000000 --- a/dist/assets/index-D21amC2P.css +++ /dev/null @@ -1 +0,0 @@ -:root{--bg: #0b1020;--panel: #141b34;--text: #e6e8ef;--muted: #9aa3b2;--accent: #6ea8fe;--border: #24304f}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}.no-select{-webkit-user-select:none;user-select:none;cursor:ew-resize!important}.app{display:grid;grid-template-columns:var(--sidebar-width, 230px) 1fr;grid-template-rows:1fr;height:100%}.sidebar{display:grid;grid-template-rows:auto 1fr auto;background:var(--panel);border-right:1px solid var(--border);height:100vh;overflow:hidden;position:relative}.sidebar span{font-size:14px}.resizer{width:13px;cursor:ew-resize;background:transparent;position:absolute;top:0;right:-5px;bottom:0;z-index:1}.sidebar-header{display:flex;justify-content:space-around;padding:0;background:var(--panel)}.sidebar-tab{flex-grow:1;text-align:center;padding:11px 16px;cursor:pointer;border-bottom:3px solid transparent;transition:background-color .2s ease}.sidebar-tab:hover{background-color:var(--hover-bg)}.sidebar-tab.active{background-color:var(--active-bg);border-bottom-color:var(--accent)}.sidebar-tab.active:hover{background-color:var(--active-bg)}.sidebar-content{flex-grow:1;overflow-y:auto}.db-list,.settings-list{padding:8px 0}.empty-list-message{padding:10px 16px;color:var(--muted);text-align:center}.settings-item{padding:10px 16px;cursor:pointer;border-left:3px solid transparent}.settings-item.active{background:var(--active-bg);border-left-color:var(--accent)}.settings-item.active:hover{background:var(--active-bg)}.settings-item:hover{background:var(--hover-bg)}.settings-footer-placeholder{height:40px;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel)}.new-db-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-db-button:hover{opacity:.9}.chat-list{overflow-y:auto;padding:8px 0}.chat-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;overflow:hidden;white-space:nowrap}.chat-item span{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-buttons{display:flex;gap:8px;align-items:center}.unread-dot{width:8px;height:8px;background-color:red;border-radius:50%;margin-right:4px}.icon-button{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.icon-button svg{width:16px;height:16px;stroke:var(--muted);transition:stroke .2s ease}.icon-button:hover svg{stroke:var(--accent)}.icon-button:hover{color:var(--accent)}.chat-item.active{background:var(--active-bg);border-left-color:var(--accent)}.chat-item:hover{background:var(--hover-bg)}.chat-item.active:hover{background:var(--active-bg)}.rename-input{background:var(--input-bg);border:1px solid var(--accent);color:var(--text);border-radius:10px;padding:8px 12px;outline:none;width:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--muted);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}.sidebar-footer{padding:12px 16px;background:var(--panel)}.new-db-form,.library-inline-form{display:grid;gap:8px}.new-db-actions{display:flex;gap:8px}.form-error{color:#ff9aa8;font-size:12px}.new-chat-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-chat-button:hover{opacity:.9}.main-content{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100vh;overflow:hidden}.header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.select,.input,.button{background:var(--input-bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;outline:none}.footer-content-wrapper .button{flex-shrink:0}.select{min-width:220px}.button{cursor:pointer}.button:hover{border-color:var(--accent)}.button.ghost{background:transparent}.button.danger{border-color:#8f3d49;color:#ffb8c2}.button.danger:hover{border-color:#d86a79}.header-subtle{color:var(--muted);font-size:13px}.chat{display:grid;grid-template-columns:1fr minmax(auto,1000px) 1fr;align-content:start;gap:8px;padding:16px;overflow:auto}.chat>*{grid-column:2}.msg{padding:12px 14px;border-radius:12px;line-height:1.5;white-space:wrap;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}textarea.input{resize:none;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial;overflow-y:auto;flex-grow:1}.msg.user{background:var(--user-msg-bg);margin-left:auto;max-width:80%;border:1px solid var(--border);margin-right:5px;margin-bottom:15px;transition:border-color .15s ease,box-shadow .15s ease}.msg.user.editing{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.msg.user .msg-content--user{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;position:relative}.msg.user .user-msg-expand{margin-top:8px;padding:0;background:transparent;border:none;color:var(--muted);font-weight:700;cursor:pointer;align-self:flex-start;margin-left:0;text-align:left}.msg.assistant{background:transparent;border:none;max-width:none;animation:fadeIn .3s ease-in-out;margin-bottom:30px}.user-message-wrapper{display:flex;flex-direction:column;align-items:flex-end;position:relative}.assistant-message-wrapper{display:flex;flex-direction:column;align-items:flex-start;position:relative}.message-options-bar{display:flex;gap:2px;padding:0;border-radius:8px;background-color:transparent;border:none;position:absolute;bottom:-30px}.user-options{right:-10px;bottom:-40px}.assistant-options{left:0}.message-options-bar .icon-button{padding:4px;border-radius:4px;border:none}.message-options-bar .icon-button:hover{background-color:var(--hover-bg)}.new-msg-tip{position:absolute;right:24px;bottom:84px;padding:8px 12px;border-radius:9999px;background:var(--accent);color:var(--bg);border:none;cursor:pointer;font-weight:600;box-shadow:0 6px 20px #00000059}.new-msg-tip:hover{opacity:.9}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.footer{display:flex;justify-content:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel);align-items:flex-end}.footer-content-wrapper{display:flex;gap:8px;width:100%;max-width:1000px;align-items:flex-end}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.setting-switch-row{display:inline-flex;align-items:center;gap:12px;flex-wrap:wrap}.setting-switch-label{color:var(--muted);font-weight:600;letter-spacing:.01em;transition:color .2s ease}.setting-switch-label.active{color:var(--text)}.toggle-switch--binary-select .slider{background-color:var(--input-bg);border-color:var(--border)}.toggle-switch--binary-select .slider:before{background-color:var(--text)}.toggle-switch--binary-select input:checked+.slider{background-color:var(--input-bg);border-color:var(--border)}.toggle-switch--binary-select input:checked+.slider:before{background-color:var(--text)}.range-input{width:min(360px,100%);accent-color:var(--accent)}.setting-value{min-width:48px;color:var(--text);font-variant-numeric:tabular-nums}.setting-description{margin:10px 0 0;color:var(--muted);line-height:1.5}.setting-status{margin:12px 0 0;line-height:1.5}.setting-status.success{color:#8fd6a3}.setting-status.warning{color:#f1c97a}.setting-status.error{color:#ff9aa8}.setting-status.neutral{color:var(--text)}.setting-meta{margin-top:10px;display:grid;gap:4px;color:var(--muted);font-size:.95em}.msg h1,.msg h2,.msg h3,.msg h4{margin:10px 0;color:var(--accent)}.msg blockquote{border-left:4px solid var(--accent);padding-left:15px;margin-left:0;color:var(--muted)}.msg ul{padding-left:20px}.msg li{margin-bottom:5px}.msg code{background-color:var(--input-bg);padding:2px 4px;border-radius:4px;font-family:monospace}.msg pre{background-color:var(--input-bg);padding:10px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}.msg pre code{padding:0;background-color:transparent}.msg a{color:var(--text);display:inline-flex;align-items:center;gap:4px;position:relative;text-decoration:underline dotted;text-underline-offset:3px}.msg a .tooltip{visibility:hidden;width:auto;background-color:var(--panel);color:var(--text);text-align:center;border-radius:6px;padding:5px 10px;position:absolute;z-index:1;bottom:110%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s;white-space:nowrap}.msg a:hover .tooltip{visibility:visible;opacity:1}.msg a:hover{color:var(--accent)}.msg a svg{width:14px;height:14px;stroke:var(--text);transition:stroke .2s ease}.msg a:hover svg{stroke:var(--accent)}.msg hr{border:none;border-top:1px solid var(--border);margin:20px 0}:root{--outline-w: 1px;--grid-w: 1px;--grid: var(--border)}.msg table.nice{border-collapse:separate;border-spacing:0;width:100%;margin:1rem 0;border-radius:12px;box-shadow:0 0 0 var(--outline-w) var(--border)}.msg table.nice th,.msg table.nice td{border:var(--grid-w) solid var(--grid);border-width:.5px;padding:.6rem .75rem;vertical-align:top}.msg table.nice thead tr:first-child th{border-top:0}.msg table.nice tr th:first-child,.msg table.nice tr td:first-child{border-left:0}.msg table.nice tr th:last-child,.msg table.nice tr td:last-child{border-right:0}.msg table.nice tbody tr:last-child td{border-bottom:0}.msg table.nice thead tr:first-child th{background-color:var(--panel)}.msg table.nice thead tr:first-child th:first-child{border-top-left-radius:12px;background-clip:padding-box}.msg table.nice thead tr:first-child th:last-child{border-top-right-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:first-child{border-bottom-left-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:last-child{border-bottom-right-radius:12px;background-clip:padding-box}.toggle-switch{position:relative;display:inline-block;width:50px;height:28px}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--input-bg);border:1px solid var(--border);transition:.4s;border-radius:28px}.slider:before{position:absolute;content:"";height:20px;width:20px;left:3px;bottom:3px;background-color:var(--muted);transition:.4s;border-radius:50%}input:checked+.slider{background-color:var(--accent)}input:checked+.slider:before{transform:translate(22px);background-color:var(--panel)}.startup-task-banner{position:fixed;top:16px;right:16px;z-index:50;display:flex;align-items:flex-start;gap:12px;max-width:min(420px,calc(100vw - 32px));padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--panel);color:var(--text);line-height:1.5;box-shadow:0 12px 32px #0000003d;pointer-events:none}.startup-task-banner__spinner{width:18px;height:18px;margin:2px 0 0;border-width:2px;flex:0 0 auto}.startup-task-banner__text{flex:1 1 auto}.spinner{border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top:3px solid var(--accent);width:20px;height:20px;animation:spin 1s linear infinite;margin:0 auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.codeblock{border:1px solid var(--grid, #e5e7eb);border-radius:12px;overflow:hidden;margin:1rem 0}.codeblock__header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--panel);border-bottom:1px solid var(--grid);font-weight:600;font-size:.875rem}.codeblock__lang{opacity:.9}.codeblock__copy{display:inline-flex;align-items:center;gap:.25rem;border:0;background:transparent;padding:.25rem;border-radius:8px;cursor:pointer}.codeblock__copy:hover{background:#0000000f}.codeblock__copy.copied .icon-copy{transform:scale(1.05)}.codeblock__pre{margin:0;padding:.75rem;overflow:auto}.codeblock__code{display:block;white-space:pre}.assistant-message{display:block}.assistant-thoughts{margin-bottom:8px}.think-toggle{background:var(--active-bg);color:var(--muted);border:1px solid var(--border);border-radius:10px;font-size:12px;padding:4px 8px;cursor:pointer}.think-toggle:hover{color:var(--text);border-color:var(--accent)}.think-toggle-icon{display:inline-block;margin-right:6px}.think-content{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.edit-message-input{display:block;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none}.edit-message-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.user-edit-shadow{visibility:hidden;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.edit-message-input.edit-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none;box-shadow:none}.websearch-toggle,.db-picker-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view{height:100%;overflow:auto;padding:20px}.placeholder-view h1{margin-top:0}.library-panel{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.library-panel-scroll{flex:1;min-height:0;overflow:auto;padding:20px}.library-inline-form{margin-bottom:14px;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.danger-zone{border-color:#8f3d49}.library-toast-stack{position:absolute;right:20px;bottom:92px;left:20px;z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}.library-toast{width:min(100%,560px);padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black);box-shadow:0 16px 36px #00000047;line-height:1.45;animation:libraryToastIn .18s ease-out}.library-toast.success{border-color:color-mix(in srgb,#69c4a1 60%,var(--border))}.library-toast.warning{border-color:color-mix(in srgb,#e18282 60%,var(--border))}@keyframes libraryToastIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.library-footer-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding:14px 20px 20px;border-top:1px solid var(--border);background:color-mix(in srgb,var(--panel) 94%,black)}.library-files h2{margin:0 0 12px;font-size:16px}.library-file-list{display:grid;gap:10px}.library-file-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.library-file-meta{min-width:0;flex:1}.library-file-name{font-weight:600;margin-bottom:4px}.library-file-mode{display:inline-flex;align-items:center;margin-top:4px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.library-file-mode.enabled{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border));background:color-mix(in srgb,var(--accent) 12%,transparent)}.library-file-path,.muted-copy{color:var(--muted);font-size:13px;word-break:break-word}.library-file-actions{display:flex;gap:8px;flex-shrink:0}.library-file-sync{margin-top:10px}.library-file-sync-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin-bottom:8px}.library-file-sync-label{font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.library-file-sync-label.ready{color:#69c4a1}.library-file-sync-label.syncing,.library-file-sync-label.pending{color:var(--accent)}.library-file-sync-label.failed{color:#e18282}.library-file-sync-detail{color:var(--muted);font-size:12px;line-height:1.35}.library-file-progress{position:relative;width:100%;height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--panel) 50%,black);border:1px solid color-mix(in srgb,var(--border) 80%,transparent)}.library-file-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 76%,white),var(--accent));transition:width .18s ease}.library-file-progress.ready .library-file-progress-bar{background:linear-gradient(90deg,#5cb48e,#7be1b5)}.library-file-progress.failed .library-file-progress-bar{background:linear-gradient(90deg,#c35d5d,#e18282)}@media (max-width: 760px){.library-toast-stack{right:12px;bottom:124px;left:12px}.library-footer-actions{padding:12px}.library-file-row{flex-direction:column}.library-file-actions{width:100%;justify-content:flex-end}} diff --git a/dist/index.html b/dist/index.html index 66ea0ea..bf8fd6e 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,8 @@ LLM Desktop - - + +