diff --git a/backend/libraries/punk/library.json b/backend/libraries/punk/library.json index 02fa66c..844ae7e 100644 --- a/backend/libraries/punk/library.json +++ b/backend/libraries/punk/library.json @@ -4,29 +4,15 @@ "slug": "punk", "created_at": "2026-03-19T20:02:20Z", "files": [ - { - "sha256": "19f1e5d2ceaab5fd1f1dc58ff07422388f156610d16dfdea2bdb35a5b9e70813", - "path": "/Users/giers/Documents/GeorgeJordac-TheVoiceOfHumanJustice.pdf", - "rel": "19f1e5d2ceaab5fd1f1dc58ff07422388f156610d16dfdea2bdb35a5b9e70813--GeorgeJordac-TheVoiceOfHumanJustice.pdf", - "name": "GeorgeJordac-TheVoiceOfHumanJustice.pdf", - "size": 849816, - "added_at": "2026-03-19T20:40:28Z" - }, - { - "sha256": "1382a12d7c29a62012b1b64b6aa68af3cd69d7b7809ef1112e1ccea5fda6b5c1", - "path": "/Users/giers/Documents/Frischmuth, Barbara - Die Mystifikationen der Sophie Silber (2016, Aufbau Digital) - libgen.li.epub", - "rel": "1382a12d7c29a62012b1b64b6aa68af3cd69d7b7809ef1112e1ccea5fda6b5c1--Frischmuth_Barbara_-_Die_Mystifikationen_der_Sophie_Silber_2016_Aufbau_Digital_-_libgen.li.epub", - "name": "Frischmuth, Barbara - Die Mystifikationen der Sophie Silber (2016, Aufbau Digital) - libgen.li.epub", - "size": 2122352, - "added_at": "2026-03-19T20:40:48Z" - }, { "sha256": "b4d7f8ab4b2661eb958e477b1dc857ffc209d5c6a38374237992ce2044bc0f09", "path": "/Users/giers/Documents/Humanity\u2019s Last Prompt Engineering Guide.pdf", "rel": "b4d7f8ab4b2661eb958e477b1dc857ffc209d5c6a38374237992ce2044bc0f09--Humanity_s_Last_Prompt_Engineering_Guide.pdf", "name": "Humanity\u2019s Last Prompt Engineering Guide.pdf", "size": 4697895, - "added_at": "2026-03-19T20:40:56Z" + "added_at": "2026-03-19T20:40:56Z", + "sync_status": "failed", + "sync_error": "ModuleNotFoundError: No module named 'tqdm'" }, { "sha256": "38d83f5a4d382ccfc263a1cf98aac4c1d4a323bee3237096474db567d9c49f39", @@ -34,11 +20,13 @@ "rel": "38d83f5a4d382ccfc263a1cf98aac4c1d4a323bee3237096474db567d9c49f39--Storyteller_Tactics.pdf", "name": "Storyteller Tactics.pdf", "size": 48959517, - "added_at": "2026-03-19T20:41:06Z" + "added_at": "2026-03-19T20:41:06Z", + "sync_status": "failed", + "sync_error": "ModuleNotFoundError: No module named 'tqdm'" } ], "pipeline": { - "pending_prepare_signature": "1e98a25388ed71bb6a0d8d2f7c9cd137956509b7d4904f2725ec12593c5825b3", - "pending_prepare_updated_at": "2026-03-19T20:41:06Z" + "pending_prepare_signature": "b2336450f8c5d6d2b352193a72e03dc62a3db85b963de641b71ba2b1f05dbe45", + "pending_prepare_updated_at": "2026-03-19T20:46:36Z" } } \ No newline at end of file diff --git a/backend/libraries/punk/stage/1382a12d7c29a62012b1b64b6aa68af3cd69d7b7809ef1112e1ccea5fda6b5c1--Frischmuth_Barbara_-_Die_Mystifikationen_der_Sophie_Silber_2016_Aufbau_Digital_-_libgen.li.epub b/backend/libraries/punk/stage/1382a12d7c29a62012b1b64b6aa68af3cd69d7b7809ef1112e1ccea5fda6b5c1--Frischmuth_Barbara_-_Die_Mystifikationen_der_Sophie_Silber_2016_Aufbau_Digital_-_libgen.li.epub deleted file mode 120000 index 569496f..0000000 --- a/backend/libraries/punk/stage/1382a12d7c29a62012b1b64b6aa68af3cd69d7b7809ef1112e1ccea5fda6b5c1--Frischmuth_Barbara_-_Die_Mystifikationen_der_Sophie_Silber_2016_Aufbau_Digital_-_libgen.li.epub +++ /dev/null @@ -1 +0,0 @@ -/Users/giers/Documents/Frischmuth, Barbara - Die Mystifikationen der Sophie Silber (2016, Aufbau Digital) - libgen.li.epub \ No newline at end of file diff --git a/backend/libraries/punk/stage/19f1e5d2ceaab5fd1f1dc58ff07422388f156610d16dfdea2bdb35a5b9e70813--GeorgeJordac-TheVoiceOfHumanJustice.pdf b/backend/libraries/punk/stage/19f1e5d2ceaab5fd1f1dc58ff07422388f156610d16dfdea2bdb35a5b9e70813--GeorgeJordac-TheVoiceOfHumanJustice.pdf deleted file mode 120000 index 44e3f4c..0000000 --- a/backend/libraries/punk/stage/19f1e5d2ceaab5fd1f1dc58ff07422388f156610d16dfdea2bdb35a5b9e70813--GeorgeJordac-TheVoiceOfHumanJustice.pdf +++ /dev/null @@ -1 +0,0 @@ -/Users/giers/Documents/GeorgeJordac-TheVoiceOfHumanJustice.pdf \ No newline at end of file diff --git a/dist/assets/index-HsqF-Zwv.css b/dist/assets/index-BLvuAcau.css similarity index 91% rename from dist/assets/index-HsqF-Zwv.css rename to dist/assets/index-BLvuAcau.css index c7120ec..c5b19dd 100644 --- a/dist/assets/index-HsqF-Zwv.css +++ b/dist/assets/index-BLvuAcau.css @@ -1 +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}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.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,.db-picker-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view,.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} +:root{--bg: #0b1020;--panel: #141b34;--text: #e6e8ef;--muted: #9aa3b2;--accent: #6ea8fe;--border: #24304f}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}.no-select{-webkit-user-select:none;user-select:none;cursor:ew-resize!important}.app{display:grid;grid-template-columns:var(--sidebar-width, 230px) 1fr;grid-template-rows:1fr;height:100%}.sidebar{display:grid;grid-template-rows:auto 1fr auto;background:var(--panel);border-right:1px solid var(--border);height:100vh;overflow:hidden;position:relative}.sidebar span{font-size:14px}.resizer{width:13px;cursor:ew-resize;background:transparent;position:absolute;top:0;right:-5px;bottom:0;z-index:1}.sidebar-header{display:flex;justify-content:space-around;padding:0;background:var(--panel)}.sidebar-tab{flex-grow:1;text-align:center;padding:11px 16px;cursor:pointer;border-bottom:3px solid transparent;transition:background-color .2s ease}.sidebar-tab:hover{background-color:var(--hover-bg)}.sidebar-tab.active{background-color:var(--active-bg);border-bottom-color:var(--accent)}.sidebar-tab.active:hover{background-color:var(--active-bg)}.sidebar-content{flex-grow:1;overflow-y:auto}.db-list,.settings-list{padding:8px 0}.empty-list-message{padding:10px 16px;color:var(--muted);text-align:center}.settings-item{padding:10px 16px;cursor:pointer;border-left:3px solid transparent}.settings-item.active{background:var(--active-bg);border-left-color:var(--accent)}.settings-item.active:hover{background:var(--active-bg)}.settings-item:hover{background:var(--hover-bg)}.settings-footer-placeholder{height:40px;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel)}.new-db-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-db-button:hover{opacity:.9}.chat-list{overflow-y:auto;padding:8px 0}.chat-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;overflow:hidden;white-space:nowrap}.chat-item span{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-buttons{display:flex;gap:8px;align-items:center}.unread-dot{width:8px;height:8px;background-color:red;border-radius:50%;margin-right:4px}.icon-button{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.icon-button svg{width:16px;height:16px;stroke:var(--muted);transition:stroke .2s ease}.icon-button:hover svg{stroke:var(--accent)}.icon-button:hover{color:var(--accent)}.chat-item.active{background:var(--active-bg);border-left-color:var(--accent)}.chat-item:hover{background:var(--hover-bg)}.chat-item.active:hover{background:var(--active-bg)}.rename-input{background:var(--input-bg);border:1px solid var(--accent);color:var(--text);border-radius:10px;padding:8px 12px;outline:none;width:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--muted);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}.sidebar-footer{padding:12px 16px;background:var(--panel)}.new-db-form,.library-inline-form{display:grid;gap:8px}.new-db-actions{display:flex;gap:8px}.form-error{color:#ff9aa8;font-size:12px}.new-chat-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-chat-button:hover{opacity:.9}.main-content{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100vh;overflow:hidden}.header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.select,.input,.button{background:var(--input-bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;outline:none}.footer-content-wrapper .button{flex-shrink:0}.select{min-width:220px}.button{cursor:pointer}.button:hover{border-color:var(--accent)}.button.ghost{background:transparent}.button.danger{border-color:#8f3d49;color:#ffb8c2}.button.danger:hover{border-color:#d86a79}.header-subtle{color:var(--muted);font-size:13px}.chat{display:grid;grid-template-columns:1fr minmax(auto,1000px) 1fr;align-content:start;gap:8px;padding:16px;overflow:auto}.chat>*{grid-column:2}.msg{padding:12px 14px;border-radius:12px;line-height:1.5;white-space:wrap;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}textarea.input{resize:none;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial;overflow-y:auto;flex-grow:1}.msg.user{background:var(--user-msg-bg);margin-left:auto;max-width:80%;border:1px solid var(--border);margin-right:5px;margin-bottom:15px;transition:border-color .15s ease,box-shadow .15s ease}.msg.user.editing{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.msg.user .msg-content--user{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;position:relative}.msg.user .user-msg-expand{margin-top:8px;padding:0;background:transparent;border:none;color:var(--muted);font-weight:700;cursor:pointer;align-self:flex-start;margin-left:0;text-align:left}.msg.assistant{background:transparent;border:none;max-width:none;animation:fadeIn .3s ease-in-out;margin-bottom:30px}.user-message-wrapper{display:flex;flex-direction:column;align-items:flex-end;position:relative}.assistant-message-wrapper{display:flex;flex-direction:column;align-items:flex-start;position:relative}.message-options-bar{display:flex;gap:2px;padding:0;border-radius:8px;background-color:transparent;border:none;position:absolute;bottom:-30px}.user-options{right:-10px;bottom:-40px}.assistant-options{left:0}.message-options-bar .icon-button{padding:4px;border-radius:4px;border:none}.message-options-bar .icon-button:hover{background-color:var(--hover-bg)}.new-msg-tip{position:absolute;right:24px;bottom:84px;padding:8px 12px;border-radius:9999px;background:var(--accent);color:var(--bg);border:none;cursor:pointer;font-weight:600;box-shadow:0 6px 20px #00000059}.new-msg-tip:hover{opacity:.9}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.footer{display:flex;justify-content:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel);align-items:flex-end}.footer-content-wrapper{display:flex;gap:8px;width:100%;max-width:1000px;align-items:flex-end}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.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,.db-picker-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view,.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;flex:1}.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}.library-file-sync{margin-top:10px}.library-file-sync-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin-bottom:8px}.library-file-sync-label{font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.library-file-sync-label.ready{color:#69c4a1}.library-file-sync-label.syncing,.library-file-sync-label.pending{color:var(--accent)}.library-file-sync-label.failed{color:#e18282}.library-file-sync-detail{color:var(--muted);font-size:12px;line-height:1.35}.library-file-progress{position:relative;width:100%;height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--panel) 50%,black);border:1px solid color-mix(in srgb,var(--border) 80%,transparent)}.library-file-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 76%,white),var(--accent));transition:width .18s ease}.library-file-progress.ready .library-file-progress-bar{background:linear-gradient(90deg,#5cb48e,#7be1b5)}.library-file-progress.failed .library-file-progress-bar{background:linear-gradient(90deg,#c35d5d,#e18282)}@media (max-width: 760px){.library-file-row{flex-direction:column}.library-file-actions{width:100%;justify-content:flex-end}} diff --git a/dist/assets/index-gF5dDH11.js b/dist/assets/index-Bl2Chmww.js similarity index 75% rename from dist/assets/index-gF5dDH11.js rename to dist/assets/index-Bl2Chmww.js index 45dd94f..1631f8a 100644 --- a/dist/assets/index-gF5dDH11.js +++ b/dist/assets/index-Bl2Chmww.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var el=Symbol.for("react.element"),_p=Symbol.for("react.portal"),Lp=Symbol.for("react.fragment"),Pp=Symbol.for("react.strict_mode"),Rp=Symbol.for("react.profiler"),jp=Symbol.for("react.provider"),Tp=Symbol.for("react.context"),$p=Symbol.for("react.forward_ref"),Mp=Symbol.for("react.suspense"),zp=Symbol.for("react.memo"),Op=Symbol.for("react.lazy"),Ha=Symbol.iterator;function Fp(e){return e===null||typeof e!="object"?null:(e=Ha&&e[Ha]||e["@@iterator"],typeof e=="function"?e:null)}var gc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vc=Object.assign,yc={};function ar(e,t,n){this.props=e,this.context=t,this.refs=yc,this.updater=n||gc}ar.prototype.isReactComponent={};ar.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")};ar.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wc(){}wc.prototype=ar.prototype;function ks(e,t,n){this.props=e,this.context=t,this.refs=yc,this.updater=n||gc}var Es=ks.prototype=new wc;Es.constructor=ks;vc(Es,ar.prototype);Es.isPureReactComponent=!0;var Wa=Array.isArray,Sc=Object.prototype.hasOwnProperty,Cs={current:null},xc={key:!0,ref:!0,__self:!0,__source:!0};function kc(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)Sc.call(t,r)&&!xc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,fe=z[ee];if(0>>1;eel(xt,B))ktl(be,xt)?(z[ee]=be,z[kt]=B,ee=kt):(z[ee]=xt,z[ft]=B,ee=ft);else if(ktl(be,B))z[ee]=be,z[kt]=B,ee=kt;else break e}}return $}function l(z,$){var B=z.sortIndex-$.sortIndex;return B!==0?B:z.id-$.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,S=!1,x=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=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(z){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=z)r(u),$.sortIndex=$.expirationTime,t(s,$);else break;$=n(u)}}function E(z){if(C=!1,d(z),!x)if(n(s)!==null)x=!0,Be(P);else{var $=n(u);$!==null&&wt(E,$.startTime-z)}}function P(z,$){x=!1,C&&(C=!1,h(F),F=-1),S=!0;var B=v;try{for(d($),m=n(s);m!==null&&(!(m.expirationTime>$)||z&&!H());){var ee=m.callback;if(typeof ee=="function"){m.callback=null,v=m.priorityLevel;var fe=ee(m.expirationTime<=$);$=e.unstable_now(),typeof fe=="function"?m.callback=fe:m===n(s)&&r(s),d($)}else r(s);m=n(s)}if(m!==null)var St=!0;else{var ft=n(u);ft!==null&&wt(E,ft.startTime-$),St=!1}return St}finally{m=null,v=B,S=!1}}var j=!1,T=null,F=-1,A=5,R=-1;function H(){return!(e.unstable_now()-Rz||125ee?(z.sortIndex=B,t(u,z),n(s)===null&&z===n(u)&&(C?(h(F),F=-1):C=!0,wt(E,B-ee))):(z.sortIndex=fe,t(s,z),x||S||(x=!0,Be(P))),z},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(z){var $=v;return function(){var B=v;v=$;try{return z.apply(this,arguments)}finally{v=B}}}})(Lc);_c.exports=Lc;var Yp=_c.exports;/** + */(function(e){function t(z,$){var H=z.length;z.push($);e:for(;0>>1,fe=z[ee];if(0>>1;eel(xt,H))ktl(Ye,xt)?(z[ee]=Ye,z[kt]=H,ee=kt):(z[ee]=xt,z[ft]=H,ee=ft);else if(ktl(Ye,H))z[ee]=Ye,z[kt]=H,ee=kt;else break e}}return $}function l(z,$){var H=z.sortIndex-$.sortIndex;return H!==0?H:z.id-$.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,y=3,S=!1,x=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=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(z){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=z)r(u),$.sortIndex=$.expirationTime,t(s,$);else break;$=n(u)}}function E(z){if(C=!1,d(z),!x)if(n(s)!==null)x=!0,Be(P);else{var $=n(u);$!==null&&wt(E,$.startTime-z)}}function P(z,$){x=!1,C&&(C=!1,h(F),F=-1),S=!0;var H=y;try{for(d($),m=n(s);m!==null&&(!(m.expirationTime>$)||z&&!A());){var ee=m.callback;if(typeof ee=="function"){m.callback=null,y=m.priorityLevel;var fe=ee(m.expirationTime<=$);$=e.unstable_now(),typeof fe=="function"?m.callback=fe:m===n(s)&&r(s),d($)}else r(s);m=n(s)}if(m!==null)var St=!0;else{var ft=n(u);ft!==null&&wt(E,ft.startTime-$),St=!1}return St}finally{m=null,y=H,S=!1}}var j=!1,T=null,F=-1,U=5,R=-1;function A(){return!(e.unstable_now()-Rz||125ee?(z.sortIndex=H,t(u,z),n(s)===null&&z===n(u)&&(C?(h(F),F=-1):C=!0,wt(E,H-ee))):(z.sortIndex=fe,t(s,z),x||S||(x=!0,Be(P))),z},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(z){var $=y;return function(){var H=y;y=$;try{return z.apply(this,arguments)}finally{y=H}}}})(Lc);_c.exports=Lc;var bp=_c.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bp=g,Qe=Yp;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"),_i=Object.prototype.hasOwnProperty,Jp=/^[: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]*$/,Qa={},Ka={};function Gp(e){return _i.call(Ka,e)?!0:_i.call(Qa,e)?!1:Jp.test(e)?Ka[e]=!0:(Qa[e]=!0,!1)}function Xp(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 Zp(e,t,n,r){if(t===null||typeof t>"u"||Xp(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 Oe(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 ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ke[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ke[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ke[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ke[e]=new Oe(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){ke[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ke[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ke[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ke[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ke[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var _s=/[\-:]([a-z])/g;function Ls(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(_s,Ls);ke[t]=new Oe(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(_s,Ls);ke[t]=new Oe(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(_s,Ls);ke[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ke[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});ke.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ke[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ps(e,t,n,r){var l=ke.hasOwnProperty(t)?ke[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=Object.prototype.hasOwnProperty,Jp=/^[: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]*$/,Qa={},Ka={};function Gp(e){return _i.call(Ka,e)?!0:_i.call(Qa,e)?!1:Jp.test(e)?Ka[e]=!0:(Qa[e]=!0,!1)}function Xp(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 Zp(e,t,n,r){if(t===null||typeof t>"u"||Xp(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 Oe(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 Ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ee[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ee[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ee[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ee[e]=new Oe(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){Ee[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ee[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ee[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ee[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ee[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var _s=/[\-:]([a-z])/g;function Ls(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(_s,Ls);Ee[t]=new Oe(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(_s,Ls);Ee[t]=new Oe(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(_s,Ls);Ee[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ee[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ee.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ee[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ps(e,t,n,r){var l=Ee.hasOwnProperty(t)?Ee[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{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?kr(e):""}function qp(e){switch(e.tag){case 5:return kr(e.type);case 16:return kr("Lazy");case 13:return kr("Suspense");case 19:return kr("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function ji(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 Dn:return"Fragment";case In:return"Portal";case Li:return"Profiler";case Rs:return"StrictMode";case Pi:return"Suspense";case Ri:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jc:return(e.displayName||"Context")+".Consumer";case Rc:return(e._context.displayName||"Context")+".Provider";case js:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ts:return t=e.displayName||null,t!==null?t:ji(e.type)||"Memo";case Wt:t=e._payload,e=e._init;try{return ji(e(t))}catch{}}return null}function eh(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 ji(t);case 8:return t===Rs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $c(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function th(e){var t=$c(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 yl(e){e._valueTracker||(e._valueTracker=th(e))}function Mc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$c(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(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 Ti(e,t){var n=t.checked;return ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ba(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zc(e,t){t=t.checked,t!=null&&Ps(e,"checked",t,!1)}function $i(e,t){zc(e,t);var n=rn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mi(e,t.type,rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ja(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 Mi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Er=Array.isArray;function Jn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _r={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},nh=["Webkit","ms","Moz","O"];Object.keys(_r).forEach(function(e){nh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_r[t]=_r[e]})});function Dc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_r.hasOwnProperty(e)&&_r[e]?(""+t).trim():t+"px"}function Ac(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Dc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var rh=ie({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 Fi(e,t){if(t){if(rh[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 Ii(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 Di=null;function $s(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ai=null,Gn=null,Xn=null;function Za(e){if(e=rl(e)){if(typeof Ai!="function")throw Error(L(280));var t=e.stateNode;t&&(t=_o(t),Ai(e.stateNode,e.type,t))}}function Uc(e){Gn?Xn?Xn.push(e):Xn=[e]:Gn=e}function Bc(){if(Gn){var e=Gn,t=Xn;if(Xn=Gn=null,Za(e),t)for(e=0;e>>=0,e===0?32:31-(hh(e)/mh|0)|0}var Sl=64,xl=4194304;function Cr(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 ql(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=Cr(a):(o&=i,o!==0&&(r=Cr(o)))}else i=n&~l,i!==0?r=Cr(i):o!==0&&(r=Cr(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 tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-st(t),e[t]=n}function wh(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=Pr),su=" ",au=!1;function af(e,t){switch(e){case"keyup":return Yh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function Jh(e,t){switch(e){case"compositionend":return uf(t);case"keypress":return t.which!==32?null:(au=!0,su);case"textInput":return e=t.data,e===su&&au?null:e;default:return null}}function Gh(e,t){if(An)return e==="compositionend"||!Us&&af(e,t)?(e=of(),Il=Is=Yt=null,An=!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=du(n)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Bs(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 om(e){var t=hf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pf(n.ownerDocument.documentElement,n)){if(r!==null&&Bs(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=pu(n,o);var i=pu(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,Un=null,Qi=null,jr=null,Ki=!1;function hu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||Un==null||Un!==Jl(r)||(r=Un,"selectionStart"in r&&Bs(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}),jr&&Hr(jr,r)||(jr=r,r=no(Qi,"onSelect"),0Wn||(e.current=Zi[Wn],Zi[Wn]=null,Wn--)}function G(e,t){Wn++,Zi[Wn]=e.current,e.current=t}var ln={},Pe=sn(ln),De=sn(!1),Sn=ln;function nr(e,t){var n=e.type.contextTypes;if(!n)return ln;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ae(e){return e=e.childContextTypes,e!=null}function lo(){q(De),q(Pe)}function xu(e,t,n){if(Pe.current!==ln)throw Error(L(168));G(Pe,t),G(De,n)}function Ef(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,eh(e)||"Unknown",l));return ie({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,Sn=Pe.current,G(Pe,e),G(De,De.current),!0}function ku(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Ef(e,t,Sn),r.__reactInternalMemoizedMergedChildContext=e,q(De),q(Pe),G(Pe,e)):q(De),G(De,n)}var _t=null,Lo=!1,mi=!1;function Cf(e){_t===null?_t=[e]:_t.push(e)}function vm(e){Lo=!0,Cf(e)}function an(){if(!mi&&_t!==null){mi=!0;var e=0,t=J;try{var n=_t;for(J=1;e>=i,l-=i,Lt=1<<32-st(t)+l|n<F?(A=T,T=null):A=T.sibling;var R=v(h,T,d[F],E);if(R===null){T===null&&(T=A);break}e&&T&&R.alternate===null&&t(h,T),f=o(R,f,F),j===null?P=R:j.sibling=R,j=R,T=A}if(F===d.length)return n(h,T),te&&pn(h,F),P;if(T===null){for(;FF?(A=T,T=null):A=T.sibling;var H=v(h,T,R.value,E);if(H===null){T===null&&(T=A);break}e&&T&&H.alternate===null&&t(h,T),f=o(H,f,F),j===null?P=H:j.sibling=H,j=H,T=A}if(R.done)return n(h,T),te&&pn(h,F),P;if(T===null){for(;!R.done;F++,R=d.next())R=m(h,R.value,E),R!==null&&(f=o(R,f,F),j===null?P=R:j.sibling=R,j=R);return te&&pn(h,F),P}for(T=r(h,T);!R.done;F++,R=d.next())R=S(T,h,F,R.value,E),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?F:R.key),f=o(R,f,F),j===null?P=R:j.sibling=R,j=R);return e&&T.forEach(function(ce){return t(h,ce)}),te&&pn(h,F),P}function _(h,f,d,E){if(typeof d=="object"&&d!==null&&d.type===Dn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var P=d.key,j=f;j!==null;){if(j.key===P){if(P=d.type,P===Dn){if(j.tag===7){n(h,j.sibling),f=l(j,d.props.children),f.return=h,h=f;break e}}else if(j.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Wt&&Nu(P)===j.type){n(h,j.sibling),f=l(j,d.props),f.ref=yr(h,j,d),f.return=h,h=f;break e}n(h,j);break}else t(h,j);j=j.sibling}d.type===Dn?(f=wn(d.props.children,h.mode,E,d.key),f.return=h,h=f):(E=Ql(d.type,d.key,d.props,null,h.mode,E),E.ref=yr(h,f,d),E.return=h,h=E)}return i(h);case In:e:{for(j=d.key;f!==null;){if(f.key===j)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ei(d,h.mode,E),f.return=h,h=f}return i(h);case Wt:return j=d._init,_(h,f,j(d._payload),E)}if(Er(d))return x(h,f,d,E);if(pr(d))return C(h,f,d,E);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=ki(d,h.mode,E),f.return=h,h=f),i(h)):n(h,f)}return _}var lr=Pf(!0),Rf=Pf(!1),ao=sn(null),uo=null,Kn=null,Qs=null;function Ks(){Qs=Kn=uo=null}function Ys(e){var t=ao.current;q(ao),e._currentValue=t}function ts(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 qn(e,t){uo=e,Qs=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function et(e){var t=e._currentValue;if(Qs!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(uo===null)throw Error(L(308));Kn=e,uo.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var gn=null;function bs(e){gn===null?gn=[e]:gn.push(e)}function jf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,bs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Mt(e,r)}function Mt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vt=!1;function Js(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Mt(e,n)}return l=r.interleaved,l===null?(t.next=t,bs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Mt(e,n)}function Al(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}function _u(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 co(e,t,n,r){var l=e.updateQueue;Vt=!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,S=a.eventTime;if((r&v)===v){p!==null&&(p=p.next={eventTime:S,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,C=a;switch(v=t,S=n,C.tag){case 1:if(x=C.payload,typeof x=="function"){m=x.call(S,m,v);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=C.payload,v=typeof x=="function"?x.call(S,m,v):x,v==null)break e;m=ie({},m,v);break e;case 2:Vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,v=l.effects,v===null?l.effects=[a]:v.push(a))}else S={eventTime:S,lane:v,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=S,s=m):p=p.next=S,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);En|=i,e.lanes=i,e.memoizedState=m}}function Lu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{J=n,vi.transition=r}}function bf(){return tt().memoizedState}function xm(e,t,n){var r=tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jf(e))Gf(t,n);else if(n=jf(e,t,n,r),n!==null){var l=Me();at(n,e,r,l),Xf(n,t,r)}}function km(e,t,n){var r=tn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jf(e))Gf(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,ut(a,i)){var s=t.interleaved;s===null?(l.next=l,bs(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=jf(e,t,l,r),n!==null&&(l=Me(),at(n,e,r,l),Xf(n,t,r))}}function Jf(e){var t=e.alternate;return e===le||t!==null&&t===le}function Gf(e,t){Tr=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}var ho={readContext:et,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useInsertionEffect:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useDeferredValue:Ne,useTransition:Ne,useMutableSource:Ne,useSyncExternalStore:Ne,useId:Ne,unstable_isNewReconciler:!1},Em={readContext:et,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,Wf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(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=xm.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Pu,useDebugValue:ra,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Pu(!1),t=e[0];return e=Sm.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,l=ht();if(te){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ye===null)throw Error(L(349));kn&30||Of(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ru(If.bind(null,r,o,e),[e]),r.flags|=2048,Gr(9,Ff.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ht(),t=ye.identifierPrefix;if(te){var n=Pt,r=Lt;n=(r&~(1<<32-st(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=br++,0")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?kr(e):""}function qp(e){switch(e.tag){case 5:return kr(e.type);case 16:return kr("Lazy");case 13:return kr("Suspense");case 19:return kr("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function ji(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 Dn:return"Fragment";case In:return"Portal";case Li:return"Profiler";case Rs:return"StrictMode";case Pi:return"Suspense";case Ri:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jc:return(e.displayName||"Context")+".Consumer";case Rc:return(e._context.displayName||"Context")+".Provider";case js:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ts:return t=e.displayName||null,t!==null?t:ji(e.type)||"Memo";case Wt:t=e._payload,e=e._init;try{return ji(e(t))}catch{}}return null}function eh(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 ji(t);case 8:return t===Rs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $c(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function th(e){var t=$c(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 yl(e){e._valueTracker||(e._valueTracker=th(e))}function Mc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$c(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(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 Ti(e,t){var n=t.checked;return ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ya(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zc(e,t){t=t.checked,t!=null&&Ps(e,"checked",t,!1)}function $i(e,t){zc(e,t);var n=rn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mi(e,t.type,rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ja(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 Mi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Er=Array.isArray;function Jn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _r={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},nh=["Webkit","ms","Moz","O"];Object.keys(_r).forEach(function(e){nh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_r[t]=_r[e]})});function Dc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_r.hasOwnProperty(e)&&_r[e]?(""+t).trim():t+"px"}function Ac(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Dc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var rh=ie({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 Fi(e,t){if(t){if(rh[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 Ii(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 Di=null;function $s(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ai=null,Gn=null,Xn=null;function Za(e){if(e=rl(e)){if(typeof Ai!="function")throw Error(L(280));var t=e.stateNode;t&&(t=_o(t),Ai(e.stateNode,e.type,t))}}function Uc(e){Gn?Xn?Xn.push(e):Xn=[e]:Gn=e}function Bc(){if(Gn){var e=Gn,t=Xn;if(Xn=Gn=null,Za(e),t)for(e=0;e>>=0,e===0?32:31-(hh(e)/mh|0)|0}var Sl=64,xl=4194304;function Cr(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 ql(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=Cr(a):(o&=i,o!==0&&(r=Cr(o)))}else i=n&~l,i!==0?r=Cr(i):o!==0&&(r=Cr(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 tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-st(t),e[t]=n}function wh(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=Pr),su=" ",au=!1;function af(e,t){switch(e){case"keyup":return bh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function Jh(e,t){switch(e){case"compositionend":return uf(t);case"keypress":return t.which!==32?null:(au=!0,su);case"textInput":return e=t.data,e===su&&au?null:e;default:return null}}function Gh(e,t){if(An)return e==="compositionend"||!Us&&af(e,t)?(e=of(),Il=Is=bt=null,An=!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=du(n)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Bs(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 om(e){var t=hf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pf(n.ownerDocument.documentElement,n)){if(r!==null&&Bs(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=pu(n,o);var i=pu(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,Un=null,Qi=null,jr=null,Ki=!1;function hu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||Un==null||Un!==Jl(r)||(r=Un,"selectionStart"in r&&Bs(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}),jr&&Hr(jr,r)||(jr=r,r=no(Qi,"onSelect"),0Wn||(e.current=Zi[Wn],Zi[Wn]=null,Wn--)}function G(e,t){Wn++,Zi[Wn]=e.current,e.current=t}var ln={},Re=sn(ln),De=sn(!1),Sn=ln;function nr(e,t){var n=e.type.contextTypes;if(!n)return ln;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ae(e){return e=e.childContextTypes,e!=null}function lo(){q(De),q(Re)}function xu(e,t,n){if(Re.current!==ln)throw Error(L(168));G(Re,t),G(De,n)}function Ef(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,eh(e)||"Unknown",l));return ie({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ln,Sn=Re.current,G(Re,e),G(De,De.current),!0}function ku(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Ef(e,t,Sn),r.__reactInternalMemoizedMergedChildContext=e,q(De),q(Re),G(Re,e)):q(De),G(De,n)}var _t=null,Lo=!1,mi=!1;function Cf(e){_t===null?_t=[e]:_t.push(e)}function vm(e){Lo=!0,Cf(e)}function an(){if(!mi&&_t!==null){mi=!0;var e=0,t=J;try{var n=_t;for(J=1;e>=i,l-=i,Lt=1<<32-st(t)+l|n<F?(U=T,T=null):U=T.sibling;var R=y(h,T,d[F],E);if(R===null){T===null&&(T=U);break}e&&T&&R.alternate===null&&t(h,T),f=o(R,f,F),j===null?P=R:j.sibling=R,j=R,T=U}if(F===d.length)return n(h,T),te&&pn(h,F),P;if(T===null){for(;FF?(U=T,T=null):U=T.sibling;var A=y(h,T,R.value,E);if(A===null){T===null&&(T=U);break}e&&T&&A.alternate===null&&t(h,T),f=o(A,f,F),j===null?P=A:j.sibling=A,j=A,T=U}if(R.done)return n(h,T),te&&pn(h,F),P;if(T===null){for(;!R.done;F++,R=d.next())R=m(h,R.value,E),R!==null&&(f=o(R,f,F),j===null?P=R:j.sibling=R,j=R);return te&&pn(h,F),P}for(T=r(h,T);!R.done;F++,R=d.next())R=S(T,h,F,R.value,E),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?F:R.key),f=o(R,f,F),j===null?P=R:j.sibling=R,j=R);return e&&T.forEach(function(se){return t(h,se)}),te&&pn(h,F),P}function _(h,f,d,E){if(typeof d=="object"&&d!==null&&d.type===Dn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var P=d.key,j=f;j!==null;){if(j.key===P){if(P=d.type,P===Dn){if(j.tag===7){n(h,j.sibling),f=l(j,d.props.children),f.return=h,h=f;break e}}else if(j.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Wt&&Nu(P)===j.type){n(h,j.sibling),f=l(j,d.props),f.ref=yr(h,j,d),f.return=h,h=f;break e}n(h,j);break}else t(h,j);j=j.sibling}d.type===Dn?(f=wn(d.props.children,h.mode,E,d.key),f.return=h,h=f):(E=Ql(d.type,d.key,d.props,null,h.mode,E),E.ref=yr(h,f,d),E.return=h,h=E)}return i(h);case In:e:{for(j=d.key;f!==null;){if(f.key===j)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ei(d,h.mode,E),f.return=h,h=f}return i(h);case Wt:return j=d._init,_(h,f,j(d._payload),E)}if(Er(d))return x(h,f,d,E);if(pr(d))return C(h,f,d,E);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=ki(d,h.mode,E),f.return=h,h=f),i(h)):n(h,f)}return _}var lr=Pf(!0),Rf=Pf(!1),ao=sn(null),uo=null,Kn=null,Qs=null;function Ks(){Qs=Kn=uo=null}function bs(e){var t=ao.current;q(ao),e._currentValue=t}function ts(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 qn(e,t){uo=e,Qs=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function et(e){var t=e._currentValue;if(Qs!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(uo===null)throw Error(L(308));Kn=e,uo.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var gn=null;function Ys(e){gn===null?gn=[e]:gn.push(e)}function jf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ys(t)):(n.next=l.next,l.next=n),t.interleaved=n,Mt(e,r)}function Mt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vt=!1;function Js(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,b&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Mt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ys(r)):(t.next=l.next,l.next=t),r.interleaved=t,Mt(e,n)}function Al(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}function _u(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 co(e,t,n,r){var l=e.updateQueue;Vt=!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 y=a.lane,S=a.eventTime;if((r&y)===y){p!==null&&(p=p.next={eventTime:S,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,C=a;switch(y=t,S=n,C.tag){case 1:if(x=C.payload,typeof x=="function"){m=x.call(S,m,y);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=C.payload,y=typeof x=="function"?x.call(S,m,y):x,y==null)break e;m=ie({},m,y);break e;case 2:Vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[a]:y.push(a))}else S={eventTime:S,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=S,s=m):p=p.next=S,i|=y;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;y=a,a=y.next,y.next=null,l.lastBaseUpdate=y,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);En|=i,e.lanes=i,e.memoizedState=m}}function Lu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{J=n,vi.transition=r}}function Yf(){return tt().memoizedState}function xm(e,t,n){var r=tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jf(e))Gf(t,n);else if(n=jf(e,t,n,r),n!==null){var l=Me();at(n,e,r,l),Xf(n,t,r)}}function km(e,t,n){var r=tn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jf(e))Gf(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,ut(a,i)){var s=t.interleaved;s===null?(l.next=l,Ys(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=jf(e,t,l,r),n!==null&&(l=Me(),at(n,e,r,l),Xf(n,t,r))}}function Jf(e){var t=e.alternate;return e===le||t!==null&&t===le}function Gf(e,t){Tr=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}var ho={readContext:et,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},Em={readContext:et,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,Wf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(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=xm.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Pu,useDebugValue:ra,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Pu(!1),t=e[0];return e=Sm.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,l=ht();if(te){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),we===null)throw Error(L(349));kn&30||Of(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ru(If.bind(null,r,o,e),[e]),r.flags|=2048,Gr(9,Ff.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ht(),t=we.identifierPrefix;if(te){var n=Pt,r=Lt;n=(r&~(1<<32-st(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yr++,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[Qr]=r,sd(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ii(n,r),n){case"dialog":Z("cancel",e),Z("close",e),l=r;break;case"iframe":case"object":case"embed":Z("load",e),l=r;break;case"video":case"audio":for(l=0;lsr&&(t.flags|=128,r=!0,wr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!te)return _e(t),null}else 2*ue()-o.renderingStartTime>sr&&n!==1073741824&&(t.flags|=128,r=!0,wr(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=ue(),t.sibling=null,n=re.current,G(re,r?n&1|2:n&1),t):(_e(t),null);case 22:case 23:return ua(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(_e(t),t.subtreeFlags&6&&(t.flags|=8192)):_e(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function Tm(e,t){switch(Ws(t),t.tag){case 1:return Ae(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(),q(De),q(Pe),Zs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xs(t),null;case 13:if(q(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(re),null;case 4:return or(),null;case 10:return Ys(t.type._context),null;case 22:case 23:return ua(),null;case 24:return null;default:return null}}var jl=!1,Le=!1,$m=typeof WeakSet=="function"?WeakSet:Set,O=null;function Yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){se(e,t,r)}else n.current=null}function cs(e,t,n){try{n()}catch(r){se(e,t,r)}}var Uu=!1;function Mm(e,t){if(Yi=eo,e=hf(),Bs(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 S;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),(S=m.firstChild)!==null;)v=m,m=S;for(;;){if(m===e)break t;if(v===n&&++u===l&&(a=i),v===o&&++p===r&&(s=i),(S=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=S}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(bi={focusedElem:e,selectionRange:n},eo=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;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 C=x.memoizedProps,_=x.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:lt(t.type,C),_);h.__reactInternalSnapshotBeforeUpdate=f}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){se(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return x=Uu,Uu=!1,x}function $r(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&&cs(t,n,o)}l=l.next}while(l!==r)}}function jo(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 fs(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 cd(e){var t=e.alternate;t!==null&&(e.alternate=null,cd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mt],delete t[Qr],delete t[Xi],delete t[mm],delete t[gm])),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 fd(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fd(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 ds(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=ro));else if(r!==4&&(e=e.child,e!==null))for(ds(e,t,n),e=e.sibling;e!==null;)ds(e,t,n),e=e.sibling}function ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}var Se=null,ot=!1;function Ht(e,t,n){for(n=n.child;n!==null;)dd(e,t,n),n=n.sibling}function dd(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:Le||Yn(n,t);case 6:var r=Se,l=ot;Se=null,Ht(e,t,n),Se=r,ot=l,Se!==null&&(ot?(e=Se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Se.removeChild(n.stateNode));break;case 18:Se!==null&&(ot?(e=Se,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),Ur(e)):hi(Se,n.stateNode));break;case 4:r=Se,l=ot,Se=n.stateNode.containerInfo,ot=!0,Ht(e,t,n),Se=r,ot=l;break;case 0:case 11:case 14:case 15:if(!Le&&(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)&&cs(n,t,i),l=l.next}while(l!==r)}Ht(e,t,n);break;case 1:if(!Le&&(Yn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){se(n,t,a)}Ht(e,t,n);break;case 21:Ht(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,Ht(e,t,n),Le=r):Ht(e,t,n);break;default:Ht(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $m),t.forEach(function(r){var l=Hm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function rt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Om(r/1960))-r,10e?16:e,bt===null)var r=!1;else{if(e=bt,bt=null,vo=0,Y&6)throw Error(L(331));var l=Y;for(Y|=4,O=e.current;O!==null;){var o=O,i=o.child;if(O.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sue()-sa?yn(e,0):ia|=n),Ue(e,t)}function Sd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=Me();e=Mt(e,t),e!==null&&(tl(e,t,n),Ue(e,n))}function Bm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sd(e,n)}function Hm(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),Sd(e,n)}var xd;xd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,Rm(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,te&&t.flags&1048576&&Nf(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=nr(t,Pe.current);qn(t,n),l=ea(null,t,r,e,l,n);var o=ta();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,Ae(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Js(t),l.updater=Ro,t.stateNode=l,l._reactInternals=t,rs(t,r,e,n),t=is(null,t,r,!0,o,n)):(t.tag=0,te&&o&&Hs(t),$e(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Vm(r),e=lt(r,e),l){case 0:t=os(null,t,r,e,n);break e;case 1:t=Iu(null,t,r,e,n);break e;case 11:t=Ou(null,t,r,e,n);break e;case 14:t=Fu(null,t,r,lt(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:lt(r,l),os(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Iu(e,t,r,l,n);case 3:e:{if(ld(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Tf(e,t),co(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=ir(Error(L(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=ir(Error(L(424)),t),t=Du(e,t,r,n,l);break e}else for(We=Zt(t.stateNode.containerInfo.firstChild),Ve=t,te=!0,it=null,n=Rf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rr(),r===l){t=zt(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return $f(t),e===null&&es(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Ji(r,l)?i=null:o!==null&&Ji(r,o)&&(t.flags|=32),rd(e,t),$e(e,t,i,n),t.child;case 6:return e===null&&es(t),null;case 13:return od(e,t,n);case 4:return Gs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lr(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Ou(e,t,r,l,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(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,G(ao,r._currentValue),r._currentValue=i,o!==null)if(ut(o.value,i)){if(o.children===l.children&&!De.current){t=zt(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=Rt(-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),ts(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),ts(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}$e(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,qn(t,n),l=et(l),r=r(l),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,l=lt(r,t.pendingProps),l=lt(r.type,l),Fu(e,t,r,l,n);case 15:return td(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Hl(e,t),t.tag=1,Ae(r)?(e=!0,oo(t)):e=!1,qn(t,n),Zf(t,r,l),rs(t,r,l,n),is(null,t,r,!0,e,n);case 19:return id(e,t,n);case 22:return nd(e,t,n)}throw Error(L(156,t.tag))};function kd(e,t){return bc(e,t)}function Wm(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 Ze(e,t,n,r){return new Wm(e,t,n,r)}function fa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vm(e){if(typeof e=="function")return fa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===js)return 11;if(e===Ts)return 14}return 2}function nn(e,t){var n=e.alternate;return n===null?(n=Ze(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 Ql(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")fa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Dn:return wn(n.children,l,o,t);case Rs:i=8,l|=8;break;case Li:return e=Ze(12,n,t,l|2),e.elementType=Li,e.lanes=o,e;case Pi:return e=Ze(13,n,t,l),e.elementType=Pi,e.lanes=o,e;case Ri:return e=Ze(19,n,t,l),e.elementType=Ri,e.lanes=o,e;case Tc:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rc:i=10;break e;case jc:i=9;break e;case js:i=11;break e;case Ts:i=14;break e;case Wt:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function wn(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=Tc,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qm(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=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function da(e,t,n,r,l,o,i,a,s){return e=new Qm(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Js(o),e}function Km(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_d)}catch(e){console.error(e)}}_d(),Nc.exports=Ke;var Ld=Nc.exports,Pd,Gu=Ld;Pd=Gu.createRoot,Gu.hydrateRoot;/** +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function Si(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ls(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _m=typeof WeakMap=="function"?WeakMap:Map;function qf(e,t,n){n=Rt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){go||(go=!0,hs=r),ls(e,t)},n}function ed(e,t,n){n=Rt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){ls(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ls(e,t),typeof r!="function"&&(en===null?en=new Set([this]):en.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function $u(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _m;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Um.bind(null,e,t,n),t.then(e,e))}function Mu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function zu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rt(-1,1),t.tag=2,qt(n,t,1))),n.lanes|=1),e)}var Lm=Ft.ReactCurrentOwner,Ie=!1;function $e(e,t,n,r){t.child=e===null?Rf(t,null,n,r):lr(t,e.child,n,r)}function Ou(e,t,n,r,l){n=n.render;var o=t.ref;return qn(t,l),r=ea(e,t,n,r,o,l),n=ta(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,zt(e,t,l)):(te&&n&&Hs(t),t.flags|=1,$e(e,t,r,l),t.child)}function Fu(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!fa(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,td(e,t,o,r,l)):(e=Ql(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&l)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Hr,n(i,r)&&e.ref===t.ref)return zt(e,t,l)}return t.flags|=1,e=nn(o,r),e.ref=t.ref,e.return=t,t.child=e}function td(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(Hr(o,r)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(Ie=!0);else return t.lanes=e.lanes,zt(e,t,l)}return os(e,t,n,r,l)}function nd(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(Yn,He),He|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,G(Yn,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,G(Yn,He),He|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,G(Yn,He),He|=r;return $e(e,t,l,n),t.child}function rd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function os(e,t,n,r,l){var o=Ae(n)?Sn:Re.current;return o=nr(t,o),qn(t,l),n=ea(e,t,n,r,o,l),r=ta(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,zt(e,t,l)):(te&&r&&Hs(t),t.flags|=1,$e(e,t,n,l),t.child)}function Iu(e,t,n,r,l){if(Ae(n)){var o=!0;oo(t)}else o=!1;if(qn(t,l),t.stateNode===null)Hl(e,t),Zf(t,n,r),rs(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var s=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=et(u):(u=Ae(n)?Sn:Re.current,u=nr(t,u));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function";m||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||s!==u)&&Tu(t,i,r,u),Vt=!1;var y=t.memoizedState;i.state=y,co(t,r,i,l),s=t.memoizedState,a!==r||y!==s||De.current||Vt?(typeof p=="function"&&(ns(t,n,p,r),s=t.memoizedState),(a=Vt||ju(t,n,a,r,y,s,u))?(m||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=u,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Tf(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:lt(t.type,a),i.props=u,m=t.pendingProps,y=i.context,s=n.contextType,typeof s=="object"&&s!==null?s=et(s):(s=Ae(n)?Sn:Re.current,s=nr(t,s));var S=n.getDerivedStateFromProps;(p=typeof S=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==m||y!==s)&&Tu(t,i,r,s),Vt=!1,y=t.memoizedState,i.state=y,co(t,r,i,l);var x=t.memoizedState;a!==m||y!==x||De.current||Vt?(typeof S=="function"&&(ns(t,n,S,r),x=t.memoizedState),(u=Vt||ju(t,n,u,r,y,x,s)||!1)?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,x,s),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,x,s)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),i.props=r,i.state=x,i.context=s,r=u):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),r=!1)}return is(e,t,n,r,o,l)}function is(e,t,n,r,l,o){rd(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&ku(t,n,!1),zt(e,t,o);r=t.stateNode,Lm.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=lr(t,e.child,null,o),t.child=lr(t,null,a,o)):$e(e,t,a,o),t.memoizedState=r.state,l&&ku(t,n,!0),t.child}function ld(e){var t=e.stateNode;t.pendingContext?xu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xu(e,t.context,!1),Gs(e,t.containerInfo)}function Du(e,t,n,r,l){return rr(),Vs(l),t.flags|=256,$e(e,t,n,r),t.child}var ss={dehydrated:null,treeContext:null,retryLane:0};function as(e){return{baseLanes:e,cachePool:null,transitions:null}}function od(e,t,n){var r=t.pendingProps,l=re.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),G(re,l&1),e===null)return es(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=$o(i,r,0,null),e=wn(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=as(n),t.memoizedState=ss,e):la(t,i));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return Pm(e,t,i,r,a,l,n);if(o){o=r.fallback,i=t.mode,l=e.child,a=l.sibling;var s={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=nn(l,s),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?o=nn(a,o):(o=wn(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?as(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=ss,r}return o=e.child,e=o.sibling,r=nn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function la(e,t){return t=$o({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rl(e,t,n,r){return r!==null&&Vs(r),lr(t,e.child,null,n),e=la(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pm(e,t,n,r,l,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Si(Error(L(422))),Rl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=$o({mode:"visible",children:r.children},l,0,null),o=wn(o,l,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&lr(t,e.child,null,i),t.child.memoizedState=as(i),t.memoizedState=ss,o);if(!(t.mode&1))return Rl(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(L(419)),r=Si(o,r,void 0),Rl(e,t,i,r)}if(a=(i&e.childLanes)!==0,Ie||a){if(r=we,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,Mt(e,l),at(r,e,l,-1))}return ca(),r=Si(Error(L(421))),Rl(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Bm.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,We=Zt(l.nextSibling),Ve=t,te=!0,it=null,e!==null&&(Ge[Xe++]=Lt,Ge[Xe++]=Pt,Ge[Xe++]=xn,Lt=e.id,Pt=e.overflow,xn=t),t=la(t,r.children),t.flags|=4096,t)}function Au(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ts(e.return,t,n)}function xi(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function id(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if($e(e,t,r.children,n),r=re.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Au(e,n,t);else if(e.tag===19)Au(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(G(re,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),xi(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&fo(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}xi(t,!0,n,null,o);break;case"together":xi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),En|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=nn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=nn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rm(e,t,n){switch(t.tag){case 3:ld(t),rr();break;case 5:$f(t);break;case 1:Ae(t.type)&&oo(t);break;case 4:Gs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;G(ao,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(G(re,re.current&1),t.flags|=128,null):n&t.child.childLanes?od(e,t,n):(G(re,re.current&1),e=zt(e,t,n),e!==null?e.sibling:null);G(re,re.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return id(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),G(re,re.current),r)break;return null;case 22:case 23:return t.lanes=0,nd(e,t,n)}return zt(e,t,n)}var sd,us,ad,ud;sd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};us=function(){};ad=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,vn(vt.current);var o=null;switch(n){case"input":l=Ti(e,l),r=Ti(e,r),o=[];break;case"select":l=ie({},l,{value:void 0}),r=ie({},r,{value:void 0}),o=[];break;case"textarea":l=zi(e,l),r=zi(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ro)}Fi(n,r);var i;n=null;for(u in l)if(!r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&l[u]!=null)if(u==="style"){var a=l[u];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Or.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var s=r[u];if(a=l!=null?l[u]:void 0,r.hasOwnProperty(u)&&s!==a&&(s!=null||a!=null))if(u==="style")if(a){for(i in a)!a.hasOwnProperty(i)||s&&s.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in s)s.hasOwnProperty(i)&&a[i]!==s[i]&&(n||(n={}),n[i]=s[i])}else n||(o||(o=[]),o.push(u,n)),n=s;else u==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,a=a?a.__html:void 0,s!=null&&a!==s&&(o=o||[]).push(u,s)):u==="children"?typeof s!="string"&&typeof s!="number"||(o=o||[]).push(u,""+s):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Or.hasOwnProperty(u)?(s!=null&&u==="onScroll"&&Z("scroll",e),o||a===s||(o=[])):(o=o||[]).push(u,s))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};ud=function(e,t,n,r){n!==r&&(t.flags|=4)};function wr(e,t){if(!te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function jm(e,t,n){var r=t.pendingProps;switch(Ws(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Ae(t.type)&&lo(),Le(t),null;case 3:return r=t.stateNode,or(),q(De),q(Re),Zs(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,it!==null&&(vs(it),it=null))),us(e,t),Le(t),null;case 5:Xs(t);var l=vn(br.current);if(n=t.type,e!==null&&t.stateNode!=null)ad(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return Le(t),null}if(e=vn(vt.current),Ll(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[mt]=t,r[Qr]=o,e=(t.mode&1)!==0,n){case"dialog":Z("cancel",r),Z("close",r);break;case"iframe":case"object":case"embed":Z("load",r);break;case"video":case"audio":for(l=0;l<\/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[Qr]=r,sd(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ii(n,r),n){case"dialog":Z("cancel",e),Z("close",e),l=r;break;case"iframe":case"object":case"embed":Z("load",e),l=r;break;case"video":case"audio":for(l=0;lsr&&(t.flags|=128,r=!0,wr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!te)return Le(t),null}else 2*ce()-o.renderingStartTime>sr&&n!==1073741824&&(t.flags|=128,r=!0,wr(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=re.current,G(re,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return ua(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function Tm(e,t){switch(Ws(t),t.tag){case 1:return Ae(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(),q(De),q(Re),Zs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xs(t),null;case 13:if(q(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(re),null;case 4:return or(),null;case 10:return bs(t.type._context),null;case 22:case 23:return ua(),null;case 24:return null;default:return null}}var jl=!1,Pe=!1,$m=typeof WeakSet=="function"?WeakSet:Set,O=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 cs(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Uu=!1;function Mm(e,t){if(bi=eo,e=hf(),Bs(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,y=null;t:for(;;){for(var S;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),(S=m.firstChild)!==null;)y=m,m=S;for(;;){if(m===e)break t;if(y===n&&++u===l&&(a=i),y===o&&++p===r&&(s=i),(S=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=S}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},eo=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;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 C=x.memoizedProps,_=x.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:lt(t.type,C),_);h.__reactInternalSnapshotBeforeUpdate=f}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,O=e;break}O=t.return}return x=Uu,Uu=!1,x}function $r(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&&cs(t,n,o)}l=l.next}while(l!==r)}}function jo(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 fs(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 cd(e){var t=e.alternate;t!==null&&(e.alternate=null,cd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mt],delete t[Qr],delete t[Xi],delete t[mm],delete t[gm])),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 fd(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fd(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 ds(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=ro));else if(r!==4&&(e=e.child,e!==null))for(ds(e,t,n),e=e.sibling;e!==null;)ds(e,t,n),e=e.sibling}function ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}var xe=null,ot=!1;function Ht(e,t,n){for(n=n.child;n!==null;)dd(e,t,n),n=n.sibling}function dd(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:Pe||bn(n,t);case 6:var r=xe,l=ot;xe=null,Ht(e,t,n),xe=r,ot=l,xe!==null&&(ot?(e=xe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xe.removeChild(n.stateNode));break;case 18:xe!==null&&(ot?(e=xe,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),Ur(e)):hi(xe,n.stateNode));break;case 4:r=xe,l=ot,xe=n.stateNode.containerInfo,ot=!0,Ht(e,t,n),xe=r,ot=l;break;case 0:case 11:case 14:case 15:if(!Pe&&(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)&&cs(n,t,i),l=l.next}while(l!==r)}Ht(e,t,n);break;case 1:if(!Pe&&(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)}Ht(e,t,n);break;case 21:Ht(e,t,n);break;case 22:n.mode&1?(Pe=(r=Pe)||n.memoizedState!==null,Ht(e,t,n),Pe=r):Ht(e,t,n);break;default:Ht(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $m),t.forEach(function(r){var l=Hm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function rt(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*Om(r/1960))-r,10e?16:e,Yt===null)var r=!1;else{if(e=Yt,Yt=null,vo=0,b&6)throw Error(L(331));var l=b;for(b|=4,O=e.current;O!==null;){var o=O,i=o.child;if(O.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sce()-sa?yn(e,0):ia|=n),Ue(e,t)}function Sd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=Me();e=Mt(e,t),e!==null&&(tl(e,t,n),Ue(e,n))}function Bm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sd(e,n)}function Hm(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),Sd(e,n)}var xd;xd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,Rm(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,te&&t.flags&1048576&&Nf(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=nr(t,Re.current);qn(t,n),l=ea(null,t,r,e,l,n);var o=ta();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,Ae(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Js(t),l.updater=Ro,t.stateNode=l,l._reactInternals=t,rs(t,r,e,n),t=is(null,t,r,!0,o,n)):(t.tag=0,te&&o&&Hs(t),$e(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Vm(r),e=lt(r,e),l){case 0:t=os(null,t,r,e,n);break e;case 1:t=Iu(null,t,r,e,n);break e;case 11:t=Ou(null,t,r,e,n);break e;case 14:t=Fu(null,t,r,lt(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:lt(r,l),os(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Iu(e,t,r,l,n);case 3:e:{if(ld(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Tf(e,t),co(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=ir(Error(L(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=ir(Error(L(424)),t),t=Du(e,t,r,n,l);break e}else for(We=Zt(t.stateNode.containerInfo.firstChild),Ve=t,te=!0,it=null,n=Rf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rr(),r===l){t=zt(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return $f(t),e===null&&es(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Ji(r,l)?i=null:o!==null&&Ji(r,o)&&(t.flags|=32),rd(e,t),$e(e,t,i,n),t.child;case 6:return e===null&&es(t),null;case 13:return od(e,t,n);case 4:return Gs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lr(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Ou(e,t,r,l,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(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,G(ao,r._currentValue),r._currentValue=i,o!==null)if(ut(o.value,i)){if(o.children===l.children&&!De.current){t=zt(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=Rt(-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),ts(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),ts(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}$e(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,qn(t,n),l=et(l),r=r(l),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,l=lt(r,t.pendingProps),l=lt(r.type,l),Fu(e,t,r,l,n);case 15:return td(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Hl(e,t),t.tag=1,Ae(r)?(e=!0,oo(t)):e=!1,qn(t,n),Zf(t,r,l),rs(t,r,l,n),is(null,t,r,!0,e,n);case 19:return id(e,t,n);case 22:return nd(e,t,n)}throw Error(L(156,t.tag))};function kd(e,t){return Yc(e,t)}function Wm(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 Ze(e,t,n,r){return new Wm(e,t,n,r)}function fa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vm(e){if(typeof e=="function")return fa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===js)return 11;if(e===Ts)return 14}return 2}function nn(e,t){var n=e.alternate;return n===null?(n=Ze(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 Ql(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")fa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Dn:return wn(n.children,l,o,t);case Rs:i=8,l|=8;break;case Li:return e=Ze(12,n,t,l|2),e.elementType=Li,e.lanes=o,e;case Pi:return e=Ze(13,n,t,l),e.elementType=Pi,e.lanes=o,e;case Ri:return e=Ze(19,n,t,l),e.elementType=Ri,e.lanes=o,e;case Tc:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rc:i=10;break e;case jc:i=9;break e;case js:i=11;break e;case Ts:i=14;break e;case Wt:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function wn(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=Tc,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qm(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=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function da(e,t,n,r,l,o,i,a,s){return e=new Qm(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Js(o),e}function Km(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_d)}catch(e){console.error(e)}}_d(),Nc.exports=Ke;var Ld=Nc.exports,Pd,Gu=Ld;Pd=Gu.createRoot,Gu.hydrateRoot;/** * react-router v7.8.2 * * Copyright (c) Remix Software Inc. @@ -46,9 +46,9 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var Xu="popstate";function Xm(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=Ln(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ys("",{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:Zr(o))}function r(l,o){ct(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return qm(t,n,r,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ct(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Zm(){return Math.random().toString(36).substring(2,10)}function Zu(e,t){return{usr:e.state,key:e.key,idx:t}}function ys(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ln(t):t,state:n,key:t&&t.key||r||Zm()}}function Zr({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 Ln(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 qm(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 _=p(),h=_==null?null:_-u;u=_,s&&s({action:a,location:C.location,delta:h})}function v(_,h){a="PUSH";let f=ys(C.location,_,h);n&&n(f,_),u=p()+1;let d=Zu(f,u),E=C.createHref(f);try{i.pushState(d,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(E)}o&&s&&s({action:a,location:C.location,delta:1})}function S(_,h){a="REPLACE";let f=ys(C.location,_,h);n&&n(f,_),u=p();let d=Zu(f,u),E=C.createHref(f);i.replaceState(d,"",E),o&&s&&s({action:a,location:C.location,delta:0})}function x(_){return eg(_)}let C={get action(){return a},get location(){return e(l,i)},listen(_){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Xu,m),s=_,()=>{l.removeEventListener(Xu,m),s=null}},createHref(_){return t(l,_)},createURL:x,encodeLocation(_){let h=x(_);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:v,replace:S,go(_){return i.go(_)}};return C}function eg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),oe(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Zr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Rd(e,t,n="/"){return tg(e,t,n,!1)}function tg(e,t,n,r){let l=typeof t=="string"?Ln(t):t,o=Ot(l.pathname||"/",n);if(o==null)return null;let i=jd(e);ng(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;oe(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=jt([r,p.relativePath]),v=n.concat(p);i.children&&i.children.length>0&&(oe(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),jd(i.children,t,v,m,s)),!(i.path==null&&!i.index)&&t.push({path:m,score:ug(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 Td(i.path))o(i,a,!0,u)}),t}function Td(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=Td(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 ng(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var rg=/^:[\w-]+$/,lg=3,og=2,ig=1,sg=10,ag=-2,qu=e=>e==="*";function ug(e,t){let n=e.split("/"),r=n.length;return n.some(qu)&&(r+=ag),t&&(r+=og),n.filter(l=>!qu(l)).reduce((l,o)=>l+(rg.test(o)?lg:o===""?ig:sg),r)}function cg(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 fg(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 S=a[v];return m&&!S?u[p]=void 0:u[p]=(S||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function dg(e,t=!1,n=!0){ct(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 pg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ct(!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 Ot(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 hg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Ln(e):e;return{pathname:n?n.startsWith("/")?n:mg(n,t):t,search:yg(r),hash:wg(l)}}function mg(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 Ci(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 gg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $d(e){let t=gg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Md(e,t,n,r=!1){let l;typeof e=="string"?l=Ln(e):(l={...e},oe(!l.pathname||!l.pathname.includes("?"),Ci("?","pathname","search",l)),oe(!l.pathname||!l.pathname.includes("#"),Ci("#","pathname","hash",l)),oe(!l.search||!l.search.includes("#"),Ci("#","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=hg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var jt=e=>e.join("/").replace(/\/\/+/g,"/"),vg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Sg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var zd=["POST","PUT","PATCH","DELETE"];new Set(zd);var xg=["GET",...zd];new Set(xg);var fr=g.createContext(null);fr.displayName="DataRouter";var Io=g.createContext(null);Io.displayName="DataRouterState";g.createContext(!1);var Od=g.createContext({isTransitioning:!1});Od.displayName="ViewTransition";var kg=g.createContext(new Map);kg.displayName="Fetchers";var Eg=g.createContext(null);Eg.displayName="Await";var yt=g.createContext(null);yt.displayName="Navigation";var ol=g.createContext(null);ol.displayName="Location";var It=g.createContext({outlet:null,matches:[],isDataRoute:!1});It.displayName="Route";var ga=g.createContext(null);ga.displayName="RouteError";function Cg(e,{relative:t}={}){oe(il(),"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}=sl(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:jt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function il(){return g.useContext(ol)!=null}function Pn(){return oe(il(),"useLocation() may be used only in the context of a component."),g.useContext(ol).location}var Fd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Id(e){g.useContext(yt).static||g.useLayoutEffect(e)}function Ng(){let{isDataRoute:e}=g.useContext(It);return e?Dg():_g()}function _g(){oe(il(),"useNavigate() may be used only in the context of a component.");let e=g.useContext(fr),{basename:t,navigator:n}=g.useContext(yt),{matches:r}=g.useContext(It),{pathname:l}=Pn(),o=JSON.stringify($d(r)),i=g.useRef(!1);return Id(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(ct(i.current,Fd),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Md(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:jt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}g.createContext(null);function sl(e,{relative:t}={}){let{matches:n}=g.useContext(It),{pathname:r}=Pn(),l=JSON.stringify($d(n));return g.useMemo(()=>Md(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Lg(e,t){return Dd(e,t)}function Dd(e,t,n,r,l){var f;oe(il(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=g.useContext(yt),{matches:i}=g.useContext(It),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||"";Ad(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. + */var Xu="popstate";function Xm(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=Ln(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ys("",{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:Zr(o))}function r(l,o){ct(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return qm(t,n,r,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ct(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Zm(){return Math.random().toString(36).substring(2,10)}function Zu(e,t){return{usr:e.state,key:e.key,idx:t}}function ys(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ln(t):t,state:n,key:t&&t.key||r||Zm()}}function Zr({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 Ln(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 qm(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 _=p(),h=_==null?null:_-u;u=_,s&&s({action:a,location:C.location,delta:h})}function y(_,h){a="PUSH";let f=ys(C.location,_,h);n&&n(f,_),u=p()+1;let d=Zu(f,u),E=C.createHref(f);try{i.pushState(d,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(E)}o&&s&&s({action:a,location:C.location,delta:1})}function S(_,h){a="REPLACE";let f=ys(C.location,_,h);n&&n(f,_),u=p();let d=Zu(f,u),E=C.createHref(f);i.replaceState(d,"",E),o&&s&&s({action:a,location:C.location,delta:0})}function x(_){return eg(_)}let C={get action(){return a},get location(){return e(l,i)},listen(_){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Xu,m),s=_,()=>{l.removeEventListener(Xu,m),s=null}},createHref(_){return t(l,_)},createURL:x,encodeLocation(_){let h=x(_);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:y,replace:S,go(_){return i.go(_)}};return C}function eg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),oe(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Zr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Rd(e,t,n="/"){return tg(e,t,n,!1)}function tg(e,t,n,r){let l=typeof t=="string"?Ln(t):t,o=Ot(l.pathname||"/",n);if(o==null)return null;let i=jd(e);ng(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;oe(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=jt([r,p.relativePath]),y=n.concat(p);i.children&&i.children.length>0&&(oe(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),jd(i.children,t,y,m,s)),!(i.path==null&&!i.index)&&t.push({path:m,score:ug(m,i.index),routesMeta:y})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of Td(i.path))o(i,a,!0,u)}),t}function Td(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=Td(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 ng(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var rg=/^:[\w-]+$/,lg=3,og=2,ig=1,sg=10,ag=-2,qu=e=>e==="*";function ug(e,t){let n=e.split("/"),r=n.length;return n.some(qu)&&(r+=ag),t&&(r+=og),n.filter(l=>!qu(l)).reduce((l,o)=>l+(rg.test(o)?lg:o===""?ig:sg),r)}function cg(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 fg(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let x=a[y]||"";i=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const S=a[y];return m&&!S?u[p]=void 0:u[p]=(S||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function dg(e,t=!1,n=!0){ct(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 pg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ct(!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 Ot(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 hg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Ln(e):e;return{pathname:n?n.startsWith("/")?n:mg(n,t):t,search:yg(r),hash:wg(l)}}function mg(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 Ci(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 gg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $d(e){let t=gg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Md(e,t,n,r=!1){let l;typeof e=="string"?l=Ln(e):(l={...e},oe(!l.pathname||!l.pathname.includes("?"),Ci("?","pathname","search",l)),oe(!l.pathname||!l.pathname.includes("#"),Ci("#","pathname","hash",l)),oe(!l.search||!l.search.includes("#"),Ci("#","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 y=i.split("/");for(;y[0]==="..";)y.shift(),m-=1;l.pathname=y.join("/")}a=m>=0?t[m]:"/"}let s=hg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var jt=e=>e.join("/").replace(/\/\/+/g,"/"),vg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Sg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var zd=["POST","PUT","PATCH","DELETE"];new Set(zd);var xg=["GET",...zd];new Set(xg);var fr=v.createContext(null);fr.displayName="DataRouter";var Io=v.createContext(null);Io.displayName="DataRouterState";v.createContext(!1);var Od=v.createContext({isTransitioning:!1});Od.displayName="ViewTransition";var kg=v.createContext(new Map);kg.displayName="Fetchers";var Eg=v.createContext(null);Eg.displayName="Await";var yt=v.createContext(null);yt.displayName="Navigation";var ol=v.createContext(null);ol.displayName="Location";var It=v.createContext({outlet:null,matches:[],isDataRoute:!1});It.displayName="Route";var ga=v.createContext(null);ga.displayName="RouteError";function Cg(e,{relative:t}={}){oe(il(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(yt),{hash:l,pathname:o,search:i}=sl(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:jt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function il(){return v.useContext(ol)!=null}function Pn(){return oe(il(),"useLocation() may be used only in the context of a component."),v.useContext(ol).location}var Fd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Id(e){v.useContext(yt).static||v.useLayoutEffect(e)}function Ng(){let{isDataRoute:e}=v.useContext(It);return e?Dg():_g()}function _g(){oe(il(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(fr),{basename:t,navigator:n}=v.useContext(yt),{matches:r}=v.useContext(It),{pathname:l}=Pn(),o=JSON.stringify($d(r)),i=v.useRef(!1);return Id(()=>{i.current=!0}),v.useCallback((s,u={})=>{if(ct(i.current,Fd),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Md(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:jt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}v.createContext(null);function sl(e,{relative:t}={}){let{matches:n}=v.useContext(It),{pathname:r}=Pn(),l=JSON.stringify($d(n));return v.useMemo(()=>Md(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Lg(e,t){return Dd(e,t)}function Dd(e,t,n,r,l){var f;oe(il(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=v.useContext(yt),{matches:i}=v.useContext(It),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||"";Ad(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=Pn(),S;if(t){let d=typeof t=="string"?Ln(t):t;oe(p==="/"||((f=d.pathname)==null?void 0:f.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.`),S=d}else S=v;let x=S.pathname||"/",C=x;if(p!=="/"){let d=p.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(d.length).join("/")}let _=Rd(e,{pathname:C});ct(m||_!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),ct(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=$g(_&&_.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:jt([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:jt([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?g.createElement(ol.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},h):h}function Pg(){let e=Ig(),t=Sg(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 Rg=g.createElement(Pg,null),jg=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(It.Provider,{value:this.props.routeContext},g.createElement(ga.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Tg({routeContext:e,match:t,children:n}){let r=g.useContext(fr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(It.Provider,{value:e},n)}function $g(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);oe(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,S=!1,x=null,C=null;n&&(v=i&&p.route.id?i[p.route.id]:void 0,x=p.route.errorElement||Rg,a&&(s<0&&m===0?(Ad("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):s===m&&(S=!0,C=p.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,m+1)),h=()=>{let f;return v?f=x:S?f=C:p.route.Component?f=g.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=u,g.createElement(Tg,{match:p,routeContext:{outlet:u,matches:_,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?g.createElement(jg,{location:n.location,revalidation:n.revalidation,component:x,error:v,children:h(),routeContext:{outlet:null,matches:_,isDataRoute:!0},unstable_onError:r}):h()},null)}function va(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mg(e){let t=g.useContext(fr);return oe(t,va(e)),t}function zg(e){let t=g.useContext(Io);return oe(t,va(e)),t}function Og(e){let t=g.useContext(It);return oe(t,va(e)),t}function ya(e){let t=Og(e),n=t.matches[t.matches.length-1];return oe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fg(){return ya("useRouteId")}function Ig(){var r;let e=g.useContext(ga),t=zg("useRouteError"),n=ya("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Dg(){let{router:e}=Mg("useNavigate"),t=ya("useNavigate"),n=g.useRef(!1);return Id(()=>{n.current=!0}),g.useCallback(async(l,o={})=>{ct(n.current,Fd),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var ec={};function Ad(e,t,n){!t&&!ec[e]&&(ec[e]=!0,ct(!1,n))}g.memo(Ag);function Ag({routes:e,future:t,state:n,unstable_onError:r}){return Dd(e,void 0,n,r,t)}function Ud(e){oe(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Ug({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){oe(!il(),"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=Ln(n));let{pathname:s="/",search:u="",hash:p="",state:m=null,key:v="default"}=n,S=g.useMemo(()=>{let x=Ot(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 ct(S!=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.`),S==null?null:g.createElement(yt.Provider,{value:a},g.createElement(ol.Provider,{children:t,value:S}))}function Bg({children:e,location:t}){return Lg(ws(e),t)}function ws(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,ws(r.props.children,o));return}oe(r.type===Ud,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),oe(!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=ws(r.props.children,o)),n.push(i)}),n}var Kl="get",Yl="application/x-www-form-urlencoded";function Do(e){return e!=null&&typeof e.tagName=="string"}function Hg(e){return Do(e)&&e.tagName.toLowerCase()==="button"}function Wg(e){return Do(e)&&e.tagName.toLowerCase()==="form"}function Vg(e){return Do(e)&&e.tagName.toLowerCase()==="input"}function Qg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kg(e,t){return e.button===0&&(!t||t==="_self")&&!Qg(e)}var Ml=null;function Yg(){if(Ml===null)try{new FormData(document.createElement("form"),0),Ml=!1}catch{Ml=!0}return Ml}var bg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ni(e){return e!=null&&!bg.has(e)?(ct(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Yl}"`),null):e}function Jg(e,t){let n,r,l,o,i;if(Wg(e)){let a=e.getAttribute("action");r=a?Ot(a,t):null,n=e.getAttribute("method")||Kl,l=Ni(e.getAttribute("enctype"))||Yl,o=new FormData(e)}else if(Hg(e)||Vg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a `,x=`
${v}
`;return`
${S}${x}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function Kv(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;rd.replace(/^\||\|$/g,"").split("|").map(E=>E.trim()),m=p(u[0]),y=p(u[1]);if(m.length<2||y.length<2||!y.every(d=>/^[ :\-]+$/.test(d)&&/-/.test(d)))return a;const S=y.map(d=>{const E=d.replace(/\s+/g,""),P=E.startsWith(":"),j=E.endsWith(":");return P&&j?"center":j?"right":"left"}),x=u.slice(2).filter(d=>/^\|/.test(d.trim())),C=d=>` style="text-align:${S[d]||"left"};vertical-align:top;padding:.6rem .75rem"`,_=m.map((d,E)=>`${d}`).join(""),h=x.map(d=>`${p(d).map((j,T)=>`${j}`).join("")}`).join("");return`${_}${h}
`+(s?` +`:"")}),l=l.replace(/^---\s*$/gm,"
");let i=l.replace(/\*\*(.+?)\*\*/g,"$1").replace(new RegExp("(?$1").replace(/`(.+?)`/g,"$1");return i=i.replace(/\[([^\]]+?)\]\(([^)]+?)\)/g,'$1 $2'),i=i.replace(/\n/g,"
"),i=i.replace(/
\s*(
    )/g,"$1").replace(/(<\/ul>)\s*
    /g,"$1").replace(/
    \s*(
    ]*>)/g,"$1").replace(/(<\/div>)\s*
    /g,"$1").replace(/
    \s*(]*>)/g,"$1").replace(/(<\/table>)\s*
    /g,"$1").replace(/
    \s*(
    )/g,"$1").replace(/(<\/blockquote>)\s*
    /g,"$1"),i=i.replace(/(
    )[ \t]+/g,"$1").replace(/(
    )(?:[ \t]*
    )+/g,"$1").replace(/(<\/blockquote>)(?:[ \t]*
    )+/g,"$1").replace(/(<\/ul>)(?:[ \t]*
    )+/g,"$1"),i=i.replace(/@@CODEBLOCK(\d+)@@/g,(a,s)=>{const{lang:u,code:p}=n[+s],m=u&&u.trim()?u.trim():"code",y=p.replace(/&/g,"&").replace(//g,">"),S=`
    ${m}
    `,x=`
    ${y}
    `;return`
    ${S}${x}
    `}),i=i.replace(/
    \s*(?=
    ]*>[\s\S]*?<\/div>)\s*
    /g,"$1"),i}function bv(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 Yv({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=Jd(e||""),[o,i]=Te.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:cc(r)}})]}),y.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:cc(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 S=v.pathname.split("/").filter(Boolean);p=decodeURIComponent(S[S.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 S,x;if(m){v.preventDefault();try{const C=new URL(s);(x=(S=window.electronAPI)==null?void 0:S.openPath)==null||x.call(S,decodeURIComponent(C.pathname))}catch{}}},children:p},s+u)})})]})}const fc="websearch.searxUrl",dc="websearch.engines",pc="chat.libraryBySession";let bv="http://127.0.0.1:8000";const Jv=48,Gv=24;function Xv(){var Ba;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(null),[v,S]=g.useState([]),[x,C]=g.useState([]),[_,h]=g.useState(null),[f,d]=g.useState(()=>{try{const c=localStorage.getItem(pc);return c?JSON.parse(c):{}}catch{return{}}}),[E,P]=g.useState(!1),[j,T]=g.useState(""),[F,A]=g.useState(""),[R,H]=g.useState(!1),[ce,Re]=g.useState(""),[Rn,al]=g.useState(""),Be=g.useRef(null),wt=g.useRef(null),z=g.useRef(null),[$,B]=g.useState(bv),[ee,fe]=g.useState("Default"),[St,ft]=g.useState(!1),[xt,kt]=g.useState(localStorage.getItem(fc)||"http://localhost:8888"),[be,Gd]=g.useState(()=>{try{const c=localStorage.getItem(dc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});g.useEffect(()=>{localStorage.setItem(fc,xt||"")},[xt]),g.useEffect(()=>{try{localStorage.setItem(dc,JSON.stringify(be||[]))}catch{}},[be]);const[ul,Xd]=g.useState(!1),[Dt,Ao]=g.useState(!1),[ey,Uo]=g.useState(!0),[Zd,jn]=g.useState([]),[cl,ka]=g.useState({}),[qd,Bo]=g.useState(null),[Ho,fl]=g.useState("");function ep(c){const w=c.content||"";if(c.role==="assistant")try{const{answer:k}=Jd(w);return(k||w).trim()}catch{return w.trim()}return w}async function Ea(c){try{await navigator.clipboard.writeText(ep(c))}catch(w){console.error("Failed to copy message:",w)}}function un(c,w,k,N={}){const{removeIfEmpty:M=!1}=N;t(D=>D.map(U=>{if(U.session_id!==c)return U;const I=[];for(const W of U.messages||[]){if(W.id!==w){I.push(W);continue}M&&!k||I.push({...W,content:k})}return{...U,messages:I}}))}function At(c){return(c==null?void 0:c.name)==="AbortError"}function Wo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Ca(c,w,k){if(!c)return{contextBlock:null,sources:[]};const M=await(await fetch(`${$}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({prompt:w,top_k:5})})).json();return{contextBlock:typeof(M==null?void 0:M.context_block)=="string"&&M.context_block.trim()?M.context_block.trim():null,sources:Array.isArray(M==null?void 0:M.sources)?M.sources:[]}}function tp(c,w){Bo(c),fl(w||"")}function dl(){Bo(null),fl("")}async function np(c){var D;const w=(((D=zn[c])==null?void 0:D.content)||"").trim(),N=(Ho??"").trim();if(N.length===0){dl();return}if(N===w){dl();return}const M=n;if(M){t(U=>U.map(I=>{if(I.session_id!==M)return I;const Ce=(I.messages||[]).slice(0,c+1).map((he,Je)=>Je===c?{...he,content:N}:he);return{...I,messages:Ce}})),Bo(null),fl(""),requestAnimationFrame(()=>Go("auto",M));try{const U=await fetch(`${$}/sessions/${M}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:N})});if(!U.ok)throw new Error(`HTTP ${U.status}`)}catch(U){console.error("Failed to update message:",U),t(I=>I.map(W=>{if(W.session_id!==M)return W;const he=(W.messages||[]).map((Je,V)=>V===c?{...Je,content:w}:Je);return{...W,messages:he}}));return}await Na(c,N)}}async function Na(c,w=null){var Ce,he,Je,V,ae,we;const k=n;if(Dt||!k||typeof c!="number")return;const N=((Ce=e.find(b=>b.session_id===k))==null?void 0:Ce.messages)||[];let M=c;for(let b=c;b>=0;b--)if(((he=N[b])==null?void 0:he.role)==="user"){M=b;break}t(b=>b.map(ne=>ne.session_id===k?{...ne,messages:(ne.messages||[]).slice(0,M+1)}:ne));const D=Ta(k);let U=w??(((Je=N[M])==null?void 0:Je.content)||""),I=[];const W=[];try{const b=Oa(k),ne=w??(((V=N[M])==null?void 0:V.content)||"");if((ae=b==null?void 0:b.states)!=null&&ae.is_indexed)try{const Q=await Ca(b.slug,ne,D.signal);Q.contextBlock&&W.push(Q.contextBlock),Array.isArray(Q.sources)&&I.push(...Q.sources)}catch(Q){if(At(Q))throw Q;console.warn("local library enrichment (regenerate) failed",Q)}if(ul)try{const Q=N.slice(Math.max(0,M-7),M+1).map(de=>({role:de.role,content:de.content||""}));Q.length>0&&(Q[Q.length-1]={role:"user",content:ne});const X=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({prompt:ne,model:ce,messages:Q,history_limit:8,searx_url:xt||null,engines:Array.isArray(be)?be:null})})).json();X&&typeof X.context_block=="string"&&X.context_block.trim()&&W.push(X.context_block.trim()),Array.isArray(X==null?void 0:X.sources)&&I.push(...X.sources)}catch(Q){if(At(Q))throw Q;console.warn("web search enrichment (regenerate) failed",Q)}if(I=[...new Set(I)],W.length>0?U=`${ne} +`+r}return e}function Jd(e){if(!e)return{think:null,answer:""};const t=//i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let 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 Yv({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=Jd(e||""),[o,i]=Te.useState(!1),a=!!r;return g.jsxs("div",{className:"assistant-message",children:[a&&g.jsxs("div",{className:"assistant-thoughts",children:[g.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[g.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&g.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:cc(r)}})]}),g.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:cc(l||e||"")}}),Array.isArray(n)&&n.length>0&&g.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,m=!1;try{const y=new URL(s);if(y.protocol==="file:"){m=!0;const S=y.pathname.split("/").filter(Boolean);p=decodeURIComponent(S[S.length-1]||s)}else p=(y.hostname||s).replace(/^www\./i,"")}catch{}return g.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:y=>{var S,x;if(m){y.preventDefault();try{const C=new URL(s);(x=(S=window.electronAPI)==null?void 0:S.openPath)==null||x.call(S,decodeURIComponent(C.pathname))}catch{}}},children:p},s+u)})})]})}const fc="websearch.searxUrl",dc="websearch.engines",pc="chat.libraryBySession";let Jv="http://127.0.0.1:8000";const Gv=48,Xv=24;function Zv(){var Ba;const[e,t]=v.useState([]),[n,r]=v.useState(null),[l,o]=v.useState("chats"),[i,a]=v.useState("General"),[s,u]=v.useState(null),[p,m]=v.useState(null),[y,S]=v.useState([]),[x,C]=v.useState([]),[_,h]=v.useState(null),[f,d]=v.useState(()=>{try{const c=localStorage.getItem(pc);return c?JSON.parse(c):{}}catch{return{}}}),[E,P]=v.useState(!1),[j,T]=v.useState(""),[F,U]=v.useState(""),[R,A]=v.useState(!1),[se,ve]=v.useState(""),[Rn,al]=v.useState(""),Be=v.useRef(null),wt=v.useRef(null),z=v.useRef(null),[$,H]=v.useState(Jv),[ee,fe]=v.useState("Default"),[St,ft]=v.useState(!1),[xt,kt]=v.useState(localStorage.getItem(fc)||"http://localhost:8888"),[Ye,Gd]=v.useState(()=>{try{const c=localStorage.getItem(dc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});v.useEffect(()=>{localStorage.setItem(fc,xt||"")},[xt]),v.useEffect(()=>{try{localStorage.setItem(dc,JSON.stringify(Ye||[]))}catch{}},[Ye]);const[ul,Xd]=v.useState(!1),[Dt,Ao]=v.useState(!1),[ty,Uo]=v.useState(!0),[Zd,jn]=v.useState([]),[cl,ka]=v.useState({}),[qd,Bo]=v.useState(null),[Ho,fl]=v.useState("");function ep(c){const w=c.content||"";if(c.role==="assistant")try{const{answer:k}=Jd(w);return(k||w).trim()}catch{return w.trim()}return w}async function Ea(c){try{await navigator.clipboard.writeText(ep(c))}catch(w){console.error("Failed to copy message:",w)}}function un(c,w,k,N={}){const{removeIfEmpty:M=!1}=N;t(D=>D.map(B=>{if(B.session_id!==c)return B;const I=[];for(const W of B.messages||[]){if(W.id!==w){I.push(W);continue}M&&!k||I.push({...W,content:k})}return{...B,messages:I}}))}function At(c){return(c==null?void 0:c.name)==="AbortError"}function Wo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Ca(c,w,k){if(!c)return{contextBlock:null,sources:[]};const M=await(await fetch(`${$}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({prompt:w,top_k:5})})).json();return{contextBlock:typeof(M==null?void 0:M.context_block)=="string"&&M.context_block.trim()?M.context_block.trim():null,sources:Array.isArray(M==null?void 0:M.sources)?M.sources:[]}}function tp(c,w){Bo(c),fl(w||"")}function dl(){Bo(null),fl("")}async function np(c){var D;const w=(((D=zn[c])==null?void 0:D.content)||"").trim(),N=(Ho??"").trim();if(N.length===0){dl();return}if(N===w){dl();return}const M=n;if(M){t(B=>B.map(I=>{if(I.session_id!==M)return I;const Ne=(I.messages||[]).slice(0,c+1).map((he,Je)=>Je===c?{...he,content:N}:he);return{...I,messages:Ne}})),Bo(null),fl(""),requestAnimationFrame(()=>Go("auto",M));try{const B=await fetch(`${$}/sessions/${M}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:N})});if(!B.ok)throw new Error(`HTTP ${B.status}`)}catch(B){console.error("Failed to update message:",B),t(I=>I.map(W=>{if(W.session_id!==M)return W;const he=(W.messages||[]).map((Je,V)=>V===c?{...Je,content:w}:Je);return{...W,messages:he}}));return}await Na(c,N)}}async function Na(c,w=null){var Ne,he,Je,V,ue,Se;const k=n;if(Dt||!k||typeof c!="number")return;const N=((Ne=e.find(Y=>Y.session_id===k))==null?void 0:Ne.messages)||[];let M=c;for(let Y=c;Y>=0;Y--)if(((he=N[Y])==null?void 0:he.role)==="user"){M=Y;break}t(Y=>Y.map(ne=>ne.session_id===k?{...ne,messages:(ne.messages||[]).slice(0,M+1)}:ne));const D=Ta(k);let B=w??(((Je=N[M])==null?void 0:Je.content)||""),I=[];const W=[];try{const Y=Oa(k),ne=w??(((V=N[M])==null?void 0:V.content)||"");if((ue=Y==null?void 0:Y.states)!=null&&ue.is_indexed)try{const Q=await Ca(Y.slug,ne,D.signal);Q.contextBlock&&W.push(Q.contextBlock),Array.isArray(Q.sources)&&I.push(...Q.sources)}catch(Q){if(At(Q))throw Q;console.warn("local library enrichment (regenerate) failed",Q)}if(ul)try{const Q=N.slice(Math.max(0,M-7),M+1).map(de=>({role:de.role,content:de.content||""}));Q.length>0&&(Q[Q.length-1]={role:"user",content:ne});const X=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({prompt:ne,model:se,messages:Q,history_limit:8,searx_url:xt||null,engines:Array.isArray(Ye)?Ye:null})})).json();X&&typeof X.context_block=="string"&&X.context_block.trim()&&W.push(X.context_block.trim()),Array.isArray(X==null?void 0:X.sources)&&I.push(...X.sources)}catch(Q){if(At(Q))throw Q;console.warn("web search enrichment (regenerate) failed",Q)}if(I=[...new Set(I)],W.length>0?B=`${ne} ${W.join(` -`)}`:U=null,St){const Q=`msg-${Date.now()}-${Math.random()}`;let Ct="";t(X=>X.map(de=>de.session_id===k?{...de,messages:[...de.messages||[],{id:Q,role:"assistant",content:"",sources:I}]}:de));try{const X=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:ce,stream:!0,enriched_message:U,sources:I||[]})});if(!X.ok)throw new Error(`HTTP ${X.status}`);const de=(we=X.body)==null?void 0:we.getReader();if(!de)throw new Error("Missing response body");const Bt=new TextDecoder;let dt=!1;for(;;){const{value:dn,done:Ep}=await de.read();if(Ep)break;const Cp=Bt.decode(dn,{stream:!0});Ct+=Cp,un(k,Q,Ct),!dt&&Ee.current!==k&&(dt=!0,cn(Xo=>({...Xo,[k]:Q})),jn(Xo=>[...new Set([...Xo,k])]))}Ee.current!==k?(cn(dn=>({...dn,[k]:Q})),jn(dn=>[...new Set([...dn,k])])):Tn.current[k]?$n(dn=>({...dn,[k]:Q})):requestAnimationFrame(()=>On(Q,"smooth",k))}catch(X){if(At(X)){un(k,Q,Ct,{removeIfEmpty:!0});return}console.error(X),un(k,Q,`Error: ${Wo(X)}`,{removeIfEmpty:!0});return}}else{const Q=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:ce,stream:!1,enriched_message:U,sources:I||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const Ct=await Q.json(),X=`msg-${Date.now()}`;t(de=>de.map(Bt=>Bt.session_id===k?{...Bt,messages:[...Bt.messages||[],{role:"assistant",content:Ct.reply,id:X,sources:I}]}:Bt)),Ee.current!==k?(cn(de=>({...de,[k]:X})),jn(de=>[...new Set([...de,k])])):Tn.current[k]?$n(de=>({...de,[k]:X})):requestAnimationFrame(()=>On(X,"smooth",k))}}catch(b){At(b)||console.error(b)}finally{Vo(D)}}const[_a,rp]=g.useState({}),Tn=g.useRef({}),[lp,cn]=g.useState({}),fn=g.useRef({}),La=g.useRef({}),[Pa,$n]=g.useState({}),[op,Ra]=g.useState({}),ja=(c,w,k)=>c!=null&&c.id?c.id:`${k}:${w}`;g.useEffect(()=>{var w;if(!n)return;const c=((w=e.find(k=>k.session_id===n))==null?void 0:w.messages)||[];Ra(k=>{const N={};return c.forEach((M,D)=>{if(M.role!=="user")return;const U=ja(M,D,n),W=(M.content||"").split(/\r\n|\r|\n/).length>30;N[U]=W?k[U]??!0:!1}),N})},[e,n]);function ip(c){Ra(w=>({...w,[c]:!(w[c]??!0)}))}const dr=Te.useCallback((c,w)=>{rp(k=>{const N={...k,[c]:w};return Tn.current=N,N})},[]),Mn=g.useRef(null),sp=g.useRef(!1),ap=g.useRef(null),Ee=g.useRef(n);g.useEffect(()=>{Ee.current=n},[n]);const Ta=Te.useCallback(c=>{const w=new AbortController;return Mn.current={controller:w,sessionId:c},Ao(!0),w},[]),Vo=Te.useCallback(c=>{var w;((w=Mn.current)==null?void 0:w.controller)===c&&(Mn.current=null,Ao(!1))},[]),up=Te.useCallback(()=>{const c=Mn.current;c&&(Mn.current=null,c.controller.abort(),Ao(!1))},[]);g.useEffect(()=>()=>{var c;(c=Mn.current)==null||c.controller.abort()},[]);const Ut=g.useRef(null),[cp,fp]=g.useState(230),[pl,$a]=g.useState(!1),dp=Te.useCallback(c=>{$a(!0)},[]),Qo=Te.useCallback(()=>{$a(!1)},[]),Ko=Te.useCallback(c=>{if(pl){const w=Math.max(230,Math.min(500,c.clientX));fp(w)}},[pl]);Te.useEffect(()=>(window.addEventListener("mousemove",Ko),window.addEventListener("mouseup",Qo),()=>{window.removeEventListener("mousemove",Ko),window.removeEventListener("mouseup",Qo)}),[Ko,Qo]),Te.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),Te.useEffect(()=>{const c=async w=>{const k=w.target.closest(".codeblock__copy");if(!k)return;const N=k.closest(".codeblock"),M=N==null?void 0:N.querySelector("pre > code");if(M)try{await navigator.clipboard.writeText(M.textContent||""),k.classList.add("copied"),setTimeout(()=>k.classList.remove("copied"),800)}catch(D){console.error("Copy failed:",D)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),g.useEffect(()=>{window.electronAPI.getSettings().then(w=>{B(w.ollamaApiUrl),fe(w.colorScheme||"Default"),Re(w.chatModel||""),ft(w.streamOutput||!1),ka(w.scrollPositions||{}),qr(w.colorScheme||"Default")});const c=()=>{var w;l==="chats"&&((w=wt.current)==null||w.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),g.useEffect(()=>{qr(ee)},[ee]);const pp=c=>{!c||!$||fetch(`${$}/history?session_id=${encodeURIComponent(c)}`).then(w=>w.json()).then(w=>{t(k=>k.map(N=>N.session_id===c?{...N,messages:w.messages||[]}:N))}).catch(()=>{})};async function hl(){if($)try{const w=await(await fetch(`${$}/libraries`)).json(),k=Array.isArray(w.libraries)?w.libraries:[];if(S(k),k.length===0){h(null);return}k.some(N=>N.slug===_)||h(k[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function Yo(){if($)try{const w=await(await fetch(`${$}/jobs`)).json();C(Array.isArray(w.jobs)?w.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function Ma(c=null){const k=(typeof c=="string"?c:j).trim();if(!k){A("Name is required.");return}try{A("");const N=await fetch(`${$}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})});if(!N.ok){const D=await N.text();throw new Error(D||`HTTP ${N.status}`)}const M=await N.json();P(!1),T(""),await hl(),M!=null&&M.slug&&h(M.slug)}catch(N){console.error("Failed to create library",N),A(String((N==null?void 0:N.message)||N))}}g.useEffect(()=>{$&&(Uo(!0),fetch(`${$}/sessions`).then(c=>c.json()).then(c=>{const w=c.sessions.map(k=>({...k,messages:[]}));t(w),w.length>0?r(w[0].session_id):r(null),Uo(!1)}).catch(()=>{Uo(!1)}))},[$]),g.useEffect(()=>{$&&(hl(),Yo())},[$]),g.useEffect(()=>{try{localStorage.setItem(pc,JSON.stringify(f||{}))}catch{}},[f]),g.useEffect(()=>{if(!$)return;const c=setInterval(()=>{hl(),Yo()},3e3);return()=>clearInterval(c)},[$,l,_]),g.useEffect(()=>{pp(n)},[n]),g.useEffect(()=>{const c=new Set(v.map(w=>w.slug));d(w=>{let k=!1;const N={};for(const[M,D]of Object.entries(w||{}))c.has(D)?N[M]=D:k=!0;return k?N:w})},[v]);const bo=c=>{o(c)},hp=c=>{wp(c)},zn=g.useMemo(()=>{var c;return((c=e.find(w=>w.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=g.useMemo(()=>v.find(c=>c.slug===_)||null,[_,v]),Et=n&&f[n]||null,nt=g.useMemo(()=>v.find(c=>c.slug===Et)||null,[Et,v]),za=g.useMemo(()=>Et?x.some(c=>c.slug===Et&&(c.status==="queued"||c.status==="running")):!1,[Et,x]),Jo=g.useMemo(()=>{var c,w;return nt?(c=nt.files)!=null&&c.length?(w=nt.states)!=null&&w.is_indexed?"":za?" (syncing)":" (needs sync)":" (empty)":""},[nt,za]);function mp(c){return c&&f[c]||null}function Oa(c){const w=mp(c);return w&&v.find(k=>k.slug===w)||null}function Fa(c){return c?x.some(w=>w.slug===c&&(w.status==="queued"||w.status==="running")):!1}function Ia(c,w){c&&d(k=>{const N={...k||{}};return w?N[c]=w:delete N[c],N})}function gp(c){c&&d(w=>{let k=!1;const N={};for(const[M,D]of Object.entries(w||{})){if(D===c){k=!0;continue}N[M]=D}return k?N:w})}g.useEffect(()=>{if(!R)return;const c=w=>{var k;(k=z.current)!=null&&k.contains(w.target)||H(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[R]),g.useEffect(()=>{H(!1)},[n,l]),g.useEffect(()=>{const c=n,w=l;return()=>{if(w==="chats"&&c){const k=typeof fn.current[c]=="number"?fn.current[c]:Be.current?Be.current.scrollTop:0;ka(N=>{const M={...N,[c]:k};return window.electronAPI.updateSettings({scrollPositions:M}),M})}}},[n,l]),g.useEffect(()=>{const c=Be.current;if(!c)return;const w=()=>{const{scrollTop:k,scrollHeight:N,clientHeight:M}=c,D=N-k-M<=Gv;if(n){const U=La.current[n],I=typeof U=="number"&&kc.removeEventListener("scroll",w)},[n,dr]),g.useEffect(()=>{const c=n;c&&_a[c]===!1&&$n(w=>{if(!(c in w))return w;const k={...w};return delete k[c],k})},[n,_a]),g.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=Be.current;if(!c)return;Ut.current=null;const w=()=>{if(Ut.current===n)return;const U=typeof fn.current[n]=="number"?fn.current[n]:void 0,I=typeof U=="number"?U:cl[n];if(typeof I=="number"){c.scrollTop=I,Ut.current=n;return}zn.length>0&&(c.scrollTop=c.scrollHeight,Ut.current=n)};w();const k=requestAnimationFrame(w),N=()=>{Ut.current!==n&&requestAnimationFrame(w)},M=new MutationObserver(N);M.observe(c,{childList:!0,subtree:!0});const D=new ResizeObserver(N);return D.observe(c),()=>{cancelAnimationFrame(k),M.disconnect(),D.disconnect()}},[n,l,zn.length,cl]),g.useEffect(()=>{if(l!=="chats"||!n||Ut.current===n)return;const c=typeof fn.current[n]=="number"?fn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&zn.length>0&&requestAnimationFrame(()=>{const k=Be.current;k&&(k.scrollTop=k.scrollHeight,Ut.current=n)})},[zn.length,n,l,cl]);const Go=(c="smooth",w=null)=>{const k=Be.current;if(!k)return;const N=w??Ee.current;Ee.current===N&&(k.scrollTo({top:k.scrollHeight,behavior:c}),dr(N,!1))},On=(c,w="auto",k=null)=>{const N=Be.current;if(!N)return;const M=k??Ee.current;if(Ee.current!==M)return;const D=document.getElementById(c);if(D){const U=Math.max(0,D.offsetTop-Jv);N.scrollTo({top:U,behavior:w})}},vp=()=>{const c=Ee.current,w=Pa[c];w&&(On(w,"smooth",c),$n(k=>{const{[c]:N,...M}=k;return M}))};async function Da(){var M,D,U;if(Dt||!Rn.trim()||!ce)return;let c=n,w=!1;if(c){const I=e.find(W=>W.session_id===c);w=I&&I.name==="New Chat"&&I.messages.length===0}else{const I=await Aa();await new Promise(W=>setTimeout(W,200)),c=I.session_id,w=!0}const k={role:"user",content:Rn.trim(),id:`msg-${Date.now()}-${Math.random()}`};sp.current=!0,ap.current=c,dr(c,!1),Ee.current===c&&(Ut.current=Ee.current),Ld.flushSync(()=>{t(I=>I.map(W=>W.session_id===c?{...W,messages:[...W.messages||[],k]}:W)),al("")}),requestAnimationFrame(()=>Go("auto",c));const N=Ta(c);try{let I=[];try{I=[...(((M=e.find(we=>we.session_id===c))==null?void 0:M.messages)||[]).slice(-8).map(we=>({role:we.role,content:we.content||""})),{role:"user",content:k.content}]}catch{}let W=k.content,Ce=[];const he=[],Je=Oa(c);if((D=Je==null?void 0:Je.states)!=null&&D.is_indexed)try{const V=await Ca(Je.slug,k.content,N.signal);V.contextBlock&&he.push(V.contextBlock),Array.isArray(V.sources)&&Ce.push(...V.sources)}catch(V){if(At(V))throw V;console.warn("local library enrichment failed",V)}if(ul)try{const ae=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({prompt:k.content,model:ce,messages:I,history_limit:8,searx_url:xt||null,engines:Array.isArray(be)?be:null})})).json();ae&&typeof ae.context_block=="string"&&ae.context_block.trim()&&he.push(ae.context_block.trim()),Array.isArray(ae==null?void 0:ae.sources)&&Ce.push(...ae.sources)}catch(V){if(At(V))throw V;console.warn("web search enrichment failed",V)}if(Ce=[...new Set(Ce)],he.length>0&&(W=`${k.content} +`)}`:B=null,St){const Q=`msg-${Date.now()}-${Math.random()}`;let Ct="";t(X=>X.map(de=>de.session_id===k?{...de,messages:[...de.messages||[],{id:Q,role:"assistant",content:"",sources:I}]}:de));try{const X=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:se,stream:!0,enriched_message:B,sources:I||[]})});if(!X.ok)throw new Error(`HTTP ${X.status}`);const de=(Se=X.body)==null?void 0:Se.getReader();if(!de)throw new Error("Missing response body");const Bt=new TextDecoder;let dt=!1;for(;;){const{value:dn,done:Ep}=await de.read();if(Ep)break;const Cp=Bt.decode(dn,{stream:!0});Ct+=Cp,un(k,Q,Ct),!dt&&Ce.current!==k&&(dt=!0,cn(Xo=>({...Xo,[k]:Q})),jn(Xo=>[...new Set([...Xo,k])]))}Ce.current!==k?(cn(dn=>({...dn,[k]:Q})),jn(dn=>[...new Set([...dn,k])])):Tn.current[k]?$n(dn=>({...dn,[k]:Q})):requestAnimationFrame(()=>On(Q,"smooth",k))}catch(X){if(At(X)){un(k,Q,Ct,{removeIfEmpty:!0});return}console.error(X),un(k,Q,`Error: ${Wo(X)}`,{removeIfEmpty:!0});return}}else{const Q=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({index:c,model:se,stream:!1,enriched_message:B,sources:I||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const Ct=await Q.json(),X=`msg-${Date.now()}`;t(de=>de.map(Bt=>Bt.session_id===k?{...Bt,messages:[...Bt.messages||[],{role:"assistant",content:Ct.reply,id:X,sources:I}]}:Bt)),Ce.current!==k?(cn(de=>({...de,[k]:X})),jn(de=>[...new Set([...de,k])])):Tn.current[k]?$n(de=>({...de,[k]:X})):requestAnimationFrame(()=>On(X,"smooth",k))}}catch(Y){At(Y)||console.error(Y)}finally{Vo(D)}}const[_a,rp]=v.useState({}),Tn=v.useRef({}),[lp,cn]=v.useState({}),fn=v.useRef({}),La=v.useRef({}),[Pa,$n]=v.useState({}),[op,Ra]=v.useState({}),ja=(c,w,k)=>c!=null&&c.id?c.id:`${k}:${w}`;v.useEffect(()=>{var w;if(!n)return;const c=((w=e.find(k=>k.session_id===n))==null?void 0:w.messages)||[];Ra(k=>{const N={};return c.forEach((M,D)=>{if(M.role!=="user")return;const B=ja(M,D,n),W=(M.content||"").split(/\r\n|\r|\n/).length>30;N[B]=W?k[B]??!0:!1}),N})},[e,n]);function ip(c){Ra(w=>({...w,[c]:!(w[c]??!0)}))}const dr=Te.useCallback((c,w)=>{rp(k=>{const N={...k,[c]:w};return Tn.current=N,N})},[]),Mn=v.useRef(null),sp=v.useRef(!1),ap=v.useRef(null),Ce=v.useRef(n);v.useEffect(()=>{Ce.current=n},[n]);const Ta=Te.useCallback(c=>{const w=new AbortController;return Mn.current={controller:w,sessionId:c},Ao(!0),w},[]),Vo=Te.useCallback(c=>{var w;((w=Mn.current)==null?void 0:w.controller)===c&&(Mn.current=null,Ao(!1))},[]),up=Te.useCallback(()=>{const c=Mn.current;c&&(Mn.current=null,c.controller.abort(),Ao(!1))},[]);v.useEffect(()=>()=>{var c;(c=Mn.current)==null||c.controller.abort()},[]);const Ut=v.useRef(null),[cp,fp]=v.useState(230),[pl,$a]=v.useState(!1),dp=Te.useCallback(c=>{$a(!0)},[]),Qo=Te.useCallback(()=>{$a(!1)},[]),Ko=Te.useCallback(c=>{if(pl){const w=Math.max(230,Math.min(500,c.clientX));fp(w)}},[pl]);Te.useEffect(()=>(window.addEventListener("mousemove",Ko),window.addEventListener("mouseup",Qo),()=>{window.removeEventListener("mousemove",Ko),window.removeEventListener("mouseup",Qo)}),[Ko,Qo]),Te.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),Te.useEffect(()=>{const c=async w=>{const k=w.target.closest(".codeblock__copy");if(!k)return;const N=k.closest(".codeblock"),M=N==null?void 0:N.querySelector("pre > code");if(M)try{await navigator.clipboard.writeText(M.textContent||""),k.classList.add("copied"),setTimeout(()=>k.classList.remove("copied"),800)}catch(D){console.error("Copy failed:",D)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),v.useEffect(()=>{window.electronAPI.getSettings().then(w=>{H(w.ollamaApiUrl),fe(w.colorScheme||"Default"),ve(w.chatModel||""),ft(w.streamOutput||!1),ka(w.scrollPositions||{}),qr(w.colorScheme||"Default")});const c=()=>{var w;l==="chats"&&((w=wt.current)==null||w.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),v.useEffect(()=>{qr(ee)},[ee]);const pp=c=>{!c||!$||fetch(`${$}/history?session_id=${encodeURIComponent(c)}`).then(w=>w.json()).then(w=>{t(k=>k.map(N=>N.session_id===c?{...N,messages:w.messages||[]}:N))}).catch(()=>{})};async function hl(){if($)try{const w=await(await fetch(`${$}/libraries`)).json(),k=Array.isArray(w.libraries)?w.libraries:[];if(S(k),k.length===0){h(null);return}k.some(N=>N.slug===_)||h(k[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function bo(){if($)try{const w=await(await fetch(`${$}/jobs`)).json();C(Array.isArray(w.jobs)?w.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function Ma(c=null){const k=(typeof c=="string"?c:j).trim();if(!k){U("Name is required.");return}try{U("");const N=await fetch(`${$}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})});if(!N.ok){const D=await N.text();throw new Error(D||`HTTP ${N.status}`)}const M=await N.json();P(!1),T(""),await hl(),M!=null&&M.slug&&h(M.slug)}catch(N){console.error("Failed to create library",N),U(String((N==null?void 0:N.message)||N))}}v.useEffect(()=>{$&&(Uo(!0),fetch(`${$}/sessions`).then(c=>c.json()).then(c=>{const w=c.sessions.map(k=>({...k,messages:[]}));t(w),w.length>0?r(w[0].session_id):r(null),Uo(!1)}).catch(()=>{Uo(!1)}))},[$]),v.useEffect(()=>{$&&(hl(),bo())},[$]),v.useEffect(()=>{try{localStorage.setItem(pc,JSON.stringify(f||{}))}catch{}},[f]),v.useEffect(()=>{if(!$)return;const c=setInterval(()=>{hl(),bo()},3e3);return()=>clearInterval(c)},[$,l,_]),v.useEffect(()=>{pp(n)},[n]),v.useEffect(()=>{const c=new Set(y.map(w=>w.slug));d(w=>{let k=!1;const N={};for(const[M,D]of Object.entries(w||{}))c.has(D)?N[M]=D:k=!0;return k?N:w})},[y]);const Yo=c=>{o(c)},hp=c=>{wp(c)},zn=v.useMemo(()=>{var c;return((c=e.find(w=>w.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=v.useMemo(()=>y.find(c=>c.slug===_)||null,[_,y]),Et=n&&f[n]||null,nt=v.useMemo(()=>y.find(c=>c.slug===Et)||null,[Et,y]),za=v.useMemo(()=>Et?x.some(c=>c.slug===Et&&(c.status==="queued"||c.status==="running")):!1,[Et,x]),Jo=v.useMemo(()=>{var c,w;return nt?(c=nt.files)!=null&&c.length?(w=nt.states)!=null&&w.is_indexed?"":za?" (syncing)":" (needs sync)":" (empty)":""},[nt,za]);function mp(c){return c&&f[c]||null}function Oa(c){const w=mp(c);return w&&y.find(k=>k.slug===w)||null}function Fa(c){return c?x.some(w=>w.slug===c&&(w.status==="queued"||w.status==="running")):!1}function Ia(c,w){c&&d(k=>{const N={...k||{}};return w?N[c]=w:delete N[c],N})}function gp(c){c&&d(w=>{let k=!1;const N={};for(const[M,D]of Object.entries(w||{})){if(D===c){k=!0;continue}N[M]=D}return k?N:w})}v.useEffect(()=>{if(!R)return;const c=w=>{var k;(k=z.current)!=null&&k.contains(w.target)||A(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[R]),v.useEffect(()=>{A(!1)},[n,l]),v.useEffect(()=>{const c=n,w=l;return()=>{if(w==="chats"&&c){const k=typeof fn.current[c]=="number"?fn.current[c]:Be.current?Be.current.scrollTop:0;ka(N=>{const M={...N,[c]:k};return window.electronAPI.updateSettings({scrollPositions:M}),M})}}},[n,l]),v.useEffect(()=>{const c=Be.current;if(!c)return;const w=()=>{const{scrollTop:k,scrollHeight:N,clientHeight:M}=c,D=N-k-M<=Xv;if(n){const B=La.current[n],I=typeof B=="number"&&kc.removeEventListener("scroll",w)},[n,dr]),v.useEffect(()=>{const c=n;c&&_a[c]===!1&&$n(w=>{if(!(c in w))return w;const k={...w};return delete k[c],k})},[n,_a]),v.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=Be.current;if(!c)return;Ut.current=null;const w=()=>{if(Ut.current===n)return;const B=typeof fn.current[n]=="number"?fn.current[n]:void 0,I=typeof B=="number"?B:cl[n];if(typeof I=="number"){c.scrollTop=I,Ut.current=n;return}zn.length>0&&(c.scrollTop=c.scrollHeight,Ut.current=n)};w();const k=requestAnimationFrame(w),N=()=>{Ut.current!==n&&requestAnimationFrame(w)},M=new MutationObserver(N);M.observe(c,{childList:!0,subtree:!0});const D=new ResizeObserver(N);return D.observe(c),()=>{cancelAnimationFrame(k),M.disconnect(),D.disconnect()}},[n,l,zn.length,cl]),v.useEffect(()=>{if(l!=="chats"||!n||Ut.current===n)return;const c=typeof fn.current[n]=="number"?fn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&zn.length>0&&requestAnimationFrame(()=>{const k=Be.current;k&&(k.scrollTop=k.scrollHeight,Ut.current=n)})},[zn.length,n,l,cl]);const Go=(c="smooth",w=null)=>{const k=Be.current;if(!k)return;const N=w??Ce.current;Ce.current===N&&(k.scrollTo({top:k.scrollHeight,behavior:c}),dr(N,!1))},On=(c,w="auto",k=null)=>{const N=Be.current;if(!N)return;const M=k??Ce.current;if(Ce.current!==M)return;const D=document.getElementById(c);if(D){const B=Math.max(0,D.offsetTop-Gv);N.scrollTo({top:B,behavior:w})}},vp=()=>{const c=Ce.current,w=Pa[c];w&&(On(w,"smooth",c),$n(k=>{const{[c]:N,...M}=k;return M}))};async function Da(){var M,D,B;if(Dt||!Rn.trim()||!se)return;let c=n,w=!1;if(c){const I=e.find(W=>W.session_id===c);w=I&&I.name==="New Chat"&&I.messages.length===0}else{const I=await Aa();await new Promise(W=>setTimeout(W,200)),c=I.session_id,w=!0}const k={role:"user",content:Rn.trim(),id:`msg-${Date.now()}-${Math.random()}`};sp.current=!0,ap.current=c,dr(c,!1),Ce.current===c&&(Ut.current=Ce.current),Ld.flushSync(()=>{t(I=>I.map(W=>W.session_id===c?{...W,messages:[...W.messages||[],k]}:W)),al("")}),requestAnimationFrame(()=>Go("auto",c));const N=Ta(c);try{let I=[];try{I=[...(((M=e.find(Se=>Se.session_id===c))==null?void 0:M.messages)||[]).slice(-8).map(Se=>({role:Se.role,content:Se.content||""})),{role:"user",content:k.content}]}catch{}let W=k.content,Ne=[];const he=[],Je=Oa(c);if((D=Je==null?void 0:Je.states)!=null&&D.is_indexed)try{const V=await Ca(Je.slug,k.content,N.signal);V.contextBlock&&he.push(V.contextBlock),Array.isArray(V.sources)&&Ne.push(...V.sources)}catch(V){if(At(V))throw V;console.warn("local library enrichment failed",V)}if(ul)try{const ue=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({prompt:k.content,model:se,messages:I,history_limit:8,searx_url:xt||null,engines:Array.isArray(Ye)?Ye:null})})).json();ue&&typeof ue.context_block=="string"&&ue.context_block.trim()&&he.push(ue.context_block.trim()),Array.isArray(ue==null?void 0:ue.sources)&&Ne.push(...ue.sources)}catch(V){if(At(V))throw V;console.warn("web search enrichment failed",V)}if(Ne=[...new Set(Ne)],he.length>0&&(W=`${k.content} ${he.join(` -`)}`),St){const V=`msg-${Date.now()}-${Math.random()}`;let ae="";const we={role:"assistant",content:"",id:V,sources:Ce};t(b=>b.map(ne=>ne.session_id===c?{...ne,messages:[...ne.messages||[],we]}:ne));try{const b=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:ce,message:k.content,enriched_message:he.length>0?W:null,stream:!0,sources:Ce||[]})});if(!b.ok)throw new Error(`HTTP ${b.status}`);const ne=(U=b.body)==null?void 0:U.getReader();if(!ne)throw new Error("Missing response body");const Q=new TextDecoder;let Ct=!1;for(;;){const{value:X,done:de}=await ne.read();if(de){un(c,V,ae),Ee.current===c?Tn.current[c]?$n(dt=>({...dt,[c]:V})):requestAnimationFrame(()=>On(V,"smooth",c)):(cn(dt=>({...dt,[c]:V})),jn(dt=>[...new Set([...dt,c])]));break}const Bt=Q.decode(X,{stream:!0});ae+=Bt,un(c,V,ae),Ee.current===c&&!Tn.current[c]&&Go("auto",c),Ee.current!==c&&!Ct&&(cn(dt=>({...dt,[c]:V})),Ct=!0)}}catch(b){if(At(b)){un(c,V,ae,{removeIfEmpty:!0});return}console.error("Failed to send message:",b),un(c,V,"Error: "+Wo(b),{removeIfEmpty:!0});return}}else{const V=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:ce,message:k.content,enriched_message:he.length>0?W:null,stream:!1,sources:Ce||[]})});if(!V.ok)throw new Error(`HTTP ${V.status}`);const ae=await V.json(),we=`msg-${Date.now()}`,b={role:"assistant",content:ae.reply,id:we,sources:Ce};t(ne=>ne.map(Q=>Q.session_id===c?{...Q,messages:[...Q.messages||[],b]}:Q)),we&&(Ee.current===c?Tn.current[c]?$n(ne=>({...ne,[c]:we})):requestAnimationFrame(()=>On(we,"smooth",c)):cn(ne=>({...ne,[c]:we})))}Ee.current!==c&&jn(V=>[...new Set([...V,c])]),w&&fetch(`${$}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:k.content,model:ce})}).then(V=>V.json()).then(V=>{const ae=V.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(we=>we.map(b=>b.session_id===c?{...b,name:ae}:b))})}catch(I){if(At(I)){Vo(N);return}console.error("Failed to send message:",I);const W={role:"assistant",content:"Error: "+Wo(I),id:`msg-${Date.now()}-${Math.random()}`};t(Ce=>Ce.map(he=>he.session_id===c?{...he,messages:[...he.messages,W]}:he))}finally{Vo(N)}}function yp(){Xd(c=>!c)}async function Aa(){var M;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),k=await(await fetch(`${$}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),N={...k,messages:[]};return t(D=>[N,...D]),r(k.session_id),(M=wt.current)==null||M.focus(),k}function wp(c){r(c),jn(k=>k.filter(N=>N!==c));const w=lp[c];w&&requestAnimationFrame(()=>{let k=12;const N=()=>{if(!Be.current)return;let D=document.getElementById(w);if(!D){const U=e.find(I=>I.session_id===c);if(U&&Array.isArray(U.messages))for(let I=U.messages.length-1;I>=0;I--){const W=U.messages[I];if(W.role==="assistant"&&W.id){D=document.getElementById(W.id);break}}}D?(On(D.id,"smooth",c),cn(U=>{const{[c]:I,...W}=U;return W})):k-- >0&&requestAnimationFrame(N)};requestAnimationFrame(N)})}function Sp(c,w){fetch(`${$}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})}).then(()=>{t(k=>k.map(N=>N.session_id===c?{...N,name:w}:N)),u(null)})}function xp(c,w){const k=(w||"").trim(),N=v.find(M=>M.slug===c);if(!N){m(null);return}if(!k||k===N.name){m(null);return}fetch(`${$}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})}).then(()=>{S(M=>M.map(D=>D.slug===c?{...D,name:k}:D)),m(null)})}function Ua(c){fetch(`${$}/sessions/${c}`,{method:"DELETE"}).then(()=>{const w=e.filter(k=>k.session_id!==c);t(w),d(k=>{const N={...k||{}};return delete N[c],N}),n===c&&r(w.length>0?w[0].session_id:null)})}g.useEffect(()=>{const c=e.filter(w=>w.name==="New Chat"&&w.session_id!==n&&w.messages.length===0);c.length>0&&c.forEach(w=>{Ua(w.session_id)})},[n,e,$]);const kp=c=>{var k;window.getSelection().toString().length>0||document.activeElement!==wt.current&&(c.target.closest(".msg")||(k=wt.current)==null||k.focus())};return y.jsxs("div",{className:"app",style:{gridTemplateColumns:`${cp}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:()=>bo("chats"),children:"Chats"}),y.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>bo("dbs"),children:"DBs"}),y.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>bo("settings"),children:"Settings"})]}),y.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&y.jsx("div",{className:"chat-list",children:e.map(c=>y.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>hp(c.session_id),children:s===c.session_id?y.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:w=>{w.key==="Enter"?Sp(c.session_id,w.target.value):w.key==="Escape"&&u(null)},autoFocus:!0}):y.jsxs(y.Fragment,{children:[y.jsx("span",{children:c.name}),y.jsxs("div",{className:"chat-item-buttons",children:[Zd.includes(c.session_id)&&y.jsx("div",{className:"unread-dot"}),y.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),u(c.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:w=>{w.stopPropagation(),Ua(c.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"})]})})]})]})},c.session_id))}),l==="dbs"&&y.jsx("div",{className:"db-list",children:v.length===0?y.jsx("div",{className:"empty-list-message",children:"No databases yet."}):v.map(c=>y.jsx("div",{className:`chat-item ${c.slug===_?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?y.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>m(null),onKeyDown:w=>{w.key==="Enter"?xp(c.slug,w.target.value):w.key==="Escape"&&m(null)},autoFocus:!0}):y.jsxs(y.Fragment,{children:[y.jsx("span",{children:c.name}),y.jsxs("div",{className:"chat-item-buttons",children:[Et===c.slug&&y.jsx("div",{className:"db-active-badge",children:"Chat"}),Fa(c.slug)&&y.jsx("div",{className:"db-active-badge",children:"Syncing"}),y.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),m(c.slug)},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"})})})]})]})},c.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:Aa,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:c=>T(c.target.value),onKeyDown:c=>{c.key==="Enter"?Ma():c.key==="Escape"&&(P(!1),T(""),A(""))},placeholder:"Database name",autoFocus:!0}),F&&y.jsx("div",{className:"form-error",children:F}),y.jsxs("div",{className:"new-db-actions",children:[y.jsx("button",{className:"button new-db-button",onClick:()=>Ma(),children:"Create"}),y.jsx("button",{className:"button ghost",onClick:()=>{P(!1),T(""),A("")},children:"Cancel"})]})]}):y.jsx("button",{className:"button new-db-button",onClick:()=>{P(!0),A("")},children:"New Database"}))]}),y.jsx("div",{className:"resizer",onMouseDown:dp})]}),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 - ",((Ba=e.find(c=>c.session_id===n))==null?void 0:Ba.name)||"New Chat"]}),nt&&y.jsx("span",{className:"header-subtle",children:`DB: ${nt.name}${Jo}`})]}),y.jsx("div",{className:"chat",ref:Be,onClick:kp,children:zn.map((c,w)=>{const k=c.role==="user"&&qd===w;return y.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(k?" editing":""),children:c.role==="assistant"?y.jsxs("div",{className:"assistant-message-wrapper",children:[y.jsx(Yv,{content:c.content,streamOutput:St,sources:c.sources}),!Dt&&y.jsxs("div",{className:"message-options-bar assistant-options",children:[y.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ea(c),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:()=>Na(w),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:[k?y.jsxs("div",{className:"msg-content msg-content--user editing",children:[y.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ho}),y.jsx(sc,{className:"edit-message-input edit-overlay",value:Ho,onChange:N=>fl(N.target.value),onBlur:dl,onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),dl()),N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),np(w))},autoFocus:!0,minRows:1})]}):(()=>{const N=c.content||"",M=N.split(/\r\n|\r|\n/),D=M.length>30,U=ja(c,w,n),I=D?op[U]??!0:!1,W=I?M.slice(0,30).join(` +`)}`),St){const V=`msg-${Date.now()}-${Math.random()}`;let ue="";const Se={role:"assistant",content:"",id:V,sources:Ne};t(Y=>Y.map(ne=>ne.session_id===c?{...ne,messages:[...ne.messages||[],Se]}:ne));try{const Y=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:se,message:k.content,enriched_message:he.length>0?W:null,stream:!0,sources:Ne||[]})});if(!Y.ok)throw new Error(`HTTP ${Y.status}`);const ne=(B=Y.body)==null?void 0:B.getReader();if(!ne)throw new Error("Missing response body");const Q=new TextDecoder;let Ct=!1;for(;;){const{value:X,done:de}=await ne.read();if(de){un(c,V,ue),Ce.current===c?Tn.current[c]?$n(dt=>({...dt,[c]:V})):requestAnimationFrame(()=>On(V,"smooth",c)):(cn(dt=>({...dt,[c]:V})),jn(dt=>[...new Set([...dt,c])]));break}const Bt=Q.decode(X,{stream:!0});ue+=Bt,un(c,V,ue),Ce.current===c&&!Tn.current[c]&&Go("auto",c),Ce.current!==c&&!Ct&&(cn(dt=>({...dt,[c]:V})),Ct=!0)}}catch(Y){if(At(Y)){un(c,V,ue,{removeIfEmpty:!0});return}console.error("Failed to send message:",Y),un(c,V,"Error: "+Wo(Y),{removeIfEmpty:!0});return}}else{const V=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:se,message:k.content,enriched_message:he.length>0?W:null,stream:!1,sources:Ne||[]})});if(!V.ok)throw new Error(`HTTP ${V.status}`);const ue=await V.json(),Se=`msg-${Date.now()}`,Y={role:"assistant",content:ue.reply,id:Se,sources:Ne};t(ne=>ne.map(Q=>Q.session_id===c?{...Q,messages:[...Q.messages||[],Y]}:Q)),Se&&(Ce.current===c?Tn.current[c]?$n(ne=>({...ne,[c]:Se})):requestAnimationFrame(()=>On(Se,"smooth",c)):cn(ne=>({...ne,[c]:Se})))}Ce.current!==c&&jn(V=>[...new Set([...V,c])]),w&&fetch(`${$}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:k.content,model:se})}).then(V=>V.json()).then(V=>{const ue=V.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(Se=>Se.map(Y=>Y.session_id===c?{...Y,name:ue}:Y))})}catch(I){if(At(I)){Vo(N);return}console.error("Failed to send message:",I);const W={role:"assistant",content:"Error: "+Wo(I),id:`msg-${Date.now()}-${Math.random()}`};t(Ne=>Ne.map(he=>he.session_id===c?{...he,messages:[...he.messages,W]}:he))}finally{Vo(N)}}function yp(){Xd(c=>!c)}async function Aa(){var M;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),k=await(await fetch(`${$}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),N={...k,messages:[]};return t(D=>[N,...D]),r(k.session_id),(M=wt.current)==null||M.focus(),k}function wp(c){r(c),jn(k=>k.filter(N=>N!==c));const w=lp[c];w&&requestAnimationFrame(()=>{let k=12;const N=()=>{if(!Be.current)return;let D=document.getElementById(w);if(!D){const B=e.find(I=>I.session_id===c);if(B&&Array.isArray(B.messages))for(let I=B.messages.length-1;I>=0;I--){const W=B.messages[I];if(W.role==="assistant"&&W.id){D=document.getElementById(W.id);break}}}D?(On(D.id,"smooth",c),cn(B=>{const{[c]:I,...W}=B;return W})):k-- >0&&requestAnimationFrame(N)};requestAnimationFrame(N)})}function Sp(c,w){fetch(`${$}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w})}).then(()=>{t(k=>k.map(N=>N.session_id===c?{...N,name:w}:N)),u(null)})}function xp(c,w){const k=(w||"").trim(),N=y.find(M=>M.slug===c);if(!N){m(null);return}if(!k||k===N.name){m(null);return}fetch(`${$}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})}).then(()=>{S(M=>M.map(D=>D.slug===c?{...D,name:k}:D)),m(null)})}function Ua(c){fetch(`${$}/sessions/${c}`,{method:"DELETE"}).then(()=>{const w=e.filter(k=>k.session_id!==c);t(w),d(k=>{const N={...k||{}};return delete N[c],N}),n===c&&r(w.length>0?w[0].session_id:null)})}v.useEffect(()=>{const c=e.filter(w=>w.name==="New Chat"&&w.session_id!==n&&w.messages.length===0);c.length>0&&c.forEach(w=>{Ua(w.session_id)})},[n,e,$]);const kp=c=>{var k;window.getSelection().toString().length>0||document.activeElement!==wt.current&&(c.target.closest(".msg")||(k=wt.current)==null||k.focus())};return g.jsxs("div",{className:"app",style:{gridTemplateColumns:`${cp}px 1fr`},children:[g.jsxs("div",{className:"sidebar",children:[g.jsxs("div",{className:"sidebar-header",children:[g.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Yo("chats"),children:"Chats"}),g.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Yo("dbs"),children:"DBs"}),g.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Yo("settings"),children:"Settings"})]}),g.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&g.jsx("div",{className:"chat-list",children:e.map(c=>g.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>hp(c.session_id),children:s===c.session_id?g.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:w=>{w.key==="Enter"?Sp(c.session_id,w.target.value):w.key==="Escape"&&u(null)},autoFocus:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{children:c.name}),g.jsxs("div",{className:"chat-item-buttons",children:[Zd.includes(c.session_id)&&g.jsx("div",{className:"unread-dot"}),g.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),u(c.session_id)},children:g.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:g.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),g.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),Ua(c.session_id)},children:g.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:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&g.jsx("div",{className:"db-list",children:y.length===0?g.jsx("div",{className:"empty-list-message",children:"No databases yet."}):y.map(c=>g.jsx("div",{className:`chat-item ${c.slug===_?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?g.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>m(null),onKeyDown:w=>{w.key==="Enter"?xp(c.slug,w.target.value):w.key==="Escape"&&m(null)},autoFocus:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{children:c.name}),g.jsxs("div",{className:"chat-item-buttons",children:[Et===c.slug&&g.jsx("div",{className:"db-active-badge",children:"Chat"}),Fa(c.slug)&&g.jsx("div",{className:"db-active-badge",children:"Syncing"}),g.jsx("button",{className:"icon-button",onClick:w=>{w.stopPropagation(),m(c.slug)},children:g.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:g.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})})]})]})},c.slug))}),l==="settings"&&g.jsxs("div",{className:"settings-list",children:[g.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),g.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),g.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&g.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&g.jsx("button",{className:"button new-chat-button",onClick:Aa,children:"New Chat"}),l==="dbs"&&(E?g.jsxs("div",{className:"new-db-form",children:[g.jsx("input",{type:"text",className:"rename-input",value:j,onChange:c=>T(c.target.value),onKeyDown:c=>{c.key==="Enter"?Ma():c.key==="Escape"&&(P(!1),T(""),U(""))},placeholder:"Database name",autoFocus:!0}),F&&g.jsx("div",{className:"form-error",children:F}),g.jsxs("div",{className:"new-db-actions",children:[g.jsx("button",{className:"button new-db-button",onClick:()=>Ma(),children:"Create"}),g.jsx("button",{className:"button ghost",onClick:()=>{P(!1),T(""),U("")},children:"Cancel"})]})]}):g.jsx("button",{className:"button new-db-button",onClick:()=>{P(!0),U("")},children:"New Database"}))]}),g.jsx("div",{className:"resizer",onMouseDown:dp})]}),g.jsxs("div",{className:"main-content",children:[l==="chats"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"header",children:[g.jsxs("strong",{children:["Chat - ",((Ba=e.find(c=>c.session_id===n))==null?void 0:Ba.name)||"New Chat"]}),nt&&g.jsx("span",{className:"header-subtle",children:`DB: ${nt.name}${Jo}`})]}),g.jsx("div",{className:"chat",ref:Be,onClick:kp,children:zn.map((c,w)=>{const k=c.role==="user"&&qd===w;return g.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(k?" editing":""),children:c.role==="assistant"?g.jsxs("div",{className:"assistant-message-wrapper",children:[g.jsx(Yv,{content:c.content,streamOutput:St,sources:c.sources}),!Dt&&g.jsxs("div",{className:"message-options-bar assistant-options",children:[g.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ea(c),children:g.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:[g.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),g.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),g.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>Na(w),children:g.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:g.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"})})})]})]}):g.jsxs("div",{className:"user-message-wrapper",children:[k?g.jsxs("div",{className:"msg-content msg-content--user editing",children:[g.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ho}),g.jsx(sc,{className:"edit-message-input edit-overlay",value:Ho,onChange:N=>fl(N.target.value),onBlur:dl,onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),dl()),N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),np(w))},autoFocus:!0,minRows:1})]}):(()=>{const N=c.content||"",M=N.split(/\r\n|\r|\n/),D=M.length>30,B=ja(c,w,n),I=D?op[B]??!0:!1,W=I?M.slice(0,30).join(` `)+` -…`:N;return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"msg-content msg-content--user",children:W}),D&&y.jsx("button",{className:"user-msg-expand",onClick:()=>ip(U),"aria-expanded":I?"false":"true",children:I?"Show entire message":"Collapse"})]})})(),!Dt&&!k&&y.jsxs("div",{className:"message-options-bar user-options",children:[y.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>tp(w,c.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:()=>Ea(c),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"})]})})]})]})},c.id||w)})},n),Pa[n]&&y.jsxs("button",{className:"new-msg-tip",onClick:vp,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(sc,{ref:wt,className:"input",value:Rn,onChange:c=>al(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Da())},placeholder:"Ask any question...",maxRows:13}),y.jsxs("div",{className:"footer-tool-group",ref:z,children:[y.jsx("button",{type:"button",className:"db-picker-toggle"+(nt?" active":""),onClick:()=>{n&&H(c=>!c)},title:nt?`Database: ${nt.name}${Jo}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":R,disabled:!n,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("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),y.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),y.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),R&&y.jsxs("div",{className:"db-picker-menu",role:"menu",children:[y.jsxs("button",{type:"button",className:"db-picker-option"+(Et?"":" selected"),onClick:()=>{Ia(n,null),H(!1)},children:[y.jsx("span",{children:"No database"}),!Et&&y.jsx("span",{className:"db-picker-status",children:"Selected"})]}),v.length===0?y.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):v.map(c=>{var M,D,U;const w=Et===c.slug,k=Fa(c.slug),N=(M=c.files)!=null&&M.length?(D=c.states)!=null&&D.is_indexed?"Ready":k?"Syncing":"Needs sync":"Empty";return y.jsxs("button",{type:"button",className:"db-picker-option"+(w?" selected":""),disabled:!((U=c.files)!=null&&U.length),onClick:()=>{Ia(n,c.slug),H(!1)},children:[y.jsx("span",{children:c.name}),y.jsx("span",{className:"db-picker-status",children:w?"Selected":N})]},c.slug)})]})]}),y.jsx("button",{type:"button",className:"websearch-toggle"+(ul?" active":""),onClick:yp,title:"Toggle web search","aria-pressed":ul,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:Dt?up:Da,title:Dt?"Cancel generation":"Send","aria-label":Dt?"Cancel generation":"Send",children:Dt?y.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"header",children:[y.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),nt&&y.jsx("span",{className:"header-subtle",children:`Current chat DB: ${nt.name}${Jo}`})]}),y.jsx(Vv,{apiBase:$,library:ml,jobs:x,onRefresh:async()=>{await hl(),await Yo()},onDeleted:c=>{if(_===c){const w=v.find(k=>k.slug!==c);h((w==null?void 0:w.slug)||null)}gp(c)}})]}),l==="settings"&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"header",children:y.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&y.jsx(Dv,{onModelChange:Re,streamOutput:St,onStreamOutputChange:ft}),i==="Interface"&&y.jsx(Hv,{}),i==="Websearch"&&y.jsx(Qv,{searxUrl:xt,setSearxUrl:kt,engines:be,setEngines:Gd})]})]})]})}function Zv(){return g.useEffect(()=>{window.electronAPI.getSettings().then(e=>{qr(e.colorScheme||"Default")})},[]),y.jsx(Te.StrictMode,{children:y.jsx(cv,{children:y.jsx(Bg,{children:y.jsx(Ud,{path:"/",element:y.jsx(Xv,{})})})})})}const qv=Pd(document.getElementById("root"));qv.render(y.jsx(Zv,{})); +…`:N;return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"msg-content msg-content--user",children:W}),D&&g.jsx("button",{className:"user-msg-expand",onClick:()=>ip(B),"aria-expanded":I?"false":"true",children:I?"Show entire message":"Collapse"})]})})(),!Dt&&!k&&g.jsxs("div",{className:"message-options-bar user-options",children:[g.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>tp(w,c.content),children:g.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:[g.jsx("path",{d:"M12 20h9"}),g.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),g.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ea(c),children:g.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:[g.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),g.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||w)})},n),Pa[n]&&g.jsxs("button",{className:"new-msg-tip",onClick:vp,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",g.jsx("span",{style:{marginLeft:6},children:"↓"})]}),g.jsx("div",{className:"footer",children:g.jsxs("div",{className:"footer-content-wrapper",children:[g.jsx(sc,{ref:wt,className:"input",value:Rn,onChange:c=>al(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Da())},placeholder:"Ask any question...",maxRows:13}),g.jsxs("div",{className:"footer-tool-group",ref:z,children:[g.jsx("button",{type:"button",className:"db-picker-toggle"+(nt?" active":""),onClick:()=>{n&&A(c=>!c)},title:nt?`Database: ${nt.name}${Jo}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":R,disabled:!n,children:g.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:[g.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),g.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),g.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),R&&g.jsxs("div",{className:"db-picker-menu",role:"menu",children:[g.jsxs("button",{type:"button",className:"db-picker-option"+(Et?"":" selected"),onClick:()=>{Ia(n,null),A(!1)},children:[g.jsx("span",{children:"No database"}),!Et&&g.jsx("span",{className:"db-picker-status",children:"Selected"})]}),y.length===0?g.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):y.map(c=>{var M,D,B;const w=Et===c.slug,k=Fa(c.slug),N=(M=c.files)!=null&&M.length?(D=c.states)!=null&&D.is_indexed?"Ready":k?"Syncing":"Needs sync":"Empty";return g.jsxs("button",{type:"button",className:"db-picker-option"+(w?" selected":""),disabled:!((B=c.files)!=null&&B.length),onClick:()=>{Ia(n,c.slug),A(!1)},children:[g.jsx("span",{children:c.name}),g.jsx("span",{className:"db-picker-status",children:w?"Selected":N})]},c.slug)})]})]}),g.jsx("button",{type:"button",className:"websearch-toggle"+(ul?" active":""),onClick:yp,title:"Toggle web search","aria-pressed":ul,children:g.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:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),g.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"})]})}),g.jsx("button",{className:"button",onClick:Dt?up:Da,title:Dt?"Cancel generation":"Send","aria-label":Dt?"Cancel generation":"Send",children:Dt?g.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"header",children:[g.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),nt&&g.jsx("span",{className:"header-subtle",children:`Current chat DB: ${nt.name}${Jo}`})]}),g.jsx(Qv,{apiBase:$,library:ml,jobs:x,onRefresh:async()=>{await hl(),await bo()},onDeleted:c=>{if(_===c){const w=y.find(k=>k.slug!==c);h((w==null?void 0:w.slug)||null)}gp(c)}})]}),l==="settings"&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"header",children:g.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&g.jsx(Dv,{onModelChange:ve,streamOutput:St,onStreamOutputChange:ft}),i==="Interface"&&g.jsx(Hv,{}),i==="Websearch"&&g.jsx(Kv,{searxUrl:xt,setSearxUrl:kt,engines:Ye,setEngines:Gd})]})]})]})}function qv(){return v.useEffect(()=>{window.electronAPI.getSettings().then(e=>{qr(e.colorScheme||"Default")})},[]),g.jsx(Te.StrictMode,{children:g.jsx(cv,{children:g.jsx(Bg,{children:g.jsx(Ud,{path:"/",element:g.jsx(Zv,{})})})})})}const ey=Pd(document.getElementById("root"));ey.render(g.jsx(qv,{})); diff --git a/dist/index.html b/dist/index.html index b7d83ca..5a19a6e 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,8 @@ LLM Desktop - - + +