var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=ee(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},P={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),m=o(((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=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var ee=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function se(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function F(e,t){ae++,ie[ae]=e.current,e.current=t}var ce=oe(null),le=oe(null),I=oe(null),ue=oe(null);function de(e,t){switch(F(I,t),F(le,e),F(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}se(ce),F(ce,e)}function L(){se(ce),se(le),se(I)}function fe(e){e.memoizedState!==null&&F(ue,e);var t=ce.current,n=Hd(t,e.type);t!==n&&(F(le,e),F(ce,n))}function pe(e){le.current===e&&(se(ce),se(le)),ue.current===e&&(se(ue),Qf._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,R=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:z,Re=Math.log,ze=Math.LN2;function z(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var B=256,Be=262144,Ve=4194304;function V(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=V(n))):i=V(o):i=V(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=V(n))):i=V(o)):i=V(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function H(){var e=Ve;return Ve<<=1,!(Ve&62914560)&&(Ve=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function et(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[nt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),xt={},St={};function Ct(e){return xe.call(St,e)?!0:xe.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Tt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Et(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Dt(s):e.removeAttribute(`name`)}function It(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Dt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ut(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Kt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(bu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,`passive`,{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return un=i.slice(e,1<r?1-r:void 0)}function fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pn(){return!0}function mn(){return!1}function hn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?pn:mn,this.isPropagationStopped=mn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=h({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=h({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(h({},Cn,{dataTransfer:0})),En=hn(h({},vn,{relatedTarget:0})),Dn=hn(h({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(h({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(h({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(h({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(h({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(h({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(h({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(h({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=hn(h({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Ed(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){yd(e,0)}function ar(e){if(jt(pt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(an){var cr;if(an){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,Zt(e)),nn(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mt(e.document)}return t}function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Mt(r)||(r=Er,`selectionStart`in r&&wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Or&&yr(Or,r)||(Or=r,r=Ed(Dr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};an&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),vt(t,[e])}var Kr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function si(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ii(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return li(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ii(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ii(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ii(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],bi=0,xi=null,Si=1,Ci=``;function wi(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ti(e,t,n){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,xi=e;var r=Si;e=Ci;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-Le(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===xi;)xi=yi[--bi],yi[bi]=null,Ci=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null}function Oi(e,t){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,Si=t.id,Ci=t.overflow,xi=e}var ki=null,Ai=null,U=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Bt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:ki=ki.return}}function Li(e){if(e!==ki)return!1;if(!U)return Ii(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Ai&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else t===27?(t=Ai,Zd(e.type)?(e=lf,lf=null,Ai=e):Ai=t):Ai=ki?cf(e.stateNode.nextSibling):null;return!0}function Ri(){Ai=ki=null,U=!1}function zi(){var e=ji;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=oe(null),Hi=null,Ui=null;function Wi(e,t,n){F(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,se(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=dd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=N.S;N.S=function(e,t){eu=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=oe(null);function ha(){var e=ma.current;return e===null?q.pooledCache:e}function ga(e,t){t===null?F(ma,ma.current):F(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ci(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=fi(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(ne(t)||M(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=wa(n),p(e,t,n,r)}if(ne(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=wa(r),m(e,t,n,r,i)}if(ne(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&wi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&wi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&wi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&wi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&wi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=oe(null),Ya=oe(0);function Xa(e,t){e=Ul,F(Ya,e),F(Ja,t),Ul=e|t.baseLanes}function Za(){F(Ya,Ul),F(Ja,Ja.current)}function Qa(){Ul=Ya.current,se(Ja),se(Ya)}var $a=oe(null),eo=null;function to(e){var t=e.alternate;F(oo,oo.current&1),F($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){F(oo,oo.current),F($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(F(oo,oo.current),F($a,e),eo===null&&(eo=e)):io(e)}function io(){F(oo,oo.current),F($a,$a.current)}function ao(e){se($a),eo===e&&(eo=null),se(oo)}var oo=oe(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Is;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function So(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),G,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);vr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,a=Oo(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((G||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||co&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Ho(e){var t=$r(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,G,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(U){var n=q.formState;if(n!==null){a:{var r=W;if(U){if(Ai){b:{for(var i=Ai,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ai=cf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),G,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=G;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&yo(r,G.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return vr(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=vs(e,n,r),vr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ms(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,re,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=za(n);var r=Ba(t,e,n);r!==null&&(hu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Qr(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,vr(s,o))return Zr(e,t,i,0),q===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),G.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return G===null?vs(n,e,t):ys(n,G.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(hu(t,e,n),Va(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!yr(n,r)||!yr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Kr(e)}function Ks(e){console.error(e)}function qs(e){Kr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(U)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&s&&Ei(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=q,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,Ai=cf(s.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=lc(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ni,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(U){if(a?to(t):io(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ai=cf(c.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,F(oo,o),nc(e,t,r,n),r=U?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:fe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),F(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,U&&t.flags&1048576&&Ti(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ai=cf(e.firstChild),ki=t,U=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Bd(I.current).createElement(n),r[nt]=t,r[rt]=e,Pd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&U&&(r=t.stateNode=ff(t.type,t.pendingProps,I.current),ki=t,Mi=!0,a=Ai,Zd(t.type)?(lf=a,Ai=cf(r.firstChild)):Ai=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=Ai)&&(r=tf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,ki=t,Ai=cf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=Ai)&&(n=nf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,ki=t,Ai=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=q,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:H(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),L(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(pe(t),n=I.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=ce.current,Li(t)?Fi(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=ce.current,Li(t))Fi(t,o);else{var s=Bd(I.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=I.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return L(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(se(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return F(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Te()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=oo.current,F(oo,a?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),L(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(oo),null;case 4:return L(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&se(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),L();break;case 26:case 27:case 5:pe(t);break;case 4:L();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:se(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&se(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[rt]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Cr(e),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:N.T===null?$e():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||U){var e=Be;Be<<=1,!(Be&3932160)&&(Be=262144),Jl=e}else Jl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Ke(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Te(),10<a)){if(yu(r,t,Jl,!Bl),He(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},jl(t,a,d);var m=(a&62914560)===a?$l-Te():(a&4194048)===a?eu-Te():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!vr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Ui=Hi=null,Eo(e),Oa=null,ka=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=oi(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ue(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Xr(),n}function Cu(e,t){W=null,N.H=Is,t===va||t===ba?(t=Ea(),X=3):t===ya?(t=Ea(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,mi(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?eo===null:(Y&62914560)===Y||Y&536870912?e===eo:!1}function Tu(){var e=N.H;return N.H=Is,e===null?Is:e}function Eu(){var e=N.A;return N.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&$a.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,K=r,N.H=i,N.A=a,J===null&&(q=null,Y=0,Xr()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=Te()+500,Su(e,t)):Vl=Ue(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Sa(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Sa(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ui=Hi=null,N.H=r,N.A=a,K=n,J===null?(q=null,Y=0,Xr(),Wl):0}function ju(){for(;J!==null&&!Ce();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=si(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Ui=Hi=null,Eo(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,mi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,mi(n,e.current)),J=null;return}t.flags&32768?(U||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,qe(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(ke,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,P.p=a,N.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=xr(s,h),v=xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,P.p=r,N.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,P.p=r,N.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,we();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),Qe(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=Qe(su),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{P.p=a,N.T=r,Vu(e,t)}}function Wu(e,t,n){t=mi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Ke(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=mi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Ke(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Te()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=H()),e=$r(e,t),e!==null&&(Ke(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Se(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=He(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Te(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&R(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&R(r),Qe(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=cd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&R(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=He(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Se(De,ad):od()})}function dd(){if(nd===0){var e=ca;e===0&&(e=B,B<<=1,!(B&261888)&&(B=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Wr.length;hd++){var gd=Wr[hd];Gr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!on||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Ir:case Lr:case Rr:l=Dn;break;case Hr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c))if(sr)v=gr;else{v=mr;var y=pr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(s,n,i)}var b;if(Hn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Ed(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=rn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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 o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);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(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=Jt(``+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),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(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=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(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,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Bt(e,r,a,o);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(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Gt(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 a=null,o=null,s=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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}zt(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(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Gt(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[lt]||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),ut(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[lt])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(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(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=P.d;P.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=ft(e);t!==null&&t.tag===5&&t.type===`form`?ws(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=Pt(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),ht(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="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(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),ht(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="`+Pt(r)+`"][href="`+Pt(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),ht(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=mt(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`);ht(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=mt(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`),ht(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=mt(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`),ht(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 a=(a=I.current)?gf(a):null;if(!a)throw Error(i(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=mt(a).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 o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.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),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(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=mt(a).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(i(444,e))}}function Af(e){return`href="`+Pt(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),ht(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Pt(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~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,ht(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(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[lt]||a[nt]||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,ht(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ht(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:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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=ii(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function tp(e){return e?(e=ni,e):ni}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(hu(n,e,t),Va(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=$r(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=Ze(t);var n=$r(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.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=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=V(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=Te()+500,id(0,!1))}}break;case 31:case 13:s=$r(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=Zt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je: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=ft(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=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(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);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(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=ft(n);a!==null&&(e.splice(t,3),t-=3,Ss(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[rt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||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(i(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[it]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();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=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Pe=zp.inject(Rp),Fe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[it]=t.current,Sd(e),new Fp(t)}})),g=o(((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=h()})),_=o((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})),v=o(((e,t)=>{t.exports=_()})),y=g(),b=c(u(),1),x=v(),S={layers:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`m3 7 9-5 9 5-9 5z`}),(0,x.jsx)(`path`,{d:`m3 12 9 5 9-5M3 17l9 5 9-5`})]}),overview:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,x.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,x.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1.5`}),(0,x.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1.5`})]}),folder:(0,x.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),book:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`M12 5C9 3 5 3 2 4v15c3-1 7-1 10 1 3-2 7-2 10-1V4c-3-1-7-1-10 1z`}),(0,x.jsx)(`path`,{d:`M12 5v15`})]}),file:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,x.jsx)(`path`,{d:`M14 2v6h6M8 13h8M8 17h5`})]}),branch:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`6`,cy:`4`,r:`2`}),(0,x.jsx)(`circle`,{cx:`6`,cy:`20`,r:`2`}),(0,x.jsx)(`circle`,{cx:`18`,cy:`5`,r:`2`}),(0,x.jsx)(`path`,{d:`M6 6v12M18 7v3a4 4 0 0 1-4 4H6`})]}),chat:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`M21 11.5a8.5 8.5 0 0 1-8.5 8.5H4l-3 2V11.5A8.5 8.5 0 0 1 9.5 3h3a8.5 8.5 0 0 1 8.5 8.5z`}),(0,x.jsx)(`path`,{d:`M7 11h9M7 15h5`})]}),checkSquare:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}),(0,x.jsx)(`path`,{d:`m7 12 3 3 7-7`})]}),graph:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`12`,cy:`4`,r:`2.5`}),(0,x.jsx)(`circle`,{cx:`4`,cy:`18`,r:`2.5`}),(0,x.jsx)(`circle`,{cx:`20`,cy:`18`,r:`2.5`}),(0,x.jsx)(`path`,{d:`m11 6-6 10M13 6l6 10M7 18h10`})]}),shield:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`m12 2 9 4v6c0 5-9 10-9 10S3 17 3 12V6z`}),(0,x.jsx)(`path`,{d:`m8 11 3 3 5-5`})]}),settings:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`m9 3-1 3-3 1v4l2 1-1 3 3 3 3-1 1 2h4l1-3 3-1v-4l-2-1 1-3-3-3-3 1-1-2z`}),(0,x.jsx)(`circle`,{cx:`12`,cy:`11`,r:`3`})]}),search:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`10.5`,cy:`10.5`,r:`7.5`}),(0,x.jsx)(`path`,{d:`m16 16 5 5`})]}),chevron:(0,x.jsx)(`path`,{d:`m9 5 7 7-7 7`}),down:(0,x.jsx)(`path`,{d:`m6 9 6 6 6-6`}),plus:(0,x.jsx)(`path`,{d:`M12 5v14M5 12h14`}),arrow:(0,x.jsx)(`path`,{d:`M4 12h16m-6-6 6 6-6 6`}),arrowUp:(0,x.jsx)(`path`,{d:`M12 19V5m-6 6 6-6 6 6`}),bell:(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(`path`,{d:`M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4`})}),sun:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,x.jsx)(`path`,{d:`M12 1v2m0 18v2M1 12h2m18 0h2M4 4l2 2m12 12 2 2M4 20l2-2M18 6l2-2`})]}),moon:(0,x.jsx)(`path`,{d:`M21 13a9 9 0 0 1-10-10A9 9 0 1 0 21 13z`}),users:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`9`,cy:`7`,r:`3`}),(0,x.jsx)(`path`,{d:`M2 21v-3a7 7 0 0 1 14 0v3M17 4a3 3 0 0 1 0 6M19 14a5 5 0 0 1 3 5v2`})]}),check:(0,x.jsx)(`path`,{d:`m5 12 4 4L19 6`}),clock:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,x.jsx)(`path`,{d:`M12 7v5l3 2`})]}),alert:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`m10.3 3-8 14A2 2 0 0 0 4 20h16a2 2 0 0 0 1.7-3l-8-14a2 2 0 0 0-3.4 0z`}),(0,x.jsx)(`path`,{d:`M12 8v5m0 3v.1`})]}),info:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,x.jsx)(`path`,{d:`M12 11v6m0-10v.1`})]}),upload:(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(`path`,{d:`M12 16V3m-5 5 5-5 5 5M3 16v5h18v-5`})}),attach:(0,x.jsx)(`path`,{d:`m21 11-9 9a6 6 0 0 1-8.5-8.5L13 2a4 4 0 0 1 5.5 5.5L9 17a2 2 0 0 1-3-3l9-9`}),more:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`}),(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,x.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`})]}),close:(0,x.jsx)(`path`,{d:`m6 6 12 12M6 18 18 6`}),external:(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(`path`,{d:`M14 3h7v7M21 3 11 13M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5`})}),lock:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`rect`,{x:`4`,y:`10`,width:`16`,height:`12`,rx:`3`}),(0,x.jsx)(`path`,{d:`M8 10V6a4 4 0 0 1 8 0v4`})]}),eye:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z`}),(0,x.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),eyeOff:(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(`path`,{d:`m3 3 18 18M10.6 5.1A11.5 11.5 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4M6.5 6.5A21 21 0 0 0 2 12s3.5 7 10 7a12 12 0 0 0 5.5-1.5M10 10a3 3 0 0 0 4 4`})}),filter:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`M3 6h18M6 12h12M9 18h6`}),(0,x.jsx)(`circle`,{cx:`8`,cy:`6`,r:`2`,fill:`currentColor`,stroke:`none`}),(0,x.jsx)(`circle`,{cx:`16`,cy:`12`,r:`2`,fill:`currentColor`,stroke:`none`})]}),menu:(0,x.jsx)(`path`,{d:`M3 6h18M3 12h18M3 18h18`}),spark:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`path`,{d:`m12 2 2.5 7.5L22 12l-7.5 2.5L12 22l-2.5-7.5L2 12l7.5-2.5z`}),(0,x.jsx)(`path`,{d:`m20 1 .8 2.2L23 4l-2.2.8L20 7l-.8-2.2L17 4l2.2-.8z`})]})};function C({name:e,size:t=20,style:n,className:r=``}){return(0,x.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.65`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:n,className:r,children:S[e]||S.file})}var w={userHash:`5ad5c1934a4602677ed173d3bf0d69aab489aba11309b165f0b68725220fcf47`,administratorHash:`198352b6a8078a827be267c847d39506629d3af446a3cc0bce670dd3a6b5d753`};async function T(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return[...new Uint8Array(t)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function E(e,t,n){if(!e.teams.includes(t)||!n)throw Error(`Choose a team and enter the system password.`);let r=e.teamAccess[t],i=await T(n),a=i===r?.administratorHash?`administrator`:i===r?.userHash?`user`:``;if(!a)throw Error(`The password does not match the selected team.`);return{team:t,role:a,name:`${t} ${a===`administrator`?`Administrator`:`User`}`,authenticated:!0}}function D(e){e.templates.forEach(e=>{e.name=e.name.replace(/CCIL/g,`Testcraft`)}),e.documents.filter(e=>e.synthetic).forEach(e=>{e.excerpt=e.excerpt?.replace(/CCIL/g,`Testcraft`)}),e.teamAccess||={};for(let t of e.teams)e.teamAccess[t]||={...w};let t=e=>typeof e==`string`?e.replace(/ (Normal User|Contributor|Reviewer|Baseline Approver|Developer|Business User|BA)$/,` User`):e;return e.session.name=`${e.session.team} ${e.session.role===`administrator`?`Administrator`:`User`}`,e.questions.forEach(e=>{e.author=t(e.author),e.resolvedBy=t(e.resolvedBy),e.validatedBy=t(e.validatedBy)}),e.audit.forEach(e=>{e.actor=t(e.actor),e.action=e.action.replace(/ as (Normal User|Contributor|Reviewer|Baseline Approver|Developer|Business User|BA)$/,` as User`)}),Object.values(e.threads).forEach(e=>e.messages?.forEach(e=>{e.actor=t(e.actor)})),e.candidates.forEach(e=>e.decisions?.forEach(e=>{e.actor=t(e.actor)})),e.accessModelVersion===1?e:(e.session.role=e.session.role===`administrator`?`administrator`:`user`,e.session.authenticated=!1,e.workspaces.forEach(e=>{e.visibility=`team`,e.members=[e.team]}),e.baselines.forEach(e=>{e.status===`Approved`&&!e.parentId&&(e.status=`Active`)}),e.questions.forEach(e=>{e.status===`validated`||e.status===`submitted`&&e.answer&&e.sourceReference&&(e.answerSourceId||e.sourceId)?e.status=`resolved`:e.status===`submitted`&&(e.status=`open`),e.author=t(e.author),e.resolvedBy=t(e.validatedBy||e.author)}),e.templates.forEach(e=>{e.fields=e.fields.map(e=>e===`Reviewer status`?`Review status`:e)}),e.suites.forEach(e=>{e.templateSnapshot&&(e.templateSnapshot.fields=e.templateSnapshot.fields.map(e=>e===`Reviewer status`?`Review status`:e))}),e.accessModelVersion=1,e)}function O(e){return e.length?[]:[`Upload at least one Business, Technical, or Functional / Bug Information document.`]}function k(e,t,n,r){if(!e.session.authenticated||e.session.role!==`administrator`)throw Error(`Only an Administrator can add a team.`);if(!t||e.teams.some(e=>e.toLowerCase()===t.toLowerCase()))throw Error(`Enter a unique team name.`);if(![n,r].every(e=>/^[a-f0-9]{64}$/.test(e))||n===r)throw Error(`Provide different User and Administrator system passwords.`);e.teams.push(t),e.teamAccess[t]={userHash:n,administratorHash:r}}function A(e,t,n){return[...t.trim()?[]:[`Enter a System Baseline name.`],...e.baselines.some(n=>n.team===e.session.team&&n.status!==`Rejected`&&n.ref===t.trim())?[`This System Baseline name already exists.`]:[],...O(n)]}function j(e,t,n,r,i,a,o){let s=e.questions.find(e=>e.id===n&&e.workspaceId===t.id&&e.version===t.version);if(!s||!r.trim()||!a.trim()||!o.some(e=>e.id===i&&[`Ready`,`Reviewed locally`].includes(e.status)))throw Error(`Provide an answer, an accessible source, and its revision / location.`);Object.assign(s,{answer:r.trim(),answerSourceId:i,sourceReference:a.trim(),status:`resolved`,author:e.session.name,resolvedBy:e.session.name,answeredAt:new Date().toISOString()})}var M=`2026-10-14T09:30:00+05:30`,ee=[`Technical`,`Functional / Bug Information`,`Business`],te=[`Test ID`,`Title`,`Owner team`,`Category`,`Requirement`,`Objective`,`Preconditions`,`Test data`,`Steps`,`Expected result`,`Priority`,`Evidence`,`Review status`],ne={MCM:`Membership and Collateral Management`,RMS:`Risk Management`},N=e=>[`membership`,`mcm`,`membership and collateral management`,`membership & collateral management`].includes(e.trim().toLowerCase())?`MCM`:e.trim(),P=(e,t,n,r)=>({id:e,title:t,text:n,source:r}),re=[P(`VAL-001`,`Identifier format`,`Validate the identifier against the approved format.`,`d1`),P(`VAL-002`,`Required identifier`,`The member identifier is required in an incoming request.`,`d2`),P(`VAL-003`,`Identifier source`,`Validate the identifier using the approved source list.`,`d1`)],ie=(e,t,n,r,i,a={})=>({id:e,name:t,kind:n,category:r,excerpt:i,size:`Sample`,status:`Ready`,revision:2,team:`RMS`,date:M,synthetic:!0,...a});function ae(){return structuredClone({schema:1,session:{team:`RMS`,role:`user`,name:`RMS User`,authenticated:!1},activeWorkspaceId:`w1042`,teams:[`RMS`,`Securities`,`Membership`,`Forex`,`Derivatives`],baselines:[{id:`b1`,ref:`RMS-B1`,team:`RMS`,version:`1.2`,status:`Approved`,description:`Reusable RMS message reception and member validation knowledge.`,scope:`Message reception`,sourceIds:[`d1`,`d2`,`d5`],rules:re,incorporatedCRs:[],createdAt:M},{id:`b2`,ref:`RMS-B2`,team:`RMS`,version:`2.0`,status:`Approved`,description:`Approved RMS knowledge including explicit identifier rejection.`,scope:`Message reception`,sourceIds:[`d1`,`d2`,`d3`,`d5`],rules:re.map(e=>e.id===`VAL-002`?{...e,text:`Reject a request with a missing required member identifier.`,source:`d3`}:e),incorporatedCRs:[`cr1042`],createdAt:M},{id:`bs1`,ref:`SEC-B1`,team:`Securities`,version:`1.0`,status:`Approved`,description:`Sample Securities-owned settlement knowledge.`,scope:`Settlement`,sourceIds:[],rules:[],incorporatedCRs:[],createdAt:M}],crs:[{id:`cr1042`,ref:`CR-1042`,team:`RMS`,name:`Member identifier validation`,revision:2,requires:[],conflicts:[`cr1073`],changes:[{ruleId:`VAL-002`,op:`REPLACE`,title:`Required identifier`,before:re[1].text,after:`Reject a request with a missing required member identifier.`,source:`d3`}]},{id:`cr1051`,ref:`CR-1051`,team:`RMS`,name:`Settlement limit controls`,revision:1,requires:[],conflicts:[],changes:[{ruleId:`LIMIT-001`,op:`ADD`,title:`Settlement limit`,before:``,after:`Apply the approved participant settlement limit. Numeric limits remain symbolic sample fixtures.`,source:`d6`}]},{id:`cr1068`,ref:`CR-1068`,team:`RMS`,name:`Participant status updates`,revision:1,requires:[`cr1051`],conflicts:[],changes:[{ruleId:`STATUS-001`,op:`ADD`,title:`Participant status`,before:``,after:`Validate the participant status before applying a settlement limit.`,source:`d6`}]},{id:`cr1073`,ref:`CR-1073`,team:`RMS`,name:`Retire required identifier check`,revision:1,requires:[],conflicts:[`cr1042`],changes:[{ruleId:`VAL-002`,op:`REMOVE`,title:`Required identifier`,before:re[1].text,after:``,source:`d3`}]}],workspaces:[{id:`w1042`,ref:`CR-1042`,name:`Member identifier validation`,purpose:`Review changes to member validation at the RMS message boundary.`,team:`RMS`,baselineId:`b1`,crIds:[`cr1042`],version:1,visibility:`team`,members:[`RMS`],updatedAt:M,requirementCount:4,sharedContractIds:[`dshared`]},{id:`w1051`,ref:`CR-1051`,name:`Settlement limit controls`,purpose:`Verify participant settlement controls.`,team:`RMS`,baselineId:`b2`,crIds:[`cr1051`],version:1,visibility:`team`,members:[`RMS`],updatedAt:M,requirementCount:4,sharedContractIds:[]},{id:`w1068`,ref:`CR-1068`,name:`Participant status updates`,purpose:`Review status and limit dependencies.`,team:`RMS`,baselineId:`b2`,crIds:[`cr1051`,`cr1068`],version:1,visibility:`private`,members:[`RMS`],updatedAt:M,requirementCount:6,sharedContractIds:[]},{id:`w1073`,ref:`CR-1073`,name:`Message acknowledgement`,purpose:`Collect evidence for message acknowledgement.`,team:`RMS`,baselineId:`b2`,crIds:[],version:1,visibility:`team`,members:[`RMS`],updatedAt:M,requirementCount:3,sharedContractIds:[]}],documents:[ie(`d1`,`RMS_Message_Processor.sql`,`SQL`,0,`Synthetic example: member identifiers are checked against an approved format and source list. This is illustrative text, not actual Testcraft procedure logic.`,{baselineId:`b1`,locator:`Lines 18–32`}),ie(`d2`,`RMS_Receiving_BRD.pdf`,`PDF`,1,`Synthetic requirement: the member identifier is required in an incoming request. The approved identifier validation rules continue to apply.`,{baselineId:`b1`,locator:`Page 7 · Section 4.2`}),ie(`d3`,`CR-1042_Requirements.docx`,`DOCX`,1,`Synthetic change: reject a request when the required member identifier is absent. Timeout and retry behavior are not defined by this example.`,{workspaceId:`w1042`,crId:`cr1042`,locator:`Section 4.2`}),ie(`d4`,`Member_Validation_Screen.pdf`,`PDF`,0,`Synthetic screen reference: the member identifier is a request field. No concrete error code or screen behavior is established here.`,{workspaceId:`w1042`,locator:`Page 2 · Fields`}),ie(`d5`,`Member_Lifecycle.md`,`MD`,2,`Synthetic context: participants submit messages to RMS. This context explains terms and roles; expected behavior is established by functional requirements.`,{baselineId:`b1`,locator:`Participant roles`}),ie(`d6`,`Settlement_Controls.md`,`MD`,1,`Synthetic requirement: apply the approved settlement limit for the participant. Use symbolic fixture APPROVED_LIMIT; this example does not establish numeric policy.`,{workspaceId:`w1051`,crId:`cr1051`,locator:`Section 2`}),ie(`dshared`,`Securities_Message_Contract.pdf`,`PDF`,0,`Synthetic shared interface contract describes the request boundary. Timeout, retries, fallback, and duplicate handling are unspecified.`,{team:`Securities`,sharedWith:[`RMS`],locator:`v2.1 · Interface behavior`,revision:`2.1`})],questions:[{id:`q1`,workspaceId:`w1042`,version:1,requirement:`REQ-RMS-03`,title:`What timeout should RMS apply?`,why:`The shared interface contract does not define the timeout for a delayed response.`,requested:`Provide the approved timeout rule, applicability, and source revision.`,sourceId:`dshared`,status:`open`,answer:``},{id:`q2`,workspaceId:`w1042`,version:1,requirement:`REQ-RMS-03`,title:`What is the approved retry and fallback behavior?`,why:`Retry, fallback, and duplicate-handling rules are absent from the selected evidence.`,requested:`Provide the retry limit, fallback rule, duplicate handling, and a source reference.`,sourceId:`dshared`,status:`open`,answer:``},{id:`q3`,workspaceId:`w1068`,version:1,requirement:`REQ-RMS-06`,title:`Which participant statuses can proceed?`,why:`The sample source does not enumerate approved statuses.`,requested:`Attach the approved status definition or provide a source-backed answer.`,sourceId:`d6`,status:`open`,answer:``}],threads:{},templates:[{id:`t1`,name:`Testcraft structured test case`,team:`RMS`,version:1,description:`Evidence and requirement traceability with team review.`,fields:te,visibility:`team`},{id:`t2`,name:`Compact regression checklist`,team:`RMS`,version:1,description:`A concise checklist for focused regression reviews.`,fields:[`Test ID`,`Title`,`Category`,`Steps`,`Expected result`,`Evidence`,`Review status`],visibility:`team`}],suites:[{id:`s1`,name:`Settlement controls · Review suite`,workspaceId:`w1051`,version:1,baselineId:`b2`,crIds:[`cr1051`],templateId:`t1`,provisional:!1,status:`Ready for review`,createdAt:M,gaps:[],tests:[{id:`TC-RMS-001`,title:`Accept a request within the approved limit`,category:`Positive`,requirement:`LIMIT-001`,objective:`Verify an eligible request follows the approved limit rule.`,preconditions:`Approved participant and limit fixture available.`,data:`ELIGIBLE_PARTICIPANT, APPROVED_LIMIT`,steps:[`Prepare the approved participant fixture.`,`Submit a request within APPROVED_LIMIT.`,`Observe the outcome.`],expected:`The request is accepted under the approved sample limit rule.`,priority:`High`,rationale:`Core participant limit behavior.`,sourceIds:[`d6`],status:`Generated`,notes:``},{id:`TC-RMS-002`,title:`Reject a request exceeding the approved limit`,category:`Negative`,requirement:`LIMIT-001`,objective:`Verify a request outside the approved limit is rejected.`,preconditions:`Approved limit fixture available.`,data:`EXCEEDS_APPROVED_LIMIT`,steps:[`Prepare an above-limit request.`,`Submit the request.`,`Check the validation outcome.`],expected:`The above-limit request is rejected under the sample rule.`,priority:`High`,rationale:`Prevents acceptance outside approved controls.`,sourceIds:[`d6`],status:`Generated`,notes:``}]}],candidates:[{id:`c1`,ref:`RMS-B3`,team:`RMS`,parentId:`b2`,crIds:[`cr1051`],description:`Incorporate settlement limit controls into reusable RMS knowledge.`,status:`Pending review`,revision:1,createdAt:M,decisions:[]}],jobs:[],shares:[{id:`share1`,sourceId:`dshared`,owner:`Securities`,consumer:`RMS`,status:`Active`}],settings:{reasoningModel:``,extractionModel:``,embeddingModel:``,gateway:``,retryLimit:2},audit:[{id:`a1`,action:`Sample knowledge initialized`,actor:`Demo fixture`,at:M}]})}var oe=[`baselines`,`crs`,`workspaces`,`documents`,`questions`,`templates`,`suites`,`candidates`,`shares`];function se(){let e=ae(),t=new Set(e.workspaces.filter(e=>e.team===`RMS`).map(e=>e.id)),n=Object.fromEntries(oe.map(n=>[n,e[n].filter(e=>e.team===`RMS`||t.has(e.workspaceId)||e.consumer===`RMS`)])),r=new Map(Object.values(n).flat().map(e=>[e.id,`mcm-${e.id}`])),i=e=>typeof e==`string`?r.get(e)||e.replaceAll(`RMS`,`MCM`):Array.isArray(e)?e.map(i):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,i(t)])):e;return i(n)}function F(e){if(e.demoTeamVersion>=2)return ce(e);let t=se();for(let n of oe){let r=new Set(e[n].map(e=>e.id));e[n].push(...t[n].filter(e=>!r.has(e.id)))}e.teams=[`MCM`,...e.teams.filter(e=>e!==`MCM`)];let n=e.documents.find(e=>e.id===`dshared`);n&&!n.sharedWith.includes(`MCM`)&&n.sharedWith.push(`MCM`);let r=e.session.role===`administrator`?`administrator`:`user`;return e.session={team:`MCM`,role:r,name:`MCM ${r===`administrator`?`Administrator`:`User`}`},e.activeWorkspaceId=`mcm-w1042`,e.demoTeamVersion=2,ce(e)}function ce(e){e.teams=[`MCM`,...new Set(e.teams.map(N).filter(e=>e!==`MCM`))];for(let t of oe)for(let n of e[t]){for(let e of[`team`,`owner`,`consumer`])n[e]&&(n[e]=N(n[e]));n.sharedWith&&=[...new Set(n.sharedWith.map(N))],n.members&&=[...new Set(n.members.map(e=>e.replace(/^Membership /,`MCM `)))]}return e.session.team=N(e.session.team),e.session.name=e.session.name.replace(/^Membership /,`MCM `),e.demoTeamVersion=3,D(e)}function le(){return F(ae())}var I=`testcraft-studio-v2`,ue=`ccil-studio-demo-v1`,de=(0,b.createContext)(null),L=e=>`${e}-${globalThis.crypto?.randomUUID?.()||`${Date.now()}-${Math.random().toString(36).slice(2)}`}`,fe=()=>new Date().toISOString(),pe=e=>`${e.id}:${e.version}`,me=e=>[`user`,`administrator`].includes(e.session.role),he=e=>e.session.authenticated===!0&&e.session.role===`administrator`,ge=e=>e.workspaces.filter(t=>t.team===e.session.team);function _e(e,t){return t?e.questions.filter(e=>e.workspaceId===t.id&&e.version===t.version):[]}function ve(e,t){if(!t)return[];let n=e.baselines.find(e=>e.id===t.baselineId),r=new Map((n?.rules||[]).map(e=>[e.id,e]));e.crs.filter(e=>t.crIds.includes(e.id)).forEach(e=>e.changes.forEach(e=>{e.op===`REMOVE`?r.delete(e.ruleId):r.set(e.ruleId,{source:e.source})})),(t.customRules||[]).forEach(e=>r.set(e.id,e));let i=new Set([...r.values()].map(e=>e.source)),a=new Set([...e.baselines.flatMap(e=>e.rules.map(e=>e.source)),...e.crs.flatMap(e=>e.changes.map(e=>e.source))]);return e.documents.filter(r=>!(r.team===t.team&&(n?.sourceIds.includes(r.id)||(t.sourceIds||[]).includes(r.id)||r.workspaceId===t.id||t.crIds.includes(r.crId))||(t.sharedContractIds||[]).includes(r.id)&&e.shares.some(e=>e.sourceId===r.id&&e.consumer===t.team&&e.status===`Active`))||r.crId&&!t.crIds.includes(r.crId)&&!n?.incorporatedCRs.includes(r.crId)?!1:!a.has(r.id)||i.has(r.id))}function ye(e,t,n){let r=e.baselines.find(e=>e.id===t),i=[];(!r||![`Active`,`Approved`].includes(r.status))&&i.push(`Select an active System Baseline.`),r&&r.team!==e.session.team&&i.push(`The baseline must belong to the selected team.`);let a=e.crs.filter(e=>n.includes(e.id));for(let t of a){t.team!==e.session.team&&i.push(`${t.ref} belongs to another team.`),r?.incorporatedCRs.includes(t.id)&&i.push(`${t.ref} is already incorporated in ${r.ref}.`);for(let a of t.requires)!n.includes(a)&&!r?.incorporatedCRs.includes(a)&&i.push(`${t.ref} requires ${e.crs.find(e=>e.id===a)?.ref||a}.`);for(let r of t.conflicts)n.includes(r)&&i.push(`${t.ref} conflicts with ${e.crs.find(e=>e.id===r)?.ref||r}.`)}return{baseline:r,changes:a,issues:[...new Set(i)],diff:a.flatMap(e=>e.changes.map(t=>({...t,crRef:e.ref})))}}function be(e,t){if(!t)return{ready:!1,blockers:[`Select a workspace.`],questions:[],sources:[],verified:0};let n=_e(e,t),r=ve(e,t),i=n.filter(e=>e.status!==`resolved`),a=ye(e,t.baselineId,t.crIds),o=[...a.issues];t.requirementCount||o.push(`No reviewed requirements are available.`),r.some(e=>e.status===`Ready`||e.status===`Reviewed locally`)||o.push(`No reviewed evidence is available.`),r.some(e=>![`Ready`,`Reviewed locally`].includes(e.status))&&o.push(`Some sources still need local review.`),(t.sharedContractIds||[]).filter(e=>!r.some(t=>t.id===e)).length&&o.push(`A selected shared contract is no longer accessible. Update the knowledge selection.`);let s=new Set(r.filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)).map(e=>e.id)),c=new Map((a.baseline?.rules||[]).map(e=>[e.id,e]));return a.diff.forEach(e=>{e.op===`REMOVE`?c.delete(e.ruleId):c.set(e.ruleId,{source:e.source})}),(t.customRules||[]).forEach(e=>c.set(e.id,e)),[...c.values()].some(e=>!s.has(e.source))&&o.push(`A selected requirement is missing accessible reviewed evidence.`),{ready:!o.length,blockers:o,questions:n,sources:r,verified:Math.max(0,t.requirementCount-new Set(i.map(e=>e.requirement)).size),selection:a}}function xe(e,t){return t.baselineId?t.requirementCount?e.suites.some(e=>e.workspaceId===t.id&&e.version===t.version)?`Ready for review`:`Ready to generate`:`Draft`:t.pendingBaselineId?`Awaiting baseline approval`:`Add baseline`}function Se(e,t){let n=_e(e,t);t.version+=1,t.updatedAt=fe(),n.forEach(n=>e.questions.push({...n,id:L(`question`),version:t.version,status:`open`,answer:``,sourceReference:``,answerSourceId:``,author:null,answeredAt:null,validatedBy:null,validatedAt:null}))}function R(e,t){e.audit.unshift({id:L(`audit`),action:t,actor:e.session.name,team:e.session.team,at:fe()})}function Ce(){let e=le();for(let t of[`workspaces`,`documents`,`baselines`,`crs`,`questions`,`candidates`,`suites`,`jobs`,`shares`,`examples`,`audit`])e[t]=[];return e.threads={},e.activeWorkspaceId=``,e.session.authenticated=!1,e}function we(){try{let e=JSON.parse(localStorage.getItem(I)||localStorage.getItem(ue));if(e?.schema===1)return e.jobs=e.jobs.map(e=>[`running`,`queued`].includes(e.status)?{...e,status:`Interrupted`,stage:`Browser restarted. Retry this run.`}:e),F(e)}catch{}return Ce()}function Te({children:e}){let[t,n]=(0,b.useState)(we),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(``);(0,b.useEffect)(()=>{try{localStorage.setItem(I,JSON.stringify(t)),i(``)}catch{i(`Browser storage is full or unavailable. Your latest changes are only in memory. Export your records from Administration.`)}},[t]),(0,b.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>o(``),4500);return()=>clearTimeout(e)},[a]);let s=e=>n(t=>{let n=structuredClone(t);return e(n),n}),c=ge(t).find(e=>e.id===t.activeWorkspaceId);return(0,x.jsx)(de.Provider,{value:{state:t,mutate:s,workspace:c,toast:a,notify:o,saveError:r,reset:()=>{n(Ce()),o(`Application records reset.`)}},children:e})}var Ee=()=>(0,b.useContext)(de);function De(e,t,n=`text/plain`){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}function Oe(e){return``+e.map(e=>e.map(e=>{let t=String(e??``);return/^[=+@\-\t\r]/.test(t)&&(t=`'${t}`),`"${t.replaceAll(`"`,`""`)}"`}).join(`,`)).join(`\r
`)}function ke(e){let t=[],n=[],r=``,i=!1,a=e.replace(/^\uFEFF/,``);for(let e=0;e<a.length;e++){let o=a[e];o===`"`?i&&a[e+1]===`"`?(r+=`"`,e++):i=!i:o===`,`&&!i?(n.push(r),r=``):o===`
`&&!i?(n.push(r.replace(/\r$/,``)),t.push(n),n=[],r=``):r+=o}if(i)throw Error(`The CSV contains an unclosed quoted value.`);return n.push(r.replace(/\r$/,``)),n.some(Boolean)&&t.push(n),t}var Ae=[`Preparing local sample fixtures`,`Applying the selected test template`,`Checking sample source traceability`,`Ready for review`];function je(e,t,n){let r=ye(e,t.baselineId,t.crIds);if(r.issues.length)throw Error(r.issues.join(` `));if(!be(e,t).ready)throw Error(`Generation requires an approved baseline and reviewed source-linked requirements.`);let i=e.templates.find(e=>e.id===n&&e.team===t.team&&(e.visibility!==`workspace`||e.workspaceId===t.id));if(!i)throw Error(`Choose an accessible team template.`);let a=new Set(ve(e,t).map(e=>e.id)),o=new Map((r.baseline?.rules||[]).map(e=>[e.id,e]));r.diff.forEach(e=>{e.op===`REMOVE`?o.delete(e.ruleId):o.set(e.ruleId,{id:e.ruleId,title:e.title,text:e.after,source:e.source,changed:!0})}),(t.customRules||[]).forEach(e=>o.set(e.id,e));let s=[...o.values()].filter(e=>a.has(e.source)).map((e,n)=>({id:`TC-${t.team.toUpperCase()}-${String(n+1).padStart(3,`0`)}`,title:`Verify ${e.title.toLowerCase()}`,category:e.changed?`Positive`:`Regression`,requirement:e.id,objective:`Check the selected revision of ${e.title}.`,preconditions:`Use an approved symbolic fixture applicable to this rule.`,data:`APPROVED_RULE_FIXTURE`,steps:[`Prepare the source-backed fixture for this rule.`,`Exercise ${e.title.toLowerCase()} within the owning team’s scope.`,`Record the observed result against the selected evidence.`],expected:e.text,priority:`Medium`,rationale:`Directly exercises a selected source-backed rule.`,sourceIds:[e.source],status:`Generated`,notes:``,revision:1})),c=_e(e,t).filter(e=>e.status!==`resolved`);_e(e,t).filter(e=>e.status===`resolved`&&a.has(e.answerSourceId||e.sourceId)).forEach((e,n)=>{let r=e.answerSourceId||e.sourceId;s.push({id:`TC-${t.team.toUpperCase()}-CL-${n+1}`,title:`Verify ${e.title.replace(/\?$/,``).toLowerCase()}`,category:`Dependency`,requirement:e.requirement,objective:`Check behavior supplied by reviewed workspace evidence.`,preconditions:`Use the fixture described by the reviewed clarification.`,data:`REVIEWED_CLARIFICATION_FIXTURE`,steps:[`Prepare the agreed fixture.`,`Exercise the approved behavior.`,`Compare the result to the reviewed answer.`],expected:e.answer,priority:`Medium`,rationale:`Covers a previously missing dependency rule.`,sourceIds:r&&a.has(r)?[r]:[],answerEvidence:e.sourceReference,status:`Generated`,notes:`User-provided evidence, saved by ${e.resolvedBy||e.author||t.team}.`,revision:1})});let l=i.fields.filter(e=>!te.some(t=>t.toLowerCase()===e.toLowerCase()));return s.forEach(e=>{e.customFields=Object.fromEntries(l.map(e=>[e,``]))}),{id:L(`suite`),name:`${t.name} · Test suite`,workspaceId:t.id,version:t.version,baselineId:t.baselineId,crIds:[...t.crIds],sharedContractIds:[...t.sharedContractIds||[]],templateId:n,templateSnapshot:structuredClone(i),provisional:!1,status:`Ready for review`,createdAt:fe(),gaps:c.map(e=>({requirement:e.requirement,title:e.title})),tests:s,demo:!0}}var Me=[`pdf`,`docx`,`txt`,`md`,`sql`];function Ne(e,t,n=1e4){return new Promise((r,i)=>{let a=setTimeout(()=>i(Error(t)),n);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}function Pe(e){return typeof FileReader>`u`?e.arrayBuffer():new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(Error(`Could not read this file. Select it again.`)),r.onabort=()=>n(Error(`File reading was interrupted. Select it again.`)),r.readAsArrayBuffer(e)})}function Fe(){return new Promise((e,t)=>{let n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(Error(e)))},i=setTimeout(()=>r(`File storage did not respond. Please try again.`),1e4),a=indexedDB.open(`ccil-local-files`,1);a.onupgradeneeded=()=>{a.result.objectStoreNames.contains(`files`)||a.result.createObjectStore(`files`)},a.onsuccess=()=>{n?a.result.close():(n=!0,clearTimeout(i),e(a.result))},a.onerror=()=>r(`File storage is unavailable. Please select the file again.`),a.onblocked=()=>r(`File storage is busy. Close other studio tabs and try again.`)})}async function Ie(e,t){let n=await Fe();try{await Ne(new Promise((r,i)=>{let a=n.transaction(`files`,e);t(a.objectStore(`files`)),a.oncomplete=r,a.onerror=()=>i(Error(`Could not save this file. Please try again.`)),a.onabort=()=>i(Error(`File saving was interrupted. Please try again.`))}),`File saving did not finish. Please try again.`)}finally{n.close()}}async function Le(e,t){let n=e.name.split(`.`).pop().toLowerCase();if(!Me.includes(n))throw Error(`${e.name}: use PDF, DOCX, TXT, Markdown, or SQL.`);if(e.size>50*1024*1024)throw Error(`${e.name}: maximum file size is 50 MB.`);if(!e.size)throw Error(`${e.name}: the file is empty.`);let r=L(`source`),i=await Ne(Pe(e),`File reading did not finish. Please select it again.`),a=await crypto.subtle.digest(`SHA-256`,i),o=Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``),s=[`txt`,`md`,`sql`].includes(n)?new TextDecoder().decode(i).slice(0,15e4):``;if([`txt`,`md`,`sql`].includes(n)&&!s.trim())throw Error(`${e.name}: no usable text was found.`);return await Ie(`readwrite`,t=>t.put(e,r)),{id:r,name:e.name,kind:n.toUpperCase(),size:`${(e.size/1024).toFixed(1)} KB`,bytes:e.size,checksum:o,excerpt:s,revision:1,status:`Staged`,synthetic:!1,date:fe(),...t}}async function Re(e){let t=await Fe();try{let n=await new Promise((n,r)=>{let i=t.transaction(`files`,`readonly`).objectStore(`files`).get(e.id);i.onsuccess=()=>n(i.result),i.onerror=r});if(!n)throw Error(`The source file is unavailable in this browser. Reattach the original file.`);let r=URL.createObjectURL(n),i=window.document.createElement(`a`);i.href=r,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}finally{t.close()}}var ze={Approved:`green`,Ready:`green`,"Reviewed locally":`green`,"Ready for review":`green`,Accepted:`green`,"Ready to generate":`green`,"Needs clarification":`amber`,"Pending review":`amber`,Submitted:`blue`,Staged:`blue`,Draft:`neutral`,Rejected:`red`,"Revision requested":`amber`,PROVISIONAL:`amber`,Completed:`green`,Interrupted:`amber`,Cancelled:`neutral`};function z({children:e,tone:t,dot:n=!0}){return(0,x.jsxs)(`span`,{className:`badge badge-${t||ze[e]||`neutral`}`,children:[n&&(0,x.jsx)(`span`,{className:`status-dot`}),e]})}function B({children:e,icon:t,variant:n=`secondary`,className:r=``,...i}){return(0,x.jsxs)(`button`,{type:`button`,className:`button button-${n} ${r}`,...i,children:[t&&(0,x.jsx)(C,{name:t,size:16}),` `,e]})}function Be({eyebrow:e,title:t,description:n,children:r}){let{state:i}=Ee();return(0,x.jsxs)(`div`,{className:`page-heading`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`eyebrow`,children:e||`${i.session.team} TEAM`}),(0,x.jsx)(`h1`,{children:t}),n&&(0,x.jsx)(`p`,{children:n})]}),r]})}function Ve({title:e=`Nothing here yet`,description:t,action:n}){return(0,x.jsxs)(`div`,{className:`empty-state`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`folder`,size:22})}),(0,x.jsx)(`h3`,{children:e}),(0,x.jsx)(`p`,{children:t}),n]})}function V({label:e,children:t,hint:n}){return(0,x.jsxs)(`label`,{className:`form-field`,children:[(0,x.jsx)(`span`,{children:e}),t,n&&(0,x.jsx)(`small`,{children:n})]})}function He({value:e,onChange:t,placeholder:n=`Search…`}){return(0,x.jsxs)(`label`,{className:`search-field`,children:[(0,x.jsx)(C,{name:`search`,size:17}),(0,x.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:n,"aria-label":n})]})}function Ue({value:e,onChange:t,items:n,label:r=`Sections`}){return(0,x.jsx)(`div`,{className:`page-tabs`,role:`tablist`,"aria-label":r,children:n.map(n=>(0,x.jsx)(`button`,{role:`tab`,"aria-selected":e===n,onClick:()=>t(n),className:e===n?`active`:``,children:n},n))})}function We({title:e,children:t,close:n,wide:r=!1}){let i=(0,b.useRef)(null),a=(0,b.useRef)(n);return a.current=n,(0,b.useEffect)(()=>{let e=document.activeElement,t=document.body.style.overflow;document.body.style.overflow=`hidden`,i.current?.querySelector(`button, input, textarea, select, [tabindex="0"]`)?.focus();let n=e=>{if(e.key===`Escape`&&a.current(),e.key!==`Tab`)return;let t=[...i.current.querySelectorAll(`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), [tabindex="0"]`)];e.shiftKey&&document.activeElement===t[0]&&(e.preventDefault(),t.at(-1)?.focus()),!e.shiftKey&&document.activeElement===t.at(-1)&&(e.preventDefault(),t[0]?.focus())};return document.addEventListener(`keydown`,n),()=>{document.body.style.overflow=t,document.removeEventListener(`keydown`,n),e?.focus?.()}},[]),(0,x.jsx)(`div`,{className:`modal-backdrop`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,x.jsxs)(`div`,{ref:i,className:`modal ${r?`modal-wide`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,children:[(0,x.jsxs)(`div`,{className:`modal-heading`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`eyebrow`,children:`TESTCRAFT STUDIO`}),(0,x.jsx)(`h2`,{id:`modal-title`,children:e})]}),(0,x.jsx)(`button`,{className:`icon-button`,onClick:n,"aria-label":`Close dialog`,children:(0,x.jsx)(C,{name:`close`})})]}),t]})})}function H({children:e,tone:t=`neutral`}){return(0,x.jsxs)(`div`,{className:`modal-note note-${t}`,children:[(0,x.jsx)(C,{name:t===`amber`?`alert`:`info`,size:16}),(0,x.jsx)(`span`,{children:e})]})}function Ge({count:e,page:t,onChange:n,size:r=6}){let i=Math.max(1,Math.ceil(e/r));return(0,x.jsxs)(`div`,{className:`table-footer`,children:[(0,x.jsx)(`span`,{children:e?`${(t-1)*r+1}–${Math.min(t*r,e)} of ${e}`:`0 records`}),(0,x.jsxs)(`div`,{className:`pagination`,children:[(0,x.jsx)(`button`,{disabled:t<=1,onClick:()=>n(t-1),"aria-label":`Previous page`,children:(0,x.jsx)(C,{name:`chevron`,size:13,style:{transform:`rotate(180deg)`}})}),(0,x.jsxs)(`span`,{children:[t,` / `,i]}),(0,x.jsx)(`button`,{disabled:t>=i,onClick:()=>n(t+1),"aria-label":`Next page`,children:(0,x.jsx)(C,{name:`chevron`,size:13})})]})]})}function Ke({navigate:e}){let{state:t,workspace:n}=Ee();if(!n)return null;let r=t.baselines.find(e=>e.id===n.baselineId);return(0,x.jsxs)(`div`,{className:`version-context`,children:[(0,x.jsxs)(`div`,{className:`context-label`,children:[(0,x.jsx)(C,{name:`layers`,size:16}),`Selected knowledge`]}),(0,x.jsxs)(`button`,{className:`version-chip`,onClick:()=>e(`versions`),children:[(0,x.jsx)(C,{name:`book`,size:14}),r?.ref||`No baseline`,r&&(0,x.jsxs)(`span`,{children:[`v`,r.version]})]}),n.crIds.map(e=>{let n=t.crs.find(t=>t.id===e);return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`span`,{className:`context-plus`,children:`+`}),(0,x.jsxs)(`span`,{className:`version-chip cr-chip`,children:[n?.ref,(0,x.jsxs)(`span`,{children:[`r`,n?.revision]})]})]},e)}),(0,x.jsx)(`span`,{className:`context-divider`}),(0,x.jsxs)(`span`,{className:`context-contract`,children:[(0,x.jsx)(C,{name:`lock`,size:13}),n.ref,` · Context `,n.version]}),(0,x.jsxs)(`button`,{className:`text-button context-change`,onClick:()=>e(`versions`),children:[`Change selection `,(0,x.jsx)(C,{name:`chevron`,size:13})]})]})}function qe({navigate:e}){return(0,x.jsx)(Ve,{title:`Choose a workspace`,description:`Create or open a workspace to use its selected knowledge context.`,action:(0,x.jsx)(B,{variant:`primary`,icon:`folder`,onClick:()=>e(`workspaces`),children:`Open workspaces`})})}function Je({sourceId:e,citation:t,close:n}){let{state:r,workspace:i,notify:a}=Ee(),o=r.documents.find(t=>t.id===e),s=o&&(o.team===r.session.team||ve(r,i).some(t=>t.id===e)),c=t?.id===e?{...o,...t}:o,l=o&&t&&(String(o.revision)!==String(t.revision)||t.checksum&&t.checksum!==o.checksum);return s?(0,x.jsxs)(We,{title:`Source evidence`,close:n,wide:!0,children:[(0,x.jsxs)(`div`,{className:`source-heading`,children:[(0,x.jsx)(`span`,{className:`table-icon soft-purple`,children:(0,x.jsx)(C,{name:`file`,size:22})}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h3`,{children:c.name}),(0,x.jsxs)(`p`,{children:[`Revision `,c.revision,` · `,c.locator||`Original document`,` · `,c.team]})]}),(0,x.jsx)(z,{tone:`purple`,children:t?`Cited revision`:`Reference document`})]}),l&&(0,x.jsx)(H,{children:`The current document has changed. This is the snapshot cited in the conversation; the original download belongs to a different revision.`}),t?.quote&&(0,x.jsx)(`blockquote`,{className:`chat-cited-quote`,children:t.quote}),(0,x.jsxs)(`div`,{className:`source-excerpt`,children:[(0,x.jsx)(`div`,{className:`eyebrow`,children:c.locator||`SOURCE PREVIEW`}),(0,x.jsx)(`pre`,{children:c.excerpt||`PDF and DOCX extraction will be supplied by the backend. Download the original file to inspect it locally.`})]}),c.checksum&&(0,x.jsxs)(`p`,{className:`checksum`,children:[`SHA-256: `,c.checksum]}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:n,children:`Close`}),!c.synthetic&&!l&&(0,x.jsx)(B,{icon:`external`,onClick:()=>Re(o).catch(e=>a(e.message)),children:`Download original`})]})]}):(0,x.jsx)(We,{title:`Source unavailable`,close:n,children:(0,x.jsx)(H,{children:`The source is not available in your current team and workspace context.`})})}function Ye({scope:e,onStaged:t,label:n=`Drop your documents here`}){let[r,i]=(0,b.useState)(!1),[a,o]=(0,b.useState)(``);async function s(n){if(r)return;i(!0),o(``);let a=await Promise.allSettled([...n].map(t=>Le(t,e))),s=a.filter(e=>e.status===`fulfilled`).map(e=>e.value),c=a.filter(e=>e.status===`rejected`).map(e=>e.reason.message);s.length&&t(s),o(c.join(` `)),i(!1)}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`label`,{className:`upload-zone ${r?`upload-busy`:``}`,onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),s(e.dataTransfer.files)},children:[(0,x.jsx)(`span`,{className:`upload-icon`,children:(0,x.jsx)(C,{name:`upload`,size:25})}),(0,x.jsx)(`strong`,{children:r?`Adding your documents…`:n}),(0,x.jsxs)(`span`,{children:[`or `,(0,x.jsx)(`em`,{children:`browse files`})]}),(0,x.jsx)(`small`,{children:`PDF, DOCX, TXT, Markdown, SQL · Up to 50 MB each`}),(0,x.jsx)(`input`,{type:`file`,multiple:!0,disabled:r,accept:`.pdf,.docx,.txt,.md,.sql`,onChange:e=>{s(e.target.files),e.target.value=``},"aria-label":`Choose evidence documents`})]}),a&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:a})]})}function Xe({navigate:e}){let{state:t,mutate:n}=Ee(),r=ge(t),i=t.baselines.filter(e=>e.team===t.session.team&&[`Active`,`Approved`].includes(e.status)),a=t.suites.filter(e=>r.some(t=>t.id===e.workspaceId)),o=t=>{n(e=>{e.activeWorkspaceId=t.id}),e(`workspace`)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${t.session.team} · YOUR TESTING SPACE`,title:`Workspace overview`,description:`From system knowledge to well-grounded test cases.`,children:(0,x.jsx)(B,{icon:`plus`,variant:`primary`,onClick:()=>e(`workspaces?create`),children:`Create workspace`})}),(0,x.jsx)(`div`,{className:`stats-grid`,children:[{label:`Workspaces`,value:r.length,icon:`folder`,note:`Across your team`,tone:`purple`,page:`workspaces`},{label:`Approved baselines`,value:i.length,icon:`layers`,note:`Ready to use`,tone:`blue`,page:`baselines`},{label:`Test suites`,value:a.length,icon:`checkSquare`,note:`Generated from your evidence`,tone:`green`,page:`suites`},{label:`Templates`,value:t.templates.filter(e=>e.team===t.session.team).length,icon:`file`,note:`Your preferred output format`,tone:`purple`,page:`templates`}].map(t=>(0,x.jsxs)(`button`,{className:`stat-card`,onClick:()=>e(t.page),children:[(0,x.jsxs)(`div`,{className:`stat-top`,children:[(0,x.jsx)(`span`,{children:t.label}),(0,x.jsx)(`span`,{className:`stat-icon soft-${t.tone}`,children:(0,x.jsx)(C,{name:t.icon,size:18})})]}),(0,x.jsx)(`strong`,{children:t.value}),(0,x.jsx)(`span`,{className:`stat-note`,children:t.note})]},t.label))}),(0,x.jsxs)(`section`,{className:`card start-guide`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`A clear path from evidence to tests`}),(0,x.jsx)(z,{tone:`purple`,children:`Your workflow`})]}),(0,x.jsx)(`div`,{className:`onboarding-grid`,children:[[`folder`,`Create a workspace`,`Give your testing work a dedicated space.`,`workspaces?create`],[`layers`,`Add a System Baseline`,`Upload documents and request approval.`,`baselines?create`],[`chat`,`Explore your evidence`,`Ask the system about uploaded knowledge.`,`chat`],[`spark`,`Generate test cases`,`Use a default or Excel template.`,`readiness`]].map(([t,n,r,i],a)=>(0,x.jsxs)(`button`,{className:`onboarding-step`,onClick:()=>e(i),children:[(0,x.jsxs)(`span`,{className:`step-kicker`,children:[`0`,a+1,(0,x.jsx)(C,{name:t,size:22})]}),(0,x.jsx)(`strong`,{children:n}),(0,x.jsx)(`p`,{children:r}),(0,x.jsx)(C,{name:`arrow`,size:16})]},n))})]}),(0,x.jsxs)(`section`,{className:`card workspace-list margin-top`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Your workspaces`}),(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>e(`workspaces`),children:[`View all `,(0,x.jsx)(C,{name:`arrow`,size:14})]})]}),r.length?(0,x.jsx)(`div`,{className:`table-scroll`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`WORKSPACE`}),(0,x.jsx)(`th`,{children:`SYSTEM BASELINE`}),(0,x.jsx)(`th`,{children:`STATUS`}),(0,x.jsx)(`th`,{})]})}),(0,x.jsx)(`tbody`,{children:r.slice(0,5).map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:(0,x.jsxs)(`button`,{className:`workspace-table-name`,onClick:()=>o(e),children:[(0,x.jsx)(`span`,{className:`table-icon soft-purple`,children:(0,x.jsx)(C,{name:`folder`,size:17})}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsx)(`small`,{children:e.ref})]})]})}),(0,x.jsx)(`td`,{children:t.baselines.find(t=>t.id===e.baselineId)?.ref||`Not connected yet`}),(0,x.jsx)(`td`,{children:(0,x.jsx)(z,{children:xe(t,e)})}),(0,x.jsx)(`td`,{children:(0,x.jsx)(B,{onClick:()=>o(e),children:`Open workspace`})})]},e.id))})]})}):(0,x.jsx)(Ve,{title:`Make room for your first test journey`,description:`Start with a workspace. You can create its System Baseline next.`,action:(0,x.jsx)(B,{variant:`primary`,icon:`plus`,onClick:()=>e(`workspaces?create`),children:`Create your first workspace`})})]})]})}function Ze({close:e}){let{state:t,workspace:n}=Ee();return(0,x.jsxs)(We,{title:`Shared team access`,close:e,children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:n.name}),(0,x.jsxs)(`div`,{className:`selection-summary`,children:[(0,x.jsx)(`span`,{children:`Owning team`}),(0,x.jsx)(`strong`,{children:n.team}),(0,x.jsx)(`small`,{children:`Everyone signed in to this team uses the same workspace access.`})]}),(0,x.jsx)(H,{children:`Users can create System Baselines, upload evidence, resolve questions, generate tests, and edit suites. Administrators also add teams and approve System Baseline creation and edits.`}),(0,x.jsx)(`div`,{className:`modal-actions`,children:(0,x.jsx)(B,{onClick:e,children:`Done`})})]})}function Qe({close:e,navigate:t,copyId:n=``}){let{state:r,mutate:i,notify:a}=Ee(),[o,s]=(0,b.useState)(0),[c,l]=(0,b.useState)(n?`copy`:`fresh`),[u,d]=(0,b.useState)(n||ge(r)[0]?.id||``),[f,p]=(0,b.useState)(r.baselines.find(e=>e.team===r.session.team&&[`Active`,`Approved`].includes(e.status))?.id||``),[m,h]=(0,b.useState)(``),[g,_]=(0,b.useState)(``),[v]=(0,b.useState)(`team`),y=ge(r).find(e=>e.id===u),S=c===`fresh`?``:c===`copy`?y?.baselineId:f,w=c===`copy`&&y?.crIds||[],T=S?ye(r,S,w):{issues:[],baseline:null},E=c===`fresh`||(c===`copy`?!!y:!!f);function D(n){if(n.preventDefault(),o!==2||T.issues.length||!m.trim())return;let s=L(`workspace`);i(e=>{let t={id:s,name:m.trim(),ref:`WS-${String(e.workspaces.length+1).padStart(4,`0`)}`,purpose:g.trim(),team:r.session.team,baselineId:S||``,crIds:w,visibility:v,members:[r.session.team],version:1,updatedAt:fe(),requirementCount:c===`copy`?y.requirementCount:T.baseline?.rules.length||0,sharedContractIds:c===`copy`?y.sharedContractIds:[],sourceIds:c===`copy`?ve(r,y).map(e=>e.id):[],customRules:c===`copy`?structuredClone(y.customRules||[]):[]};e.workspaces.unshift(t),e.activeWorkspaceId=s,c===`copy`&&_e(r,y).forEach(t=>e.questions.push({...t,id:L(`question`),workspaceId:s,version:1,answer:``,sourceReference:``,answerSourceId:``,author:null,resolvedBy:null,status:`open`,validatedAt:null})),R(e,`Created ${t.ref}${T.baseline?` from ${T.baseline.ref}`:``}`)}),a(`Workspace created. Chat starts with a fresh context.`),e(),t(`workspace`)}return(0,x.jsxs)(We,{title:`Create a workspace`,close:e,wide:!0,children:[(0,x.jsx)(`div`,{className:`wizard-steps`,children:[`Starting point`,`Workspace details`,`Review & create`].map((e,t)=>(0,x.jsxs)(`span`,{className:o>=t?`active`:``,children:[t+1,(0,x.jsx)(`small`,{children:e})]},e))}),o===0?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:`Start with the right knowledge for your change.`}),(0,x.jsx)(`div`,{className:`choice-list`,children:[{id:`fresh`,icon:`plus`,title:`Start a fresh workspace`,text:`Create your workspace first, then upload its baseline documents.`},{id:`baseline`,icon:`book`,title:`Use a System Baseline`,text:`Start from available, reusable system knowledge.`},{id:`copy`,icon:`folder`,title:`Copy an existing workspace`,text:`Reuse its selection. Chat history and answers start fresh.`}].map(e=>(0,x.jsxs)(`button`,{className:`choice-card ${c===e.id?`selected`:``}`,onClick:()=>l(e.id),children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:e.icon,size:20})}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`p`,{children:e.text})]}),(0,x.jsx)(`span`,{className:`radio-dot`})]},e.id))}),c===`baseline`&&(0,x.jsx)(V,{label:`System Baseline`,children:(0,x.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value),children:[(0,x.jsx)(`option`,{value:``,children:`Choose a baseline`}),r.baselines.filter(e=>e.team===r.session.team&&[`Active`,`Approved`].includes(e.status)).map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.ref,` · v`,e.version]},e.id))]})}),c===`copy`&&(0,x.jsx)(V,{label:`Source workspace`,children:(0,x.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),children:[(0,x.jsx)(`option`,{value:``,children:`Choose a workspace`}),ge(r).map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.ref,` · `,e.name]},e.id))]})}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:e,children:`Cancel`}),(0,x.jsxs)(B,{variant:`primary`,disabled:!E,onClick:()=>{s(1)},children:[`Continue `,(0,x.jsx)(C,{name:`arrow`,size:15})]})]})]}):(0,x.jsxs)(`form`,{onSubmit:D,children:[o===1?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(V,{label:`Workspace name`,children:(0,x.jsx)(`input`,{required:!0,autoFocus:!0,value:m,maxLength:100,onChange:e=>h(e.target.value),placeholder:`e.g. Participant validation review`})}),(0,x.jsx)(V,{label:`Purpose`,children:(0,x.jsx)(`textarea`,{value:g,maxLength:600,onChange:e=>_(e.target.value),placeholder:`What change will this workspace test?`,rows:3})}),(0,x.jsxs)(H,{children:[`This workspace is shared by everyone signed in to `,r.session.team,`. There are no individual access roles.`]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`selection-summary`,children:[(0,x.jsx)(`span`,{children:`Workspace`}),(0,x.jsx)(`strong`,{children:m}),(0,x.jsx)(`small`,{children:g||`No description added.`}),(0,x.jsxs)(`strong`,{children:[T.baseline?.ref||`Add a System Baseline after creating the workspace`,` `,w.map(e=>`+ ${r.crs.find(t=>t.id===e)?.ref}`).join(` `)]}),(0,x.jsxs)(`small`,{children:[v,` · `,r.session.team,` · New chat context`]})]}),T.issues.map(e=>(0,x.jsx)(H,{tone:`amber`,children:e},e)),(0,x.jsx)(H,{children:`Immutable source revisions are referenced. Copies do not duplicate source files or inherit private chat history.`})]}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>s(o-1),children:`Back`}),o===1?(0,x.jsx)(B,{variant:`primary`,disabled:!m.trim(),onClick:e=>{e.preventDefault(),s(2)},children:`Review workspace`}):(0,x.jsx)(B,{type:`submit`,variant:`primary`,icon:`check`,disabled:T.issues.length>0,children:`Create workspace`})]})]})]})}function $e({navigate:e,create:t=!1}){let{state:n,mutate:r}=Ee(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(`All statuses`),[c,l]=(0,b.useState)(1),[u,d]=(0,b.useState)(t),[f,p]=(0,b.useState)(``),m=ge(n).filter(e=>`${e.name} ${e.ref}`.toLowerCase().includes(i.toLowerCase())&&(o===`All statuses`||xe(n,e)===o)),h=t=>{r(e=>{e.activeWorkspaceId=t.id}),e(`workspace`)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${n.session.team} · TEAM SPACE`,title:`Your workspaces`,description:`Every change, its own knowledge context and review history.`,children:(0,x.jsx)(B,{icon:`plus`,variant:`primary`,onClick:()=>{p(``),d(!0)},children:`Create workspace`})}),(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsxs)(`div`,{className:`table-toolbar spacious`,children:[(0,x.jsx)(He,{value:i,onChange:e=>{a(e),l(1)},placeholder:`Search names or workspace references…`}),(0,x.jsx)(`select`,{className:`simple-select`,value:o,onChange:e=>{s(e.target.value),l(1)},children:[`All statuses`,`Awaiting baseline approval`,`Add baseline`,`Ready for review`,`Ready to generate`,`Draft`].map(e=>(0,x.jsx)(`option`,{children:e},e))})]}),(0,x.jsx)(`div`,{className:`table-scroll`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`WORKSPACE`}),(0,x.jsx)(`th`,{children:`BASELINE`}),(0,x.jsx)(`th`,{children:`STATUS`}),(0,x.jsx)(`th`,{children:`ACCESS`}),(0,x.jsx)(`th`,{children:`ACTIONS`})]})}),(0,x.jsx)(`tbody`,{children:m.slice((c-1)*6,c*6).map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:(0,x.jsxs)(`button`,{className:`workspace-table-name`,onClick:()=>h(e),children:[(0,x.jsx)(`span`,{className:`table-icon soft-purple`,children:(0,x.jsx)(C,{name:`folder`,size:18})}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsxs)(`small`,{children:[e.ref,` · Shared team access`]})]})]})}),(0,x.jsx)(`td`,{children:n.baselines.find(t=>t.id===e.baselineId)?.ref||`Not connected yet`}),(0,x.jsx)(`td`,{children:(0,x.jsx)(z,{children:xe(n,e)})}),(0,x.jsxs)(`td`,{children:[(0,x.jsx)(C,{name:`users`,size:13}),` Shared team`]}),(0,x.jsx)(`td`,{children:(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{onClick:()=>h(e),children:`Open`}),(0,x.jsx)(B,{onClick:()=>{p(e.id),d(!0)},children:`Copy`})]})})]},e.id))})]})}),!m.length&&(0,x.jsx)(Ve,{title:`No workspaces found`,description:`Try another search or create your first workspace.`}),(0,x.jsx)(Ge,{count:m.length,page:c,onChange:l})]}),u&&(0,x.jsx)(Qe,{copyId:f,close:()=>{d(!1),t&&e(`workspaces`)},navigate:e},f)]})}var et=e=>e&&[`Active`,`Approved`].includes(e.status),tt=(e,t)=>t.map(t=>{let n=e.documents.find(e=>e.id===t);if(!n)throw Error(`A baseline document is no longer available.`);return{id:t,revision:n.revision,checksum:n.checksum||`synthetic-sample`}});function nt(e,t,n,r=``,i=``){if(!e.session.authenticated)throw Error(`Sign in before submitting a baseline.`);let a=e.baselines.find(e=>e.id===i),o=e.workspaces.find(t=>t.id===r&&t.team===e.session.team);if(i&&(!et(a)||a.team!==e.session.team))throw Error(`Choose an approved System Baseline to edit.`);if(e.candidates.some(e=>e.status===`Pending review`&&(i?e.parentId===i:r&&e.workspaceId===r)))throw Error(`An approval request is already pending for this baseline or workspace.`);let s=a?O(n):A(e,t.ref,n);if(s.length)throw Error(s.join(` `));let c=n.map(e=>e.id);if(a&&JSON.stringify([...a.sourceIds].sort())===JSON.stringify([...c].sort())&&a.description===t.description&&(a.scope||``)===(t.scope||``))throw Error(`Add or remove a document, or update the baseline details.`);n.forEach(t=>{e.documents.some(e=>e.id===t.id)||e.documents.push({...t,status:`Ready`})});let l={id:L(`baseline`),ref:a?.ref||t.ref.trim(),team:e.session.team,description:t.description||``,scope:t.scope||``,version:a?`${Number(a.version.split(`.`)[0])+1}.0`:`1.0`,status:`Pending approval`,sourceIds:c,rules:(a?.rules||[]).filter(e=>c.includes(e.source)),incorporatedCRs:[...a?.incorporatedCRs||[]],parentId:a?.id||null,createdAt:fe()};e.baselines.push(l);let u={id:L(`candidate`),type:a?`edit`:`create`,baselineId:l.id,parentId:a?.id||null,workspaceId:o?.id||``,team:e.session.team,ref:l.ref,description:l.description,crIds:[],revision:1,status:`Pending review`,createdAt:fe(),decisions:[],manifest:{baseline:structuredClone(l),sources:tt(e,c),previousSourceIds:[...a?.sourceIds||[]]}};return e.candidates.unshift(u),o&&(o.pendingBaselineId=l.id),R(e,`Submitted System Baseline ${a?`edit`:`creation`}: ${l.ref}`),u}function rt(e,t){if(!t)return[];if(!t.manifest?.baseline){let n=[...ye(e,t.parentId,t.crIds||[]).issues];(t.crIds||[]).some(t=>!e.crs.find(e=>e.id===t)?.changes.length)&&n.push(`Add source-linked changes to each selected CR before requesting a baseline update.`);for(let r of t.manifest?.sources||[]){let i=e.documents.find(e=>e.id===r.id&&e.team===t.team);r.revision!==void 0&&(!i||i.revision!==r.revision||(i.checksum||`synthetic-sample`)!==r.checksum)&&n.push(`A submitted document changed or is unavailable. Submit a fresh request.`)}for(let r of t.manifest?.changes||[])e.crs.find(e=>e.id===r.id)?.revision!==r.revision&&n.push(`A submitted CR changed. Submit a fresh merge request.`);return[...new Set(n)]}let n=[];t.manifest.sources.length||n.push(`Keep at least one baseline document.`);for(let r of t.manifest.sources){let i=e.documents.find(e=>e.id===r.id&&e.team===t.team);(!i||i.revision!==r.revision||(i.checksum||`synthetic-sample`)!==r.checksum)&&n.push(`A submitted document changed or is unavailable. Submit a fresh request.`)}return t.parentId&&!et(e.baselines.find(e=>e.id===t.parentId))&&n.push(`The parent baseline is unavailable.`),[...new Set(n)]}function it(e,t,n){if(!e.session.authenticated)throw Error(`Sign in before submitting a CR merge.`);let r=e.workspaces.find(n=>n.id===t&&n.team===e.session.team);if(!r?.crIds.length)throw Error(`Select at least one CR in Knowledge versions.`);let i=ye(e,r.baselineId,r.crIds);if(i.issues.length)throw Error(i.issues.join(` `));if(i.changes.some(e=>!e.changes.length))throw Error(`Add source-linked changes to each selected CR.`);if(e.candidates.some(e=>e.workspaceId===r.id&&e.status===`Pending review`))throw Error(`This workspace already has a pending baseline request.`);let a=[...new Set([...i.baseline.sourceIds,...i.diff.map(e=>e.source)])],o=a.map(t=>e.documents.find(e=>e.id===t&&e.team===r.team));if(o.some(e=>!e||![`Ready`,`Reviewed locally`].includes(e.status)))throw Error(`Review every selected baseline and CR document before merging.`);let s=A(e,n,o);if(s.length)throw Error(s.join(` `));if(n.trim().length>60)throw Error(`Use a baseline name of 60 characters or fewer.`);let c={id:L(`candidate`),type:`changes`,ref:n.trim(),description:`Merge ${i.changes.map(e=>e.ref).join(`, `)} into ${i.baseline.ref}.`,team:r.team,workspaceId:r.id,parentId:r.baselineId,crIds:[...r.crIds],manifest:{parent:structuredClone(i.baseline),changes:structuredClone(i.changes),sources:tt(e,a),previousSourceIds:[...i.baseline.sourceIds]},status:`Pending review`,revision:1,createdAt:fe(),decisions:[]};return e.candidates.unshift(c),R(e,`Submitted CR merge: ${c.ref}`),c}function at(e,t,n,r=``,i=``){if(!he(e))throw Error(`Only an Administrator can approve or reject a baseline.`);let a=e.candidates.find(n=>n.id===t&&n.team===e.session.team);if(!a||a.status!==`Pending review`)throw Error(`This request has already been decided.`);if(![`Approved`,`Rejected`].includes(n))throw Error(`Choose an approval decision.`);if(n===`Rejected`&&!r.trim())throw Error(`Add a reason for rejection.`);if(n===`Approved`&&rt(e,a).length)throw Error(rt(e,a).join(` `));let o=e.baselines.find(e=>e.id===a.baselineId);if(n===`Approved`){if(a.manifest?.baseline){if(!o||o.status!==`Pending approval`)throw Error(`The submitted baseline is unavailable.`);Object.assign(o,structuredClone(a.manifest.baseline),{status:`Approved`,manifestHash:i})}else{let t=ye(e,a.parentId,a.crIds||[]),n=a.manifest||{parent:t.baseline,changes:t.changes},r=new Map(n.parent.rules.map(e=>[e.id,e]));n.changes.forEach(e=>e.changes.forEach(e=>{e.op===`REMOVE`?r.delete(e.ruleId):r.set(e.ruleId,{id:e.ruleId,title:e.title,text:e.after,source:e.source})})),o={...structuredClone(n.parent),id:L(`baseline`),ref:a.ref,description:a.description,version:`${Number(n.parent.version.split(`.`)[0])+1}.0`,parentId:a.parentId,status:`Approved`,sourceIds:[...new Set([...n.sources?.map(e=>e.id)||n.parent.sourceIds,...[...r.values()].map(e=>e.source)])],rules:[...r.values()],incorporatedCRs:[...new Set([...n.parent.incorporatedCRs,...a.crIds])],manifestHash:i,createdAt:fe()},e.baselines.push(o),a.baselineId=o.id}let t=e.workspaces.find(e=>e.id===a.workspaceId&&e.team===a.team);if(t&&(t.pendingBaselineId===o.id||!t.baselineId||t.baselineId===a.parentId)){let n=(e.baselines.find(e=>e.id===t.baselineId)?.sourceIds||[]).filter(e=>!o.sourceIds.includes(e));t.customRules=(t.customRules||[]).filter(e=>!n.includes(e.source)),t.baselineId=o.id,t.pendingBaselineId=``,t.crIds=t.crIds.filter(e=>!o.incorporatedCRs.includes(e)),t.requirementCount=o.rules.length+t.customRules.length,Se(e,t)}}else{o&&(o.status=`Rejected`);let t=e.workspaces.find(e=>e.id===a.workspaceId);t?.pendingBaselineId===a.baselineId&&(t.pendingBaselineId=``)}return a.status=n,a.decisions.push({decision:n,actor:e.session.name,at:fe(),rationale:r.trim(),revision:a.revision,manifestHash:i}),R(e,`${n} System Baseline ${a.type===`create`?`creation`:`edit`}: ${a.ref}`),o}function ot({close:e,onCreated:t,baseline:n=null,workspaceId:r=``}){let{state:i,mutate:a,notify:o}=Ee(),[s,c]=(0,b.useState)(n?.ref||``),[l,u]=(0,b.useState)(n?.description||``),[d,f]=(0,b.useState)(n?.scope||``),[p,m]=(0,b.useState)(()=>n?i.documents.filter(e=>n.sourceIds.includes(e.id)):[]),[h,g]=(0,b.useState)(0),[_,v]=(0,b.useState)(``);function y(c){c.preventDefault();try{let c=structuredClone(i),u=nt(c,{ref:s,description:l,scope:d},p,r,n?.id),f=c.baselines.find(e=>e.id===u.baselineId);a(e=>{e.baselines.push(f),e.candidates.unshift(u),p.forEach(t=>{e.documents.some(e=>e.id===t.id)||e.documents.push({...t,status:`Ready`})});let t=e.workspaces.find(e=>e.id===u.workspaceId);t&&(t.pendingBaselineId=f.id),R(e,`Submitted baseline ${u.type}: ${f.ref}`)}),t?.(f.id),e(),o(`Submitted for Administrator approval.`)}catch(e){v(e.message)}}return(0,x.jsxs)(We,{title:n?`Edit System Baseline`:`Create a System Baseline`,close:e,wide:!0,children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:n?`Add or remove documents. Your approved version stays available until this edit is approved.`:`Build the foundation for your workspace with at least one document.`}),(0,x.jsxs)(`form`,{onSubmit:y,children:[(0,x.jsxs)(`div`,{className:`form-grid`,children:[(0,x.jsx)(V,{label:`System Baseline name`,children:(0,x.jsx)(`input`,{required:!0,maxLength:60,readOnly:!!n,placeholder:`e.g. Membership and collateral`,value:s,onChange:e=>c(e.target.value)})}),(0,x.jsx)(V,{label:`Owning team`,children:(0,x.jsx)(`input`,{value:i.session.team,readOnly:!0})})]}),(0,x.jsx)(V,{label:`Description`,children:(0,x.jsx)(`textarea`,{rows:2,value:l,onChange:e=>u(e.target.value),maxLength:600,placeholder:`Describe the system knowledge.`})}),(0,x.jsx)(V,{label:`Application / process scope (optional)`,children:(0,x.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),maxLength:100,placeholder:`e.g. Membership and collateral`})}),(0,x.jsx)(`div`,{className:`category-tabs document-category-picker`,role:`tablist`,"aria-label":`Baseline document categories`,children:ee.map((e,t)=>(0,x.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h===t,className:h===t?`active`:``,onClick:()=>g(t),children:[e,(0,x.jsx)(`span`,{children:p.filter(e=>e.category===t).length})]},e))}),(0,x.jsx)(Ye,{scope:{team:i.session.team,category:h},onStaged:e=>m(t=>[...t,...e])}),(0,x.jsx)(`div`,{className:`baseline-staged-files`,children:p.map(e=>(0,x.jsxs)(`div`,{className:`selected-file`,children:[(0,x.jsx)(C,{name:`file`,size:16}),(0,x.jsxs)(`span`,{children:[e.name,(0,x.jsx)(`small`,{children:ee[e.category]})]}),(0,x.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`Remove ${e.name}`,onClick:()=>m(t=>t.filter(t=>t.id!==e.id)),children:(0,x.jsx)(C,{name:`close`,size:14})})]},e.id))}),(0,x.jsx)(H,{children:`Any one Business, Technical, or Functional / Bug Information document is sufficient. Baseline creation and edits require Administrator approval.`}),_&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:_}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:e,children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,disabled:!p.length||!s.trim(),children:`Submit for approval`})]})]})]})}function st({navigate:e,create:t=!1}){let{state:n,workspace:r}=Ee(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(t?`create`:``),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(`Documents`),[m,h]=(0,b.useState)(0),g=n.baselines.filter(e=>e.team===n.session.team&&`${e.ref} ${e.description}`.toLowerCase().includes(i.toLowerCase())),_=n.baselines.find(e=>e.id===o&&e.team===n.session.team),v=_?n.documents.filter(e=>_.sourceIds.includes(e.id)):[],y=_&&n.candidates.some(e=>e.parentId===_.id&&e.status===`Pending review`);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${n.session.team} · SYSTEM KNOWLEDGE`,title:_?.ref||`System Baselines`,description:_?.description||`Approved knowledge for your testing workspaces.`,children:_?(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{onClick:()=>s(``),children:`All baselines`}),[`Active`,`Approved`].includes(_.status)&&(0,x.jsx)(B,{variant:`primary`,icon:`edit`,disabled:y,onClick:()=>l(`edit`),children:y?`Edit awaiting approval`:`Edit baseline`})]}):(0,x.jsx)(B,{icon:`plus`,variant:`primary`,onClick:()=>l(`create`),children:`Create System Baseline`})}),_?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`detail-summary`,children:[(0,x.jsx)(z,{tone:[`Active`,`Approved`].includes(_.status)?`green`:`amber`,children:_.status}),(0,x.jsxs)(`span`,{children:[`Owning team: `,(0,x.jsx)(`strong`,{children:_.team})]}),(0,x.jsxs)(`span`,{children:[`Version: `,(0,x.jsx)(`strong`,{children:_.version})]}),(0,x.jsxs)(`span`,{children:[`Scope: `,(0,x.jsx)(`strong`,{children:_.scope||`General`})]})]}),(0,x.jsx)(Ue,{value:f,onChange:p,items:[`Documents`,`Knowledge rules`,`Version history`]}),f===`Documents`?(0,x.jsxs)(`div`,{className:`detail-grid`,children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsxs)(`div`,{className:`section-heading inset`,children:[(0,x.jsx)(`h2`,{children:`System Baseline documents`}),(0,x.jsx)(`span`,{className:`count-pill`,children:v.length})]}),(0,x.jsx)(`div`,{className:`category-tabs document-category-picker`,role:`tablist`,"aria-label":`System Baseline categories`,children:ee.map((e,t)=>(0,x.jsxs)(`button`,{role:`tab`,"aria-selected":m===t,className:m===t?`active`:``,onClick:()=>h(t),children:[e,(0,x.jsx)(`span`,{children:v.filter(e=>e.category===t).length})]},e))}),v.filter(e=>e.category===m).map(e=>(0,x.jsxs)(`div`,{className:`review-source`,children:[(0,x.jsxs)(`button`,{className:`source-link`,onClick:()=>d(e.id),children:[(0,x.jsx)(C,{name:`file`,size:19}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsxs)(`small`,{children:[e.kind,` · `,e.size,` · Revision `,e.revision]})]})]}),(0,x.jsx)(z,{children:e.status})]},e.id)),!v.some(e=>e.category===m)&&(0,x.jsx)(Ve,{title:`No document in this category`,description:`One document in any category is sufficient.`})]}),(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Baseline lifecycle`}),(0,x.jsxs)(`div`,{className:`lifecycle-steps`,children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(C,{name:`upload`,size:18}),`Submit documents`]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(C,{name:`shield`,size:18}),`Administrator approval`]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(C,{name:`check`,size:18}),`Use approved knowledge`]})]}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Creation and document edits follow the same approval flow. Approved versions remain available for existing workspaces.`}),(0,x.jsx)(B,{className:`full-width margin-top`,onClick:()=>e(`approvals`),children:`View baseline approvals`}),[`Active`,`Approved`].includes(_.status)&&(0,x.jsx)(B,{className:`full-width margin-top`,onClick:()=>e(`workspace`),children:`Open workspace`})]})]}):f===`Knowledge rules`?(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsx)(`div`,{className:`section-heading`,children:(0,x.jsx)(`h2`,{children:`Knowledge manifest`})}),_.rules.map(e=>(0,x.jsxs)(`div`,{className:`rule-row`,children:[(0,x.jsx)(`span`,{className:`code-label`,children:e.id}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`p`,{children:e.text})]}),(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>d(e.source),children:[`Source `,(0,x.jsx)(C,{name:`external`,size:12})]})]},e.id)),!_.rules.length&&(0,x.jsx)(Ve,{title:`Documents are ready for your requirements`,description:`Record source-linked requirements in the workspace before generating test cases.`})]}):(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsx)(`div`,{className:`section-heading`,children:(0,x.jsx)(`h2`,{children:`System Baseline version history`})}),n.baselines.filter(e=>e.team===_.team&&(e.ref===_.ref||e.id===_.parentId)).map(e=>(0,x.jsxs)(`button`,{className:`history-row`,onClick:()=>s(e.id),children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`layers`,size:17})}),(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`strong`,{children:[e.ref,` · v`,e.version]}),(0,x.jsx)(`small`,{children:new Date(e.createdAt).toLocaleDateString(`en-IN`)})]}),(0,x.jsx)(z,{children:e.status}),(0,x.jsx)(C,{name:`chevron`,size:15})]},e.id))]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`library-toolbar`,children:[(0,x.jsx)(He,{value:i,onChange:a,placeholder:`Search System Baselines…`}),(0,x.jsx)(`span`,{className:`subtle`,children:`Versioned system knowledge`})]}),(0,x.jsx)(`div`,{className:`library-grid`,children:g.map(e=>(0,x.jsxs)(`button`,{className:`card library-card`,onClick:()=>{s(e.id),p(`Documents`)},children:[(0,x.jsxs)(`div`,{className:`library-card-top`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`layers`,size:21})}),(0,x.jsx)(z,{tone:[`Active`,`Approved`].includes(e.status)?`green`:`amber`,children:e.status})]}),(0,x.jsx)(`h3`,{children:e.ref}),(0,x.jsx)(`p`,{children:e.description||`System knowledge for your workspace.`}),(0,x.jsxs)(`div`,{className:`library-meta`,children:[(0,x.jsxs)(`span`,{children:[`Version `,e.version]}),(0,x.jsxs)(`span`,{children:[e.sourceIds.length,` documents`]})]}),(0,x.jsxs)(`div`,{className:`library-footer`,children:[(0,x.jsx)(`span`,{children:e.scope||`System knowledge`}),(0,x.jsx)(C,{name:`arrow`,size:16})]})]},e.id))}),!g.length&&(0,x.jsx)(`section`,{className:`card`,children:(0,x.jsx)(Ve,{title:`Your system knowledge starts here`,description:`Create your workspace, then add a System Baseline with any one document.`,action:(0,x.jsx)(B,{onClick:()=>l(`create`),children:`Create System Baseline`})})})]}),c&&(0,x.jsx)(ot,{baseline:c===`edit`?_:null,workspaceId:r?.id||``,onCreated:s,close:()=>{l(``),t&&e(`baselines`)}}),` `,u&&(0,x.jsx)(Je,{sourceId:u,close:()=>d(``)})]})}function ct({close:e}){let{state:t,workspace:n,mutate:r,notify:i}=Ee(),[a]=(0,b.useState)(()=>L(`cr`)),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(0),[f,p]=(0,b.useState)([]),m=t.crs.some(e=>e.ref===o.trim()&&e.team===n.team),h=o.trim()&&c.trim()&&!m&&!O(f).length;function g(t){t.preventDefault(),h&&(r(e=>{e.crs.push({id:a,ref:o.trim(),name:c.trim(),team:n.team,revision:1,requires:[],conflicts:[],changes:[]}),e.documents.push(...f.map(e=>({...e,status:`Ready`})));let t=e.workspaces.find(e=>e.id===n.id);t.crIds.push(a),Se(e,t),R(e,`Created ${o.trim()} with ${f.length} document(s)`)}),e(),i(`CR created with its supporting document(s). No separate approval is required.`))}return(0,x.jsxs)(We,{title:`Add a change request`,close:e,wide:!0,children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:`One document from any category is enough to create a CR.`}),(0,x.jsxs)(`form`,{onSubmit:g,children:[(0,x.jsxs)(`div`,{className:`form-grid`,children:[(0,x.jsx)(V,{label:`CR / SDR reference`,children:(0,x.jsx)(`input`,{required:!0,value:o,onChange:e=>s(e.target.value),placeholder:`CR-1080`,maxLength:60})}),(0,x.jsx)(V,{label:`Change name`,children:(0,x.jsx)(`input`,{required:!0,value:c,onChange:e=>l(e.target.value),maxLength:120})})]}),(0,x.jsx)(`div`,{className:`category-tabs document-category-picker`,role:`tablist`,"aria-label":`CR upload categories`,children:ee.map((e,t)=>(0,x.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":u===t,className:u===t?`active`:``,onClick:()=>d(t),children:[e,(0,x.jsx)(`span`,{children:f.filter(e=>e.category===t).length})]},e))}),(0,x.jsx)(Ye,{scope:{team:n.team,workspaceId:n.id,crId:a,category:u},onStaged:e=>p(t=>[...t,...e])}),f.map(e=>(0,x.jsxs)(`div`,{className:`selected-file`,children:[(0,x.jsx)(C,{name:`file`,size:16}),(0,x.jsxs)(`span`,{children:[e.name,(0,x.jsx)(`small`,{children:ee[e.category]})]}),(0,x.jsx)(z,{tone:`green`,children:`Attached`}),(0,x.jsx)(B,{onClick:()=>p(t=>t.filter(t=>t.id!==e.id)),children:`Remove`})]},e.id)),(0,x.jsx)(H,{children:f.length?`The one-document minimum is met. Other categories can remain empty.`:`Upload at least one Business, Technical, or Functional / Bug Information document. All three are not required.`}),m&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:`This CR reference already exists in your team.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:e,children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,disabled:!h,children:`Create CR`})]})]})]})}function lt({navigate:e}){let{state:t,mutate:n,workspace:r,notify:i}=Ee(),[a,o]=(0,b.useState)(0),[s,c]=(0,b.useState)(`Evidence & scope`),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(``),[p,m]=(0,b.useState)(``),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(``),[y,S]=(0,b.useState)(``),[w,T]=(0,b.useState)(``),[E,D]=(0,b.useState)(``);if(!r)return(0,x.jsx)(qe,{navigate:e});if(!r.baselineId){let n=t.baselines.find(e=>e.id===r.pendingBaselineId&&e.status===`Pending approval`);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${r.ref} · YOUR NEW WORKSPACE`,title:r.name,description:r.purpose||`Bring your system knowledge into this workspace.`}),(0,x.jsxs)(`section`,{className:`card workspace-setup`,children:[(0,x.jsx)(`span`,{className:`setup-orbit`,children:(0,x.jsx)(C,{name:n?`shield`:`layers`,size:38})}),(0,x.jsx)(`span`,{className:`eyebrow`,children:n?`BASELINE SUBMITTED`:`NEXT · SYSTEM KNOWLEDGE`}),(0,x.jsx)(`h2`,{children:n?`Your baseline is awaiting approval`:`Give your workspace a foundation`}),(0,x.jsx)(`p`,{children:n?`${n.ref} is ready for an Administrator to review. Your documents become available once the baseline is approved.`:`Add your business, technical, or functional documents to create a System Baseline. One document is enough to get started.`}),(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{variant:`primary`,icon:n?`shield`:`plus`,onClick:()=>e(n?`approvals`:`baselines?create`),children:n?`View approval request`:`Create System Baseline`}),(0,x.jsx)(B,{onClick:()=>e(`versions`),children:`Use an approved baseline`})]}),(0,x.jsxs)(`div`,{className:`setup-path`,children:[(0,x.jsx)(`span`,{className:`done`,children:`Workspace created`}),(0,x.jsx)(C,{name:`chevron`,size:15}),(0,x.jsx)(`span`,{children:n?`Baseline submitted`:`Add documents`}),(0,x.jsx)(C,{name:`chevron`,size:15}),(0,x.jsx)(`span`,{children:`Administrator approval`}),(0,x.jsx)(C,{name:`chevron`,size:15}),(0,x.jsx)(`span`,{children:`Generate tests`})]})]})]})}let O=ve(t,r),k=be(t,r),A=ye(t,r.baselineId,r.crIds),j=[...A.baseline?.rules||[]];A.diff.forEach(e=>{let t=j.findIndex(t=>t.id===e.ruleId);t>=0&&j.splice(t,1),e.op!==`REMOVE`&&j.push({id:e.ruleId,title:e.title,text:e.after,source:e.source})});let M=[...j,...r.customRules||[]];k.questions.filter((e,t,n)=>n.findIndex(t=>t.requirement===e.requirement)===t).forEach(e=>{M.some(t=>t.id===e.requirement)||M.push({id:e.requirement,title:e.title,text:e.why,source:e.sourceId,question:!0})});function te(e){n(t=>{t.documents.find(t=>t.id===e).status=`Reviewed locally`,R(t,`Reviewed local CR source for ${r.ref}`)}),i(`Source reviewed locally. `)}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${r.ref} · ${r.visibility.toUpperCase()} WORKSPACE`,title:r.name,description:`${r.purpose} · Shared team workspace`,children:(0,x.jsx)(B,{icon:`users`,onClick:()=>u(`members`),children:`Team access`})}),(0,x.jsx)(Ke,{navigate:e}),(0,x.jsx)(Ue,{value:s,onChange:c,items:[`Evidence & scope`,`Requirements`,`Activity`]}),s===`Activity`?(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Workspace and team activity`}),(0,x.jsx)(z,{children:`Audit history`})]}),t.audit.filter(e=>e.team===r.team||e.actor===`Demo fixture`).slice(0,20).map(e=>(0,x.jsxs)(`div`,{className:`activity-row`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`clock`,size:17})}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:e.action.replace(/Team Baseline/g,`System Baseline`).replace(/local demo/gi,`studio`)}),(0,x.jsx)(`p`,{children:e.actor===`Demo fixture`?`System`:e.actor})]}),(0,x.jsx)(`small`,{children:new Date(e.at).toLocaleString(`en-IN`)})]},e.id))]}):(0,x.jsxs)(`div`,{className:`workspace-grid`,children:[(0,x.jsxs)(`div`,{className:`workspace-main`,children:[s===`Evidence & scope`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`section`,{className:`card evidence-card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsxs)(`div`,{className:`inline-heading`,children:[(0,x.jsx)(`h2`,{children:`Supporting evidence`}),(0,x.jsx)(`span`,{className:`count-pill`,children:O.length})]}),(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{onClick:()=>u(`cr`),children:`Add CR`}),(0,x.jsx)(B,{icon:`plus`,onClick:()=>u(`upload`),children:`Add evidence`})]})]}),(0,x.jsx)(`div`,{className:`category-tabs`,role:`tablist`,"aria-label":`CR evidence categories`,children:ee.map((e,t)=>(0,x.jsxs)(`button`,{role:`tab`,"aria-selected":a===t,className:a===t?`active`:``,onClick:()=>o(t),children:[e,(0,x.jsx)(`span`,{children:O.filter(e=>e.category===t).length})]},e))}),(0,x.jsx)(`p`,{className:`category-description`,children:[`Procedures, functions, packages, tables, screens, APIs, and implementation validations.`,`Expected behavior, BRDs, acceptance criteria, defects, and regression requirements.`,`Terminology, processes, participant roles, and background for this change.`][a]}),(0,x.jsxs)(`div`,{className:`document-list`,children:[O.filter(e=>e.category===a).map(e=>(0,x.jsxs)(`div`,{className:`evidence-source`,children:[(0,x.jsxs)(`button`,{className:`document-row`,onClick:()=>f(e.id),children:[(0,x.jsxs)(`span`,{className:`file-type file-${e.kind.toLowerCase()}`,children:[(0,x.jsx)(C,{name:`file`,size:21}),(0,x.jsx)(`small`,{children:e.kind})]}),(0,x.jsxs)(`span`,{className:`document-info`,children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsxs)(`small`,{children:[e.synthetic?`Reference document`:`Uploaded document`,e.team===r.team?``:` · Shared by ${e.team}`]}),(0,x.jsxs)(`span`,{children:[e.size,` · Revision `,e.revision]})]}),(0,x.jsx)(z,{children:e.status}),(0,x.jsx)(C,{name:`chevron`,size:15})]}),e.status===`Staged`&&(0,x.jsxs)(`div`,{className:`source-review-actions`,children:[(0,x.jsxs)(`label`,{children:[`Route to category`,(0,x.jsx)(`select`,{value:e.category,onChange:t=>n(n=>{n.documents.find(t=>t.id===e.id).category=Number(t.target.value)}),children:ee.map((e,t)=>(0,x.jsx)(`option`,{value:t,children:e},e))})]}),(0,x.jsx)(B,{onClick:()=>te(e.id),children:`Confirm local routing`})]})]},e.id)),!O.some(e=>e.category===a)&&(0,x.jsx)(Ve,{title:`No separate source in this category`,description:`A combined document or sufficient evidence in other categories may be enough.`,action:(0,x.jsx)(B,{onClick:()=>u(`upload`),children:`Add evidence`})})]}),(0,x.jsxs)(`div`,{className:`evidence-hint`,children:[(0,x.jsx)(C,{name:`info`,size:15}),`One combined document is welcome. These are categories, not three compulsory files.`]})]}),(0,x.jsxs)(`div`,{className:`scope-card`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`shield`,size:19})}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h3`,{children:`Clear team boundaries`}),(0,x.jsxs)(`p`,{children:[r.team,`-owned requirements and explicitly shared contracts are in scope.`]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(C,{name:`lock`,size:12}),`Other teams’ private implementation details are excluded.`]})]}),(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>e(`graph`),children:[`Explore dependencies `,(0,x.jsx)(C,{name:`arrow`,size:14})]})]})]}),(0,x.jsxs)(`section`,{className:`card requirements-card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsxs)(`div`,{className:`inline-heading`,children:[(0,x.jsx)(`h2`,{children:`Requirements in scope`}),(0,x.jsx)(`span`,{className:`count-pill`,children:M.length})]}),(0,x.jsx)(B,{icon:`plus`,onClick:()=>u(`requirement`),children:`Add requirement`})]}),(0,x.jsx)(`div`,{className:`table-scroll`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`REQUIREMENT`}),(0,x.jsx)(`th`,{children:`EVIDENCE`}),(0,x.jsx)(`th`,{children:`STATUS`})]})}),(0,x.jsx)(`tbody`,{children:M.map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:(0,x.jsxs)(`button`,{className:`requirement-name`,onClick:()=>f(e.source),children:[(0,x.jsx)(`small`,{children:e.id}),(0,x.jsx)(`strong`,{children:e.title})]})}),(0,x.jsx)(`td`,{children:(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>f(e.source),children:[`Open source `,(0,x.jsx)(C,{name:`external`,size:12})]})}),(0,x.jsx)(`td`,{children:(0,x.jsx)(z,{tone:e.question&&k.questions.some(t=>t.requirement===e.id&&t.status!==`resolved`)?`amber`:`green`,children:e.question&&k.questions.some(t=>t.requirement===e.id&&t.status!==`resolved`)?`Evidence gap`:`Source linked`})})]},e.id))})]})}),!M.length&&(0,x.jsx)(Ve,{title:`No reviewed requirements yet`,description:`Record the expected behavior and link it to an uploaded document.`})]})]}),(0,x.jsxs)(`section`,{className:`card readiness-card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Your next step`}),(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`spark`,size:20})})]}),(0,x.jsx)(z,{tone:k.ready?`green`:`neutral`,children:k.ready?`Ready to generate`:`Build your evidence`}),(0,x.jsx)(`h3`,{children:`Turn your evidence into test cases.`}),(0,x.jsx)(`p`,{children:`Choose a test-case format and generate from the requirements available in this workspace.`}),(0,x.jsx)(B,{className:`full-width`,variant:`primary`,icon:`spark`,onClick:()=>e(`readiness`),children:`Generate test cases`}),(0,x.jsx)(B,{className:`full-width margin-top`,icon:`chat`,onClick:()=>e(`chat`),children:`Ask the system`})]})]}),l===`members`&&(0,x.jsx)(Ze,{close:()=>u(``)}),l===`upload`&&(0,x.jsxs)(We,{title:`Add CR evidence`,close:()=>u(``),children:[(0,x.jsx)(V,{label:`Proposed evidence category`,children:(0,x.jsx)(`select`,{value:a,onChange:e=>o(Number(e.target.value)),children:ee.map((e,t)=>(0,x.jsx)(`option`,{value:t,children:e},e))})}),(0,x.jsx)(H,{children:`Functional evidence defines expected behavior. Business context explains terms and processes. Mixed documents can be reviewed by section later.`}),(0,x.jsx)(`div`,{className:`margin-top`,children:(0,x.jsx)(Ye,{scope:{team:r.team,workspaceId:r.id,category:a,crId:r.crIds[0]},onStaged:e=>{n(t=>{t.documents.push(...e),Se(t,t.workspaces.find(e=>e.id===r.id)),R(t,`Staged ${e.length} CR sources for ${r.ref}`)}),u(``),i(`Files saved locally. Review their routing; knowledge context was updated.`)}})})]}),l===`requirement`&&(0,x.jsx)(We,{title:`Add a reviewed requirement`,close:()=>u(``),children:(0,x.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),!(!y||!p.trim()||!h.trim()||!_.trim())&&(n(e=>{let t=e.workspaces.find(e=>e.id===r.id);t.customRules=[...t.customRules||[],{id:p.trim(),title:h,text:_,source:y}],t.requirementCount+=1,Se(e,t),R(e,`Added source-linked requirement ${p}`)}),u(``),i(`Requirement added to this workspace context.`))},children:[(0,x.jsx)(V,{label:`Requirement ID`,children:(0,x.jsx)(`input`,{required:!0,value:p,onChange:e=>m(e.target.value),placeholder:`REQ-${r.team}-04`})}),(0,x.jsx)(V,{label:`Title`,children:(0,x.jsx)(`input`,{required:!0,value:h,onChange:e=>g(e.target.value)})}),(0,x.jsx)(V,{label:`Approved expected behavior`,children:(0,x.jsx)(`textarea`,{required:!0,rows:3,value:_,onChange:e=>v(e.target.value)})}),(0,x.jsx)(V,{label:`Supporting source`,children:(0,x.jsxs)(`select`,{required:!0,value:y,onChange:e=>S(e.target.value),children:[(0,x.jsx)(`option`,{value:``,children:`Choose evidence`}),O.filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)).map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,x.jsx)(H,{children:`User-provided requirements stay scoped to this workspace. They do not update a System Baseline.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>u(``),children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,disabled:M.some(e=>e.id===p.trim()),children:`Save requirement`})]})]})}),l===`cr`&&(0,x.jsx)(ct,{close:()=>u(``)}),d&&(0,x.jsx)(Je,{sourceId:d,close:()=>f(``)})]})}function ut({navigate:e}){let{state:t,mutate:n,workspace:r,notify:i}=Ee(),[a,o]=(0,b.useState)(r?.baselineId||``),[s,c]=(0,b.useState)(r?.crIds||[]),[l,u]=(0,b.useState)(``);if(!r)return(0,x.jsx)(qe,{navigate:e});let d=ye(t,a,s),f=a!==r.baselineId||JSON.stringify([...s].sort())!==JSON.stringify([...r.crIds].sort()),p=new Set(d.diff.map(e=>e.ruleId));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${r.ref} · KNOWLEDGE CONTEXT ${r.version}`,title:`Select a knowledge version`,description:`Resolve the exact baseline and change revisions before using their evidence.`,children:(0,x.jsx)(B,{variant:`primary`,icon:`layers`,disabled:!r.crIds.length||f||!!d.issues.length,onClick:()=>e(`approvals?merge`),children:`Merge CRs into baseline`})}),(0,x.jsx)(Ke,{navigate:e}),(0,x.jsxs)(`div`,{className:`detail-grid margin-top`,children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Selected Baseline`}),(0,x.jsx)(`select`,{className:`wide-select margin-top`,value:a,onChange:e=>o(e.target.value),children:t.baselines.filter(e=>e.team===t.session.team&&[`Active`,`Approved`].includes(e.status)).map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.ref,` · Baseline Version `,e.version]},e.id))}),(0,x.jsx)(`h2`,{className:`margin-top`,children:`Change requests`}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`A partial change replaces only its affected rule. Unchanged knowledge stays in the manifest.`}),(0,x.jsx)(`div`,{className:`version-options`,children:t.crs.filter(e=>e.team===t.session.team).map(e=>{let n=d.baseline?.incorporatedCRs.includes(e.id);return(0,x.jsxs)(`label`,{children:[(0,x.jsx)(`input`,{type:`checkbox`,disabled:n,checked:s.includes(e.id),onChange:()=>c(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`strong`,{children:[e.ref,` · `,e.name]}),(0,x.jsxs)(`small`,{children:[`Revision `,e.revision,` · `,e.changes.length,` changes`,e.requires.length?` · Requires ${e.requires.map(e=>t.crs.find(t=>t.id===e)?.ref).join(`, `)}`:``]})]}),(0,x.jsx)(z,{tone:n?`neutral`:`purple`,children:n?`Incorporated`:`Available`})]},e.id)})}),!t.crs.some(e=>e.team===t.session.team)&&(0,x.jsx)(H,{children:`No change requests have been added to this team.`})]}),(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Resolved selection`}),(0,x.jsxs)(`div`,{className:`selection-summary`,children:[(0,x.jsx)(`span`,{children:`Baseline plus selected changes`}),(0,x.jsxs)(`strong`,{children:[d.baseline?.ref||`Choose a baseline`,d.changes.map(e=>` + ${e.ref}`).join(``)]}),(0,x.jsxs)(`small`,{children:[d.diff.length,` changed rules · `,d.baseline?.rules.filter(e=>!p.has(e.id)).length||0,` unchanged rules`]})]}),d.issues.map(e=>(0,x.jsx)(H,{tone:`amber`,children:e},e)),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Applying a new selection creates a fresh version-specific chat context and resets clarification readiness. Historical chats and suites retain their original version.`}),(0,x.jsx)(B,{variant:`primary`,className:`full-width margin-top`,disabled:!f||d.issues.length>0,onClick:()=>{n(e=>{let t=e.workspaces.find(e=>e.id===r.id);t.baselineId=a,t.crIds=s,Se(e,t),R(e,`Changed knowledge selection for ${r.ref}`)}),i(`New knowledge context created. Clarifications require revalidation.`)},children:`Use this version`})]})]}),(0,x.jsxs)(`section`,{className:`card margin-top`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Knowledge diff`}),(0,x.jsx)(z,{tone:`purple`,children:`Exact selected revisions`})]}),d.diff.map((e,t)=>(0,x.jsxs)(`div`,{className:`diff-block`,children:[(0,x.jsxs)(`div`,{className:`diff-heading`,children:[(0,x.jsx)(`span`,{className:`operation operation-${e.op.toLowerCase()}`,children:e.op}),(0,x.jsxs)(`strong`,{children:[e.ruleId,` · `,e.title]}),(0,x.jsx)(`span`,{children:e.crRef}),(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>u(e.source),children:[`Source `,(0,x.jsx)(C,{name:`external`,size:12})]})]}),(0,x.jsxs)(`div`,{className:`diff-columns`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`small`,{children:`BASELINE REVISION`}),(0,x.jsx)(`p`,{children:e.before||`New rule — not present in baseline`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`small`,{children:`SELECTED CR REVISION`}),(0,x.jsx)(`p`,{children:e.after||`Removed from resolved knowledge`})]})]})]},`${e.crRef}-${t}`)),d.baseline?.rules.filter(e=>!p.has(e.id)).map(e=>(0,x.jsxs)(`div`,{className:`rule-row`,children:[(0,x.jsx)(z,{children:`Unchanged`}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`strong`,{children:[e.id,` · `,e.title]}),(0,x.jsx)(`p`,{children:e.text})]})]},e.id)),!d.diff.length&&(0,x.jsx)(`div`,{className:`padded`,children:(0,x.jsx)(H,{children:`No CR changes selected. Retrieval uses the selected baseline manifest.`})})]}),(0,x.jsxs)(`section`,{className:`card padded margin-top`,children:[(0,x.jsx)(`h2`,{children:`Shared contracts`}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Select explicitly shared evidence. Changing a contract creates a fresh knowledge context.`}),t.shares.filter(e=>e.consumer===r.team&&e.status===`Active`).map(e=>(0,x.jsxs)(`label`,{className:`check-label`,children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:(r.sharedContractIds||[]).includes(e.sourceId),onChange:t=>{let a=t.target.checked;n(t=>{let n=t.workspaces.find(e=>e.id===r.id);n.sharedContractIds=a?[...new Set([...n.sharedContractIds||[],e.sourceId])]:(n.sharedContractIds||[]).filter(t=>t!==e.sourceId),Se(t,n),R(t,`Changed selected shared evidence for `+r.ref)}),i(`Shared evidence selection updated. Clarifications require revalidation.`)}}),t.documents.find(t=>t.id===e.sourceId)?.name,` · Shared by `,e.owner]},e.id)),r.sharedContractIds?.length?r.sharedContractIds.map(e=>{let i=t.documents.find(t=>t.id===e),a=t.shares.find(t=>t.sourceId===e&&t.consumer===r.team);return(0,x.jsxs)(`div`,{className:`history-row`,children:[(0,x.jsx)(C,{name:`lock`,size:18}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:i?.name}),(0,x.jsxs)(`small`,{children:[`Owner: `,i?.team,` · Revision `,i?.revision,` · Shared boundary only`]})]}),(0,x.jsx)(z,{tone:a?.status===`Active`?`green`:`amber`,children:a?.status||`Unavailable`}),a?.status!==`Active`&&(0,x.jsx)(B,{onClick:()=>n(t=>{let n=t.workspaces.find(e=>e.id===r.id);n.sharedContractIds=n.sharedContractIds.filter(t=>t!==e),Se(t,n)}),children:`Remove selection`})]},e)}):(0,x.jsx)(`p`,{className:`supporting-copy`,children:`No shared contracts are selected for this workspace.`})]}),l&&(0,x.jsx)(Je,{sourceId:l,close:()=>u(``)})]})}var dt=new TextDecoder;async function ft(e){let t=new Uint8Array(e),n=new DataView(e),r=new Map,i=t.length-22;for(;i>=Math.max(0,t.length-65557)&&n.getUint32(i,!0)!==101010256;)i--;if(i<0||i<t.length-65557)throw Error(`This is not a valid Excel .xlsx workbook.`);let a=n.getUint16(i+10,!0);if(a>500)throw Error(`Use a smaller Excel workbook.`);let o=n.getUint32(i+16,!0),s=0;for(let e=0;e<a;e++){if(o+46>t.length||n.getUint32(o,!0)!==33639248)throw Error(`The Excel workbook is damaged.`);let e=n.getUint16(o+8,!0),i=n.getUint16(o+10,!0),a=n.getUint32(o+20,!0),c=n.getUint32(o+24,!0),l=n.getUint16(o+28,!0),u=n.getUint16(o+30,!0),d=n.getUint16(o+32,!0),f=n.getUint32(o+42,!0);if(s+=c,e&1)throw Error(`Use an Excel workbook without password protection.`);if(s>12*1024*1024)throw Error(`Use an Excel workbook smaller than 12 MB when expanded.`);let p=dt.decode(t.slice(o+46,o+46+l));if(f+30>t.length||n.getUint32(f,!0)!==67324752)throw Error(`The Excel workbook is damaged.`);let m=f+30+n.getUint16(f+26,!0)+n.getUint16(f+28,!0);if(m+a>t.length)throw Error(`The Excel workbook is incomplete.`);r.set(p,async()=>{let e=t.slice(m,m+a);if(i===0)return dt.decode(e);if(i!==8)throw Error(`This Excel compression format is not supported. Save the file as .xlsx again.`);let n=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate-raw`)).getReader(),r=[],o=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;if(o+=t.length,o>c||o>12*1024*1024)throw await n.cancel(),Error(`The Excel workbook exceeds the size limit.`);r.push(t)}let s=new Uint8Array(o),l=0;return r.forEach(e=>{s.set(e,l),l+=e.length}),dt.decode(s)}),o+=46+l+u+d}return r}function pt(e){if(!e||/<!DOCTYPE|<!ENTITY/i.test(e))throw Error(`The Excel workbook contains unsupported XML.`);let t=new DOMParser().parseFromString(e,`application/xml`);if(t.getElementsByTagName(`parsererror`).length)throw Error(`The Excel workbook contains invalid XML.`);return t}var mt=(e,t)=>[...e.getElementsByTagNameNS(`*`,t)],ht=(e,t)=>mt(e,t).map(e=>e.textContent||``).join(``);function gt(e,t){let n=t.startsWith(`/`)?[]:e.split(`/`);for(let e of t.split(`/`))e===`..`?n.pop():e&&e!==`.`&&n.push(e);return n.join(`/`)}async function _t(e){if(e.size>2*1024*1024)throw Error(`Use a template smaller than 2 MB.`);let t,n=``;if(/\.csv$/i.test(e.name))t=ke(await e.text());else if(/\.xlsx$/i.test(e.name)){let r=await ft(await e.arrayBuffer()),i=mt(pt(await r.get(`xl/workbook.xml`)?.()),`sheet`)[0];if(!i)throw Error(`The Excel workbook has no worksheets.`);n=i.getAttribute(`name`)||`First worksheet`;let a=pt(await r.get(`xl/_rels/workbook.xml.rels`)?.()),o=i.getAttributeNS(`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,`id`),s=mt(a,`Relationship`).find(e=>e.getAttribute(`Id`)===o);if(!s||s.getAttribute(`TargetMode`)===`External`)throw Error(`The worksheet is not stored in this workbook.`);let c=gt(`xl`,s.getAttribute(`Target`)),l=r.has(`xl/sharedStrings.xml`)?mt(pt(await r.get(`xl/sharedStrings.xml`)()),`si`).map(e=>ht(e,`t`)):[];t=mt(pt(await r.get(c)?.()),`row`).slice(0,101).map(e=>{let t=[];for(let n of mt(e,`c`)){let e=[...(n.getAttribute(`r`)?.match(/^[A-Z]+/i)?.[0]||`A`).toUpperCase()].reduce((e,t)=>e*26+t.charCodeAt(0)-64,0)-1;if(e>199)throw Error(`Use a template with no more than 200 columns.`);let r=n.getAttribute(`t`),i=ht(n,`v`);t[e]=r===`s`?l[Number(i)]||``:r===`inlineStr`?ht(n,`t`):i}return Array.from({length:t.length},(e,n)=>t[n]||``)})}else throw Error(`Upload an Excel .xlsx or CSV template.`);if(!t.length||t[0].filter(e=>e.trim()).length<2)throw Error(`Put at least two named columns in the first worksheet row.`);let r=t[0].map((e,t)=>e.trim()||`Column ${t+1}`);if(new Set(r.map(e=>e.toLowerCase())).size!==r.length)throw Error(`Use a unique name for each template column.`);return{name:e.name,fields:r,rows:t.slice(1,101),sourceSheet:n}}function vt(e,t,n=``,r=`template-${crypto.randomUUID()}`){let i={id:r,name:t.name.replace(/\.(xlsx|csv)$/i,``),description:`Columns from ${t.name}${t.sourceSheet?` · ${t.sourceSheet}`:``}`,fields:[...t.fields],team:e.session.team,visibility:`team`,version:1};e.templates.push(i);let a=e.workspaces.find(t=>t.id===n&&t.team===e.session.team);return a&&(a.templateId=r),i}function yt({onSelected:e,disabled:t=!1}){let{mutate:n,workspace:r,notify:i}=Ee(),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(!1);async function d(e){let n=e.target.files?.[0];if(e.target.value=``,!(!n||t)){c(``),u(!0);try{o(await _t(n))}catch(e){c(e.message)}finally{u(!1)}}}function f(){if(t)return;let s=L(`template`);n(e=>{vt(e,a,r?.id,s),R(e,`Uploaded test template ${a.name}`)}),e?.(s),o(null),i(`Excel template selected. Its columns will be used for the test suite.`)}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`label`,{className:`button button-secondary file-button ${l?`is-busy`:``}`,children:[(0,x.jsx)(C,{name:`upload`,size:16}),l?`Reading template…`:`Upload Excel template`,(0,x.jsx)(`input`,{"aria-label":`Upload Excel template`,type:`file`,disabled:l||t,accept:`.xlsx,.csv`,onChange:d})]}),s&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:s}),a&&(0,x.jsxs)(We,{title:`Review your test-case template`,close:()=>o(null),wide:!0,children:[(0,x.jsxs)(`p`,{className:`modal-intro`,children:[a.name,a.sourceSheet?` · ${a.sourceSheet}`:``]}),(0,x.jsx)(`div`,{className:`field-chips`,children:a.fields.map((e,t)=>(0,x.jsxs)(`span`,{children:[t+1,`. `,e]},e))}),(0,x.jsx)(`div`,{className:`table-scroll import-table`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsx)(`tr`,{children:a.fields.map(e=>(0,x.jsx)(`th`,{children:e},e))})}),(0,x.jsx)(`tbody`,{children:a.rows.slice(0,3).map((e,t)=>(0,x.jsx)(`tr`,{children:a.fields.map((t,n)=>(0,x.jsx)(`td`,{children:e[n]||`—`},t))},t))})]})}),(0,x.jsx)(H,{children:`These column names define the output format. Example rows are formatting references; expected results come from your workspace evidence.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>o(null),children:`Cancel`}),(0,x.jsx)(B,{variant:`primary`,onClick:f,children:`Use this template`})]})]})]})}function bt({citations:e=[],onSource:t}){return e.length?(0,x.jsx)(`div`,{className:`chat-source-list`,"aria-label":`Supporting sources`,children:e.map((e,n)=>(0,x.jsxs)(`button`,{onClick:()=>t(e),className:`chat-source-link`,children:[(0,x.jsx)(`span`,{className:`chat-source-number`,children:n+1}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsxs)(`small`,{children:[`Revision `,e.revision,` · `,e.locator||`Document excerpt`]})]}),(0,x.jsx)(C,{name:`external`,size:13})]},e.id))}):null}function xt({message:e,savedSuite:t,historical:n,busy:r,onSource:i,onSave:a,onOpen:o,onExport:s,onPrompt:c}){let l=e.draft;return(0,x.jsxs)(`section`,{className:`chat-test-draft`,"aria-label":`${l.kind} test-case draft`,children:[(0,x.jsxs)(`div`,{className:`chat-draft-heading`,children:[(0,x.jsx)(`span`,{className:`chat-draft-icon`,children:(0,x.jsx)(C,{name:`checkSquare`,size:21})}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h3`,{children:[l.kind,` test cases`]}),(0,x.jsxs)(`p`,{children:[l.tests.length,` scenarios · `,l.templateSnapshot.name]})]}),(0,x.jsx)(z,{tone:t?`green`:`purple`,children:t?`Saved to suite`:`Draft`})]}),(0,x.jsxs)(`div`,{className:`chat-draft-meta`,children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(C,{name:`branch`,size:13}),`Context `,l.version]}),(0,x.jsxs)(`span`,{children:[`Template v`,l.templateSnapshot.version]}),(0,x.jsx)(`span`,{children:`Source-linked expected results`})]}),(0,x.jsx)(`div`,{className:`chat-test-list`,children:l.tests.map((t,n)=>(0,x.jsxs)(`details`,{className:`chat-test-case`,open:l.tests.length<=3||n===0,children:[(0,x.jsxs)(`summary`,{children:[(0,x.jsx)(`span`,{className:`chat-case-index`,children:String(n+1).padStart(2,`0`)}),(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`small`,{children:[t.id,` · `,t.requirement]}),(0,x.jsx)(`strong`,{children:t.title})]}),(0,x.jsx)(z,{tone:t.category===`Negative`?`amber`:`neutral`,children:t.category}),(0,x.jsx)(C,{name:`down`,size:15})]}),(0,x.jsxs)(`div`,{className:`chat-case-body`,children:[(0,x.jsx)(`p`,{className:`chat-case-objective`,children:t.objective}),(0,x.jsxs)(`div`,{className:`chat-case-facts`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h4`,{children:`Preconditions`}),(0,x.jsx)(`p`,{children:t.preconditions})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h4`,{children:`Test data`}),(0,x.jsx)(`p`,{children:t.data})]})]}),(0,x.jsx)(`h4`,{children:`Steps`}),(0,x.jsx)(`ol`,{children:t.steps.map((e,t)=>(0,x.jsx)(`li`,{children:e},t))}),(0,x.jsxs)(`div`,{className:`chat-case-expected`,children:[(0,x.jsx)(`h4`,{children:`Expected result`}),(0,x.jsx)(`p`,{children:t.expected})]}),(0,x.jsxs)(`div`,{className:`chat-case-bottom`,children:[(0,x.jsxs)(`span`,{children:[t.priority,` priority`]}),t.sourceIds.map(t=>{let n=e.citations?.find(e=>e.id===t);return n&&(0,x.jsxs)(`button`,{onClick:()=>i(n),children:[(0,x.jsx)(C,{name:`file`,size:12}),n.name,(0,x.jsx)(C,{name:`external`,size:11})]},t)})]})]})]},t.id))}),(0,x.jsxs)(`div`,{className:`chat-draft-actions`,children:[t?(0,x.jsx)(B,{variant:`primary`,icon:`checkSquare`,onClick:()=>o(t.id),children:`Open test suite`}):(0,x.jsx)(B,{variant:`primary`,icon:`check`,disabled:n||r,onClick:()=>a(e),children:`Save to test suite`}),(0,x.jsx)(B,{icon:`external`,disabled:n||r,onClick:()=>s(e),children:`Export CSV`}),(0,x.jsx)(B,{icon:`chat`,disabled:n||r,onClick:()=>c(`Add negative scenarios`),children:`Refine in chat`})]})]})}var St=[`Auto`,`Technical`,`Functional`,`Business`],Ct=new Set(`a an the and or to for of in on at by with from about against based using please can could would will should what which where when why how does do is are was were be it its this that these those my our your me us tell show find give explain answer answers information knowledge source sources document documents evidence requirement requirements test tests testing testcase testcases case cases scenario scenarios generate generated generating create build prepare write draft provide add include more refine focus only technical functional business regression positive negative boundary all any selected uploaded current workspace system`.split(` `)),wt=e=>[...new Set((e.toLowerCase().match(/[a-z0-9_-]+/g)||[]).filter(e=>e.length>2&&!Ct.has(e)).map(e=>e.replace(/s$/,``)))],Tt=(e,t)=>t.filter(t=>e.toLowerCase().includes(t)).length,Et=e=>/\b(reject|invalid|missing|absent|exceed|fail|prevent|disallow|denied)\w*\b|must not|not allowed/i.test(e),Dt=e=>/\b(accept|allow|success|succeed)\w*\b/i.test(e);function Ot(e,{kind:t=`Auto`,previousDraft:n}={}){let r=e.trim(),i=/\b(source|sources|citation|citations|reference|references|where.*document|where.*rule|evidence for)\b/i.test(r),a=/\b(test\s*cases?|tests|scenarios?)\b/i.test(r),o=/\b(generate|create|build|prepare|write|draft|give|provide)\b/i.test(r)&&a,s=!!n&&/^(?:please\s+)?(?:add|include|refine|focus|only|make|change|regenerate|more|keep|remove|use)\b/i.test(r),c=o?`generate`:s&&!i?`refine`:i?`sources`:`question`,l=(/\b(technical|database|sql|api|procedure|integration)\b/i.test(r)?`Technical`:/\b(functional|functionality|behaviour|behavior)\b/i.test(r)?`Functional`:/\b(business|uat|acceptance)\b/i.test(r)?`Business`:``)||(t===`Auto`?c===`refine`?n?.kind:``:t)||`Functional`,u=/\bnegative\b/i.test(r)?`Negative`:/\bpositive\b/i.test(r)?`Positive`:/\bregression\b/i.test(r)?`Regression`:``,d=wt(r).filter(e=>!/^(?:\d+|cr-\d+|sql|api|database|procedure|integration|uat|acceptance)$/.test(e)),f=[...new Set(r.toUpperCase().match(/CR-\d+/g)||[])],p=Number(r.match(/\b(?:generate|create|give|provide|write|prepare)\s+(\d+)\b/i)?.[1])||null;return{intent:c,kind:l,scenario:u,words:d,crRefs:f,count:Number.isSafeInteger(p)&&p>0?p:null,append:/^\s*(?:please\s+)?(?:add|include|more)\b/i.test(r)}}function kt(e,t){if(!e.session.authenticated||t.team!==e.session.team)throw Error(`Open a workspace belonging to your signed-in team.`);let n=e.baselines.find(e=>e.id===t.baselineId);return{workspaceId:t.id,version:t.version,team:t.team,baselineId:t.baselineId,baselineVersion:n?.version||``,baselineStatus:n?.status||``,crs:t.crIds.map(t=>({id:t,revision:e.crs.find(e=>e.id===t)?.revision})),sharedContractIds:[...t.sharedContractIds||[]].sort(),rules:[...n?.rules||[],...t.customRules||[]].map(e=>({id:e.id,text:e.text,source:e.source})),crChanges:e.crs.filter(e=>t.crIds.includes(e.id)).flatMap(e=>e.changes),sources:ve(e,t).map(e=>({id:e.id,revision:e.revision,checksum:e.checksum||``,status:e.status,text:e.excerpt||``})).sort((e,t)=>e.id.localeCompare(t.id))}}function At(e=[]){return[...e].reverse().find(e=>e.role===`assistant`&&e.draft)?.draft}function jt(e,t,{prompt:n,kind:r=`Auto`,templateId:i,messages:a=[]}){if(!n.trim())throw Error(`Enter a question or describe the test cases you need.`);let o=At(a),s=Ot(n,{kind:r,previousDraft:o}),c=kt(e,t);if(s.intent===`refine`&&JSON.stringify(o.contextSnapshot)!==JSON.stringify(c))throw Error(`Workspace knowledge changed. Generate a new draft before refining these cases.`);return{id:L(`chat-request`),prompt:n.trim(),context:c,threadKey:pe(t),templateId:i,...s,previousDraft:s.intent===`refine`?structuredClone(o):null,history:a.slice(-12).map(e=>({role:e.role,content:e.content}))}}function Mt(e,t){let n=e.workspaces.find(e=>e.id===t.context.workspaceId);if(!n||e.activeWorkspaceId!==n.id||JSON.stringify(kt(e,n))!==JSON.stringify(t.context))throw Error(`Workspace knowledge changed. Send your request again in the current context.`);return n}function Nt(e,t){return{id:e.id,name:e.name,revision:e.revision,checksum:e.checksum||``,team:e.team,locator:e.locator||`Uploaded document excerpt`,excerpt:e.excerpt||``,quote:t||``}}function Pt(e,t){let n=ye(e,t.baselineId,t.crIds),r=new Map((n.baseline?.rules||[]).map(e=>[e.id,e]));return n.diff.forEach(e=>{e.op===`REMOVE`?r.delete(e.ruleId):r.set(e.ruleId,{id:e.ruleId,title:e.title,text:e.after,source:e.source})}),(t.customRules||[]).forEach(e=>r.set(e.id,e)),[...r.values()]}function Ft(e,t,n){let r=ve(e,t).filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)),i=[...n.history].reverse().find(e=>e.role===`user`)?.content||``,a=n.words.length?n.words:wt(i),o=[...e.threads[n.threadKey]?.messages||[]].reverse().find(e=>e.role===`assistant`&&(e.citations?.length||e.sourceIds?.length)),s=n.intent===`sources`&&(!n.words.length||/\b(these|those|this|that|above|previous|result|cases)\b/i.test(n.prompt)),c=new Set(o?.citations?.map(e=>e.id)||o?.sourceIds||[]),l=r.map(e=>({doc:e,score:Tt(`${e.name} ${e.excerpt||``}`,a)}));if(s&&c.size?l=l.filter(e=>c.has(e.doc.id)):a.length?l=l.filter(e=>e.score>0):n.intent!==`sources`&&(l=[]),l.sort((e,t)=>t.score-e.score),!l.length)return{content:`I could not find supporting information in the selected workspace documents. Try a more specific question or attach a relevant document.`,citations:[],suggestions:[`Show sources for the selected knowledge`]};let u=l.slice(0,3).map(({doc:e})=>Nt(e,(e.excerpt||``).split(/(?<=[.!?])\s+|\n{2,}/).map(e=>e.trim()).filter(Boolean).map(e=>({text:e,score:Tt(e,a)})).sort((e,t)=>t.score-e.score).slice(0,2).map(e=>e.text).join(` `).slice(0,1400)));if(n.intent===`sources`)return{content:s&&c.size?`These are the documents supporting the previous answer. Each reference keeps the cited revision and location.`:`These references support the selected workspace knowledge. Open a source to inspect its text and revision.`,citations:u,suggestions:[`Generate technical test cases`,`Generate functional test cases`]};let d=Pt(e,t).filter(e=>u.some(t=>t.id===e.source)&&Tt(`${e.title} ${e.text}`,a)>0).slice(0,3);return{content:(d.length?d.map(e=>`${e.id} · ${e.title}\n${e.text}`).join(`
`):u.filter(e=>e.quote).map((e,t)=>`[${t+1}] ${e.quote}`).join(`
`))||`The source is available, but its text has not been extracted. Open the original document to inspect it or upload a readable technical or requirements document.`,citations:u,suggestions:[`Show sources for this answer`,`Generate functional test cases`]}}function It(e,t,n){let r;try{r=je(e,t,n.templateId)}catch(e){return{content:e.message,citations:[],needsEvidence:!0,suggestions:[`Show sources for the selected knowledge`]}}let i=ve(e,t).filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)),a=new Map(i.map(e=>[e.id,e])),o=n.previousDraft,s=n.words.length?n.words:o?.requestScope?.words||[],c=n.crRefs.length?n.crRefs:o?.requestScope?.crRefs||[],l=e.crs.filter(e=>t.crIds.includes(e.id));if(c.some(e=>!l.some(t=>t.ref===e)))return{content:`That change request is not in the selected workspace knowledge. Apply its revision in Knowledge versions, then generate again.`,citations:[],needsEvidence:!0};let u=r.tests.filter(e=>e.sourceIds.every(e=>{let t=a.get(e);return t?.excerpt?.trim()?n.kind===`Technical`?t.category===0:n.kind===`Business`?t.category===1||t.category===2:!0:!1})).filter(e=>!s.length||Tt(`${e.title} ${e.expected} ${e.requirement}`,s)>0);if(c.length&&(u=u.filter(e=>l.some(t=>c.includes(t.ref)&&t.changes.some(t=>t.ruleId===e.requirement)))),u=u.map(e=>{let t=a.get(e.sourceIds[0]),r=Et(e.expected)?`Negative`:Dt(e.expected)?`Positive`:`Regression`;return{...e,type:n.kind,category:r,objective:`Verify ${e.requirement} against the selected ${n.kind.toLowerCase()} evidence.`,preconditions:`The approved requirement and its source revision are available. Use the environment and fixtures defined in ${t.name}.`,steps:[`Review ${e.requirement} in ${t.name}${t.locator?`, ${t.locator}`:``}.`,r===`Negative`?`Exercise the documented rejection or invalid-input condition using the source-defined fixture.`:`Exercise the documented ${n.kind===`Technical`?`technical validation path`:n.kind===`Business`?`business workflow`:`application behavior`} using a source-defined fixture.`,`Compare the observed result with the cited expected behavior and record the evidence.`],data:`Use the input values and fixtures defined by the cited source; unspecified values require user input.`,rationale:`Source-backed ${n.kind.toLowerCase()} coverage for ${e.requirement}.`}}),n.scenario&&(u=u.filter(e=>e.category===n.scenario)),!u.length)return{content:`The selected evidence does not support ${n.scenario?`${n.scenario.toLowerCase()} `:``}${n.kind.toLowerCase()} test cases${s.length?` for that scope`:``}. Add a reviewed source-linked requirement${n.kind===`Technical`?` backed by a Technical document`:``}, or change the requested scope. I have not invented expected results.`,citations:[],needsEvidence:!0,suggestions:[`Show sources for the selected knowledge`]};if(o&&n.append&&o.kind===n.kind){let e=new Map(o.tests.map(e=>[`${e.requirement}:${e.category}:${e.expected}`,structuredClone(e)]));u.forEach(t=>e.set(`${t.requirement}:${t.category}:${t.expected}`,t)),u=[...e.values()]}n.count&&(u=u.slice(0,n.count)),u.forEach((e,n)=>{e.id=`TC-${t.team.toUpperCase()}-${String(n+1).padStart(3,`0`)}`});let d=[...new Set(u.flatMap(e=>e.sourceIds))].map(e=>Nt(a.get(e)));return Object.assign(r,{name:`${t.name} · ${n.kind} tests`,kind:n.kind,tests:u,sourceSnapshot:d,origin:`chat`,requestPrompt:n.prompt,requestScope:{words:s,crRefs:c},contextSnapshot:n.context}),{content:`${o?`Updated`:`Prepared`} ${u.length} ${n.kind.toLowerCase()} test case${u.length===1?``:`s`} from the selected requirements.${n.count&&u.length<n.count?` The evidence supports ${u.length} cases; I have not filled the requested count with unsupported cases.`:``} Review the draft below, refine it in chat, or save it to Test suites.`,citations:d,draft:r,suggestions:[`Add negative scenarios`,`Show sources for these test cases`,`Focus only on member identifier validation`]}}async function Lt(e,{state:t,signal:n,transport:r}={}){if(n?.aborted)throw new DOMException(`Request stopped.`,`AbortError`);let i=Mt(t,e),a=r?await r(e,{signal:n}):[`generate`,`refine`].includes(e.intent)?It(t,i,e):Ft(t,i,e);if(n?.aborted)throw new DOMException(`Request stopped.`,`AbortError`);let o=new Set(e.context.sources.filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)).map(e=>e.id)),s=new Map(ve(t,i).filter(e=>o.has(e.id)).map(e=>[e.id,e]));if(!a||typeof a.content!=`string`||!Array.isArray(a.citations)||a.citations.some(e=>!e||!o.has(e.id)||String(e.revision)!==String(s.get(e.id)?.revision)||(e.checksum||``)!==(s.get(e.id)?.checksum||``)||e.quote!=null&&typeof e.quote!=`string`))throw Error(`The assistant returned an invalid evidence reference. Try again.`);a.citations=a.citations.map(e=>Nt(s.get(e.id),e.quote));let c=new Set(a.citations.map(e=>e.id)),l=t.templates.find(t=>t.id===e.templateId&&t.team===i.team&&(t.visibility!==`workspace`||t.workspaceId===i.id));if(a.draft&&(!Array.isArray(a.draft.tests)||!a.draft.tests.length||a.draft.workspaceId!==i.id||a.draft.version!==i.version||![`Technical`,`Functional`,`Business`].includes(a.draft.kind)||!l||a.draft.templateId!==l.id||!a.draft.templateSnapshot||JSON.stringify(a.draft.templateSnapshot.fields)!==JSON.stringify(l.fields)||a.draft.tests.some(e=>!Array.isArray(e.sourceIds)||!e.sourceIds.length||e.sourceIds.some(e=>!c.has(e))||[`id`,`title`,`expected`,`objective`,`preconditions`,`data`,`category`,`priority`,`requirement`].some(t=>typeof e[t]!=`string`)||!e.expected.trim()||!Array.isArray(e.steps)||!e.steps.length||e.steps.some(e=>typeof e!=`string`)||e.customFields&&Object.values(e.customFields).some(e=>typeof e!=`string`))))throw Error(`The assistant returned an invalid test-case draft. Try again.`);if(a.draft&&(a.draft.templateSnapshot=structuredClone(l),a.draft.sourceSnapshot=structuredClone(a.citations),a.draft.contextSnapshot=structuredClone(e.context)),a.suggestions&&(!Array.isArray(a.suggestions)||a.suggestions.some(e=>typeof e!=`string`)))throw Error(`The assistant returned invalid follow-up suggestions. Try again.`);return{...a,intent:e.intent,requestContext:e.context,engine:r?`connected`:`local-evidence`}}function Rt(e,t,n,r=pe(t)){if(r!==pe(t))throw Error(`Historical conversations are read-only.`);let i=e.threads[r]?.messages.find(e=>e.id===n);if(!i?.draft?.tests?.length)throw Error(`Generate a test-case draft first.`);if(Mt(e,{context:i.requestContext}),i.savedSuiteId){if(e.suites.some(e=>e.id===i.savedSuiteId))return i.savedSuiteId;throw Error(`The saved suite is no longer available.`)}let a=structuredClone(i.draft);return a.id=L(`suite`),a.createdAt=fe(),a.chatMessageId=i.id,e.suites.unshift(a),i.savedSuiteId=a.id,a.id}function zt(e,t,n){if(!n?.tests?.length||n.workspaceId!==t.id)throw Error(`Choose a test suite in this workspace.`);let r=(n.templateSnapshot||e.templates.find(e=>e.id===n.templateId))?.fields||te,i=(r,i)=>{let a=i.toLowerCase().replace(/[^a-z0-9]/g,``),o=r.sourceIds.map(t=>{let r=n.sourceSnapshot?.find(e=>e.id===t)||e.documents.find(e=>e.id===t);return r?`${r.name} · revision ${r.revision}${r.locator?` · ${r.locator}`:``}`:`Source unavailable`}).join(`; `);return{testid:r.id,testcaseid:r.id,title:r.title,testcasetitle:r.title,ownerteam:t.team,type:r.type||n.kind||``,testtype:r.type||n.kind||``,category:r.category,requirement:r.requirement,requirementid:r.requirement,objective:r.objective,preconditions:r.preconditions,testdata:r.data,steps:r.steps.map((e,t)=>`${t+1}. ${e}`).join(`
`),teststeps:r.steps.join(`
`),expectedresult:r.expected,expectedresults:r.expected,priority:r.priority,evidence:o,source:o,sources:o,reviewstatus:r.status,notes:r.notes,reviewnotes:r.notes}[a]??r.customFields?.[i]??``};return{filename:`${t.ref}-tests-context-${n.version}.csv`,mimeType:`text/csv;charset=utf-8`,content:Oe([r,...n.tests.map(e=>r.map(t=>i(e,t)))])}}var Bt=[{icon:`chat`,title:`Understand your knowledge`,text:`Ask a question about your documents.`,prompt:`What are the member validation requirements?`},{icon:`spark`,title:`Create test cases`,text:`Turn requirements into a testable draft.`,prompt:`Generate technical test cases for the selected requirements`},{icon:`file`,title:`Find the source`,text:`See the evidence behind an answer.`,prompt:`Show sources for the selected knowledge`}];function Vt({navigate:e}){let{state:t,workspace:n,mutate:r,notify:i}=Ee(),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(`Auto`),[l,u]=(0,b.useState)(n?.templateId||``),[d,f]=(0,b.useState)(``),[p,m]=(0,b.useState)(null),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(``),[y,S]=(0,b.useState)(``),[w,T]=(0,b.useState)(``),[E,D]=(0,b.useState)(``),[O,k]=(0,b.useState)(!1),[A,M]=(0,b.useState)(``),ee=(0,b.useRef)(null),te=(0,b.useRef)(null),ne=(0,b.useRef)(null),N=(0,b.useRef)(t);N.current=t;let P=n?pe(n):``,re=E||P,ie=t.threads[re],ae=ie?.messages||[],oe=t.templates.filter(e=>e.team===t.session.team&&(e.visibility!==`workspace`||e.workspaceId===n?.id)),se=oe.find(e=>e.id===l)||oe.find(e=>e.id===n?.templateId)||oe[0];if((0,b.useEffect)(()=>{ne.current?.abort(),ne.current=null,k(!1),M(``),D(``),f(``),c(`Auto`),o(``)},[P]),(0,b.useEffect)(()=>()=>ne.current?.abort(),[]),(0,b.useEffect)(()=>{u(n?.templateId||``)},[n?.id,n?.templateId]),(0,b.useEffect)(()=>{ee.current?.scrollIntoView({behavior:`auto`,block:`nearest`})},[ae.length,O]),!n)return(0,x.jsx)(qe,{navigate:e});let F=ve(t,n).filter(e=>[`Ready`,`Reviewed locally`].includes(e.status)),ce=t.baselines.find(e=>e.id===n.baselineId),le=_e(t,n),I=le.find(e=>e.id===d)||le.find(e=>e.status!==`resolved`)||le[0],ue=[...ae].reverse().find(e=>e.role===`assistant`)?.suggestions||[],de=e=>m(typeof e==`string`?Nt(t.documents.find(t=>t.id===e)||{id:e}):e);function me(e){E||O||(o(e),M(``),te.current?.focus())}function he(e){u(e),r(t=>{let r=t.workspaces.find(e=>e.id===n.id);r&&(r.templateId=e)})}function ge(){ne.current?.abort(),ne.current=null,k(!1),M(`Request stopped. You can send another message.`)}async function ye(e){if(e.preventDefault(),!a.trim()||E||ne.current)return;let i;try{i=jt(t,n,{prompt:a,kind:s,templateId:se?.id,messages:ae})}catch(e){M(e.message);return}let c=new AbortController,l=structuredClone(t);ne.current=c,k(!0),M(``),o(``),r(e=>{e.threads[P]||(e.threads[P]={workspaceId:n.id,version:n.version,team:n.team,baselineId:n.baselineId,crIds:[...n.crIds],label:`${ce?.ref||n.ref} · Context ${n.version}`,messages:[]}),e.threads[P].messages.push({id:L(`message`),role:`user`,content:i.prompt,at:fe(),actor:t.session.name})});try{let e=await Lt(i,{state:l,signal:c.signal});if(c.signal.aborted||ne.current!==c)return;Mt(N.current,i),r(t=>{try{Mt(t,i)}catch{return}t.threads[P].messages.push({...e,id:L(`message`),role:`assistant`,actor:`Workspace assistant`,at:fe(),sourceIds:e.citations.map(e=>e.id)})})}catch(e){e.name!==`AbortError`&&ne.current===c&&(M(e.message),o(i.prompt))}finally{ne.current===c&&(ne.current=null,k(!1))}}function be(e){try{Rt(structuredClone(t),n,e.id,re),r(t=>{Rt(t,n,e.id,re),R(t,`Saved ${e.draft.kind.toLowerCase()} tests from workspace chat`)}),i(`Test cases saved to Test suites.`)}catch(e){M(e.message)}}function xe(e){try{Mt(t,{context:e.requestContext});let r=zt(t,n,t.suites.find(t=>t.id===e.savedSuiteId)||e.draft);De(r.filename,r.content,r.mimeType),i(`Test cases exported using your selected template columns.`)}catch(e){M(e.message)}}function Ce(e){e.preventDefault();try{j(structuredClone(t),n,I.id,_,w,y,F),r(e=>{j(e,n,I.id,_,w,y,F),R(e,`Resolved ${I.requirement} with source-backed evidence`)}),g(``),i(`Answer saved. You can refine the test cases in chat.`)}catch(e){i(e.message)}}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${n.ref} · ${n.name.toUpperCase()}`,title:`Workspace chat`,description:`Ask questions. Create test cases. Follow the evidence.`,children:(0,x.jsxs)(`div`,{className:`chat-heading-actions`,children:[(0,x.jsx)(B,{icon:`clock`,onClick:()=>g(`history`),children:`Thread history`}),(0,x.jsx)(B,{icon:`checkSquare`,onClick:()=>e(`suites`),children:`Test suites`})]})}),(0,x.jsx)(Ke,{navigate:e}),E&&(0,x.jsxs)(`div`,{className:`history-banner`,children:[(0,x.jsx)(C,{name:`clock`,size:16}),ie?.label,` · Read-only historical thread`,(0,x.jsx)(B,{onClick:()=>D(``),children:`Return to current context`})]}),(0,x.jsxs)(`div`,{className:`chat-grid chat-studio`,children:[(0,x.jsxs)(`section`,{className:`card conversation`,children:[(0,x.jsxs)(`div`,{className:`conversation-heading`,children:[(0,x.jsxs)(`div`,{className:`assistant-label`,children:[(0,x.jsx)(`span`,{className:`assistant-symbol`,children:(0,x.jsx)(C,{name:`spark`,size:19})}),(0,x.jsxs)(`span`,{children:[`Workspace assistant`,(0,x.jsx)(`small`,{children:`Answers and test cases, with sources`})]})]}),(0,x.jsx)(B,{icon:`book`,onClick:()=>g(`sources`),children:`View sources`})]}),(0,x.jsxs)(`div`,{className:`chat-messages`,role:`log`,"aria-label":`Workspace conversation`,"aria-live":`polite`,"aria-relevant":`additions`,children:[!ae.length&&(0,x.jsxs)(`div`,{className:`chat-welcome`,children:[(0,x.jsx)(`span`,{className:`chat-welcome-symbol`,children:(0,x.jsx)(C,{name:`spark`,size:29})}),(0,x.jsx)(`div`,{className:`chat-kicker`,children:`YOUR WORKSPACE, ONE CONVERSATION`}),(0,x.jsx)(`h2`,{children:`What would you like to test?`}),(0,x.jsx)(`p`,{children:`Explore your documents, turn requirements into test cases, and see where every answer comes from.`}),(0,x.jsx)(`div`,{className:`chat-starters`,children:Bt.map(e=>(0,x.jsxs)(`button`,{onClick:()=>me(e.prompt),children:[(0,x.jsx)(C,{name:e.icon,size:20}),(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsx)(`span`,{children:e.text}),(0,x.jsx)(C,{name:`arrow`,size:14})]},e.title))})]}),ae.map(n=>{let r=n.citations||(n.sourceIds||[]).map(e=>t.documents.find(t=>t.id===e)).filter(Boolean).map(e=>Nt(e)),i=t.suites.find(e=>e.id===n.savedSuiteId);return(0,x.jsxs)(`article`,{className:`message message-${n.role}`,children:[(0,x.jsx)(`span`,{className:`message-avatar ${n.role===`user`?`user-avatar`:`assistant-avatar`}`,children:(0,x.jsx)(C,{name:n.role===`user`?`users`:`spark`,size:16})}),(0,x.jsxs)(`div`,{className:`chat-message-content`,children:[(0,x.jsxs)(`div`,{className:`message-author`,children:[n.actor,(0,x.jsx)(`small`,{children:new Date(n.at).toLocaleTimeString(`en-IN`,{hour:`2-digit`,minute:`2-digit`})})]}),(0,x.jsxs)(`div`,{className:`message-bubble`,children:[(0,x.jsx)(`div`,{className:`chat-response-text`,children:n.content}),n.draft&&(0,x.jsx)(xt,{message:n,savedSuite:i,historical:!!E,busy:O,onSource:de,onSave:be,onOpen:t=>e(`suites?suite=${encodeURIComponent(t)}`),onExport:xe,onPrompt:me}),` `,!!r.length&&(0,x.jsxs)(`details`,{className:`chat-message-sources`,open:n.intent===`sources`,children:[(0,x.jsx)(`summary`,{children:n.draft?`Evidence behind these cases`:`Supporting sources`}),(0,x.jsx)(bt,{citations:r,onSource:de})]})]})]})]},n.id)}),O&&(0,x.jsxs)(`div`,{className:`chat-working`,role:`status`,children:[(0,x.jsx)(C,{name:`clock`,size:16}),`Working with your workspace evidence`,(0,x.jsx)(B,{onClick:ge,children:`Stop`})]}),(0,x.jsx)(`div`,{ref:ee})]}),!!ue.length&&!E&&(0,x.jsx)(`div`,{className:`chat-followups`,"aria-label":`Suggested follow-ups`,children:ue.map(e=>(0,x.jsxs)(`button`,{disabled:O,onClick:()=>me(e),children:[e,(0,x.jsx)(C,{name:`arrow`,size:11})]},e))}),A&&(0,x.jsxs)(`div`,{className:`chat-error`,role:`alert`,children:[(0,x.jsx)(C,{name:`info`,size:16}),(0,x.jsx)(`span`,{children:A}),(0,x.jsx)(`button`,{"aria-label":`Dismiss message`,onClick:()=>M(``),children:(0,x.jsx)(C,{name:`close`,size:14})})]}),(0,x.jsxs)(`form`,{className:`chat-composer`,onSubmit:ye,children:[(0,x.jsxs)(`div`,{className:`chat-composer-top`,children:[(0,x.jsx)(`label`,{htmlFor:`workspace-question`,children:`Message your workspace`}),(0,x.jsxs)(`label`,{className:`chat-kind-select`,children:[(0,x.jsx)(`span`,{children:`Test type`}),(0,x.jsx)(`select`,{"aria-label":`Test case type`,value:s,disabled:!!E||O,onChange:e=>c(e.target.value),children:St.map(e=>(0,x.jsx)(`option`,{children:e},e))})]})]}),(0,x.jsx)(`textarea`,{ref:te,id:`workspace-question`,disabled:!!E||O,value:a,onChange:e=>o(e.target.value),placeholder:E?`This historical conversation is read-only.`:`Ask about your documents, or describe the test cases you need…`,"aria-label":`Message your workspace`,rows:3,maxLength:12e3,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),ye(e))}}),(0,x.jsxs)(`div`,{className:`composer-bottom`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`attach-button`,disabled:!!E||O,onClick:()=>g(`attach`),children:[(0,x.jsx)(C,{name:`attach`,size:16}),`Attach evidence`]}),(0,x.jsx)(`span`,{children:`Enter to send · Shift + Enter for a new line`}),O?(0,x.jsxs)(`button`,{type:`button`,className:`chat-stop`,onClick:ge,"aria-label":`Stop workspace request`,children:[(0,x.jsx)(`span`,{}),`Stop`]}):(0,x.jsx)(`button`,{type:`submit`,className:`send-button`,disabled:!a.trim()||!!E,"aria-label":`Send workspace message`,children:(0,x.jsx)(C,{name:`arrowUp`,size:18})})]})]}),(0,x.jsxs)(`div`,{className:`chat-footer`,children:[(0,x.jsx)(C,{name:`shield`,size:11}),`Workspace `,n.ref,` · Context `,E?ie?.version:n.version,(0,x.jsx)(`span`,{children:`Review generated cases against their sources.`})]})]}),(0,x.jsxs)(`aside`,{className:`chat-aside`,children:[(0,x.jsxs)(`section`,{className:`card chat-template-card`,children:[(0,x.jsx)(`div`,{className:`chat-kicker`,children:`TEST-CASE FORMAT`}),(0,x.jsx)(`h2`,{children:`Your format, every time.`}),(0,x.jsx)(`p`,{children:`Choose a template before generating, or upload the Excel format you already use.`}),(0,x.jsx)(`label`,{className:`chat-template-label`,htmlFor:`chat-template`,children:`Selected template`}),(0,x.jsx)(`select`,{id:`chat-template`,"aria-label":`Chat test-case template`,value:se?.id||``,disabled:!!E||O,onChange:e=>he(e.target.value),children:oe.map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.version]},e.id))}),se&&(0,x.jsxs)(`div`,{className:`chat-template-fields`,children:[se.fields.slice(0,4).map(e=>(0,x.jsx)(`span`,{children:e},e)),se.fields.length>4&&(0,x.jsxs)(`span`,{children:[`+`,se.fields.length-4,` columns`]})]}),(0,x.jsx)(yt,{disabled:!!E||O,onSelected:u})]}),(0,x.jsxs)(`section`,{className:`card chat-context-card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Selected knowledge`}),(0,x.jsx)(C,{name:`layers`,size:16})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:`System baseline`}),(0,x.jsxs)(`strong`,{children:[ce?.ref||`Not selected`,ce&&` · v${ce.version}`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:`Workspace`}),(0,x.jsx)(`strong`,{children:n.ref})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:`Change requests`}),(0,x.jsx)(`strong`,{children:n.crIds.map(e=>t.crs.find(t=>t.id===e)?.ref).filter(Boolean).join(`, `)||`None selected`})]}),(0,x.jsxs)(`button`,{className:`text-button`,onClick:()=>g(`sources`),children:[`Browse source documents `,(0,x.jsx)(C,{name:`arrow`,size:13})]}),(0,x.jsxs)(`p`,{className:`chat-evidence-note`,children:[(0,x.jsx)(C,{name:`shield`,size:15}),`Answers and drafts use the evidence selected for this workspace.`]})]}),(0,x.jsxs)(`details`,{className:`card clarification-panel optional-clarifications`,children:[(0,x.jsx)(`summary`,{children:`Optional clarifications`}),(0,x.jsx)(`p`,{className:`panel-description`,children:`Generate now. Add answers whenever you want to refine the results.`}),le.map(e=>(0,x.jsxs)(`button`,{className:`clarification-option ${I?.id===e.id?`selected`:``}`,onClick:()=>f(e.id),children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsxs)(`small`,{children:[e.requirement,` · `,e.status]})]}),(0,x.jsx)(C,{name:`chevron`,size:14})]},e.id)),I?(0,x.jsxs)(`div`,{className:`question-detail`,children:[(0,x.jsx)(z,{tone:I.status===`resolved`?`green`:`amber`,children:I.status===`resolved`?`Resolved`:`Optional answer`}),(0,x.jsx)(`h3`,{children:I.title}),(0,x.jsx)(`p`,{children:I.why}),(0,x.jsx)(`p`,{className:`margin-top`,children:I.requested}),(0,x.jsxs)(`button`,{className:`text-button margin-top`,onClick:()=>de(I.sourceId),children:[`Open cited source `,(0,x.jsx)(C,{name:`external`,size:12})]}),I.answer&&(0,x.jsxs)(`div`,{className:`answer-preview`,children:[(0,x.jsx)(`small`,{children:`USER-PROVIDED EVIDENCE`}),(0,x.jsx)(`p`,{children:I.answer}),(0,x.jsx)(`span`,{children:I.sourceReference})]}),(0,x.jsx)(`div`,{className:`stack-actions`,children:(0,x.jsx)(B,{disabled:!!E||O,onClick:()=>{v(I.answer||``),S(I.sourceReference||``),T(I.answerSourceId||(F.some(e=>e.id===I.sourceId)?I.sourceId:``)),g(`answer`)},children:I.answer?`Edit answer`:`Answer clarification`})})]}):(0,x.jsx)(`p`,{className:`panel-description`,children:`No open questions for this context.`})]})]})]}),h===`sources`&&(0,x.jsxs)(We,{title:`Workspace sources`,close:()=>g(``),wide:!0,children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:`Open a document to inspect its selected revision and evidence.`}),F.length?(0,x.jsx)(bt,{citations:F.map(e=>Nt(e)),onSource:e=>{g(``),de(e)}}):(0,x.jsx)(Ve,{title:`Add your first source`,description:`Choose a baseline and reviewed source documents for this workspace.`})]}),h===`answer`&&I&&(0,x.jsxs)(We,{title:`Answer a clarification`,close:()=>g(``),children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:I.title}),(0,x.jsxs)(`form`,{onSubmit:Ce,children:[(0,x.jsx)(V,{label:`Behavior / answer`,children:(0,x.jsx)(`textarea`,{required:!0,rows:5,value:_,onChange:e=>v(e.target.value),maxLength:5e3})}),(0,x.jsx)(V,{label:`Supporting evidence source`,children:(0,x.jsxs)(`select`,{required:!0,value:w,onChange:e=>T(e.target.value),children:[(0,x.jsx)(`option`,{value:``,children:`Choose reviewed evidence`}),F.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,x.jsx)(V,{label:`Source revision and location`,children:(0,x.jsx)(`input`,{required:!0,value:y,onChange:e=>S(e.target.value),placeholder:`Document, revision, page / section / procedure`,maxLength:300})}),(0,x.jsx)(H,{children:`Save the answer with an accessible source and its revision and location.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>g(``),children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,children:`Save answer and resolve`})]})]})]}),h===`history`&&(0,x.jsxs)(We,{title:`Conversation history`,close:()=>g(``),children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:`Conversations keep the knowledge context they were created with.`}),Object.entries(t.threads).filter(([,e])=>e.workspaceId===n.id&&e.team===t.session.team).map(([e,t])=>(0,x.jsxs)(`button`,{className:`history-row`,onClick:()=>{ne.current?.abort(),ne.current=null,k(!1),M(``),D(e===P?``:e),g(``)},children:[(0,x.jsx)(C,{name:`chat`,size:18}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:t.label}),(0,x.jsx)(`small`,{children:e===P?`Current context`:`Read-only history`})]}),(0,x.jsx)(C,{name:`chevron`,size:14})]},e)),!Object.values(t.threads).some(e=>e.workspaceId===n.id&&e.team===t.session.team)&&(0,x.jsx)(Ve,{title:`No saved conversations`,description:`Send a message to start a conversation.`})]}),h===`attach`&&(0,x.jsxs)(We,{title:`Attach supporting evidence`,close:()=>g(``),children:[(0,x.jsx)(H,{children:`Add a document, then review and link its requirements in CR evidence before generating test cases from it.`}),(0,x.jsx)(`div`,{className:`margin-top`,children:(0,x.jsx)(Ye,{scope:{team:n.team,workspaceId:n.id,category:0},onStaged:e=>{r(t=>{t.documents.push(...e),Se(t,t.workspaces.find(e=>e.id===n.id)),R(t,`Attached chat evidence to ${n.ref}`)}),g(``),i(`Evidence added. Review its routing in CR evidence.`)}})})]}),p&&(0,x.jsx)(Je,{sourceId:p.id,citation:p,close:()=>m(null)})]})}function Ht({navigate:e}){let{state:t,mutate:n,workspace:r}=Ee(),[i,a]=(0,b.useState)(r?.templateId||t.templates.find(e=>e.team===t.session.team&&e.visibility!==`workspace`)?.id||``);if(!r)return(0,x.jsx)(qe,{navigate:e});let o=be(t,r),s=t.jobs.filter(e=>e.workspaceId===r.id),c=s.find(e=>e.status===`running`),l=t.templates.filter(e=>e.team===t.session.team&&(e.visibility!==`workspace`||e.workspaceId===r.id));function u(){!o.ready||c||!l.some(e=>e.id===i)||n(e=>{e.jobs.unshift({id:L(`run`),workspaceId:r.id,version:r.version,context:pe(r),templateId:i,provisional:!1,status:`running`,stageIndex:0,createdAt:fe(),stage:`Preparing workspace evidence`}),R(e,`Started test suite for ${r.ref}`)})}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${r.ref} · FROM EVIDENCE TO TESTS`,title:`Generate test cases`,description:`Choose your format and generate from the knowledge available in this workspace.`}),(0,x.jsx)(Ke,{navigate:e}),(0,x.jsxs)(`div`,{className:`generation-layout margin-top`,children:[(0,x.jsxs)(`section`,{className:`card padded generation-main`,children:[(0,x.jsxs)(`div`,{className:`section-heading inset`,children:[(0,x.jsx)(`h2`,{children:`Your test-case format`}),(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`checkSquare`,size:22})})]}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Use the standard format, select a saved template, or upload your own Excel template.`}),(0,x.jsxs)(`label`,{className:`form-field`,children:[(0,x.jsx)(`span`,{children:`Test-case template`}),(0,x.jsx)(`select`,{value:i,onChange:e=>a(e.target.value),children:l.map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.version]},e.id))})]}),(0,x.jsxs)(`div`,{className:`template-upload-option`,children:[(0,x.jsx)(yt,{onSelected:a}),(0,x.jsx)(`small`,{children:`Optional · Excel .xlsx or CSV · Headers in the first row`})]}),(0,x.jsx)(`div`,{className:`generation-fields`,children:l.find(e=>e.id===i)?.fields.map(e=>(0,x.jsx)(`span`,{children:e},e))}),(0,x.jsxs)(`div`,{className:`generation-action`,children:[(0,x.jsx)(B,{variant:`primary`,icon:`spark`,className:`full-width`,disabled:!o.ready||!i||!!c,onClick:u,children:c?`Generating test cases…`:`Generate test cases`}),(0,x.jsx)(`p`,{children:`Generation uses your approved baseline and reviewed evidence.`})]})]}),(0,x.jsxs)(`aside`,{children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsxs)(`div`,{className:`section-heading inset`,children:[(0,x.jsx)(`h2`,{children:`Workspace evidence`}),(0,x.jsx)(z,{tone:o.ready?`green`:`neutral`,children:o.ready?`Ready`:`Set up evidence`})]}),(0,x.jsxs)(`div`,{className:`evidence-check-row`,children:[(0,x.jsx)(C,{name:`layers`,size:18}),(0,x.jsx)(`span`,{children:o.selection?.baseline?.ref||`Connect an approved baseline`})]}),(0,x.jsxs)(`div`,{className:`evidence-check-row`,children:[(0,x.jsx)(C,{name:`file`,size:18}),(0,x.jsxs)(`span`,{children:[o.sources.length,` accessible document`,o.sources.length===1?``:`s`]})]}),o.blockers.map(e=>(0,x.jsx)(H,{children:e},e)),!o.ready&&(0,x.jsx)(B,{className:`full-width margin-top`,onClick:()=>e(`workspace`),children:`Open workspace evidence`})]}),(0,x.jsxs)(`section`,{className:`card padded margin-top optional-help`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`chat`,size:21})}),(0,x.jsx)(`h2`,{children:`Want to refine the results?`}),(0,x.jsx)(`p`,{children:`You can answer optional clarifications or ask the system about uploaded documents. You can generate test cases without answering every question.`}),(0,x.jsx)(B,{icon:`chat`,onClick:()=>e(`chat`),children:`Open workspace chat`})]})]})]}),(0,x.jsxs)(`section`,{className:`card margin-top`,children:[(0,x.jsx)(`div`,{className:`section-heading`,children:(0,x.jsx)(`h2`,{children:`Generation history`})}),s.map(t=>(0,x.jsxs)(`div`,{className:`job-row`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-${t.status===`Completed`?`green`:`purple`}`,children:(0,x.jsx)(C,{name:t.status===`Completed`?`check`:`clock`,size:18})}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`strong`,{children:[`Test suite · Context `,t.version]}),(0,x.jsx)(`p`,{children:t.stage}),(0,x.jsx)(`div`,{className:`stage-dots`,children:[0,1,2,3].map(e=>(0,x.jsx)(`span`,{className:e<=t.stageIndex?`done`:``},e))})]}),(0,x.jsx)(z,{children:t.status}),t.status===`running`?(0,x.jsx)(B,{onClick:()=>n(e=>{let n=e.jobs.find(e=>e.id===t.id);n.status=`Cancelled`,n.stage=`Cancelled by user.`}),children:`Cancel`}):[`Interrupted`,`Cancelled`,`Failed`].includes(t.status)?(0,x.jsx)(B,{disabled:!o.ready,onClick:u,children:`Retry`}):(0,x.jsx)(B,{onClick:()=>e(`suites`),children:`Review test suite`})]},t.id)),!s.length&&(0,x.jsx)(Ve,{title:`Your first suite starts here`,description:`Choose a template, then generate test cases.`})]})]})}function Ut({navigate:e,initialSuiteId:t=``}){let{state:n,workspace:r,mutate:i,notify:a}=Ee(),[o,s]=(0,b.useState)(t),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(`All`),[m,h]=(0,b.useState)(`Scenarios`),[g,_]=(0,b.useState)(null),[v,y]=(0,b.useState)(``);if((0,b.useEffect)(()=>{s(t),l(``)},[t]),!r)return(0,x.jsx)(qe,{navigate:e});let S=n.suites.filter(e=>e.workspaceId===r.id),w=S.find(e=>e.id===o)||S[0],T=(w?.tests||[]).filter(e=>`${e.id} ${e.title} ${e.requirement}`.toLowerCase().includes(u.toLowerCase())&&(f===`All`||e.status===f)),E=w?.tests.find(e=>e.id===c)||T[0],D=w?.templateSnapshot||n.templates.find(e=>e.id===w?.templateId),O=e=>w?.sourceSnapshot?.find(t=>t.id===e)||n.documents.find(t=>t.id===e),k=(D?.fields||[]).filter(e=>!te.some(t=>t.toLowerCase()===e.toLowerCase())),A=e=>!D||D.fields.some(t=>t.toLowerCase()===e.toLowerCase());function j(e){!E||!me(n)||(i(t=>{let r=t.suites.find(e=>e.id===w.id),i=r.tests.find(e=>e.id===E.id);i.status=e,i.reviewedBy=n.session.name,i.revision=(i.revision||1)+1,r.status=r.provisional?`PROVISIONAL`:r.tests.every(e=>e.status===`Accepted`)?`Accepted`:`Ready for review`,R(t,`${e}: ${E.id}`)}),a(`Scenario ${e.toLowerCase()}.`))}function M(){let e=zt(n,r,w);De(e.filename,e.content,e.mimeType),a(`Test cases exported in the selected template column order.`)}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${r.ref} · REVIEW WITH TRACEABILITY`,title:`Test suites`,description:`Review the scenario, its expected behavior, and the evidence behind it.`,children:(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{onClick:()=>e(`readiness`),children:`New generation`}),(0,x.jsx)(B,{variant:`primary`,icon:`external`,disabled:!w,onClick:M,children:`Export CSV`})]})}),(0,x.jsx)(Ke,{navigate:e}),w?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`suite-toolbar`,children:[(0,x.jsx)(`select`,{className:`wide-select`,value:w.id,onChange:e=>{s(e.target.value),l(``)},children:S.map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.name,` · Context `,e.version]},e.id))}),(0,x.jsx)(z,{children:w.status}),(0,x.jsxs)(`span`,{className:`subtle`,children:[D?.name,` · v`,D?.version]})]}),w.version!==r.version&&(0,x.jsxs)(H,{tone:`amber`,children:[`This historic suite is pinned to context `,w.version,`. The current workspace uses context `,r.version,`. Reviewing it does not change its knowledge version.`]}),w.provisional&&(0,x.jsxs)(H,{tone:`amber`,children:[`PROVISIONAL · `,w.gaps.length,` unresolved requirements. Unsupported expected outcomes remain unresolved. This suite does not establish complete coverage.`]}),(0,x.jsx)(Ue,{value:m,onChange:h,items:[`Scenarios`,`Coverage & gaps`]}),m===`Coverage & gaps`?(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Concrete coverage and review status`}),(0,x.jsxs)(`span`,{className:`count-pill`,children:[w.tests.length,` tests`]})]}),(0,x.jsxs)(`div`,{className:`readiness-tiles padded`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:new Set(w.tests.map(e=>e.requirement)).size}),(0,x.jsx)(`span`,{children:`Requirements represented`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:w.tests.filter(e=>!e.sourceIds.length&&!e.answerEvidence).length}),(0,x.jsx)(`span`,{children:`Missing citations`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:w.tests.filter(e=>e.expected===`Expected result unresolved`).length}),(0,x.jsx)(`span`,{children:`Unsupported outcomes`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:w.tests.filter(e=>e.status===`Accepted`).length}),(0,x.jsx)(`span`,{children:`Accepted tests`})]})]}),(0,x.jsx)(`div`,{className:`table-scroll`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`REQUIREMENT`}),(0,x.jsx)(`th`,{children:`TEST CASES`}),(0,x.jsx)(`th`,{children:`REVIEW`})]})}),(0,x.jsx)(`tbody`,{children:[...new Set(w.tests.map(e=>e.requirement))].map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:e}),(0,x.jsx)(`td`,{children:w.tests.filter(t=>t.requirement===e).map(e=>e.id).join(`, `)}),(0,x.jsx)(`td`,{children:(0,x.jsx)(z,{tone:w.tests.some(t=>t.requirement===e&&t.expected===`Expected result unresolved`)?`amber`:`green`,children:w.tests.some(t=>t.requirement===e&&t.expected===`Expected result unresolved`)?`Evidence gap`:`Source linked`})})]},e))})]})}),(0,x.jsx)(`div`,{className:`padded`,children:(0,x.jsx)(H,{children:`These measures describe this suite only. They do not claim full requirement coverage or model accuracy.`})})]}):(0,x.jsxs)(`div`,{className:`suite-grid`,children:[(0,x.jsxs)(`section`,{className:`card scenario-list`,children:[(0,x.jsxs)(`div`,{className:`padded`,children:[(0,x.jsx)(He,{value:u,onChange:d,placeholder:`Search scenarios…`}),(0,x.jsx)(`select`,{className:`wide-select margin-top`,value:f,onChange:e=>p(e.target.value),children:[`All`,`Generated`,`Accepted`,`Revision requested`,`Rejected`].map(e=>(0,x.jsx)(`option`,{children:e},e))})]}),T.map(e=>(0,x.jsxs)(`button`,{className:`scenario-item ${E?.id===e.id?`selected`:``}`,onClick:()=>l(e.id),children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.id}),(0,x.jsx)(z,{children:e.status})]}),(0,x.jsx)(`strong`,{children:e.title}),(0,x.jsxs)(`small`,{children:[e.category,` · `,e.requirement]})]},e.id)),!T.length&&(0,x.jsx)(Ve,{title:`No matching scenarios`,description:`Clear your search or status filter.`})]}),E&&(0,x.jsxs)(`section`,{className:`card padded scenario-detail`,children:[(0,x.jsxs)(`div`,{className:`section-heading inset`,children:[(0,x.jsx)(`span`,{className:`code-label`,children:E.id}),(0,x.jsx)(B,{icon:`file`,onClick:()=>_({...E,steps:E.steps.join(`
`)}),children:`Edit scenario`})]}),(0,x.jsx)(`h2`,{className:`scenario-title`,children:E.title}),(0,x.jsxs)(`div`,{className:`detail-summary`,children:[(0,x.jsx)(z,{tone:`purple`,children:E.category}),(0,x.jsx)(z,{children:E.status}),(0,x.jsxs)(`span`,{children:[E.requirement,` · Revision `,E.revision||1]})]}),[[`Objective`,E.objective],[`Preconditions`,E.preconditions],[`Test data`,E.data]].filter(([e])=>A(e)).map(([e,t])=>(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsx)(`h3`,{children:e}),(0,x.jsx)(`p`,{children:t||`Not specified`})]},e)),(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsx)(`h3`,{children:`Steps`}),(0,x.jsx)(`ol`,{className:`test-steps`,children:E.steps.map((e,t)=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(`span`,{children:t+1}),e]},t))})]}),(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsx)(`h3`,{children:`Expected result`}),(0,x.jsx)(`div`,{className:`expected-result ${E.expected===`Expected result unresolved`?`unresolved`:``}`,children:E.expected})]}),(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsxs)(`h3`,{children:[`Priority · `,E.priority]}),(0,x.jsx)(`p`,{children:E.rationale})]}),k.map(e=>(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsx)(`h3`,{children:e}),(0,x.jsx)(`p`,{children:E.customFields?.[e]||`Not provided`})]},e)),(0,x.jsxs)(`div`,{className:`test-field`,children:[(0,x.jsx)(`h3`,{children:`Evidence citations`}),E.sourceIds.map(e=>(0,x.jsxs)(`button`,{className:`source-citation`,onClick:()=>y(e),children:[(0,x.jsx)(C,{name:`file`,size:19}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:O(e)?.name||`Source unavailable`}),(0,x.jsxs)(`small`,{children:[O(e)?.locator,` · Revision `,O(e)?.revision]})]}),(0,x.jsx)(C,{name:`external`,size:14})]},e)),E.answerEvidence&&(0,x.jsxs)(H,{children:[`User-provided reviewed evidence: `,E.answerEvidence]})]}),(0,x.jsx)(V,{label:`Review notes`,children:(0,x.jsx)(`textarea`,{value:E.notes||``,rows:2,onChange:e=>i(t=>{t.suites.find(e=>e.id===w.id).tests.find(e=>e.id===E.id).notes=e.target.value}),placeholder:`Document changes or team review notes…`})}),(0,x.jsxs)(`div`,{className:`review-actions`,children:[(0,x.jsx)(B,{variant:`primary`,icon:`check`,disabled:!me(n)||E.expected===`Expected result unresolved`,onClick:()=>j(`Accepted`),children:`Accept scenario`}),(0,x.jsx)(B,{disabled:!me(n),onClick:()=>j(`Revision requested`),children:`Request revision`}),(0,x.jsx)(B,{disabled:!me(n),onClick:()=>j(`Rejected`),children:`Reject`})]}),!me(n)&&(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Sign in to review this scenario.`})]})]})]}):(0,x.jsx)(`section`,{className:`card margin-top`,children:(0,x.jsx)(Ve,{title:`No test suites yet`,description:`Review readiness and generate a test suite for this workspace.`,action:(0,x.jsx)(B,{variant:`primary`,onClick:()=>e(`readiness`),children:`Review readiness`})})}),g&&(0,x.jsx)(We,{title:`Edit test scenario`,close:()=>_(null),wide:!0,children:(0,x.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i(e=>{let t=e.suites.find(e=>e.id===w.id).tests.find(e=>e.id===g.id);Object.assign(t,g,{steps:g.steps.split(`
`).map(e=>e.trim()).filter(Boolean),status:`Revision requested`,revision:(t.revision||1)+1}),R(e,`Edited ${g.id}`)}),_(null),a(`Scenario revision saved. Team review acceptance reset.`)},children:[(0,x.jsx)(V,{label:`Title`,children:(0,x.jsx)(`input`,{required:!0,value:g.title,onChange:e=>_(t=>({...t,title:e.target.value}))})}),[[`Objective`,`objective`],[`Preconditions`,`preconditions`],[`Test data`,`data`],[`Steps (one per line)`,`steps`],[`Expected result`,`expected`]].map(([e,t])=>(0,x.jsx)(V,{label:e,children:(0,x.jsx)(`textarea`,{required:[`steps`,`expected`].includes(t),rows:t===`steps`?4:2,value:g[t],onChange:e=>_(n=>({...n,[t]:e.target.value}))})},t)),(0,x.jsx)(V,{label:`Priority`,children:(0,x.jsx)(`select`,{value:g.priority,onChange:e=>_(t=>({...t,priority:e.target.value})),children:[`High`,`Medium`,`Low`,`Unassigned`].map(e=>(0,x.jsx)(`option`,{children:e},e))})}),k.map(e=>(0,x.jsx)(V,{label:e,children:(0,x.jsx)(`input`,{value:g.customFields?.[e]||``,onChange:t=>_(n=>({...n,customFields:{...n.customFields,[e]:t.target.value}}))})},e)),(0,x.jsx)(H,{children:`Edits are user-provided revisions. Check every changed expected result against the pinned evidence before accepting.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>_(null),children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,children:`Save revision`})]})]})}),v&&(0,x.jsx)(Je,{sourceId:v,citation:w?.sourceSnapshot?.find(e=>e.id===v),close:()=>y(``)})]})}function Wt(){let{state:e,mutate:t,workspace:n,notify:r}=Ee(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(`Templates`),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(``),g=e.templates.filter(t=>t.team===e.session.team&&(t.visibility!==`workspace`||t.workspaceId===n?.id)&&`${t.name} ${t.description}`.toLowerCase().includes(i.toLowerCase()));async function _(e){let t=e.target.files?.[0];if(e.target.value=``,t)try{p(await _t(t)),h(``)}catch(e){h(e.message)}}function v(e){d(``),l(e?{...e,fields:[...e.fields],originalId:e.id}:{name:``,description:``,fields:[...te],visibility:`team`,version:0})}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${e.session.team} · PRESENTATION & EXAMPLES`,title:`Template library`,description:`Choose the shape of a test case. Evidence still defines its expected behavior.`,children:(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(yt,{}),(0,x.jsxs)(`label`,{className:`button button-secondary file-button`,children:[(0,x.jsx)(C,{name:`upload`,size:16}),`Import examples`,(0,x.jsx)(`input`,{type:`file`,accept:`.csv,.xlsx`,onChange:_})]}),(0,x.jsx)(B,{icon:`plus`,variant:`primary`,onClick:()=>v(),children:`Create template`})]})}),(0,x.jsx)(Ue,{value:o,onChange:s,items:[`Templates`,`Example suites`]}),m&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:m}),o===`Templates`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`library-toolbar`,children:[(0,x.jsx)(He,{value:i,onChange:a,placeholder:`Search templates…`}),(0,x.jsx)(`span`,{className:`subtle`,children:`Immutable template versions`})]}),(0,x.jsx)(`div`,{className:`library-grid`,children:g.map(e=>(0,x.jsxs)(`section`,{className:`card library-card`,children:[(0,x.jsxs)(`div`,{className:`library-card-top`,children:[(0,x.jsx)(`span`,{className:`soft-icon soft-purple`,children:(0,x.jsx)(C,{name:`checkSquare`,size:21})}),(0,x.jsx)(z,{tone:n?.templateId===e.id?`green`:`neutral`,children:n?.templateId===e.id?`Selected`:`Version ${e.version}`})]}),(0,x.jsx)(`h3`,{children:e.name}),(0,x.jsx)(`p`,{children:e.description}),(0,x.jsxs)(`div`,{className:`field-chips`,children:[e.fields.slice(0,5).map(e=>(0,x.jsx)(`span`,{children:e},e)),e.fields.length>5&&(0,x.jsxs)(`span`,{children:[`+`,e.fields.length-5,` fields`]})]}),(0,x.jsxs)(`div`,{className:`library-footer`,children:[(0,x.jsx)(B,{onClick:()=>v(e),children:`View / edit`}),(0,x.jsx)(B,{variant:`primary`,disabled:!n||n.templateId===e.id,onClick:()=>{t(t=>{t.workspaces.find(e=>e.id===n.id).templateId=e.id}),r(`Template selected for this workspace.`)},children:`Use template`})]})]},e.id))}),!g.length&&(0,x.jsx)(`section`,{className:`card`,children:(0,x.jsx)(Ve,{title:`No templates found`,description:`Create a template or import a Excel or CSV example suite.`})})]}):(0,x.jsxs)(`section`,{className:`card`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Imported example suites`}),(0,x.jsx)(z,{tone:`purple`,children:`Style references only`})]}),(0,x.jsx)(`div`,{className:`padded`,children:(0,x.jsx)(H,{children:`Example suites teach formatting and coverage style. Their old expected results are not current business truth.`})}),(e.examples||[]).filter(t=>t.team===e.session.team).map(e=>(0,x.jsxs)(`div`,{className:`history-row`,children:[(0,x.jsx)(C,{name:`file`,size:18}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.name}),(0,x.jsxs)(`small`,{children:[e.rows.length,` rows · Source rows begin at 2 · `,e.fields.length,` columns`]})]}),(0,x.jsx)(B,{onClick:()=>p(e),children:`Review import`})]},e.id)),!(e.examples||[]).some(t=>t.team===e.session.team)&&(0,x.jsx)(Ve,{title:`No examples imported`,description:`Import an Excel or CSV file to review its header fields and row coordinates.`})]}),c&&(0,x.jsx)(We,{title:c.originalId?`Create a template revision`:`Create test template`,close:()=>l(null),wide:!0,children:(0,x.jsxs)(`form`,{onSubmit:i=>{i.preventDefault();let a=L(`template`);t(t=>{t.templates.push({id:a,name:c.name.trim(),description:c.description,fields:c.fields,visibility:c.visibility,workspaceId:c.visibility===`workspace`?n?.id:null,version:c.version+1,team:e.session.team}),R(t,`Saved template ${c.name} v${c.version+1}`)}),l(null),r(`Immutable template version saved.`)},children:[(0,x.jsx)(V,{label:`Template name`,children:(0,x.jsx)(`input`,{required:!0,value:c.name,onChange:e=>l(t=>({...t,name:e.target.value})),maxLength:100})}),(0,x.jsx)(V,{label:`Description`,children:(0,x.jsx)(`textarea`,{rows:2,value:c.description,onChange:e=>l(t=>({...t,description:e.target.value}))})}),(0,x.jsx)(V,{label:`Visibility`,children:(0,x.jsxs)(`select`,{value:c.visibility,onChange:e=>l(t=>({...t,visibility:e.target.value})),children:[(0,x.jsx)(`option`,{value:`team`,children:`Team-shared`}),(0,x.jsx)(`option`,{value:`workspace`,children:`Workspace only`})]})}),(0,x.jsx)(`h3`,{className:`form-section-label`,children:`Output fields and order`}),(0,x.jsx)(`div`,{className:`template-fields`,children:c.fields.map((e,t)=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:t+1}),(0,x.jsx)(`strong`,{children:e}),(0,x.jsx)(`button`,{type:`button`,"aria-label":`Move ${e} up`,disabled:t===0,onClick:()=>l(e=>{let n=[...e.fields];return[n[t-1],n[t]]=[n[t],n[t-1]],{...e,fields:n}}),children:(0,x.jsx)(C,{name:`arrowUp`,size:13})}),(0,x.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:()=>l(e=>({...e,fields:e.fields.filter((e,n)=>n!==t)})),children:(0,x.jsx)(C,{name:`close`,size:14})})]},`${e}-${t}`))}),(0,x.jsxs)(`div`,{className:`inline-form`,children:[(0,x.jsx)(`input`,{"aria-label":`New field name`,value:u,onChange:e=>d(e.target.value),placeholder:`Custom field name`}),(0,x.jsx)(B,{disabled:!u.trim()||c.fields.includes(u.trim()),onClick:()=>{l(e=>({...e,fields:[...e.fields,u.trim()]})),d(``)},children:`Add field`})]}),(0,x.jsx)(H,{children:`Saving creates a new version. Existing suites keep their original template identity. Traceability fields are retained in exports even for a compact presentation.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>l(null),children:`Cancel`}),(0,x.jsxs)(B,{type:`submit`,variant:`primary`,disabled:!c.fields.length||c.visibility===`workspace`&&!n,children:[`Save template v`,c.version+1]})]})]})}),f&&(0,x.jsxs)(We,{title:`Review imported examples`,close:()=>p(null),wide:!0,children:[(0,x.jsxs)(`p`,{className:`modal-intro`,children:[f.name,` · Fields are inferred from the first worksheet row.`]}),(0,x.jsx)(`div`,{className:`field-chips`,children:f.fields.map((e,t)=>(0,x.jsxs)(`span`,{children:[`Column `,t+1,`: `,e]},t))}),(0,x.jsx)(`div`,{className:`table-scroll import-table`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`SOURCE ROW`}),f.fields.map((e,t)=>(0,x.jsx)(`th`,{children:e},t))]})}),(0,x.jsx)(`tbody`,{children:f.rows.slice(0,4).map((e,t)=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:t+2}),e.map((e,t)=>(0,x.jsx)(`td`,{children:e.slice(0,120)},t))]},t))})]})}),(0,x.jsx)(H,{children:`Review the fields before saving. Up to 100 example rows are kept, with source row numbers. Old expected results do not override selected knowledge.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>p(null),children:`Cancel`}),(0,x.jsx)(B,{variant:`primary`,onClick:()=>{f.id||t(t=>{t.examples=[...t.examples||[],{...f,id:L(`example`),team:e.session.team}]}),l({name:f.name.replace(/\.(xlsx|csv)$/i,``),description:`Fields reviewed from ${f.name}`,fields:f.fields,visibility:`team`,version:0}),p(null)},children:`Review as a template`})]})]})]})}async function Gt(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return[...new Uint8Array(t)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Kt({navigate:e,merge:t=!1}){let{state:n,mutate:r,workspace:i,notify:a}=Ee(),o=n.candidates.filter(e=>e.team===n.session.team),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)([!1,!1]),[d,f]=(0,b.useState)(``),[p,m]=(0,b.useState)(``),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(!1),[y,S]=(0,b.useState)(t),[w,T]=(0,b.useState)(``),[E,D]=(0,b.useState)(``);(0,b.useEffect)(()=>{t&&S(!0)},[t]);let O=i?ye(n,i.baselineId,i.crIds):null;function k(e){e.preventDefault(),D(``);try{let e=it(structuredClone(n),i?.id,w);r(t=>{t.candidates.unshift(e),R(t,`Submitted CR merge: ${e.ref}`)}),c(e.id),S(!1),a(`CR merge sent for Administrator approval.`)}catch(e){D(e.message)}}let A=o.find(e=>e.id===s)||o[0],j=A?.manifest,M=JSON.stringify(j||{});(0,b.useEffect)(()=>{u([!1,!1]),g(``),f(``);let e=!0;return A&&Gt(M).then(t=>{e&&f(t)}),()=>{e=!1}},[A?.id,M]);let ee=rt(n,A),te=A?.status===`Pending review`,ne=j?.baseline?.sourceIds||j?.sources?.map(e=>e.id)||[],N=(j?.previousSourceIds||[]).filter(e=>!ne.includes(e));async function P(e){if(!_){v(!0);try{let t=await Gt(M);at(structuredClone(n),A.id,e,h,t),r(n=>{at(n,A.id,e,h,t)}),a(e===`Approved`?`Baseline approved. Its workspace can use the approved version.`:`Baseline request rejected.`)}catch(e){a(e.message)}finally{v(!1)}}}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${n.session.team} · KNOWLEDGE GOVERNANCE`,title:`Baseline approvals`,description:`Review baseline creation and edits before they become available.`,children:(0,x.jsx)(B,{disabled:!i?.baselineId||!i.crIds.length,onClick:()=>S(!0),children:`Merge selected CRs`})}),(0,x.jsxs)(`div`,{className:`approval-layout`,children:[(0,x.jsxs)(`aside`,{className:`card approval-queue`,children:[(0,x.jsx)(`div`,{className:`section-heading`,children:(0,x.jsx)(`h2`,{children:`Requests`})}),o.map(e=>(0,x.jsxs)(`button`,{className:`approval-queue-item ${e.id===A?.id?`selected`:``}`,onClick:()=>c(e.id),children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.ref}),(0,x.jsxs)(`small`,{children:[e.type===`create`?`Baseline creation`:e.type===`changes`?`CR merge`:`Baseline edit`,` · `,new Date(e.createdAt).toLocaleDateString(`en-IN`)]})]}),(0,x.jsx)(z,{tone:e.status===`Approved`?`green`:`amber`,children:e.status})]},e.id)),!o.length&&(0,x.jsx)(Ve,{title:`No approval requests`,description:`New baselines and document edits appear here.`})]}),(0,x.jsx)(`div`,{children:A?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsxs)(`div`,{className:`section-heading inset`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`eyebrow`,children:A.type===`create`?`BASELINE CREATION`:A.type===`changes`?`CR MERGE`:`BASELINE EDIT`}),(0,x.jsx)(`h2`,{children:A.ref})]}),(0,x.jsx)(z,{children:A.status})]}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:A.description||`System knowledge submitted for approval.`}),(0,x.jsxs)(`div`,{className:`approval-document-list`,children:[ne.map(e=>{let t=n.documents.find(t=>t.id===e),r=j?.previousSourceIds&&!j.previousSourceIds.includes(e);return(0,x.jsxs)(`div`,{className:`review-source`,children:[(0,x.jsxs)(`button`,{className:`source-link`,onClick:()=>m(e),children:[(0,x.jsx)(C,{name:`file`,size:19}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:t?.name||e}),(0,x.jsxs)(`small`,{children:[`Revision `,t?.revision,` · `,t?.size]})]})]}),(0,x.jsx)(z,{tone:r?`green`:`neutral`,children:r?`Added`:`Retained`})]},e)}),N.map(e=>(0,x.jsxs)(`div`,{className:`review-source`,children:[(0,x.jsx)(`span`,{children:n.documents.find(t=>t.id===e)?.name}),(0,x.jsx)(z,{tone:`amber`,children:`Removed in this edit`})]},e))]}),j?.changes?.flatMap(e=>e.changes).map((e,t)=>(0,x.jsxs)(`div`,{className:`diff-block`,children:[(0,x.jsxs)(`strong`,{children:[e.op,` · `,e.title]}),e.before&&(0,x.jsxs)(`p`,{children:[(0,x.jsx)(`small`,{children:`BEFORE`}),` `,e.before]}),(0,x.jsxs)(`p`,{children:[(0,x.jsx)(`small`,{children:`AFTER`}),` `,e.after||`Removed from knowledge`]})]},t)),(0,x.jsxs)(`details`,{className:`manifest-details`,children:[(0,x.jsx)(`summary`,{children:`Exact manifest SHA-256`}),(0,x.jsx)(`code`,{children:d||`Preparing manifest…`})]})]}),(0,x.jsxs)(`section`,{className:`card padded margin-top`,children:[(0,x.jsx)(`h2`,{children:`Approval decision`}),ee.map(e=>(0,x.jsx)(H,{tone:`amber`,children:e},e)),[`I reviewed the submitted documents and proposed changes.`,`I approve this exact baseline version for use.`].map((e,t)=>(0,x.jsxs)(`label`,{className:`check-label`,children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:A.status===`Approved`||l[t],disabled:!te||!he(n),onChange:e=>u(n=>n.map((n,r)=>r===t?e.target.checked:n))}),e]},e)),(0,x.jsx)(V,{label:`Decision notes`,children:(0,x.jsx)(`textarea`,{value:h,onChange:e=>g(e.target.value),disabled:!te,rows:2,placeholder:`Add a review note…`})}),(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{variant:`primary`,icon:`shield`,disabled:!he(n)||!l.every(Boolean)||!!ee.length||!d||_||!te,onClick:()=>P(`Approved`),children:A.type===`changes`?`Approve CR merge`:`Approve baseline ${A.type===`create`?`creation`:`edit`}`}),(0,x.jsx)(B,{disabled:!he(n)||!te||!h.trim()||_,onClick:()=>P(`Rejected`),children:`Reject request`})]}),!he(n)&&te&&(0,x.jsxs)(H,{children:[`Awaiting an Administrator’s decision. `,(0,x.jsx)(`button`,{className:`text-button`,onClick:()=>e(`login`),children:`Administrator sign-in`})]})]}),!!A.decisions.length&&(0,x.jsxs)(`section`,{className:`card padded margin-top`,children:[(0,x.jsx)(`h2`,{children:`Decision history`}),A.decisions.map((e,t)=>(0,x.jsxs)(`div`,{className:`decision-record`,children:[(0,x.jsx)(z,{children:e.decision}),(0,x.jsx)(`strong`,{children:e.actor}),(0,x.jsx)(`small`,{children:new Date(e.at).toLocaleString(`en-IN`)}),(0,x.jsx)(`p`,{children:e.rationale||`Submitted version reviewed and approved.`})]},t))]})]}):(0,x.jsx)(`section`,{className:`card`,children:(0,x.jsx)(Ve,{title:`Everything starts with a baseline`,description:`Create a baseline in your workspace and submit it for approval.`,action:(0,x.jsx)(B,{onClick:()=>e(`workspaces`),children:`Open workspaces`})})})})]}),y&&(0,x.jsx)(We,{title:`Merge CRs into a new baseline`,close:()=>S(!1),wide:!0,children:(0,x.jsxs)(`form`,{onSubmit:k,children:[(0,x.jsxs)(`div`,{className:`selection-summary`,children:[(0,x.jsx)(`span`,{children:`Current approved baseline`}),(0,x.jsxs)(`strong`,{children:[O?.baseline?.ref,` · v`,O?.baseline?.version]}),(0,x.jsx)(`small`,{children:`Unchanged requirements and existing documents are retained.`})]}),(0,x.jsx)(`h3`,{className:`form-section-label`,children:`CRs to incorporate`}),O?.changes.map(e=>(0,x.jsxs)(`div`,{className:`history-row`,children:[(0,x.jsx)(C,{name:`branch`,size:18}),(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`strong`,{children:[e.ref,` · `,e.name]}),(0,x.jsxs)(`small`,{children:[`Revision `,e.revision,` · `,e.changes.length,` source-linked changes`]})]})]},e.id)),(0,x.jsx)(V,{label:`New baseline name`,children:(0,x.jsx)(`input`,{required:!0,maxLength:60,placeholder:`e.g. Membership and collateral - CR-1001`,value:w,onChange:e=>T(e.target.value)})}),(0,x.jsx)(H,{children:`Submit this merge for Administrator approval. Approval creates a new baseline version containing the selected CR changes. The current approved baseline stays available.`}),E&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:E}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>S(!1),children:`Cancel`}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,disabled:!w.trim()||!O?.changes.length,children:`Submit merge for approval`})]})]})}),` `,p&&(0,x.jsx)(Je,{sourceId:p,close:()=>m(``)})]})}var qt={Team:`#7a6bc3`,Rule:`#5e89b9`,Document:`#799a83`,Contract:`#b78d50`,CR:`#9474ae`,Unresolved:`#c18f43`};function Jt(e,t,n){if(!t)return{nodes:[],edges:[]};let r=ye(e,t.baselineId,t.crIds),i=ve(e,t),a=new Set(i.map(e=>e.id)),o=[{id:`team`,label:t.team,type:`Team`,x:80,y:220,description:`Owning team. Cross-team traversal ends at explicitly shared contracts.`}],s=[],c=new Map((r.baseline?.rules||[]).map(e=>[e.id,e]));if(r.diff.forEach(e=>{e.op===`REMOVE`?c.delete(e.ruleId):c.set(e.ruleId,{id:e.ruleId,title:e.title,text:e.after,source:e.source})}),(t.customRules||[]).forEach(e=>c.set(e.id,e)),[...c.values()].slice(0,8).forEach((e,t)=>{o.push({id:e.id,label:e.title,type:`Rule`,x:315,y:75+t*100,description:e.text,source:e.source,revision:r.baseline?.version}),s.push({from:e.id,to:`team`,label:`APPLIES_TO`,source:e.source})}),n>=2&&(i.slice(0,8).forEach((e,n)=>{o.push({id:e.id,label:e.name,type:e.team===t.team?`Document`:`Contract`,x:590,y:55+n*88,description:e.excerpt||`Open the source evidence to review this document.`,source:e.id,revision:e.revision})}),[...c.values()].forEach(e=>{a.has(e.source)&&s.push({from:e.id,to:e.source,label:`EVIDENCED_BY`,source:e.source})})),n>=3){r.changes.slice(0,4).forEach((e,t)=>{o.push({id:e.id,label:e.ref,type:`CR`,x:80,y:65+t*100,description:`${e.name} · Revision ${e.revision}`}),e.changes.forEach(t=>{c.has(t.ruleId)&&s.push({from:e.id,to:t.ruleId,label:`AFFECTS`,source:t.source})})});let n=e.questions.find(e=>e.workspaceId===t.id&&e.version===t.version&&e.status!==`resolved`);n&&(o.push({id:n.id,label:`Unresolved dependency`,type:`Unresolved`,x:315,y:75+Math.min(c.size,8)*100,description:`${n.title} ${n.why}`,source:n.sourceId}),a.has(n.sourceId)&&s.push({from:n.id,to:n.sourceId,label:`EVIDENCED_BY`,source:n.sourceId}))}return{nodes:o.slice(0,30),edges:s}}function Yt({navigate:e}){let{state:t,workspace:n}=Ee(),[r,i]=(0,b.useState)(3),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(Object.keys(qt)),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(1),[p,m]=(0,b.useState)({x:0,y:0}),[h,g]=(0,b.useState)(``),_=(0,b.useRef)(null),v=(0,b.useRef)(null),y=(0,b.useMemo)(()=>Jt(t,n,r),[t,n,r]);if(!n)return(0,x.jsx)(qe,{navigate:e});let S=y.nodes.filter(e=>s.includes(e.type)),C=new Set(S.map(e=>e.id)),w=y.edges.filter(e=>C.has(e.from)&&C.has(e.to)),T=y.nodes.find(e=>e.id===l),E=Math.max(490,Math.min(1e3,Math.max(...y.nodes.map(e=>e.y))+75));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${n.ref} · SOURCE-BACKED RELATIONSHIPS`,title:`Dependency graph`,description:`Explore selected rules and evidence without crossing private team boundaries.`}),(0,x.jsx)(Ke,{navigate:e}),(0,x.jsxs)(`div`,{className:`graph-layout margin-top`,children:[(0,x.jsxs)(`section`,{className:`card graph-card`,children:[(0,x.jsxs)(`div`,{className:`graph-toolbar`,children:[(0,x.jsx)(He,{value:a,onChange:o,placeholder:`Highlight an entity…`}),(0,x.jsxs)(`label`,{children:[`Hops`,(0,x.jsx)(`select`,{value:r,onChange:e=>i(Number(e.target.value)),children:[1,2,3].map(e=>(0,x.jsx)(`option`,{children:e},e))})]}),(0,x.jsxs)(`div`,{className:`row-actions`,children:[(0,x.jsx)(B,{"aria-label":`Zoom out`,onClick:()=>f(e=>Math.max(.45,e-.15)),children:`−`}),(0,x.jsxs)(`span`,{className:`subtle`,children:[Math.round(d*100),`%`]}),(0,x.jsx)(B,{"aria-label":`Zoom in`,onClick:()=>f(e=>Math.min(1.8,e+.15)),children:`+`}),(0,x.jsx)(B,{onClick:()=>{f(1),m({x:0,y:0})},children:`Reset`})]})]}),(0,x.jsx)(`div`,{className:`graph-type-filters`,children:Object.entries(qt).map(([e,t])=>(0,x.jsxs)(`label`,{children:[(0,x.jsx)(`input`,{type:`checkbox`,checked:s.includes(e),onChange:()=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}),(0,x.jsx)(`span`,{style:{background:t}}),e]},e))}),(0,x.jsx)(`div`,{className:`graph-surface`,children:(0,x.jsxs)(`svg`,{ref:v,viewBox:`0 0 790 ${E}`,"aria-label":`Interactive source-backed dependency graph`,onPointerDown:e=>{e.button!==0||e.target.closest(`[data-node]`)||(v.current.setPointerCapture(e.pointerId),_.current={x:e.clientX,y:e.clientY,pan:p})},onPointerMove:e=>{if(_.current){let t=790/v.current.getBoundingClientRect().width;m({x:_.current.pan.x+(e.clientX-_.current.x)*t,y:_.current.pan.y+(e.clientY-_.current.y)*t})}},onPointerUp:()=>{_.current=null},onPointerCancel:()=>{_.current=null},children:[(0,x.jsxs)(`defs`,{children:[(0,x.jsx)(`marker`,{id:`graph-arrow`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`,children:(0,x.jsx)(`path`,{d:`M0 0 L6 3 L0 6`,fill:`#b8b6c9`})}),(0,x.jsx)(`pattern`,{id:`dot-grid`,width:`20`,height:`20`,patternUnits:`userSpaceOnUse`,children:(0,x.jsx)(`circle`,{cx:`1`,cy:`1`,r:`.7`,fill:`currentColor`})})]}),(0,x.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`url(#dot-grid)`,className:`graph-grid`}),(0,x.jsxs)(`g`,{transform:`translate(${p.x} ${p.y}) scale(${d})`,children:[w.map((e,t)=>{let n=S.find(t=>t.id===e.from),r=S.find(t=>t.id===e.to),i=r.x<n.x,a=n.x+(i?-65:65),o=r.x+(i?65:-65);return(0,x.jsxs)(`g`,{children:[(0,x.jsx)(`path`,{d:`M ${a} ${n.y} C ${(a+o)/2} ${n.y}, ${(a+o)/2} ${r.y}, ${o} ${r.y}`,fill:`none`,stroke:`#b8b6c9`,strokeWidth:`1.2`,markerEnd:`url(#graph-arrow)`}),(0,x.jsx)(`text`,{x:(n.x+r.x)/2,y:(n.y+r.y)/2-7,textAnchor:`middle`,className:`graph-edge-label`,children:e.label})]},t)}),S.map(e=>(0,x.jsxs)(`g`,{"data-node":e.id,transform:`translate(${e.x},${e.y})`,role:`button`,tabIndex:0,"aria-label":`${e.type}: ${e.label}`,onClick:()=>u(e.id),onKeyDown:t=>{[`Enter`,` `].includes(t.key)&&(t.preventDefault(),u(e.id))},className:`graph-node ${l===e.id?`selected`:``} ${a&&!e.label.toLowerCase().includes(a.toLowerCase())?`dimmed`:``}`,children:[(0,x.jsx)(`rect`,{x:`-65`,y:`-27`,width:`130`,height:`54`,rx:`8`,fill:`var(--surface)`,stroke:qt[e.type],strokeWidth:l===e.id?2.7:1.3}),(0,x.jsx)(`circle`,{cx:`-51`,cy:`-10`,r:`3`,fill:qt[e.type]}),(0,x.jsx)(`text`,{x:`-42`,y:`-7`,className:`graph-node-type`,children:e.type.toUpperCase()}),(0,x.jsx)(`text`,{x:`-51`,y:`12`,className:`graph-node-title`,children:e.label.length>20?`${e.label.slice(0,18)}…`:e.label})]},e.id))]})]})}),(0,x.jsxs)(`div`,{className:`table-footer`,children:[S.length,` nodes · `,w.length,` links · Maximum 3 hops / 30 nodes`,(0,x.jsx)(`span`,{children:`Drag background to pan`})]})]}),(0,x.jsxs)(`section`,{className:`card padded graph-inspector`,children:[(0,x.jsx)(`h2`,{children:T?T.label:`Inspect a relationship`}),T?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`detail-summary`,children:[(0,x.jsx)(z,{tone:`purple`,children:T.type}),T.revision&&(0,x.jsxs)(`span`,{children:[`Revision `,T.revision]})]}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:T.description}),T.source&&(0,x.jsx)(B,{className:`margin-top full-width`,icon:`file`,onClick:()=>g(T.source),children:`Open source evidence`}),(0,x.jsx)(`h3`,{className:`form-section-label`,children:`Directed relationships`}),y.edges.filter(e=>e.from===T.id||e.to===T.id).map((e,t)=>(0,x.jsxs)(`div`,{className:`graph-relationship`,children:[(0,x.jsx)(`small`,{children:e.label}),(0,x.jsxs)(`span`,{children:[y.nodes.find(t=>t.id===e.from)?.label,` → `,y.nodes.find(t=>t.id===e.to)?.label]})]},t))]}):(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Select a node with a click or keyboard to inspect its type, version, relationships, and source evidence.`})]})]}),h&&(0,x.jsx)(Je,{sourceId:h,close:()=>g(``)})]})}function Xt({navigate:e}){let{state:t,mutate:n,notify:r,reset:i}=Ee(),[a,o]=(0,b.useState)(`Teams & access`),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(``),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(t.teams.find(e=>e!==t.session.team)||``),[y,S]=(0,b.useState)({...t.settings}),[w,E]=(0,b.useState)(``),[D,O]=(0,b.useState)(``),A=(0,b.useRef)(null),j=he(t);async function M(e){if(e.preventDefault(),!(!j||p)){O(``),m(!0);try{if(l.length<6||d.length<6)throw Error(`Use at least six characters for each password.`);let e=N(s),[i,a]=await Promise.all([T(l),T(d)]);if(!e||t.teams.some(t=>t.toLowerCase()===e.toLowerCase()))throw Error(`This team already exists.`);if(i===a)throw Error(`Team and administrator passwords must be different.`);n(t=>{k(t,e,i,a),R(t,`Added team ${e}`)}),c(``),u(``),f(``),r(`Team created. Its system password can now be used on the sign-in screen.`)}catch(e){O(e.message)}finally{m(!1)}}}async function ee(e){let t=e.target.files?.[0];if(e.target.value=``,t)try{if(t.size>10*1024*1024)throw Error(`Use a backup under 10 MB.`);let e=JSON.parse(await t.text());if(e.schema!==1||[`teams`,`workspaces`,`baselines`,`documents`,`crs`,`questions`,`suites`,`templates`,`candidates`,`shares`,`audit`,`jobs`].some(t=>!Array.isArray(e[t]))||!e.session||!e.teams.includes(e.session.team)||!e.threads||!e.settings)throw Error(`This file is not a compatible backup.`);let i=F(e);n(e=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,i),e.jobs=e.jobs.map(e=>e.status===`running`?{...e,status:`Interrupted`,stage:`Imported run. Retry to continue.`}:e)}),r(`Backup restored.`),O(``)}catch(e){O(e.message)}}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Be,{eyebrow:`${t.session.team} · SHARED STUDIO`,title:`Administration`,description:`Team access, source sharing, and connection settings.`}),(0,x.jsx)(Ue,{value:a,onChange:o,items:[`Teams & access`,`Knowledge sharing`,`Connections`,`Data & audit`]}),a===`Teams & access`?(0,x.jsxs)(`div`,{className:`detail-grid`,children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Configured teams`}),t.teams.map(e=>(0,x.jsxs)(`div`,{className:`history-row`,children:[(0,x.jsx)(`span`,{className:`team-avatar`,children:e[0]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e}),ne[e]&&(0,x.jsx)(`small`,{children:ne[e]}),(0,x.jsxs)(`small`,{children:[t.workspaces.filter(t=>t.team===e).length,` workspaces · `,t.baselines.filter(t=>t.team===e).length,` System Baselines`]})]}),(0,x.jsx)(z,{tone:`green`,children:`Active`})]},e)),(0,x.jsx)(`h3`,{className:`form-section-label`,children:`Add a team`}),j?(0,x.jsxs)(`form`,{onSubmit:M,children:[(0,x.jsx)(V,{label:`New team name`,children:(0,x.jsx)(`input`,{required:!0,maxLength:40,value:s,onChange:e=>c(e.target.value),placeholder:`Team name`})}),(0,x.jsx)(V,{label:`System password`,children:(0,x.jsx)(`input`,{type:`password`,autoComplete:`new-password`,required:!0,minLength:6,value:l,onChange:e=>u(e.target.value)})}),(0,x.jsx)(V,{label:`Administrator system password`,children:(0,x.jsx)(`input`,{type:`password`,autoComplete:`new-password`,required:!0,minLength:6,value:d,onChange:e=>f(e.target.value)})}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Use different passwords. Both access levels sign in through the same team login.`}),D&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:D}),(0,x.jsx)(`div`,{className:`modal-actions`,children:(0,x.jsx)(B,{variant:`primary`,type:`submit`,icon:`plus`,disabled:p,children:p?`Adding…`:`Add team`})})]}):(0,x.jsx)(H,{children:`Only an Administrator can add a new team. All existing teams use shared team sign-in.`})]}),(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Two access levels`}),(0,x.jsxs)(`div`,{className:`role-row`,children:[(0,x.jsx)(C,{name:`users`,size:19}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:`User`}),(0,x.jsx)(`p`,{children:`Create System Baselines and workspaces, upload documents, resolve questions, generate and edit tests, manage templates, and request baseline updates.`})]})]}),(0,x.jsxs)(`div`,{className:`role-row`,children:[(0,x.jsx)(C,{name:`shield`,size:19}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:`Administrator`}),(0,x.jsx)(`p`,{children:`Everything a User can do, plus add teams and approve or reject System Baseline updates.`})]})]}),(0,x.jsx)(H,{children:`Everyone signed in to a team shares the same working capabilities. Only System Baseline updates need approval.`}),(0,x.jsx)(B,{onClick:()=>{n(e=>{e.session.authenticated=!1}),e(`login`)},children:`Sign out / change access`})]})]}):a===`Knowledge sharing`?(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Explicit source sharing`}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Share a source with another team while preserving its ownership and provenance.`}),(0,x.jsx)(`div`,{className:`table-scroll`,children:(0,x.jsxs)(`table`,{children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{children:`SOURCE`}),(0,x.jsx)(`th`,{children:`OWNER`}),(0,x.jsx)(`th`,{children:`CONSUMER`}),(0,x.jsx)(`th`,{children:`STATUS`}),(0,x.jsx)(`th`,{children:`ACTION`})]})}),(0,x.jsx)(`tbody`,{children:t.shares.map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`td`,{children:t.documents.find(t=>t.id===e.sourceId)?.name||e.sourceId}),(0,x.jsx)(`td`,{children:e.owner}),(0,x.jsx)(`td`,{children:e.consumer}),(0,x.jsx)(`td`,{children:(0,x.jsx)(z,{tone:e.status===`Active`?`green`:`neutral`,children:e.status})}),(0,x.jsx)(`td`,{children:(0,x.jsx)(B,{onClick:()=>{n(t=>{t.shares.find(t=>t.id===e.id).status=e.status===`Active`?`Revoked`:`Active`,R(t,`Updated sharing for ${e.sourceId}`)}),r(`Sharing updated.`)},children:e.status===`Active`?`Revoke`:`Restore`})})]},e.id))})]})}),(0,x.jsxs)(`form`,{className:`sharing-form margin-top`,onSubmit:e=>{e.preventDefault(),!(!h||!_)&&(n(e=>{e.shares.push({id:L(`share`),sourceId:h,owner:t.session.team,consumer:_,status:`Active`}),R(e,`Shared source with ${_}`)}),g(``),r(`Sharing grant saved.`))},children:[(0,x.jsx)(V,{label:`Source owned by current team`,children:(0,x.jsxs)(`select`,{required:!0,value:h,onChange:e=>g(e.target.value),children:[(0,x.jsx)(`option`,{value:``,children:`Choose a source`}),t.documents.filter(e=>e.team===t.session.team).map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}),(0,x.jsx)(V,{label:`Consuming team`,children:(0,x.jsx)(`select`,{value:_,onChange:e=>v(e.target.value),children:t.teams.filter(e=>e!==t.session.team).map(e=>(0,x.jsx)(`option`,{children:e},e))})}),(0,x.jsx)(B,{type:`submit`,variant:`primary`,disabled:!h||t.shares.some(e=>e.sourceId===h&&e.consumer===_),children:`Save sharing grant`})]})]}):a===`Connections`?(0,x.jsxs)(`section`,{className:`card padded settings-card`,children:[(0,x.jsx)(`div`,{className:`section-heading inset`,children:(0,x.jsx)(`h2`,{children:`Model connection configuration`})}),(0,x.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n(e=>{e.settings=y,R(e,`Saved connection settings`)}),r(`Connection settings saved.`)},children:[[[`Model gateway URL`,`gateway`,`https://your-internal-gateway`],[`Generation / reasoning model ID`,`reasoningModel`,`Configured endpoint model identifier`],[`Classification / extraction model ID`,`extractionModel`,`Configured endpoint model identifier`],[`Embedding model ID`,`embeddingModel`,`Pinned embedding profile identifier`]].map(([e,t,n])=>(0,x.jsx)(V,{label:e,children:(0,x.jsx)(`input`,{type:t===`gateway`?`url`:`text`,value:y[t],onChange:e=>S(n=>({...n,[t]:e.target.value})),placeholder:n})},t)),(0,x.jsx)(V,{label:`Bounded retry limit`,children:(0,x.jsx)(`input`,{type:`number`,min:0,max:5,value:y.retryLimit,onChange:e=>S(t=>({...t,retryLimit:Number(e.target.value)}))})}),(0,x.jsx)(`div`,{className:`modal-actions`,children:(0,x.jsx)(B,{type:`submit`,variant:`primary`,children:`Save connection settings`})})]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`section`,{className:`card padded`,children:[(0,x.jsx)(`h2`,{children:`Team workspace`}),(0,x.jsx)(`p`,{className:`supporting-copy`,children:`Back up your workspace records and review activity.`}),(0,x.jsxs)(`div`,{className:`row-actions margin-top`,children:[(0,x.jsx)(B,{icon:`external`,onClick:()=>De(`ccil-studio-backup.json`,JSON.stringify(t,null,2),`application/json`),children:`Export metadata backup`}),(0,x.jsx)(B,{icon:`upload`,onClick:()=>A.current.click(),children:`Import metadata backup`}),(0,x.jsx)(B,{onClick:()=>E(`reset`),children:`Reset application records`}),(0,x.jsx)(`input`,{ref:A,className:`sr-only`,type:`file`,accept:`.json`,onChange:ee})]}),D&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:D}),(0,x.jsx)(H,{children:`Metadata backups include source text and conversations. Original file bytes are not included.`})]}),(0,x.jsxs)(`section`,{className:`card margin-top`,children:[(0,x.jsxs)(`div`,{className:`section-heading`,children:[(0,x.jsx)(`h2`,{children:`Audit trail`}),(0,x.jsx)(`span`,{className:`count-pill`,children:t.audit.length})]}),t.audit.slice(0,40).map(e=>(0,x.jsxs)(`div`,{className:`activity-row`,children:[(0,x.jsx)(C,{name:`clock`,size:17}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`strong`,{children:e.action.replace(/Team Baseline/g,`System Baseline`).replace(/local demo/gi,`studio`)}),(0,x.jsxs)(`p`,{children:[e.actor===`Demo fixture`?`System`:e.actor,` · `,e.team||`System`]})]}),(0,x.jsx)(`small`,{children:new Date(e.at).toLocaleString(`en-IN`)})]},e.id))]})]}),w===`reset`&&(0,x.jsxs)(We,{title:`Reset application records?`,close:()=>E(``),children:[(0,x.jsx)(`p`,{className:`modal-intro`,children:`This replaces application records with synthetic samples. Export a metadata backup first to retain your changes.`}),(0,x.jsx)(H,{children:`Original uploaded files are retained in browser storage.`}),(0,x.jsxs)(`div`,{className:`modal-actions`,children:[(0,x.jsx)(B,{onClick:()=>E(``),children:`Cancel`}),(0,x.jsx)(B,{variant:`primary`,onClick:()=>{i(),E(``),e(`login`)},children:`Reset application records`})]})]})]})}function Zt({navigate:e}){let{state:t,mutate:n}=Ee(),[r,i]=(0,b.useState)(t.session.team),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)(``);async function p(i){if(i.preventDefault(),!l){u(!0),f(``);try{let i=await E(t,r,a);n(e=>{e.session=i,e.activeWorkspaceId=ge(e)[0]?.id||``,R(e,`Signed in to ${r} as ${i.role===`administrator`?`Administrator`:`User`}`)}),o(``),e(`overview`)}catch(e){f(e.message)}finally{u(!1)}}}return(0,x.jsxs)(`div`,{className:`login-page`,children:[(0,x.jsxs)(`section`,{className:`login-story`,children:[(0,x.jsxs)(`div`,{className:`login-brand`,children:[(0,x.jsx)(`span`,{className:`brand-symbol`,children:(0,x.jsx)(C,{name:`layers`,size:29})}),(0,x.jsx)(`span`,{children:`Testcraft Studio`})]}),(0,x.jsxs)(`div`,{className:`login-story-body`,children:[(0,x.jsx)(`span`,{className:`eyebrow`,children:`EVIDENCE. CLARITY. CONFIDENCE.`}),(0,x.jsxs)(`h1`,{children:[`Clear evidence.`,(0,x.jsx)(`br`,{}),`Confident testing.`]}),(0,x.jsx)(`p`,{children:`Bring your system knowledge and change requests together to create traceable test cases.`})]}),(0,x.jsx)(`div`,{className:`login-story-footer`,children:`Built for clear decisions at every step.`})]}),(0,x.jsxs)(`section`,{className:`login-form-area`,children:[(0,x.jsxs)(`form`,{onSubmit:p,children:[(0,x.jsx)(`span`,{className:`eyebrow login-eyebrow`,children:`TESTCRAFT STUDIO`}),(0,x.jsx)(`h2`,{children:`Welcome back`}),(0,x.jsx)(`p`,{children:`Sign in to your workspace.`}),(0,x.jsx)(V,{label:`Team`,children:(0,x.jsxs)(`div`,{className:`login-select-field`,children:[(0,x.jsx)(C,{name:`users`,size:18}),(0,x.jsx)(`select`,{value:r,title:ne[r]||r,onChange:e=>{i(e.target.value),o(``),f(``)},children:t.teams.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))})]})}),(0,x.jsx)(V,{label:`System password`,children:(0,x.jsxs)(`div`,{className:`password-field`,children:[(0,x.jsx)(C,{name:`lock`,size:18}),(0,x.jsx)(`input`,{type:s?`text`:`password`,required:!0,autoComplete:`current-password`,"aria-label":`System password`,value:a,onChange:e=>o(e.target.value),placeholder:`Enter your system password`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-label":s?`Hide password`:`Show password`,title:s?`Hide password`:`Show password`,children:(0,x.jsx)(C,{name:s?`eyeOff`:`eye`,size:18})})]})}),d&&(0,x.jsx)(`p`,{className:`form-error`,role:`alert`,children:d}),(0,x.jsxs)(B,{type:`submit`,variant:`primary`,className:`full-width`,disabled:l||!a,children:[l?`Signing in…`:`Sign in`,` `,(0,x.jsx)(C,{name:`arrow`,size:16})]})]}),(0,x.jsx)(`div`,{className:`login-footer`,children:`Testcraft Studio`})]})]})}var Qt=[{group:`TEAM SPACE`,items:[[`overview`,`Overview`,`overview`],[`workspaces`,`Workspaces`,`folder`],[`baselines`,`System Baselines`,`book`],[`templates`,`Template library`,`checkSquare`]]},{group:`CURRENT WORKSPACE`,items:[[`workspace`,`CR evidence`,`file`],[`versions`,`Knowledge versions`,`branch`],[`chat`,`Workspace chat`,`chat`],[`readiness`,`Generate test cases`,`spark`],[`suites`,`Test suites`,`checkSquare`],[`graph`,`Dependency graph`,`graph`]]},{group:`GOVERNANCE`,items:[[`approvals`,`Baseline approvals`,`shield`],[`admin`,`Administration`,`settings`]]}],$t=Qt.flatMap(e=>e.items),en=()=>{let[e=`overview`,t=``]=location.hash.slice(1).split(`?`),n=new URLSearchParams(t);return{page:e||`overview`,create:n.has(`create`),merge:n.has(`merge`),suiteId:n.get(`suite`)||``}};function tn(){let{state:e,mutate:t,workspace:n,toast:r,notify:i,saveError:a}=Ee(),[o,s]=(0,b.useState)(en),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(()=>{try{return localStorage.getItem(`ccil-preview-theme`)===`dark`}catch{return!1}}),v=(0,b.useRef)(null),{page:y,create:S,merge:w,suiteId:T}=o,E=ge(e),D=e.candidates.filter(t=>t.team===e.session.team&&t.status===`Pending review`);function O(e){location.hash=e,s(en()),p(!1),h(!1),v.current?.scrollTo(0,0)}(0,b.useEffect)(()=>{let e=()=>{s(en()),v.current?.scrollTo(0,0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,b.useEffect)(()=>{document.documentElement.dataset.theme=g?`dark`:`light`;try{localStorage.setItem(`ccil-preview-theme`,g?`dark`:`light`)}catch{}},[g]),(0,b.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),d(``),l(e=>e?``:`command`)),e.key===`Escape`&&(h(!1),p(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{let n=e.jobs.filter(e=>e.status===`running`).map(e=>setTimeout(()=>t(t=>{let n=t.jobs.find(t=>t.id===e.id);if(n?.status!==`running`)return;let r=t.workspaces.find(e=>e.id===n.workspaceId);if(!r||pe(r)!==n.context){n.status=`Cancelled`,n.stage=`Knowledge context changed. Start a new run.`;return}let i={...t,session:{...t.session,team:r.team}};if(!be(i,r).ready){n.status=`Failed`,n.stage=`Readiness changed. Review the current evidence before retrying.`;return}if(n.stageIndex+=1,n.stage=Ae[n.stageIndex],n.stageIndex>=3){let e;try{e=je(i,r,n.templateId)}catch(e){n.status=`Failed`,n.stage=e.message;return}if(!e.tests.length){n.status=`Failed`,n.stage=`No source-linked rules are available for the local generator.`;return}t.suites.unshift(e),n.status=`Completed`,n.suiteId=e.id,R(t,`Completed test suite for ${r.ref}`)}}),900));return()=>n.forEach(clearTimeout)},[e.jobs,e.workspaces,e.questions,e.documents,e.shares]);let k;switch(y){case`overview`:k=(0,x.jsx)(Xe,{navigate:O});break;case`workspaces`:k=(0,x.jsx)($e,{navigate:O,create:S});break;case`baselines`:k=(0,x.jsx)(st,{navigate:O,create:S});break;case`workspace`:k=(0,x.jsx)(lt,{navigate:O});break;case`versions`:k=(0,x.jsx)(ut,{navigate:O});break;case`chat`:k=(0,x.jsx)(Vt,{navigate:O});break;case`readiness`:k=(0,x.jsx)(Ht,{navigate:O});break;case`suites`:k=(0,x.jsx)(Ut,{navigate:O,initialSuiteId:T});break;case`templates`:k=(0,x.jsx)(Wt,{navigate:O});break;case`approvals`:k=(0,x.jsx)(Kt,{navigate:O,merge:w});break;case`graph`:k=(0,x.jsx)(Yt,{navigate:O});break;case`admin`:k=(0,x.jsx)(Xt,{navigate:O});break;case`login`:k=(0,x.jsx)(Zt,{navigate:O});break;default:k=(0,x.jsx)(Ve,{title:`Page not found`,description:`Choose a page from the studio navigation.`,action:(0,x.jsx)(B,{onClick:()=>O(`overview`),children:`Back to overview`})})}let A=e.baselines.find(e=>e.id===n?.baselineId),j=$t.find(e=>e[0]===y)?.[1]||`Sign in`;function M(){t(e=>{e.session.authenticated=!1}),O(`login`)}return y===`login`||!e.session.authenticated?(0,x.jsx)(Zt,{navigate:O}):(0,x.jsxs)(`div`,{className:`app-shell`,children:[(0,x.jsx)(`a`,{className:`skip-link`,href:`#main-content`,onClick:e=>{e.preventDefault(),document.getElementById(`main-content`)?.focus()},children:`Skip to content`}),f&&(0,x.jsx)(`button`,{className:`sidebar-backdrop`,"aria-label":`Close navigation`,onClick:()=>p(!1)}),(0,x.jsxs)(`aside`,{className:`sidebar ${f?`is-open`:``}`,children:[(0,x.jsxs)(`button`,{className:`brand`,onClick:()=>O(`overview`),"aria-label":`Testcraft Studio home`,children:[(0,x.jsx)(`span`,{className:`brand-symbol`,children:(0,x.jsx)(C,{name:`layers`,size:24})}),(0,x.jsxs)(`span`,{children:[(0,x.jsxs)(`strong`,{children:[`Testcraft `,(0,x.jsx)(`span`,{children:`Studio`})]}),(0,x.jsx)(`small`,{children:`EVIDENCE. CLARITY. CONFIDENCE.`})]})]}),(0,x.jsx)(`div`,{className:`team-switcher-wrap`,children:(0,x.jsxs)(`button`,{className:`team-switcher`,onClick:M,"aria-label":`Change team or sign out`,children:[(0,x.jsx)(`span`,{className:`team-avatar`,children:e.session.team[0]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.session.team}),(0,x.jsx)(`small`,{children:`Shared team workspace`})]}),(0,x.jsx)(C,{name:`down`,size:14})]})}),(0,x.jsx)(`nav`,{className:`main-nav`,"aria-label":`Main navigation`,children:Qt.map(t=>(0,x.jsxs)(`div`,{className:`nav-group`,children:[(0,x.jsx)(`span`,{className:`nav-group-label`,children:t.group}),t.items.map(([t,n,r])=>(0,x.jsxs)(`button`,{className:`nav-item ${t===y?`active`:``}`,"aria-current":t===y?`page`:void 0,onClick:()=>O(t),children:[(0,x.jsx)(C,{name:r,size:18}),(0,x.jsx)(`span`,{children:n}),t===`workspaces`&&(0,x.jsx)(`span`,{className:`nav-count`,children:E.length}),t===`approvals`&&e.candidates.some(t=>t.team===e.session.team&&t.status===`Pending review`)&&(0,x.jsx)(`span`,{className:`nav-count`,children:e.candidates.filter(t=>t.team===e.session.team&&t.status===`Pending review`).length})]},t))]},t.group))}),(0,x.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,x.jsxs)(`button`,{className:`sidebar-baseline`,onClick:()=>O(n?`versions`:`baselines`),children:[(0,x.jsx)(`span`,{className:`baseline-symbol`,children:(0,x.jsx)(C,{name:`layers`,size:17})}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`small`,{children:`Selected Baseline`}),(0,x.jsxs)(`strong`,{children:[A?.ref||`Choose a workspace`,A&&(0,x.jsxs)(`span`,{children:[`v`,A.version]})]})]}),A&&(0,x.jsx)(`span`,{className:`tiny-dot green-dot`})]}),(0,x.jsxs)(`button`,{className:`profile`,onClick:M,children:[(0,x.jsx)(`span`,{className:`profile-avatar`,children:(0,x.jsx)(C,{name:`users`,size:18})}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:`${e.session.team} ${e.session.role===`administrator`?`Administrator`:`User`}`}),(0,x.jsx)(`small`,{children:`Sign out / change team`})]}),(0,x.jsx)(C,{name:`down`,size:14})]})]})]}),(0,x.jsxs)(`div`,{className:`app-body`,children:[(0,x.jsxs)(`header`,{className:`topbar`,children:[(0,x.jsx)(`button`,{className:`icon-button mobile-menu`,onClick:()=>p(!0),"aria-label":`Open navigation`,children:(0,x.jsx)(C,{name:`menu`})}),(0,x.jsxs)(`div`,{className:`breadcrumbs`,children:[(0,x.jsx)(`span`,{children:e.session.team}),(0,x.jsx)(C,{name:`chevron`,size:12}),(0,x.jsx)(`strong`,{children:j})]}),(0,x.jsxs)(`select`,{className:`header-workspace`,value:n?.id||``,"aria-label":`Active workspace`,onChange:e=>{t(t=>{t.activeWorkspaceId=e.target.value}),i(`Active workspace context changed.`)},children:[(0,x.jsx)(`option`,{value:``,children:`Select workspace`}),E.map(e=>(0,x.jsxs)(`option`,{value:e.id,children:[e.ref,` · `,e.name]},e.id))]}),(0,x.jsxs)(`div`,{className:`topbar-actions`,children:[(0,x.jsxs)(`button`,{className:`global-search`,onClick:()=>{d(``),l(`command`)},"aria-label":`Search pages`,children:[(0,x.jsx)(C,{name:`search`,size:16}),(0,x.jsx)(`span`,{children:`Jump to…`}),(0,x.jsx)(`kbd`,{children:`Ctrl K`})]}),(0,x.jsx)(`span`,{className:`topbar-divider`}),(0,x.jsx)(`button`,{className:`icon-button`,onClick:()=>_(!g),"aria-label":g?`Switch to light theme`:`Switch to dark theme`,children:(0,x.jsx)(C,{name:g?`sun`:`moon`,size:18})}),(0,x.jsxs)(`button`,{className:`icon-button notification-button`,onClick:()=>l(`notifications`),"aria-label":`Open attention queue`,children:[(0,x.jsx)(C,{name:`bell`,size:19}),D.length>0&&(0,x.jsx)(`span`,{})]})]})]}),(0,x.jsxs)(`main`,{ref:v,id:`main-content`,className:`main-content page-${y}`,tabIndex:-1,children:[a&&(0,x.jsx)(`p`,{className:`storage-error`,role:`alert`,children:a}),(0,x.jsx)(`div`,{children:k},`${y}:${n?.id||e.session.team}`),(0,x.jsx)(`footer`,{className:`app-footer`,children:(0,x.jsxs)(`span`,{children:[`Testcraft Studio `,(0,x.jsx)(`span`,{children:`·`}),` Evidence-led testing`]})})]})]}),r&&(0,x.jsxs)(`div`,{className:`toast`,role:`status`,children:[(0,x.jsx)(C,{name:`check`,size:17}),(0,x.jsx)(`span`,{children:r}),(0,x.jsx)(`button`,{onClick:()=>i(``),"aria-label":`Dismiss notification`,children:(0,x.jsx)(C,{name:`close`,size:15})})]}),c===`command`&&(0,x.jsxs)(We,{title:`Go anywhere`,close:()=>l(``),children:[(0,x.jsx)(He,{value:u,onChange:d,placeholder:`Search studio pages…`}),(0,x.jsx)(`div`,{className:`command-results`,children:$t.filter(([,e])=>e.toLowerCase().includes(u.toLowerCase())).map(([e,t,n])=>(0,x.jsxs)(`button`,{onClick:()=>{O(e),l(``)},children:[(0,x.jsx)(C,{name:n,size:18}),t,(0,x.jsx)(C,{name:`arrow`,size:16})]},e))}),!$t.some(([,e])=>e.toLowerCase().includes(u.toLowerCase()))&&(0,x.jsx)(Ve,{title:`No matching pages`,description:`Try another page name.`})]}),c===`notifications`&&(0,x.jsxs)(We,{title:`Baseline approvals`,close:()=>l(``),children:[D.map(e=>(0,x.jsxs)(`button`,{className:`history-row`,onClick:()=>{O(`approvals`),l(``)},children:[(0,x.jsx)(C,{name:`shield`,size:17}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`strong`,{children:e.ref}),(0,x.jsxs)(`small`,{children:[e.type===`create`?`Baseline creation`:`Baseline edit`,` · Awaiting approval`]})]}),(0,x.jsx)(C,{name:`chevron`,size:15})]},e.id)),!D.length&&(0,x.jsx)(Ve,{title:`No pending approvals`,description:`Baseline creation and edit requests appear here.`})]})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(Te,{children:(0,x.jsx)(tn,{})})}));
Top comments (0)