diff --git a/static/dist/jbot.css b/static/dist/jbot.css index c3b3b94..5d72c7e 100644 --- a/static/dist/jbot.css +++ b/static/dist/jbot.css @@ -1 +1 @@ -*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}body{background:#f1f5f9;color:#0f172a;font-family:system-ui,Segoe UI,sans-serif;-webkit-font-smoothing:antialiased}#root{height:100dvh;height:-webkit-fill-available;display:flex;flex-direction:column}:root{--bg: #F1F5F9;--surface: #FFFFFF;--border: #E2E8F0;--text: #0F172A;--text2: #475569;--text3: #94A3B8;--accent: #0EA5E9;--accent-bg: #E0F7FE;--face-bg: #080C14}.app{height:100dvh;height:-webkit-fill-available;display:flex;flex-direction:column;background:var(--bg);color:var(--text);overflow:hidden}.hdr{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:10px 20px;background:var(--surface);border-bottom:1px solid var(--border)}.hdr h1{font-size:1.5rem;font-weight:800;letter-spacing:.1em;color:var(--text);margin:0}.accent{color:var(--accent)}.subtitle{font-size:.72rem;color:var(--text3);letter-spacing:.05em}.hdr-nav{margin-left:auto;display:flex;gap:8px}.hdr-link{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);font-size:.78rem;padding:4px 10px;cursor:pointer;transition:background .15s,color .15s}.hdr-link:hover{background:var(--bg);color:var(--accent)}.page-body{flex:1;min-height:0;display:flex;overflow:hidden}.left-col{flex:0 0 auto;width:296px;display:flex;flex-direction:column;overflow-y:auto;background:var(--surface);border-right:1px solid var(--border);padding:14px 14px 20px;gap:14px}.right-col{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}.screen-wrap{display:flex;flex-direction:column;align-items:center;gap:8px}.bezel{background:var(--face-bg);border-radius:18px;padding:12px;box-shadow:0 4px 28px #00000038,0 0 0 1px #ffffff0f}.expr-label{font-size:.85rem;color:var(--text2);height:1.4em;text-align:center}.scale-controls{display:flex;gap:6px}.scale-btn{background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text2);padding:3px 12px;font-size:.78rem;cursor:pointer;transition:all .15s}.scale-btn:hover{border-color:var(--accent);color:var(--accent)}.scale-btn.active{background:var(--accent-bg);border-color:var(--accent);color:var(--accent);font-weight:600}.panel{display:flex;flex-direction:column;gap:12px}.panel-section h3{font-size:.67rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--text3);margin:0 0 7px}.key-hint{font-weight:400;opacity:.7}.btn-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:5px}.btn-grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.btn-grid-4 .ebtn{font-size:.62rem;padding:5px 3px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ebtn{background:var(--bg);border:1px solid var(--border);border-radius:7px;color:var(--text2);padding:6px 9px;font-size:.78rem;cursor:pointer;transition:all .15s;text-align:left}.ebtn:hover{border-color:var(--c);color:var(--c);background:color-mix(in srgb,var(--c) 6%,var(--surface))}.ebtn.active{background:color-mix(in srgb,var(--c) 12%,var(--surface));border-color:var(--c);color:var(--c);font-weight:600}.toggle{display:flex;align-items:center;gap:7px;font-size:.8rem;color:var(--text2);cursor:pointer;-webkit-user-select:none;user-select:none}.toggle input[type=checkbox]{accent-color:var(--accent);width:14px;height:14px}.switch-interval{display:flex;flex-direction:column;gap:5px}.switch-interval-label{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text2)}.interval-val{color:var(--accent);font-weight:700}.switch-interval input[type=range]{width:100%;accent-color:var(--accent);cursor:pointer}.interval-ticks{display:flex;justify-content:space-between;font-size:.65rem;color:var(--text3)}.hint{font-size:.72rem;color:var(--text3);line-height:1.7}kbd{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:.68rem;font-family:inherit;color:var(--text2)}.hist-inline-link{background:none;border:none;color:var(--accent);font-size:.72rem;padding:0;cursor:pointer;text-decoration:underline}.chat-panel{display:flex;flex-direction:column;height:100%;padding:14px 18px;gap:10px;overflow:hidden}.chat-header{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding-bottom:8px;border-bottom:1px solid var(--border)}.chat-title{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--text3)}.history-link{background:none;border:none;color:var(--accent);font-size:.75rem;cursor:pointer;padding:0}.history-link:hover{text-decoration:underline}.voice-status{flex:0 0 auto;font-size:.8rem;letter-spacing:.04em;padding:6px 12px;border-radius:8px;width:fit-content}.voice-status-listening{color:#0369a1;background:#e0f2fe;animation:pulse .9s ease-in-out infinite}.voice-status-thinking{color:#92400e;background:#fef3c7;animation:pulse 1.2s ease-in-out infinite}.voice-status-speaking{color:#065f46;background:#d1fae5}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.chat-messages{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:4px 2px;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.chat-messages::-webkit-scrollbar{width:4px}.chat-messages::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}.chat-empty{font-size:.82rem;color:var(--text3);text-align:center;padding:40px 0;margin:auto}.bubble{display:flex;flex-direction:column;gap:3px;max-width:82%}.bubble-user{align-self:flex-end;align-items:flex-end}.bubble-bot{align-self:flex-start;align-items:flex-start}.bubble-label{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text3)}.bubble-text{border-radius:12px;padding:9px 13px;font-size:.9rem;line-height:1.55}.bubble-user .bubble-text{background:#dbeafe;color:#1e3a8a;border-bottom-right-radius:3px}.bubble-bot .bubble-text{background:var(--surface);border:1px solid var(--border);color:var(--text);border-bottom-left-radius:3px}.audio-btn{width:100%;max-width:220px;height:28px;margin-top:3px;border-radius:6px;opacity:.8}.audio-btn:hover{opacity:1}.hist-page{min-height:100vh;background:var(--bg)}.hist-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:10}.hist-heading{font-size:1rem;font-weight:700;color:var(--text);margin:0}.hist-back{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);padding:5px 12px;font-size:.78rem;cursor:pointer}.hist-back:hover{border-color:var(--accent);color:var(--accent)}.hist-clear{background:none;border:1px solid #FECACA;border-radius:6px;color:#dc2626;padding:5px 12px;font-size:.78rem;cursor:pointer}.hist-clear:hover:not(:disabled){border-color:#dc2626}.hist-clear:disabled{opacity:.3;cursor:default}.hist-empty{text-align:center;color:var(--text3);padding:64px 32px;font-size:.9rem}.hist-list{display:flex;flex-direction:column;max-width:680px;margin:0 auto;padding:16px 24px}.hist-entry{border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:12px;background:var(--surface)}.hist-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.hist-time{font-size:.68rem;color:var(--text3)}.hist-del{background:none;border:none;color:var(--text3);cursor:pointer;font-size:.8rem;padding:0 4px}.hist-del:hover{color:#dc2626}.hist-row{display:flex;gap:10px;margin-bottom:8px}.hist-role{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text3);min-width:36px;padding-top:2px}.hist-row-user .hist-role{color:#2563eb}.hist-row-bot .hist-role{color:#059669}.hist-body{flex:1}.hist-text{font-size:.86rem;color:var(--text);line-height:1.5;margin:0 0 6px}.hist-audio{width:100%;max-width:260px;height:26px;opacity:.75;border-radius:6px}.hist-audio:hover{opacity:1}@media(max-width:700px){.app{height:100dvh;height:-webkit-fill-available}.hdr{padding:8px 14px}.hdr h1{font-size:1.2rem}.subtitle{display:none}.page-body{flex-direction:column}.left-col{width:100%;flex:0 0 auto;border-right:none;border-bottom:1px solid var(--border);padding:10px 12px;gap:8px;flex-direction:row;align-items:flex-start;overflow-x:hidden;overflow-y:visible}.screen-wrap{flex:0 0 auto}.bezel{padding:8px}.panel{flex:1;min-width:0;gap:8px;overflow-y:auto;max-height:272px}.btn-grid{grid-template-columns:repeat(2,1fr);gap:4px}.btn-grid-4{grid-template-columns:repeat(4,1fr);gap:3px}.ebtn{font-size:.7rem;padding:5px 6px}.btn-grid-4 .ebtn{font-size:.58rem;padding:4px 2px}.scale-controls{display:none}.right-col{flex:1;min-height:0}.chat-panel{padding:10px 12px}}.memory-panel{border:1px solid var(--border);border-radius:8px;overflow:hidden}.memory-toggle{width:100%;display:flex;align-items:center;gap:6px;padding:7px 10px;background:var(--bg);border:none;cursor:pointer;font-size:.78rem;color:var(--text2);text-align:left}.memory-toggle:hover{background:#e8eef6}.memory-badge{margin-left:auto;background:var(--accent-bg);color:var(--accent);border-radius:10px;font-size:.65rem;font-weight:700;padding:1px 6px;min-width:18px;text-align:center}.memory-arrow{font-size:.6rem;color:var(--text3)}.memory-body{padding:8px 10px;background:var(--surface);border-top:1px solid var(--border)}.memory-empty{font-size:.72rem;color:var(--text3);text-align:center;padding:6px 0;margin:0}.memory-list{list-style:none;display:flex;flex-direction:column;gap:5px;margin:0 0 8px;padding:0;max-height:160px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.memory-item{display:flex;align-items:flex-start;gap:6px;font-size:.75rem;color:var(--text2);line-height:1.4}.memory-text{flex:1}.memory-del{flex:0 0 auto;background:none;border:none;color:var(--text3);cursor:pointer;font-size:.9rem;line-height:1;padding:0 2px}.memory-del:hover{color:#dc2626}.memory-clear{width:100%;background:none;border:1px solid #FECACA;border-radius:5px;color:#dc2626;font-size:.72rem;padding:4px 0;cursor:pointer}.memory-clear:hover{background:#fef2f2}.voice-hint{margin-top:4px;display:flex;align-items:center;gap:4px;flex-wrap:wrap}.settings-page{min-height:100dvh;background:var(--bg);color:var(--text)}.settings-toolbar{display:flex;align-items:center;gap:14px;padding:12px 20px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10}.settings-back{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);font-size:.85rem;padding:5px 12px;cursor:pointer;transition:background .15s}.settings-back:hover{background:var(--bg);color:var(--accent)}.settings-heading{font-size:1.1rem;font-weight:700;margin:0;flex:1}.settings-save{background:var(--accent);border:none;border-radius:7px;color:#fff;font-size:.85rem;font-weight:600;padding:6px 16px;cursor:pointer;transition:opacity .15s}.settings-save:hover{opacity:.85}.settings-body{max-width:600px;margin:0 auto;padding:20px 18px 40px;display:flex;flex-direction:column;gap:20px}.settings-section{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:12px}.settings-section-title{font-size:.85rem;font-weight:700;color:var(--text2);margin:0 0 4px;letter-spacing:.02em}.settings-label{display:flex;flex-direction:column;gap:5px;font-size:.82rem;font-weight:600;color:var(--text2)}.settings-label-mt{margin-top:6px}.settings-hint{font-size:.73rem;font-weight:400;color:var(--text3);margin-left:4px}.settings-hint-block{font-size:.75rem;color:var(--text3);margin:0}.settings-hint-block a{color:var(--accent)}.settings-input{border:1px solid var(--border);border-radius:6px;padding:7px 10px;font-size:.85rem;color:var(--text);background:var(--bg);outline:none;transition:border-color .15s;font-family:inherit}.settings-input:focus{border-color:var(--accent)}.settings-textarea{border:1px solid var(--border);border-radius:6px;padding:7px 10px;font-size:.85rem;color:var(--text);background:var(--bg);outline:none;resize:vertical;min-height:60px;transition:border-color .15s;font-family:inherit;line-height:1.5}.settings-textarea:focus{border-color:var(--accent)}.settings-radio-group{display:flex;flex-direction:column;gap:8px}.settings-radio-label{display:flex;align-items:center;gap:8px;font-size:.85rem;color:var(--text2);cursor:pointer}.settings-radio-label input{accent-color:var(--accent)}.settings-voice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}.settings-voice-btn{display:flex;flex-direction:column;gap:3px;padding:10px 10px 8px;background:var(--bg);border:1.5px solid var(--border);border-radius:8px;cursor:pointer;text-align:left;transition:border-color .15s,background .15s}.settings-voice-btn:hover,.settings-voice-btn.active{border-color:var(--accent);background:var(--accent-bg)}.voice-btn-label{font-size:.88rem;font-weight:700;color:var(--text)}.voice-btn-meta{font-size:.68rem;color:var(--text3);line-height:1.3}.settings-section-danger{border-color:#fecaca}.settings-reset-btn{background:none;border:1px solid #FECACA;border-radius:6px;color:#dc2626;font-size:.82rem;padding:7px 14px;cursor:pointer;transition:background .15s}.settings-reset-btn:hover{background:#fef2f2}.settings-secret-row{display:flex;gap:.5rem;align-items:stretch}.settings-secret-row .settings-input{flex:1}.settings-show-btn{padding:.45rem .75rem;font-size:.78rem;background:#e2e8f0;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;white-space:nowrap;color:#475569}.settings-show-btn:hover{background:#cbd5e1}.vbtn-wrap{flex:0 0 auto;display:flex;justify-content:center;padding:10px 16px 14px;background:var(--surface);border-top:1px solid var(--border)}.vbtn{position:relative;width:100%;max-width:380px;height:52px;border:none;border-radius:26px;font-size:1rem;font-weight:700;letter-spacing:.03em;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:none;background:var(--accent);color:#fff;box-shadow:0 4px 14px #0ea5e959;transition:background .15s,box-shadow .15s,transform .1s}.vbtn:active:not(:disabled){transform:scale(.96)}.vbtn--acquiring{background:#f59e0b;box-shadow:0 0 #f59e0b80;animation:vbtn-pulse-amber .7s ease-out infinite}@keyframes vbtn-pulse-amber{0%{box-shadow:0 0 #f59e0b8c}70%{box-shadow:0 0 0 16px #f59e0b00}to{box-shadow:0 0 #f59e0b00}}.vbtn--recording{background:#ef4444;box-shadow:0 0 #ef444480;animation:vbtn-pulse-red .9s ease-out infinite}@keyframes vbtn-pulse-red{0%{box-shadow:0 0 #ef44448c}70%{box-shadow:0 0 0 20px #ef444400}to{box-shadow:0 0 #ef444400}}.vbtn--busy{background:#94a3b8;box-shadow:none;cursor:not-allowed}@media(max-width:700px){.vbtn-wrap{position:fixed;bottom:0;left:0;right:0;padding:10px 20px calc(10px + env(safe-area-inset-bottom));background:#fffffff5;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--border);z-index:100}.vbtn{height:60px;font-size:1.08rem}.right-col{padding-bottom:100px}} +*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}body{background:#f1f5f9;color:#0f172a;font-family:system-ui,Segoe UI,sans-serif;-webkit-font-smoothing:antialiased}#root{height:100dvh;height:-webkit-fill-available;display:flex;flex-direction:column}:root{--bg: #F1F5F9;--surface: #FFFFFF;--border: #E2E8F0;--text: #0F172A;--text2: #475569;--text3: #94A3B8;--accent: #0EA5E9;--accent-bg: #E0F7FE;--face-bg: #080C14}.app{height:100dvh;height:-webkit-fill-available;display:flex;flex-direction:column;background:var(--bg);color:var(--text);overflow:hidden}.hdr{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:10px 20px;background:var(--surface);border-bottom:1px solid var(--border)}.hdr h1{font-size:1.5rem;font-weight:800;letter-spacing:.1em;color:var(--text);margin:0}.accent{color:var(--accent)}.subtitle{font-size:.72rem;color:var(--text3);letter-spacing:.05em}.hdr-nav{margin-left:auto;display:flex;gap:8px}.hdr-link{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);font-size:.78rem;padding:4px 10px;cursor:pointer;transition:background .15s,color .15s}.hdr-link:hover{background:var(--bg);color:var(--accent)}.page-body{flex:1;min-height:0;display:flex;overflow:hidden}.left-col{flex:0 0 auto;width:296px;display:flex;flex-direction:column;overflow-y:auto;background:var(--surface);border-right:1px solid var(--border);padding:14px 14px 20px;gap:14px}.right-col{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}.screen-wrap{display:flex;flex-direction:column;align-items:center;gap:8px}.bezel{background:var(--face-bg);border-radius:18px;padding:12px;box-shadow:0 4px 28px #00000038,0 0 0 1px #ffffff0f}.expr-label{font-size:.85rem;color:var(--text2);height:1.4em;text-align:center}.scale-controls{display:flex;gap:6px}.scale-btn{background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text2);padding:3px 12px;font-size:.78rem;cursor:pointer;transition:all .15s}.scale-btn:hover{border-color:var(--accent);color:var(--accent)}.scale-btn.active{background:var(--accent-bg);border-color:var(--accent);color:var(--accent);font-weight:600}.panel{display:flex;flex-direction:column;gap:12px}.panel-section h3{font-size:.67rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--text3);margin:0 0 7px}.key-hint{font-weight:400;opacity:.7}.btn-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:5px}.btn-grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.btn-grid-4 .ebtn{font-size:.62rem;padding:5px 3px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ebtn{background:var(--bg);border:1px solid var(--border);border-radius:7px;color:var(--text2);padding:6px 9px;font-size:.78rem;cursor:pointer;transition:all .15s;text-align:left}.ebtn:hover{border-color:var(--c);color:var(--c);background:color-mix(in srgb,var(--c) 6%,var(--surface))}.ebtn.active{background:color-mix(in srgb,var(--c) 12%,var(--surface));border-color:var(--c);color:var(--c);font-weight:600}.toggle{display:flex;align-items:center;gap:7px;font-size:.8rem;color:var(--text2);cursor:pointer;-webkit-user-select:none;user-select:none}.toggle input[type=checkbox]{accent-color:var(--accent);width:14px;height:14px}.switch-interval{display:flex;flex-direction:column;gap:5px}.switch-interval-label{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text2)}.interval-val{color:var(--accent);font-weight:700}.switch-interval input[type=range]{width:100%;accent-color:var(--accent);cursor:pointer}.interval-ticks{display:flex;justify-content:space-between;font-size:.65rem;color:var(--text3)}.hint{font-size:.72rem;color:var(--text3);line-height:1.7}kbd{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:.68rem;font-family:inherit;color:var(--text2)}.hist-inline-link{background:none;border:none;color:var(--accent);font-size:.72rem;padding:0;cursor:pointer;text-decoration:underline}.chat-panel{display:flex;flex-direction:column;flex:1;min-height:0;padding:14px 18px;gap:10px;overflow:hidden}.chat-header{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding-bottom:8px;border-bottom:1px solid var(--border)}.chat-title{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--text3)}.history-link{background:none;border:none;color:var(--accent);font-size:.75rem;cursor:pointer;padding:0}.history-link:hover{text-decoration:underline}.voice-status{flex:0 0 auto;font-size:.8rem;letter-spacing:.04em;padding:6px 12px;border-radius:8px;width:fit-content}.voice-status-listening{color:#0369a1;background:#e0f2fe;animation:pulse .9s ease-in-out infinite}.voice-status-thinking{color:#92400e;background:#fef3c7;animation:pulse 1.2s ease-in-out infinite}.voice-status-speaking{color:#065f46;background:#d1fae5}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.chat-messages{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:4px 2px;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.chat-messages::-webkit-scrollbar{width:4px}.chat-messages::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}.chat-empty{font-size:.82rem;color:var(--text3);text-align:center;padding:40px 0;margin:auto}.bubble{display:flex;flex-direction:column;gap:3px;max-width:82%}.bubble-user{align-self:flex-end;align-items:flex-end}.bubble-bot{align-self:flex-start;align-items:flex-start}.bubble-label{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text3)}.bubble-text{border-radius:12px;padding:9px 13px;font-size:.9rem;line-height:1.55}.bubble-user .bubble-text{background:#dbeafe;color:#1e3a8a;border-bottom-right-radius:3px}.bubble-bot .bubble-text{background:var(--surface);border:1px solid var(--border);color:var(--text);border-bottom-left-radius:3px}.audio-btn{width:100%;max-width:220px;height:28px;margin-top:3px;border-radius:6px;opacity:.8}.audio-btn:hover{opacity:1}.hist-page{min-height:100vh;background:var(--bg)}.hist-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:10}.hist-heading{font-size:1rem;font-weight:700;color:var(--text);margin:0}.hist-back{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);padding:5px 12px;font-size:.78rem;cursor:pointer}.hist-back:hover{border-color:var(--accent);color:var(--accent)}.hist-clear{background:none;border:1px solid #FECACA;border-radius:6px;color:#dc2626;padding:5px 12px;font-size:.78rem;cursor:pointer}.hist-clear:hover:not(:disabled){border-color:#dc2626}.hist-clear:disabled{opacity:.3;cursor:default}.hist-empty{text-align:center;color:var(--text3);padding:64px 32px;font-size:.9rem}.hist-list{display:flex;flex-direction:column;max-width:680px;margin:0 auto;padding:16px 24px}.hist-entry{border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:12px;background:var(--surface)}.hist-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.hist-time{font-size:.68rem;color:var(--text3)}.hist-del{background:none;border:none;color:var(--text3);cursor:pointer;font-size:.8rem;padding:0 4px}.hist-del:hover{color:#dc2626}.hist-row{display:flex;gap:10px;margin-bottom:8px}.hist-role{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text3);min-width:36px;padding-top:2px}.hist-row-user .hist-role{color:#2563eb}.hist-row-bot .hist-role{color:#059669}.hist-body{flex:1}.hist-text{font-size:.86rem;color:var(--text);line-height:1.5;margin:0 0 6px}.hist-audio{width:100%;max-width:260px;height:26px;opacity:.75;border-radius:6px}.hist-audio:hover{opacity:1}@media(max-width:700px){.app{height:100dvh;height:-webkit-fill-available}.hdr{padding:8px 14px}.hdr h1{font-size:1.2rem}.subtitle{display:none}.page-body{flex-direction:column}.left-col{width:100%;flex:0 0 auto;border-right:none;border-bottom:1px solid var(--border);padding:10px 12px;gap:8px;flex-direction:row;align-items:flex-start;overflow-x:hidden;overflow-y:visible}.screen-wrap{flex:0 0 auto}.bezel{padding:8px}.panel{flex:1;min-width:0;gap:8px;overflow-y:auto;max-height:272px}.btn-grid{grid-template-columns:repeat(2,1fr);gap:4px}.btn-grid-4{grid-template-columns:repeat(4,1fr);gap:3px}.ebtn{font-size:.7rem;padding:5px 6px}.btn-grid-4 .ebtn{font-size:.58rem;padding:4px 2px}.scale-controls{display:none}.right-col{flex:1;min-height:0}.chat-panel{padding:10px 12px}}.memory-panel{border:1px solid var(--border);border-radius:8px;overflow:hidden}.memory-toggle{width:100%;display:flex;align-items:center;gap:6px;padding:7px 10px;background:var(--bg);border:none;cursor:pointer;font-size:.78rem;color:var(--text2);text-align:left}.memory-toggle:hover{background:#e8eef6}.memory-badge{margin-left:auto;background:var(--accent-bg);color:var(--accent);border-radius:10px;font-size:.65rem;font-weight:700;padding:1px 6px;min-width:18px;text-align:center}.memory-arrow{font-size:.6rem;color:var(--text3)}.memory-body{padding:8px 10px;background:var(--surface);border-top:1px solid var(--border)}.memory-empty{font-size:.72rem;color:var(--text3);text-align:center;padding:6px 0;margin:0}.memory-list{list-style:none;display:flex;flex-direction:column;gap:5px;margin:0 0 8px;padding:0;max-height:160px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.memory-item{display:flex;align-items:flex-start;gap:6px;font-size:.75rem;color:var(--text2);line-height:1.4}.memory-text{flex:1}.memory-del{flex:0 0 auto;background:none;border:none;color:var(--text3);cursor:pointer;font-size:.9rem;line-height:1;padding:0 2px}.memory-del:hover{color:#dc2626}.memory-clear{width:100%;background:none;border:1px solid #FECACA;border-radius:5px;color:#dc2626;font-size:.72rem;padding:4px 0;cursor:pointer}.memory-clear:hover{background:#fef2f2}.voice-hint{margin-top:4px;display:flex;align-items:center;gap:4px;flex-wrap:wrap}.settings-page{min-height:100dvh;background:var(--bg);color:var(--text)}.settings-toolbar{display:flex;align-items:center;gap:14px;padding:12px 20px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10}.settings-back{background:none;border:1px solid var(--border);border-radius:6px;color:var(--text2);font-size:.85rem;padding:5px 12px;cursor:pointer;transition:background .15s}.settings-back:hover{background:var(--bg);color:var(--accent)}.settings-heading{font-size:1.1rem;font-weight:700;margin:0;flex:1}.settings-save{background:var(--accent);border:none;border-radius:7px;color:#fff;font-size:.85rem;font-weight:600;padding:6px 16px;cursor:pointer;transition:opacity .15s}.settings-save:hover{opacity:.85}.settings-body{max-width:600px;margin:0 auto;padding:20px 18px 40px;display:flex;flex-direction:column;gap:20px}.settings-section{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:12px}.settings-section-title{font-size:.85rem;font-weight:700;color:var(--text2);margin:0 0 4px;letter-spacing:.02em}.settings-label{display:flex;flex-direction:column;gap:5px;font-size:.82rem;font-weight:600;color:var(--text2)}.settings-label-mt{margin-top:6px}.settings-hint{font-size:.73rem;font-weight:400;color:var(--text3);margin-left:4px}.settings-hint-block{font-size:.75rem;color:var(--text3);margin:0}.settings-hint-block a{color:var(--accent)}.settings-input{border:1px solid var(--border);border-radius:6px;padding:7px 10px;font-size:.85rem;color:var(--text);background:var(--bg);outline:none;transition:border-color .15s;font-family:inherit}.settings-input:focus{border-color:var(--accent)}.settings-textarea{border:1px solid var(--border);border-radius:6px;padding:7px 10px;font-size:.85rem;color:var(--text);background:var(--bg);outline:none;resize:vertical;min-height:60px;transition:border-color .15s;font-family:inherit;line-height:1.5}.settings-textarea:focus{border-color:var(--accent)}.settings-radio-group{display:flex;flex-direction:column;gap:8px}.settings-radio-label{display:flex;align-items:center;gap:8px;font-size:.85rem;color:var(--text2);cursor:pointer}.settings-radio-label input{accent-color:var(--accent)}.settings-voice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}.settings-voice-btn{display:flex;flex-direction:column;gap:3px;padding:10px 10px 8px;background:var(--bg);border:1.5px solid var(--border);border-radius:8px;cursor:pointer;text-align:left;transition:border-color .15s,background .15s}.settings-voice-btn:hover,.settings-voice-btn.active{border-color:var(--accent);background:var(--accent-bg)}.voice-btn-label{font-size:.88rem;font-weight:700;color:var(--text)}.voice-btn-meta{font-size:.68rem;color:var(--text3);line-height:1.3}.settings-section-danger{border-color:#fecaca}.settings-reset-btn{background:none;border:1px solid #FECACA;border-radius:6px;color:#dc2626;font-size:.82rem;padding:7px 14px;cursor:pointer;transition:background .15s}.settings-reset-btn:hover{background:#fef2f2}.settings-secret-row{display:flex;gap:.5rem;align-items:stretch}.settings-secret-row .settings-input{flex:1}.settings-show-btn{padding:.45rem .75rem;font-size:.78rem;background:#e2e8f0;border:1px solid #cbd5e1;border-radius:6px;cursor:pointer;white-space:nowrap;color:#475569}.settings-show-btn:hover{background:#cbd5e1}.vbtn-wrap{flex:0 0 auto;display:flex;justify-content:center;padding:10px 16px 14px;background:var(--surface);border-top:1px solid var(--border)}.vbtn{position:relative;width:100%;max-width:380px;height:52px;border:none;border-radius:26px;font-size:1rem;font-weight:700;letter-spacing:.03em;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:none;background:var(--accent);color:#fff;box-shadow:0 4px 14px #0ea5e959;transition:background .15s,box-shadow .15s,transform .1s}.vbtn:active:not(:disabled){transform:scale(.96)}.vbtn--acquiring{background:#f59e0b;box-shadow:0 0 #f59e0b80;animation:vbtn-pulse-amber .7s ease-out infinite}@keyframes vbtn-pulse-amber{0%{box-shadow:0 0 #f59e0b8c}70%{box-shadow:0 0 0 16px #f59e0b00}to{box-shadow:0 0 #f59e0b00}}.vbtn--recording{background:#ef4444;box-shadow:0 0 #ef444480;animation:vbtn-pulse-red .9s ease-out infinite}@keyframes vbtn-pulse-red{0%{box-shadow:0 0 #ef44448c}70%{box-shadow:0 0 0 20px #ef444400}to{box-shadow:0 0 #ef444400}}.vbtn--busy{background:#94a3b8;box-shadow:none;cursor:not-allowed}@media(max-width:700px){.vbtn-wrap{position:fixed;bottom:0;left:0;right:0;padding:10px 20px calc(10px + env(safe-area-inset-bottom));background:#fffffff5;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--border);z-index:100}.vbtn{height:60px;font-size:1.08rem}.right-col{padding-bottom:100px}} diff --git a/static/dist/jbot.js b/static/dist/jbot.js index 6e984b3..9a3b465 100644 --- a/static/dist/jbot.js +++ b/static/dist/jbot.js @@ -1,4 +1,4 @@ -import{r as i,j as l,c as rn}from"./client-DS0SU7Jy.js";/** +import{r as i,j as l,c as nn}from"./client-DS0SU7Jy.js";/** * react-router v7.15.1 * * Copyright (c) Remix Software Inc. @@ -7,6 +7,6 @@ import{r as i,j as l,c as rn}from"./client-DS0SU7Jy.js";/** * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var gt="popstate";function yt(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function an(e={}){function t(r,a){var d;let s=(d=a.state)==null?void 0:d.masked,{pathname:o,search:c,hash:u}=s||r.location;return Xe("",{pathname:o,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:xe(a)}return on(t,n,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function K(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sn(){return Math.random().toString(36).substring(2,10)}function vt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Xe(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?he(t):t,state:n,key:t&&t.key||r||sn(),mask:a}}function xe({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 he(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 on(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,c="POP",u=null,d=f();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function f(){return(o.state||{idx:null}).idx}function h(){c="POP";let m=f(),g=m==null?null:m-d;d=m,u&&u({action:c,location:y.location,delta:g})}function p(m,g){c="PUSH";let w=yt(m)?m:Xe(y.location,m,g);d=f()+1;let E=vt(w,d),I=y.createHref(w.mask||w);try{o.pushState(E,"",I)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;a.location.assign(I)}s&&u&&u({action:c,location:y.location,delta:1})}function v(m,g){c="REPLACE";let w=yt(m)?m:Xe(y.location,m,g);d=f();let E=vt(w,d),I=y.createHref(w.mask||w);o.replaceState(E,"",I),s&&u&&u({action:c,location:y.location,delta:0})}function b(m){return ln(m)}let y={get action(){return c},get location(){return e(a,o)},listen(m){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(gt,h),u=m,()=>{a.removeEventListener(gt,h),u=null}},createHref(m){return t(a,m)},createURL:b,encodeLocation(m){let g=b(m);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:v,go(m){return o.go(m)}};return y}function ln(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),P(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:xe(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Mt(e,t,n="/"){return un(e,t,n,!1)}function un(e,t,n,r,a){let s=typeof t=="string"?he(t):t,o=ee(s.pathname||"/",n);if(o==null)return null;let c=cn(e),u=null,d=En(o);for(let f=0;u==null&&f{let f={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;P(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let h=J([r,f.relativePath]),p=n.concat(f);o.children&&o.children.length>0&&(P(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),It(o.children,t,p,h,u)),!(o.path==null&&!o.index)&&t.push({path:h,score:vn(h,o.index),routesMeta:p})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))s(o,c);else for(let d of At(o.path))s(o,c,!0,d)}),t}function At(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=At(r.join("/")),c=[];return c.push(...o.map(u=>u===""?s:[s,u].join("/"))),a&&c.push(...o),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function dn(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bn(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var hn=/^:[\w-]+$/,fn=3,mn=2,pn=1,gn=10,yn=-2,bt=e=>e==="*";function vn(e,t){let n=e.split("/"),r=n.length;return n.some(bt)&&(r+=yn),t&&(r+=mn),n.filter(a=>!bt(a)).reduce((a,s)=>a+(hn.test(s)?fn:s===""?pn:gn),r)}function bn(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function wn(e,t,n=!1){let{routesMeta:r}=e,a={},s="/",o=[];for(let c=0;c{if(f==="*"){let b=c[p]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const v=c[p];return h&&!v?d[f]=void 0:d[f]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:o,pattern:e}}function xn(e,t=!1,n=!0){K(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,u,d,f)=>{if(r.push({paramName:c,isOptional:u!=null}),u){let h=f.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function En(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return K(!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 ee(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)||"/"}var Rn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Sn(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?he(e):e,s;return n?(n=$t(n),n.startsWith("/")?s=wt(n.substring(1),"/"):s=wt(n,t)):s=t,{pathname:s,search:Nn(r),hash:jn(a)}}function wt(e,t){let n=_e(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function qe(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 kn(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Lt(e){let t=kn(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function rt(e,t,n,r=!1){let a;typeof e=="string"?a=he(e):(a={...e},P(!a.pathname||!a.pathname.includes("?"),qe("?","pathname","search",a)),P(!a.pathname||!a.pathname.includes("#"),qe("#","pathname","hash",a)),P(!a.search||!a.search.includes("#"),qe("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,c;if(o==null)c=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;a.pathname=p.join("/")}c=h>=0?t[h]:"/"}let u=Sn(a,c),d=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||f)&&(u.pathname+="/"),u}var $t=e=>e.replace(/\/\/+/g,"/"),J=e=>$t(e.join("/")),_e=e=>e.replace(/\/+$/,""),Cn=e=>_e(e).replace(/^\/*/,"/"),Nn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Tn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Pn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Mn(e){let t=e.map(n=>n.route.path).filter(Boolean);return J(t)||"/"}var _t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bt(e,t){let n=e;if(typeof n!="string"||!Rn.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(_t)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=ee(o.pathname,t);o.origin===s.origin&&c!=null?n=c+o.search+o.hash:a=!0}catch{K(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ft=["POST","PUT","PATCH","DELETE"];new Set(Ft);var In=["GET",...Ft];new Set(In);var fe=i.createContext(null);fe.displayName="DataRouter";var Fe=i.createContext(null);Fe.displayName="DataRouterState";var Ot=i.createContext(!1);function An(){return i.useContext(Ot)}var Dt=i.createContext({isTransitioning:!1});Dt.displayName="ViewTransition";var Ln=i.createContext(new Map);Ln.displayName="Fetchers";var $n=i.createContext(null);$n.displayName="Await";var V=i.createContext(null);V.displayName="Navigation";var Ee=i.createContext(null);Ee.displayName="Location";var te=i.createContext({outlet:null,matches:[],isDataRoute:!1});te.displayName="Route";var at=i.createContext(null);at.displayName="RouteError";var Ut="REACT_ROUTER_ERROR",_n="REDIRECT",Bn="ROUTE_ERROR_RESPONSE";function Fn(e){if(e.startsWith(`${Ut}:${_n}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function On(e){if(e.startsWith(`${Ut}:${Bn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Tn(t.status,t.statusText,t.data)}catch{}}function Dn(e,{relative:t}={}){P(Re(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=i.useContext(V),{hash:a,pathname:s,search:o}=ke(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:J([n,s])),r.createHref({pathname:c,search:o,hash:a})}function Re(){return i.useContext(Ee)!=null}function ne(){return P(Re(),"useLocation() may be used only in the context of a component."),i.useContext(Ee).location}var zt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ht(e){i.useContext(V).static||i.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=i.useContext(te);return e?Zn():Un()}function Un(){P(Re(),"useNavigate() may be used only in the context of a component.");let e=i.useContext(fe),{basename:t,navigator:n}=i.useContext(V),{matches:r}=i.useContext(te),{pathname:a}=ne(),s=JSON.stringify(Lt(r)),o=i.useRef(!1);return Ht(()=>{o.current=!0}),i.useCallback((u,d={})=>{if(K(o.current,zt),!o.current)return;if(typeof u=="number"){n.go(u);return}let f=rt(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:J([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,a,e])}i.createContext(null);function ke(e,{relative:t}={}){let{matches:n}=i.useContext(te),{pathname:r}=ne(),a=JSON.stringify(Lt(n));return i.useMemo(()=>rt(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function zn(e,t){return Wt(e,t)}function Wt(e,t,n){var m;P(Re(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=i.useContext(V),{matches:a}=i.useContext(te),s=a[a.length-1],o=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",d=s&&s.route;{let g=d&&d.path||"";Jt(c,!d||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + */var mt="popstate";function pt(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function rn(e={}){function t(r,a){var d;let s=(d=a.state)==null?void 0:d.masked,{pathname:o,search:u,hash:c}=s||r.location;return Ge("",{pathname:o,search:u,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:be(a)}return sn(t,n,null,e)}function M(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function K(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function an(){return Math.random().toString(36).substring(2,10)}function gt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ge(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ue(t):t,state:n,key:t&&t.key||r||an(),mask:a}}function be({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 ue(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 sn(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,u="POP",c=null,d=f();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function f(){return(o.state||{idx:null}).idx}function h(){u="POP";let m=f(),y=m==null?null:m-d;d=m,c&&c({action:u,location:g.location,delta:y})}function p(m,y){u="PUSH";let w=pt(m)?m:Ge(g.location,m,y);d=f()+1;let x=gt(w,d),N=g.createHref(w.mask||w);try{o.pushState(x,"",N)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;a.location.assign(N)}s&&c&&c({action:u,location:g.location,delta:1})}function b(m,y){u="REPLACE";let w=pt(m)?m:Ge(g.location,m,y);d=f();let x=gt(w,d),N=g.createHref(w.mask||w);o.replaceState(x,"",N),s&&c&&c({action:u,location:g.location,delta:0})}function v(m){return on(m)}let g={get action(){return u},get location(){return e(a,o)},listen(m){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(mt,h),c=m,()=>{a.removeEventListener(mt,h),c=null}},createHref(m){return t(a,m)},createURL:v,encodeLocation(m){let y=v(m);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:b,go(m){return o.go(m)}};return g}function on(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),M(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:be(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Tt(e,t,n="/"){return ln(e,t,n,!1)}function ln(e,t,n,r,a){let s=typeof t=="string"?ue(t):t,o=Z(s.pathname||"/",n);if(o==null)return null;let u=un(e),c=null,d=xn(o);for(let f=0;c==null&&f{let f={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:u,route:o};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&c)return;M(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let h=V([r,f.relativePath]),p=n.concat(f);o.children&&o.children.length>0&&(M(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Pt(o.children,t,p,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:yn(h,o.index),routesMeta:p})};return e.forEach((o,u)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,u);else for(let d of Mt(o.path))s(o,u,!0,d)}),t}function Mt(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=Mt(r.join("/")),u=[];return u.push(...o.map(c=>c===""?s:[s,c].join("/"))),a&&u.push(...o),u.map(c=>e.startsWith("/")&&c===""?"/":c)}function cn(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vn(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var dn=/^:[\w-]+$/,hn=3,fn=2,mn=1,pn=10,gn=-2,yt=e=>e==="*";function yn(e,t){let n=e.split("/"),r=n.length;return n.some(yt)&&(r+=gn),t&&(r+=fn),n.filter(a=>!yt(a)).reduce((a,s)=>a+(dn.test(s)?hn:s===""?mn:pn),r)}function vn(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function bn(e,t,n=!1){let{routesMeta:r}=e,a={},s="/",o=[];for(let u=0;u{if(f==="*"){let v=u[p]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const b=u[p];return h&&!b?d[f]=void 0:d[f]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:o,pattern:e}}function wn(e,t=!1,n=!0){K(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,u,c,d,f)=>{if(r.push({paramName:u,isOptional:c!=null}),c){let h=f.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function xn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return K(!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 Z(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)||"/"}var En=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Rn(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ue(e):e,s;return n?(n=At(n),n.startsWith("/")?s=vt(n.substring(1),"/"):s=vt(n,t)):s=t,{pathname:s,search:Cn(r),hash:Nn(a)}}function vt(e,t){let n=Ae(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ve(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 Sn(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function It(e){let t=Sn(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function tt(e,t,n,r=!1){let a;typeof e=="string"?a=ue(e):(a={...e},M(!a.pathname||!a.pathname.includes("?"),Ve("?","pathname","search",a)),M(!a.pathname||!a.pathname.includes("#"),Ve("#","pathname","hash",a)),M(!a.search||!a.search.includes("#"),Ve("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,u;if(o==null)u=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;a.pathname=p.join("/")}u=h>=0?t[h]:"/"}let c=Rn(a,u),d=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}var At=e=>e.replace(/\/\/+/g,"/"),V=e=>At(e.join("/")),Ae=e=>e.replace(/\/+$/,""),kn=e=>Ae(e).replace(/^\/*/,"/"),Cn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Tn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Pn(e){let t=e.map(n=>n.route.path).filter(Boolean);return V(t)||"/"}var Lt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(e,t){let n=e;if(typeof n!="string"||!En.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(Lt)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=Z(o.pathname,t);o.origin===s.origin&&u!=null?n=u+o.search+o.hash:a=!0}catch{K(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=["POST","PUT","PATCH","DELETE"];new Set(_t);var Mn=["GET",..._t];new Set(Mn);var ce=i.createContext(null);ce.displayName="DataRouter";var $e=i.createContext(null);$e.displayName="DataRouterState";var Bt=i.createContext(!1);function In(){return i.useContext(Bt)}var Ft=i.createContext({isTransitioning:!1});Ft.displayName="ViewTransition";var An=i.createContext(new Map);An.displayName="Fetchers";var Ln=i.createContext(null);Ln.displayName="Await";var H=i.createContext(null);H.displayName="Navigation";var we=i.createContext(null);we.displayName="Location";var ee=i.createContext({outlet:null,matches:[],isDataRoute:!1});ee.displayName="Route";var nt=i.createContext(null);nt.displayName="RouteError";var Ot="REACT_ROUTER_ERROR",$n="REDIRECT",_n="ROUTE_ERROR_RESPONSE";function Bn(e){if(e.startsWith(`${Ot}:${$n}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Fn(e){if(e.startsWith(`${Ot}:${_n}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jn(t.status,t.statusText,t.data)}catch{}}function On(e,{relative:t}={}){M(xe(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=i.useContext(H),{hash:a,pathname:s,search:o}=Re(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:V([n,s])),r.createHref({pathname:u,search:o,hash:a})}function xe(){return i.useContext(we)!=null}function te(){return M(xe(),"useLocation() may be used only in the context of a component."),i.useContext(we).location}var Dt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ut(e){i.useContext(H).static||i.useLayoutEffect(e)}function Ee(){let{isDataRoute:e}=i.useContext(ee);return e?Qn():Dn()}function Dn(){M(xe(),"useNavigate() may be used only in the context of a component.");let e=i.useContext(ce),{basename:t,navigator:n}=i.useContext(H),{matches:r}=i.useContext(ee),{pathname:a}=te(),s=JSON.stringify(It(r)),o=i.useRef(!1);return Ut(()=>{o.current=!0}),i.useCallback((c,d={})=>{if(K(o.current,Dt),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=tt(c,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:V([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,a,e])}i.createContext(null);function Re(e,{relative:t}={}){let{matches:n}=i.useContext(ee),{pathname:r}=te(),a=JSON.stringify(It(n));return i.useMemo(()=>tt(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function Un(e,t){return zt(e,t)}function zt(e,t,n){var m;M(xe(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=i.useContext(H),{matches:a}=i.useContext(ee),s=a[a.length-1],o=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",d=s&&s.route;{let y=d&&d.path||"";Wt(u,!d||y.endsWith("*")||y.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 f=ne(),h;if(t){let g=typeof t=="string"?he(t):t;P(u==="/"||((m=g.pathname)==null?void 0:m.startsWith(u)),`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 "${u}" but pathname "${g.pathname}" was given in the \`location\` prop.`),h=g}else h=f;let p=h.pathname||"/",v=p;if(u!=="/"){let g=u.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(g.length).join("/")}let b=n&&n.state.matches.length?n.state.matches.map(g=>Object.assign(g,{route:n.manifest[g.route.id]||g.route})):Mt(e,{pathname:v});K(d||b!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),K(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 y=qn(b&&b.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:J([u,r.encodeLocation?r.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:J([u,r.encodeLocation?r.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),a,n);return t&&y?i.createElement(Ee.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},y):y}function Hn(){let e=Qn(),t=Pn(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)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:a},n):null,o)}var Wn=i.createElement(Hn,null),Vt=class extends i.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.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=On(e.digest);n&&(e=n)}let t=e!==void 0?i.createElement(te.Provider,{value:this.props.routeContext},i.createElement(at.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(Vn,{error:e},t):t}};Vt.contextType=Ot;var Ke=new WeakMap;function Vn({children:e,error:t}){let{basename:n}=i.useContext(V);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Fn(t.digest);if(r){let a=Ke.get(t);if(a)throw a;let s=Bt(r.location,n);if(_t&&!Ke.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Ke.set(t,o),o}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function Jn({routeContext:e,match:t,children:n}){let r=i.useContext(fe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(te.Provider,{value:e},n)}function qn(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,s=r==null?void 0:r.errors;if(s!=null){let f=a.findIndex(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);P(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let f=0;f=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let u=n==null?void 0:n.onError,d=r&&u?(f,h)=>{var p,v;u(f,{location:r.location,params:((v=(p=r.matches)==null?void 0:p[0])==null?void 0:v.params)??{},pattern:Mn(r.matches),errorInfo:h})}:void 0;return a.reduceRight((f,h,p)=>{let v,b=!1,y=null,m=null;r&&(v=s&&h.route.id?s[h.route.id]:void 0,y=h.route.errorElement||Wn,o&&(c<0&&p===0?(Jt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,m=null):c===p&&(b=!0,m=h.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,p+1)),w=()=>{let E;return v?E=y:b?E=m:h.route.Component?E=i.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=f,i.createElement(Jn,{match:h,routeContext:{outlet:f,matches:g,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?i.createElement(Vt,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:w(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:d}):w()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kn(e){let t=i.useContext(fe);return P(t,st(e)),t}function Gn(e){let t=i.useContext(Fe);return P(t,st(e)),t}function Yn(e){let t=i.useContext(te);return P(t,st(e)),t}function ot(e){let t=Yn(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Xn(){return ot("useRouteId")}function Qn(){var r;let e=i.useContext(at),t=Gn("useRouteError"),n=ot("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Zn(){let{router:e}=Kn("useNavigate"),t=ot("useNavigate"),n=i.useRef(!1);return Ht(()=>{n.current=!0}),i.useCallback(async(a,s={})=>{K(n.current,zt),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...s}))},[e,t])}var xt={};function Jt(e,t,n){!t&&!xt[e]&&(xt[e]=!0,K(!1,n))}i.memo(er);function er({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:s}){return Wt(e,void 0,{manifest:t,state:r,isStatic:a,onError:s})}function Ie(e){P(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function tr({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:s=!1,useTransitions:o}){P(!Re(),"You cannot render a inside another . You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=i.useMemo(()=>({basename:c,navigator:a,static:s,useTransitions:o,future:{}}),[c,a,s,o]);typeof n=="string"&&(n=he(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default",mask:b}=n,y=i.useMemo(()=>{let m=ee(d,c);return m==null?null:{location:{pathname:m,search:f,hash:h,state:p,key:v,mask:b},navigationType:r}},[c,d,f,h,p,v,r,b]);return K(y!=null,` is not able to match the URL "${d}${f}${h}" because it does not start with the basename, so the won't render anything.`),y==null?null:i.createElement(V.Provider,{value:u},i.createElement(Ee.Provider,{children:t,value:y}))}function nr({children:e,location:t}){return zn(Qe(e),t)}function Qe(e,t=[]){let n=[];return i.Children.forEach(e,(r,a)=>{if(!i.isValidElement(r))return;let s=[...t,a];if(r.type===i.Fragment){n.push.apply(n,Qe(r.props.children,s));return}P(r.type===Ie,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),P(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,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&&(o.children=Qe(r.props.children,s)),n.push(o)}),n}var Ae="get",Le="application/x-www-form-urlencoded";function Oe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function rr(e){return Oe(e)&&e.tagName.toLowerCase()==="button"}function ar(e){return Oe(e)&&e.tagName.toLowerCase()==="form"}function sr(e){return Oe(e)&&e.tagName.toLowerCase()==="input"}function or(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e,t){return e.button===0&&(!t||t==="_self")&&!or(e)}var Te=null;function lr(){if(Te===null)try{new FormData(document.createElement("form"),0),Te=!1}catch{Te=!0}return Te}var ur=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ge(e){return e!=null&&!ur.has(e)?(K(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Le}"`),null):e}function cr(e,t){let n,r,a,s,o;if(ar(e)){let c=e.getAttribute("action");r=c?ee(c,t):null,n=e.getAttribute("method")||Ae,a=Ge(e.getAttribute("enctype"))||Le,s=new FormData(e)}else if(rr(e)||sr(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a + + ); +} + export default function App() { const navigate = useNavigate(); - - // ── VoiceButton: WeChat-style hold-to-record ────────────── - // Placed here so it shares App's handleSpaceDown/handleSpaceUp via closure. - function VoiceButton({ phase, onStart, onEnd }) { - const busy = phase === 'thinking' || phase === 'speaking'; - let label = '🎙 按住说话'; - let mod = ''; - if (phase === 'acquiring') { label = '⏳ 准备中…'; mod = ' vbtn--acquiring'; } - else if (phase === 'listening') { label = '🔴 松开发送'; mod = ' vbtn--recording'; } - else if (phase === 'thinking') { label = '⚙ 思考中…'; mod = ' vbtn--busy'; } - else if (phase === 'speaking') { label = '🔊 播放中…'; mod = ' vbtn--busy'; } - - const startEvt = (e) => { e.preventDefault(); if (!busy) onStart(); }; - const endEvt = (e) => { e.preventDefault(); onEnd(); }; - - return ( -
- -
- ); - } - // ── Expression / auto-rotate state ─────────────────────────── const [exprId, setExprId] = useState(ALL_AUTO_IDS[0]); const [autoRotate, setAutoRotate] = useState(true);