From 3a8d71c2b52bccef0c3939367cb268b8f2a62996 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 19 Mar 2026 21:25:39 +0100 Subject: [PATCH] auto-git: [add] dist/assets/index-Cc0DLWqA.css [add] dist/assets/index-CdhItaw4.js [add] dist/index.html --- dist/assets/index-Cc0DLWqA.css | 1 + dist/assets/index-CdhItaw4.js | 69 ++++++++++++++++++++++++++++++++++ dist/index.html | 14 +++++++ 3 files changed, 84 insertions(+) create mode 100644 dist/assets/index-Cc0DLWqA.css create mode 100644 dist/assets/index-CdhItaw4.js create mode 100644 dist/index.html diff --git a/dist/assets/index-Cc0DLWqA.css b/dist/assets/index-Cc0DLWqA.css new file mode 100644 index 0000000..0502232 --- /dev/null +++ b/dist/assets/index-Cc0DLWqA.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}.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}.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}.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}.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)}.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{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{width:20px;height:20px;pointer-events:none}.websearch-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible{outline:none;box-shadow:none}.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,.library-panel{overflow:auto;padding:20px}.placeholder-view h1{margin-top:0}.library-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}.library-states{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px}.state-pill{padding:6px 10px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:13px}.state-pill.ready{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border))}.library-chat-note,.job-card{margin-bottom:12px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--panel) 82%,black);border:1px solid var(--border)}.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-files h2{margin:18px 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}.library-file-name{font-weight:600;margin-bottom:4px}.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} diff --git a/dist/assets/index-CdhItaw4.js b/dist/assets/index-CdhItaw4.js new file mode 100644 index 0000000..7120c32 --- /dev/null +++ b/dist/assets/index-CdhItaw4.js @@ -0,0 +1,69 @@ +(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 fp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oc={exports:{}},yo={},ic={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 Zr=Symbol.for("react.element"),dp=Symbol.for("react.portal"),pp=Symbol.for("react.fragment"),hp=Symbol.for("react.strict_mode"),mp=Symbol.for("react.profiler"),gp=Symbol.for("react.provider"),vp=Symbol.for("react.context"),yp=Symbol.for("react.forward_ref"),wp=Symbol.for("react.suspense"),Sp=Symbol.for("react.memo"),xp=Symbol.for("react.lazy"),za=Symbol.iterator;function kp(e){return e===null||typeof e!="object"?null:(e=za&&e[za]||e["@@iterator"],typeof e=="function"?e:null)}var sc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ac=Object.assign,uc={};function rr(e,t,n){this.props=e,this.context=t,this.refs=uc,this.updater=n||sc}rr.prototype.isReactComponent={};rr.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")};rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cc(){}cc.prototype=rr.prototype;function ws(e,t,n){this.props=e,this.context=t,this.refs=uc,this.updater=n||sc}var Ss=ws.prototype=new cc;Ss.constructor=ws;ac(Ss,rr.prototype);Ss.isPureReactComponent=!0;var Ia=Array.isArray,fc=Object.prototype.hasOwnProperty,xs={current:null},dc={key:!0,ref:!0,__self:!0,__source:!0};function pc(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)fc.call(t,r)&&!dc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,b=$[D];if(0>>1;Dl(sr,_))Jel(En,sr)?($[D]=En,$[Je]=_,D=Je):($[D]=sr,$[Le]=_,D=Le);else if(Jel(En,_))$[D]=En,$[Je]=_,D=Je;else break e}}return W}function l($,W){var _=$.sortIndex-W.sortIndex;return _!==0?_:$.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],p=1,m=null,v=3,w=!1,x=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d($){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=$)r(u),W.sortIndex=W.expirationTime,t(s,W);else break;W=n(u)}}function E($){if(k=!1,d($),!x)if(n(s)!==null)x=!0,V(R);else{var W=n(u);W!==null&&Mt(E,W.startTime-$)}}function R($,W){x=!1,k&&(k=!1,h(z),z=-1),w=!0;var _=v;try{for(d(W),m=n(s);m!==null&&(!(m.expirationTime>W)||$&&!ue());){var D=m.callback;if(typeof D=="function"){m.callback=null,v=m.priorityLevel;var b=D(m.expirationTime<=W);W=e.unstable_now(),typeof b=="function"?m.callback=b:m===n(s)&&r(s),d(W)}else r(s);m=n(s)}if(m!==null)var Ue=!0;else{var Le=n(u);Le!==null&&Mt(E,Le.startTime-W),Ue=!1}return Ue}finally{m=null,v=_,w=!1}}var j=!1,T=null,z=-1,U=5,I=-1;function ue(){return!(e.unstable_now()-I$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function($){switch(v){case 1:case 2:case 3:var W=3;break;default:W=v}var _=v;v=W;try{return $()}finally{v=_}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var _=v;v=$;try{return W()}finally{v=_}},e.unstable_scheduleCallback=function($,W,_){var D=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?D+_:D):_=D,$){case 1:var b=-1;break;case 2:b=250;break;case 5:b=1073741823;break;case 4:b=1e4;break;default:b=5e3}return b=_+b,$={id:p++,callback:W,priorityLevel:$,startTime:_,expirationTime:b,sortIndex:-1},_>D?($.sortIndex=_,t(u,$),n(s)===null&&$===n(u)&&(k?(h(z),z=-1):k=!0,Mt(E,_-D))):($.sortIndex=b,t(s,$),x||w||(x=!0,V(R))),$},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function($){var W=v;return function(){var _=v;v=W;try{return $.apply(this,arguments)}finally{v=_}}}})(yc);vc.exports=yc;var Mp=vc.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 zp=g,Qe=Mp;function L(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"),Ei=Object.prototype.hasOwnProperty,Ip=/^[: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]*$/,Oa={},Da={};function Fp(e){return Ei.call(Da,e)?!0:Ei.call(Oa,e)?!1:Ip.test(e)?Da[e]=!0:(Oa[e]=!0,!1)}function Op(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 Dp(e,t,n,r){if(t===null||typeof t>"u"||Op(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ze(e,t,n,r,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 we={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){we[e]=new ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];we[t]=new ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){we[e]=new ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){we[e]=new ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){we[e]=new ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){we[e]=new ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){we[e]=new ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){we[e]=new ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){we[e]=new ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Es=/[\-:]([a-z])/g;function Cs(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(Es,Cs);we[t]=new ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Es,Cs);we[t]=new ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Es,Cs);we[t]=new ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){we[e]=new ze(e,1,!1,e.toLowerCase(),null,!1,!1)});we.xlinkHref=new ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){we[e]=new ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ns(e,t,n,r){var l=we.hasOwnProperty(t)?we[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` +`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{Xo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sr(e):""}function Ap(e){switch(e.tag){case 5:return Sr(e.type);case 16:return Sr("Lazy");case 13:return Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 2:case 15:return e=bo(e.type,!1),e;case 11:return e=bo(e.type.render,!1),e;case 1:return e=bo(e.type,!0),e;default:return""}}function Pi(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 Mn:return"Fragment";case $n:return"Portal";case Ci:return"Profiler";case _s:return"StrictMode";case Ni:return"Suspense";case _i:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xc:return(e.displayName||"Context")+".Consumer";case Sc:return(e._context.displayName||"Context")+".Provider";case Ps:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ls:return t=e.displayName||null,t!==null?t:Pi(e.type)||"Memo";case Ot:t=e._payload,e=e._init;try{return Pi(e(t))}catch{}}return null}function Up(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 Pi(t);case 8:return t===_s?"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 bt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ec(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hp(e){var t=Ec(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 ml(e){e._valueTracker||(e._valueTracker=Hp(e))}function Cc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ec(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kl(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 Li(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ua(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=bt(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 Nc(e,t){t=t.checked,t!=null&&Ns(e,"checked",t,!1)}function Ri(e,t){Nc(e,t);var n=bt(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")?ji(e,t.type,n):t.hasOwnProperty("defaultValue")&&ji(e,t.type,bt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ha(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 ji(e,t,n){(t!=="number"||Kl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xr=Array.isArray;function Vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cr={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},Bp=["Webkit","ms","Moz","O"];Object.keys(Cr).forEach(function(e){Bp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cr[t]=Cr[e]})});function Rc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cr.hasOwnProperty(e)&&Cr[e]?(""+t).trim():t+"px"}function jc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Rc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Wp=se({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 Mi(e,t){if(t){if(Wp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function zi(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 Ii=null;function Rs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fi=null,Qn=null,Kn=null;function Va(e){if(e=tl(e)){if(typeof Fi!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Eo(t),Fi(e.stateNode,e.type,t))}}function Tc(e){Qn?Kn?Kn.push(e):Kn=[e]:Qn=e}function $c(){if(Qn){var e=Qn,t=Kn;if(Kn=Qn=null,Va(e),t)for(e=0;e>>=0,e===0?32:31-(eh(e)/th|0)|0}var vl=64,yl=4194304;function kr(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 Xl(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 a=i&~l;a!==0?r=kr(a):(o&=i,o!==0&&(r=kr(o)))}else i=n&~l,i!==0?r=kr(i):o!==0&&(r=kr(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 qr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-at(t),e[t]=n}function oh(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=_r),qa=" ",eu=!1;function Zc(e,t){switch(e){case"keyup":return Mh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function Ih(e,t){switch(e){case"compositionend":return qc(t);case"keypress":return t.which!==32?null:(eu=!0,qa);case"textInput":return e=t.data,e===qa&&eu?null:e;default:return null}}function Fh(e,t){if(zn)return e==="compositionend"||!Os&&Zc(e,t)?(e=Xc(),zl=zs=Ht=null,zn=!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=lu(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 lf(){for(var e=window,t=Kl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kl(e.document)}return t}function Ds(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 Qh(e){var t=lf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rf(n.ownerDocument.documentElement,n)){if(r!==null&&Ds(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=ou(n,o);var i=ou(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,In=null,Bi=null,Lr=null,Wi=!1;function iu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wi||In==null||In!==Kl(r)||(r=In,"selectionStart"in r&&Ds(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}),Lr&&Ur(Lr,r)||(Lr=r,r=ql(Bi,"onSelect"),0Dn||(e.current=Gi[Dn],Gi[Dn]=null,Dn--)}function ee(e,t){Dn++,Gi[Dn]=e.current,e.current=t}var Zt={},_e=en(Zt),Oe=en(!1),hn=Zt;function bn(e,t){var n=e.type.contextTypes;if(!n)return Zt;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 De(e){return e=e.childContextTypes,e!=null}function to(){ne(Oe),ne(_e)}function pu(e,t,n){if(_e.current!==Zt)throw Error(L(168));ee(_e,t),ee(Oe,n)}function hf(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(L(108,Up(e)||"Unknown",l));return se({},n,r)}function no(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zt,hn=_e.current,ee(_e,e),ee(Oe,Oe.current),!0}function hu(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=hf(e,t,hn),r.__reactInternalMemoizedMergedChildContext=e,ne(Oe),ne(_e),ee(_e,e)):ne(Oe),ee(Oe,n)}var xt=null,Co=!1,fi=!1;function mf(e){xt===null?xt=[e]:xt.push(e)}function rm(e){Co=!0,mf(e)}function tn(){if(!fi&&xt!==null){fi=!0;var e=0,t=q;try{var n=xt;for(q=1;e>=i,l-=i,kt=1<<32-at(t)+l|n<z?(U=T,T=null):U=T.sibling;var I=v(h,T,d[z],E);if(I===null){T===null&&(T=U);break}e&&T&&I.alternate===null&&t(h,T),c=o(I,c,z),j===null?R=I:j.sibling=I,j=I,T=U}if(z===d.length)return n(h,T),re&&sn(h,z),R;if(T===null){for(;zz?(U=T,T=null):U=T.sibling;var ue=v(h,T,I.value,E);if(ue===null){T===null&&(T=U);break}e&&T&&ue.alternate===null&&t(h,T),c=o(ue,c,z),j===null?R=ue:j.sibling=ue,j=ue,T=U}if(I.done)return n(h,T),re&&sn(h,z),R;if(T===null){for(;!I.done;z++,I=d.next())I=m(h,I.value,E),I!==null&&(c=o(I,c,z),j===null?R=I:j.sibling=I,j=I);return re&&sn(h,z),R}for(T=r(h,T);!I.done;z++,I=d.next())I=w(T,h,z,I.value,E),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?z:I.key),c=o(I,c,z),j===null?R=I:j.sibling=I,j=I);return e&&T.forEach(function(tt){return t(h,tt)}),re&&sn(h,z),R}function N(h,c,d,E){if(typeof d=="object"&&d!==null&&d.type===Mn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case hl:e:{for(var R=d.key,j=c;j!==null;){if(j.key===R){if(R=d.type,R===Mn){if(j.tag===7){n(h,j.sibling),c=l(j,d.props.children),c.return=h,h=c;break e}}else if(j.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Ot&&vu(R)===j.type){n(h,j.sibling),c=l(j,d.props),c.ref=gr(h,j,d),c.return=h,h=c;break e}n(h,j);break}else t(h,j);j=j.sibling}d.type===Mn?(c=pn(d.props.children,h.mode,E,d.key),c.return=h,h=c):(E=Bl(d.type,d.key,d.props,null,h.mode,E),E.ref=gr(h,c,d),E.return=h,h=E)}return i(h);case $n:e:{for(j=d.key;c!==null;){if(c.key===j)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(h,c.sibling),c=l(c,d.children||[]),c.return=h,h=c;break e}else{n(h,c);break}else t(h,c);c=c.sibling}c=wi(d,h.mode,E),c.return=h,h=c}return i(h);case Ot:return j=d._init,N(h,c,j(d._payload),E)}if(xr(d))return x(h,c,d,E);if(fr(d))return k(h,c,d,E);Nl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(h,c.sibling),c=l(c,d),c.return=h,h=c):(n(h,c),c=yi(d,h.mode,E),c.return=h,h=c),i(h)):n(h,c)}return N}var qn=wf(!0),Sf=wf(!1),oo=en(null),io=null,Hn=null,Bs=null;function Ws(){Bs=Hn=io=null}function Vs(e){var t=oo.current;ne(oo),e._currentValue=t}function Zi(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 Jn(e,t){io=e,Bs=Hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fe=!0),e.firstContext=null)}function qe(e){var t=e._currentValue;if(Bs!==e)if(e={context:e,memoizedValue:t,next:null},Hn===null){if(io===null)throw Error(L(308));Hn=e,io.dependencies={lanes:0,firstContext:e}}else Hn=Hn.next=e;return t}var cn=null;function Qs(e){cn===null?cn=[e]:cn.push(e)}function xf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Qs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Lt(e,r)}function Lt(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 Dt=!1;function Ks(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kf(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 Ct(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yt(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,Lt(e,n)}return l=r.interleaved,l===null?(t.next=t,Qs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Lt(e,n)}function Fl(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,Ts(e,n)}}function yu(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 so(e,t,n,r){var l=e.updateQueue;Dt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==i&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=s))}if(o!==null){var m=l.baseState;i=0,p=u=s=null,a=o;do{var v=a.lane,w=a.eventTime;if((r&v)===v){p!==null&&(p=p.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,k=a;switch(v=t,w=n,k.tag){case 1:if(x=k.payload,typeof x=="function"){m=x.call(w,m,v);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=k.payload,v=typeof x=="function"?x.call(w,m,v):x,v==null)break e;m=se({},m,v);break e;case 2:Dt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,v=l.effects,v===null?l.effects=[a]:v.push(a))}else w={eventTime:w,lane:v,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=w,s=m):p=p.next=w,i|=v;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;v=a,a=v.next,v.next=null,l.lastBaseUpdate=v,l.shared.pending=null}}while(!0);if(p===null&&(s=m),l.baseState=s,l.firstBaseUpdate=u,l.lastBaseUpdate=p,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);vn|=i,e.lanes=i,e.memoizedState=m}}function wu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=pi.transition;pi.transition={};try{e(!1),t()}finally{q=n,pi.transition=r}}function Af(){return et().memoizedState}function sm(e,t,n){var r=Gt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uf(e))Hf(t,n);else if(n=xf(e,t,n,r),n!==null){var l=$e();ut(n,e,r,l),Bf(n,t,r)}}function am(e,t,n){var r=Gt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uf(e))Hf(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,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,ct(a,i)){var s=t.interleaved;s===null?(l.next=l,Qs(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=xf(e,t,l,r),n!==null&&(l=$e(),ut(n,e,r,l),Bf(n,t,r))}}function Uf(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function Hf(e,t){Rr=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ts(e,n)}}var co={readContext:qe,useCallback:Ee,useContext:Ee,useEffect:Ee,useImperativeHandle:Ee,useInsertionEffect:Ee,useLayoutEffect:Ee,useMemo:Ee,useReducer:Ee,useRef:Ee,useState:Ee,useDebugValue:Ee,useDeferredValue:Ee,useTransition:Ee,useMutableSource:Ee,useSyncExternalStore:Ee,useId:Ee,unstable_isNewReconciler:!1},um={readContext:qe,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:xu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dl(4194308,4,zf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dl(4,2,e,t)},useMemo:function(e,t){var n=ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=sm.bind(null,oe,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Su,useDebugValue:ea,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Su(!1),t=e[0];return e=im.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=oe,l=ht();if(re){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ge===null)throw Error(L(349));gn&30||_f(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,xu(Lf.bind(null,r,o,e),[e]),r.flags|=2048,Jr(9,Pf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ht(),t=ge.identifierPrefix;if(re){var n=Et,r=kt;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kr++,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[mt]=t,e[Wr]=r,Zf(e,t,!1,!1),t.stateNode=e;e:{switch(i=zi(n,r),n){case"dialog":te("cancel",e),te("close",e),l=r;break;case"iframe":case"object":case"embed":te("load",e),l=r;break;case"video":case"audio":for(l=0;lnr&&(t.flags|=128,r=!0,vr(o,!1),t.lanes=4194304)}else{if(!r)if(e=ao(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!re)return Ce(t),null}else 2*ce()-o.renderingStartTime>nr&&n!==1073741824&&(t.flags|=128,r=!0,vr(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=ce(),t.sibling=null,n=le.current,ee(le,r?n&1|2:n&1),t):(Ce(t),null);case 22:case 23:return ia(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Be&1073741824&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function vm(e,t){switch(Us(t),t.tag){case 1:return De(t.type)&&to(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(),ne(Oe),ne(_e),Gs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Js(t),null;case 13:if(ne(le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(le),null;case 4:return er(),null;case 10:return Vs(t.type._context),null;case 22:case 23:return ia(),null;case 24:return null;default:return null}}var Pl=!1,Ne=!1,ym=typeof WeakSet=="function"?WeakSet:Set,M=null;function Bn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function ss(e,t,n){try{n()}catch(r){ae(e,t,r)}}var $u=!1;function wm(e,t){if(Vi=bl,e=lf(),Ds(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,a=-1,s=-1,u=0,p=0,m=e,v=null;t:for(;;){for(var w;m!==n||l!==0&&m.nodeType!==3||(a=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(w=m.firstChild)!==null;)v=m,m=w;for(;;){if(m===e)break t;if(v===n&&++u===l&&(a=i),v===o&&++p===r&&(s=i),(w=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=w}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qi={focusedElem:e,selectionRange:n},bl=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var k=x.memoizedProps,N=x.memoizedState,h=t.stateNode,c=h.getSnapshotBeforeUpdate(t.elementType===t.type?k:ot(t.type,k),N);h.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(E){ae(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return x=$u,$u=!1,x}function jr(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&&ss(t,n,o)}l=l.next}while(l!==r)}}function Po(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 as(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 td(e){var t=e.alternate;t!==null&&(e.alternate=null,td(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mt],delete t[Wr],delete t[Ji],delete t[tm],delete t[nm])),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 nd(e){return e.tag===5||e.tag===3||e.tag===4}function Mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nd(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 us(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=eo));else if(r!==4&&(e=e.child,e!==null))for(us(e,t,n),e=e.sibling;e!==null;)us(e,t,n),e=e.sibling}function cs(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(cs(e,t,n),e=e.sibling;e!==null;)cs(e,t,n),e=e.sibling}var ve=null,it=!1;function Ft(e,t,n){for(n=n.child;n!==null;)rd(e,t,n),n=n.sibling}function rd(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(wo,n)}catch{}switch(n.tag){case 5:Ne||Bn(n,t);case 6:var r=ve,l=it;ve=null,Ft(e,t,n),ve=r,it=l,ve!==null&&(it?(e=ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ve.removeChild(n.stateNode));break;case 18:ve!==null&&(it?(e=ve,n=n.stateNode,e.nodeType===8?ci(e.parentNode,n):e.nodeType===1&&ci(e,n),Dr(e)):ci(ve,n.stateNode));break;case 4:r=ve,l=it,ve=n.stateNode.containerInfo,it=!0,Ft(e,t,n),ve=r,it=l;break;case 0:case 11:case 14:case 15:if(!Ne&&(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)&&ss(n,t,i),l=l.next}while(l!==r)}Ft(e,t,n);break;case 1:if(!Ne&&(Bn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ae(n,t,a)}Ft(e,t,n);break;case 21:Ft(e,t,n);break;case 22:n.mode&1?(Ne=(r=Ne)||n.memoizedState!==null,Ft(e,t,n),Ne=r):Ft(e,t,n);break;default:Ft(e,t,n)}}function zu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ym),t.forEach(function(r){var l=Lm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function lt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xm(r/1960))-r,10e?16:e,Bt===null)var r=!1;else{if(e=Bt,Bt=null,ho=0,G&6)throw Error(L(331));var l=G;for(G|=4,M=e.current;M!==null;){var o=M,i=o.child;if(M.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sce()-la?dn(e,0):ra|=n),Ae(e,t)}function fd(e,t){t===0&&(e.mode&1?(t=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):t=1);var n=$e();e=Lt(e,t),e!==null&&(qr(e,t,n),Ae(e,n))}function Pm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fd(e,n)}function Lm(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(L(314))}r!==null&&r.delete(t),fd(e,n)}var dd;dd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fe=!1,mm(e,t,n);Fe=!!(e.flags&131072)}else Fe=!1,re&&t.flags&1048576&&gf(t,lo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Al(e,t),e=t.pendingProps;var l=bn(t,_e.current);Jn(t,n),l=bs(null,t,r,e,l,n);var o=Zs();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,De(r)?(o=!0,no(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ks(t),l.updater=_o,t.stateNode=l,l._reactInternals=t,es(t,r,e,n),t=rs(null,t,r,!0,o,n)):(t.tag=0,re&&o&&As(t),Te(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Al(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=jm(r),e=ot(r,e),l){case 0:t=ns(null,t,r,e,n);break e;case 1:t=Ru(null,t,r,e,n);break e;case 11:t=Pu(null,t,r,e,n);break e;case 14:t=Lu(null,t,r,ot(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ot(r,l),ns(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ot(r,l),Ru(e,t,r,l,n);case 3:e:{if(Gf(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,l=o.element,kf(e,t),so(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=tr(Error(L(423)),t),t=ju(e,t,r,n,l);break e}else if(r!==l){l=tr(Error(L(424)),t),t=ju(e,t,r,n,l);break e}else for(We=Kt(t.stateNode.containerInfo.firstChild),Ve=t,re=!0,st=null,n=Sf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zn(),r===l){t=Rt(e,t,n);break e}Te(e,t,r,n)}t=t.child}return t;case 5:return Ef(t),e===null&&bi(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Ki(r,l)?i=null:o!==null&&Ki(r,o)&&(t.flags|=32),Jf(e,t),Te(e,t,i,n),t.child;case 6:return e===null&&bi(t),null;case 13:return Xf(e,t,n);case 4:return Ys(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qn(t,null,r,n):Te(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ot(r,l),Pu(e,t,r,l,n);case 7:return Te(e,t,t.pendingProps,n),t.child;case 8:return Te(e,t,t.pendingProps.children,n),t.child;case 12:return Te(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(oo,r._currentValue),r._currentValue=i,o!==null)if(ct(o.value,i)){if(o.children===l.children&&!Oe.current){t=Rt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Ct(-1,n&-n),s.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Zi(o.return,n,t),a.lanes|=n;break}s=s.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(L(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Zi(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}Te(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Jn(t,n),l=qe(l),r=r(l),t.flags|=1,Te(e,t,r,n),t.child;case 14:return r=t.type,l=ot(r,t.pendingProps),l=ot(r.type,l),Lu(e,t,r,l,n);case 15:return Kf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ot(r,l),Al(e,t),t.tag=1,De(r)?(e=!0,no(t)):e=!1,Jn(t,n),Wf(t,r,l),es(t,r,l,n),rs(null,t,r,!0,e,n);case 19:return bf(e,t,n);case 22:return Yf(e,t,n)}throw Error(L(156,t.tag))};function pd(e,t){return Ac(e,t)}function Rm(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 be(e,t,n,r){return new Rm(e,t,n,r)}function aa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jm(e){if(typeof e=="function")return aa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ps)return 11;if(e===Ls)return 14}return 2}function Xt(e,t){var n=e.alternate;return n===null?(n=be(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Bl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")aa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Mn:return pn(n.children,l,o,t);case _s:i=8,l|=8;break;case Ci:return e=be(12,n,t,l|2),e.elementType=Ci,e.lanes=o,e;case Ni:return e=be(13,n,t,l),e.elementType=Ni,e.lanes=o,e;case _i:return e=be(19,n,t,l),e.elementType=_i,e.lanes=o,e;case kc:return Ro(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sc:i=10;break e;case xc:i=9;break e;case Ps:i=11;break e;case Ls:i=14;break e;case Ot:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=be(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function pn(e,t,n,r){return e=be(7,e,r,t),e.lanes=n,e}function Ro(e,t,n,r){return e=be(22,e,r,t),e.elementType=kc,e.lanes=n,e.stateNode={isHidden:!1},e}function yi(e,t,n){return e=be(6,e,null,t),e.lanes=n,e}function wi(e,t,n){return t=be(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tm(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=qo(0),this.expirationTimes=qo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qo(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ua(e,t,n,r,l,o,i,a,s){return e=new Tm(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=be(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ks(o),e}function $m(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vd)}catch(e){console.error(e)}}vd(),gc.exports=Ke;var yd=gc.exports,wd,Bu=yd;wd=Bu.createRoot,Bu.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 Wu="popstate";function Om(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=xn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ms("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let s=l.location.href,u=s.indexOf("#");a=u===-1?s:s.slice(0,u)}return a+"#"+(typeof o=="string"?o:Xr(o))}function r(l,o){ft(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return Am(t,n,r,e)}function ie(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ft(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Dm(){return Math.random().toString(36).substring(2,10)}function Vu(e,t){return{usr:e.state,key:e.key,idx:t}}function ms(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?xn(t):t,state:n,key:t&&t.key||r||Dm()}}function Xr({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 xn(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 Am(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a="POP",s=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function m(){a="POP";let N=p(),h=N==null?null:N-u;u=N,s&&s({action:a,location:k.location,delta:h})}function v(N,h){a="PUSH";let c=ms(k.location,N,h);n&&n(c,N),u=p()+1;let d=Vu(c,u),E=k.createHref(c);try{i.pushState(d,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;l.location.assign(E)}o&&s&&s({action:a,location:k.location,delta:1})}function w(N,h){a="REPLACE";let c=ms(k.location,N,h);n&&n(c,N),u=p();let d=Vu(c,u),E=k.createHref(c);i.replaceState(d,"",E),o&&s&&s({action:a,location:k.location,delta:0})}function x(N){return Um(N)}let k={get action(){return a},get location(){return e(l,i)},listen(N){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Wu,m),s=N,()=>{l.removeEventListener(Wu,m),s=null}},createHref(N){return t(l,N)},createURL:x,encodeLocation(N){let h=x(N);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:v,replace:w,go(N){return i.go(N)}};return k}function Um(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ie(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Xr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Sd(e,t,n="/"){return Hm(e,t,n,!1)}function Hm(e,t,n,r){let l=typeof t=="string"?xn(t):t,o=jt(l.pathname||"/",n);if(o==null)return null;let i=xd(e);Bm(i);let a=null;for(let s=0;a==null&&s{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&s)return;ie(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let m=Nt([r,p.relativePath]),v=n.concat(p);i.children&&i.children.length>0&&(ie(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),xd(i.children,t,v,m,s)),!(i.path==null&&!i.index)&&t.push({path:m,score:Gm(m,i.index),routesMeta:v})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of kd(i.path))o(i,a,!0,u)}),t}function kd(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=kd(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function Bm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Xm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Wm=/^:[\w-]+$/,Vm=3,Qm=2,Km=1,Ym=10,Jm=-2,Qu=e=>e==="*";function Gm(e,t){let n=e.split("/"),r=n.length;return n.some(Qu)&&(r+=Jm),t&&(r+=Qm),n.filter(l=>!Qu(l)).reduce((l,o)=>l+(Wm.test(o)?Vm:o===""?Km:Ym),r)}function Xm(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 bm(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let x=a[v]||"";i=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=a[v];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Zm(e,t=!1,n=!0){ft(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,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).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 qm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ft(!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 jt(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 eg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?xn(e):e;return{pathname:n?n.startsWith("/")?n:tg(n,t):t,search:lg(r),hash:og(l)}}function tg(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 Si(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 ng(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ed(e){let t=ng(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Cd(e,t,n,r=!1){let l;typeof e=="string"?l=xn(e):(l={...e},ie(!l.pathname||!l.pathname.includes("?"),Si("?","pathname","search",l)),ie(!l.pathname||!l.pathname.includes("#"),Si("#","pathname","hash",l)),ie(!l.search||!l.search.includes("#"),Si("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let m=t.length-1;if(!r&&i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),m-=1;l.pathname=v.join("/")}a=m>=0?t[m]:"/"}let s=eg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var Nt=e=>e.join("/").replace(/\/\/+/g,"/"),rg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,og=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ig(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Nd=["POST","PUT","PATCH","DELETE"];new Set(Nd);var sg=["GET",...Nd];new Set(sg);var ir=g.createContext(null);ir.displayName="DataRouter";var zo=g.createContext(null);zo.displayName="DataRouterState";g.createContext(!1);var _d=g.createContext({isTransitioning:!1});_d.displayName="ViewTransition";var ag=g.createContext(new Map);ag.displayName="Fetchers";var ug=g.createContext(null);ug.displayName="Await";var yt=g.createContext(null);yt.displayName="Navigation";var rl=g.createContext(null);rl.displayName="Location";var $t=g.createContext({outlet:null,matches:[],isDataRoute:!1});$t.displayName="Route";var pa=g.createContext(null);pa.displayName="RouteError";function cg(e,{relative:t}={}){ie(ll(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=g.useContext(yt),{hash:l,pathname:o,search:i}=ol(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Nt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function ll(){return g.useContext(rl)!=null}function kn(){return ie(ll(),"useLocation() may be used only in the context of a component."),g.useContext(rl).location}var Pd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ld(e){g.useContext(yt).static||g.useLayoutEffect(e)}function fg(){let{isDataRoute:e}=g.useContext($t);return e?Cg():dg()}function dg(){ie(ll(),"useNavigate() may be used only in the context of a component.");let e=g.useContext(ir),{basename:t,navigator:n}=g.useContext(yt),{matches:r}=g.useContext($t),{pathname:l}=kn(),o=JSON.stringify(Ed(r)),i=g.useRef(!1);return Ld(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(ft(i.current,Pd),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Cd(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Nt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}g.createContext(null);function ol(e,{relative:t}={}){let{matches:n}=g.useContext($t),{pathname:r}=kn(),l=JSON.stringify(Ed(n));return g.useMemo(()=>Cd(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function pg(e,t){return Rd(e,t)}function Rd(e,t,n,r,l){var c;ie(ll(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=g.useContext(yt),{matches:i}=g.useContext($t),a=i[i.length-1],s=a?a.params:{},u=a?a.pathname:"/",p=a?a.pathnameBase:"/",m=a&&a.route;{let d=m&&m.path||"";jd(u,!m||d.endsWith("*")||d.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 v=kn(),w;if(t){let d=typeof t=="string"?xn(t):t;ie(p==="/"||((c=d.pathname)==null?void 0:c.startsWith(p)),`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 "${p}" but pathname "${d.pathname}" was given in the \`location\` prop.`),w=d}else w=v;let x=w.pathname||"/",k=x;if(p!=="/"){let d=p.replace(/^\//,"").split("/");k="/"+x.replace(/^\//,"").split("/").slice(d.length).join("/")}let N=Sd(e,{pathname:k});ft(m||N!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),ft(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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 h=yg(N&&N.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:Nt([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Nt([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?g.createElement(rl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},h):h}function hg(){let e=Eg(),t=ig(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=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:l},n):null,i)}var mg=g.createElement(hg,null),gg=class extends g.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?g.createElement($t.Provider,{value:this.props.routeContext},g.createElement(pa.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function vg({routeContext:e,match:t,children:n}){let r=g.useContext(ir);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement($t.Provider,{value:e},n)}function yg(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(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);ie(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 a=!1,s=-1;if(n)for(let u=0;u=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((u,p,m)=>{let v,w=!1,x=null,k=null;n&&(v=i&&p.route.id?i[p.route.id]:void 0,x=p.route.errorElement||mg,a&&(s<0&&m===0?(jd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,k=null):s===m&&(w=!0,k=p.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,m+1)),h=()=>{let c;return v?c=x:w?c=k:p.route.Component?c=g.createElement(p.route.Component,null):p.route.element?c=p.route.element:c=u,g.createElement(vg,{match:p,routeContext:{outlet:u,matches:N,isDataRoute:n!=null},children:c})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?g.createElement(gg,{location:n.location,revalidation:n.revalidation,component:x,error:v,children:h(),routeContext:{outlet:null,matches:N,isDataRoute:!0},unstable_onError:r}):h()},null)}function ha(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wg(e){let t=g.useContext(ir);return ie(t,ha(e)),t}function Sg(e){let t=g.useContext(zo);return ie(t,ha(e)),t}function xg(e){let t=g.useContext($t);return ie(t,ha(e)),t}function ma(e){let t=xg(e),n=t.matches[t.matches.length-1];return ie(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kg(){return ma("useRouteId")}function Eg(){var r;let e=g.useContext(pa),t=Sg("useRouteError"),n=ma("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Cg(){let{router:e}=wg("useNavigate"),t=ma("useNavigate"),n=g.useRef(!1);return Ld(()=>{n.current=!0}),g.useCallback(async(l,o={})=>{ft(n.current,Pd),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var Ku={};function jd(e,t,n){!t&&!Ku[e]&&(Ku[e]=!0,ft(!1,n))}g.memo(Ng);function Ng({routes:e,future:t,state:n,unstable_onError:r}){return Rd(e,void 0,n,r,t)}function Td(e){ie(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function _g({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ie(!ll(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=g.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=xn(n));let{pathname:s="/",search:u="",hash:p="",state:m=null,key:v="default"}=n,w=g.useMemo(()=>{let x=jt(s,i);return x==null?null:{location:{pathname:x,search:u,hash:p,state:m,key:v},navigationType:r}},[i,s,u,p,m,v,r]);return ft(w!=null,` is not able to match the URL "${s}${u}${p}" because it does not start with the basename, so the won't render anything.`),w==null?null:g.createElement(yt.Provider,{value:a},g.createElement(rl.Provider,{children:t,value:w}))}function Pg({children:e,location:t}){return pg(gs(e),t)}function gs(e,t=[]){let n=[];return g.Children.forEach(e,(r,l)=>{if(!g.isValidElement(r))return;let o=[...t,l];if(r.type===g.Fragment){n.push.apply(n,gs(r.props.children,o));return}ie(r.type===Td,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ie(!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=gs(r.props.children,o)),n.push(i)}),n}var Wl="get",Vl="application/x-www-form-urlencoded";function Io(e){return e!=null&&typeof e.tagName=="string"}function Lg(e){return Io(e)&&e.tagName.toLowerCase()==="button"}function Rg(e){return Io(e)&&e.tagName.toLowerCase()==="form"}function jg(e){return Io(e)&&e.tagName.toLowerCase()==="input"}function Tg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $g(e,t){return e.button===0&&(!t||t==="_self")&&!Tg(e)}var jl=null;function Mg(){if(jl===null)try{new FormData(document.createElement("form"),0),jl=!1}catch{jl=!0}return jl}var zg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xi(e){return e!=null&&!zg.has(e)?(ft(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Vl}"`),null):e}function Ig(e,t){let n,r,l,o,i;if(Rg(e)){let a=e.getAttribute("action");r=a?jt(a,t):null,n=e.getAttribute("method")||Wl,l=xi(e.getAttribute("enctype"))||Vl,o=new FormData(e)}else if(Lg(e)||jg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a `,x=`
${v}
`;return`
${w}${x}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function $v(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r/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 a=e.substring(l+o);const s=a.match(n);let u=null,p=i;return s?(u=a.substring(0,s.index).trim(),p+=a.substring(s.index+s[0].length)):u=a.trim(),{think:u||null,answer:p.trim()}}function Mv({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=Ud(e||""),[o,i]=je.useState(!1),a=!!r;return y.jsxs("div",{className:"assistant-message",children:[a&&y.jsxs("div",{className:"assistant-thoughts",children:[y.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[y.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&y.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:nc(r)}})]}),y.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:nc(l||e||"")}}),Array.isArray(n)&&n.length>0&&y.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,m=!1;try{const v=new URL(s);if(v.protocol==="file:"){m=!0;const w=v.pathname.split("/").filter(Boolean);p=decodeURIComponent(w[w.length-1]||s)}else p=(v.hostname||s).replace(/^www\./i,"")}catch{}return y.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:v=>{var w,x;if(m){v.preventDefault();try{const k=new URL(s);(x=(w=window.electronAPI)==null?void 0:w.openPath)==null||x.call(w,decodeURIComponent(k.pathname))}catch{}}},children:p},s+u)})})]})}const rc="websearch.searxUrl",lc="websearch.engines",ki="chat.librarySlug";let zv="http://127.0.0.1:8000";const Iv=48,Fv=24;function Ov(){var Ma;const[e,t]=g.useState([]),[n,r]=g.useState(null),[l,o]=g.useState("chats"),[i,a]=g.useState("General"),[s,u]=g.useState(null),[p,m]=g.useState([]),[v,w]=g.useState([]),[x,k]=g.useState(null),[N,h]=g.useState(localStorage.getItem(ki)||null),[c,d]=g.useState(null),[E,R]=g.useState(!1),[j,T]=g.useState(""),[z,U]=g.useState(""),[I,ue]=g.useState(""),[tt,nt]=g.useState(""),Pe=g.useRef(null),dt=g.useRef(null),[V,Mt]=g.useState(zv),[$,W]=g.useState("Default"),[_,D]=g.useState(!1),[b,Ue]=g.useState(localStorage.getItem(rc)||"http://localhost:8888"),[Le,sr]=g.useState(()=>{try{const f=localStorage.getItem(lc);if(f)return JSON.parse(f)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});g.useEffect(()=>{localStorage.setItem(rc,b||"")},[b]),g.useEffect(()=>{try{localStorage.setItem(lc,JSON.stringify(Le||[]))}catch{}},[Le]);const[Je,En]=g.useState(!1),[zt,Fo]=g.useState(!1),[Uv,Oo]=g.useState(!0),[Hd,Cn]=g.useState([]),[il,wa]=g.useState({}),[Bd,Do]=g.useState(null),[Ao,sl]=g.useState("");function Wd(f){const S=f.content||"";if(f.role==="assistant")try{const{answer:C}=Ud(S);return(C||S).trim()}catch{return S.trim()}return S}async function Sa(f){try{await navigator.clipboard.writeText(Wd(f))}catch(S){console.error("Failed to copy message:",S)}}function nn(f,S,C,P={}){const{removeIfEmpty:O=!1}=P;t(B=>B.map(H=>{if(H.session_id!==f)return H;const A=[];for(const K of H.messages||[]){if(K.id!==S){A.push(K);continue}O&&!C||A.push({...K,content:C})}return{...H,messages:A}}))}function rn(f){return(f==null?void 0:f.name)==="AbortError"}function Uo(f){return f instanceof Error&&f.message?f.message:String(f)}function Vd(f,S){Do(f),sl(S||"")}function al(){Do(null),sl("")}async function Qd(f){var B;const S=(((B=Ln[f])==null?void 0:B.content)||"").trim(),P=(Ao??"").trim();if(P.length===0){al();return}if(P===S){al();return}const O=n;if(O){t(H=>H.map(A=>{if(A.session_id!==O)return A;const xe=(A.messages||[]).slice(0,f+1).map((de,Q)=>Q===f?{...de,content:P}:de);return{...A,messages:xe}})),Do(null),sl(""),requestAnimationFrame(()=>Qo("auto",O));try{const H=await fetch(`${V}/sessions/${O}/messages/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:P})});if(!H.ok)throw new Error(`HTTP ${H.status}`)}catch(H){console.error("Failed to update message:",H),t(A=>A.map(K=>{if(K.session_id!==O)return K;const de=(K.messages||[]).map((Q,F)=>F===f?{...Q,content:S}:Q);return{...K,messages:de}}));return}await xa(f,P)}}async function xa(f,S=null){var K,xe,de,Q;const C=n;if(zt||!C||typeof f!="number")return;const P=((K=e.find(F=>F.session_id===C))==null?void 0:K.messages)||[];let O=f;for(let F=f;F>=0;F--)if(((xe=P[F])==null?void 0:xe.role)==="user"){O=F;break}t(F=>F.map(Z=>Z.session_id===C?{...Z,messages:(Z.messages||[]).slice(0,O+1)}:Z));const B=Pa(C);let H=null,A=[];try{if(Je)try{const F=S??(((de=P[O])==null?void 0:de.content)||""),Z=P.slice(Math.max(0,O-7),O+1).map(ke=>({role:ke.role,content:ke.content||""}));Z.length>0&&(Z[Z.length-1]={role:"user",content:F});const J=await(await fetch(`${V}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:B.signal,body:JSON.stringify({prompt:F,model:I,messages:Z,history_limit:8,searx_url:b||null,engines:Array.isArray(Le)?Le:null})})).json();J&&typeof J.enriched_prompt=="string"&&(H=J.enriched_prompt,A=Array.isArray(J.sources)?J.sources:[])}catch(F){if(rn(F))throw F;console.warn("web search enrichment (regenerate) failed",F)}if(_){const F=`msg-${Date.now()}-${Math.random()}`;let Z="";t(X=>X.map(J=>J.session_id===C?{...J,messages:[...J.messages||[],{id:F,role:"assistant",content:"",sources:A}]}:J));try{const X=await fetch(`${V}/sessions/${C}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:B.signal,body:JSON.stringify({index:f,model:I,stream:!0,enriched_message:H,sources:A||[]})});if(!X.ok)throw new Error(`HTTP ${X.status}`);const J=(Q=X.body)==null?void 0:Q.getReader();if(!J)throw new Error("Missing response body");const ke=new TextDecoder;let cr=!1;for(;;){const{value:wt,done:Ko}=await J.read();if(Ko)break;const Yo=ke.decode(wt,{stream:!0});Z+=Yo,nn(C,F,Z),!cr&&Se.current!==C&&(cr=!0,ln(rt=>({...rt,[C]:F})),Cn(rt=>[...new Set([...rt,C])]))}Se.current!==C?(ln(wt=>({...wt,[C]:F})),Cn(wt=>[...new Set([...wt,C])])):Nn.current[C]?_n(wt=>({...wt,[C]:F})):requestAnimationFrame(()=>jn(F,"smooth",C))}catch(X){if(rn(X)){nn(C,F,Z,{removeIfEmpty:!0});return}console.error(X),nn(C,F,`Error: ${Uo(X)}`,{removeIfEmpty:!0});return}}else{const F=await fetch(`${V}/sessions/${C}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:B.signal,body:JSON.stringify({index:f,model:I,stream:!1,enriched_message:H,sources:A||[]})});if(!F.ok)throw new Error(`HTTP ${F.status}`);const Z=await F.json(),X=`msg-${Date.now()}`;t(J=>J.map(ke=>ke.session_id===C?{...ke,messages:[...ke.messages||[],{role:"assistant",content:Z.reply,id:X,sources:A}]}:ke)),Se.current!==C?(ln(J=>({...J,[C]:X})),Cn(J=>[...new Set([...J,C])])):Nn.current[C]?_n(J=>({...J,[C]:X})):requestAnimationFrame(()=>jn(X,"smooth",C))}}catch(F){rn(F)||console.error(F)}finally{Ho(B)}}const[ka,Kd]=g.useState({}),Nn=g.useRef({}),[Yd,ln]=g.useState({}),on=g.useRef({}),Ea=g.useRef({}),[Ca,_n]=g.useState({}),[Jd,Na]=g.useState({}),_a=(f,S,C)=>f!=null&&f.id?f.id:`${C}:${S}`;g.useEffect(()=>{var S;if(!n)return;const f=((S=e.find(C=>C.session_id===n))==null?void 0:S.messages)||[];Na(C=>{const P={};return f.forEach((O,B)=>{if(O.role!=="user")return;const H=_a(O,B,n),K=(O.content||"").split(/\r\n|\r|\n/).length>30;P[H]=K?C[H]??!0:!1}),P})},[e,n]);function Gd(f){Na(S=>({...S,[f]:!(S[f]??!0)}))}const ar=je.useCallback((f,S)=>{Kd(C=>{const P={...C,[f]:S};return Nn.current=P,P})},[]),Pn=g.useRef(null),Xd=g.useRef(!1),bd=g.useRef(null),Se=g.useRef(n);g.useEffect(()=>{Se.current=n},[n]);const Pa=je.useCallback(f=>{const S=new AbortController;return Pn.current={controller:S,sessionId:f},Fo(!0),S},[]),Ho=je.useCallback(f=>{var S;((S=Pn.current)==null?void 0:S.controller)===f&&(Pn.current=null,Fo(!1))},[]),Zd=je.useCallback(()=>{const f=Pn.current;f&&(Pn.current=null,f.controller.abort(),Fo(!1))},[]);g.useEffect(()=>()=>{var f;(f=Pn.current)==null||f.controller.abort()},[]);const It=g.useRef(null),[qd,ep]=g.useState(230),[ul,La]=g.useState(!1),tp=je.useCallback(f=>{La(!0)},[]),Bo=je.useCallback(()=>{La(!1)},[]),Wo=je.useCallback(f=>{if(ul){const S=Math.max(230,Math.min(500,f.clientX));ep(S)}},[ul]);je.useEffect(()=>(window.addEventListener("mousemove",Wo),window.addEventListener("mouseup",Bo),()=>{window.removeEventListener("mousemove",Wo),window.removeEventListener("mouseup",Bo)}),[Wo,Bo]),je.useEffect(()=>{ul?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[ul]),je.useEffect(()=>{const f=async S=>{const C=S.target.closest(".codeblock__copy");if(!C)return;const P=C.closest(".codeblock"),O=P==null?void 0:P.querySelector("pre > code");if(O)try{await navigator.clipboard.writeText(O.textContent||""),C.classList.add("copied"),setTimeout(()=>C.classList.remove("copied"),800)}catch(B){console.error("Copy failed:",B)}};return document.addEventListener("click",f),()=>document.removeEventListener("click",f)},[]),g.useEffect(()=>{window.electronAPI.getSettings().then(S=>{Mt(S.ollamaApiUrl),W(S.colorScheme||"Default"),ue(S.chatModel||""),D(S.streamOutput||!1),wa(S.scrollPositions||{}),br(S.colorScheme||"Default")});const f=()=>{var S;l==="chats"&&((S=dt.current)==null||S.focus())};return window.electronAPI.onWindowFocus(f),()=>{}},[l]),g.useEffect(()=>{br($)},[$]);const np=f=>{!f||!V||fetch(`${V}/history?session_id=${encodeURIComponent(f)}`).then(S=>S.json()).then(S=>{t(C=>C.map(P=>P.session_id===f?{...P,messages:S.messages||[]}:P))}).catch(()=>{})};async function ur(){if(V)try{const S=await(await fetch(`${V}/libraries`)).json(),C=Array.isArray(S.libraries)?S.libraries:[];if(m(C),C.length===0){k(null),h(null),d(null);return}C.some(P=>P.slug===x)||k(C[0].slug),N&&!C.some(P=>P.slug===N)&&h(null),c&&!C.some(P=>P.slug===c)&&d(null)}catch(f){console.warn("Failed to load libraries",f)}}async function cl(){if(V)try{const S=await(await fetch(`${V}/jobs`)).json();w(Array.isArray(S.jobs)?S.jobs:[])}catch(f){console.warn("Failed to load library jobs",f)}}async function rp(f,S){const C={method:"POST",headers:{"Content-Type":"application/json"}},P=await fetch(`${V}/libraries/${f}/jobs/${S}`,C);if(!P.ok){const O=await P.text();throw new Error(O||`HTTP ${P.status}`)}await cl()}async function Ra(f=null){const C=(typeof f=="string"?f:j).trim();if(!C){U("Name is required.");return}try{U("");const P=await fetch(`${V}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:C})});if(!P.ok){const B=await P.text();throw new Error(B||`HTTP ${P.status}`)}const O=await P.json();R(!1),T(""),await ur(),O!=null&&O.slug&&k(O.slug)}catch(P){console.error("Failed to create library",P),U(String((P==null?void 0:P.message)||P))}}g.useEffect(()=>{V&&(Oo(!0),fetch(`${V}/sessions`).then(f=>f.json()).then(f=>{const S=f.sessions.map(C=>({...C,messages:[]}));t(S),S.length>0?r(S[0].session_id):r(null),Oo(!1)}).catch(()=>{Oo(!1)}))},[V]),g.useEffect(()=>{V&&(ur(),cl())},[V]),g.useEffect(()=>{try{N?localStorage.setItem(ki,N):localStorage.removeItem(ki)}catch{}},[N]),g.useEffect(()=>{if(!V)return;const f=setInterval(()=>{ur(),cl()},3e3);return()=>clearInterval(f)},[V,l,x,N]),g.useEffect(()=>{np(n)},[n]);const Vo=f=>{o(f)},lp=f=>{ap(f)},Ln=g.useMemo(()=>{var f;return((f=e.find(S=>S.session_id===n))==null?void 0:f.messages)||[]},[n,e]),fl=g.useMemo(()=>p.find(f=>f.slug===x)||null,[x,p]),He=g.useMemo(()=>p.find(f=>f.slug===N)||null,[N,p]),Rn=g.useMemo(()=>p.find(f=>f.slug===c)||null,[c,p]),dl=g.useMemo(()=>He||Rn||null,[He,Rn]);g.useEffect(()=>{var f,S;N&&He&&!((f=He.states)!=null&&f.is_indexed)&&((S=He.files)!=null&&S.length&&d(N),h(null))},[N,He]),g.useEffect(()=>{var O,B;if(!c||!V)return;const f=v.filter(H=>H.slug===c).sort((H,A)=>String(A.created_at||"").localeCompare(String(H.created_at||""))),S=f.some(H=>H.status==="queued"||H.status==="running"),C=f[0]||null;if(!Rn){d(null);return}if((O=Rn.states)!=null&&O.is_indexed){h(c),d(null);return}if(S)return;if((C==null?void 0:C.status)==="failed"){d(null);return}if(!((B=Rn.files)!=null&&B.length)){d(null);return}let P=!1;return(async()=>{try{await rp(c,"prepare"),P||await ur()}catch(H){console.error("Failed to prepare library for chat",H),P||d(null)}})(),()=>{P=!0}},[c,Rn,v,V]);async function op(f){var P,O;const S=typeof f=="string"?f:f==null?void 0:f.slug;if(!S)return;if(N===S||c===S){h(B=>B===S?null:B),d(B=>B===S?null:B);return}const C=p.find(B=>B.slug===S);if(C){if((P=C.states)!=null&&P.is_indexed){h(S),d(null);return}if(!((O=C.files)!=null&&O.length))throw new Error("Add files before adding this database to chat.");d(S)}}g.useEffect(()=>{const f=n,S=l;return()=>{if(S==="chats"&&f){const C=typeof on.current[f]=="number"?on.current[f]:Pe.current?Pe.current.scrollTop:0;wa(P=>{const O={...P,[f]:C};return window.electronAPI.updateSettings({scrollPositions:O}),O})}}},[n,l]),g.useEffect(()=>{const f=Pe.current;if(!f)return;const S=()=>{const{scrollTop:C,scrollHeight:P,clientHeight:O}=f,B=P-C-O<=Fv;if(n){const H=Ea.current[n],A=typeof H=="number"&&Cf.removeEventListener("scroll",S)},[n,ar]),g.useEffect(()=>{const f=n;f&&ka[f]===!1&&_n(S=>{if(!(f in S))return S;const C={...S};return delete C[f],C})},[n,ka]),g.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const f=Pe.current;if(!f)return;It.current=null;const S=()=>{if(It.current===n)return;const H=typeof on.current[n]=="number"?on.current[n]:void 0,A=typeof H=="number"?H:il[n];if(typeof A=="number"){f.scrollTop=A,It.current=n;return}Ln.length>0&&(f.scrollTop=f.scrollHeight,It.current=n)};S();const C=requestAnimationFrame(S),P=()=>{It.current!==n&&requestAnimationFrame(S)},O=new MutationObserver(P);O.observe(f,{childList:!0,subtree:!0});const B=new ResizeObserver(P);return B.observe(f),()=>{cancelAnimationFrame(C),O.disconnect(),B.disconnect()}},[n,l,Ln.length,il]),g.useEffect(()=>{if(l!=="chats"||!n||It.current===n)return;const f=typeof on.current[n]=="number"?on.current[n]:void 0;typeof(typeof f=="number"?f:il[n])!="number"&&Ln.length>0&&requestAnimationFrame(()=>{const C=Pe.current;C&&(C.scrollTop=C.scrollHeight,It.current=n)})},[Ln.length,n,l,il]);const Qo=(f="smooth",S=null)=>{const C=Pe.current;if(!C)return;const P=S??Se.current;Se.current===P&&(C.scrollTo({top:C.scrollHeight,behavior:f}),ar(P,!1))},jn=(f,S="auto",C=null)=>{const P=Pe.current;if(!P)return;const O=C??Se.current;if(Se.current!==O)return;const B=document.getElementById(f);if(B){const H=Math.max(0,B.offsetTop-Iv);P.scrollTo({top:H,behavior:S})}},ip=()=>{const f=Se.current,S=Ca[f];S&&(jn(S,"smooth",f),_n(C=>{const{[f]:P,...O}=C;return O}))};async function ja(){var O,B,H;if(zt||!tt.trim()||!I)return;let f=n,S=!1;if(f){const A=e.find(K=>K.session_id===f);S=A&&A.name==="New Chat"&&A.messages.length===0}else{const A=await Ta();await new Promise(K=>setTimeout(K,200)),f=A.session_id,S=!0}const C={role:"user",content:tt.trim(),id:`msg-${Date.now()}-${Math.random()}`};Xd.current=!0,bd.current=f,ar(f,!1),Se.current===f&&(It.current=Se.current),yd.flushSync(()=>{t(A=>A.map(K=>K.session_id===f?{...K,messages:[...K.messages||[],C]}:K)),nt("")}),requestAnimationFrame(()=>Qo("auto",f));const P=Pa(f);try{let A=[];try{A=[...(((O=e.find(Z=>Z.session_id===f))==null?void 0:O.messages)||[]).slice(-8).map(Z=>({role:Z.role,content:Z.content||""})),{role:"user",content:C.content}]}catch{}let K=C.content,xe=[];const de=[];if(N&&((B=He==null?void 0:He.states)!=null&&B.is_indexed))try{const F=await(await fetch(`${V}/libraries/${N}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:P.signal,body:JSON.stringify({prompt:C.content,top_k:5})})).json();F&&typeof F.context_block=="string"&&F.context_block.trim()&&de.push(F.context_block.trim()),Array.isArray(F==null?void 0:F.sources)&&xe.push(...F.sources)}catch(Q){if(rn(Q))throw Q;console.warn("local library enrichment failed",Q)}if(Je)try{const F=await(await fetch(`${V}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:P.signal,body:JSON.stringify({prompt:C.content,model:I,messages:A,history_limit:8,searx_url:b||null,engines:Array.isArray(Le)?Le:null})})).json();F&&typeof F.context_block=="string"&&F.context_block.trim()&&de.push(F.context_block.trim()),Array.isArray(F==null?void 0:F.sources)&&xe.push(...F.sources)}catch(Q){if(rn(Q))throw Q;console.warn("web search enrichment failed",Q)}if(xe=[...new Set(xe)],de.length>0&&(K=`${C.content} + +${de.join(` + +`)}`),_){const Q=`msg-${Date.now()}-${Math.random()}`;let F="";const Z={role:"assistant",content:"",id:Q,sources:xe};t(X=>X.map(J=>J.session_id===f?{...J,messages:[...J.messages||[],Z]}:J));try{const X=await fetch(`${V}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:P.signal,body:JSON.stringify({session_id:f,model:I,message:C.content,enriched_message:de.length>0?K:null,stream:!0,sources:xe||[]})});if(!X.ok)throw new Error(`HTTP ${X.status}`);const J=(H=X.body)==null?void 0:H.getReader();if(!J)throw new Error("Missing response body");const ke=new TextDecoder;let cr=!1;for(;;){const{value:wt,done:Ko}=await J.read();if(Ko){nn(f,Q,F),Se.current===f?Nn.current[f]?_n(rt=>({...rt,[f]:Q})):requestAnimationFrame(()=>jn(Q,"smooth",f)):(ln(rt=>({...rt,[f]:Q})),Cn(rt=>[...new Set([...rt,f])]));break}const Yo=ke.decode(wt,{stream:!0});F+=Yo,nn(f,Q,F),Se.current===f&&!Nn.current[f]&&Qo("auto",f),Se.current!==f&&!cr&&(ln(rt=>({...rt,[f]:Q})),cr=!0)}}catch(X){if(rn(X)){nn(f,Q,F,{removeIfEmpty:!0});return}console.error("Failed to send message:",X),nn(f,Q,"Error: "+Uo(X),{removeIfEmpty:!0});return}}else{const Q=await fetch(`${V}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:P.signal,body:JSON.stringify({session_id:f,model:I,message:C.content,enriched_message:de.length>0?K:null,stream:!1,sources:xe||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const F=await Q.json(),Z=`msg-${Date.now()}`,X={role:"assistant",content:F.reply,id:Z,sources:xe};t(J=>J.map(ke=>ke.session_id===f?{...ke,messages:[...ke.messages||[],X]}:ke)),Z&&(Se.current===f?Nn.current[f]?_n(J=>({...J,[f]:Z})):requestAnimationFrame(()=>jn(Z,"smooth",f)):ln(J=>({...J,[f]:Z})))}Se.current!==f&&Cn(Q=>[...new Set([...Q,f])]),S&&fetch(`${V}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:f,message:C.content,model:I})}).then(Q=>Q.json()).then(Q=>{const F=Q.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(Z=>Z.map(X=>X.session_id===f?{...X,name:F}:X))})}catch(A){if(rn(A)){Ho(P);return}console.error("Failed to send message:",A);const K={role:"assistant",content:"Error: "+Uo(A),id:`msg-${Date.now()}-${Math.random()}`};t(xe=>xe.map(de=>de.session_id===f?{...de,messages:[...de.messages,K]}:de))}finally{Ho(P)}}function sp(){En(f=>!f)}async function Ta(){var O;const f="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),C=await(await fetch(`${V}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:f})})).json(),P={...C,messages:[]};return t(B=>[P,...B]),r(C.session_id),(O=dt.current)==null||O.focus(),C}function ap(f){r(f),Cn(C=>C.filter(P=>P!==f));const S=Yd[f];S&&requestAnimationFrame(()=>{let C=12;const P=()=>{if(!Pe.current)return;let B=document.getElementById(S);if(!B){const H=e.find(A=>A.session_id===f);if(H&&Array.isArray(H.messages))for(let A=H.messages.length-1;A>=0;A--){const K=H.messages[A];if(K.role==="assistant"&&K.id){B=document.getElementById(K.id);break}}}B?(jn(B.id,"smooth",f),ln(H=>{const{[f]:A,...K}=H;return K})):C-- >0&&requestAnimationFrame(P)};requestAnimationFrame(P)})}function up(f,S){fetch(`${V}/sessions/${f}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S})}).then(()=>{t(C=>C.map(P=>P.session_id===f?{...P,name:S}:P)),u(null)})}function $a(f){fetch(`${V}/sessions/${f}`,{method:"DELETE"}).then(()=>{const S=e.filter(C=>C.session_id!==f);t(S),n===f&&r(S.length>0?S[0].session_id:null)})}g.useEffect(()=>{const f=e.filter(S=>S.name==="New Chat"&&S.session_id!==n&&S.messages.length===0);f.length>0&&f.forEach(S=>{$a(S.session_id)})},[n,e,V]);const cp=f=>{var C;window.getSelection().toString().length>0||document.activeElement!==dt.current&&(f.target.closest(".msg")||(C=dt.current)==null||C.focus())};return y.jsxs("div",{className:"app",style:{gridTemplateColumns:`${qd}px 1fr`},children:[y.jsxs("div",{className:"sidebar",children:[y.jsxs("div",{className:"sidebar-header",children:[y.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Vo("chats"),children:"Chats"}),y.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Vo("dbs"),children:"DBs"}),y.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Vo("settings"),children:"Settings"})]}),y.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&y.jsx("div",{className:"chat-list",children:e.map(f=>y.jsx("div",{className:`chat-item ${f.session_id===n?"active":""}`,onClick:()=>lp(f.session_id),children:s===f.session_id?y.jsx("input",{type:"text",className:"rename-input",defaultValue:f.name,onBlur:()=>u(null),onKeyDown:S=>{S.key==="Enter"?up(f.session_id,S.target.value):S.key==="Escape"&&u(null)},autoFocus:!0}):y.jsxs(y.Fragment,{children:[y.jsx("span",{children:f.name}),y.jsxs("div",{className:"chat-item-buttons",children:[Hd.includes(f.session_id)&&y.jsx("div",{className:"unread-dot"}),y.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),u(f.session_id)},children:y.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:y.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),y.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),$a(f.session_id)},children:y.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:[y.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),y.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},f.session_id))}),l==="dbs"&&y.jsx("div",{className:"db-list",children:p.length===0?y.jsx("div",{className:"empty-list-message",children:"No databases yet."}):p.map(f=>y.jsxs("div",{className:`chat-item ${f.slug===x?"active":""}`,onClick:()=>k(f.slug),children:[y.jsx("span",{children:f.name}),N===f.slug&&y.jsx("div",{className:"db-active-badge",children:"Chat"}),c===f.slug&&y.jsx("div",{className:"db-active-badge",children:"Preparing"})]},f.slug))}),l==="settings"&&y.jsxs("div",{className:"settings-list",children:[y.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),y.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),y.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&y.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&y.jsx("button",{className:"button new-chat-button",onClick:Ta,children:"New Chat"}),l==="dbs"&&(E?y.jsxs("div",{className:"new-db-form",children:[y.jsx("input",{type:"text",className:"rename-input",value:j,onChange:f=>T(f.target.value),onKeyDown:f=>{f.key==="Enter"?Ra():f.key==="Escape"&&(R(!1),T(""),U(""))},placeholder:"Database name",autoFocus:!0}),z&&y.jsx("div",{className:"form-error",children:z}),y.jsxs("div",{className:"new-db-actions",children:[y.jsx("button",{className:"button new-db-button",onClick:()=>Ra(),children:"Create"}),y.jsx("button",{className:"button ghost",onClick:()=>{R(!1),T(""),U("")},children:"Cancel"})]})]}):y.jsx("button",{className:"button new-db-button",onClick:()=>{R(!0),U("")},children:"New Database"}))]}),y.jsx("div",{className:"resizer",onMouseDown:tp})]}),y.jsxs("div",{className:"main-content",children:[l==="chats"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"header",children:[y.jsxs("strong",{children:["Chat - ",((Ma=e.find(f=>f.session_id===n))==null?void 0:Ma.name)||"New Chat"]}),dl&&y.jsx("span",{className:"header-subtle",children:He?`DB: ${He.name}`:`DB: ${dl.name} (preparing)`})]}),y.jsx("div",{className:"chat",ref:Pe,onClick:cp,children:Ln.map((f,S)=>{const C=f.role==="user"&&Bd===S;return y.jsx("div",{id:f.id,className:"msg "+(f.role==="user"?"user":"assistant")+(C?" editing":""),children:f.role==="assistant"?y.jsxs("div",{className:"assistant-message-wrapper",children:[y.jsx(Mv,{content:f.content,streamOutput:_,sources:f.sources}),!zt&&y.jsxs("div",{className:"message-options-bar assistant-options",children:[y.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Sa(f),children:y.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:[y.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),y.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),y.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>xa(S),children:y.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:y.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"})})})]})]}):y.jsxs("div",{className:"user-message-wrapper",children:[C?y.jsxs("div",{className:"msg-content msg-content--user editing",children:[y.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ao}),y.jsx(qu,{className:"edit-message-input edit-overlay",value:Ao,onChange:P=>sl(P.target.value),onBlur:al,onKeyDown:P=>{P.key==="Escape"&&(P.preventDefault(),al()),P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),Qd(S))},autoFocus:!0,minRows:1})]}):(()=>{const P=f.content||"",O=P.split(/\r\n|\r|\n/),B=O.length>30,H=_a(f,S,n),A=B?Jd[H]??!0:!1,K=A?O.slice(0,30).join(` +`)+` +…`:P;return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"msg-content msg-content--user",children:K}),B&&y.jsx("button",{className:"user-msg-expand",onClick:()=>Gd(H),"aria-expanded":A?"false":"true",children:A?"Show entire message":"Collapse"})]})})(),!zt&&!C&&y.jsxs("div",{className:"message-options-bar user-options",children:[y.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>Vd(S,f.content),children:y.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:[y.jsx("path",{d:"M12 20h9"}),y.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),y.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Sa(f),children:y.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:[y.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),y.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},f.id||S)})},n),Ca[n]&&y.jsxs("button",{className:"new-msg-tip",onClick:ip,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",y.jsx("span",{style:{marginLeft:6},children:"↓"})]}),y.jsx("div",{className:"footer",children:y.jsxs("div",{className:"footer-content-wrapper",children:[y.jsx(qu,{ref:dt,className:"input",value:tt,onChange:f=>nt(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),ja())},placeholder:"Ask any question...",maxRows:13}),y.jsx("button",{type:"button",className:"websearch-toggle"+(Je?" active":""),onClick:sp,title:"Toggle web search","aria-pressed":Je,children:y.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:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),y.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"})]})}),y.jsx("button",{className:"button",onClick:zt?Zd:ja,title:zt?"Cancel generation":"Send","aria-label":zt?"Cancel generation":"Send",children:zt?y.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"header",children:[y.jsx("strong",{children:(fl==null?void 0:fl.name)||"Databases"}),dl&&y.jsx("span",{className:"header-subtle",children:He?`Chat DB: ${He.name}`:`Chat DB: ${dl.name} (preparing)`})]}),y.jsx(jv,{apiBase:V,library:fl,jobs:v,chatLibrarySlug:N,pendingChatLibrarySlug:c,onRefresh:async()=>{await ur(),await cl()},onToggleChatLibrary:op,onDeleted:f=>{if(x===f){const S=p.find(C=>C.slug!==f);k((S==null?void 0:S.slug)||null)}N===f&&h(null),c===f&&d(null)}})]}),l==="settings"&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"header",children:y.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&y.jsx(Cv,{onModelChange:ue,streamOutput:_,onStreamOutputChange:D}),i==="Interface"&&y.jsx(Lv,{}),i==="Websearch"&&y.jsx(Tv,{searxUrl:b,setSearxUrl:Ue,engines:Le,setEngines:sr})]})]})]})}function Dv(){return g.useEffect(()=>{window.electronAPI.getSettings().then(e=>{br(e.colorScheme||"Default")})},[]),y.jsx(je.StrictMode,{children:y.jsx(Xg,{children:y.jsx(Pg,{children:y.jsx(Td,{path:"/",element:y.jsx(Ov,{})})})})})}const Av=wd(document.getElementById("root"));Av.render(y.jsx(Dv,{})); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..a66adf1 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + LLM Desktop + + + + +
+ +