Spaces:
Sleeping
Sleeping
Auto-clear uploads on app start and switch to query tab after upload
Browse files- Files are cleared when app loads (clean slate each session)
- After successful file upload, auto-switches to Query tab after 1 second
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
frontend/dist/assets/{index-BRxIAB5u.js β index-I0eAJ0hd.js}
RENAMED
|
@@ -9,7 +9,7 @@ Error generating stack: `+e.message+`
|
|
| 9 |
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:rn(e,r,a);break;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=on.get(n)||n,Lt(e,n,r))}}function Nd(e,t,n,r,i,a){switch(n){case`style`:rn(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[_t]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,a,o,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:$(e,t,r,d,n,null)}}Yt(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(o in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:$(e,t,o,c,n,null)}$t(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:o=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Jt(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:o=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&$(e,t,o,i,r,a)}Qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=E.d;E.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?js(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),k(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),k(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),k(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Ot(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);k(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),k(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),k(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=_e.current)?gf(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var a=Ot(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(jf(e)))&&!a._p&&(o.instance=a,o.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),a||Nf(i,e,n,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Af(e){return`href="`+qt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),k(t),e.head.appendChild(t))}function Pf(e){return`[src="`+qt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,k(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),k(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var a=e.querySelector(jf(i));if(a)return t.state.loading|=4,t.instance=a,k(a),a;r=Mf(n),(i=mf.get(i))&&Rf(r,i),a=(e.ownerDocument||e).createElement(`link`),k(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),t.state.loading|=4,Lf(a,n.precedence,e),t.instance=a;case`script`:return a=Pf(n.src),(i=e.querySelector(Ff(a)))?(t.instance=i,k(i),i):(r=n,(i=mf.get(a))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),k(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,k(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),k(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function tp(e){return e?(e=hi,e):hi}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(hu(n,e,t),Qa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=dt(t);var n=fi(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=2,up(e,t,n,r)}finally{E.p=a,T.T=i}}function lp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=8,up(e,t,n,r)}finally{E.p=a,T.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=et(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-qe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(W&6)&&(nu=Fe()+500,id(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=dn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=Tt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ie()){case Le:return 2;case Re:return 8;case ze:case Be:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=Tt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,mt(e.priority,function(){op(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,mt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Et(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[vt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=r.version;if(Lp!==`19.2.4`)throw Error(s(527,Lp,`19.2.4`));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:T,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{We=zp.inject(Rp),Ge=zp}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=Qs,a=$s,o=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,a,o,Pp),e[vt]=t.current,Sd(e),new Fp(t)}})),c=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()}))(),l=n(),u=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),d=e(((e,t)=>{t.exports=u()}))(),f=`/api`,p=({className:e=``})=>(0,d.jsx)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z`})}),m=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,d.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),h=()=>(0,d.jsx)(`svg`,{className:`w-5 h-5 text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),g=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,d.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),_=()=>(0,d.jsx)(`svg`,{className:`w-4 h-4`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),v=()=>(0,d.jsx)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),y=()=>(0,d.jsxs)(`svg`,{className:`w-6 h-6`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,d.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,d.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),b=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,d.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,d.jsx)(`line`,{x1:`16`,y1:`13`,x2:`8`,y2:`13`}),(0,d.jsx)(`line`,{x1:`16`,y1:`17`,x2:`8`,y2:`17`})]}),x=()=>(0,d.jsxs)(`svg`,{className:`w-4 h-4`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,d.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}),ee=[`When was Python released and who created it?`,`What caused World War I?`,`Tell me about artificial intelligence history.`,`How does the human body work?`,`What is climate change and what causes it?`,`Tell me about the Renaissance period.`,`How did the internet develop?`,`Tell me about quantum physics.`];function S({label:e,value:t,color:n=`text-indigo-400`}){return(0,d.jsxs)(`div`,{className:`bg-slate-800/60 border border-slate-700/50 rounded-xl p-4 text-center backdrop-blur-sm`,children:[(0,d.jsx)(`p`,{className:`text-2xl font-bold ${n}`,children:t}),(0,d.jsx)(`p`,{className:`text-xs text-slate-400 mt-1 uppercase tracking-wider`,children:e})]})}function C({claim:e}){let[t,n]=(0,l.useState)(!1),r=e.is_supported;return(0,d.jsxs)(`div`,{className:`rounded-xl border p-4 transition-all duration-200 ${r?`border-emerald-500/30 bg-emerald-950/20`:`border-red-500/30 bg-red-950/20`}`,children:[(0,d.jsxs)(`div`,{className:`flex items-start gap-3 cursor-pointer`,onClick:()=>n(!t),children:[(0,d.jsx)(`div`,{className:`mt-0.5`,children:r?(0,d.jsx)(h,{}):(0,d.jsx)(g,{})}),(0,d.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-slate-200 leading-relaxed`,children:e.text}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-slate-400`,children:[(0,d.jsxs)(`span`,{children:[`Similarity: `,(0,d.jsxs)(`strong`,{className:r?`text-emerald-400`:`text-red-400`,children:[(e.similarity_score*100).toFixed(1),`%`]})]}),(0,d.jsx)(`span`,{className:`opacity-40`,children:`|`}),(0,d.jsxs)(`span`,{children:[`Entailment: `,(0,d.jsx)(`strong`,{className:e.entailment_label===`ENTAILED`?`text-emerald-400`:`text-amber-400`,children:e.entailment_label})]})]})]}),(0,d.jsx)(`div`,{className:`transition-transform duration-200 ${t?`rotate-180`:``}`,children:(0,d.jsx)(_,{})})]}),t&&e.best_evidence&&(0,d.jsxs)(`div`,{className:`mt-3 ml-8 p-3 bg-slate-800/50 rounded-lg border border-slate-700/40 text-xs text-slate-300 leading-relaxed`,children:[(0,d.jsx)(`p`,{className:`text-[10px] uppercase tracking-widest text-slate-500 mb-1 font-semibold`,children:`Best Evidence`}),e.best_evidence]})]})}function te({ev:e,idx:t}){return(0,d.jsxs)(`div`,{className:`bg-slate-800/40 border border-slate-700/40 rounded-lg p-3`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-slate-400 mb-1`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-blue-400`,children:[`#`,t+1,` β `,e.source]}),(0,d.jsxs)(`span`,{children:[`Score: `,(e.similarity_score*100).toFixed(1),`%`]})]}),(0,d.jsx)(`p`,{className:`text-xs text-slate-300 leading-relaxed`,children:e.content})]})}function ne({text:e}){return e.startsWith(`Comparison between`)?(0,d.jsx)(re,{text:e}):/^\d+\s+students\s+have|^Students with .* found\):/i.test(e)||/^\s*\d+\.\s+/m.test(e)?(0,d.jsx)(w,{text:e}):/^(Details for|For )\S/i.test(e)?(0,d.jsx)(ie,{text:e}):(0,d.jsx)(`p`,{className:`text-slate-200 leading-relaxed whitespace-pre-line`,children:e})}function re({text:e}){let t=e.split(`
|
| 10 |
`).filter(e=>e.trim()),n=t[0].match(/Comparison between (.+?) and (.+?):/),r=n?.[1]||`Student 1`,i=n?.[2]||`Student 2`,a=[],o=[];for(let e=1;e<t.length;e++){let n=t[e].match(/^\s*(.+?):\s*([\d.]+)\s+vs\s+([\d.]+)\s*(.*)/);if(n){let[,e,t,r,i]=n;a.push({subject:e.trim(),v1:parseFloat(t),v2:parseFloat(r),marker:i.trim()})}else t[e].match(/^Comparison between/)||o.push(t[e].trim())}return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`bg-slate-700/40 text-slate-300`,children:[(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold`,children:`Subject`}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:r}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:i}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:`Result`})]})}),(0,d.jsx)(`tbody`,{children:a.map((e,t)=>{let n=e.v1-e.v2,r=n>0?`text-emerald-400 font-semibold`:n<0?`text-red-400`:`text-slate-300`,i=n<0?`text-emerald-400 font-semibold`:n>0?`text-red-400`:`text-slate-300`,a=n>0?(0,d.jsxs)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400`,children:[`+`,n.toFixed(1)]}):n<0?(0,d.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-red-500/20 text-red-400`,children:n.toFixed(1)}):(0,d.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-slate-600/40 text-slate-400`,children:`Equal`});return(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-300 font-medium`,children:e.subject}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center ${r}`,children:e.v1}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center ${i}`,children:e.v2}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center`,children:a})]},t)})})]})}),o.length>0&&(0,d.jsx)(`div`,{className:`bg-slate-700/30 rounded-xl px-4 py-3 text-sm text-slate-300 space-y-1`,children:o.map((e,t)=>(0,d.jsx)(`p`,{children:e},t))})]})}function w({text:e}){let t=e.split(`
|
| 11 |
`).filter(e=>e.trim()),n=t[0],r=t.slice(1).filter(e=>/^\s*\d+\./.test(e)),i=t.slice(1).filter(e=>!/^\s*\d+\./.test(e));return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`p`,{className:`text-slate-200 font-medium`,children:n}),r.length>0&&(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`bg-slate-700/40 text-slate-300`,children:[(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold w-10`,children:`#`}),(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold`,children:`Name`}),(0,d.jsx)(`th`,{className:`text-right px-4 py-2.5 font-semibold`,children:`Value`})]})}),(0,d.jsx)(`tbody`,{children:r.map((e,t)=>{let n=e.match(/^\s*(\d+)\.\s+(.+?)\s*[ββ-]\s*([\d.]+)/);return n?(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-500`,children:n[1]}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-200`,children:n[2].trim()}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-right text-indigo-400 font-semibold`,children:n[3]})]},t):null})})]})}),i.map((e,t)=>(0,d.jsx)(`p`,{className:`text-sm text-slate-400`,children:e},t))]})}function ie({text:e}){let t=e.split(`
|
| 12 |
-
`).filter(e=>e.trim()),n=t[0],r=t.slice(1).filter(e=>e.includes(`:`));return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`p`,{className:`text-slate-200 font-medium`,children:n}),r.length>0&&(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsx)(`table`,{className:`w-full text-sm`,children:(0,d.jsx)(`tbody`,{children:r.map((e,t)=>{let n=e.match(/^\s*-?\s*(.+?):\s*(.+)/);return n?(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-400 font-medium w-1/3`,children:n[1].trim()}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-200 font-semibold`,children:n[2].trim()})]},t):null})})})})]})}function ae({onStatusChange:e}){let[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)([]),[a,o]=(0,l.useState)(!1),[s,c]=(0,l.useState)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>{fetch(`${f}/status`).then(e=>e.json()).then(e=>{i(e.uploaded_files.map(e=>({name:e,status:`done`})))}).catch(()=>{})},[]);let p=async t=>{c(null);let r=t.name.split(`.`).pop().toLowerCase();if(![`txt`,`pdf`,`docx`,`xlsx`,`xls`,`csv`].includes(r)){c(`Unsupported file: .${r}. Use .txt, .pdf, .docx, .xlsx, .xls, or .csv`);return}n(!0),i(e=>[...e,{name:t.name,status:`uploading`}]);let a=new FormData;a.append(`file`,t);try{let n=await fetch(`${f}/upload`,{method:`POST`,body:a});if(!n.ok){let e=await n.json();throw Error(e.detail||`Upload failed`)}let r=await n.json();i(e=>e.map(e=>e.name===t.name?{...e,status:`done`,chunks:r.chunks_added}:e)),e?.()}catch(e){c(e.message),i(e=>e.filter(e=>e.name!==t.name||e.status!==`uploading`))}n(!1)},m=e=>{Array.from(e).forEach(p)},_=e=>{e.preventDefault(),o(!1),m(e.dataTransfer.files)},v=async()=>{if(confirm(`Delete all uploaded files?`))try{await fetch(`${f}/clear-uploads`,{method:`POST`}),i([]),e?.()}catch(e){console.error(e)}},ee=async t=>{if(confirm(`Delete "${t}"?`))try{(await fetch(`${f}/delete-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filename:t})})).ok&&(i(e=>e.filter(e=>e.name!==t)),e?.())}catch(e){console.error(e)}},S=r.filter(e=>e.status===`done`);return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[(0,d.jsxs)(`div`,{className:`relative border-2 border-dashed rounded-2xl p-10 text-center transition-all cursor-pointer ${a?`border-indigo-400 bg-indigo-950/20`:`border-slate-600/50 hover:border-slate-500/70 bg-slate-800/30`}`,onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:_,onClick:()=>u.current?.click(),children:[(0,d.jsx)(`input`,{ref:u,type:`file`,className:`hidden`,accept:`.txt,.pdf,.docx,.xlsx,.xls,.csv`,multiple:!0,onChange:e=>m(e.target.files)}),(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-14 h-14 rounded-2xl flex items-center justify-center transition-colors ${a?`bg-indigo-600/30 text-indigo-300`:`bg-slate-700/50 text-slate-400`}`,children:(0,d.jsx)(y,{})}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-base font-semibold text-slate-200`,children:a?`Drop files here`:`Upload your documents`}),(0,d.jsxs)(`p`,{className:`text-sm text-slate-400 mt-1`,children:[`Drag & drop or click to browse β `,(0,d.jsx)(`span`,{className:`text-indigo-400`,children:`TXT, PDF, DOCX, Excel, CSV`})]})]}),t&&(0,d.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}),(0,d.jsx)(`span`,{className:`text-sm text-slate-400`,children:`Processing...`})]})]})]}),s&&(0,d.jsxs)(`div`,{className:`bg-red-950/30 border border-red-500/30 rounded-xl p-3 text-sm text-red-300 flex items-center gap-2`,children:[(0,d.jsx)(g,{}),` `,s]}),S.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,d.jsxs)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400`,children:[`Uploaded Documents (`,S.length,`)`]}),(0,d.jsxs)(`button`,{onClick:v,className:`text-xs text-red-400 hover:text-red-300 flex items-center gap-1 transition-colors`,children:[(0,d.jsx)(x,{}),` Clear all uploads`]})]}),(0,d.jsx)(`div`,{className:`space-y-2`,children:S.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-center gap-3 bg-slate-800/50 border border-slate-700/40 rounded-xl p-3 group`,children:[(0,d.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-indigo-600/15 flex items-center justify-center text-indigo-400`,children:(0,d.jsx)(b,{})}),(0,d.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-slate-200 truncate`,children:e.name}),(0,d.jsx)(`p`,{className:`text-xs text-slate-500`,children:e.chunks?`${e.chunks} chunks extracted`:`Processed`})]}),(0,d.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-emerald-500/20 flex items-center justify-center`,children:(0,d.jsx)(h,{})}),(0,d.jsx)(`button`,{onClick:()=>ee(e.name),className:`w-8 h-8 rounded-lg flex items-center justify-center text-slate-500 hover:text-red-400 hover:bg-red-950/30 opacity-0 group-hover:opacity-100 transition-all`,title:`Delete ${e.name}`,children:(0,d.jsx)(x,{})})]},t))})]}),(0,d.jsxs)(`div`,{className:`bg-slate-800/30 border border-slate-700/30 rounded-xl p-4 text-sm text-slate-400 leading-relaxed`,children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-300 mb-1`,children:`How it works:`}),(0,d.jsxs)(`ol`,{className:`list-decimal list-inside space-y-1`,children:[(0,d.jsx)(`li`,{children:`Upload any document (TXT, PDF, DOCX, Excel, or CSV)`}),(0,d.jsx)(`li`,{children:`The system extracts text and splits it into searchable chunks`}),(0,d.jsxs)(`li`,{children:[`Switch to the `,(0,d.jsx)(`strong`,{className:`text-indigo-400`,children:`Query`}),` tab and ask questions about your document`]}),(0,d.jsx)(`li`,{children:`Every claim in the answer is verified against your uploaded content`})]})]})]})}function oe({chunkCount:e}){let[t,n]=(0,l.useState)(``),[r,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),u=async e=>{let r=e||t;if(r.trim()){n(r),i(!0),o(null);try{o(await(await fetch(`${f}/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:r})})).json())}catch(e){console.error(e)}i(!1)}};return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[e===0&&(0,d.jsxs)(`div`,{className:`bg-amber-950/30 border border-amber-500/30 rounded-xl p-4 text-sm text-amber-300 text-center`,children:[`No documents loaded. Go to `,(0,d.jsx)(`strong`,{children:`Upload`}),` tab to add documents first.`]}),(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`input`,{type:`text`,className:`w-full bg-slate-800/70 border border-slate-600/50 rounded-2xl py-4 pl-5 pr-28 text-base text-slate-100 placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/50 transition-all`,placeholder:`Ask anything about your documents...`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&u()}),(0,d.jsx)(`button`,{onClick:()=>u(),disabled:r||e===0,className:`absolute right-2 top-1/2 -translate-y-1/2 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white font-semibold py-2.5 px-5 rounded-xl flex items-center gap-2 transition-all text-sm`,children:r?(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m,{}),` Ask`]})})]}),(0,d.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ee.slice(0,5).map(t=>(0,d.jsx)(`button`,{onClick:()=>u(t),disabled:e===0,className:`text-xs bg-slate-800/60 hover:bg-slate-700/60 disabled:opacity-40 border border-slate-700/40 text-slate-300 hover:text-white py-1.5 px-3 rounded-full transition-all`,children:t.length>40?t.slice(0,38)+`...`:t},t))}),r&&(0,d.jsxs)(`div`,{className:`flex flex-col items-center py-16 gap-4`,children:[(0,d.jsx)(`div`,{className:`spinner`}),(0,d.jsx)(`p`,{className:`text-slate-400 text-sm animate-pulse`,children:`Running VDHF pipeline...`})]}),a&&!r&&(0,d.jsxs)(`div`,{className:`space-y-6 animate-[fadeIn_.3s_ease]`,children:[(0,d.jsxs)(`div`,{className:`rounded-2xl p-5 flex items-center justify-between ${a.is_verified?`bg-gradient-to-r from-emerald-900/40 to-emerald-800/20 border border-emerald-500/30`:a.supported_claims===0?`bg-gradient-to-r from-red-900/40 to-red-800/20 border border-red-500/30`:`bg-gradient-to-r from-amber-900/40 to-amber-800/20 border border-amber-500/30`}`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center text-lg ${a.is_verified?`bg-emerald-500/20`:a.supported_claims===0?`bg-red-500/20`:`bg-amber-500/20`}`,children:a.is_verified?`β
`:a.supported_claims===0?`β`:`β οΈ`}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-bold text-lg`,children:a.is_verified?`Verified Response`:a.supported_claims===0?`Hallucinated Response`:`Partially Verified`}),(0,d.jsxs)(`p`,{className:`text-sm text-slate-400`,children:[a.supported_claims,`/`,a.total_claims,` claims supported`]})]})]}),(0,d.jsxs)(`div`,{className:`text-right`,children:[(0,d.jsxs)(`p`,{className:`text-2xl font-extrabold tabular-nums`,style:{color:a.is_verified?`#22c55e`:a.supported_claims===0?`#ef4444`:`#f59e0b`},children:[(a.support_ratio*100).toFixed(0),`%`]}),(0,d.jsx)(`p`,{className:`text-[10px] uppercase tracking-widest text-slate-500`,children:`support ratio`})]})]}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,d.jsx)(S,{label:`Support Ratio`,value:`${(a.support_ratio*100).toFixed(0)}%`,color:a.is_verified?`text-emerald-400`:a.supported_claims===0?`text-red-400`:`text-amber-400`}),(0,d.jsx)(S,{label:`Total Claims`,value:a.total_claims}),(0,d.jsx)(S,{label:`Supported`,value:a.supported_claims,color:`text-emerald-400`}),(0,d.jsx)(S,{label:`Regenerations`,value:a.regeneration_attempts,color:`text-blue-400`})]}),(0,d.jsxs)(`div`,{className:`bg-slate-800/50 border border-slate-700/40 rounded-2xl p-5`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,d.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400`,children:`Response`}),(0,d.jsxs)(`span`,{className:`text-xs text-slate-500`,children:[a.elapsed_seconds,`s`]})]}),(0,d.jsx)(ne,{text:a.response})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex justify-between text-xs text-slate-400 mb-1`,children:[(0,d.jsx)(`span`,{children:`Verification Progress`}),(0,d.jsxs)(`span`,{children:[a.supported_claims,`/`,a.total_claims]})]}),(0,d.jsx)(`div`,{className:`h-2.5 bg-slate-800 rounded-full overflow-hidden`,children:(0,d.jsx)(`div`,{className:`bar-fill h-full rounded-full`,style:{width:`${a.support_ratio*100}%`,background:a.is_verified?`linear-gradient(90deg,#22c55e,#4ade80)`:a.supported_claims===0?`linear-gradient(90deg,#ef4444,#f87171)`:`linear-gradient(90deg,#f59e0b,#fbbf24)`}})})]}),a.claims.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400 mb-3`,children:`Claims Breakdown`}),(0,d.jsx)(`div`,{className:`space-y-2`,children:a.claims.map((e,t)=>(0,d.jsx)(C,{claim:e},t))})]}),a.evidence.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`button`,{onClick:()=>c(!s),className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-slate-400 hover:text-slate-200 transition-colors mb-3`,children:[(0,d.jsxs)(`span`,{children:[`Retrieved Evidence (`,a.evidence.length,`)`]}),(0,d.jsx)(`div`,{className:`transition-transform duration-200 ${s?`rotate-180`:``}`,children:(0,d.jsx)(_,{})})]}),s&&(0,d.jsx)(`div`,{className:`space-y-2`,children:a.evidence.map((e,t)=>(0,d.jsx)(te,{ev:e,idx:t},t))})]})]})]})}function se(){let[e,t]=(0,l.useState)(``),[n,r]=(0,l.useState)(!1),[i,a]=(0,l.useState)(null);return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-sm text-slate-400 mb-2`,children:`Enter claims to verify (one per line):`}),(0,d.jsx)(`textarea`,{rows:6,className:`w-full bg-slate-800/70 border border-slate-600/50 rounded-xl p-4 text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition-all resize-none`,placeholder:`Python was created by Guido van Rossum.
|
| 13 |
Python was released in 2005.
|
| 14 |
Python is a compiled language.`,value:e,onChange:e=>t(e.target.value)})]}),(0,d.jsx)(`button`,{onClick:async()=>{let t=e.split(`
|
| 15 |
-
`).map(e=>e.trim()).filter(Boolean);if(t.length){r(!0),a(null);try{a(await(await fetch(`${f}/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({claims:t})})).json())}catch(e){console.error(e)}r(!1)}},disabled:n,className:`bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white font-semibold py-3 px-6 rounded-xl flex items-center gap-2 transition-all`,children:n?(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(v,{}),` Verify Claims`]})}),i&&(0,d.jsxs)(`div`,{className:`space-y-4 animate-[fadeIn_.3s_ease]`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,d.jsxs)(`p`,{className:`text-lg font-bold`,children:[i.supported,`/`,i.total,` supported `,(0,d.jsxs)(`span`,{className:`text-slate-500 font-normal`,children:[`(`,(i.ratio*100).toFixed(0),`%)`]})]}),(0,d.jsx)(`div`,{className:`flex-1 h-2.5 bg-slate-800 rounded-full overflow-hidden`,children:(0,d.jsx)(`div`,{className:`bar-fill h-full rounded-full bg-gradient-to-r from-indigo-500 to-purple-500`,style:{width:`${i.ratio*100}%`}})})]}),(0,d.jsx)(`div`,{className:`space-y-2`,children:i.results.map((e,t)=>(0,d.jsx)(C,{claim:e},t))})]})]})}function ce(){return(0,d.jsxs)(`div`,{className:`space-y-8 max-w-3xl`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-xl font-bold text-slate-100 mb-3`,children:`How VDHF Works`}),(0,d.jsx)(`p`,{className:`text-slate-400 leading-relaxed text-sm`,children:`The Verification-Driven Hallucination Firewall is a post-generation system that detects and blocks hallucinated content in LLM responses by verifying every factual claim against a trusted knowledge base.`})]}),(0,d.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[{n:`1`,title:`Retrieve`,desc:`Sentence-BERT embeds your query and finds the top-K most relevant document chunks via ChromaDB.`},{n:`2`,title:`Generate`,desc:`An LLM (Groq / mock) generates a response grounded in the retrieved evidence context.`},{n:`3`,title:`Extract`,desc:`Rule-based decomposition splits the response into atomic, independently verifiable factual claims.`},{n:`4`,title:`Verify`,desc:`Each claim is scored for semantic similarity and checked for NLI entailment against evidence.`},{n:`5`,title:`Firewall`,desc:`If SupportRatio >= threshold (80%), the response passes. Otherwise, regeneration is triggered.`},{n:`6`,title:`Regenerate`,desc:`A refined prompt using only verified evidence is created, and the LLM produces a safer response.`}].map(e=>(0,d.jsxs)(`div`,{className:`bg-slate-800/50 border border-slate-700/40 rounded-xl p-4`,children:[(0,d.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-indigo-600/20 flex items-center justify-center text-indigo-400 font-bold text-sm mb-3`,children:e.n}),(0,d.jsx)(`p`,{className:`font-semibold text-slate-200 text-sm mb-1`,children:e.title}),(0,d.jsx)(`p`,{className:`text-xs text-slate-400 leading-relaxed`,children:e.desc})]},e.n))}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-lg font-bold text-slate-100 mb-3`,children:`Models & Config`}),(0,d.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{className:`bg-slate-800/60`,children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{className:`text-left p-3 text-slate-400 font-medium`,children:`Parameter`}),(0,d.jsx)(`th`,{className:`text-left p-3 text-slate-400 font-medium`,children:`Value`})]})}),(0,d.jsx)(`tbody`,{className:`divide-y divide-slate-700/30`,children:[[`Embedding Model`,`all-MiniLM-L6-v2 (Sentence-BERT)`],[`NLI Model`,`microsoft/deberta-base-mnli`],[`LLM`,`llama-3.3-70b-versatile (Groq)`],[`Similarity Threshold`,`0.75`],[`Firewall Threshold`,`0.80`],[`Top-K Retrieval`,`7`],[`Max Regenerations`,`2`]].map(([e,t])=>(0,d.jsxs)(`tr`,{className:`hover:bg-slate-800/30 transition-colors`,children:[(0,d.jsx)(`td`,{className:`p-3 text-slate-300`,children:e}),(0,d.jsx)(`td`,{className:`p-3 text-indigo-300 font-mono text-xs`,children:t})]},e))})]})})]})]})}function le(){let[e,t]=(0,l.useState)(`upload`),[n,r]=(0,l.useState)(null),i=(0,l.useCallback)(()=>{fetch(`${f}/status`).then(e=>e.json()).then(r).catch(()=>{})},[]);(0,l.useEffect)(()=>{i()},[i]);let a=n?.document_chunks??0,o=(n?.documents_loaded?.length??0)+(n?.uploaded_files?.length??0);return(0,d.jsxs)(`div`,{className:`min-h-screen flex flex-col`,children:[(0,d.jsxs)(`header`,{className:`hero-gradient relative overflow-hidden border-b border-slate-700/40`,children:[(0,d.jsx)(`div`,{className:`particle w-32 h-32 top-8 left-[10%]`,style:{animationDelay:`0s`}}),(0,d.jsx)(`div`,{className:`particle w-20 h-20 top-20 right-[15%]`,style:{animationDelay:`2s`}}),(0,d.jsx)(`div`,{className:`particle w-16 h-16 bottom-4 left-[40%]`,style:{animationDelay:`4s`}}),(0,d.jsxs)(`div`,{className:`relative max-w-5xl mx-auto px-6 py-12 text-center`,children:[(0,d.jsx)(`div`,{className:`inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-indigo-600/20 border border-indigo-500/30 pulse-ring mb-5`,children:(0,d.jsx)(p,{className:`w-8 h-8 text-indigo-400`})}),(0,d.jsx)(`h1`,{className:`text-4xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-white via-slate-200 to-indigo-300 bg-clip-text text-transparent`,children:`Hallucination Firewall`}),(0,d.jsx)(`p`,{className:`text-slate-400 mt-3 text-base md:text-lg max-w-xl mx-auto`,children:`Upload any document, ask questions, and get verified answers β every claim checked against your content.`}),n&&(0,d.jsxs)(`div`,{className:`mt-5 flex items-center justify-center gap-3 flex-wrap`,children:[(0,d.jsxs)(`div`,{className:`inline-flex items-center gap-2 bg-slate-800/60 border border-slate-700/50 rounded-full py-1.5 px-4 text-xs text-slate-400`,children:[(0,d.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-emerald-400 animate-pulse`}),a,` chunks from `,o,` documents`]}),n.uploaded_files?.length>0&&(0,d.jsxs)(`div`,{className:`inline-flex items-center gap-2 bg-indigo-950/40 border border-indigo-500/30 rounded-full py-1.5 px-4 text-xs text-indigo-300`,children:[(0,d.jsx)(b,{}),` `,n.uploaded_files.length,` uploaded`]})]})]})]}),(0,d.jsx)(`nav`,{className:`border-b border-slate-700/40 bg-slate-900/60 backdrop-blur-sm sticky top-0 z-20`,children:(0,d.jsx)(`div`,{className:`max-w-5xl mx-auto px-6 flex gap-1`,children:[{id:`upload`,label:`Upload`,icon:`π`},{id:`query`,label:`Query`,icon:`π`},{id:`verify`,label:`Verify Claims`,icon:`π§ͺ`},{id:`about`,label:`About`,icon:`π`}].map(n=>(0,d.jsxs)(`button`,{onClick:()=>t(n.id),className:`py-3.5 px-5 text-sm font-medium transition-all border-b-2 ${e===n.id?`border-indigo-500 text-indigo-300`:`border-transparent text-slate-400 hover:text-slate-200`}`,children:[(0,d.jsx)(`span`,{className:`mr-1.5`,children:n.icon}),n.label]},n.id))})}),(0,d.jsxs)(`main`,{className:`flex-1 max-w-5xl mx-auto px-6 py-8 w-full`,children:[e===`upload`&&(0,d.jsx)(ae,{onStatusChange:i}),e===`query`&&(0,d.jsx)(oe,{chunkCount:a}),e===`verify`&&(0,d.jsx)(se,{}),e===`about`&&(0,d.jsx)(ce,{})]}),(0,d.jsx)(`footer`,{className:`border-t border-slate-700/40 py-4 text-center text-xs text-slate-500`,children:`VDHF β Verification-Driven Hallucination Firewall Β· Built with React + FastAPI`})]})}(0,c.createRoot)(document.getElementById(`root`)).render((0,d.jsx)(l.StrictMode,{children:(0,d.jsx)(le,{})}));
|
|
|
|
| 9 |
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:rn(e,r,a);break;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=on.get(n)||n,Lt(e,n,r))}}function Nd(e,t,n,r,i,a){switch(n){case`style`:rn(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[_t]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,a,o,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:$(e,t,r,d,n,null)}}Yt(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(o in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:$(e,t,o,c,n,null)}$t(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:o=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Jt(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:o=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&$(e,t,o,i,r,a)}Qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=E.d;E.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?js(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),k(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),k(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),k(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Ot(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);k(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),k(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),k(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=_e.current)?gf(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var a=Ot(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(jf(e)))&&!a._p&&(o.instance=a,o.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),a||Nf(i,e,n,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Af(e){return`href="`+qt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),k(t),e.head.appendChild(t))}function Pf(e){return`[src="`+qt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,k(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),k(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var a=e.querySelector(jf(i));if(a)return t.state.loading|=4,t.instance=a,k(a),a;r=Mf(n),(i=mf.get(i))&&Rf(r,i),a=(e.ownerDocument||e).createElement(`link`),k(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),t.state.loading|=4,Lf(a,n.precedence,e),t.instance=a;case`script`:return a=Pf(n.src),(i=e.querySelector(Ff(a)))?(t.instance=i,k(i),i):(r=n,(i=mf.get(a))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),k(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,k(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),k(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function tp(e){return e?(e=hi,e):hi}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(hu(n,e,t),Qa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=dt(t);var n=fi(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=2,up(e,t,n,r)}finally{E.p=a,T.T=i}}function lp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=8,up(e,t,n,r)}finally{E.p=a,T.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=et(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-qe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(W&6)&&(nu=Fe()+500,id(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=dn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=Tt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ie()){case Le:return 2;case Re:return 8;case ze:case Be:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Et(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=Tt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,mt(e.priority,function(){op(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,mt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Et(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[vt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=r.version;if(Lp!==`19.2.4`)throw Error(s(527,Lp,`19.2.4`));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:T,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{We=zp.inject(Rp),Ge=zp}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=Qs,a=$s,o=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,a,o,Pp),e[vt]=t.current,Sd(e),new Fp(t)}})),c=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()}))(),l=n(),u=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),d=e(((e,t)=>{t.exports=u()}))(),f=`/api`,p=({className:e=``})=>(0,d.jsx)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z`})}),m=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,d.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),h=()=>(0,d.jsx)(`svg`,{className:`w-5 h-5 text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),g=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,d.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),_=()=>(0,d.jsx)(`svg`,{className:`w-4 h-4`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),v=()=>(0,d.jsx)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,d.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),y=()=>(0,d.jsxs)(`svg`,{className:`w-6 h-6`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,d.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,d.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),b=()=>(0,d.jsxs)(`svg`,{className:`w-5 h-5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,d.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,d.jsx)(`line`,{x1:`16`,y1:`13`,x2:`8`,y2:`13`}),(0,d.jsx)(`line`,{x1:`16`,y1:`17`,x2:`8`,y2:`17`})]}),x=()=>(0,d.jsxs)(`svg`,{className:`w-4 h-4`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,d.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}),ee=[`When was Python released and who created it?`,`What caused World War I?`,`Tell me about artificial intelligence history.`,`How does the human body work?`,`What is climate change and what causes it?`,`Tell me about the Renaissance period.`,`How did the internet develop?`,`Tell me about quantum physics.`];function S({label:e,value:t,color:n=`text-indigo-400`}){return(0,d.jsxs)(`div`,{className:`bg-slate-800/60 border border-slate-700/50 rounded-xl p-4 text-center backdrop-blur-sm`,children:[(0,d.jsx)(`p`,{className:`text-2xl font-bold ${n}`,children:t}),(0,d.jsx)(`p`,{className:`text-xs text-slate-400 mt-1 uppercase tracking-wider`,children:e})]})}function C({claim:e}){let[t,n]=(0,l.useState)(!1),r=e.is_supported;return(0,d.jsxs)(`div`,{className:`rounded-xl border p-4 transition-all duration-200 ${r?`border-emerald-500/30 bg-emerald-950/20`:`border-red-500/30 bg-red-950/20`}`,children:[(0,d.jsxs)(`div`,{className:`flex items-start gap-3 cursor-pointer`,onClick:()=>n(!t),children:[(0,d.jsx)(`div`,{className:`mt-0.5`,children:r?(0,d.jsx)(h,{}):(0,d.jsx)(g,{})}),(0,d.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-slate-200 leading-relaxed`,children:e.text}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-slate-400`,children:[(0,d.jsxs)(`span`,{children:[`Similarity: `,(0,d.jsxs)(`strong`,{className:r?`text-emerald-400`:`text-red-400`,children:[(e.similarity_score*100).toFixed(1),`%`]})]}),(0,d.jsx)(`span`,{className:`opacity-40`,children:`|`}),(0,d.jsxs)(`span`,{children:[`Entailment: `,(0,d.jsx)(`strong`,{className:e.entailment_label===`ENTAILED`?`text-emerald-400`:`text-amber-400`,children:e.entailment_label})]})]})]}),(0,d.jsx)(`div`,{className:`transition-transform duration-200 ${t?`rotate-180`:``}`,children:(0,d.jsx)(_,{})})]}),t&&e.best_evidence&&(0,d.jsxs)(`div`,{className:`mt-3 ml-8 p-3 bg-slate-800/50 rounded-lg border border-slate-700/40 text-xs text-slate-300 leading-relaxed`,children:[(0,d.jsx)(`p`,{className:`text-[10px] uppercase tracking-widest text-slate-500 mb-1 font-semibold`,children:`Best Evidence`}),e.best_evidence]})]})}function te({ev:e,idx:t}){return(0,d.jsxs)(`div`,{className:`bg-slate-800/40 border border-slate-700/40 rounded-lg p-3`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-slate-400 mb-1`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-blue-400`,children:[`#`,t+1,` β `,e.source]}),(0,d.jsxs)(`span`,{children:[`Score: `,(e.similarity_score*100).toFixed(1),`%`]})]}),(0,d.jsx)(`p`,{className:`text-xs text-slate-300 leading-relaxed`,children:e.content})]})}function ne({text:e}){return e.startsWith(`Comparison between`)?(0,d.jsx)(re,{text:e}):/^\d+\s+students\s+have|^Students with .* found\):/i.test(e)||/^\s*\d+\.\s+/m.test(e)?(0,d.jsx)(w,{text:e}):/^(Details for|For )\S/i.test(e)?(0,d.jsx)(ie,{text:e}):(0,d.jsx)(`p`,{className:`text-slate-200 leading-relaxed whitespace-pre-line`,children:e})}function re({text:e}){let t=e.split(`
|
| 10 |
`).filter(e=>e.trim()),n=t[0].match(/Comparison between (.+?) and (.+?):/),r=n?.[1]||`Student 1`,i=n?.[2]||`Student 2`,a=[],o=[];for(let e=1;e<t.length;e++){let n=t[e].match(/^\s*(.+?):\s*([\d.]+)\s+vs\s+([\d.]+)\s*(.*)/);if(n){let[,e,t,r,i]=n;a.push({subject:e.trim(),v1:parseFloat(t),v2:parseFloat(r),marker:i.trim()})}else t[e].match(/^Comparison between/)||o.push(t[e].trim())}return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`bg-slate-700/40 text-slate-300`,children:[(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold`,children:`Subject`}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:r}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:i}),(0,d.jsx)(`th`,{className:`text-center px-4 py-2.5 font-semibold`,children:`Result`})]})}),(0,d.jsx)(`tbody`,{children:a.map((e,t)=>{let n=e.v1-e.v2,r=n>0?`text-emerald-400 font-semibold`:n<0?`text-red-400`:`text-slate-300`,i=n<0?`text-emerald-400 font-semibold`:n>0?`text-red-400`:`text-slate-300`,a=n>0?(0,d.jsxs)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400`,children:[`+`,n.toFixed(1)]}):n<0?(0,d.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-red-500/20 text-red-400`,children:n.toFixed(1)}):(0,d.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-slate-600/40 text-slate-400`,children:`Equal`});return(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-300 font-medium`,children:e.subject}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center ${r}`,children:e.v1}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center ${i}`,children:e.v2}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-center`,children:a})]},t)})})]})}),o.length>0&&(0,d.jsx)(`div`,{className:`bg-slate-700/30 rounded-xl px-4 py-3 text-sm text-slate-300 space-y-1`,children:o.map((e,t)=>(0,d.jsx)(`p`,{children:e},t))})]})}function w({text:e}){let t=e.split(`
|
| 11 |
`).filter(e=>e.trim()),n=t[0],r=t.slice(1).filter(e=>/^\s*\d+\./.test(e)),i=t.slice(1).filter(e=>!/^\s*\d+\./.test(e));return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`p`,{className:`text-slate-200 font-medium`,children:n}),r.length>0&&(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`bg-slate-700/40 text-slate-300`,children:[(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold w-10`,children:`#`}),(0,d.jsx)(`th`,{className:`text-left px-4 py-2.5 font-semibold`,children:`Name`}),(0,d.jsx)(`th`,{className:`text-right px-4 py-2.5 font-semibold`,children:`Value`})]})}),(0,d.jsx)(`tbody`,{children:r.map((e,t)=>{let n=e.match(/^\s*(\d+)\.\s+(.+?)\s*[ββ-]\s*([\d.]+)/);return n?(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-500`,children:n[1]}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-200`,children:n[2].trim()}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-right text-indigo-400 font-semibold`,children:n[3]})]},t):null})})]})}),i.map((e,t)=>(0,d.jsx)(`p`,{className:`text-sm text-slate-400`,children:e},t))]})}function ie({text:e}){let t=e.split(`
|
| 12 |
+
`).filter(e=>e.trim()),n=t[0],r=t.slice(1).filter(e=>e.includes(`:`));return(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(`p`,{className:`text-slate-200 font-medium`,children:n}),r.length>0&&(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-slate-700/40`,children:(0,d.jsx)(`table`,{className:`w-full text-sm`,children:(0,d.jsx)(`tbody`,{children:r.map((e,t)=>{let n=e.match(/^\s*-?\s*(.+?):\s*(.+)/);return n?(0,d.jsxs)(`tr`,{className:t%2==0?`bg-slate-800/30`:`bg-slate-800/10`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-400 font-medium w-1/3`,children:n[1].trim()}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-slate-200 font-semibold`,children:n[2].trim()})]},t):null})})})})]})}function ae({onStatusChange:e,onSwitchToQuery:t}){let[n,r]=(0,l.useState)(!1),[i,a]=(0,l.useState)([]),[o,s]=(0,l.useState)(!1),[c,u]=(0,l.useState)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{fetch(`${f}/status`).then(e=>e.json()).then(e=>{a(e.uploaded_files.map(e=>({name:e,status:`done`})))}).catch(()=>{})},[]);let m=async n=>{u(null);let i=n.name.split(`.`).pop().toLowerCase();if(![`txt`,`pdf`,`docx`,`xlsx`,`xls`,`csv`].includes(i)){u(`Unsupported file: .${i}. Use .txt, .pdf, .docx, .xlsx, .xls, or .csv`);return}r(!0),a(e=>[...e,{name:n.name,status:`uploading`}]);let o=new FormData;o.append(`file`,n);try{let r=await fetch(`${f}/upload`,{method:`POST`,body:o});if(!r.ok){let e=await r.json();throw Error(e.detail||`Upload failed`)}let i=await r.json();a(e=>e.map(e=>e.name===n.name?{...e,status:`done`,chunks:i.chunks_added}:e)),e?.(),setTimeout(()=>t?.(),1e3)}catch(e){u(e.message),a(e=>e.filter(e=>e.name!==n.name||e.status!==`uploading`))}r(!1)},_=e=>{Array.from(e).forEach(m)},v=e=>{e.preventDefault(),s(!1),_(e.dataTransfer.files)},ee=async()=>{if(confirm(`Delete all uploaded files?`))try{await fetch(`${f}/clear-uploads`,{method:`POST`}),a([]),e?.()}catch(e){console.error(e)}},S=async t=>{if(confirm(`Delete "${t}"?`))try{(await fetch(`${f}/delete-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filename:t})})).ok&&(a(e=>e.filter(e=>e.name!==t)),e?.())}catch(e){console.error(e)}},C=i.filter(e=>e.status===`done`);return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[(0,d.jsxs)(`div`,{className:`relative border-2 border-dashed rounded-2xl p-10 text-center transition-all cursor-pointer ${o?`border-indigo-400 bg-indigo-950/20`:`border-slate-600/50 hover:border-slate-500/70 bg-slate-800/30`}`,onDragOver:e=>{e.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:v,onClick:()=>p.current?.click(),children:[(0,d.jsx)(`input`,{ref:p,type:`file`,className:`hidden`,accept:`.txt,.pdf,.docx,.xlsx,.xls,.csv`,multiple:!0,onChange:e=>_(e.target.files)}),(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-14 h-14 rounded-2xl flex items-center justify-center transition-colors ${o?`bg-indigo-600/30 text-indigo-300`:`bg-slate-700/50 text-slate-400`}`,children:(0,d.jsx)(y,{})}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-base font-semibold text-slate-200`,children:o?`Drop files here`:`Upload your documents`}),(0,d.jsxs)(`p`,{className:`text-sm text-slate-400 mt-1`,children:[`Drag & drop or click to browse β `,(0,d.jsx)(`span`,{className:`text-indigo-400`,children:`TXT, PDF, DOCX, Excel, CSV`})]})]}),n&&(0,d.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}),(0,d.jsx)(`span`,{className:`text-sm text-slate-400`,children:`Processing...`})]})]})]}),c&&(0,d.jsxs)(`div`,{className:`bg-red-950/30 border border-red-500/30 rounded-xl p-3 text-sm text-red-300 flex items-center gap-2`,children:[(0,d.jsx)(g,{}),` `,c]}),C.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,d.jsxs)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400`,children:[`Uploaded Documents (`,C.length,`)`]}),(0,d.jsxs)(`button`,{onClick:ee,className:`text-xs text-red-400 hover:text-red-300 flex items-center gap-1 transition-colors`,children:[(0,d.jsx)(x,{}),` Clear all uploads`]})]}),(0,d.jsx)(`div`,{className:`space-y-2`,children:C.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-center gap-3 bg-slate-800/50 border border-slate-700/40 rounded-xl p-3 group`,children:[(0,d.jsx)(`div`,{className:`w-9 h-9 rounded-lg bg-indigo-600/15 flex items-center justify-center text-indigo-400`,children:(0,d.jsx)(b,{})}),(0,d.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-slate-200 truncate`,children:e.name}),(0,d.jsx)(`p`,{className:`text-xs text-slate-500`,children:e.chunks?`${e.chunks} chunks extracted`:`Processed`})]}),(0,d.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-emerald-500/20 flex items-center justify-center`,children:(0,d.jsx)(h,{})}),(0,d.jsx)(`button`,{onClick:()=>S(e.name),className:`w-8 h-8 rounded-lg flex items-center justify-center text-slate-500 hover:text-red-400 hover:bg-red-950/30 opacity-0 group-hover:opacity-100 transition-all`,title:`Delete ${e.name}`,children:(0,d.jsx)(x,{})})]},t))})]}),(0,d.jsxs)(`div`,{className:`bg-slate-800/30 border border-slate-700/30 rounded-xl p-4 text-sm text-slate-400 leading-relaxed`,children:[(0,d.jsx)(`p`,{className:`font-semibold text-slate-300 mb-1`,children:`How it works:`}),(0,d.jsxs)(`ol`,{className:`list-decimal list-inside space-y-1`,children:[(0,d.jsx)(`li`,{children:`Upload any document (TXT, PDF, DOCX, Excel, or CSV)`}),(0,d.jsx)(`li`,{children:`The system extracts text and splits it into searchable chunks`}),(0,d.jsxs)(`li`,{children:[`Switch to the `,(0,d.jsx)(`strong`,{className:`text-indigo-400`,children:`Query`}),` tab and ask questions about your document`]}),(0,d.jsx)(`li`,{children:`Every claim in the answer is verified against your uploaded content`})]})]})]})}function oe({chunkCount:e}){let[t,n]=(0,l.useState)(``),[r,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),u=async e=>{let r=e||t;if(r.trim()){n(r),i(!0),o(null);try{o(await(await fetch(`${f}/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:r})})).json())}catch(e){console.error(e)}i(!1)}};return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[e===0&&(0,d.jsxs)(`div`,{className:`bg-amber-950/30 border border-amber-500/30 rounded-xl p-4 text-sm text-amber-300 text-center`,children:[`No documents loaded. Go to `,(0,d.jsx)(`strong`,{children:`Upload`}),` tab to add documents first.`]}),(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`input`,{type:`text`,className:`w-full bg-slate-800/70 border border-slate-600/50 rounded-2xl py-4 pl-5 pr-28 text-base text-slate-100 placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/50 transition-all`,placeholder:`Ask anything about your documents...`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&u()}),(0,d.jsx)(`button`,{onClick:()=>u(),disabled:r||e===0,className:`absolute right-2 top-1/2 -translate-y-1/2 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white font-semibold py-2.5 px-5 rounded-xl flex items-center gap-2 transition-all text-sm`,children:r?(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m,{}),` Ask`]})})]}),(0,d.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ee.slice(0,5).map(t=>(0,d.jsx)(`button`,{onClick:()=>u(t),disabled:e===0,className:`text-xs bg-slate-800/60 hover:bg-slate-700/60 disabled:opacity-40 border border-slate-700/40 text-slate-300 hover:text-white py-1.5 px-3 rounded-full transition-all`,children:t.length>40?t.slice(0,38)+`...`:t},t))}),r&&(0,d.jsxs)(`div`,{className:`flex flex-col items-center py-16 gap-4`,children:[(0,d.jsx)(`div`,{className:`spinner`}),(0,d.jsx)(`p`,{className:`text-slate-400 text-sm animate-pulse`,children:`Running VDHF pipeline...`})]}),a&&!r&&(0,d.jsxs)(`div`,{className:`space-y-6 animate-[fadeIn_.3s_ease]`,children:[(0,d.jsxs)(`div`,{className:`rounded-2xl p-5 flex items-center justify-between ${a.is_verified?`bg-gradient-to-r from-emerald-900/40 to-emerald-800/20 border border-emerald-500/30`:a.supported_claims===0?`bg-gradient-to-r from-red-900/40 to-red-800/20 border border-red-500/30`:`bg-gradient-to-r from-amber-900/40 to-amber-800/20 border border-amber-500/30`}`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center text-lg ${a.is_verified?`bg-emerald-500/20`:a.supported_claims===0?`bg-red-500/20`:`bg-amber-500/20`}`,children:a.is_verified?`β
`:a.supported_claims===0?`β`:`β οΈ`}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`font-bold text-lg`,children:a.is_verified?`Verified Response`:a.supported_claims===0?`Hallucinated Response`:`Partially Verified`}),(0,d.jsxs)(`p`,{className:`text-sm text-slate-400`,children:[a.supported_claims,`/`,a.total_claims,` claims supported`]})]})]}),(0,d.jsxs)(`div`,{className:`text-right`,children:[(0,d.jsxs)(`p`,{className:`text-2xl font-extrabold tabular-nums`,style:{color:a.is_verified?`#22c55e`:a.supported_claims===0?`#ef4444`:`#f59e0b`},children:[(a.support_ratio*100).toFixed(0),`%`]}),(0,d.jsx)(`p`,{className:`text-[10px] uppercase tracking-widest text-slate-500`,children:`support ratio`})]})]}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,d.jsx)(S,{label:`Support Ratio`,value:`${(a.support_ratio*100).toFixed(0)}%`,color:a.is_verified?`text-emerald-400`:a.supported_claims===0?`text-red-400`:`text-amber-400`}),(0,d.jsx)(S,{label:`Total Claims`,value:a.total_claims}),(0,d.jsx)(S,{label:`Supported`,value:a.supported_claims,color:`text-emerald-400`}),(0,d.jsx)(S,{label:`Regenerations`,value:a.regeneration_attempts,color:`text-blue-400`})]}),(0,d.jsxs)(`div`,{className:`bg-slate-800/50 border border-slate-700/40 rounded-2xl p-5`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,d.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400`,children:`Response`}),(0,d.jsxs)(`span`,{className:`text-xs text-slate-500`,children:[a.elapsed_seconds,`s`]})]}),(0,d.jsx)(ne,{text:a.response})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex justify-between text-xs text-slate-400 mb-1`,children:[(0,d.jsx)(`span`,{children:`Verification Progress`}),(0,d.jsxs)(`span`,{children:[a.supported_claims,`/`,a.total_claims]})]}),(0,d.jsx)(`div`,{className:`h-2.5 bg-slate-800 rounded-full overflow-hidden`,children:(0,d.jsx)(`div`,{className:`bar-fill h-full rounded-full`,style:{width:`${a.support_ratio*100}%`,background:a.is_verified?`linear-gradient(90deg,#22c55e,#4ade80)`:a.supported_claims===0?`linear-gradient(90deg,#ef4444,#f87171)`:`linear-gradient(90deg,#f59e0b,#fbbf24)`}})})]}),a.claims.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-sm font-semibold uppercase tracking-wider text-slate-400 mb-3`,children:`Claims Breakdown`}),(0,d.jsx)(`div`,{className:`space-y-2`,children:a.claims.map((e,t)=>(0,d.jsx)(C,{claim:e},t))})]}),a.evidence.length>0&&(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`button`,{onClick:()=>c(!s),className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-slate-400 hover:text-slate-200 transition-colors mb-3`,children:[(0,d.jsxs)(`span`,{children:[`Retrieved Evidence (`,a.evidence.length,`)`]}),(0,d.jsx)(`div`,{className:`transition-transform duration-200 ${s?`rotate-180`:``}`,children:(0,d.jsx)(_,{})})]}),s&&(0,d.jsx)(`div`,{className:`space-y-2`,children:a.evidence.map((e,t)=>(0,d.jsx)(te,{ev:e,idx:t},t))})]})]})]})}function se(){let[e,t]=(0,l.useState)(``),[n,r]=(0,l.useState)(!1),[i,a]=(0,l.useState)(null);return(0,d.jsxs)(`div`,{className:`space-y-6`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-sm text-slate-400 mb-2`,children:`Enter claims to verify (one per line):`}),(0,d.jsx)(`textarea`,{rows:6,className:`w-full bg-slate-800/70 border border-slate-600/50 rounded-xl p-4 text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition-all resize-none`,placeholder:`Python was created by Guido van Rossum.
|
| 13 |
Python was released in 2005.
|
| 14 |
Python is a compiled language.`,value:e,onChange:e=>t(e.target.value)})]}),(0,d.jsx)(`button`,{onClick:async()=>{let t=e.split(`
|
| 15 |
+
`).map(e=>e.trim()).filter(Boolean);if(t.length){r(!0),a(null);try{a(await(await fetch(`${f}/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({claims:t})})).json())}catch(e){console.error(e)}r(!1)}},disabled:n,className:`bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white font-semibold py-3 px-6 rounded-xl flex items-center gap-2 transition-all`,children:n?(0,d.jsx)(`div`,{className:`spinner !w-5 !h-5 !border-2`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(v,{}),` Verify Claims`]})}),i&&(0,d.jsxs)(`div`,{className:`space-y-4 animate-[fadeIn_.3s_ease]`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,d.jsxs)(`p`,{className:`text-lg font-bold`,children:[i.supported,`/`,i.total,` supported `,(0,d.jsxs)(`span`,{className:`text-slate-500 font-normal`,children:[`(`,(i.ratio*100).toFixed(0),`%)`]})]}),(0,d.jsx)(`div`,{className:`flex-1 h-2.5 bg-slate-800 rounded-full overflow-hidden`,children:(0,d.jsx)(`div`,{className:`bar-fill h-full rounded-full bg-gradient-to-r from-indigo-500 to-purple-500`,style:{width:`${i.ratio*100}%`}})})]}),(0,d.jsx)(`div`,{className:`space-y-2`,children:i.results.map((e,t)=>(0,d.jsx)(C,{claim:e},t))})]})]})}function ce(){return(0,d.jsxs)(`div`,{className:`space-y-8 max-w-3xl`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-xl font-bold text-slate-100 mb-3`,children:`How VDHF Works`}),(0,d.jsx)(`p`,{className:`text-slate-400 leading-relaxed text-sm`,children:`The Verification-Driven Hallucination Firewall is a post-generation system that detects and blocks hallucinated content in LLM responses by verifying every factual claim against a trusted knowledge base.`})]}),(0,d.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[{n:`1`,title:`Retrieve`,desc:`Sentence-BERT embeds your query and finds the top-K most relevant document chunks via ChromaDB.`},{n:`2`,title:`Generate`,desc:`An LLM (Groq / mock) generates a response grounded in the retrieved evidence context.`},{n:`3`,title:`Extract`,desc:`Rule-based decomposition splits the response into atomic, independently verifiable factual claims.`},{n:`4`,title:`Verify`,desc:`Each claim is scored for semantic similarity and checked for NLI entailment against evidence.`},{n:`5`,title:`Firewall`,desc:`If SupportRatio >= threshold (80%), the response passes. Otherwise, regeneration is triggered.`},{n:`6`,title:`Regenerate`,desc:`A refined prompt using only verified evidence is created, and the LLM produces a safer response.`}].map(e=>(0,d.jsxs)(`div`,{className:`bg-slate-800/50 border border-slate-700/40 rounded-xl p-4`,children:[(0,d.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-indigo-600/20 flex items-center justify-center text-indigo-400 font-bold text-sm mb-3`,children:e.n}),(0,d.jsx)(`p`,{className:`font-semibold text-slate-200 text-sm mb-1`,children:e.title}),(0,d.jsx)(`p`,{className:`text-xs text-slate-400 leading-relaxed`,children:e.desc})]},e.n))}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`text-lg font-bold text-slate-100 mb-3`,children:`Models & Config`}),(0,d.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-slate-700/40`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{className:`bg-slate-800/60`,children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{className:`text-left p-3 text-slate-400 font-medium`,children:`Parameter`}),(0,d.jsx)(`th`,{className:`text-left p-3 text-slate-400 font-medium`,children:`Value`})]})}),(0,d.jsx)(`tbody`,{className:`divide-y divide-slate-700/30`,children:[[`Embedding Model`,`all-MiniLM-L6-v2 (Sentence-BERT)`],[`NLI Model`,`microsoft/deberta-base-mnli`],[`LLM`,`llama-3.3-70b-versatile (Groq)`],[`Similarity Threshold`,`0.75`],[`Firewall Threshold`,`0.80`],[`Top-K Retrieval`,`7`],[`Max Regenerations`,`2`]].map(([e,t])=>(0,d.jsxs)(`tr`,{className:`hover:bg-slate-800/30 transition-colors`,children:[(0,d.jsx)(`td`,{className:`p-3 text-slate-300`,children:e}),(0,d.jsx)(`td`,{className:`p-3 text-indigo-300 font-mono text-xs`,children:t})]},e))})]})})]})]})}function le(){let[e,t]=(0,l.useState)(`upload`),[n,r]=(0,l.useState)(null),i=(0,l.useCallback)(()=>{fetch(`${f}/status`).then(e=>e.json()).then(r).catch(()=>{})},[]);(0,l.useEffect)(()=>{fetch(`${f}/clear-uploads`,{method:`POST`}).then(()=>i()).catch(()=>i())},[i]);let a=n?.document_chunks??0,o=(n?.documents_loaded?.length??0)+(n?.uploaded_files?.length??0);return(0,d.jsxs)(`div`,{className:`min-h-screen flex flex-col`,children:[(0,d.jsxs)(`header`,{className:`hero-gradient relative overflow-hidden border-b border-slate-700/40`,children:[(0,d.jsx)(`div`,{className:`particle w-32 h-32 top-8 left-[10%]`,style:{animationDelay:`0s`}}),(0,d.jsx)(`div`,{className:`particle w-20 h-20 top-20 right-[15%]`,style:{animationDelay:`2s`}}),(0,d.jsx)(`div`,{className:`particle w-16 h-16 bottom-4 left-[40%]`,style:{animationDelay:`4s`}}),(0,d.jsxs)(`div`,{className:`relative max-w-5xl mx-auto px-6 py-12 text-center`,children:[(0,d.jsx)(`div`,{className:`inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-indigo-600/20 border border-indigo-500/30 pulse-ring mb-5`,children:(0,d.jsx)(p,{className:`w-8 h-8 text-indigo-400`})}),(0,d.jsx)(`h1`,{className:`text-4xl md:text-5xl font-extrabold tracking-tight bg-gradient-to-r from-white via-slate-200 to-indigo-300 bg-clip-text text-transparent`,children:`Hallucination Firewall`}),(0,d.jsx)(`p`,{className:`text-slate-400 mt-3 text-base md:text-lg max-w-xl mx-auto`,children:`Upload any document, ask questions, and get verified answers β every claim checked against your content.`}),n&&(0,d.jsxs)(`div`,{className:`mt-5 flex items-center justify-center gap-3 flex-wrap`,children:[(0,d.jsxs)(`div`,{className:`inline-flex items-center gap-2 bg-slate-800/60 border border-slate-700/50 rounded-full py-1.5 px-4 text-xs text-slate-400`,children:[(0,d.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-emerald-400 animate-pulse`}),a,` chunks from `,o,` documents`]}),n.uploaded_files?.length>0&&(0,d.jsxs)(`div`,{className:`inline-flex items-center gap-2 bg-indigo-950/40 border border-indigo-500/30 rounded-full py-1.5 px-4 text-xs text-indigo-300`,children:[(0,d.jsx)(b,{}),` `,n.uploaded_files.length,` uploaded`]})]})]})]}),(0,d.jsx)(`nav`,{className:`border-b border-slate-700/40 bg-slate-900/60 backdrop-blur-sm sticky top-0 z-20`,children:(0,d.jsx)(`div`,{className:`max-w-5xl mx-auto px-6 flex gap-1`,children:[{id:`upload`,label:`Upload`,icon:`π`},{id:`query`,label:`Query`,icon:`π`},{id:`verify`,label:`Verify Claims`,icon:`π§ͺ`},{id:`about`,label:`About`,icon:`π`}].map(n=>(0,d.jsxs)(`button`,{onClick:()=>t(n.id),className:`py-3.5 px-5 text-sm font-medium transition-all border-b-2 ${e===n.id?`border-indigo-500 text-indigo-300`:`border-transparent text-slate-400 hover:text-slate-200`}`,children:[(0,d.jsx)(`span`,{className:`mr-1.5`,children:n.icon}),n.label]},n.id))})}),(0,d.jsxs)(`main`,{className:`flex-1 max-w-5xl mx-auto px-6 py-8 w-full`,children:[e===`upload`&&(0,d.jsx)(ae,{onStatusChange:i,onSwitchToQuery:()=>t(`query`)}),e===`query`&&(0,d.jsx)(oe,{chunkCount:a}),e===`verify`&&(0,d.jsx)(se,{}),e===`about`&&(0,d.jsx)(ce,{})]}),(0,d.jsx)(`footer`,{className:`border-t border-slate-700/40 py-4 text-center text-xs text-slate-500`,children:`VDHF β Verification-Driven Hallucination Firewall Β· Built with React + FastAPI`})]})}(0,c.createRoot)(document.getElementById(`root`)).render((0,d.jsx)(l.StrictMode,{children:(0,d.jsx)(le,{})}));
|
frontend/dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
| 11 |
-
<script type="module" crossorigin src="/assets/index-
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-CVrfrRHK.css">
|
| 13 |
</head>
|
| 14 |
<body>
|
|
|
|
| 8 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 9 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 10 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
| 11 |
+
<script type="module" crossorigin src="/assets/index-I0eAJ0hd.js"></script>
|
| 12 |
<link rel="stylesheet" crossorigin href="/assets/index-CVrfrRHK.css">
|
| 13 |
</head>
|
| 14 |
<body>
|
frontend/src/App.jsx
CHANGED
|
@@ -270,7 +270,7 @@ function DetailTable({ text }) {
|
|
| 270 |
/* βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 271 |
/* TAB: UPLOAD DOCUMENTS */
|
| 272 |
/* βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 273 |
-
function UploadTab({ onStatusChange }) {
|
| 274 |
const [uploading, setUploading] = useState(false);
|
| 275 |
const [uploadedFiles, setUploadedFiles] = useState([]);
|
| 276 |
const [dragOver, setDragOver] = useState(false);
|
|
@@ -309,6 +309,8 @@ function UploadTab({ onStatusChange }) {
|
|
| 309 |
prev.map(f => f.name === file.name ? { ...f, status: "done", chunks: data.chunks_added } : f)
|
| 310 |
);
|
| 311 |
onStatusChange?.();
|
|
|
|
|
|
|
| 312 |
} catch (e) {
|
| 313 |
setError(e.message);
|
| 314 |
setUploadedFiles(prev => prev.filter(f => f.name !== file.name || f.status !== "uploading"));
|
|
@@ -734,7 +736,10 @@ export default function App() {
|
|
| 734 |
fetch(`${API}/status`).then((r) => r.json()).then(setStatus).catch(() => {});
|
| 735 |
}, []);
|
| 736 |
|
| 737 |
-
|
|
|
|
|
|
|
|
|
|
| 738 |
|
| 739 |
const chunkCount = status?.document_chunks ?? 0;
|
| 740 |
const totalDocs = (status?.documents_loaded?.length ?? 0) + (status?.uploaded_files?.length ?? 0);
|
|
@@ -797,7 +802,7 @@ export default function App() {
|
|
| 797 |
|
| 798 |
{/* ββ Content βββ */}
|
| 799 |
<main className="flex-1 max-w-5xl mx-auto px-6 py-8 w-full">
|
| 800 |
-
{tab === "upload" && <UploadTab onStatusChange={refreshStatus} />}
|
| 801 |
{tab === "query" && <QueryTab chunkCount={chunkCount} />}
|
| 802 |
{tab === "verify" && <VerifyTab />}
|
| 803 |
{tab === "about" && <AboutTab />}
|
|
|
|
| 270 |
/* βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 271 |
/* TAB: UPLOAD DOCUMENTS */
|
| 272 |
/* βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */
|
| 273 |
+
function UploadTab({ onStatusChange, onSwitchToQuery }) {
|
| 274 |
const [uploading, setUploading] = useState(false);
|
| 275 |
const [uploadedFiles, setUploadedFiles] = useState([]);
|
| 276 |
const [dragOver, setDragOver] = useState(false);
|
|
|
|
| 309 |
prev.map(f => f.name === file.name ? { ...f, status: "done", chunks: data.chunks_added } : f)
|
| 310 |
);
|
| 311 |
onStatusChange?.();
|
| 312 |
+
// Auto-switch to query tab after successful upload
|
| 313 |
+
setTimeout(() => onSwitchToQuery?.(), 1000);
|
| 314 |
} catch (e) {
|
| 315 |
setError(e.message);
|
| 316 |
setUploadedFiles(prev => prev.filter(f => f.name !== file.name || f.status !== "uploading"));
|
|
|
|
| 736 |
fetch(`${API}/status`).then((r) => r.json()).then(setStatus).catch(() => {});
|
| 737 |
}, []);
|
| 738 |
|
| 739 |
+
// Clear uploads on app start (clean slate each session)
|
| 740 |
+
useEffect(() => {
|
| 741 |
+
fetch(`${API}/clear-uploads`, { method: "POST" }).then(() => refreshStatus()).catch(() => refreshStatus());
|
| 742 |
+
}, [refreshStatus]);
|
| 743 |
|
| 744 |
const chunkCount = status?.document_chunks ?? 0;
|
| 745 |
const totalDocs = (status?.documents_loaded?.length ?? 0) + (status?.uploaded_files?.length ?? 0);
|
|
|
|
| 802 |
|
| 803 |
{/* ββ Content βββ */}
|
| 804 |
<main className="flex-1 max-w-5xl mx-auto px-6 py-8 w-full">
|
| 805 |
+
{tab === "upload" && <UploadTab onStatusChange={refreshStatus} onSwitchToQuery={() => setTab("query")} />}
|
| 806 |
{tab === "query" && <QueryTab chunkCount={chunkCount} />}
|
| 807 |
{tab === "verify" && <VerifyTab />}
|
| 808 |
{tab === "about" && <AboutTab />}
|