@astermind/chatbot-template 2.2.11 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astermind-chatbot.esm.js +152 -16
- package/dist/astermind-chatbot.esm.js.map +1 -1
- package/dist/astermind-chatbot.min.js +3 -3
- package/dist/astermind-chatbot.min.js.map +1 -1
- package/dist/astermind-chatbot.umd.js +151 -15
- package/dist/astermind-chatbot.umd.js.map +1 -1
- package/dist/components/ChatbotWidget.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var AsterMindChatbot=function(e){"use strict";var t="undefined"!=typeof document?document.currentScript:null;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},a={},o=Symbol.for("react.element"),i=Symbol.for("react.portal"),
|
|
1
|
+
var AsterMindChatbot=function(e){"use strict";var t="undefined"!=typeof document?document.currentScript:null;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},a={},o=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function w(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}function S(){}function k(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=w.prototype;var x=k.prototype=new S;x.constructor=k,v(x,w.prototype),x.isPureReactComponent=!0;var C=Array.isArray,E=Object.prototype.hasOwnProperty,_={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,n){var r,a={},i=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)E.call(t,r)&&!M.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===a[r]&&(a[r]=l[r]);return{$$typeof:o,type:e,key:i,ref:s,props:a,_owner:_.current}}function N(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var A=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function R(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case o:case i:l=!0}}if(l)return a=a(l=e),e=""===r?"."+P(l,0):r,C(a)?(n="",null!=e&&(n=e.replace(A,"$&/")+"/"),R(a,t,n,"",function(e){return e})):null!=a&&(N(a)&&(a=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(A,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=""===r?".":r+":",C(e))for(var c=0;c<e.length;c++){var u=r+P(s=e[c],c);l+=R(s,t,n,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=g&&e[g]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(s=e.next()).done;)l+=R(s=s.value,t,n,u=r+P(s,c++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function T(e,t,n){if(null==e)return e;var r=[],a=0;return R(e,r,"","",function(e){return t.call(n,e,a++)}),r}function I(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D={current:null},z={transition:null},F={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:z,ReactCurrentOwner:_};function O(){throw Error("act(...) is not supported in production builds of React.")}a.Children={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!N(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a.Component=w,a.Fragment=s,a.Profiler=c,a.PureComponent=k,a.StrictMode=l,a.Suspense=h,a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,a.act=O,a.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=v({},e.props),a=e.key,i=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,s=_.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)E.call(t,c)&&!M.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:o,type:e.type,key:a,ref:i,props:r,_owner:s}},a.createContext=function(e){return(e={$$typeof:d,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:u,_context:e},e.Consumer=e},a.createElement=L,a.createFactory=function(e){var t=L.bind(null,e);return t.type=e,t},a.createRef=function(){return{current:null}},a.forwardRef=function(e){return{$$typeof:f,render:e}},a.isValidElement=N,a.lazy=function(e){return{$$typeof:m,_payload:{_status:-1,_result:e},_init:I}},a.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},a.startTransition=function(e){var t=z.transition;z.transition={};try{e()}finally{z.transition=t}},a.unstable_act=O,a.useCallback=function(e,t){return D.current.useCallback(e,t)},a.useContext=function(e){return D.current.useContext(e)},a.useDebugValue=function(){},a.useDeferredValue=function(e){return D.current.useDeferredValue(e)},a.useEffect=function(e,t){return D.current.useEffect(e,t)},a.useId=function(){return D.current.useId()},a.useImperativeHandle=function(e,t,n){return D.current.useImperativeHandle(e,t,n)},a.useInsertionEffect=function(e,t){return D.current.useInsertionEffect(e,t)},a.useLayoutEffect=function(e,t){return D.current.useLayoutEffect(e,t)},a.useMemo=function(e,t){return D.current.useMemo(e,t)},a.useReducer=function(e,t,n){return D.current.useReducer(e,t,n)},a.useRef=function(e){return D.current.useRef(e)},a.useState=function(e){return D.current.useState(e)},a.useSyncExternalStore=function(e,t,n){return D.current.useSyncExternalStore(e,t,n)},a.useTransition=function(){return D.current.useTransition()},a.version="18.3.1",r.exports=a;var j=r.exports,$=n(j),U={exports:{}},B={},V={exports:{}},W={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* scheduler.production.min.js
|
|
@@ -8,7 +8,7 @@ var AsterMindChatbot=function(e){"use strict";var t="undefined"!=typeof document
|
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var
|
|
11
|
+
!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>a(l,n))c<o&&0>a(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var a=n(c);null!==a;){if(null===a.callback)r(c);else{if(!(a.startTime<=e))break;r(c),a.sortIndex=a.expirationTime,t(l,a)}a=n(c)}}function w(e){if(m=!1,b(e),!p)if(null!==n(l))p=!0,R(S);else{var t=n(c);null!==t&&T(w,t.startTime-e)}}function S(t,a){p=!1,m&&(m=!1,y(E),E=-1),h=!0;var o=f;try{for(b(a),d=n(l);null!==d&&(!(d.expirationTime>a)||t&&!L());){var i=d.callback;if("function"==typeof i){d.callback=null,f=d.priorityLevel;var s=i(d.expirationTime<=a);a=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(a)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&T(w,g.startTime-a),u=!1}return u}finally{d=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,x=!1,C=null,E=-1,_=5,M=-1;function L(){return!(e.unstable_now()-M<_)}function N(){if(null!==C){var t=e.unstable_now();M=t;var n=!0;try{n=C(!0,t)}finally{n?k():(x=!1,C=null)}}else x=!1}if("function"==typeof v)k=function(){v(N)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,P=A.port2;A.port1.onmessage=N,k=function(){P.postMessage(null)}}else k=function(){g(N,0)};function R(e){C=e,x||(x=!0,k())}function T(t,n){E=g(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_continueExecution=function(){p||h||(p=!0,R(S))},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"):_=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},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_pauseExecution=function(){},e.unstable_requestPaint=function(){},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,a,o){var i=e.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?i+o:i:o=i,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 r={id:u++,callback:a,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>i?(r.sortIndex=o,t(c,r),null===n(l)&&r===n(c)&&(m?(y(E),E=-1):m=!0,T(w,o-i))):(r.sortIndex=s,t(l,r),p||h||(p=!0,R(S))),r},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(W),V.exports=W;var H=V.exports,K=j,q=H;
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-dom.production.min.js
|
|
@@ -17,5 +17,5 @@ var AsterMindChatbot=function(e){"use strict";var t="undefined"!=typeof document
|
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var q=new Set,Y={};function X(e,t){J(e,t),J(e+"Capture",t)}function J(e,t){for(Y[e]=t,e=0;e<t.length;e++)q.add(t[e])}var Z=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),ee=Object.prototype.hasOwnProperty,te=/^[: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]*$/,ne={},re={};function ae(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ae(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ae(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ae(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ae(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){oe[e]=new ae(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ae(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){oe[e]=new ae(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){oe[e]=new ae(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){oe[e]=new ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var ie=/[\-:]([a-z])/g;function le(e){return e[1].toUpperCase()}function se(e,t,n,r){var a=oe.hasOwnProperty(t)?oe[t]:null;(null!==a?0!==a.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!ee.call(re,e)||!ee.call(ne,e)&&(te.test(e)?re[e]=!0:(ne[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ie,le);oe[t]=new ae(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ie,le);oe[t]=new ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ie,le);oe[t]=new ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ae(e,1,!1,e.toLowerCase(),null,!1,!1)}),oe.xlinkHref=new ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){oe[e]=new ae(e,1,!1,e.toLowerCase(),null,!0,!0)});var ue=K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ce=Symbol.for("react.element"),de=Symbol.for("react.portal"),fe=Symbol.for("react.fragment"),pe=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),ge=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),we=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),Se=Symbol.for("react.offscreen"),xe=Symbol.iterator;function Ce(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=xe&&e[xe]||e["@@iterator"])?e:null}var _e,Ee=Object.assign;function Me(e){if(void 0===_e)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||""}return"\n"+_e+e}var Ne=!1;function Pe(e,t){if(!e||Ne)return"";Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),o=r.stack.split("\n"),i=a.length-1,l=o.length-1;1<=i&&0<=l&&a[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(a[i]!==o[l]){if(1!==i||1!==l)do{if(i--,0>--l||a[i]!==o[l]){var s="\n"+a[i].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=i&&0<=l);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Me(e):""}function Re(e){switch(e.tag){case 5:return Me(e.type);case 16:return Me("Lazy");case 13:return Me("Suspense");case 19:return Me("SuspenseList");case 0:case 2:case 15:return e=Pe(e.type,!1);case 11:return e=Pe(e.type.render,!1);case 1:return e=Pe(e.type,!0);default:return""}}function Le(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case fe:return"Fragment";case de:return"Portal";case he:return"Profiler";case pe:return"StrictMode";case ve:return"Suspense";case be:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ge:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case ye:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case we:return null!==(t=e.displayName||null)?t:Le(e.type)||"Memo";case ke:t=e._payload,e=e._init;try{return Le(e(t))}catch(e){}}return null}function Ae(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Le(t);case 8:return t===pe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function Te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ze(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function De(e){e._valueTracker||(e._valueTracker=function(e){var t=ze(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ie(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ze(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Oe(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Fe(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function je(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Te(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ue(e,t){null!=(t=t.checked)&&se(e,"checked",t,!1)}function $e(e,t){Ue(e,t);var n=Te(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ve(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ve(e,t.type,Te(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Be(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ve(e,t,n){"number"===t&&Oe(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var We=Array.isArray;function He(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Te(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function Ke(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(G(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(G(92));if(We(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Te(n)}}function Ge(e,t){var n=Te(t.value),r=Te(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function qe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function Ye(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Xe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ye(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Je,Ze,et=(Ze=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((Je=Je||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Ze(e,t)})}:Ze);function tt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var nt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rt=["Webkit","ms","Moz","O"];function at(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||nt.hasOwnProperty(e)&&nt[e]?(""+t).trim():t+"px"}function ot(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=at(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(nt).forEach(function(e){rt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nt[t]=nt[e]})});var it=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lt(e,t){if(t){if(it[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(G(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(G(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(G(62))}}function st(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 ut=null;function ct(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var dt=null,ft=null,pt=null;function ht(e){if(e=so(e)){if("function"!=typeof dt)throw Error(G(280));var t=e.stateNode;t&&(t=co(t),dt(e.stateNode,e.type,t))}}function mt(e){ft?pt?pt.push(e):pt=[e]:ft=e}function gt(){if(ft){var e=ft,t=pt;if(pt=ft=null,ht(e),t)for(e=0;e<t.length;e++)ht(t[e])}}function yt(e,t){return e(t)}function vt(){}var bt=!1;function wt(e,t,n){if(bt)return e(t,n);bt=!0;try{return yt(e,t,n)}finally{bt=!1,(null!==ft||null!==pt)&&(vt(),gt())}}function kt(e,t){var n=e.stateNode;if(null===n)return null;var r=co(n);if(null===r)return null;n=r[t];e: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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(G(231,t,typeof n));return n}var St=!1;if(Z)try{var xt={};Object.defineProperty(xt,"passive",{get:function(){St=!0}}),window.addEventListener("test",xt,xt),window.removeEventListener("test",xt,xt)}catch(Ze){St=!1}function Ct(e,t,n,r,a,o,i,l,s){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var _t=!1,Et=null,Mt=!1,Nt=null,Pt={onError:function(e){_t=!0,Et=e}};function Rt(e,t,n,r,a,o,i,l,s){_t=!1,Et=null,Ct.apply(Pt,arguments)}function Lt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function At(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Tt(e){if(Lt(e)!==e)throw Error(G(188))}function zt(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Lt(e)))throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return Tt(a),e;if(o===r)return Tt(a),t;o=o.sibling}throw Error(G(188))}if(n.return!==r.return)n=a,r=o;else{for(var i=!1,l=a.child;l;){if(l===n){i=!0,n=a,r=o;break}if(l===r){i=!0,r=a,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=a;break}if(l===r){i=!0,r=o,n=a;break}l=l.sibling}if(!i)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(3!==n.tag)throw Error(G(188));return n.stateNode.current===n?e:t}(e),null!==e?Dt(e):null}function Dt(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Dt(e);if(null!==t)return t;e=e.sibling}return null}var It=Q.unstable_scheduleCallback,Ot=Q.unstable_cancelCallback,Ft=Q.unstable_shouldYield,jt=Q.unstable_requestPaint,Ut=Q.unstable_now,$t=Q.unstable_getCurrentPriorityLevel,Bt=Q.unstable_ImmediatePriority,Vt=Q.unstable_UserBlockingPriority,Wt=Q.unstable_NormalPriority,Ht=Q.unstable_LowPriority,Kt=Q.unstable_IdlePriority,Qt=null,Gt=null;var qt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(Yt(e)/Xt|0)|0},Yt=Math.log,Xt=Math.LN2;var Jt=64,Zt=4194304;function en(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tn(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes,i=268435455&n;if(0!==i){var l=i&~a;0!==l?r=en(l):0!==(o&=i)&&(r=en(o))}else 0!==(i=n&~a)?r=en(i):0!==o&&(r=en(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(o=t&-t)||16===a&&4194240&o))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-qt(t)),r|=e[n],t&=~a;return r}function nn(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function rn(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function an(){var e=Jt;return!(4194240&(Jt<<=1))&&(Jt=64),e}function on(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ln(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-qt(t)]=n}function sn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qt(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var un=0;function cn(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var dn,fn,pn,hn,mn,gn=!1,yn=[],vn=null,bn=null,wn=null,kn=new Map,Sn=new Map,xn=[],Cn="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 submit".split(" ");function _n(e,t){switch(e){case"focusin":case"focusout":vn=null;break;case"dragenter":case"dragleave":bn=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":kn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sn.delete(t.pointerId)}}function En(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},null!==t&&(null!==(t=so(t))&&fn(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function Mn(e){var t=lo(e.target);if(null!==t){var n=Lt(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=At(n)))return e.blockedOn=t,void mn(e.priority,function(){pn(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Nn(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=jn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=so(n))&&fn(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ut=r,n.target.dispatchEvent(r),ut=null,t.shift()}return!0}function Pn(e,t,n){Nn(e)&&n.delete(t)}function Rn(){gn=!1,null!==vn&&Nn(vn)&&(vn=null),null!==bn&&Nn(bn)&&(bn=null),null!==wn&&Nn(wn)&&(wn=null),kn.forEach(Pn),Sn.forEach(Pn)}function Ln(e,t){e.blockedOn===t&&(e.blockedOn=null,gn||(gn=!0,Q.unstable_scheduleCallback(Q.unstable_NormalPriority,Rn)))}function An(e){function t(t){return Ln(t,e)}if(0<yn.length){Ln(yn[0],e);for(var n=1;n<yn.length;n++){var r=yn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==vn&&Ln(vn,e),null!==bn&&Ln(bn,e),null!==wn&&Ln(wn,e),kn.forEach(t),Sn.forEach(t),n=0;n<xn.length;n++)(r=xn[n]).blockedOn===e&&(r.blockedOn=null);for(;0<xn.length&&null===(n=xn[0]).blockedOn;)Mn(n),null===n.blockedOn&&xn.shift()}var Tn=ue.ReactCurrentBatchConfig,zn=!0;function Dn(e,t,n,r){var a=un,o=Tn.transition;Tn.transition=null;try{un=1,On(e,t,n,r)}finally{un=a,Tn.transition=o}}function In(e,t,n,r){var a=un,o=Tn.transition;Tn.transition=null;try{un=4,On(e,t,n,r)}finally{un=a,Tn.transition=o}}function On(e,t,n,r){if(zn){var a=jn(e,t,n,r);if(null===a)Ta(e,t,r,Fn,n),_n(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return vn=En(vn,e,t,n,r,a),!0;case"dragenter":return bn=En(bn,e,t,n,r,a),!0;case"mouseover":return wn=En(wn,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return kn.set(o,En(kn.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,Sn.set(o,En(Sn.get(o)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(_n(e,r),4&t&&-1<Cn.indexOf(e)){for(;null!==a;){var o=so(a);if(null!==o&&dn(o),null===(o=jn(e,t,n,r))&&Ta(e,t,r,Fn,n),o===a)break;a=o}null!==a&&r.stopPropagation()}else Ta(e,t,r,null,n)}}var Fn=null;function jn(e,t,n,r){if(Fn=null,null!==(e=lo(e=ct(r))))if(null===(t=Lt(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=At(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Fn=e,null}function Un(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($t()){case Bt:return 1;case Vt:return 4;case Wt:case Ht:return 16;case Kt:return 536870912;default:return 16}default:return 16}}var $n=null,Bn=null,Vn=null;function Wn(){if(Vn)return Vn;var e,t,n=Bn,r=n.length,a="value"in $n?$n.value:$n.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return Vn=a.slice(e,1<t?1-t:void 0)}function Hn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kn(){return!0}function Qn(){return!1}function Gn(e){function t(t,n,r,a,o){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?Kn:Qn,this.isPropagationStopped=Qn,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kn)},persist:function(){},isPersistent:Kn}),t}var qn,Yn,Xn,Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zn=Gn(Jn),er=Ee({},Jn,{view:0,detail:0}),tr=Gn(er),nr=Ee({},er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Xn&&(Xn&&"mousemove"===e.type?(qn=e.screenX-Xn.screenX,Yn=e.screenY-Xn.screenY):Yn=qn=0,Xn=e),qn)},movementY:function(e){return"movementY"in e?e.movementY:Yn}}),rr=Gn(nr),ar=Gn(Ee({},nr,{dataTransfer:0})),or=Gn(Ee({},er,{relatedTarget:0})),ir=Gn(Ee({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0})),lr=Ee({},Jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sr=Gn(lr),ur=Gn(Ee({},Jn,{data:0})),cr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dr={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"},fr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=fr[e])&&!!t[e]}function hr(){return pr}var mr=Ee({},er,{key:function(e){if(e.key){var t=cr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Hn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?dr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hr,charCode:function(e){return"keypress"===e.type?Hn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Hn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),gr=Gn(mr),yr=Gn(Ee({},nr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),vr=Gn(Ee({},er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hr})),br=Gn(Ee({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),wr=Ee({},nr,{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}),kr=Gn(wr),Sr=[9,13,27,32],xr=Z&&"CompositionEvent"in window,Cr=null;Z&&"documentMode"in document&&(Cr=document.documentMode);var _r=Z&&"TextEvent"in window&&!Cr,Er=Z&&(!xr||Cr&&8<Cr&&11>=Cr),Mr=String.fromCharCode(32),Nr=!1;function Pr(e,t){switch(e){case"keyup":return-1!==Sr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Lr=!1;var Ar={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ar[e.type]:"textarea"===t}function zr(e,t,n,r){mt(r),0<(t=Da(t,"onChange")).length&&(n=new Zn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Ir=null;function Or(e){Ma(e,0)}function Fr(e){if(Ie(uo(e)))return e}function jr(e,t){if("change"===e)return t}var Ur=!1;if(Z){var $r;if(Z){var Br="oninput"in document;if(!Br){var Vr=document.createElement("div");Vr.setAttribute("oninput","return;"),Br="function"==typeof Vr.oninput}$r=Br}else $r=!1;Ur=$r&&(!document.documentMode||9<document.documentMode)}function Wr(){Dr&&(Dr.detachEvent("onpropertychange",Hr),Ir=Dr=null)}function Hr(e){if("value"===e.propertyName&&Fr(Ir)){var t=[];zr(t,Ir,e,ct(e)),wt(Or,t)}}function Kr(e,t,n){"focusin"===e?(Wr(),Ir=n,(Dr=t).attachEvent("onpropertychange",Hr)):"focusout"===e&&Wr()}function Qr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Fr(Ir)}function Gr(e,t){if("click"===e)return Fr(t)}function qr(e,t){if("input"===e||"change"===e)return Fr(t)}var Yr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function Xr(e,t){if(Yr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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 a=n[r];if(!ee.call(t,a)||!Yr(e[a],t[a]))return!1}return!0}function Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zr(e,t){var n,r=Jr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jr(r)}}function ea(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ea(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ta(){for(var e=window,t=Oe();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Oe((e=t.contentWindow).document)}return t}function na(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ra(e){var t=ta(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ea(n.ownerDocument.documentElement,n)){if(null!==r&&na(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,o=Math.min(r.start,a);r=void 0===r.end?o:Math.min(r.end,a),!e.extend&&o>r&&(a=r,r=o,o=a),a=Zr(n,o);var i=Zr(n,r);a&&i&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var aa=Z&&"documentMode"in document&&11>=document.documentMode,oa=null,ia=null,la=null,sa=!1;function ua(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sa||null==oa||oa!==Oe(r)||("selectionStart"in(r=oa)&&na(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},la&&Xr(la,r)||(la=r,0<(r=Da(ia,"onSelect")).length&&(t=new Zn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=oa)))}function ca(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var da={animationend:ca("Animation","AnimationEnd"),animationiteration:ca("Animation","AnimationIteration"),animationstart:ca("Animation","AnimationStart"),transitionend:ca("Transition","TransitionEnd")},fa={},pa={};function ha(e){if(fa[e])return fa[e];if(!da[e])return e;var t,n=da[e];for(t in n)if(n.hasOwnProperty(t)&&t in pa)return fa[e]=n[t];return e}Z&&(pa=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);var ma=ha("animationend"),ga=ha("animationiteration"),ya=ha("animationstart"),va=ha("transitionend"),ba=new Map,wa="abort auxClick 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(" ");function ka(e,t){ba.set(e,t),X(t,[e])}for(var Sa=0;Sa<wa.length;Sa++){var xa=wa[Sa];ka(xa.toLowerCase(),"on"+(xa[0].toUpperCase()+xa.slice(1)))}ka(ma,"onAnimationEnd"),ka(ga,"onAnimationIteration"),ka(ya,"onAnimationStart"),ka("dblclick","onDoubleClick"),ka("focusin","onFocus"),ka("focusout","onBlur"),ka(va,"onTransitionEnd"),J("onMouseEnter",["mouseout","mouseover"]),J("onMouseLeave",["mouseout","mouseover"]),J("onPointerEnter",["pointerout","pointerover"]),J("onPointerLeave",["pointerout","pointerover"]),X("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),X("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),X("onBeforeInput",["compositionend","keypress","textInput","paste"]),X("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),X("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),X("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ca="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(" "),_a=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ca));function Ea(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,o,i,l,s){if(Rt.apply(this,arguments),_t){if(!_t)throw Error(G(198));var u=Et;_t=!1,Et=null,Mt||(Mt=!0,Nt=u)}}(r,t,void 0,e),e.currentTarget=null}function Ma(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==o&&a.isPropagationStopped())break e;Ea(a,l,u),o=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,u=l.currentTarget,l=l.listener,s!==o&&a.isPropagationStopped())break e;Ea(a,l,u),o=s}}}if(Mt)throw e=Nt,Mt=!1,Nt=null,e}function Na(e,t){var n=t[ao];void 0===n&&(n=t[ao]=new Set);var r=e+"__bubble";n.has(r)||(Aa(t,e,2,!1),n.add(r))}function Pa(e,t,n){var r=0;t&&(r|=4),Aa(n,e,r,t)}var Ra="_reactListening"+Math.random().toString(36).slice(2);function La(e){if(!e[Ra]){e[Ra]=!0,q.forEach(function(t){"selectionchange"!==t&&(_a.has(t)||Pa(t,!1,e),Pa(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ra]||(t[Ra]=!0,Pa("selectionchange",!1,t))}}function Aa(e,t,n,r){switch(Un(t)){case 1:var a=Dn;break;case 4:a=In;break;default:a=On}n=a.bind(null,t,n,e),a=void 0,!St||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Ta(e,t,n,r,a){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===a||8===l.nodeType&&l.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var s=i.tag;if((3===s||4===s)&&((s=i.stateNode.containerInfo)===a||8===s.nodeType&&s.parentNode===a))return;i=i.return}for(;null!==l;){if(null===(i=lo(l)))return;if(5===(s=i.tag)||6===s){r=o=i;continue e}l=l.parentNode}}r=r.return}wt(function(){var r=o,a=ct(n),i=[];e:{var l=ba.get(e);if(void 0!==l){var s=Zn,u=e;switch(e){case"keypress":if(0===Hn(n))break e;case"keydown":case"keyup":s=gr;break;case"focusin":u="focus",s=or;break;case"focusout":u="blur",s=or;break;case"beforeblur":case"afterblur":s=or;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=ar;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=vr;break;case ma:case ga:case ya:s=ir;break;case va:s=br;break;case"scroll":s=tr;break;case"wheel":s=kr;break;case"copy":case"cut":case"paste":s=sr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=yr}var c=!!(4&t),d=!c&&"scroll"===e,f=c?null!==l?l+"Capture":null:l;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=kt(h,f))&&c.push(za(h,m,p)))),d)break;h=h.return}0<c.length&&(l=new s(l,u,null,n,a),i.push({event:l,listeners:c}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===ut||!(u=n.relatedTarget||n.fromElement)||!lo(u)&&!u[ro])&&(s||l)&&(l=a.window===a?a:(l=a.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(u=(u=n.relatedTarget||n.toElement)?lo(u):null)&&(u!==(d=Lt(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(s=null,u=r),s!==u)){if(c=rr,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=yr,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==s?l:uo(s),p=null==u?l:uo(u),(l=new c(m,h+"leave",s,n,a)).target=d,l.relatedTarget=p,m=null,lo(a)===r&&((c=new c(f,h+"enter",u,n,a)).target=p,c.relatedTarget=d,m=c),d=m,s&&u)e:{for(f=u,h=0,p=c=s;p;p=Ia(p))h++;for(p=0,m=f;m;m=Ia(m))p++;for(;0<h-p;)c=Ia(c),h--;for(;0<p-h;)f=Ia(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=Ia(c),f=Ia(f)}c=null}else c=null;null!==s&&Oa(i,l,s,c,!1),null!==u&&null!==d&&Oa(i,d,u,c,!0)}if("select"===(s=(l=r?uo(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=jr;else if(Tr(l))if(Ur)g=qr;else{g=Qr;var y=Kr}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=Gr);switch(g&&(g=g(e,r))?zr(i,g,n,a):(y&&y(e,l,r),"focusout"===e&&(y=l._wrapperState)&&y.controlled&&"number"===l.type&&Ve(l,"number",l.value)),y=r?uo(r):window,e){case"focusin":(Tr(y)||"true"===y.contentEditable)&&(oa=y,ia=r,la=null);break;case"focusout":la=ia=oa=null;break;case"mousedown":sa=!0;break;case"contextmenu":case"mouseup":case"dragend":sa=!1,ua(i,n,a);break;case"selectionchange":if(aa)break;case"keydown":case"keyup":ua(i,n,a)}var v;if(xr)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Lr?Pr(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Er&&"ko"!==n.locale&&(Lr||"onCompositionStart"!==b?"onCompositionEnd"===b&&Lr&&(v=Wn()):(Bn="value"in($n=a)?$n.value:$n.textContent,Lr=!0)),0<(y=Da(r,b)).length&&(b=new ur(b,e,null,n,a),i.push({event:b,listeners:y}),v?b.data=v:null!==(v=Rr(n))&&(b.data=v))),(v=_r?function(e,t){switch(e){case"compositionend":return Rr(t);case"keypress":return 32!==t.which?null:(Nr=!0,Mr);case"textInput":return(e=t.data)===Mr&&Nr?null:e;default:return null}}(e,n):function(e,t){if(Lr)return"compositionend"===e||!xr&&Pr(e,t)?(e=Wn(),Vn=Bn=$n=null,Lr=!1,e):null;switch(e){case"paste":default: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 Er&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Da(r,"onBeforeInput")).length&&(a=new ur("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=v))}Ma(i,t)})}function za(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Da(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,o=a.stateNode;5===a.tag&&null!==o&&(a=o,null!=(o=kt(e,n))&&r.unshift(za(e,o,a)),null!=(o=kt(e,t))&&r.push(za(e,o,a))),e=e.return}return r}function Ia(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Oa(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,u=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==u&&(l=u,a?null!=(s=kt(n,o))&&i.unshift(za(n,s,l)):a||null!=(s=kt(n,o))&&i.push(za(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Fa=/\r\n?/g,ja=/\u0000|\uFFFD/g;function Ua(e){return("string"==typeof e?e:""+e).replace(Fa,"\n").replace(ja,"")}function $a(e,t,n){if(t=Ua(t),Ua(e)!==t&&n)throw Error(G(425))}function Ba(){}var Va=null,Wa=null;function Ha(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Ka="function"==typeof setTimeout?setTimeout:void 0,Qa="function"==typeof clearTimeout?clearTimeout:void 0,Ga="function"==typeof Promise?Promise:void 0,qa="function"==typeof queueMicrotask?queueMicrotask:void 0!==Ga?function(e){return Ga.resolve(null).then(e).catch(Ya)}:Ka;function Ya(e){setTimeout(function(){throw e})}function Xa(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0===r)return e.removeChild(a),void An(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=a}while(n);An(t)}function Ja(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function Za(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var eo=Math.random().toString(36).slice(2),to="__reactFiber$"+eo,no="__reactProps$"+eo,ro="__reactContainer$"+eo,ao="__reactEvents$"+eo,oo="__reactListeners$"+eo,io="__reactHandles$"+eo;function lo(e){var t=e[to];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ro]||n[to]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Za(e);null!==e;){if(n=e[to])return n;e=Za(e)}return t}n=(e=n).parentNode}return null}function so(e){return!(e=e[to]||e[ro])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function uo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(G(33))}function co(e){return e[no]||null}var fo=[],po=-1;function ho(e){return{current:e}}function mo(e){0>po||(e.current=fo[po],fo[po]=null,po--)}function go(e,t){po++,fo[po]=e.current,e.current=t}var yo={},vo=ho(yo),bo=ho(!1),wo=yo;function ko(e,t){var n=e.type.contextTypes;if(!n)return yo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in n)o[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function So(e){return null!=(e=e.childContextTypes)}function xo(){mo(bo),mo(vo)}function Co(e,t,n){if(vo.current!==yo)throw Error(G(168));go(vo,t),go(bo,n)}function _o(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(G(108,Ae(e)||"Unknown",a));return Ee({},n,r)}function Eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yo,wo=vo.current,go(vo,e),go(bo,bo.current),!0}function Mo(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=_o(e,t,wo),r.__reactInternalMemoizedMergedChildContext=e,mo(bo),mo(vo),go(vo,e)):mo(bo),go(bo,n)}var No=null,Po=!1,Ro=!1;function Lo(e){null===No?No=[e]:No.push(e)}function Ao(){if(!Ro&&null!==No){Ro=!0;var e=0,t=un;try{var n=No;for(un=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}No=null,Po=!1}catch(t){throw null!==No&&(No=No.slice(e+1)),It(Bt,Ao),t}finally{un=t,Ro=!1}}return null}var To=[],zo=0,Do=null,Io=0,Oo=[],Fo=0,jo=null,Uo=1,$o="";function Bo(e,t){To[zo++]=Io,To[zo++]=Do,Do=e,Io=t}function Vo(e,t,n){Oo[Fo++]=Uo,Oo[Fo++]=$o,Oo[Fo++]=jo,jo=e;var r=Uo;e=$o;var a=32-qt(r)-1;r&=~(1<<a),n+=1;var o=32-qt(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,Uo=1<<32-qt(t)+a|n<<a|r,$o=o+e}else Uo=1<<o|n<<a|r,$o=e}function Wo(e){null!==e.return&&(Bo(e,1),Vo(e,1,0))}function Ho(e){for(;e===Do;)Do=To[--zo],To[zo]=null,Io=To[--zo],To[zo]=null;for(;e===jo;)jo=Oo[--Fo],Oo[Fo]=null,$o=Oo[--Fo],Oo[Fo]=null,Uo=Oo[--Fo],Oo[Fo]=null}var Ko=null,Qo=null,Go=!1,qo=null;function Yo(e,t){var n=wc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function Xo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Ko=e,Qo=Ja(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Ko=e,Qo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==jo?{id:Uo,overflow:$o}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=wc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Ko=e,Qo=null,!0);default:return!1}}function Jo(e){return!(!(1&e.mode)||128&e.flags)}function Zo(e){if(Go){var t=Qo;if(t){var n=t;if(!Xo(e,t)){if(Jo(e))throw Error(G(418));t=Ja(n.nextSibling);var r=Ko;t&&Xo(e,t)?Yo(r,n):(e.flags=-4097&e.flags|2,Go=!1,Ko=e)}}else{if(Jo(e))throw Error(G(418));e.flags=-4097&e.flags|2,Go=!1,Ko=e}}}function ei(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Ko=e}function ti(e){if(e!==Ko)return!1;if(!Go)return ei(e),Go=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Ha(e.type,e.memoizedProps)),t&&(t=Qo)){if(Jo(e))throw ni(),Error(G(418));for(;t;)Yo(e,t),t=Ja(t.nextSibling)}if(ei(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Qo=Ja(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Qo=null}}else Qo=Ko?Ja(e.stateNode.nextSibling):null;return!0}function ni(){for(var e=Qo;e;)e=Ja(e.nextSibling)}function ri(){Qo=Ko=null,Go=!1}function ai(e){null===qo?qo=[e]:qo.push(e)}var oi=ue.ReactCurrentBatchConfig;function ii(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var a=r,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function li(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function si(e){return(0,e._init)(e._payload)}function ui(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Sc(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function i(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ec(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function s(e,t,n,r){var o=n.type;return o===fe?c(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===ke&&si(o)===t.type)?((r=a(t,n.props)).ref=ii(e,t,n),r.return=e,r):((r=xc(n.type,n.key,n.props,null,e.mode,r)).ref=ii(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Mc(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function c(e,t,n,r,o){return null===t||7!==t.tag?((t=Cc(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Ec(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ce:return(n=xc(t.type,t.key,t.props,null,e.mode,n)).ref=ii(e,null,t),n.return=e,n;case de:return(t=Mc(t,e.mode,n)).return=e,t;case ke:return d(e,(0,t._init)(t._payload),n)}if(We(t)||Ce(t))return(t=Cc(t,e.mode,n,null)).return=e,t;li(e,t)}return null}function f(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==a?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ce:return n.key===a?s(e,t,n,r):null;case de:return n.key===a?u(e,t,n,r):null;case ke:return f(e,t,(a=n._init)(n._payload),r)}if(We(n)||Ce(n))return null!==a?null:c(e,t,n,r,null);li(e,n)}return null}function p(e,t,n,r,a){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ce:return s(t,e=e.get(null===r.key?n:r.key)||null,r,a);case de:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a);case ke:return p(e,t,n,(0,r._init)(r._payload),a)}if(We(r)||Ce(r))return c(t,e=e.get(n)||null,r,a,null);li(t,r)}return null}function h(a,i,l,s){for(var u=null,c=null,h=i,m=i=0,g=null;null!==h&&m<l.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var y=f(a,h,l[m],s);if(null===y){null===h&&(h=g);break}e&&h&&null===y.alternate&&t(a,h),i=o(y,i,m),null===c?u=y:c.sibling=y,c=y,h=g}if(m===l.length)return n(a,h),Go&&Bo(a,m),u;if(null===h){for(;m<l.length;m++)null!==(h=d(a,l[m],s))&&(i=o(h,i,m),null===c?u=h:c.sibling=h,c=h);return Go&&Bo(a,m),u}for(h=r(a,h);m<l.length;m++)null!==(g=p(h,a,m,l[m],s))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),i=o(g,i,m),null===c?u=g:c.sibling=g,c=g);return e&&h.forEach(function(e){return t(a,e)}),Go&&Bo(a,m),u}function m(a,i,l,s){var u=Ce(l);if("function"!=typeof u)throw Error(G(150));if(null==(l=u.call(l)))throw Error(G(151));for(var c=u=null,h=i,m=i=0,g=null,y=l.next();null!==h&&!y.done;m++,y=l.next()){h.index>m?(g=h,h=null):g=h.sibling;var v=f(a,h,y.value,s);if(null===v){null===h&&(h=g);break}e&&h&&null===v.alternate&&t(a,h),i=o(v,i,m),null===c?u=v:c.sibling=v,c=v,h=g}if(y.done)return n(a,h),Go&&Bo(a,m),u;if(null===h){for(;!y.done;m++,y=l.next())null!==(y=d(a,y.value,s))&&(i=o(y,i,m),null===c?u=y:c.sibling=y,c=y);return Go&&Bo(a,m),u}for(h=r(a,h);!y.done;m++,y=l.next())null!==(y=p(h,a,m,y.value,s))&&(e&&null!==y.alternate&&h.delete(null===y.key?m:y.key),i=o(y,i,m),null===c?u=y:c.sibling=y,c=y);return e&&h.forEach(function(e){return t(a,e)}),Go&&Bo(a,m),u}return function e(r,o,l,s){if("object"==typeof l&&null!==l&&l.type===fe&&null===l.key&&(l=l.props.children),"object"==typeof l&&null!==l){switch(l.$$typeof){case ce:e:{for(var u=l.key,c=o;null!==c;){if(c.key===u){if((u=l.type)===fe){if(7===c.tag){n(r,c.sibling),(o=a(c,l.props.children)).return=r,r=o;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===ke&&si(u)===c.type){n(r,c.sibling),(o=a(c,l.props)).ref=ii(r,c,l),o.return=r,r=o;break e}n(r,c);break}t(r,c),c=c.sibling}l.type===fe?((o=Cc(l.props.children,r.mode,s,l.key)).return=r,r=o):((s=xc(l.type,l.key,l.props,null,r.mode,s)).ref=ii(r,o,l),s.return=r,r=s)}return i(r);case de:e:{for(c=l.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===l.containerInfo&&o.stateNode.implementation===l.implementation){n(r,o.sibling),(o=a(o,l.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Mc(l,r.mode,s)).return=r,r=o}return i(r);case ke:return e(r,o,(c=l._init)(l._payload),s)}if(We(l))return h(r,o,l,s);if(Ce(l))return m(r,o,l,s);li(r,l)}return"string"==typeof l&&""!==l||"number"==typeof l?(l=""+l,null!==o&&6===o.tag?(n(r,o.sibling),(o=a(o,l)).return=r,r=o):(n(r,o),(o=Ec(l,r.mode,s)).return=r,r=o),i(r)):n(r,o)}}var ci=ui(!0),di=ui(!1),fi=ho(null),pi=null,hi=null,mi=null;function gi(){mi=hi=pi=null}function yi(e){var t=fi.current;mo(fi),e._currentValue=t}function vi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bi(e,t){pi=e,mi=hi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ss=!0),e.firstContext=null)}function wi(e){var t=e._currentValue;if(mi!==e)if(e={context:e,memoizedValue:t,next:null},null===hi){if(null===pi)throw Error(G(308));hi=e,pi.dependencies={lanes:0,firstContext:e}}else hi=hi.next=e;return t}var ki=null;function Si(e){null===ki?ki=[e]:ki.push(e)}function xi(e,t,n,r){var a=t.interleaved;return null===a?(n.next=n,Si(t)):(n.next=a.next,a.next=n),t.interleaved=n,Ci(e,r)}function Ci(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var _i=!1;function Ei(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ni(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pi(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&yu){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Ci(e,n)}return null===(a=r.interleaved)?(t.next=t,Si(r)):(t.next=a.next,a.next=t),r.interleaved=t,Ci(e,n)}function Ri(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,sn(e,n)}}function Li(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?a=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?a=o=t:o=o.next=t}else a=o=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ai(e,t,n,r){var a=e.updateQueue;_i=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var s=l,u=s.next;s.next=null,null===i?o=u:i.next=u,i=s;var c=e.alternate;null!==c&&((l=(c=c.updateQueue).lastBaseUpdate)!==i&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(null!==o){var d=a.baseState;for(i=0,c=u=s=null,l=o;;){var f=l.lane,p=l.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var h=e,m=l;switch(f=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=m.payload)?h.call(p,d,f):h))break e;d=Ee({},d,f);break e;case 2:_i=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(f=a.effects)?a.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=p,s=d):c=c.next=p,i|=f;if(null===(l=l.next)){if(null===(l=a.shared.pending))break;l=(f=l).next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}if(null===c&&(s=d),a.baseState=s,a.firstBaseUpdate=u,a.lastBaseUpdate=c,null!==(t=a.shared.interleaved)){a=t;do{i|=a.lane,a=a.next}while(a!==t)}else null===o&&(a.shared.lanes=0);_u|=i,e.lanes=i,e.memoizedState=d}}function Ti(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!=typeof a)throw Error(G(191,a));a.call(r)}}}var zi={},Di=ho(zi),Ii=ho(zi),Oi=ho(zi);function Fi(e){if(e===zi)throw Error(G(174));return e}function ji(e,t){switch(go(Oi,t),go(Ii,e),go(Di,zi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xe(null,"");break;default:t=Xe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}mo(Di),go(Di,t)}function Ui(){mo(Di),mo(Ii),mo(Oi)}function $i(e){Fi(Oi.current);var t=Fi(Di.current),n=Xe(t,e.type);t!==n&&(go(Ii,e),go(Di,n))}function Bi(e){Ii.current===e&&(mo(Di),mo(Ii))}var Vi=ho(0);function Wi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Hi=[];function Ki(){for(var e=0;e<Hi.length;e++)Hi[e]._workInProgressVersionPrimary=null;Hi.length=0}var Qi=ue.ReactCurrentDispatcher,Gi=ue.ReactCurrentBatchConfig,qi=0,Yi=null,Xi=null,Ji=null,Zi=!1,el=!1,tl=0,nl=0;function rl(){throw Error(G(321))}function al(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function ol(e,t,n,r,a,o){if(qi=o,Yi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qi.current=null===e||null===e.memoizedState?Bl:Vl,e=n(r,a),el){o=0;do{if(el=!1,tl=0,25<=o)throw Error(G(301));o+=1,Ji=Xi=null,t.updateQueue=null,Qi.current=Wl,e=n(r,a)}while(el)}if(Qi.current=$l,t=null!==Xi&&null!==Xi.next,qi=0,Ji=Xi=Yi=null,Zi=!1,t)throw Error(G(300));return e}function il(){var e=0!==tl;return tl=0,e}function ll(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ji?Yi.memoizedState=Ji=e:Ji=Ji.next=e,Ji}function sl(){if(null===Xi){var e=Yi.alternate;e=null!==e?e.memoizedState:null}else e=Xi.next;var t=null===Ji?Yi.memoizedState:Ji.next;if(null!==t)Ji=t,Xi=e;else{if(null===e)throw Error(G(310));e={memoizedState:(Xi=e).memoizedState,baseState:Xi.baseState,baseQueue:Xi.baseQueue,queue:Xi.queue,next:null},null===Ji?Yi.memoizedState=Ji=e:Ji=Ji.next=e}return Ji}function ul(e,t){return"function"==typeof t?t(e):t}function cl(e){var t=sl(),n=t.queue;if(null===n)throw Error(G(311));n.lastRenderedReducer=e;var r=Xi,a=r.baseQueue,o=n.pending;if(null!==o){if(null!==a){var i=a.next;a.next=o.next,o.next=i}r.baseQueue=a=o,n.pending=null}if(null!==a){o=a.next,r=r.baseState;var l=i=null,s=null,u=o;do{var c=u.lane;if((qi&c)===c)null!==s&&(s=s.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===s?(l=s=d,i=r):s=s.next=d,Yi.lanes|=c,_u|=c}u=u.next}while(null!==u&&u!==o);null===s?i=r:s.next=l,Yr(r,t.memoizedState)||(ss=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=s,n.lastRenderedState=r}if(null!==(e=n.interleaved)){a=e;do{o=a.lane,Yi.lanes|=o,_u|=o,a=a.next}while(a!==e)}else null===a&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function dl(e){var t=sl(),n=t.queue;if(null===n)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var i=a=a.next;do{o=e(o,i.action),i=i.next}while(i!==a);Yr(o,t.memoizedState)||(ss=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fl(){}function pl(e,t){var n=Yi,r=sl(),a=t(),o=!Yr(r.memoizedState,a);if(o&&(r.memoizedState=a,ss=!0),r=r.queue,_l(gl.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==Ji&&1&Ji.memoizedState.tag){if(n.flags|=2048,wl(9,ml.bind(null,n,r,a,t),void 0,null),null===vu)throw Error(G(349));30&qi||hl(n,t,a)}return a}function hl(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Yi.updateQueue)?(t={lastEffect:null,stores:null},Yi.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function ml(e,t,n,r){t.value=n,t.getSnapshot=r,yl(t)&&vl(e)}function gl(e,t,n){return n(function(){yl(t)&&vl(e)})}function yl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch(e){return!0}}function vl(e){var t=Ci(e,1);null!==t&&Hu(t,e,1,-1)}function bl(e){var t=ll();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t.queue=e,e=e.dispatch=Ol.bind(null,Yi,e),[t.memoizedState,e]}function wl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Yi.updateQueue)?(t={lastEffect:null,stores:null},Yi.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function kl(){return sl().memoizedState}function Sl(e,t,n,r){var a=ll();Yi.flags|=e,a.memoizedState=wl(1|t,n,void 0,void 0===r?null:r)}function xl(e,t,n,r){var a=sl();r=void 0===r?null:r;var o=void 0;if(null!==Xi){var i=Xi.memoizedState;if(o=i.destroy,null!==r&&al(r,i.deps))return void(a.memoizedState=wl(t,n,o,r))}Yi.flags|=e,a.memoizedState=wl(1|t,n,o,r)}function Cl(e,t){return Sl(8390656,8,e,t)}function _l(e,t){return xl(2048,8,e,t)}function El(e,t){return xl(4,2,e,t)}function Ml(e,t){return xl(4,4,e,t)}function Nl(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Pl(e,t,n){return n=null!=n?n.concat([e]):null,xl(4,4,Nl.bind(null,t,e),n)}function Rl(){}function Ll(e,t){var n=sl();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&al(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Al(e,t){var n=sl();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&al(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tl(e,t,n){return 21&qi?(Yr(n,t)||(n=an(),Yi.lanes|=n,_u|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ss=!0),e.memoizedState=n)}function zl(e,t){var n=un;un=0!==n&&4>n?n:4,e(!0);var r=Gi.transition;Gi.transition={};try{e(!1),t()}finally{un=n,Gi.transition=r}}function Dl(){return sl().memoizedState}function Il(e,t,n){var r=Wu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fl(e))jl(t,n);else if(null!==(n=xi(e,t,n,r))){Hu(n,e,r,Vu()),Ul(n,t,r)}}function Ol(e,t,n){var r=Wu(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fl(e))jl(t,a);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,l=o(i,n);if(a.hasEagerState=!0,a.eagerState=l,Yr(l,i)){var s=t.interleaved;return null===s?(a.next=a,Si(t)):(a.next=s.next,s.next=a),void(t.interleaved=a)}}catch(e){}null!==(n=xi(e,t,a,r))&&(Hu(n,e,r,a=Vu()),Ul(n,t,r))}}function Fl(e){var t=e.alternate;return e===Yi||null!==t&&t===Yi}function jl(e,t){el=Zi=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ul(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,sn(e,n)}}var $l={readContext:wi,useCallback:rl,useContext:rl,useEffect:rl,useImperativeHandle:rl,useInsertionEffect:rl,useLayoutEffect:rl,useMemo:rl,useReducer:rl,useRef:rl,useState:rl,useDebugValue:rl,useDeferredValue:rl,useTransition:rl,useMutableSource:rl,useSyncExternalStore:rl,useId:rl,unstable_isNewReconciler:!1},Bl={readContext:wi,useCallback:function(e,t){return ll().memoizedState=[e,void 0===t?null:t],e},useContext:wi,useEffect:Cl,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Sl(4194308,4,Nl.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sl(4,2,e,t)},useMemo:function(e,t){var n=ll();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ll();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Il.bind(null,Yi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ll().memoizedState=e},useState:bl,useDebugValue:Rl,useDeferredValue:function(e){return ll().memoizedState=e},useTransition:function(){var e=bl(!1),t=e[0];return e=zl.bind(null,e[1]),ll().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Yi,a=ll();if(Go){if(void 0===n)throw Error(G(407));n=n()}else{if(n=t(),null===vu)throw Error(G(349));30&qi||hl(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Cl(gl.bind(null,r,o,e),[e]),r.flags|=2048,wl(9,ml.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ll(),t=vu.identifierPrefix;if(Go){var n=$o;t=":"+t+"R"+(n=(Uo&~(1<<32-qt(Uo)-1)).toString(32)+n),0<(n=tl++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=nl++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vl={readContext:wi,useCallback:Ll,useContext:wi,useEffect:_l,useImperativeHandle:Pl,useInsertionEffect:El,useLayoutEffect:Ml,useMemo:Al,useReducer:cl,useRef:kl,useState:function(){return cl(ul)},useDebugValue:Rl,useDeferredValue:function(e){return Tl(sl(),Xi.memoizedState,e)},useTransition:function(){return[cl(ul)[0],sl().memoizedState]},useMutableSource:fl,useSyncExternalStore:pl,useId:Dl,unstable_isNewReconciler:!1},Wl={readContext:wi,useCallback:Ll,useContext:wi,useEffect:_l,useImperativeHandle:Pl,useInsertionEffect:El,useLayoutEffect:Ml,useMemo:Al,useReducer:dl,useRef:kl,useState:function(){return dl(ul)},useDebugValue:Rl,useDeferredValue:function(e){var t=sl();return null===Xi?t.memoizedState=e:Tl(t,Xi.memoizedState,e)},useTransition:function(){return[dl(ul)[0],sl().memoizedState]},useMutableSource:fl,useSyncExternalStore:pl,useId:Dl,unstable_isNewReconciler:!1};function Hl(e,t){if(e&&e.defaultProps){for(var n in t=Ee({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Kl(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:Ee({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Ql={isMounted:function(e){return!!(e=e._reactInternals)&&Lt(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vu(),a=Wu(e),o=Ni(r,a);o.payload=t,null!=n&&(o.callback=n),null!==(t=Pi(e,o,a))&&(Hu(t,e,a,r),Ri(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vu(),a=Wu(e),o=Ni(r,a);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Pi(e,o,a))&&(Hu(t,e,a,r),Ri(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vu(),r=Wu(e),a=Ni(n,r);a.tag=2,null!=t&&(a.callback=t),null!==(t=Pi(e,a,r))&&(Hu(t,e,r,n),Ri(t,e,r))}};function Gl(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!Xr(n,r)||!Xr(a,o))}function ql(e,t,n){var r=!1,a=yo,o=t.contextType;return"object"==typeof o&&null!==o?o=wi(o):(a=So(t)?wo:vo.current,o=(r=null!=(r=t.contextTypes))?ko(e,a):yo),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Ql,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function Yl(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ql.enqueueReplaceState(t,t.state,null)}function Xl(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Ei(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=wi(o):(o=So(t)?wo:vo.current,a.context=ko(e,o)),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Kl(e,t,o,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&Ql.enqueueReplaceState(a,a.state,null),Ai(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4194308)}function Jl(e,t){try{var n="",r=t;do{n+=Re(r),r=r.return}while(r);var a=n}catch(e){a="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:a,digest:null}}function Zl(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function es(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ts="function"==typeof WeakMap?WeakMap:Map;function ns(e,t,n){(n=Ni(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Tu||(Tu=!0,zu=r),es(0,t)},n}function rs(e,t,n){(n=Ni(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){es(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){es(0,t),"function"!=typeof r&&(null===Du?Du=new Set([this]):Du.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function as(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ts;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=hc.bind(null,e,t,n),t.then(e,e))}function os(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function is(e,t,n,r,a){return 1&e.mode?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ni(-1,1)).tag=2,Pi(n,t,1))),n.lanes|=1),e)}var ls=ue.ReactCurrentOwner,ss=!1;function us(e,t,n,r){t.child=null===e?di(t,null,n,r):ci(t,e.child,n,r)}function cs(e,t,n,r,a){n=n.render;var o=t.ref;return bi(t,a),r=ol(e,t,n,r,o,a),n=il(),null===e||ss?(Go&&n&&Wo(t),t.flags|=1,us(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ts(e,t,a))}function ds(e,t,n,r,a){if(null===e){var o=n.type;return"function"!=typeof o||kc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=xc(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,fs(e,t,o,r,a))}if(o=e.child,0===(e.lanes&a)){var i=o.memoizedProps;if((n=null!==(n=n.compare)?n:Xr)(i,r)&&e.ref===t.ref)return Ts(e,t,a)}return t.flags|=1,(e=Sc(o,r)).ref=t.ref,e.return=t,t.child=e}function fs(e,t,n,r,a){if(null!==e){var o=e.memoizedProps;if(Xr(o,r)&&e.ref===t.ref){if(ss=!1,t.pendingProps=r=o,0===(e.lanes&a))return t.lanes=e.lanes,Ts(e,t,a);131072&e.flags&&(ss=!0)}}return ms(e,t,n,r,a)}function ps(e,t,n){var r=t.pendingProps,a=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,go(Su,ku),ku|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,go(Su,ku),ku|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},go(Su,ku),ku|=n;else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,go(Su,ku),ku|=r;return us(e,t,a,n),t.child}function hs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ms(e,t,n,r,a){var o=So(n)?wo:vo.current;return o=ko(t,o),bi(t,a),n=ol(e,t,n,r,o,a),r=il(),null===e||ss?(Go&&r&&Wo(t),t.flags|=1,us(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ts(e,t,a))}function gs(e,t,n,r,a){if(So(n)){var o=!0;Eo(t)}else o=!1;if(bi(t,a),null===t.stateNode)As(e,t),ql(t,n,r),Xl(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,u=n.contextType;"object"==typeof u&&null!==u?u=wi(u):u=ko(t,u=So(n)?wo:vo.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==u)&&Yl(t,i,r,u),_i=!1;var f=t.memoizedState;i.state=f,Ai(t,r,i,a),s=t.memoizedState,l!==r||f!==s||bo.current||_i?("function"==typeof c&&(Kl(t,n,c,r),s=t.memoizedState),(l=_i||Gl(t,n,l,r,f,s,u))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=u,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Mi(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Hl(t.type,l),i.props=u,d=t.pendingProps,f=i.context,"object"==typeof(s=n.contextType)&&null!==s?s=wi(s):s=ko(t,s=So(n)?wo:vo.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||f!==s)&&Yl(t,i,r,s),_i=!1,f=t.memoizedState,i.state=f,Ai(t,r,i,a);var h=t.memoizedState;l!==d||f!==h||bo.current||_i?("function"==typeof p&&(Kl(t,n,p,r),h=t.memoizedState),(u=_i||Gl(t,n,u,r,f,h,s)||!1)?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,h,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=s,r=u):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ys(e,t,n,r,o,a)}function ys(e,t,n,r,a,o){hs(e,t);var i=!!(128&t.flags);if(!r&&!i)return a&&Mo(t,n,!1),Ts(e,t,o);r=t.stateNode,ls.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=ci(t,e.child,null,o),t.child=ci(t,null,l,o)):us(e,t,l,o),t.memoizedState=r.state,a&&Mo(t,n,!0),t.child}function vs(e){var t=e.stateNode;t.pendingContext?Co(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Co(0,t.context,!1),ji(e,t.containerInfo)}function bs(e,t,n,r,a){return ri(),ai(a),t.flags|=256,us(e,t,n,r),t.child}var ws,ks,Ss,xs,Cs={dehydrated:null,treeContext:null,retryLane:0};function _s(e){return{baseLanes:e,cachePool:null,transitions:null}}function Es(e,t,n){var r,a=t.pendingProps,o=Vi.current,i=!1,l=!!(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&!!(2&o)),r?(i=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),go(Vi,1&o),null===e)return Zo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=a.children,e=a.fallback,i?(a=t.mode,i=t.child,l={mode:"hidden",children:l},1&a||null===i?i=_c(l,a,0,null):(i.childLanes=0,i.pendingProps=l),e=Cc(e,a,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=_s(n),t.memoizedState=Cs,e):Ms(t,l));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,a,o,i){if(n)return 256&t.flags?(t.flags&=-257,Ns(e,t,i,r=Zl(Error(G(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,a=t.mode,r=_c({mode:"visible",children:r.children},a,0,null),(o=Cc(o,a,i,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,1&t.mode&&ci(t,e.child,null,i),t.child.memoizedState=_s(i),t.memoizedState=Cs,o);if(!(1&t.mode))return Ns(e,t,i,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var l=r.dgst;return r=l,Ns(e,t,i,r=Zl(o=Error(G(419)),r,void 0))}if(l=0!==(i&e.childLanes),ss||l){if(null!==(r=vu)){switch(i&-i){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=0!==(a&(r.suspendedLanes|i))?0:a)&&a!==o.retryLane&&(o.retryLane=a,Ci(e,a),Hu(r,e,a,-1))}return ac(),Ns(e,t,i,r=Zl(Error(G(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=gc.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Qo=Ja(a.nextSibling),Ko=t,Go=!0,qo=null,null!==e&&(Oo[Fo++]=Uo,Oo[Fo++]=$o,Oo[Fo++]=jo,Uo=e.id,$o=e.overflow,jo=t),t=Ms(t,r.children),t.flags|=4096,t)}(e,t,l,a,r,o,n);if(i){i=a.fallback,l=t.mode,r=(o=e.child).sibling;var s={mode:"hidden",children:a.children};return 1&l||t.child===o?(a=Sc(o,s)).subtreeFlags=14680064&o.subtreeFlags:((a=t.child).childLanes=0,a.pendingProps=s,t.deletions=null),null!==r?i=Sc(r,i):(i=Cc(i,l,n,null)).flags|=2,i.return=t,a.return=t,a.sibling=i,t.child=a,a=i,i=t.child,l=null===(l=e.child.memoizedState)?_s(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=Cs,a}return e=(i=e.child).sibling,a=Sc(i,{mode:"visible",children:a.children}),!(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Ms(e,t){return(t=_c({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ns(e,t,n,r){return null!==r&&ai(r),ci(t,e.child,null,n),(e=Ms(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ps(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),vi(e.return,t,n)}function Rs(e,t,n,r,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a)}function Ls(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(us(e,t,r.children,n),2&(r=Vi.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ps(e,n,t);else if(19===e.tag)Ps(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(go(Vi,r),1&t.mode)switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===Wi(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Rs(t,!1,a,n,o);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===Wi(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Rs(t,!0,n,null,o);break;case"together":Rs(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function As(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ts(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),_u|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(G(153));if(null!==t.child){for(n=Sc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Sc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function zs(e,t){if(!Go)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ds(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Is(e,t,n){var r=t.pendingProps;switch(Ho(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ds(t),null;case 1:case 17:return So(t.type)&&xo(),Ds(t),null;case 3:return r=t.stateNode,Ui(),mo(bo),mo(vo),Ki(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ti(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==qo&&(qu(qo),qo=null))),ks(e,t),Ds(t),null;case 5:Bi(t);var a=Fi(Oi.current);if(n=t.type,null!==e&&null!=t.stateNode)Ss(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(G(166));return Ds(t),null}if(e=Fi(Di.current),ti(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[to]=t,r[no]=o,e=!!(1&t.mode),n){case"dialog":Na("cancel",r),Na("close",r);break;case"iframe":case"object":case"embed":Na("load",r);break;case"video":case"audio":for(a=0;a<Ca.length;a++)Na(Ca[a],r);break;case"source":Na("error",r);break;case"img":case"image":case"link":Na("error",r),Na("load",r);break;case"details":Na("toggle",r);break;case"input":je(r,o),Na("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Na("invalid",r);break;case"textarea":Qe(r,o),Na("invalid",r)}for(var i in lt(n,o),a=null,o)if(o.hasOwnProperty(i)){var l=o[i];"children"===i?"string"==typeof l?r.textContent!==l&&(!0!==o.suppressHydrationWarning&&$a(r.textContent,l,e),a=["children",l]):"number"==typeof l&&r.textContent!==""+l&&(!0!==o.suppressHydrationWarning&&$a(r.textContent,l,e),a=["children",""+l]):Y.hasOwnProperty(i)&&null!=l&&"onScroll"===i&&Na("scroll",r)}switch(n){case"input":De(r),Be(r,o,!0);break;case"textarea":De(r),qe(r);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(r.onclick=Ba)}r=a,t.updateQueue=r,null!==r&&(t.flags|=4)}else{i=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=Ye(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),"select"===n&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[to]=t,e[no]=r,ws(e,t,!1,!1),t.stateNode=e;e:{switch(i=st(n,r),n){case"dialog":Na("cancel",e),Na("close",e),a=r;break;case"iframe":case"object":case"embed":Na("load",e),a=r;break;case"video":case"audio":for(a=0;a<Ca.length;a++)Na(Ca[a],e);a=r;break;case"source":Na("error",e),a=r;break;case"img":case"image":case"link":Na("error",e),Na("load",e),a=r;break;case"details":Na("toggle",e),a=r;break;case"input":je(e,r),a=Fe(e,r),Na("invalid",e);break;case"option":default:a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ee({},r,{value:void 0}),Na("invalid",e);break;case"textarea":Qe(e,r),a=Ke(e,r),Na("invalid",e)}for(o in lt(n,a),l=a)if(l.hasOwnProperty(o)){var s=l[o];"style"===o?ot(e,s):"dangerouslySetInnerHTML"===o?null!=(s=s?s.__html:void 0)&&et(e,s):"children"===o?"string"==typeof s?("textarea"!==n||""!==s)&&tt(e,s):"number"==typeof s&&tt(e,""+s):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(Y.hasOwnProperty(o)?null!=s&&"onScroll"===o&&Na("scroll",e):null!=s&&se(e,o,s,i))}switch(n){case"input":De(e),Be(e,r,!1);break;case"textarea":De(e),qe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Te(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?He(e,!!r.multiple,o,!1):null!=r.defaultValue&&He(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Ba)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ds(t),null;case 6:if(e&&null!=t.stateNode)xs(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(G(166));if(n=Fi(Oi.current),Fi(Di.current),ti(t)){if(r=t.stateNode,n=t.memoizedProps,r[to]=t,(o=r.nodeValue!==n)&&null!==(e=Ko))switch(e.tag){case 3:$a(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&$a(r.nodeValue,n,!!(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[to]=t,t.stateNode=r}return Ds(t),null;case 13:if(mo(Vi),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Go&&null!==Qo&&1&t.mode&&!(128&t.flags))ni(),ri(),t.flags|=98560,o=!1;else if(o=ti(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(G(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(G(317));o[to]=t}else ri(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ds(t),o=!1}else null!==qo&&(qu(qo),qo=null),o=!0;if(!o)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Vi.current?0===xu&&(xu=3):ac())),null!==t.updateQueue&&(t.flags|=4),Ds(t),null);case 4:return Ui(),ks(e,t),null===e&&La(t.stateNode.containerInfo),Ds(t),null;case 10:return yi(t.type._context),Ds(t),null;case 19:if(mo(Vi),null===(o=t.memoizedState))return Ds(t),null;if(r=!!(128&t.flags),null===(i=o.rendering))if(r)zs(o,!1);else{if(0!==xu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(i=Wi(e))){for(t.flags|=128,zs(o,!1),null!==(r=i.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(i=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return go(Vi,1&Vi.current|2),t.child}e=e.sibling}null!==o.tail&&Ut()>Lu&&(t.flags|=128,r=!0,zs(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Wi(i))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),zs(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate&&!Go)return Ds(t),null}else 2*Ut()-o.renderingStartTime>Lu&&1073741824!==n&&(t.flags|=128,r=!0,zs(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(null!==(n=o.last)?n.sibling=i:t.child=i,o.last=i)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,n=Vi.current,go(Vi,r?1&n|2:1&n),t):(Ds(t),null);case 22:case 23:return ec(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&ku)&&(Ds(t),6&t.subtreeFlags&&(t.flags|=8192)):Ds(t),null;case 24:case 25:return null}throw Error(G(156,t.tag))}function Os(e,t){switch(Ho(t),t.tag){case 1:return So(t.type)&&xo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ui(),mo(bo),mo(vo),Ki(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Bi(t),null;case 13:if(mo(Vi),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(G(340));ri()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return mo(Vi),null;case 4:return Ui(),null;case 10:return yi(t.type._context),null;case 22:case 23:return ec(),null;default:return null}}ws=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ks=function(){},Ss=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Fi(Di.current);var o,i=null;switch(n){case"input":a=Fe(e,a),r=Fe(e,r),i=[];break;case"select":a=Ee({},a,{value:void 0}),r=Ee({},r,{value:void 0}),i=[];break;case"textarea":a=Ke(e,a),r=Ke(e,r),i=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Ba)}for(u in lt(n,r),n=null,a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&null!=a[u])if("style"===u){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(Y.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var s=r[u];if(l=null!=a?a[u]:void 0,r.hasOwnProperty(u)&&s!==l&&(null!=s||null!=l))if("style"===u)if(l){for(o in l)!l.hasOwnProperty(o)||s&&s.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in s)s.hasOwnProperty(o)&&l[o]!==s[o]&&(n||(n={}),n[o]=s[o])}else n||(i||(i=[]),i.push(u,n)),n=s;else"dangerouslySetInnerHTML"===u?(s=s?s.__html:void 0,l=l?l.__html:void 0,null!=s&&l!==s&&(i=i||[]).push(u,s)):"children"===u?"string"!=typeof s&&"number"!=typeof s||(i=i||[]).push(u,""+s):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(Y.hasOwnProperty(u)?(null!=s&&"onScroll"===u&&Na("scroll",e),i||l===s||(i=[])):(i=i||[]).push(u,s))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},xs=function(e,t,n,r){n!==r&&(t.flags|=4)};var Fs=!1,js=!1,Us="function"==typeof WeakSet?WeakSet:Set,$s=null;function Bs(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){pc(e,t,n)}else n.current=null}function Vs(e,t,n){try{n()}catch(n){pc(e,t,n)}}var Ws=!1;function Hs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var o=a.destroy;a.destroy=void 0,void 0!==o&&Vs(t,n,o)}a=a.next}while(a!==r)}}function Ks(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qs(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function Gs(e){var t=e.alternate;null!==t&&(e.alternate=null,Gs(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[to],delete t[no],delete t[ao],delete t[oo],delete t[io])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qs(e){return 5===e.tag||3===e.tag||4===e.tag}function Ys(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||qs(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Xs(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ba));else if(4!==r&&null!==(e=e.child))for(Xs(e,t,n),e=e.sibling;null!==e;)Xs(e,t,n),e=e.sibling}function Js(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Js(e,t,n),e=e.sibling;null!==e;)Js(e,t,n),e=e.sibling}var Zs=null,eu=!1;function tu(e,t,n){for(n=n.child;null!==n;)nu(e,t,n),n=n.sibling}function nu(e,t,n){if(Gt&&"function"==typeof Gt.onCommitFiberUnmount)try{Gt.onCommitFiberUnmount(Qt,n)}catch(e){}switch(n.tag){case 5:js||Bs(n,t);case 6:var r=Zs,a=eu;Zs=null,tu(e,t,n),eu=a,null!==(Zs=r)&&(eu?(e=Zs,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Zs.removeChild(n.stateNode));break;case 18:null!==Zs&&(eu?(e=Zs,n=n.stateNode,8===e.nodeType?Xa(e.parentNode,n):1===e.nodeType&&Xa(e,n),An(e)):Xa(Zs,n.stateNode));break;case 4:r=Zs,a=eu,Zs=n.stateNode.containerInfo,eu=!0,tu(e,t,n),Zs=r,eu=a;break;case 0:case 11:case 14:case 15:if(!js&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){a=r=r.next;do{var o=a,i=o.destroy;o=o.tag,void 0!==i&&(2&o||4&o)&&Vs(n,t,i),a=a.next}while(a!==r)}tu(e,t,n);break;case 1:if(!js&&(Bs(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){pc(n,t,e)}tu(e,t,n);break;case 21:tu(e,t,n);break;case 22:1&n.mode?(js=(r=js)||null!==n.memoizedState,tu(e,t,n),js=r):tu(e,t,n);break;default:tu(e,t,n)}}function ru(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Us),t.forEach(function(t){var r=yc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function au(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r];try{var o=e,i=t,l=i;e:for(;null!==l;){switch(l.tag){case 5:Zs=l.stateNode,eu=!1;break e;case 3:case 4:Zs=l.stateNode.containerInfo,eu=!0;break e}l=l.return}if(null===Zs)throw Error(G(160));nu(o,i,a),Zs=null,eu=!1;var s=a.alternate;null!==s&&(s.return=null),a.return=null}catch(e){pc(a,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ou(t,e),t=t.sibling}function ou(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(au(t,e),iu(e),4&r){try{Hs(3,e,e.return),Ks(3,e)}catch(t){pc(e,e.return,t)}try{Hs(5,e,e.return)}catch(t){pc(e,e.return,t)}}break;case 1:au(t,e),iu(e),512&r&&null!==n&&Bs(n,n.return);break;case 5:if(au(t,e),iu(e),512&r&&null!==n&&Bs(n,n.return),32&e.flags){var a=e.stateNode;try{tt(a,"")}catch(t){pc(e,e.return,t)}}if(4&r&&null!=(a=e.stateNode)){var o=e.memoizedProps,i=null!==n?n.memoizedProps:o,l=e.type,s=e.updateQueue;if(e.updateQueue=null,null!==s)try{"input"===l&&"radio"===o.type&&null!=o.name&&Ue(a,o),st(l,i);var u=st(l,o);for(i=0;i<s.length;i+=2){var c=s[i],d=s[i+1];"style"===c?ot(a,d):"dangerouslySetInnerHTML"===c?et(a,d):"children"===c?tt(a,d):se(a,c,d,u)}switch(l){case"input":$e(a,o);break;case"textarea":Ge(a,o);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var p=o.value;null!=p?He(a,!!o.multiple,p,!1):f!==!!o.multiple&&(null!=o.defaultValue?He(a,!!o.multiple,o.defaultValue,!0):He(a,!!o.multiple,o.multiple?[]:"",!1))}a[no]=o}catch(t){pc(e,e.return,t)}}break;case 6:if(au(t,e),iu(e),4&r){if(null===e.stateNode)throw Error(G(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){pc(e,e.return,t)}}break;case 3:if(au(t,e),iu(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{An(t.containerInfo)}catch(t){pc(e,e.return,t)}break;case 4:default:au(t,e),iu(e);break;case 13:au(t,e),iu(e),8192&(a=e.child).flags&&(o=null!==a.memoizedState,a.stateNode.isHidden=o,!o||null!==a.alternate&&null!==a.alternate.memoizedState||(Ru=Ut())),4&r&&ru(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(js=(u=js)||c,au(t,e),js=u):au(t,e),iu(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!c&&1&e.mode)for($s=e,c=e.child;null!==c;){for(d=$s=c;null!==$s;){switch(p=(f=$s).child,f.tag){case 0:case 11:case 14:case 15:Hs(4,f,f.return);break;case 1:Bs(f,f.return);var h=f.stateNode;if("function"==typeof h.componentWillUnmount){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){pc(r,n,e)}}break;case 5:Bs(f,f.return);break;case 22:if(null!==f.memoizedState){cu(d);continue}}null!==p?(p.return=f,$s=p):cu(d)}c=c.sibling}e:for(c=null,d=e;;){if(5===d.tag){if(null===c){c=d;try{a=d.stateNode,u?"function"==typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none":(l=d.stateNode,i=null!=(s=d.memoizedProps.style)&&s.hasOwnProperty("display")?s.display:null,l.style.display=at("display",i))}catch(t){pc(e,e.return,t)}}}else if(6===d.tag){if(null===c)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(t){pc(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:au(t,e),iu(e),4&r&&ru(e);case 21:}}function iu(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(qs(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var a=r.stateNode;32&r.flags&&(tt(a,""),r.flags&=-33),Js(e,Ys(e),a);break;case 3:case 4:var o=r.stateNode.containerInfo;Xs(e,Ys(e),o);break;default:throw Error(G(161))}}catch(t){pc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function lu(e,t,n){$s=e,su(e)}function su(e,t,n){for(var r=!!(1&e.mode);null!==$s;){var a=$s,o=a.child;if(22===a.tag&&r){var i=null!==a.memoizedState||Fs;if(!i){var l=a.alternate,s=null!==l&&null!==l.memoizedState||js;l=Fs;var u=js;if(Fs=i,(js=s)&&!u)for($s=a;null!==$s;)s=(i=$s).child,22===i.tag&&null!==i.memoizedState?du(a):null!==s?(s.return=i,$s=s):du(a);for(;null!==o;)$s=o,su(o),o=o.sibling;$s=a,Fs=l,js=u}uu(e)}else 8772&a.subtreeFlags&&null!==o?(o.return=a,$s=o):uu(e)}}function uu(e){for(;null!==$s;){var t=$s;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:js||Ks(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!js)if(null===n)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Hl(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&Ti(t,o,r);break;case 3:var i=t.updateQueue;if(null!==i){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ti(t,i,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var c=u.memoizedState;if(null!==c){var d=c.dehydrated;null!==d&&An(d)}}}break;default:throw Error(G(163))}js||512&t.flags&&Qs(t)}catch(e){pc(t,t.return,e)}}if(t===e){$s=null;break}if(null!==(n=t.sibling)){n.return=t.return,$s=n;break}$s=t.return}}function cu(e){for(;null!==$s;){var t=$s;if(t===e){$s=null;break}var n=t.sibling;if(null!==n){n.return=t.return,$s=n;break}$s=t.return}}function du(e){for(;null!==$s;){var t=$s;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ks(4,t)}catch(e){pc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var a=t.return;try{r.componentDidMount()}catch(e){pc(t,a,e)}}var o=t.return;try{Qs(t)}catch(e){pc(t,o,e)}break;case 5:var i=t.return;try{Qs(t)}catch(e){pc(t,i,e)}}}catch(e){pc(t,t.return,e)}if(t===e){$s=null;break}var l=t.sibling;if(null!==l){l.return=t.return,$s=l;break}$s=t.return}}var fu,pu=Math.ceil,hu=ue.ReactCurrentDispatcher,mu=ue.ReactCurrentOwner,gu=ue.ReactCurrentBatchConfig,yu=0,vu=null,bu=null,wu=0,ku=0,Su=ho(0),xu=0,Cu=null,_u=0,Eu=0,Mu=0,Nu=null,Pu=null,Ru=0,Lu=1/0,Au=null,Tu=!1,zu=null,Du=null,Iu=!1,Ou=null,Fu=0,ju=0,Uu=null,$u=-1,Bu=0;function Vu(){return 6&yu?Ut():-1!==$u?$u:$u=Ut()}function Wu(e){return 1&e.mode?2&yu&&0!==wu?wu&-wu:null!==oi.transition?(0===Bu&&(Bu=an()),Bu):0!==(e=un)?e:e=void 0===(e=window.event)?16:Un(e.type):1}function Hu(e,t,n,r){if(50<ju)throw ju=0,Uu=null,Error(G(185));ln(e,n,r),2&yu&&e===vu||(e===vu&&(!(2&yu)&&(Eu|=n),4===xu&&Yu(e,wu)),Ku(e,r),1===n&&0===yu&&!(1&t.mode)&&(Lu=Ut()+500,Po&&Ao()))}function Ku(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-qt(o),l=1<<i,s=a[i];-1===s?0!==(l&n)&&0===(l&r)||(a[i]=nn(l,t)):s<=t&&(e.expiredLanes|=l),o&=~l}}(e,t);var r=tn(e,e===vu?wu:0);if(0===r)null!==n&&Ot(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ot(n),1===t)0===e.tag?function(e){Po=!0,Lo(e)}(Xu.bind(null,e)):Lo(Xu.bind(null,e)),qa(function(){!(6&yu)&&Ao()}),n=null;else{switch(cn(r)){case 1:n=Bt;break;case 4:n=Vt;break;case 16:default:n=Wt;break;case 536870912:n=Kt}n=vc(n,Qu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Qu(e,t){if($u=-1,Bu=0,6&yu)throw Error(G(327));var n=e.callbackNode;if(dc()&&e.callbackNode!==n)return null;var r=tn(e,e===vu?wu:0);if(0===r)return null;if(30&r||0!==(r&e.expiredLanes)||t)t=oc(e,r);else{t=r;var a=yu;yu|=2;var o=rc();for(vu===e&&wu===t||(Au=null,Lu=Ut()+500,tc(e,t));;)try{lc();break}catch(t){nc(e,t)}gi(),hu.current=o,yu=a,null!==bu?t=0:(vu=null,wu=0,t=xu)}if(0!==t){if(2===t&&(0!==(a=rn(e))&&(r=a,t=Gu(e,a))),1===t)throw n=Cu,tc(e,0),Yu(e,r),Ku(e,Ut()),n;if(6===t)Yu(e,r);else{if(a=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!Yr(o(),a))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)||(t=oc(e,r),2===t&&(o=rn(e),0!==o&&(r=o,t=Gu(e,o))),1!==t)))throw n=Cu,tc(e,0),Yu(e,r),Ku(e,Ut()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:case 5:cc(e,Pu,Au);break;case 3:if(Yu(e,r),(130023424&r)===r&&10<(t=Ru+500-Ut())){if(0!==tn(e,0))break;if(((a=e.suspendedLanes)&r)!==r){Vu(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ka(cc.bind(null,e,Pu,Au),t);break}cc(e,Pu,Au);break;case 4:if(Yu(e,r),(4194240&r)===r)break;for(t=e.eventTimes,a=-1;0<r;){var i=31-qt(r);o=1<<i,(i=t[i])>a&&(a=i),r&=~o}if(r=a,10<(r=(120>(r=Ut()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pu(r/1960))-r)){e.timeoutHandle=Ka(cc.bind(null,e,Pu,Au),r);break}cc(e,Pu,Au);break;default:throw Error(G(329))}}}return Ku(e,Ut()),e.callbackNode===n?Qu.bind(null,e):null}function Gu(e,t){var n=Nu;return e.current.memoizedState.isDehydrated&&(tc(e,t).flags|=256),2!==(e=oc(e,t))&&(t=Pu,Pu=n,null!==t&&qu(t)),e}function qu(e){null===Pu?Pu=e:Pu.push.apply(Pu,e)}function Yu(e,t){for(t&=~Mu,t&=~Eu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qt(t),r=1<<n;e[n]=-1,t&=~r}}function Xu(e){if(6&yu)throw Error(G(327));dc();var t=tn(e,0);if(!(1&t))return Ku(e,Ut()),null;var n=oc(e,t);if(0!==e.tag&&2===n){var r=rn(e);0!==r&&(t=r,n=Gu(e,r))}if(1===n)throw n=Cu,tc(e,0),Yu(e,t),Ku(e,Ut()),n;if(6===n)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,cc(e,Pu,Au),Ku(e,Ut()),null}function Ju(e,t){var n=yu;yu|=1;try{return e(t)}finally{0===(yu=n)&&(Lu=Ut()+500,Po&&Ao())}}function Zu(e){null!==Ou&&0===Ou.tag&&!(6&yu)&&dc();var t=yu;yu|=1;var n=gu.transition,r=un;try{if(gu.transition=null,un=1,e)return e()}finally{un=r,gu.transition=n,!(6&(yu=t))&&Ao()}}function ec(){ku=Su.current,mo(Su)}function tc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Qa(n)),null!==bu)for(n=bu.return;null!==n;){var r=n;switch(Ho(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&xo();break;case 3:Ui(),mo(bo),mo(vo),Ki();break;case 5:Bi(r);break;case 4:Ui();break;case 13:case 19:mo(Vi);break;case 10:yi(r.type._context);break;case 22:case 23:ec()}n=n.return}if(vu=e,bu=e=Sc(e.current,null),wu=ku=t,xu=0,Cu=null,Mu=Eu=_u=0,Pu=Nu=null,null!==ki){for(t=0;t<ki.length;t++)if(null!==(r=(n=ki[t]).interleaved)){n.interleaved=null;var a=r.next,o=n.pending;if(null!==o){var i=o.next;o.next=a,r.next=i}n.pending=r}ki=null}return e}function nc(e,t){for(;;){var n=bu;try{if(gi(),Qi.current=$l,Zi){for(var r=Yi.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}Zi=!1}if(qi=0,Ji=Xi=Yi=null,el=!1,tl=0,mu.current=null,null===n||null===n.return){xu=1,Cu=t,bu=null;break}e:{var o=e,i=n.return,l=n,s=t;if(t=wu,l.flags|=32768,null!==s&&"object"==typeof s&&"function"==typeof s.then){var u=s,c=l,d=c.tag;if(!(1&c.mode||0!==d&&11!==d&&15!==d)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=os(i);if(null!==p){p.flags&=-257,is(p,i,l,0,t),1&p.mode&&as(o,u,t),s=u;var h=(t=p).updateQueue;if(null===h){var m=new Set;m.add(s),t.updateQueue=m}else h.add(s);break e}if(!(1&t)){as(o,u,t),ac();break e}s=Error(G(426))}else if(Go&&1&l.mode){var g=os(i);if(null!==g){!(65536&g.flags)&&(g.flags|=256),is(g,i,l,0,t),ai(Jl(s,l));break e}}o=s=Jl(s,l),4!==xu&&(xu=2),null===Nu?Nu=[o]:Nu.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Li(o,ns(0,s,t));break e;case 1:l=s;var y=o.type,v=o.stateNode;if(!(128&o.flags||"function"!=typeof y.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==Du&&Du.has(v)))){o.flags|=65536,t&=-t,o.lanes|=t,Li(o,rs(o,l,t));break e}}o=o.return}while(null!==o)}uc(n)}catch(e){t=e,bu===n&&null!==n&&(bu=n=n.return);continue}break}}function rc(){var e=hu.current;return hu.current=$l,null===e?$l:e}function ac(){0!==xu&&3!==xu&&2!==xu||(xu=4),null===vu||!(268435455&_u)&&!(268435455&Eu)||Yu(vu,wu)}function oc(e,t){var n=yu;yu|=2;var r=rc();for(vu===e&&wu===t||(Au=null,tc(e,t));;)try{ic();break}catch(t){nc(e,t)}if(gi(),yu=n,hu.current=r,null!==bu)throw Error(G(261));return vu=null,wu=0,xu}function ic(){for(;null!==bu;)sc(bu)}function lc(){for(;null!==bu&&!Ft();)sc(bu)}function sc(e){var t=fu(e.alternate,e,ku);e.memoizedProps=e.pendingProps,null===t?uc(e):bu=t,mu.current=null}function uc(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Os(n,t)))return n.flags&=32767,void(bu=n);if(null===e)return xu=6,void(bu=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Is(n,t,ku)))return void(bu=n);if(null!==(t=t.sibling))return void(bu=t);bu=t=e}while(null!==t);0===xu&&(xu=5)}function cc(e,t,n){var r=un,a=gu.transition;try{gu.transition=null,un=1,function(e,t,n,r){do{dc()}while(null!==Ou);if(6&yu)throw Error(G(327));n=e.finishedWork;var a=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-qt(n),o=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~o}}(e,o),e===vu&&(bu=vu=null,wu=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Iu||(Iu=!0,vc(Wt,function(){return dc(),null})),o=!!(15990&n.flags),!!(15990&n.subtreeFlags)||o){o=gu.transition,gu.transition=null;var i=un;un=1;var l=yu;yu|=4,mu.current=null,function(e,t){if(Va=zn,na(e=ta())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var i=0,l=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||0!==a&&3!==d.nodeType||(l=i+a),d!==o||0!==r&&3!==d.nodeType||(s=i+r),3===d.nodeType&&(i+=d.nodeValue.length),null!==(p=d.firstChild);)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===a&&(l=i),f===o&&++c===r&&(s=i),null!==(p=d.nextSibling))break;f=(d=f).parentNode}d=p}n=-1===l||-1===s?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wa={focusedElem:e,selectionRange:n},zn=!1,$s=t;null!==$s;)if(e=(t=$s).child,1028&t.subtreeFlags&&null!==e)e.return=t,$s=e;else for(;null!==$s;){t=$s;try{var h=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==h){var m=h.memoizedProps,g=h.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Hl(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(G(163))}}catch(e){pc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,$s=e;break}$s=t.return}h=Ws,Ws=!1}(e,n),ou(n,e),ra(Wa),zn=!!Va,Wa=Va=null,e.current=n,lu(n),jt(),yu=l,un=i,gu.transition=o}else e.current=n;if(Iu&&(Iu=!1,Ou=e,Fu=a),o=e.pendingLanes,0===o&&(Du=null),function(e){if(Gt&&"function"==typeof Gt.onCommitFiberRoot)try{Gt.onCommitFiberRoot(Qt,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),Ku(e,Ut()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Tu)throw Tu=!1,e=zu,zu=null,e;!!(1&Fu)&&0!==e.tag&&dc(),o=e.pendingLanes,1&o?e===Uu?ju++:(ju=0,Uu=e):ju=0,Ao()}(e,t,n,r)}finally{gu.transition=a,un=r}return null}function dc(){if(null!==Ou){var e=cn(Fu),t=gu.transition,n=un;try{if(gu.transition=null,un=16>e?16:e,null===Ou)var r=!1;else{if(e=Ou,Ou=null,Fu=0,6&yu)throw Error(G(331));var a=yu;for(yu|=4,$s=e.current;null!==$s;){var o=$s,i=o.child;if(16&$s.flags){var l=o.deletions;if(null!==l){for(var s=0;s<l.length;s++){var u=l[s];for($s=u;null!==$s;){var c=$s;switch(c.tag){case 0:case 11:case 15:Hs(8,c,o)}var d=c.child;if(null!==d)d.return=c,$s=d;else for(;null!==$s;){var f=(c=$s).sibling,p=c.return;if(Gs(c),c===u){$s=null;break}if(null!==f){f.return=p,$s=f;break}$s=p}}}var h=o.alternate;if(null!==h){var m=h.child;if(null!==m){h.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}$s=o}}if(2064&o.subtreeFlags&&null!==i)i.return=o,$s=i;else e:for(;null!==$s;){if(2048&(o=$s).flags)switch(o.tag){case 0:case 11:case 15:Hs(9,o,o.return)}var y=o.sibling;if(null!==y){y.return=o.return,$s=y;break e}$s=o.return}}var v=e.current;for($s=v;null!==$s;){var b=(i=$s).child;if(2064&i.subtreeFlags&&null!==b)b.return=i,$s=b;else e:for(i=v;null!==$s;){if(2048&(l=$s).flags)try{switch(l.tag){case 0:case 11:case 15:Ks(9,l)}}catch(e){pc(l,l.return,e)}if(l===i){$s=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,$s=w;break e}$s=l.return}}if(yu=a,Ao(),Gt&&"function"==typeof Gt.onPostCommitFiberRoot)try{Gt.onPostCommitFiberRoot(Qt,e)}catch(e){}r=!0}return r}finally{un=n,gu.transition=t}}return!1}function fc(e,t,n){e=Pi(e,t=ns(0,t=Jl(n,t),1),1),t=Vu(),null!==e&&(ln(e,1,t),Ku(e,t))}function pc(e,t,n){if(3===e.tag)fc(e,e,n);else for(;null!==t;){if(3===t.tag){fc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Du||!Du.has(r))){t=Pi(t,e=rs(t,e=Jl(n,e),1),1),e=Vu(),null!==t&&(ln(t,1,e),Ku(t,e));break}}t=t.return}}function hc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Vu(),e.pingedLanes|=e.suspendedLanes&n,vu===e&&(wu&n)===n&&(4===xu||3===xu&&(130023424&wu)===wu&&500>Ut()-Ru?tc(e,0):Mu|=n),Ku(e,t)}function mc(e,t){0===t&&(1&e.mode?(t=Zt,!(130023424&(Zt<<=1))&&(Zt=4194304)):t=1);var n=Vu();null!==(e=Ci(e,t))&&(ln(e,t,n),Ku(e,n))}function gc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),mc(e,n)}function yc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(G(314))}null!==r&&r.delete(t),mc(e,n)}function vc(e,t){return It(e,t)}function bc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wc(e,t,n,r){return new bc(e,t,n,r)}function kc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Sc(e,t){var n=e.alternate;return null===n?((n=wc(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xc(e,t,n,r,a,o){var i=2;if(r=e,"function"==typeof e)kc(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case fe:return Cc(n.children,a,o,t);case pe:i=8,a|=8;break;case he:return(e=wc(12,n,t,2|a)).elementType=he,e.lanes=o,e;case ve:return(e=wc(13,n,t,a)).elementType=ve,e.lanes=o,e;case be:return(e=wc(19,n,t,a)).elementType=be,e.lanes=o,e;case Se:return _c(n,a,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case me:i=10;break e;case ge:i=9;break e;case ye:i=11;break e;case we:i=14;break e;case ke:i=16,r=null;break e}throw Error(G(130,null==e?e:typeof e,""))}return(t=wc(i,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Cc(e,t,n,r){return(e=wc(7,e,r,t)).lanes=n,e}function _c(e,t,n,r){return(e=wc(22,e,r,t)).elementType=Se,e.lanes=n,e.stateNode={isHidden:!1},e}function Ec(e,t,n){return(e=wc(6,e,null,t)).lanes=n,e}function Mc(e,t,n){return(t=wc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Nc(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=on(0),this.expirationTimes=on(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Pc(e,t,n,r,a,o,i,l,s){return e=new Nc(e,t,n,l,s),1===t?(t=1,!0===o&&(t|=8)):t=0,o=wc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ei(o),e}function Rc(e){if(!e)return yo;e:{if(Lt(e=e._reactInternals)!==e||1!==e.tag)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(So(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(G(171))}if(1===e.tag){var n=e.type;if(So(n))return _o(e,n,t)}return t}function Lc(e,t,n,r,a,o,i,l,s){return(e=Pc(n,r,!0,e,0,o,0,l,s)).context=Rc(null),n=e.current,(o=Ni(r=Vu(),a=Wu(n))).callback=null!=t?t:null,Pi(n,o,a),e.current.lanes=a,ln(e,a,r),Ku(e,r),e}function Ac(e,t,n,r){var a=t.current,o=Vu(),i=Wu(a);return n=Rc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ni(o,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Pi(a,t,i))&&(Hu(e,a,i,o),Ri(e,a,i)),i}function Tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function zc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Dc(e,t){zc(e,t),(e=e.alternate)&&zc(e,t)}fu=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||bo.current)ss=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return ss=!1,function(e,t,n){switch(t.tag){case 3:vs(t),ri();break;case 5:$i(t);break;case 1:So(t.type)&&Eo(t);break;case 4:ji(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;go(fi,r._currentValue),r._currentValue=a;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(go(Vi,1&Vi.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Es(e,t,n):(go(Vi,1&Vi.current),null!==(e=Ts(e,t,n))?e.sibling:null);go(Vi,1&Vi.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Ls(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),go(Vi,Vi.current),r)break;return null;case 22:case 23:return t.lanes=0,ps(e,t,n)}return Ts(e,t,n)}(e,t,n);ss=!!(131072&e.flags)}else ss=!1,Go&&1048576&t.flags&&Vo(t,Io,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;As(e,t),e=t.pendingProps;var a=ko(t,vo.current);bi(t,n),a=ol(null,t,r,e,a,n);var o=il();return t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,So(r)?(o=!0,Eo(t)):o=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,Ei(t),a.updater=Ql,t.stateNode=a,a._reactInternals=t,Xl(t,r,e,n),t=ys(null,t,r,!0,o,n)):(t.tag=0,Go&&o&&Wo(t),us(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(As(e,t),e=t.pendingProps,r=(a=r._init)(r._payload),t.type=r,a=t.tag=function(e){if("function"==typeof e)return kc(e)?1:0;if(null!=e){if((e=e.$$typeof)===ye)return 11;if(e===we)return 14}return 2}(r),e=Hl(r,e),a){case 0:t=ms(null,t,r,e,n);break e;case 1:t=gs(null,t,r,e,n);break e;case 11:t=cs(null,t,r,e,n);break e;case 14:t=ds(null,t,r,Hl(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,ms(e,t,r,a=t.elementType===r?a:Hl(r,a),n);case 1:return r=t.type,a=t.pendingProps,gs(e,t,r,a=t.elementType===r?a:Hl(r,a),n);case 3:e:{if(vs(t),null===e)throw Error(G(387));r=t.pendingProps,a=(o=t.memoizedState).element,Mi(e,t),Ai(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=bs(e,t,r,n,a=Jl(Error(G(423)),t));break e}if(r!==a){t=bs(e,t,r,n,a=Jl(Error(G(424)),t));break e}for(Qo=Ja(t.stateNode.containerInfo.firstChild),Ko=t,Go=!0,qo=null,n=di(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ri(),r===a){t=Ts(e,t,n);break e}us(e,t,r,n)}t=t.child}return t;case 5:return $i(t),null===e&&Zo(t),r=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,i=a.children,Ha(r,a)?i=null:null!==o&&Ha(r,o)&&(t.flags|=32),hs(e,t),us(e,t,i,n),t.child;case 6:return null===e&&Zo(t),null;case 13:return Es(e,t,n);case 4:return ji(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ci(t,null,r,n):us(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,cs(e,t,r,a=t.elementType===r?a:Hl(r,a),n);case 7:return us(e,t,t.pendingProps,n),t.child;case 8:case 12:return us(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,i=a.value,go(fi,r._currentValue),r._currentValue=i,null!==o)if(Yr(o.value,i)){if(o.children===a.children&&!bo.current){t=Ts(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){i=o.child;for(var s=l.firstContext;null!==s;){if(s.context===r){if(1===o.tag){(s=Ni(-1,n&-n)).tag=2;var u=o.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?s.next=s:(s.next=c.next,c.next=s),u.pending=s}}o.lanes|=n,null!==(s=o.alternate)&&(s.lanes|=n),vi(o.return,n,t),l.lanes|=n;break}s=s.next}}else if(10===o.tag)i=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(i=o.return))throw Error(G(341));i.lanes|=n,null!==(l=i.alternate)&&(l.lanes|=n),vi(i,n,t),i=o.sibling}else i=o.child;if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===t){i=null;break}if(null!==(o=i.sibling)){o.return=i.return,i=o;break}i=i.return}o=i}us(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,bi(t,n),r=r(a=wi(a)),t.flags|=1,us(e,t,r,n),t.child;case 14:return a=Hl(r=t.type,t.pendingProps),ds(e,t,r,a=Hl(r.type,a),n);case 15:return fs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Hl(r,a),As(e,t),t.tag=1,So(r)?(e=!0,Eo(t)):e=!1,bi(t,n),ql(t,r,a),Xl(t,r,a,n),ys(null,t,r,!0,e,n);case 19:return Ls(e,t,n);case 22:return ps(e,t,n)}throw Error(G(156,t.tag))};var Ic="function"==typeof reportError?reportError:function(e){console.error(e)};function Oc(e){this._internalRoot=e}function Fc(e){this._internalRoot=e}function jc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Uc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function $c(){}function Bc(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o;if("function"==typeof a){var l=a;a=function(){var e=Tc(i);l.call(e)}}Ac(t,i,e,a)}else i=function(e,t,n,r,a){if(a){if("function"==typeof r){var o=r;r=function(){var e=Tc(i);o.call(e)}}var i=Lc(t,r,e,0,null,!1,0,"",$c);return e._reactRootContainer=i,e[ro]=i.current,La(8===e.nodeType?e.parentNode:e),Zu(),i}for(;a=e.lastChild;)e.removeChild(a);if("function"==typeof r){var l=r;r=function(){var e=Tc(s);l.call(e)}}var s=Pc(e,0,!1,null,0,!1,0,"",$c);return e._reactRootContainer=s,e[ro]=s.current,La(8===e.nodeType?e.parentNode:e),Zu(function(){Ac(t,s,n,r)}),s}(n,t,e,a,r);return Tc(i)}Fc.prototype.render=Oc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(G(409));Ac(e,t,null,null)},Fc.prototype.unmount=Oc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zu(function(){Ac(null,e,null,null)}),t[ro]=null}},Fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=hn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xn.length&&0!==t&&t<xn[n].priority;n++);xn.splice(n,0,e),0===n&&Mn(e)}},dn=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=en(t.pendingLanes);0!==n&&(sn(t,1|n),Ku(t,Ut()),!(6&yu)&&(Lu=Ut()+500,Ao()))}break;case 13:Zu(function(){var t=Ci(e,1);if(null!==t){var n=Vu();Hu(t,e,1,n)}}),Dc(e,1)}},fn=function(e){if(13===e.tag){var t=Ci(e,134217728);if(null!==t)Hu(t,e,134217728,Vu());Dc(e,134217728)}},pn=function(e){if(13===e.tag){var t=Wu(e),n=Ci(e,t);if(null!==n)Hu(n,e,t,Vu());Dc(e,t)}},hn=function(){return un},mn=function(e,t){var n=un;try{return un=e,t()}finally{un=n}},dt=function(e,t,n){switch(t){case"input":if($e(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=co(r);if(!a)throw Error(G(90));Ie(r),$e(r,a)}}}break;case"textarea":Ge(e,n);break;case"select":null!=(t=n.value)&&He(e,!!n.multiple,t,!1)}},yt=Ju,vt=Zu;var Vc={usingClientEntryPoint:!1,Events:[so,uo,co,mt,gt,Ju]},Wc={findFiberByHostInstance:lo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hc={bundleType:Wc.bundleType,version:Wc.version,rendererPackageName:Wc.rendererPackageName,rendererConfig:Wc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ue.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=zt(e))?null:e.stateNode},findFiberByHostInstance:Wc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kc.isDisabled&&Kc.supportsFiber)try{Qt=Kc.inject(Hc),Gt=Kc}catch(Ze){}}B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vc,B.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!jc(t))throw Error(G(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:de,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},B.createRoot=function(e,t){if(!jc(e))throw Error(G(299));var n=!1,r="",a=Ic;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=Pc(e,1,!1,null,0,n,0,r,a),e[ro]=t.current,La(8===e.nodeType?e.parentNode:e),new Oc(t)},B.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(G(188));throw e=Object.keys(e).join(","),Error(G(268,e))}return e=null===(e=zt(t))?null:e.stateNode},B.flushSync=function(e){return Zu(e)},B.hydrate=function(e,t,n){if(!Uc(t))throw Error(G(200));return Bc(null,e,t,!0,n)},B.hydrateRoot=function(e,t,n){if(!jc(e))throw Error(G(405));var r=null!=n&&n.hydratedSources||null,a=!1,o="",i=Ic;if(null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(i=n.onRecoverableError)),t=Lc(t,null,e,1,null!=n?n:null,a,0,o,i),e[ro]=t.current,La(e),r)for(e=0;e<r.length;e++)a=(a=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Fc(t)},B.render=function(e,t,n){if(!Uc(t))throw Error(G(200));return Bc(null,e,t,!1,n)},B.unmountComponentAtNode=function(e){if(!Uc(e))throw Error(G(40));return!!e._reactRootContainer&&(Zu(function(){Bc(null,null,e,!1,function(){e._reactRootContainer=null,e[ro]=null})}),!0)},B.unstable_batchedUpdates=Ju,B.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Uc(n))throw Error(G(200));if(null==e||void 0===e._reactInternals)throw Error(G(38));return Bc(e,t,n,!1,r)},B.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),$.exports=B;var Qc,Gc=$.exports;Qc=Gc.createRoot,Gc.hydrateRoot;var qc={exports:{}},Yc={},Xc=j,Jc=Symbol.for("react.element"),Zc=Symbol.for("react.fragment"),ed=Object.prototype.hasOwnProperty,td=Xc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nd={key:!0,ref:!0,__self:!0,__source:!0};function rd(e,t,n){var r,a={},o=null,i=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(i=t.ref),t)ed.call(t,r)&&!nd.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:Jc,type:e,key:o,ref:i,props:a,_owner:td.current}}Yc.Fragment=Zc,Yc.jsx=rd,Yc.jsxs=rd,qc.exports=Yc;var ad=qc.exports;function od(e){return{title:e.title,snippet:e.content,relevance:e.score,documentId:e.documentId,fullContent:e.fullContent,downloadUrl:e.downloadUrl,documentName:e.documentName,sourceType:e.sourceType,chunkId:e.chunkId}}class id{constructor(e,t){this.baseUrl=e.replace(/\/$/,""),this.apiKey=t}async chat(e,t){const n=await fetch(`${this.baseUrl}/api/external/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.apiKey},body:JSON.stringify({message:e,sessionId:t?.sessionId,context:t?.context})});if(!n.ok){const e=await n.json().catch(()=>({}));throw new Error(e.message||`HTTP ${n.status}: ${n.statusText}`)}const r=await n.json();return{...r,sources:(r.sources||[]).map(od)}}async chatStream(e,t){const n=await fetch(`${this.baseUrl}/api/external/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.apiKey},body:JSON.stringify({message:e,sessionId:t?.sessionId,context:t?.context})});if(!n.ok){const e=await n.json().catch(()=>({}));throw new Error(e.message||`HTTP ${n.status}`)}const r=n.body?.getReader();if(!r)throw new Error("Streaming not supported");const a=new TextDecoder;let o,i="",l="",s=[];try{for(;;){const{done:e,value:n}=await r.read();if(e)break;i+=a.decode(n,{stream:!0});const u=i.split("\n");i=u.pop()||"";for(const e of u)if(e.startsWith("event: "));else if(e.startsWith("data: "))try{const n=JSON.parse(e.slice(6));void 0!==n.text?(l+=n.text,t.onToken?.(n.text)):void 0!==n.sources?(s=(n.sources||[]).map(od),t.onSources?.(s)):void 0!==n.sessionId&&(o=n.sessionId)}catch{}}t.onComplete?.({fullText:l,sessionId:o,sources:s})}catch(e){t.onError?.(e)}}async getGeneralDocs(e){const t=new URLSearchParams;e&&t.set("since",e);const n=`${this.baseUrl}/api/external/docs${t.toString()?"?"+t:""}`,r=await fetch(n,{headers:{"X-API-Key":this.apiKey}});if(!r.ok)throw new Error(`HTTP ${r.status}`);return(await r.json()).documents}async getStatus(){const e=await fetch(`${this.baseUrl}/api/external/status`,{headers:{"X-API-Key":this.apiKey}});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async health(){const e=await fetch(`${this.baseUrl}/api/external/health`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}}let ld,sd;const ud=new WeakMap,cd=new WeakMap,dd=new WeakMap,fd=new WeakMap,pd=new WeakMap;let hd={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return cd.get(e);if("objectStoreNames"===t)return e.objectStoreNames||dd.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return yd(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function md(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(sd||(sd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(vd(this),t),yd(ud.get(this))}:function(...t){return yd(e.apply(vd(this),t))}:function(t,...n){const r=e.call(vd(this),t,...n);return dd.set(r,t.sort?t.sort():[t]),yd(r)}}function gd(e){return"function"==typeof e?md(e):(e instanceof IDBTransaction&&function(e){if(cd.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});cd.set(e,t)}(e),t=e,(ld||(ld=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,hd):e);var t}function yd(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{t(yd(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",a),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&ud.set(t,e)}).catch(()=>{}),pd.set(t,e),t}(e);if(fd.has(e))return fd.get(e);const t=gd(e);return t!==e&&(fd.set(e,t),pd.set(t,e)),t}const vd=e=>pd.get(e);function bd(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const i=indexedDB.open(e,t),l=yd(i);return r&&i.addEventListener("upgradeneeded",e=>{r(yd(i.result),e.oldVersion,e.newVersion,yd(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),l.then(e=>{o&&e.addEventListener("close",()=>o()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),l}const wd=["get","getKey","getAll","getAllKeys","count"],kd=["put","add","delete","clear"],Sd=new Map;function xd(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Sd.get(t))return Sd.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=kd.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!a&&!wd.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,a?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),a&&o.done]))[0]};return Sd.set(t,o),o}hd=(e=>({...e,get:(t,n,r)=>xd(t,n)||e.get(t,n,r),has:(t,n)=>!!xd(t,n)||e.has(t,n)}))(hd);class Cd{constructor(e){this.db=null,this.dbPromise=null,this.documentCount=0,this.lastSyncAt=null,this.config=e,"indexeddb"===e.storage&&"undefined"!=typeof indexedDB?this.dbPromise=this.initDB():"localstorage"===e.storage&&this.loadLocalStorageMetadata()}loadLocalStorageMetadata(){try{const e=localStorage.getItem("cybernetic-cache-meta");if(e){const t=JSON.parse(e);this.documentCount=t.documentCount||0,this.lastSyncAt=t.lastSyncAt||null}}catch{}}async initDB(){return this.db=await bd("cybernetic-cache",1,{upgrade(e){if(!e.objectStoreNames.contains("documents")){e.createObjectStore("documents",{keyPath:"id"}).createIndex("by-updated","updatedAt")}e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata",{keyPath:"key"})}}),await this.loadMetadata(),this.db}async getDB(){if(this.db)return this.db;if(this.dbPromise)return this.dbPromise;throw new Error("Database not available")}async loadMetadata(){if(!this.db)return;const e=await this.db.get("metadata","documentCount");this.documentCount=e?.value||0;const t=await this.db.get("metadata","lastSyncAt");this.lastSyncAt=t?.value||null}async store(e){if("localstorage"===this.config.storage)return this.storeLocalStorage(e);const t=(await this.getDB()).transaction(["documents","metadata"],"readwrite");for(const n of e)await t.objectStore("documents").put(n);this.documentCount=await t.objectStore("documents").count(),this.lastSyncAt=(new Date).toISOString(),await t.objectStore("metadata").put({key:"documentCount",value:this.documentCount}),await t.objectStore("metadata").put({key:"lastSyncAt",value:this.lastSyncAt}),await t.done}async retrieve(){if("localstorage"===this.config.storage)return this.retrieveLocalStorage();return(await this.getDB()).getAll("documents")}async getLastSync(){return this.lastSyncAt}getStatus(){const e=Date.now()-(this.lastSyncAt?new Date(this.lastSyncAt).getTime():0)>this.config.maxAge;return{documentCount:this.documentCount,lastSyncAt:this.lastSyncAt,cacheSize:5e3*this.documentCount,isStale:e}}async clear(){if("localstorage"===this.config.storage)return localStorage.removeItem("cybernetic-cache-docs"),localStorage.removeItem("cybernetic-cache-meta"),this.documentCount=0,void(this.lastSyncAt=null);const e=(await this.getDB()).transaction(["documents","metadata"],"readwrite");await e.objectStore("documents").clear(),await e.objectStore("metadata").clear(),await e.done,this.documentCount=0,this.lastSyncAt=null}storeLocalStorage(e){try{localStorage.setItem("cybernetic-cache-docs",JSON.stringify(e)),this.documentCount=e.length,this.lastSyncAt=(new Date).toISOString(),localStorage.setItem("cybernetic-cache-meta",JSON.stringify({documentCount:this.documentCount,lastSyncAt:this.lastSyncAt}))}catch{localStorage.removeItem("cybernetic-cache-docs");const t=e.slice(0,50);localStorage.setItem("cybernetic-cache-docs",JSON.stringify(t)),this.documentCount=t.length}}retrieveLocalStorage(){try{const e=localStorage.getItem("cybernetic-cache-docs");return e?JSON.parse(e):[]}catch{return[]}}}class _d{constructor(){this.documents=[],this.idf=new Map,this.indexed=!1,this.loadedFromExport=!1,this.vocabulary=new Map}isIndexed(){return this.indexed&&this.documents.length>0}async index(e){this.documents=[],this.idf=new Map;const t=new Map;for(const n of e){const e=this.tokenize(n.content),r=new Set(e);for(const e of r)t.set(e,(t.get(e)||0)+1);this.documents.push({id:n.id,title:n.title,content:n.content,tokens:e,tfidf:new Map})}const n=e.length;for(const[e,r]of t)this.idf.set(e,Math.log((n+1)/(r+1))+1);for(const e of this.documents){const t=this.computeTermFrequency(e.tokens);for(const[n,r]of t){const t=this.idf.get(n)||1;e.tfidf.set(n,r*t)}}this.indexed=!0}async ask(e){if(!this.indexed||0===this.documents.length)return{answer:"I don't have any information available offline.",sources:[],topScore:0};const t=this.tokenize(e),n=this.computeTermFrequency(t),r=new Map;for(const[e,t]of n){const n=this.idf.get(e)||1;r.set(e,t*n)}const a=this.documents.map(e=>({doc:e,score:this.cosineSimilarity(r,e.tfidf)}));a.sort((e,t)=>t.score-e.score);const o=a.slice(0,3).filter(e=>e.score>.1);if(0===o.length)return{answer:"I couldn't find relevant information for your question in my offline data.",sources:[],topScore:a[0]?.score||0};const i=o[0].doc;return{answer:this.extractRelevantSnippet(i.content,t),sources:o.map(e=>({title:e.doc.title,snippet:e.doc.content.substring(0,200)+"...",score:e.score})),topScore:o[0].score}}reset(){this.documents=[],this.idf=new Map,this.vocabulary=new Map,this.indexed=!1,this.loadedFromExport=!1,this.exportVersion=void 0,this.exportedAt=void 0}async loadFromExport(e){this.reset(),this.idf=new Map(Object.entries(e.tfidfIndex.idf));let t=0;for(const e of this.idf.keys())this.vocabulary.set(e,t++);for(const t of e.documents){const e=new Map;for(const[n,r]of t.tfidfVector)for(const[t,a]of this.vocabulary)if(a===n){e.set(t,r);break}this.documents.push({id:t.id,title:t.title,content:t.content,tokens:[],tfidf:e})}this.indexed=!0,this.loadedFromExport=!0,this.exportVersion=e.version,this.exportedAt=e.meta.exportedAt,console.log(`[CyberneticLocalRAG] Loaded ${this.documents.length} documents from export (v${e.version})`)}getExportStatus(){return{loaded:this.indexed,loadedFromExport:this.loadedFromExport,documentCount:this.documents.length,chunkCount:this.documents.length,exportVersion:this.exportVersion,exportedAt:this.exportedAt}}tokenize(e){return e.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(e=>e.length>2&&!this.isStopWord(e))}computeTermFrequency(e){const t=new Map;for(const n of e)t.set(n,(t.get(n)||0)+1);const n=Math.max(...t.values());if(n>0)for(const[e,r]of t)t.set(e,r/n);return t}cosineSimilarity(e,t){let n=0,r=0,a=0;for(const[a,o]of e){n+=o*(t.get(a)||0),r+=o*o}for(const e of t.values())a+=e*e;return 0===r||0===a?0:n/(Math.sqrt(r)*Math.sqrt(a))}extractRelevantSnippet(e,t){const n=e.split(/[.!?]+/).filter(e=>e.trim().length>0).map(e=>{const n=new Set(this.tokenize(e));let r=0;for(const e of t)n.has(e)&&r++;return{sentence:e.trim(),score:r}});n.sort((e,t)=>t.score-e.score);const r=n.slice(0,3).filter(e=>e.score>0);return 0===r.length?e.substring(0,300)+"...":r.map(e=>e.sentence).join(". ")+"."}isStopWord(e){return new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","up","about","into","through","during","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","this","that","these","those","it","its","they","them","their","what","which","who","whom","when","where","why","how","all","each","every","both","few","more","most","other","some","such","no","not","only","same","so","than","too","very"]).has(e)}}class Ed{constructor(){this.db=null,this.dbPromise=null,this.dbName="cybernetic-offline-vectors",this.dbVersion=1}async initDB(){return this.db?this.db:this.dbPromise?this.dbPromise:(this.dbPromise=bd(this.dbName,this.dbVersion,{upgrade(e){e.objectStoreNames.contains("vectors")||e.createObjectStore("vectors",{keyPath:"id"})}}),this.db=await this.dbPromise,this.db)}async store(e,t){const n=await this.getDB();await n.put("vectors",{id:e,exportVersion:t.version,exportedAt:t.meta.exportedAt,type:t.type,data:t}),console.log(`[CyberneticOfflineStorage] Stored ${t.meta.chunkCount} chunks`)}async retrieve(e){const t=await this.getDB(),n=await t.get("vectors",e);return n?.data??null}async isValid(e,t){const n=await this.getDB(),r=await n.get("vectors",e);if(!r)return!1;const a=new Date(r.exportedAt).getTime();return Date.now()-a<t}async getMeta(e){const t=await this.getDB(),n=await t.get("vectors",e);return n?{version:n.exportVersion,exportedAt:n.exportedAt,documentCount:n.data.meta.documentCount,chunkCount:n.data.meta.chunkCount,type:n.type}:null}async hasData(){const e=await this.getDB();return await e.count("vectors")>0}async getStoredIds(){return(await this.getDB()).getAllKeys("vectors")}async delete(e){const t=await this.getDB();await t.delete("vectors",e)}async clear(){const e=await this.getDB();await e.clear("vectors"),console.log("[CyberneticOfflineStorage] Cache cleared")}async getDB(){return this.db?this.db:this.initDB()}close(){this.db&&(this.db.close(),this.db=null,this.dbPromise=null)}}function Md(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");const n=t.length%4;n&&(t+="=".repeat(4-n));const r=atob(t),a=new Uint8Array(r.length);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return a}function Nd(e){const t=Md(e);return(new TextDecoder).decode(t)}async function Pd(e,t,n){try{const r=await async function(e){const t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return crypto.subtle.importKey("spki",r.buffer,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}(n),a=(new TextEncoder).encode(e),o=new Uint8Array(t).buffer;return await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,o,a)}catch(e){return console.warn("[License] Signature verification failed:",e),!1}}async function Rd(e,t){if(!e||""===e.trim())return{status:"missing",payload:null,error:"No license key provided",inGracePeriod:!1,daysRemaining:null};const n=function(e){try{const t=e.split(".");if(3!==t.length)return null;const[n,r,a]=t;return{header:JSON.parse(Nd(n)),payload:JSON.parse(Nd(r)),signature:Md(a),signedContent:`${n}.${r}`}}catch{return null}}(e);if(!n)return{status:"invalid",payload:null,error:"Invalid license key format",inGracePeriod:!1,daysRemaining:null};const r=function(e){return"string"!=typeof e.iss||"string"!=typeof e.sub||"string"!=typeof e.aud||"number"!=typeof e.iat||"number"!=typeof e.exp||"string"!=typeof e.plan||"number"!=typeof e.seats?null:Array.isArray(e.features)?"number"!=typeof e.licenseVersion?null:{iss:e.iss,sub:e.sub,aud:e.aud,iat:e.iat,exp:e.exp,plan:e.plan,org:"string"==typeof e.org?e.org:void 0,seats:e.seats,features:e.features,graceUntil:"number"==typeof e.graceUntil?e.graceUntil:void 0,licenseVersion:e.licenseVersion}:null}(n.payload);if(!r)return{status:"invalid",payload:null,error:"Invalid license payload structure",inGracePeriod:!1,daysRemaining:null};if("astermind"!==r.iss)return{status:"invalid",payload:null,error:"Invalid license issuer",inGracePeriod:!1,daysRemaining:null};if("cybernetic-chatbot"!==r.aud&&"*"!==r.aud)return{status:"invalid",payload:null,error:"License not valid for this product",inGracePeriod:!1,daysRemaining:null};if("undefined"!=typeof crypto&&crypto.subtle){const e=t||"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhLW7MXHQ0Fuk1OKt9D5CbRw7fUMN\nLJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==\n-----END PUBLIC KEY-----";if(!await Pd(n.signedContent,n.signature,e))return{status:"invalid",payload:null,error:"License signature verification failed",inGracePeriod:!1,daysRemaining:null}}const a=Math.floor(Date.now()/1e3),o=function(e){const t=e-Math.floor(Date.now()/1e3);return Math.floor(t/86400)}(r.exp);return r.exp<a?r.graceUntil&&r.graceUntil>a?{status:"valid",payload:r,inGracePeriod:!0,daysRemaining:o}:{status:"expired",payload:r,error:"License has expired",inGracePeriod:!1,daysRemaining:o}:"eval"===r.plan?{status:"eval",payload:r,inGracePeriod:!1,daysRemaining:o}:{status:"valid",payload:r,inGracePeriod:!1,daysRemaining:o}}const Ld="cybernetic-chatbot-client",Ad="agentic";class Td{constructor(e={}){this.state=null,this.verificationPromise=null,this.hasLoggedWarning=!1,this.loggedMissingFeatures=new Set,this.config=e,this.environment=e.environment||function(){if("undefined"==typeof window)return"production"===process?.env?.NODE_ENV?"production":"development";const e=window.location?.hostname||"",t=["localhost","127.0.0.1","0.0.0.0",".local",".dev",".test",":3000",":5173",":8080",":4200"];for(const n of t)if(e.includes(n)||window.location?.port===n.replace(":",""))return"development";if("file:"===window.location?.protocol)return"development";const n=["staging.","preview.","-preview.",".vercel.app",".netlify.app",".pages.dev"];for(const t of n)if(e.includes(t))return"production";return"production"}(),this.enforcementMode="development"===this.environment?"soft":"hard"}async verify(){if(this.state)return this.state;if(this.verificationPromise)return this.verificationPromise;this.verificationPromise=Rd(this.config.licenseKey,this.config.publicKey);try{return this.state=await this.verificationPromise,this.config.onStatusChange?.(this.state),this.logLicenseStatus(),this.state}finally{this.verificationPromise=null}}getState(){return this.state}isValid(){return!!this.state&&("valid"===this.state.status||"eval"===this.state.status)}requiresAction(){return!this.state||("expired"===this.state.status||"missing"===this.state.status||"invalid"===this.state.status)}getEnvironment(){return this.environment}getEnforcementMode(){return this.enforcementMode}processResponse(e){return this.state?this.isValid()&&!this.state.inGracePeriod?e:"soft"===this.enforcementMode?(this.hasLoggedWarning||(this.logDevelopmentWarning(),this.hasLoggedWarning=!0),e):e+"\n\n---\n⚠️ License Notice: Your AsterMind license key needs to be updated. Please contact support@astermind.ai or visit https://astermind.ai/license to renew your license.":e}getStatusMessage(){if(!this.state)return"License not verified";switch(this.state.status){case"valid":return this.state.inGracePeriod?`License expired but in grace period (${Math.abs(this.state.daysRemaining||0)} days overdue)`:`License valid (${this.state.daysRemaining} days remaining)`;case"eval":return`Evaluation license (${this.state.daysRemaining} days remaining)`;case"expired":return`License expired ${Math.abs(this.state.daysRemaining||0)} days ago`;case"missing":return"No license key provided";case"invalid":return`Invalid license: ${this.state.error}`;default:return"Unknown license status"}}async reVerify(){return this.state=null,this.hasLoggedWarning=!1,this.loggedMissingFeatures.clear(),this.verify()}hasFeature(e){return!!this.state?.payload&&this.state.payload.features.includes(e)}getFeatures(){return this.state?.payload?.features||[]}checkClientFeature(){return this.checkFeatureWithLog(Ld,"CyberneticClient")}checkAgenticFeature(){return this.checkFeatureWithLog(Ad,"Agentic capabilities")}checkFeatureWithLog(e,t){if(!this.state?.payload)return!0;const n=this.state.payload.features.includes(e);return n||this.loggedMissingFeatures.has(e)||(this.loggedMissingFeatures.add(e),this.logMissingFeature(e,t)),n}logMissingFeature(e,t){const n=this.getFeatures(),r=this.state?.payload?.plan||"unknown";console.warn(`[Cybernetic License] ${t} requires the '${e}' feature, which is not included in your license.`),console.info(`[Cybernetic License] Current license plan: ${r}`),console.info(`[Cybernetic License] Licensed features: ${n.length>0?n.join(", "):"(none)"}`),console.info("[Cybernetic License] To add this feature, upgrade your license at https://astermind.ai/license")}logLicenseStatus(){if(!this.state)return;const e="[Cybernetic License]";switch(this.state.status){case"valid":this.state.inGracePeriod?console.warn(`${e} License expired but in grace period. Please renew at https://astermind.ai/license`):null!==this.state.daysRemaining&&this.state.daysRemaining<=30&&console.info(`${e} License expires in ${this.state.daysRemaining} days`);break;case"eval":console.info(`${e} Evaluation license - ${this.state.daysRemaining} days remaining`);break;case"expired":console.error(`${e} License expired. Enforcement mode: ${this.enforcementMode}. Renew at https://astermind.ai/license`);break;case"missing":console.warn(`${e} No license key provided. Enforcement mode: ${this.enforcementMode}. Get a license at https://astermind.ai/license`);break;case"invalid":console.error(`${e} Invalid license: ${this.state.error}. Enforcement mode: ${this.enforcementMode}`)}}logDevelopmentWarning(){console.warn(`[Cybernetic License] Running in development mode with ${this.state?.status||"unknown"} license. In production, a warning will be appended to chatbot responses. Get a license at https://astermind.ai/license`)}}class zd{constructor(e){this.status="connecting",this.lastError=null,this.systemSettings=null,this.settingsLastChecked=0,this.SETTINGS_CHECK_INTERVAL=3e5,this.agenticCapabilities=null,this.offlineStorage=null,this.omegaRAG=null,this.offlineWarningShown=!1,this.config={apiUrl:e.apiUrl,apiKey:e.apiKey,fallback:{enabled:e.fallback?.enabled??!0,cacheMaxAge:e.fallback?.cacheMaxAge??864e5,cacheOnConnect:e.fallback?.cacheOnConnect??!0,cacheStorage:e.fallback?.cacheStorage??"indexeddb"},retry:{maxRetries:e.retry?.maxRetries??2,initialDelay:e.retry?.initialDelay??1e3,exponentialBackoff:e.retry?.exponentialBackoff??!0},agentic:e.agentic??null,offline:e.offline??null,sitemap:e.sitemap??null,sources:{enabled:e.sources?.enabled??!0,showSummary:e.sources?.showSummary??!0,showDownload:e.sources?.showDownload??!0,includeFullContent:e.sources?.includeFullContent??!1,maxSources:e.sources?.maxSources??5},onStatusChange:e.onStatusChange||(()=>{}),onError:e.onError||(()=>{})},this.apiClient=new id(this.config.apiUrl,this.config.apiKey),this.cache=new Cd({storage:this.config.fallback.cacheStorage,maxAge:this.config.fallback.cacheMaxAge}),this.localRAG=new _d,this.licenseManager=new Td({licenseKey:e.licenseKey}),this.licenseManager.verify().then(()=>{this.licenseManager.checkClientFeature()}).catch(()=>{}),this.monitorConnection(),this.config.fallback.enabled&&this.config.fallback.cacheOnConnect&&this.syncCache().catch(()=>{}),this.config.offline?.enabled&&this.initializeOffline(this.config.offline).catch(e=>{console.warn("[Cybernetic] Failed to initialize offline vectors:",e)})}registerAgentic(e){this.agenticCapabilities=e,console.log("[Cybernetic] Agentic capabilities registered")}isAgenticEnabled(){return null!==this.agenticCapabilities&&!0===this.config.agentic?.enabled&&(this.licenseManager.checkAgenticFeature(),!0)}getAgenticCapabilities(){return this.agenticCapabilities}getAgenticConfig(){return this.config.agentic}getSourcesConfig(){return{...this.config.sources}}isSourceFeatureAvailable(e){return!!this.config.sources.enabled&&("summary"===e?this.config.sources.showSummary:"download"===e&&(this.config.sources.showDownload&&"online"===this.status))}classifyIntent(e){if(!this.isAgenticEnabled()||!this.agenticCapabilities)return null;const t=this.config.agentic;return new(0,this.agenticCapabilities.agent)(t).interpretIntent(e)}async executeAction(e){if(!this.isAgenticEnabled()||!this.agenticCapabilities)return{success:!1,message:"Agentic capabilities not enabled"};const t=this.config.agentic;return new(0,this.agenticCapabilities.agent)(t).executeAction(e)}async smartAsk(e,t){const n=this.classifyIntent(e);if(n&&n.action&&!n.shouldEscalate){if(!1!==this.config.agentic?.requireConfirmation)return{action:n.action};const e=await this.executeAction(n.action);return{action:n.action,actionResult:e}}return{response:await this.ask(e,t)}}async initializeOffline(e){const t=e.storageMode??"hybrid",n=e.cacheMaxAge??6048e5;if("memory"!==t&&(this.offlineStorage=new Ed),this.offlineStorage&&"memory"!==t){const e="default";if(await this.offlineStorage.isValid(e,n)){console.log("[Cybernetic] Loading vectors from IndexedDB cache");const t=await this.offlineStorage.retrieve(e);if(t)return await this.localRAG.loadFromExport(t),void console.log("[Cybernetic] Loaded vectors from IndexedDB cache")}}if(e.vectorFileUrl)try{const n=await fetch(e.vectorFileUrl);if(!n.ok)throw new Error(`Failed to fetch vectors: ${n.status}`);const r=await n.json();return this.offlineStorage&&"memory"!==t&&await this.offlineStorage.store("default",r),await this.localRAG.loadFromExport(r),e.omega?.enabled&&await this.initializeOmega(e),void console.log("[Cybernetic] Loaded vectors from URL:",e.vectorFileUrl)}catch(e){console.error("[Cybernetic] Failed to load offline vectors from URL:",e)}if(e.vectorData)return await this.localRAG.loadFromExport(e.vectorData),e.omega?.enabled&&await this.initializeOmega(e),void console.log("[Cybernetic] Loaded inline vector data");this.offlineWarningShown||(console.warn("[Cybernetic] Offline functionality is enabled but no vectors are loaded. Offline responses will be limited. To enable full offline functionality, export vectors from the AsterMind admin panel and configure the vectorFileUrl or vectorData option."),this.offlineWarningShown=!0)}async initializeOmega(e){if(e.omega?.enabled)try{const{OmegaOfflineRAG:t}=await Promise.resolve().then(function(){return ff});this.omegaRAG=new t({reranking:e.omega.reranking,topK:5,verbose:!1}),e.omega.modelUrl?await this.omegaRAG.loadModelFromUrl(e.omega.modelUrl):e.omega.modelData&&await this.omegaRAG.loadModel(e.omega.modelData),console.log("[Cybernetic] Omega RAG initialized")}catch(e){console.warn("[Cybernetic] Failed to initialize Omega RAG:",e),this.omegaRAG=null}}async reloadOfflineVectors(){this.config.offline?.enabled?(this.localRAG.reset(),this.offlineStorage&&await this.offlineStorage.clear(),this.omegaRAG&&this.omegaRAG.clear(),await this.initializeOffline(this.config.offline)):console.warn("[Cybernetic] Offline mode is not enabled")}isOmegaOfflineEnabled(){return this.omegaRAG?.isReady()??!1}getOfflineModelInfo(){return this.omegaRAG?.getModelInfo()??null}getLocalRAGStatus(){return this.localRAG.getExportStatus()}getOfflineStorage(){return this.offlineStorage}async ask(e,t){if(!e||"string"!=typeof e)return this.createErrorResponse("Message is required","none");const n=await this.checkSystemStatus();if(n.maintenanceMode||n.forceOfflineClients)return console.log("[Cybernetic] Maintenance mode active, using cached data"),this.isCacheValid()?await this.fallbackAsk(e):{reply:n.maintenanceMessage||"The service is currently under maintenance. Please try again later.",confidence:"none",sources:[],offline:!0,degradedReason:"Maintenance mode active, no valid cache available"};try{const n=await this.apiWithRetry(e,t);this.setStatus("online");return{reply:this.licenseManager.processResponse(n.reply),confidence:"high",sources:n.sources||[],offline:!1,sessionId:n.sessionId}}catch(n){const r=this.normalizeError(n);return this.lastError=r,this.config.onError(r),"RATE_LIMIT"===r.code?{reply:"I'm receiving too many requests right now. Please try again in a moment.",confidence:"none",sources:[],offline:!1,retryAfter:r.retryAfter}:this.config.fallback.enabled&&!t?.skipFallback?await this.fallbackAsk(e):this.createErrorResponse("Unable to connect to the chatbot service. Please try again later.","none",r.retryAfter)}}async askStream(e,t,n){if(!e||"string"!=typeof e)return void t.onError?.({code:"LOCAL_RAG_ERROR",message:"Message is required"});const r=await this.checkSystemStatus();if(r.maintenanceMode||r.forceOfflineClients){console.log("[Cybernetic] Maintenance mode active, falling back to offline");const n=await this.fallbackAsk(e);return void t.onComplete?.(n)}try{await this.apiClient.chatStream(e,{sessionId:n?.sessionId,context:n?.context,onToken:t.onToken,onSources:t.onSources,onComplete:e=>{this.setStatus("online");const n=this.licenseManager.processResponse(e.fullText);t.onComplete?.({reply:n,confidence:"high",sources:e.sources||[],offline:!1,sessionId:e.sessionId})},onError:e=>{const n=this.normalizeError(e);this.config.onError(n),t.onError?.(n)}})}catch(r){const a=this.normalizeError(r);if(this.lastError=a,this.config.onError(a),this.config.fallback.enabled&&!n?.skipFallback){const n=await this.fallbackAsk(e);t.onComplete?.(n)}else t.onError?.(a)}}async syncCache(){try{const e=await this.cache.getLastSync(),t=await this.apiClient.getGeneralDocs(e);t.length>0&&(await this.cache.store(t),await this.localRAG.index(t),console.log(`[Cybernetic] Cache synced: ${t.length} documents`)),this.setStatus("online")}catch(e){console.warn("[Cybernetic] Cache sync failed:",e)}}getStatus(){return{connection:this.status,cache:this.cache.getStatus(),lastError:this.lastError,systemSettings:this.systemSettings,license:this.licenseManager.getState()}}getLicenseManager(){return this.licenseManager}async clearCache(){await this.cache.clear(),this.localRAG.reset()}async checkConnection(){try{return await this.apiClient.getStatus(),this.setStatus("online"),!0}catch{return this.setStatus("offline"),!1}}async checkSystemStatus(){if(this.systemSettings&&Date.now()-this.settingsLastChecked<this.SETTINGS_CHECK_INTERVAL)return this.systemSettings;try{const e=await this.apiClient.getStatus();return this.systemSettings={cacheRetentionHours:e.systemSettings?.cacheRetentionHours??168,maintenanceMode:e.systemSettings?.maintenanceMode??!1,maintenanceMessage:e.systemSettings?.maintenanceMessage,forceOfflineClients:e.systemSettings?.forceOfflineClients??!1},this.settingsLastChecked=Date.now(),this.systemSettings}catch{return this.systemSettings||{cacheRetentionHours:168,maintenanceMode:!1,forceOfflineClients:!1}}}isMaintenanceMode(){return this.systemSettings?.maintenanceMode??!1}getMaintenanceMessage(){return this.systemSettings?.maintenanceMessage}isCacheValid(){const e=this.cache.getStatus();if(!e.lastSyncAt)return!1;const t=60*(this.systemSettings?.cacheRetentionHours||168)*60*1e3,n=new Date(e.lastSyncAt).getTime();return Date.now()-n<t}async apiWithRetry(e,t){const{maxRetries:n,initialDelay:r,exponentialBackoff:a}=this.config.retry;let o=null;for(let i=0;i<=n;i++)try{return await this.apiClient.chat(e,{sessionId:t?.sessionId,context:t?.context})}catch(e){o=e;const t=this.normalizeError(e);if("AUTH_ERROR"===t.code||"RATE_LIMIT"===t.code)throw e;if(i<n){const e=a?r*Math.pow(2,i):r;await this.sleep(e)}}throw o}async fallbackAsk(e){if(this.setStatus("offline"),this.omegaRAG?.isReady())try{const t=await this.omegaRAG.ask(e);if(!t.degraded){return{reply:this.licenseManager.processResponse(t.answer),confidence:t.confidence,sources:t.sources.map(e=>({title:e.heading,snippet:e.content.substring(0,200)+"...",relevance:e.score})),offline:!0,degradedReason:"Omega hybrid retrieval (offline)"}}}catch(e){console.warn("[Cybernetic] Omega RAG failed, falling back to TF-IDF:",e)}const t=this.localRAG.getExportStatus();if(t.loaded&&t.documentCount>0)try{const n=await this.localRAG.ask(e);let r="medium";n.topScore<.3?r="low":n.topScore>.7&&(r="medium");return{reply:this.licenseManager.processResponse(n.answer),confidence:r,sources:n.sources.map(e=>({title:e.title,snippet:e.snippet,relevance:e.score})),offline:!0,degradedReason:t.loadedFromExport?"Using pre-exported vectors (offline)":"Processed locally with TF-IDF"}}catch(e){console.error("[Cybernetic] Local RAG error:",e)}const n=this.cache.getStatus();if(0===n.documentCount&&!t.loaded)return{reply:"I'm currently offline and don't have any cached information. Please check your connection and try again.",confidence:"none",sources:[],offline:!0,degradedReason:"No cached documents or offline vectors available"};try{const t=await this.cache.retrieve();this.localRAG.isIndexed()||await this.localRAG.index(t);const r=await this.localRAG.ask(e);let a="medium";r.topScore<.3?a="low":r.topScore>.7&&(a="medium");return{reply:this.licenseManager.processResponse(r.answer),confidence:a,sources:r.sources.map(e=>({title:e.title,snippet:e.snippet,relevance:e.score})),offline:!0,degradedReason:n.isStale?"Using stale cached data":"Processed locally without server"}}catch(e){return console.error("[Cybernetic] Local RAG error:",e),{reply:"I'm having trouble processing your request offline. Please try again when you're back online.",confidence:"none",sources:[],offline:!0,degradedReason:"Local RAG processing failed"}}}monitorConnection(){"undefined"!=typeof window&&(window.addEventListener("online",()=>{this.syncCache().catch(()=>{})}),window.addEventListener("offline",()=>{this.setStatus("offline")}),navigator.onLine||this.setStatus("offline"))}setStatus(e){this.status!==e&&(this.status=e,this.config.onStatusChange(e))}normalizeError(e){if(e instanceof Error){if(e.message.includes("401")||e.message.includes("Unauthorized"))return{code:"AUTH_ERROR",message:"Invalid or expired API key",originalError:e};if(e.message.includes("429")||e.message.includes("Rate limit")){const t=e.message.match(/retry after (\d+)/i);return{code:"RATE_LIMIT",message:"Rate limit exceeded",retryAfter:t?parseInt(t[1],10):60,originalError:e}}return e.message.includes("5")||e.message.includes("Server")?{code:"SERVER_ERROR",message:"Server error occurred",originalError:e}:{code:"NETWORK_ERROR",message:e.message||"Network error",originalError:e}}return{code:"NETWORK_ERROR",message:"Unknown error occurred"}}createErrorResponse(e,t,n){return{reply:e,confidence:t,sources:[],offline:!1,retryAfter:n}}sleep(e){return new Promise(t=>setTimeout(t,e))}}const Dd={hiddenUnits:50,activation:"relu",ridgeLambda:.01,weightInit:"xavier",seed:1337,dropout:0,log:{verbose:!0,toFile:!1,modelName:"Unnamed ELM Model",level:"info"}};function Id(e){let t=0,n=0;for(;0===t;)t=e();for(;0===n;)n=e();return Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*n)}Object.assign(Object.assign({},Dd),{useTokenizer:!1}),Object.assign(Object.assign({},Dd),{useTokenizer:!0,maxLen:30,charSet:"abcdefghijklmnopqrstuvwxyz",tokenizerDelimiter:/\s+/});class Od{constructor(e,t,n=1e-4){this.p=e,this.m=t,this.lambda=n,this.Ainv=new Float64Array(e*e),this.Beta=new Float64Array(e*t);const r=1/Math.max(1e-12,n);for(let t=0;t<e;t++)this.Ainv[t*e+t]=r}update(e,t){const{p:n,m:r,Ainv:a,Beta:o}=this,i=new Float64Array(n);for(let t=0;t<n;t++){let r=0,o=t*n;for(let t=0;t<n;t++)r+=a[o+t]*e[t];i[t]=r}let l=1;for(let t=0;t<n;t++)l+=e[t]*i[t];l=Math.max(l,1e-12);const s=1/l;for(let e=0;e<n;e++){const t=i[e]*s;for(let r=0;r<n;r++)a[e*n+r]-=t*i[r]}for(let t=0;t<n;t++){let r=0,o=t*n;for(let t=0;t<n;t++)r+=a[o+t]*e[t];i[t]=r}for(let e=0;e<n;e++){const n=i[e];for(let a=0;a<r;a++)o[e*r+a]+=n*t[a]}}predict(e){const{p:t,m:n,Beta:r}=this,a=new Float64Array(n);for(let o=0;o<n;o++){let i=0;for(let a=0;a<t;a++)i+=e[a]*r[a*n+o];a[o]=i}return a}}function Fd(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(Math.max(0,t))}function jd(e,t){var n,r;const a=Math.min(e.length,t.length);if(0===a)return 0;let o=0,i=0,l=0;for(let s=0;s<a;s++){const a=null!==(n=e[s])&&void 0!==n?n:0,u=null!==(r=t[s])&&void 0!==r?r:0;o+=a*u,i+=a*a,l+=u*u}const s=o/Math.sqrt(Math.max(i*l,1e-12));return Number.isFinite(s)?s:0}function Ud(e,t,n,r){return new(n||(n=Promise))(function(a,o){function i(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,l)}s((r=r.apply(e,t||[])).next())})}function $d(e){return e.replace(/\s+/g," ").split(/(?<=[.?!])\s+/).map(e=>e.trim()).filter(e=>e.length>8&&/\w/.test(e))}function Bd(e){return e.replace(/```[\s\S]*?```/g," ").replace(/`[^`]+`/g," ").replace(/\[[^\]]*\]\([^)]*\)/g,"").replace(/[-–>•→]/g," ").replace(/\s+/g," ").trim()}function Vd(e,t){return Ud(this,arguments,void 0,function*(e,t,n={}){if(!(null==t?void 0:t.length))return"No results found.";const{dim:r=64,features:a=32,sigma:o=1,rounds:i=3,topSentences:l=8,personality:s="neutral"}=n;let u=$d(t.map(e=>Bd(e.content)).join(" ")).filter(e=>!function(e){return/^(\*|#)/.test(e)||/chapter/i.test(e)||/part\s*\d+/i.test(e)||/section/i.test(e)||/^\s*[A-Z]\)\s*$/.test(e)||e.length<15}(e)).slice(0,120);if(0===u.length)return Bd(t[0].content).slice(0,400);const c=function(e,t,n=1,r=Math.random){const a=new Float64Array(t*e),o=new Float64Array(t),i=1/Math.max(1e-12,n);for(let n=0;n<t*e;n++)a[n]=Id(r)*i;for(let e=0;e<t;e++)o[e]=2*r()*Math.PI;return{W:a,b:o,D:t,d:e,sigma:n}}(r,a,o),d=new Od(2*a,1,.001),f=e=>{const t=new Float64Array(r),n=Math.min(e.length,r);for(let r=0;r<n;r++)t[r]=e.charCodeAt(r)/255;return function(e,t){const{W:n,b:r,D:a,d:o}=e,i=new Float64Array(2*a);for(let e=0;e<a;e++){let l=r[e];const s=e*o;for(let e=0;e<o;e++)l+=n[s+e]*(t[e]||0);i[e]=Math.cos(l),i[a+e]=Math.sin(l)}let l=0;for(let e=0;e<i.length;e++)l+=i[e]*i[e];const s=1/Math.sqrt(Math.max(l,1e-12));for(let e=0;e<i.length;e++)i[e]*=s;return i}(c,function(e,t=1e-12){const n=Fd(e);if(!(n>t&&Number.isFinite(n)))return new Float64Array(e.length);const r=new Float64Array(e.length),a=1/n;for(let t=0;t<e.length;t++)r[t]=e[t]*a;return r}(t))},p=f(e),h=e.toLowerCase().split(/\W+/).filter(e=>e.length>2),m=u.map(e=>{const t=f(e);let n=jd(t,p);const r=e.toLowerCase();for(const e of h)r.includes(e)&&(n+=.02);return{s:e,v:t,w:n}});m.sort((e,t)=>t.w-e.w);let g=m.slice(0,l).map(e=>e.s).join(" "),y=new Float64Array(2*a);for(let e=0;e<i;e++){const e=$d(g).slice(0,l),t=e.map(e=>f(e)),n=t.map(e=>jd(e,p));for(let e=0;e<t.length;e++)d.update(t[e],new Float64Array([n[e]]));y.fill(0);for(let e=0;e<t.length;e++){const r=t[e],a=n[e];for(let e=0;e<r.length;e++)y[e]+=r[e]*a}const r=Fd(y)||1;for(let e=0;e<y.length;e++)y[e]/=r;const a=e.map(e=>({s:e,w:jd(f(e),y)}));a.sort((e,t)=>t.w-e.w),g=a.slice(0,Math.max(3,Math.floor(l/2))).map(e=>e.s).join(" ")}g=function(e){return e.replace(/\s+[-–>•→]\s+/g," ").replace(/\s+\.\s+/g,". ").replace(/([a-z]) - ([a-z])/gi,"$1-$2").replace(/\s{2,}/g," ").trim()}(g);return`${"teacher"===s?"Here’s a simple way to think about it:\n\n":"scientist"===s?"From the retrieved material, we can infer:\n\n":""}${g.charAt(0).toUpperCase()+g.slice(1)}\n\n(${t[0].heading||"Answer"}, Ω-synthesized)`})}function Wd(e,t){let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function Hd(e,t,n,r){if("cosine"===n){const n=Wd(e,t),r=Math.hypot(...e),a=Math.hypot(...t);return r&&a?n/(r*a):0}if("poly2"===n){const n=Wd(e,t);return Math.pow(n+1,2)}{let n=0;for(let r=0;r<e.length;r++){const a=e[r]-t[r];n+=a*a}return Math.exp(-n/Math.max(1e-9,2*r*r))}}function Kd(e,t,n,r,a){const o=function(e,t){const n=new Float64Array(t);for(const[t,r]of e)n[t]=r;return n}(e,t),i=new Float64Array(n.length);for(let e=0;e<n.length;e++){const t=n[e];i[e]=Hd(o,t,r,a)}const l=Math.hypot(...i);if(l>0)for(let e=0;e<i.length;e++)i[e]/=l;return i}"function"==typeof SuppressedError&&SuppressedError;const Qd=new Map;function Gd(e){const t=e,n=Qd.get(t);if(n)return n;let r=e.toLowerCase();if(r=r.replace(/^[^a-z0-9]+|[^a-z0-9]+$/g,""),r.length<=2)return Qd.set(t,r),r;r.endsWith("ies")&&r.length>4?r=r.slice(0,-3)+"y":/(xes|ches|shes|zes|sses)$/.test(r)&&r.length>4?r=r.replace(/(xes|ches|shes|zes|sses)$/,e=>"sses"===e?"ss":e.replace(/es$/,"")):r.endsWith("s")&&!/(ss|us)$/.test(r)&&r.length>3&&(r=r.slice(0,-1));const a=[[/ization$|isation$/,"ize"],[/ational$/,"ate"],[/fulness$/,"ful"],[/ousness$/,"ous"],[/iveness$/,"ive"],[/ability$/,"able"],[/ness$/,""],[/ment$/,""],[/ations?$/,"ate"],[/izer$|iser$/,"ize"],[/ally$/,"al"],[/ically$/,"ic"],[/ingly$|edly$/,""],[/ing$|ed$/,""]];for(const[e,t]of a)if(e.test(r)&&r.length-t.length>=4){r=r.replace(e,t);break}return Qd.set(t,r),r}function qd(e,t){const n=Array.from(e,(e,t)=>t);return n.sort((t,n)=>e[n]-e[t]),n.slice(0,t)}function Yd(e){const{query:t,chunks:n,vocabMap:r,idf:a,tfidfDocs:o,denseDocs:i,landmarksIdx:l,landmarkMat:s,vocabSize:u,kernel:c,sigma:d,alpha:f,beta:p,ridge:h,headingW:m,useStem:g,expandQuery:y,topK:v,prefilter:b}=e,w=y?function(e){const t=[];return/\bmap\b/.test(e)&&t.push("dict key value make"),/\bchan|channel\b/.test(e)&&t.push("goroutine concurrency select buffer"),/\berror\b/.test(e)&&t.push("fmt wrap unwrap sentinel try catch"),/\bstruct\b/.test(e)&&t.push("field method receiver init zero value"),e+" "+t.join(" ")}(t):t,k=function(e,t){const n=e.toLowerCase().replace(/[`*_>~]/g," ").replace(/[^a-z0-9]+/g," ").split(/\s+/).filter(Boolean);if(!t)return n;const r=[];for(const e of n){const t=Gd(e);t&&t.length>1&&r.push(t)}return r}(w,g),S=function(e,t,n,r=1){const a=new Map;for(let t=0;t<e.length;t++){const o=e[t],i=n.get(o);if(void 0===i)continue;const l=t<8?r:1;a.set(i,(a.get(i)||0)+l)}const o=Math.max(1,...a.values()),i=new Map;for(const[e,n]of a){const r=.5+n/o*.5;i.set(e,r*(t[e]||0))}return i}(k,a,r,m),x=Kd(S,u,s,c,d),C=o.map(e=>function(e,t){let n=0,r=0,a=0;for(const[a,o]of e){r+=o*o;const e=t.get(a);e&&(n+=o*e)}for(const[,e]of t)a+=e*e;return r&&a?n/(Math.sqrt(r)*Math.sqrt(a)):0}(e,S)),_=i.map(e=>function(e,t,n,r){if("cosine"===n){const n=Wd(e,t),r=Math.hypot(...e),a=Math.hypot(...t);return r&&a?n/(r*a):0}if("poly2"===n){const n=Wd(e,t);return Math.pow(n+1,2)}{let n=0;for(let r=0;r<e.length;r++){const a=e[r]-t[r];n+=a*a}return Math.exp(-n/Math.max(1e-9,2*r*r))}}(e,x,c,d)),E=function(e,t){const n=Array.from(new Set(t.toLowerCase().split(/\W+/).filter(e=>e.length>2))),r=/\b(define|declare|syntax|example|function|struct|map|interface)\b/i.test(t);return e.map(e=>{const t=e.rich||e.content||"",a=t.toLowerCase();let o=0;for(const e of n)a.includes(e)&&o++;return r&&/```/.test(t)&&(o+=5),Math.min(1,.03*o)})}(n,t),M=function(e,t,n){return Math.max(t,Math.min(n,e))}(f,0,1),N=null!=h?h:.08,P=_.map((e,t)=>{const n=C[t],r=p*E[t],a=1/(1+N*(e*e+n*n+.5*r*r))*(M*e+(1-M)*n+r);return Math.tanh(a)}),R=Math.max(v,null!=b?b:0),L=qd(P,R),A=qd(L.map(e=>P[e]),v).map(e=>L[e]);return{items:A.map(e=>{const t=n[e],r=t.rich&&t.rich.trim()||t.content&&t.content.trim()||"(see subsections)";return{score:P[e],heading:t.heading,content:r,index:e}}),scores:A.map(e=>P[e]),indices:A,tfidfScores:A.map(e=>C[e]),denseScores:A.map(e=>_[e])}}const Xd=new Set(["a","an","the","and","or","but","if","then","else","for","to","of","in","on","at","by","with","is","are","was","were","be","been","being","as","from","that","this","it","its","you","your","i","we","they","he","she","them","his","her","our","us","do","does","did","done","not","no","yes","can","could","should","would","may","might","into","about","over","under","between"]);function Jd(e){return e.toLowerCase().replace(/[`*_#>~=\[\]{}()!?.:,;'"<>|/\\+-]+/g," ").split(/\s+/).filter(e=>e&&!Xd.has(e))}function Zd(e){const t=new Map,n=[],r=[];let a=0;for(const o of e){const e=Jd(o);r.push(e.length);const i=new Map;for(const n of e){let e=t.get(n);void 0===e&&(e=a++,t.set(n,e)),i.set(e,(i.get(e)||0)+1)}n.push(i)}const o=e.length,i=Array(a).fill(0);for(const e of n)for(const t of e.keys())i[t]+=1;const l=i.map(e=>Math.log((o+1)/(e+1))+1),s=r.reduce((e,t)=>e+t,0)/Math.max(1,o);return{stats:{vocab:t,idf:l,avgLen:s,df:i},tf:n,docLens:r}}function ef(e,t){const n=new Map;let r=0;for(const[a,o]of e){const e=o*(t[a]||0);n.set(a,e),r+=e*e}const a=Math.sqrt(r)||1e-12;for(const[e,t]of n)n.set(e,t/a);return n}function tf(e,t){const[n,r]=e.size<t.size?[e,t]:[t,e];let a=0;for(const[e,t]of n){const n=r.get(e);void 0!==n&&(a+=t*n)}return a}function nf(e,t,n=1337){const r=new Float64Array(t);for(const[n,a]of e){let e=2654435761*n>>>0;for(let n=0;n<t;n++){e^=e<<13,e^=e>>>17,e^=e<<5;const t=(e>>>0)/4294967296*2-1;r[n]+=a*t}}let a=0;for(let e=0;e<t;e++)a+=r[e]*r[e];const o=Math.sqrt(a)||1e-12;for(let e=0;e<t;e++)r[e]/=o;return r}function rf(e){return/```+\s*go([\s\S]*?)```/i.test(e)||/\bfunc\s+\w+\s*\(.*\)\s*\w*\s*{/.test(e)}function af(e){return/```+/.test(e)||/{[^}]*}/.test(e)}function of(e,t){const n=(r=Jd(e),Array.from(new Set(r)));var r;const a=new Set(Jd(t));if(0===n.length||0===a.size)return 0;let o=0;for(const e of n)a.has(e)&&o++;return o/n.length}function lf(e,t,n,r,a,o,i,l,s,u){var c;const d=[],f=[],p=tf(n,r);d.push(p),f.push("cosine_tfidf");const h=function(e,t,n,r,a=1.5,o=.75){let i=0;for(const[l]of e){const e=t.get(l)||0;e<=0||(i+=Math.log(((n.df[l]||0)+.5)/(n.idf.length-(n.df[l]||0)+.5)+1)*(e*(a+1)/(e+a*(1-o+o*(r/(n.avgLen||1)))||1e-12)))}return i}(a,o,i,l);d.push(h),f.push("bm25");const m=of(t.heading||"",e);d.push(m),f.push("heading_match_frac");const g=function(e,t){const n=new Set(Jd(e)),r=new Set(Jd(t));let a=0;for(const e of n)r.has(e)&&a++;const o=n.size+r.size-a;return 0===o?0:a/o}(e,t.content||"");d.push(g),f.push("jaccard_tokens");const y=rf(t.rich||t.content||""),v=af(t.rich||t.content||"");var b;d.push(y?1:0),f.push("flag_go_code"),d.push(v?1:0),f.push("flag_any_code"),d.push((b=t.content||"",!/(golang\.org|go\.dev|pkg\.go\.dev)/i.test(b)?0:1)),f.push("flag_go_spec_link"),d.push(null!==(c=t.score_base)&&void 0!==c?c:0),f.push("prior_score_base");const w=(t.content||"").length;if(d.push(1/Math.sqrt(1+w)),f.push("len_inv_sqrt"),s&&u){let e=0,t=0;for(let n=0;n<s.length;n++)e+=s[n]*u[n],t+=Math.abs(s[n]-u[n]);d.push(e),f.push("proj_dot"),d.push(t/s.length),f.push("proj_l1mean")}return{names:f,values:d}}class sf{constructor(){this.w=null,this.mu=null,this.sigma=null}fit(e,t,n=.01){var r;const a=e.length,o=(null===(r=e[0])||void 0===r?void 0:r.length)||0;if(0===a||0===o)return void(this.w=new Float64Array(o));const i=new Float64Array(o),l=new Float64Array(o);for(let t=0;t<o;t++){let n=0;for(let r=0;r<a;r++)n+=e[r][t];n/=a,i[t]=n;let r=0;for(let o=0;o<a;o++){const a=e[o][t]-n;r+=a*a}l[t]=Math.sqrt(r/a)||1}const s=Array.from({length:a},(e,t)=>new Float64Array(o));for(let t=0;t<a;t++)for(let n=0;n<o;n++)s[t][n]=(e[t][n]-i[n])/l[n];const u=Array.from({length:o},()=>new Float64Array(o)),c=new Float64Array(o);for(let e=0;e<a;e++){const n=s[e],r=t[e];for(let e=0;e<o;e++){c[e]+=n[e]*r;const t=n[e];for(let r=0;r<=e;r++)u[e][r]+=t*n[r]}}for(let e=0;e<o;e++){for(let t=0;t<e;t++)u[t][e]=u[e][t];u[e][e]+=n}const d=Array.from({length:o},()=>new Float64Array(o));for(let e=0;e<o;e++)for(let t=0;t<=e;t++){let n=u[e][t];for(let r=0;r<t;r++)n-=d[e][r]*d[t][r];d[e][t]=e===t?Math.sqrt(Math.max(n,1e-12)):n/(d[t][t]||1e-12)}const f=new Float64Array(o);for(let e=0;e<o;e++){let t=c[e];for(let n=0;n<e;n++)t-=d[e][n]*f[n];f[e]=t/(d[e][e]||1e-12)}const p=new Float64Array(o);for(let e=o-1;e>=0;e--){let t=f[e];for(let n=e+1;n<o;n++)t-=d[n][e]*p[n];p[e]=t/(d[e][e]||1e-12)}this.w=p,this.mu=i,this.sigma=l}predict(e){if(!this.w||!this.mu||!this.sigma)return 0;let t=0;for(let n=0;n<this.w.length;n++){const r=(e[n]-this.mu[n])/this.sigma[n];t+=this.w[n]*r}return t}}function uf(e,t,n){var r;const a=t.rich||t.content||"";let o=0;/\bgo\b/.test(e.toLowerCase())&&/(define|declare|function|func)/i.test(e)&&rf(a)&&(o=Math.max(o,1));of(t.heading||"",e)>=.34&&af(a)&&(o=Math.max(o,.8));const i=n.names.indexOf("cosine_tfidf"),l=n.names.indexOf("bm25"),s=i>=0?n.values[i]:0,u=l>=0?n.values[l]:0;s>.25&&(o=Math.max(o,.6)),u>1&&(o=Math.max(o,.6));const c=n.names.indexOf("prior_score_base"),d=c>=0?n.values[c]:0;return(null!==(r=t.score_base)&&void 0!==r?r:0)>0&&(o=Math.max(o,Math.min(.6,.2+.5*d))),o}function cf(e,t,n={}){var r,a;const{lambdaRidge:o=.01,randomProjDim:i=32,exposeFeatures:l=!0,attachFeatureNames:s=!1}=n,u=[e,...t.map(e=>e.content||"")],{stats:c,tf:d,docLens:f}=Zd(u),p=d.map(e=>ef(e,c.idf)),h=d[0],m=p[0],g=i>0?nf(m,i):void 0,y=[],v=[],b=[];for(let n=0;n<t.length;n++){const r=t[n],a=d[n+1],o=p[n+1],l=i>0?nf(o,i,1337+n):void 0,s=lf(e,r,m,o,h,a,c,f[n+1]||1,g,l);b.push(s),y.push(s.values);const u=uf(e,r,s);v.push(u)}const w=v.every(e=>Math.abs(e-v[0])<1e-9);if(w){const e=b[0].names.indexOf("cosine_tfidf");if(e>=0)for(let t=0;t<v.length;t++)v[t]=Math.max(0,Math.min(1,.2+.6*y[t][e]))}const k=new sf;k.fit(y,v,o);let S=1/0,x=-1/0;const C=y.map(e=>k.predict(e));for(const e of C)e<S&&(S=e),e>x&&(x=e);const _=Math.max(1e-9,x-S),E=s?null!==(a=null===(r=b[0])||void 0===r?void 0:r.names)&&void 0!==a?a:[]:void 0,M=t.map((e,t)=>{const n=(C[t]-S)/_,r=function(e){if(e>=0)return 1/(1+Math.exp(-e));{const t=Math.exp(e);return t/(1+t)}}((C[t]-.5*(S+x))/(.2*_+1e-6)),a=Object.assign(Object.assign({},e),{score_rr:n,p_relevant:r});return l&&(a._features=y[t]),E&&(a._feature_names=E),a});return M.sort((e,t)=>t.score_rr-e.score_rr),M}function df(e,t={}){const{probThresh:n=.45,epsilonTop:r=.05,useMMR:a=!0,mmrLambda:o=.7,budgetChars:i=1200}=t;if(0===e.length)return[];const l=e[0].score_rr,s=e.filter(e=>e.p_relevant>=n&&e.score_rr>=l-r),u=s.length>0?s:[e[0]];if(!a){const e=[];let t=0;for(const n of u){const r=(n.content||"").length;if(t+r>i&&e.length>0)break;e.push(n),t+=r}return e}return function(e,t=.7,n=1200){const r=[],a=e.map(e=>e.content||""),{stats:o,tf:i}=Zd(a),l=i.map(e=>ef(e,o.idf)),s=new Set;let u=0;for(;s.size<e.length;){let a=-1,o=-1/0;for(let n=0;n<e.length;n++){if(s.has(n))continue;const r=e[n];let i=0;for(const e of s){const t=tf(l[n],l[e]);t>i&&(i=t)}const u=t*r.score_rr-(1-t)*i;u>o&&(o=u,a=n)}if(a<0)break;const i=e[a],c=(i.content||"").length;if(u+c>n&&r.length>0)break;r.push(i),u+=c,s.add(a)}return r}(e.map(e=>Object.assign(Object.assign({},e),{score_rr:u.includes(e)?e.score_rr+.01:e.score_rr})),o,i)}var ff=Object.freeze({__proto__:null,OmegaOfflineRAG:class{constructor(e){this.modelState=null,this.model=null,this.config={reranking:{enabled:e?.reranking?.enabled??!0,lambdaRidge:e?.reranking?.lambdaRidge??.1,useMMR:e?.reranking?.useMMR??!0,mmrLambda:e?.reranking?.mmrLambda??.5,probThresh:e?.reranking?.probThresh??.1},topK:e?.topK??5,verbose:e?.verbose??!1}}async loadModel(e){const t=performance.now();if(this.model=e,this.modelState=function(e){if("astermind-pro-v1"!==e.version&&"astermind-elm-v1"!==e.version)throw new Error(`Unsupported model version: ${e.version}. Expected 'astermind-pro-v1' or 'astermind-elm-v1'`);const t=JSON.parse(JSON.stringify(e.settings||{})),n=new Map(e.vocab),r=Float64Array.from(e.idf),a=e.chunks.map(e=>({heading:e.heading,content:e.content||"",rich:e.rich,level:e.level,secId:e.secId})),o=e.tfidfDocs.map(e=>{const t=new Map;for(const[n,r]of e)t.set(n,r);return t}),i=Array.from(e.landmarksIdx),l=e.landmarkMat.map(e=>Float64Array.from(e));let s;if(!e.denseDocs||e.denseDocs.length!==o.length)throw new Error("recomputeDense=true but buildDense function not provided");return s=e.denseDocs.map(e=>Float64Array.from(e)),{settings:t,vocabMap:n,idf:r,chunks:a,tfidfDocs:o,landmarksIdx:i,landmarkMat:l,denseDocs:s}}(e),this.config.verbose){const e=performance.now()-t;console.log(`[OmegaOfflineRAG] Model loaded in ${e.toFixed(0)}ms`),console.log(`[OmegaOfflineRAG] ${this.modelState.chunks.length} chunks, ${this.modelState.vocabMap.size} vocab`)}}async loadModelFromUrl(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch model from ${e}: ${t.status}`);const n=await t.json();await this.loadModel(n)}isReady(){return null!==this.modelState}getModelInfo(){return this.model&&this.modelState?{version:this.model.version,savedAt:this.model.savedAt,documentCount:this.modelState.chunks.length,vocabularySize:this.modelState.vocabMap.size,landmarkCount:this.modelState.landmarksIdx.length,hasDenseVectors:this.modelState.denseDocs.length>0,settings:this.model.settings}:null}async ask(e){const t=performance.now();if(!this.modelState||!this.model)return{answer:"Omega model not loaded. Please load a model first.",confidence:"none",sources:[],processingTime:0,degraded:!0,degradedReason:"Model not loaded"};try{const n=this.model.settings,r=n.kernel??"rbf",a=n.sigma??1,o=n.alpha??.5,i=n.beta??.3,l=n.ridge??.001,s=n.headingW??.2,u=n.useStem??!0,c=n.expandQuery??!1,d=n.prefilter??100,f=Yd({query:e,chunks:this.modelState.chunks,vocabMap:this.modelState.vocabMap,idf:this.modelState.idf,tfidfDocs:this.modelState.tfidfDocs,denseDocs:this.modelState.denseDocs,landmarksIdx:this.modelState.landmarksIdx,landmarkMat:this.modelState.landmarkMat,vocabSize:this.modelState.vocabMap.size,kernel:r,sigma:a,alpha:o,beta:i,ridge:l,headingW:s,useStem:u,expandQuery:c,topK:2*this.config.topK,prefilter:d});let p;if(this.config.reranking.enabled&&f.items.length>0){const t=function(e,t,n={}){return df(cf(e,t,n),n)}(e,f.items.map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score_base:f.scores[t]})),{lambdaRidge:this.config.reranking.lambdaRidge,useMMR:this.config.reranking.useMMR,mmrLambda:this.config.reranking.mmrLambda,probThresh:this.config.reranking.probThresh});p=t.slice(0,this.config.topK).map(e=>({heading:e.heading,content:e.content,rich:e.rich,score:e.score_base??0,rerankScore:e.score_rr,probability:e.p_relevant}))}else p=f.items.slice(0,this.config.topK).map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score:f.scores[t]}));const h=await Vd(e,p.map(e=>({heading:e.heading,content:e.content,score:e.score}))),m=performance.now()-t,g=p[0]?.score??0,y=this.determineConfidence(g,p.length);return{answer:h,confidence:y,sources:p,processingTime:m,degraded:!1,queryClassification:this.classifyQuery(e)}}catch(e){const n=performance.now()-t;return console.error("[OmegaOfflineRAG] Error during retrieval:",e),{answer:"An error occurred while processing your question offline.",confidence:"none",sources:[],processingTime:n,degraded:!0,degradedReason:e instanceof Error?e.message:"Unknown error"}}}async retrieve(e,t){if(!this.modelState||!this.model)return[];const n=t??this.config.topK,r=this.model.settings,a=r.kernel??"rbf",o=r.sigma??1,i=r.alpha??.5,l=r.beta??.3,s=r.ridge??.001,u=r.headingW??.2,c=r.useStem??!0,d=r.expandQuery??!1,f=r.prefilter??100,p=Yd({query:e,chunks:this.modelState.chunks,vocabMap:this.modelState.vocabMap,idf:this.modelState.idf,tfidfDocs:this.modelState.tfidfDocs,denseDocs:this.modelState.denseDocs,landmarksIdx:this.modelState.landmarksIdx,landmarkMat:this.modelState.landmarkMat,vocabSize:this.modelState.vocabMap.size,kernel:a,sigma:o,alpha:i,beta:l,ridge:s,headingW:u,useStem:c,expandQuery:d,topK:n,prefilter:f});return p.items.map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score:p.scores[t]}))}classifyQuery(e){const t=e.toLowerCase(),n=t.split(/\s+/),r=["what","who","when","where","which","is","are","was","were"],a=["how","steps","guide","tutorial","process","procedure"],o=["why","explain","describe","meaning","definition","concept"],i=["go to","navigate","find","page","link","take me","show me"];let l="unknown",s=.5;const u=[];for(const e of i)if(t.includes(e)){l="navigational",s=.8,u.push(e);break}if("unknown"===l){const e=n[0];a.includes(e)||a.some(e=>t.includes(e))?(l="procedural",s=.7,u.push(...a.filter(e=>t.includes(e)))):o.includes(e)||o.some(e=>t.includes(e))?(l="conceptual",s=.7,u.push(...o.filter(e=>t.includes(e)))):r.includes(e)&&(l="factual",s=.7,u.push(e))}return{type:l,confidence:s,keywords:u}}determineConfidence(e,t){return 0===t?"none":e>=.7||e>=.4?"medium":"low"}clear(){this.modelState=null,this.model=null}}});function pf({onClick:e,position:t,unreadCount:n=0}){return ad.jsxs("button",{className:`astermind-bubble astermind-bubble--${t}`,onClick:e,"aria-label":"Open chat",type:"button",children:[ad.jsx("svg",{className:"astermind-bubble__icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ad.jsx("path",{d:"M21 11.5C21.0034 12.8199 20.6951 14.1219 20.1 15.3C19.3944 16.7118 18.3098 17.8992 16.9674 18.7293C15.6251 19.5594 14.0782 19.9994 12.5 20C11.1801 20.0035 9.87812 19.6951 8.7 19.1L3 21L4.9 15.3C4.30493 14.1219 3.99656 12.8199 4 11.5C4.00061 9.92179 4.44061 8.37488 5.27072 7.03258C6.10083 5.69028 7.28825 4.6056 8.7 3.90003C9.87812 3.30496 11.1801 2.99659 12.5 3.00003H13C15.0843 3.11502 17.053 3.99479 18.5291 5.47089C20.0052 6.94699 20.885 8.91568 21 11V11.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),n>0&&ad.jsx("span",{className:"astermind-bubble__badge",children:n})]})}function hf({title:e,subtitle:t,onClose:n,children:r}){return ad.jsxs("div",{className:"astermind-header",children:[ad.jsxs("div",{className:"astermind-header__info",children:[ad.jsx("h3",{className:"astermind-header__title",children:e}),t&&ad.jsx("p",{className:"astermind-header__subtitle",children:t})]}),ad.jsxs("div",{className:"astermind-header__actions",children:[r,ad.jsx("button",{className:"astermind-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:ad.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ad.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})}function mf(e){if(!e)return"";return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\n/g,"<br />")}function gf(){return ad.jsxs("svg",{className:"astermind-source__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ad.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),ad.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function yf(){return ad.jsxs("svg",{className:"astermind-source__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ad.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),ad.jsx("polyline",{points:"7 10 12 15 17 10"}),ad.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function vf({source:e,showSummaryButton:t,showDownloadButton:n,onViewSummary:r,onDownload:a}){const[o,i]=j.useState(!1);return ad.jsxs("div",{className:"astermind-source",children:[ad.jsxs("div",{className:"astermind-source__header",children:[ad.jsx("span",{className:"astermind-source__title",children:e.documentName||e.title}),ad.jsxs("div",{className:"astermind-source__actions",children:[t&&ad.jsx("button",{className:"astermind-source__action-btn",onClick:t=>{t.stopPropagation(),e.fullContent&&i(!o),r?.(e)},title:"View summary","aria-label":"View source summary",children:ad.jsx(gf,{})}),n&&ad.jsx("button",{className:"astermind-source__action-btn",onClick:t=>{t.stopPropagation(),a?.(e)},title:"Download source","aria-label":"Download source file",children:ad.jsx(yf,{})}),ad.jsxs("span",{className:"astermind-source__relevance",children:[Math.round(100*e.relevance),"%"]})]})]}),ad.jsx("p",{className:"astermind-source__snippet",children:e.snippet}),o&&e.fullContent&&ad.jsx("div",{className:"astermind-source__full-content",dangerouslySetInnerHTML:{__html:mf(e.fullContent)}})]})}function bf({sources:e,config:t={},isOnline:n=!0,onViewSummary:r,onDownload:a}){const{enabled:o=!0,showSummary:i=!0,showDownload:l=!0}=t;return o&&0!==e.length?ad.jsx("div",{className:"astermind-sources",children:e.map((e,t)=>{const o=i&&!!e.fullContent,s=l&&n&&!!e.downloadUrl;return ad.jsx(vf,{source:e,showSummaryButton:o,showDownloadButton:s,onViewSummary:r,onDownload:a},e.chunkId||e.documentId||t)})}):null}function wf(e){const t=new Date,n=t.getTime()-e.getTime();if(n<6e4)return"Just now";if(n<36e5){return`${Math.floor(n/6e4)}m ago`}return e.toDateString()===t.toDateString()?e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):e.toLocaleDateString([],{month:"short",day:"numeric"})}function kf({message:e,sourceConfig:t,isOnline:n=!0,onViewSourceSummary:r,onDownloadSource:a}){const[o,i]=j.useState(!1);return ad.jsxs("div",{className:`astermind-message astermind-message--${e.role}`,children:[ad.jsx("div",{className:"astermind-message__bubble",children:e.isStreaming&&!e.content?ad.jsxs("span",{className:"astermind-message__typing",children:[ad.jsx("span",{}),ad.jsx("span",{}),ad.jsx("span",{})]}):ad.jsx("div",{className:"astermind-message__content",dangerouslySetInnerHTML:{__html:mf(e.content)}})}),ad.jsxs("div",{className:"astermind-message__meta",children:[ad.jsx("span",{className:"astermind-message__time",children:wf(e.timestamp)}),e.offline&&ad.jsx("span",{className:"astermind-message__offline",title:"Offline response",children:"offline"}),e.confidence&&"high"!==e.confidence&&ad.jsx("span",{className:`astermind-message__confidence astermind-message__confidence--${e.confidence}`,title:`Confidence: ${e.confidence}`,children:e.confidence})]}),e.sources&&e.sources.length>0&&ad.jsxs("div",{className:"astermind-message__sources",children:[ad.jsxs("button",{className:"astermind-message__sources-toggle",onClick:()=>i(!o),type:"button",children:[o?"Hide":"Show"," sources (",e.sources.length,")"]}),o&&ad.jsx(bf,{sources:e.sources,config:t,isOnline:n,onViewSummary:r,onDownload:a})]})]})}function Sf(){return ad.jsxs("div",{className:"astermind-typing",children:[ad.jsx("span",{}),ad.jsx("span",{}),ad.jsx("span",{})]})}function xf({messages:e,isProcessing:t,sourceConfig:n,isOnline:r=!0,onViewSourceSummary:a,onDownloadSource:o}){const i=j.useRef(null);return j.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,t]),ad.jsxs("div",{className:"astermind-messages",ref:i,children:[e.map(e=>ad.jsx(kf,{message:e,sourceConfig:n,isOnline:r,onViewSourceSummary:a,onDownloadSource:o},e.id)),t&&""===e[e.length-1]?.content&&ad.jsx(Sf,{})]})}function Cf({placeholder:e,disabled:t=!1,onSend:n}){const[r,a]=j.useState(""),o=j.useRef(null),i=()=>{r.trim()&&!t&&(n(r.trim()),a(""),o.current?.focus())};return ad.jsxs("div",{className:"astermind-input",children:[ad.jsx("textarea",{ref:o,className:"astermind-input__textarea",value:r,onChange:e=>{const t=e.target;a(t.value),t.style.height="auto",t.style.height=Math.min(t.scrollHeight,120)+"px"},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i())},placeholder:e,disabled:t,rows:1,"aria-label":"Message input"}),ad.jsx("button",{className:"astermind-input__send",onClick:i,disabled:t||!r.trim(),"aria-label":"Send message",type:"button",children:ad.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ad.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})})})]})}function _f({action:e,onConfirm:t,onCancel:n}){return ad.jsxs("div",{className:"astermind-action-card",children:[ad.jsxs("div",{className:"astermind-action-card__header",children:[ad.jsx("div",{className:"astermind-action-card__icon",children:(e=>{switch(e){case"navigate":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ad.jsx("polyline",{points:"15,3 21,3 21,9"}),ad.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]});case"fillForm":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ad.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"clickElement":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M15 15l-2 5L9 9l11 4-5 2z"}),ad.jsx("path",{d:"M15 15l5 5"})]});default:return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("circle",{cx:"12",cy:"12",r:"10"}),ad.jsx("polyline",{points:"12,6 12,12 16,14"})]})}})(e.type)}),ad.jsxs("div",{className:"astermind-action-card__title",children:[ad.jsx("span",{className:"astermind-action-card__label",children:(e=>{switch(e){case"navigate":return"Navigate to";case"fillForm":return"Fill form field";case"clickElement":return"Click";case"triggerModal":return"Open modal";case"scroll":return"Scroll to";case"highlight":return"Highlight";case"custom":return"Execute action";default:return"Perform action"}})(e.type)}),ad.jsx("span",{className:"astermind-action-card__target",children:e.target})]})]}),e.explanation&&ad.jsx("p",{className:"astermind-action-card__explanation",children:e.explanation}),ad.jsxs("div",{className:"astermind-action-card__confidence",children:[ad.jsx("div",{className:"astermind-action-card__confidence-bar",style:{width:100*e.confidence+"%"}}),ad.jsxs("span",{children:[Math.round(100*e.confidence),"% confident"]})]}),ad.jsxs("div",{className:"astermind-action-card__actions",children:[ad.jsx("button",{className:"astermind-action-card__cancel",onClick:n,type:"button",children:"Cancel"}),ad.jsx("button",{className:"astermind-action-card__confirm",onClick:t,type:"button",children:"Confirm"})]})]})}function Ef({status:e}){return ad.jsxs("div",{className:`astermind-status astermind-status--${e}`,children:[ad.jsx("span",{className:"astermind-status__dot"}),ad.jsx("span",{className:"astermind-status__label",children:(()=>{switch(e){case"online":return"Online";case"offline":return"Offline";case"connecting":return"Connecting...";case"error":return"Error";default:return"Unknown"}})()})]})}function Mf({messages:e,isProcessing:t,connectionStatus:n,pendingAction:r,headerTitle:a,headerSubtitle:o,placeholder:i,showPoweredBy:l,sourceConfig:s,onClose:u,onSendMessage:c,onActionConfirm:d,onActionCancel:f,onViewSourceSummary:p,onDownloadSource:h}){const m="online"===n;return ad.jsxs("div",{className:"astermind-window",children:[ad.jsx(hf,{title:a,subtitle:o,onClose:u,children:ad.jsx(Ef,{status:n})}),ad.jsxs("div",{className:"astermind-window__body",children:[ad.jsx(xf,{messages:e,isProcessing:t,sourceConfig:s,isOnline:m,onViewSourceSummary:p,onDownloadSource:h}),r&&ad.jsx(_f,{action:r,onConfirm:()=>d(r),onCancel:f})]}),ad.jsxs("div",{className:"astermind-window__footer",children:[ad.jsx(Cf,{placeholder:i,disabled:t||"error"===n,onSend:c}),l&&ad.jsxs("div",{className:"astermind-powered-by",children:["Powered by ",ad.jsx("a",{href:"https://astermind.ai",target:"_blank",rel:"noopener noreferrer",children:"AsterMind"})]})]})]})}const Nf={primaryColor:"#4F46E5",primaryHover:"#4338CA",backgroundColor:"#ffffff",surfaceColor:"#f3f4f6",textColor:"#1f2937",textMuted:"#6b7280",borderColor:"#e5e7eb",userBubbleBackground:"#4F46E5",userBubbleText:"#ffffff",botBubbleBackground:"#f3f4f6",botBubbleText:"#1f2937",widgetWidth:"380px",widgetHeight:"75vh",bubbleSize:"60px",borderRadius:"12px",fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSize:"14px",shadow:"0 4px 20px rgba(0, 0, 0, 0.15)"};const Pf=j.createContext(null);function Rf({theme:e,children:t}){const n=function(e){const t=j.useMemo(()=>({...Nf,...e}),[e]),n=j.useMemo(()=>({"--astermind-primary":t.primaryColor,"--astermind-primary-hover":t.primaryHover,"--astermind-background":t.backgroundColor,"--astermind-surface":t.surfaceColor,"--astermind-text":t.textColor,"--astermind-text-muted":t.textMuted,"--astermind-border":t.borderColor,"--astermind-user-bg":t.userBubbleBackground,"--astermind-user-text":t.userBubbleText,"--astermind-bot-bg":t.botBubbleBackground,"--astermind-bot-text":t.botBubbleText,"--astermind-widget-width":t.widgetWidth,"--astermind-widget-height":t.widgetHeight,"--astermind-bubble-size":t.bubbleSize,"--astermind-border-radius":t.borderRadius,"--astermind-font-family":t.fontFamily,"--astermind-font-size":t.fontSize,"--astermind-shadow":t.shadow}),[t]);return{theme:t,cssVariables:n}}(e);return ad.jsx(Pf.Provider,{value:n,children:ad.jsx("div",{style:n.cssVariables,children:t})})}function Lf(e){const n=j.useMemo(()=>function(){let e="",n="https://api.astermind.ai";try{t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("astermind-chatbot.min.js",document.baseURI).href}catch{}if(!e&&"undefined"!=typeof process&&process.env&&(e=process.env.REACT_APP_ASTERMIND_RAG_API_KEY||e,n=process.env.REACT_APP_ASTERMIND_RAG_API_SERVER_URL||n),"undefined"!=typeof window){const t=window.__ASTERMIND_CONFIG__;t&&"object"==typeof t&&(e=t.apiKey||e,n=t.apiUrl||n)}return{apiKey:e,apiUrl:n}}(),[]),{apiKey:r,apiUrl:a,throwOnMissingKey:o=!0,position:i="bottom-right",theme:l={},greeting:s="Hi! How can I help you today?",placeholder:u="Type your message...",fallback:c={enabled:!0},sourceDisplay:d,showPoweredBy:f=!0,headerTitle:p="AsterMind",headerSubtitle:h="AI Assistant",defaultOpen:m=!1,zIndex:g=9999,onReady:y,onMessage:v,onAction:b,onError:w,onToggle:k}=e,S=r||n.apiKey,x=a||n.apiUrl,[C,_]=j.useState(m),[E,M]=j.useState(null),[N,P]=j.useState([]),[R,L]=j.useState(!1),[A,T]=j.useState(),[z,D]=j.useState(),[I,O]=j.useState("connecting"),F=j.useMemo(()=>{const e=E?.getSourcesConfig?.()||{};return{enabled:d?.enabled??e.enabled??!0,showSummary:d?.showSummary??e.showSummary??!0,showDownload:d?.showDownload??e.showDownload??!0}},[E,d]),U=j.useCallback(e=>{console.log("[AsterMind] View source summary:",e.title)},[]),$=j.useCallback(async e=>{if(e.downloadUrl)try{const t=e.downloadUrl.startsWith("http")?e.downloadUrl:`${x}${e.downloadUrl}`,n=await fetch(t,{headers:{"X-API-Key":S}});if(!n.ok)return void console.error("[AsterMind] Download failed:",n.status,n.statusText);const r=n.headers.get("Content-Disposition");let a=e.documentName||e.title||"download";if(r){const e=r.match(/filename="?(.+?)"?$/);e&&(a=e[1])}const o=await n.blob(),i=window.URL.createObjectURL(o),l=document.createElement("a");l.href=i,l.download=a,document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(i),document.body.removeChild(l)}catch(e){console.error("[AsterMind] Download error:",e)}else console.warn("[AsterMind] No download URL for source:",e.title)},[x,S]);j.useEffect(()=>{if(!S){const e='AsterMind API key is required. Configure using one of these methods:\n 1. Pass apiKey prop: <ChatbotWidget apiKey="am_..." />\n 2. Set VITE_ASTERMIND_RAG_API_KEY environment variable (Vite)\n 3. Set REACT_APP_ASTERMIND_RAG_API_KEY environment variable (CRA)\n 4. Set window.__ASTERMIND_CONFIG__ = { apiKey: "am_...", apiUrl: "..." }';if(o)throw new Error(e);console.warn("[AsterMind] "+e)}},[S,o]),j.useEffect(()=>{if(!S)return;const e=new zd({apiUrl:x,apiKey:S,fallback:{enabled:c?.enabled??!0,cacheOnConnect:!0},onStatusChange:e=>{O(e)},onError:e=>{w?.(new Error(e.message))}});if(M(e),s){const e={id:"greeting",role:"assistant",content:s,timestamp:new Date};P([e])}return y?.(),()=>{}},[S,x,c?.enabled,s,w,y]);const B=j.useCallback(()=>{const e=!C;_(e),k?.(e)},[C,k]),V=j.useCallback(()=>{_(!1),k?.(!1)},[k]),W=j.useCallback(async e=>{if(!E||!e.trim()||R)return;const t={id:`user-${Date.now()}`,role:"user",content:e.trim(),timestamp:new Date};P(e=>[...e,t]),v?.(t),L(!0);const n=`assistant-${Date.now()}`,r={id:n,role:"assistant",content:"",timestamp:new Date,isStreaming:!0};P(e=>[...e,r]);try{let t="";await E.askStream(e,{onToken:e=>{t+=e,P(e=>e.map(e=>e.id===n?{...e,content:t}:e))},onSources:e=>{P(t=>t.map(t=>t.id===n?{...t,sources:e}:t))},onComplete:e=>{const t={id:n,role:"assistant",content:e.reply,timestamp:new Date,sources:e.sources,confidence:e.confidence,offline:e.offline,isStreaming:!1};P(e=>e.map(e=>e.id===n?t:e)),T(e.sessionId),v?.(t)},onError:()=>{H(E,e,n)}},{sessionId:A})}catch{const e={id:n,role:"assistant",content:"I encountered an error processing your request. Please try again.",timestamp:new Date,isStreaming:!1};P(t=>t.map(t=>t.id===n?e:t)),w?.(new Error("Failed to process message"))}finally{L(!1)}},[E,R,A,v,w]),H=async(e,t,n)=>{try{const r=await e.ask(t,{sessionId:A}),a={id:n,role:"assistant",content:r.reply,timestamp:new Date,sources:r.sources,confidence:r.confidence,offline:r.offline,isStreaming:!1};P(e=>e.map(e=>e.id===n?a:e)),T(r.sessionId),v?.(a)}catch{const e={id:n,role:"assistant",content:"I'm having trouble connecting. Please try again later.",timestamp:new Date,isStreaming:!1};P(t=>t.map(t=>t.id===n?e:t))}},K=j.useCallback(async e=>{if(!z)return;const t={...z,status:"executed",result:{success:!0,message:`Action ${e.type} completed`}};D(void 0),b?.(t)},[z,b]),Q=j.useCallback(()=>{if(!z)return;const e={...z,status:"cancelled"};D(void 0),b?.(e)},[z,b]);return ad.jsx(Rf,{theme:l,children:ad.jsxs("div",{className:`astermind-chatbot astermind-chatbot--${i}`,style:{zIndex:g},children:[!C&&ad.jsx(pf,{onClick:B,position:i}),C&&ad.jsx(Mf,{messages:N,isProcessing:R,connectionStatus:I,pendingAction:z,headerTitle:p,headerSubtitle:h,placeholder:u,showPoweredBy:f,sourceConfig:F,onClose:V,onSendMessage:W,onActionConfirm:K,onActionCancel:Q,onViewSourceSummary:U,onDownloadSource:$})]})})}let Af=null;function Tf(e){const t=function(){if("undefined"==typeof document)return{};const e=document.querySelector("script[data-astermind-key]");if(!e)return{};const t={},n=e.getAttribute("data-astermind-key");n&&(t.apiKey=n);const r=e.getAttribute("data-astermind-url");r&&(t.apiUrl=r);const a=e.getAttribute("data-astermind-position");a&&["bottom-right","bottom-left","top-right","top-left"].includes(a)&&(t.position=a);const o=e.getAttribute("data-astermind-greeting");o&&(t.greeting=o);const i=e.getAttribute("data-astermind-title");i&&(t.headerTitle=i);const l=e.getAttribute("data-astermind-subtitle");return l&&(t.headerSubtitle=l),"true"===e.getAttribute("data-astermind-auto-open")&&(t.defaultOpen=!0),t}(),n={...t,...function(){if("undefined"==typeof window)return{};const e=window.astermindConfig;return e&&"object"==typeof e?e:{}}(),...e||{}},{container:r=document.body,...a}=n;a.apiKey||console.warn('[AsterMindChatbot] No API key found. Configure using one of these methods:\n 1. AsterMindChatbot.init({ apiKey: "am_..." })\n 2. window.astermindConfig = { apiKey: "am_..." }\n 3. <script data-astermind-key="am_..." ...>\n 4. Set VITE_ASTERMIND_RAG_API_KEY environment variable (if bundled)');const o="string"==typeof r?document.querySelector(r):r;if(!o)return void console.error("[AsterMindChatbot] Container not found:",r);const i=document.createElement("div");i.id="astermind-chatbot-root",o.appendChild(i),Af=Qc(i),Af.render(U.createElement(Lf,a)),console.log("[AsterMindChatbot] Initialized")}function zf(){Af&&(Af.unmount(),Af=null);const e=document.getElementById("astermind-chatbot-root");e&&e.remove(),console.log("[AsterMindChatbot] Destroyed")}function Df(){return null!==Af}return"undefined"!=typeof window&&(window.AsterMindChatbot={init:Tf,destroy:zf,isInitialized:Df}),e.destroy=zf,e.init=Tf,e.isInitialized=Df,e}({});
|
|
20
|
+
*/function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var G=new Set,Y={};function X(e,t){J(e,t),J(e+"Capture",t)}function J(e,t){for(Y[e]=t,e=0;e<t.length;e++)G.add(t[e])}var Z=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),ee=Object.prototype.hasOwnProperty,te=/^[: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]*$/,ne={},re={};function ae(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ae(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ae(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ae(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ae(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){oe[e]=new ae(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ae(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){oe[e]=new ae(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){oe[e]=new ae(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){oe[e]=new ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var ie=/[\-:]([a-z])/g;function se(e){return e[1].toUpperCase()}function le(e,t,n,r){var a=oe.hasOwnProperty(t)?oe[t]:null;(null!==a?0!==a.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,a,r)&&(n=null),r||null===a?function(e){return!!ee.call(re,e)||!ee.call(ne,e)&&(te.test(e)?re[e]=!0:(ne[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=null===n?3!==a.type&&"":n:(t=a.attributeName,r=a.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(a=a.type)||4===a&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ie,se);oe[t]=new ae(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ie,se);oe[t]=new ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ie,se);oe[t]=new ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ae(e,1,!1,e.toLowerCase(),null,!1,!1)}),oe.xlinkHref=new ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){oe[e]=new ae(e,1,!1,e.toLowerCase(),null,!0,!0)});var ce=K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ue=Symbol.for("react.element"),de=Symbol.for("react.portal"),fe=Symbol.for("react.fragment"),he=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),ge=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),we=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),xe=Symbol.iterator;function Ce(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=xe&&e[xe]||e["@@iterator"])?e:null}var Ee,_e=Object.assign;function Me(e){if(void 0===Ee)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||""}return"\n"+Ee+e}var Le=!1;function Ne(e,t){if(!e||Le)return"";Le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),o=r.stack.split("\n"),i=a.length-1,s=o.length-1;1<=i&&0<=s&&a[i]!==o[s];)s--;for(;1<=i&&0<=s;i--,s--)if(a[i]!==o[s]){if(1!==i||1!==s)do{if(i--,0>--s||a[i]!==o[s]){var l="\n"+a[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=i&&0<=s);break}}}finally{Le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Me(e):""}function Ae(e){switch(e.tag){case 5:return Me(e.type);case 16:return Me("Lazy");case 13:return Me("Suspense");case 19:return Me("SuspenseList");case 0:case 2:case 15:return e=Ne(e.type,!1);case 11:return e=Ne(e.type.render,!1);case 1:return e=Ne(e.type,!0);default:return""}}function Pe(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case fe:return"Fragment";case de:return"Portal";case pe:return"Profiler";case he:return"StrictMode";case ve:return"Suspense";case be:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ge:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case ye:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case we:return null!==(t=e.displayName||null)?t:Pe(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return Pe(e(t))}catch(e){}}return null}function Re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pe(t);case 8:return t===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function Te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Ie(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function De(e){e._valueTracker||(e._valueTracker=function(e){var t=Ie(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ze(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ie(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Fe(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Oe(e,t){var n=t.checked;return _e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function je(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Te(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function $e(e,t){null!=(t=t.checked)&&le(e,"checked",t,!1)}function Ue(e,t){$e(e,t);var n=Te(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ve(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ve(e,t.type,Te(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Be(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ve(e,t,n){"number"===t&&Fe(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var We=Array.isArray;function He(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Te(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function Ke(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Q(91));return _e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Q(92));if(We(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Te(n)}}function Qe(e,t){var n=Te(t.value),r=Te(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ge(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function Ye(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Xe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ye(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Je,Ze,et=(Ze=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((Je=Je||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Ze(e,t)})}:Ze);function tt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var nt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rt=["Webkit","ms","Moz","O"];function at(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||nt.hasOwnProperty(e)&&nt[e]?(""+t).trim():t+"px"}function ot(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=at(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(nt).forEach(function(e){rt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nt[t]=nt[e]})});var it=_e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function st(e,t){if(t){if(it[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Q(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Q(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Q(62))}}function lt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 ct=null;function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var dt=null,ft=null,ht=null;function pt(e){if(e=lo(e)){if("function"!=typeof dt)throw Error(Q(280));var t=e.stateNode;t&&(t=uo(t),dt(e.stateNode,e.type,t))}}function mt(e){ft?ht?ht.push(e):ht=[e]:ft=e}function gt(){if(ft){var e=ft,t=ht;if(ht=ft=null,pt(e),t)for(e=0;e<t.length;e++)pt(t[e])}}function yt(e,t){return e(t)}function vt(){}var bt=!1;function wt(e,t,n){if(bt)return e(t,n);bt=!0;try{return yt(e,t,n)}finally{bt=!1,(null!==ft||null!==ht)&&(vt(),gt())}}function St(e,t){var n=e.stateNode;if(null===n)return null;var r=uo(n);if(null===r)return null;n=r[t];e: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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Q(231,t,typeof n));return n}var kt=!1;if(Z)try{var xt={};Object.defineProperty(xt,"passive",{get:function(){kt=!0}}),window.addEventListener("test",xt,xt),window.removeEventListener("test",xt,xt)}catch(Ze){kt=!1}function Ct(e,t,n,r,a,o,i,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Et=!1,_t=null,Mt=!1,Lt=null,Nt={onError:function(e){Et=!0,_t=e}};function At(e,t,n,r,a,o,i,s,l){Et=!1,_t=null,Ct.apply(Nt,arguments)}function Pt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Rt(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Tt(e){if(Pt(e)!==e)throw Error(Q(188))}function It(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Pt(e)))throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(r=a.return)){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return Tt(a),e;if(o===r)return Tt(a),t;o=o.sibling}throw Error(Q(188))}if(n.return!==r.return)n=a,r=o;else{for(var i=!1,s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(3!==n.tag)throw Error(Q(188));return n.stateNode.current===n?e:t}(e),null!==e?Dt(e):null}function Dt(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Dt(e);if(null!==t)return t;e=e.sibling}return null}var zt=q.unstable_scheduleCallback,Ft=q.unstable_cancelCallback,Ot=q.unstable_shouldYield,jt=q.unstable_requestPaint,$t=q.unstable_now,Ut=q.unstable_getCurrentPriorityLevel,Bt=q.unstable_ImmediatePriority,Vt=q.unstable_UserBlockingPriority,Wt=q.unstable_NormalPriority,Ht=q.unstable_LowPriority,Kt=q.unstable_IdlePriority,qt=null,Qt=null;var Gt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(Yt(e)/Xt|0)|0},Yt=Math.log,Xt=Math.LN2;var Jt=64,Zt=4194304;function en(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tn(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,o=e.pingedLanes,i=268435455&n;if(0!==i){var s=i&~a;0!==s?r=en(s):0!==(o&=i)&&(r=en(o))}else 0!==(i=n&~a)?r=en(i):0!==o&&(r=en(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(o=t&-t)||16===a&&4194240&o))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-Gt(t)),r|=e[n],t&=~a;return r}function nn(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function rn(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function an(){var e=Jt;return!(4194240&(Jt<<=1))&&(Jt=64),e}function on(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sn(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-Gt(t)]=n}function ln(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Gt(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var cn=0;function un(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var dn,fn,hn,pn,mn,gn=!1,yn=[],vn=null,bn=null,wn=null,Sn=new Map,kn=new Map,xn=[],Cn="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 submit".split(" ");function En(e,t){switch(e){case"focusin":case"focusout":vn=null;break;case"dragenter":case"dragleave":bn=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":Sn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kn.delete(t.pointerId)}}function _n(e,t,n,r,a,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},null!==t&&(null!==(t=lo(t))&&fn(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function Mn(e){var t=so(e.target);if(null!==t){var n=Pt(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Rt(n)))return e.blockedOn=t,void mn(e.priority,function(){hn(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ln(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=jn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=lo(n))&&fn(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ct=r,n.target.dispatchEvent(r),ct=null,t.shift()}return!0}function Nn(e,t,n){Ln(e)&&n.delete(t)}function An(){gn=!1,null!==vn&&Ln(vn)&&(vn=null),null!==bn&&Ln(bn)&&(bn=null),null!==wn&&Ln(wn)&&(wn=null),Sn.forEach(Nn),kn.forEach(Nn)}function Pn(e,t){e.blockedOn===t&&(e.blockedOn=null,gn||(gn=!0,q.unstable_scheduleCallback(q.unstable_NormalPriority,An)))}function Rn(e){function t(t){return Pn(t,e)}if(0<yn.length){Pn(yn[0],e);for(var n=1;n<yn.length;n++){var r=yn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==vn&&Pn(vn,e),null!==bn&&Pn(bn,e),null!==wn&&Pn(wn,e),Sn.forEach(t),kn.forEach(t),n=0;n<xn.length;n++)(r=xn[n]).blockedOn===e&&(r.blockedOn=null);for(;0<xn.length&&null===(n=xn[0]).blockedOn;)Mn(n),null===n.blockedOn&&xn.shift()}var Tn=ce.ReactCurrentBatchConfig,In=!0;function Dn(e,t,n,r){var a=cn,o=Tn.transition;Tn.transition=null;try{cn=1,Fn(e,t,n,r)}finally{cn=a,Tn.transition=o}}function zn(e,t,n,r){var a=cn,o=Tn.transition;Tn.transition=null;try{cn=4,Fn(e,t,n,r)}finally{cn=a,Tn.transition=o}}function Fn(e,t,n,r){if(In){var a=jn(e,t,n,r);if(null===a)Ta(e,t,r,On,n),En(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return vn=_n(vn,e,t,n,r,a),!0;case"dragenter":return bn=_n(bn,e,t,n,r,a),!0;case"mouseover":return wn=_n(wn,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return Sn.set(o,_n(Sn.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,kn.set(o,_n(kn.get(o)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(En(e,r),4&t&&-1<Cn.indexOf(e)){for(;null!==a;){var o=lo(a);if(null!==o&&dn(o),null===(o=jn(e,t,n,r))&&Ta(e,t,r,On,n),o===a)break;a=o}null!==a&&r.stopPropagation()}else Ta(e,t,r,null,n)}}var On=null;function jn(e,t,n,r){if(On=null,null!==(e=so(e=ut(r))))if(null===(t=Pt(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Rt(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return On=e,null}function $n(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ut()){case Bt:return 1;case Vt:return 4;case Wt:case Ht:return 16;case Kt:return 536870912;default:return 16}default:return 16}}var Un=null,Bn=null,Vn=null;function Wn(){if(Vn)return Vn;var e,t,n=Bn,r=n.length,a="value"in Un?Un.value:Un.textContent,o=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[o-t];t++);return Vn=a.slice(e,1<t?1-t:void 0)}function Hn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kn(){return!0}function qn(){return!1}function Qn(e){function t(t,n,r,a,o){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?Kn:qn,this.isPropagationStopped=qn,this}return _e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kn)},persist:function(){},isPersistent:Kn}),t}var Gn,Yn,Xn,Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zn=Qn(Jn),er=_e({},Jn,{view:0,detail:0}),tr=Qn(er),nr=_e({},er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Xn&&(Xn&&"mousemove"===e.type?(Gn=e.screenX-Xn.screenX,Yn=e.screenY-Xn.screenY):Yn=Gn=0,Xn=e),Gn)},movementY:function(e){return"movementY"in e?e.movementY:Yn}}),rr=Qn(nr),ar=Qn(_e({},nr,{dataTransfer:0})),or=Qn(_e({},er,{relatedTarget:0})),ir=Qn(_e({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0})),sr=_e({},Jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lr=Qn(sr),cr=Qn(_e({},Jn,{data:0})),ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dr={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"},fr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=fr[e])&&!!t[e]}function pr(){return hr}var mr=_e({},er,{key:function(e){if(e.key){var t=ur[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Hn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?dr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pr,charCode:function(e){return"keypress"===e.type?Hn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Hn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),gr=Qn(mr),yr=Qn(_e({},nr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),vr=Qn(_e({},er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pr})),br=Qn(_e({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),wr=_e({},nr,{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}),Sr=Qn(wr),kr=[9,13,27,32],xr=Z&&"CompositionEvent"in window,Cr=null;Z&&"documentMode"in document&&(Cr=document.documentMode);var Er=Z&&"TextEvent"in window&&!Cr,_r=Z&&(!xr||Cr&&8<Cr&&11>=Cr),Mr=String.fromCharCode(32),Lr=!1;function Nr(e,t){switch(e){case"keyup":return-1!==kr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ar(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Pr=!1;var Rr={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rr[e.type]:"textarea"===t}function Ir(e,t,n,r){mt(r),0<(t=Da(t,"onChange")).length&&(n=new Zn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dr=null,zr=null;function Fr(e){Ma(e,0)}function Or(e){if(ze(co(e)))return e}function jr(e,t){if("change"===e)return t}var $r=!1;if(Z){var Ur;if(Z){var Br="oninput"in document;if(!Br){var Vr=document.createElement("div");Vr.setAttribute("oninput","return;"),Br="function"==typeof Vr.oninput}Ur=Br}else Ur=!1;$r=Ur&&(!document.documentMode||9<document.documentMode)}function Wr(){Dr&&(Dr.detachEvent("onpropertychange",Hr),zr=Dr=null)}function Hr(e){if("value"===e.propertyName&&Or(zr)){var t=[];Ir(t,zr,e,ut(e)),wt(Fr,t)}}function Kr(e,t,n){"focusin"===e?(Wr(),zr=n,(Dr=t).attachEvent("onpropertychange",Hr)):"focusout"===e&&Wr()}function qr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Or(zr)}function Qr(e,t){if("click"===e)return Or(t)}function Gr(e,t){if("input"===e||"change"===e)return Or(t)}var Yr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function Xr(e,t){if(Yr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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 a=n[r];if(!ee.call(t,a)||!Yr(e[a],t[a]))return!1}return!0}function Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zr(e,t){var n,r=Jr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jr(r)}}function ea(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ea(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ta(){for(var e=window,t=Fe();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Fe((e=t.contentWindow).document)}return t}function na(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ra(e){var t=ta(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ea(n.ownerDocument.documentElement,n)){if(null!==r&&na(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,o=Math.min(r.start,a);r=void 0===r.end?o:Math.min(r.end,a),!e.extend&&o>r&&(a=r,r=o,o=a),a=Zr(n,o);var i=Zr(n,r);a&&i&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var aa=Z&&"documentMode"in document&&11>=document.documentMode,oa=null,ia=null,sa=null,la=!1;function ca(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;la||null==oa||oa!==Fe(r)||("selectionStart"in(r=oa)&&na(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sa&&Xr(sa,r)||(sa=r,0<(r=Da(ia,"onSelect")).length&&(t=new Zn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=oa)))}function ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var da={animationend:ua("Animation","AnimationEnd"),animationiteration:ua("Animation","AnimationIteration"),animationstart:ua("Animation","AnimationStart"),transitionend:ua("Transition","TransitionEnd")},fa={},ha={};function pa(e){if(fa[e])return fa[e];if(!da[e])return e;var t,n=da[e];for(t in n)if(n.hasOwnProperty(t)&&t in ha)return fa[e]=n[t];return e}Z&&(ha=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);var ma=pa("animationend"),ga=pa("animationiteration"),ya=pa("animationstart"),va=pa("transitionend"),ba=new Map,wa="abort auxClick 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(" ");function Sa(e,t){ba.set(e,t),X(t,[e])}for(var ka=0;ka<wa.length;ka++){var xa=wa[ka];Sa(xa.toLowerCase(),"on"+(xa[0].toUpperCase()+xa.slice(1)))}Sa(ma,"onAnimationEnd"),Sa(ga,"onAnimationIteration"),Sa(ya,"onAnimationStart"),Sa("dblclick","onDoubleClick"),Sa("focusin","onFocus"),Sa("focusout","onBlur"),Sa(va,"onTransitionEnd"),J("onMouseEnter",["mouseout","mouseover"]),J("onMouseLeave",["mouseout","mouseover"]),J("onPointerEnter",["pointerout","pointerover"]),J("onPointerLeave",["pointerout","pointerover"]),X("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),X("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),X("onBeforeInput",["compositionend","keypress","textInput","paste"]),X("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),X("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),X("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ca="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(" "),Ea=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ca));function _a(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,o,i,s,l){if(At.apply(this,arguments),Et){if(!Et)throw Error(Q(198));var c=_t;Et=!1,_t=null,Mt||(Mt=!0,Lt=c)}}(r,t,void 0,e),e.currentTarget=null}function Ma(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&a.isPropagationStopped())break e;_a(a,s,c),o=l}else for(i=0;i<r.length;i++){if(l=(s=r[i]).instance,c=s.currentTarget,s=s.listener,l!==o&&a.isPropagationStopped())break e;_a(a,s,c),o=l}}}if(Mt)throw e=Lt,Mt=!1,Lt=null,e}function La(e,t){var n=t[ao];void 0===n&&(n=t[ao]=new Set);var r=e+"__bubble";n.has(r)||(Ra(t,e,2,!1),n.add(r))}function Na(e,t,n){var r=0;t&&(r|=4),Ra(n,e,r,t)}var Aa="_reactListening"+Math.random().toString(36).slice(2);function Pa(e){if(!e[Aa]){e[Aa]=!0,G.forEach(function(t){"selectionchange"!==t&&(Ea.has(t)||Na(t,!1,e),Na(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Aa]||(t[Aa]=!0,Na("selectionchange",!1,t))}}function Ra(e,t,n,r){switch($n(t)){case 1:var a=Dn;break;case 4:a=zn;break;default:a=Fn}n=a.bind(null,t,n,e),a=void 0,!kt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Ta(e,t,n,r,a){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var s=r.stateNode.containerInfo;if(s===a||8===s.nodeType&&s.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===a||8===l.nodeType&&l.parentNode===a))return;i=i.return}for(;null!==s;){if(null===(i=so(s)))return;if(5===(l=i.tag)||6===l){r=o=i;continue e}s=s.parentNode}}r=r.return}wt(function(){var r=o,a=ut(n),i=[];e:{var s=ba.get(e);if(void 0!==s){var l=Zn,c=e;switch(e){case"keypress":if(0===Hn(n))break e;case"keydown":case"keyup":l=gr;break;case"focusin":c="focus",l=or;break;case"focusout":c="blur",l=or;break;case"beforeblur":case"afterblur":l=or;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=ar;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=vr;break;case ma:case ga:case ya:l=ir;break;case va:l=br;break;case"scroll":l=tr;break;case"wheel":l=Sr;break;case"copy":case"cut":case"paste":l=lr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=yr}var u=!!(4&t),d=!u&&"scroll"===e,f=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=St(p,f))&&u.push(Ia(p,m,h)))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,a),i.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ct||!(c=n.relatedTarget||n.fromElement)||!so(c)&&!c[ro])&&(l||s)&&(s=a.window===a?a:(s=a.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?so(c):null)&&(c!==(d=Pt(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=rr,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=yr,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:co(l),h=null==c?s:co(c),(s=new u(m,p+"leave",l,n,a)).target=d,s.relatedTarget=h,m=null,so(a)===r&&((u=new u(f,p+"enter",c,n,a)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=za(h))p++;for(h=0,m=f;m;m=za(m))h++;for(;0<p-h;)u=za(u),p--;for(;0<h-p;)f=za(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=za(u),f=za(f)}u=null}else u=null;null!==l&&Fa(i,s,l,u,!1),null!==c&&null!==d&&Fa(i,d,c,u,!0)}if("select"===(l=(s=r?co(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=jr;else if(Tr(s))if($r)g=Gr;else{g=qr;var y=Kr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=Qr);switch(g&&(g=g(e,r))?Ir(i,g,n,a):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&Ve(s,"number",s.value)),y=r?co(r):window,e){case"focusin":(Tr(y)||"true"===y.contentEditable)&&(oa=y,ia=r,sa=null);break;case"focusout":sa=ia=oa=null;break;case"mousedown":la=!0;break;case"contextmenu":case"mouseup":case"dragend":la=!1,ca(i,n,a);break;case"selectionchange":if(aa)break;case"keydown":case"keyup":ca(i,n,a)}var v;if(xr)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Pr?Nr(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(_r&&"ko"!==n.locale&&(Pr||"onCompositionStart"!==b?"onCompositionEnd"===b&&Pr&&(v=Wn()):(Bn="value"in(Un=a)?Un.value:Un.textContent,Pr=!0)),0<(y=Da(r,b)).length&&(b=new cr(b,e,null,n,a),i.push({event:b,listeners:y}),v?b.data=v:null!==(v=Ar(n))&&(b.data=v))),(v=Er?function(e,t){switch(e){case"compositionend":return Ar(t);case"keypress":return 32!==t.which?null:(Lr=!0,Mr);case"textInput":return(e=t.data)===Mr&&Lr?null:e;default:return null}}(e,n):function(e,t){if(Pr)return"compositionend"===e||!xr&&Nr(e,t)?(e=Wn(),Vn=Bn=Un=null,Pr=!1,e):null;switch(e){case"paste":default: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 _r&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Da(r,"onBeforeInput")).length&&(a=new cr("onBeforeInput","beforeinput",null,n,a),i.push({event:a,listeners:r}),a.data=v))}Ma(i,t)})}function Ia(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Da(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,o=a.stateNode;5===a.tag&&null!==o&&(a=o,null!=(o=St(e,n))&&r.unshift(Ia(e,o,a)),null!=(o=St(e,t))&&r.push(Ia(e,o,a))),e=e.return}return r}function za(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Fa(e,t,n,r,a){for(var o=t._reactName,i=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,a?null!=(l=St(n,o))&&i.unshift(Ia(n,l,s)):a||null!=(l=St(n,o))&&i.push(Ia(n,l,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Oa=/\r\n?/g,ja=/\u0000|\uFFFD/g;function $a(e){return("string"==typeof e?e:""+e).replace(Oa,"\n").replace(ja,"")}function Ua(e,t,n){if(t=$a(t),$a(e)!==t&&n)throw Error(Q(425))}function Ba(){}var Va=null,Wa=null;function Ha(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Ka="function"==typeof setTimeout?setTimeout:void 0,qa="function"==typeof clearTimeout?clearTimeout:void 0,Qa="function"==typeof Promise?Promise:void 0,Ga="function"==typeof queueMicrotask?queueMicrotask:void 0!==Qa?function(e){return Qa.resolve(null).then(e).catch(Ya)}:Ka;function Ya(e){setTimeout(function(){throw e})}function Xa(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0===r)return e.removeChild(a),void Rn(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=a}while(n);Rn(t)}function Ja(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function Za(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var eo=Math.random().toString(36).slice(2),to="__reactFiber$"+eo,no="__reactProps$"+eo,ro="__reactContainer$"+eo,ao="__reactEvents$"+eo,oo="__reactListeners$"+eo,io="__reactHandles$"+eo;function so(e){var t=e[to];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ro]||n[to]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Za(e);null!==e;){if(n=e[to])return n;e=Za(e)}return t}n=(e=n).parentNode}return null}function lo(e){return!(e=e[to]||e[ro])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function co(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Q(33))}function uo(e){return e[no]||null}var fo=[],ho=-1;function po(e){return{current:e}}function mo(e){0>ho||(e.current=fo[ho],fo[ho]=null,ho--)}function go(e,t){ho++,fo[ho]=e.current,e.current=t}var yo={},vo=po(yo),bo=po(!1),wo=yo;function So(e,t){var n=e.type.contextTypes;if(!n)return yo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,o={};for(a in n)o[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ko(e){return null!=(e=e.childContextTypes)}function xo(){mo(bo),mo(vo)}function Co(e,t,n){if(vo.current!==yo)throw Error(Q(168));go(vo,t),go(bo,n)}function Eo(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(Q(108,Re(e)||"Unknown",a));return _e({},n,r)}function _o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yo,wo=vo.current,go(vo,e),go(bo,bo.current),!0}function Mo(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=Eo(e,t,wo),r.__reactInternalMemoizedMergedChildContext=e,mo(bo),mo(vo),go(vo,e)):mo(bo),go(bo,n)}var Lo=null,No=!1,Ao=!1;function Po(e){null===Lo?Lo=[e]:Lo.push(e)}function Ro(){if(!Ao&&null!==Lo){Ao=!0;var e=0,t=cn;try{var n=Lo;for(cn=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Lo=null,No=!1}catch(t){throw null!==Lo&&(Lo=Lo.slice(e+1)),zt(Bt,Ro),t}finally{cn=t,Ao=!1}}return null}var To=[],Io=0,Do=null,zo=0,Fo=[],Oo=0,jo=null,$o=1,Uo="";function Bo(e,t){To[Io++]=zo,To[Io++]=Do,Do=e,zo=t}function Vo(e,t,n){Fo[Oo++]=$o,Fo[Oo++]=Uo,Fo[Oo++]=jo,jo=e;var r=$o;e=Uo;var a=32-Gt(r)-1;r&=~(1<<a),n+=1;var o=32-Gt(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,$o=1<<32-Gt(t)+a|n<<a|r,Uo=o+e}else $o=1<<o|n<<a|r,Uo=e}function Wo(e){null!==e.return&&(Bo(e,1),Vo(e,1,0))}function Ho(e){for(;e===Do;)Do=To[--Io],To[Io]=null,zo=To[--Io],To[Io]=null;for(;e===jo;)jo=Fo[--Oo],Fo[Oo]=null,Uo=Fo[--Oo],Fo[Oo]=null,$o=Fo[--Oo],Fo[Oo]=null}var Ko=null,qo=null,Qo=!1,Go=null;function Yo(e,t){var n=wu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function Xo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Ko=e,qo=Ja(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Ko=e,qo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==jo?{id:$o,overflow:Uo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=wu(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Ko=e,qo=null,!0);default:return!1}}function Jo(e){return!(!(1&e.mode)||128&e.flags)}function Zo(e){if(Qo){var t=qo;if(t){var n=t;if(!Xo(e,t)){if(Jo(e))throw Error(Q(418));t=Ja(n.nextSibling);var r=Ko;t&&Xo(e,t)?Yo(r,n):(e.flags=-4097&e.flags|2,Qo=!1,Ko=e)}}else{if(Jo(e))throw Error(Q(418));e.flags=-4097&e.flags|2,Qo=!1,Ko=e}}}function ei(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Ko=e}function ti(e){if(e!==Ko)return!1;if(!Qo)return ei(e),Qo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Ha(e.type,e.memoizedProps)),t&&(t=qo)){if(Jo(e))throw ni(),Error(Q(418));for(;t;)Yo(e,t),t=Ja(t.nextSibling)}if(ei(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){qo=Ja(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}qo=null}}else qo=Ko?Ja(e.stateNode.nextSibling):null;return!0}function ni(){for(var e=qo;e;)e=Ja(e.nextSibling)}function ri(){qo=Ko=null,Qo=!1}function ai(e){null===Go?Go=[e]:Go.push(e)}var oi=ce.ReactCurrentBatchConfig;function ii(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var a=r,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function si(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function li(e){return(0,e._init)(e._payload)}function ci(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=ku(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function i(t){return e&&null===t.alternate&&(t.flags|=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=_u(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function l(e,t,n,r){var o=n.type;return o===fe?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===Se&&li(o)===t.type)?((r=a(t,n.props)).ref=ii(e,t,n),r.return=e,r):((r=xu(n.type,n.key,n.props,null,e.mode,r)).ref=ii(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Mu(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function u(e,t,n,r,o){return null===t||7!==t.tag?((t=Cu(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=_u(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ue:return(n=xu(t.type,t.key,t.props,null,e.mode,n)).ref=ii(e,null,t),n.return=e,n;case de:return(t=Mu(t,e.mode,n)).return=e,t;case Se:return d(e,(0,t._init)(t._payload),n)}if(We(t)||Ce(t))return(t=Cu(t,e.mode,n,null)).return=e,t;si(e,t)}return null}function f(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==a?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ue:return n.key===a?l(e,t,n,r):null;case de:return n.key===a?c(e,t,n,r):null;case Se:return f(e,t,(a=n._init)(n._payload),r)}if(We(n)||Ce(n))return null!==a?null:u(e,t,n,r,null);si(e,n)}return null}function h(e,t,n,r,a){if("string"==typeof r&&""!==r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ue:return l(t,e=e.get(null===r.key?n:r.key)||null,r,a);case de:return c(t,e=e.get(null===r.key?n:r.key)||null,r,a);case Se:return h(e,t,n,(0,r._init)(r._payload),a)}if(We(r)||Ce(r))return u(t,e=e.get(n)||null,r,a,null);si(t,r)}return null}function p(a,i,s,l){for(var c=null,u=null,p=i,m=i=0,g=null;null!==p&&m<s.length;m++){p.index>m?(g=p,p=null):g=p.sibling;var y=f(a,p,s[m],l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(a,p),i=o(y,i,m),null===u?c=y:u.sibling=y,u=y,p=g}if(m===s.length)return n(a,p),Qo&&Bo(a,m),c;if(null===p){for(;m<s.length;m++)null!==(p=d(a,s[m],l))&&(i=o(p,i,m),null===u?c=p:u.sibling=p,u=p);return Qo&&Bo(a,m),c}for(p=r(a,p);m<s.length;m++)null!==(g=h(p,a,m,s[m],l))&&(e&&null!==g.alternate&&p.delete(null===g.key?m:g.key),i=o(g,i,m),null===u?c=g:u.sibling=g,u=g);return e&&p.forEach(function(e){return t(a,e)}),Qo&&Bo(a,m),c}function m(a,i,s,l){var c=Ce(s);if("function"!=typeof c)throw Error(Q(150));if(null==(s=c.call(s)))throw Error(Q(151));for(var u=c=null,p=i,m=i=0,g=null,y=s.next();null!==p&&!y.done;m++,y=s.next()){p.index>m?(g=p,p=null):g=p.sibling;var v=f(a,p,y.value,l);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(a,p),i=o(v,i,m),null===u?c=v:u.sibling=v,u=v,p=g}if(y.done)return n(a,p),Qo&&Bo(a,m),c;if(null===p){for(;!y.done;m++,y=s.next())null!==(y=d(a,y.value,l))&&(i=o(y,i,m),null===u?c=y:u.sibling=y,u=y);return Qo&&Bo(a,m),c}for(p=r(a,p);!y.done;m++,y=s.next())null!==(y=h(p,a,m,y.value,l))&&(e&&null!==y.alternate&&p.delete(null===y.key?m:y.key),i=o(y,i,m),null===u?c=y:u.sibling=y,u=y);return e&&p.forEach(function(e){return t(a,e)}),Qo&&Bo(a,m),c}return function e(r,o,s,l){if("object"==typeof s&&null!==s&&s.type===fe&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case ue:e:{for(var c=s.key,u=o;null!==u;){if(u.key===c){if((c=s.type)===fe){if(7===u.tag){n(r,u.sibling),(o=a(u,s.props.children)).return=r,r=o;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===Se&&li(c)===u.type){n(r,u.sibling),(o=a(u,s.props)).ref=ii(r,u,s),o.return=r,r=o;break e}n(r,u);break}t(r,u),u=u.sibling}s.type===fe?((o=Cu(s.props.children,r.mode,l,s.key)).return=r,r=o):((l=xu(s.type,s.key,s.props,null,r.mode,l)).ref=ii(r,o,s),l.return=r,r=l)}return i(r);case de:e:{for(u=s.key;null!==o;){if(o.key===u){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(r,o.sibling),(o=a(o,s.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Mu(s,r.mode,l)).return=r,r=o}return i(r);case Se:return e(r,o,(u=s._init)(s._payload),l)}if(We(s))return p(r,o,s,l);if(Ce(s))return m(r,o,s,l);si(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==o&&6===o.tag?(n(r,o.sibling),(o=a(o,s)).return=r,r=o):(n(r,o),(o=_u(s,r.mode,l)).return=r,r=o),i(r)):n(r,o)}}var ui=ci(!0),di=ci(!1),fi=po(null),hi=null,pi=null,mi=null;function gi(){mi=pi=hi=null}function yi(e){var t=fi.current;mo(fi),e._currentValue=t}function vi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bi(e,t){hi=e,mi=pi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ll=!0),e.firstContext=null)}function wi(e){var t=e._currentValue;if(mi!==e)if(e={context:e,memoizedValue:t,next:null},null===pi){if(null===hi)throw Error(Q(308));pi=e,hi.dependencies={lanes:0,firstContext:e}}else pi=pi.next=e;return t}var Si=null;function ki(e){null===Si?Si=[e]:Si.push(e)}function xi(e,t,n,r){var a=t.interleaved;return null===a?(n.next=n,ki(t)):(n.next=a.next,a.next=n),t.interleaved=n,Ci(e,r)}function Ci(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ei=!1;function _i(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Li(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ni(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&yc){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Ci(e,n)}return null===(a=r.interleaved)?(t.next=t,ki(r)):(t.next=a.next,a.next=t),r.interleaved=t,Ci(e,n)}function Ai(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,ln(e,n)}}function Pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?a=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?a=o=t:o=o.next=t}else a=o=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ri(e,t,n,r){var a=e.updateQueue;Ei=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,s=a.shared.pending;if(null!==s){a.shared.pending=null;var l=s,c=l.next;l.next=null,null===i?o=c:i.next=c,i=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==o){var d=a.baseState;for(i=0,u=c=l=null,s=o;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=m.payload)?p.call(h,d,f):p))break e;d=_e({},d,f);break e;case 2:Ei=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=a.effects)?a.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,i|=f;if(null===(s=s.next)){if(null===(s=a.shared.pending))break;s=(f=s).next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}if(null===u&&(l=d),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=u,null!==(t=a.shared.interleaved)){a=t;do{i|=a.lane,a=a.next}while(a!==t)}else null===o&&(a.shared.lanes=0);Ec|=i,e.lanes=i,e.memoizedState=d}}function Ti(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!=typeof a)throw Error(Q(191,a));a.call(r)}}}var Ii={},Di=po(Ii),zi=po(Ii),Fi=po(Ii);function Oi(e){if(e===Ii)throw Error(Q(174));return e}function ji(e,t){switch(go(Fi,t),go(zi,e),go(Di,Ii),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Xe(null,"");break;default:t=Xe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}mo(Di),go(Di,t)}function $i(){mo(Di),mo(zi),mo(Fi)}function Ui(e){Oi(Fi.current);var t=Oi(Di.current),n=Xe(t,e.type);t!==n&&(go(zi,e),go(Di,n))}function Bi(e){zi.current===e&&(mo(Di),mo(zi))}var Vi=po(0);function Wi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Hi=[];function Ki(){for(var e=0;e<Hi.length;e++)Hi[e]._workInProgressVersionPrimary=null;Hi.length=0}var qi=ce.ReactCurrentDispatcher,Qi=ce.ReactCurrentBatchConfig,Gi=0,Yi=null,Xi=null,Ji=null,Zi=!1,es=!1,ts=0,ns=0;function rs(){throw Error(Q(321))}function as(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function os(e,t,n,r,a,o){if(Gi=o,Yi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qi.current=null===e||null===e.memoizedState?Bs:Vs,e=n(r,a),es){o=0;do{if(es=!1,ts=0,25<=o)throw Error(Q(301));o+=1,Ji=Xi=null,t.updateQueue=null,qi.current=Ws,e=n(r,a)}while(es)}if(qi.current=Us,t=null!==Xi&&null!==Xi.next,Gi=0,Ji=Xi=Yi=null,Zi=!1,t)throw Error(Q(300));return e}function is(){var e=0!==ts;return ts=0,e}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ji?Yi.memoizedState=Ji=e:Ji=Ji.next=e,Ji}function ls(){if(null===Xi){var e=Yi.alternate;e=null!==e?e.memoizedState:null}else e=Xi.next;var t=null===Ji?Yi.memoizedState:Ji.next;if(null!==t)Ji=t,Xi=e;else{if(null===e)throw Error(Q(310));e={memoizedState:(Xi=e).memoizedState,baseState:Xi.baseState,baseQueue:Xi.baseQueue,queue:Xi.queue,next:null},null===Ji?Yi.memoizedState=Ji=e:Ji=Ji.next=e}return Ji}function cs(e,t){return"function"==typeof t?t(e):t}function us(e){var t=ls(),n=t.queue;if(null===n)throw Error(Q(311));n.lastRenderedReducer=e;var r=Xi,a=r.baseQueue,o=n.pending;if(null!==o){if(null!==a){var i=a.next;a.next=o.next,o.next=i}r.baseQueue=a=o,n.pending=null}if(null!==a){o=a.next,r=r.baseState;var s=i=null,l=null,c=o;do{var u=c.lane;if((Gi&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===l?(s=l=d,i=r):l=l.next=d,Yi.lanes|=u,Ec|=u}c=c.next}while(null!==c&&c!==o);null===l?i=r:l.next=s,Yr(r,t.memoizedState)||(ll=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){a=e;do{o=a.lane,Yi.lanes|=o,Ec|=o,a=a.next}while(a!==e)}else null===a&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ds(e){var t=ls(),n=t.queue;if(null===n)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var i=a=a.next;do{o=e(o,i.action),i=i.next}while(i!==a);Yr(o,t.memoizedState)||(ll=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(){}function hs(e,t){var n=Yi,r=ls(),a=t(),o=!Yr(r.memoizedState,a);if(o&&(r.memoizedState=a,ll=!0),r=r.queue,Es(gs.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==Ji&&1&Ji.memoizedState.tag){if(n.flags|=2048,ws(9,ms.bind(null,n,r,a,t),void 0,null),null===vc)throw Error(Q(349));30&Gi||ps(n,t,a)}return a}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Yi.updateQueue)?(t={lastEffect:null,stores:null},Yi.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&vs(e)}function gs(e,t,n){return n(function(){ys(t)&&vs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch(e){return!0}}function vs(e){var t=Ci(e,1);null!==t&&Hc(t,e,1,-1)}function bs(e){var t=ss();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t.queue=e,e=e.dispatch=Fs.bind(null,Yi,e),[t.memoizedState,e]}function ws(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Yi.updateQueue)?(t={lastEffect:null,stores:null},Yi.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ss(){return ls().memoizedState}function ks(e,t,n,r){var a=ss();Yi.flags|=e,a.memoizedState=ws(1|t,n,void 0,void 0===r?null:r)}function xs(e,t,n,r){var a=ls();r=void 0===r?null:r;var o=void 0;if(null!==Xi){var i=Xi.memoizedState;if(o=i.destroy,null!==r&&as(r,i.deps))return void(a.memoizedState=ws(t,n,o,r))}Yi.flags|=e,a.memoizedState=ws(1|t,n,o,r)}function Cs(e,t){return ks(8390656,8,e,t)}function Es(e,t){return xs(2048,8,e,t)}function _s(e,t){return xs(4,2,e,t)}function Ms(e,t){return xs(4,4,e,t)}function Ls(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ns(e,t,n){return n=null!=n?n.concat([e]):null,xs(4,4,Ls.bind(null,t,e),n)}function As(){}function Ps(e,t){var n=ls();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&as(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rs(e,t){var n=ls();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&as(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ts(e,t,n){return 21&Gi?(Yr(n,t)||(n=an(),Yi.lanes|=n,Ec|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ll=!0),e.memoizedState=n)}function Is(e,t){var n=cn;cn=0!==n&&4>n?n:4,e(!0);var r=Qi.transition;Qi.transition={};try{e(!1),t()}finally{cn=n,Qi.transition=r}}function Ds(){return ls().memoizedState}function zs(e,t,n){var r=Wc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e))js(t,n);else if(null!==(n=xi(e,t,n,r))){Hc(n,e,r,Vc()),$s(n,t,r)}}function Fs(e,t,n){var r=Wc(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))js(t,a);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=o(i,n);if(a.hasEagerState=!0,a.eagerState=s,Yr(s,i)){var l=t.interleaved;return null===l?(a.next=a,ki(t)):(a.next=l.next,l.next=a),void(t.interleaved=a)}}catch(e){}null!==(n=xi(e,t,a,r))&&(Hc(n,e,r,a=Vc()),$s(n,t,r))}}function Os(e){var t=e.alternate;return e===Yi||null!==t&&t===Yi}function js(e,t){es=Zi=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $s(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,ln(e,n)}}var Us={readContext:wi,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useInsertionEffect:rs,useLayoutEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useMutableSource:rs,useSyncExternalStore:rs,useId:rs,unstable_isNewReconciler:!1},Bs={readContext:wi,useCallback:function(e,t){return ss().memoizedState=[e,void 0===t?null:t],e},useContext:wi,useEffect:Cs,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ks(4194308,4,Ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return ks(4,2,e,t)},useMemo:function(e,t){var n=ss();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ss();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=zs.bind(null,Yi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ss().memoizedState=e},useState:bs,useDebugValue:As,useDeferredValue:function(e){return ss().memoizedState=e},useTransition:function(){var e=bs(!1),t=e[0];return e=Is.bind(null,e[1]),ss().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Yi,a=ss();if(Qo){if(void 0===n)throw Error(Q(407));n=n()}else{if(n=t(),null===vc)throw Error(Q(349));30&Gi||ps(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Cs(gs.bind(null,r,o,e),[e]),r.flags|=2048,ws(9,ms.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ss(),t=vc.identifierPrefix;if(Qo){var n=Uo;t=":"+t+"R"+(n=($o&~(1<<32-Gt($o)-1)).toString(32)+n),0<(n=ts++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ns++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vs={readContext:wi,useCallback:Ps,useContext:wi,useEffect:Es,useImperativeHandle:Ns,useInsertionEffect:_s,useLayoutEffect:Ms,useMemo:Rs,useReducer:us,useRef:Ss,useState:function(){return us(cs)},useDebugValue:As,useDeferredValue:function(e){return Ts(ls(),Xi.memoizedState,e)},useTransition:function(){return[us(cs)[0],ls().memoizedState]},useMutableSource:fs,useSyncExternalStore:hs,useId:Ds,unstable_isNewReconciler:!1},Ws={readContext:wi,useCallback:Ps,useContext:wi,useEffect:Es,useImperativeHandle:Ns,useInsertionEffect:_s,useLayoutEffect:Ms,useMemo:Rs,useReducer:ds,useRef:Ss,useState:function(){return ds(cs)},useDebugValue:As,useDeferredValue:function(e){var t=ls();return null===Xi?t.memoizedState=e:Ts(t,Xi.memoizedState,e)},useTransition:function(){return[ds(cs)[0],ls().memoizedState]},useMutableSource:fs,useSyncExternalStore:hs,useId:Ds,unstable_isNewReconciler:!1};function Hs(e,t){if(e&&e.defaultProps){for(var n in t=_e({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Ks(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:_e({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var qs={isMounted:function(e){return!!(e=e._reactInternals)&&Pt(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vc(),a=Wc(e),o=Li(r,a);o.payload=t,null!=n&&(o.callback=n),null!==(t=Ni(e,o,a))&&(Hc(t,e,a,r),Ai(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vc(),a=Wc(e),o=Li(r,a);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Ni(e,o,a))&&(Hc(t,e,a,r),Ai(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vc(),r=Wc(e),a=Li(n,r);a.tag=2,null!=t&&(a.callback=t),null!==(t=Ni(e,a,r))&&(Hc(t,e,r,n),Ai(t,e,r))}};function Qs(e,t,n,r,a,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!Xr(n,r)||!Xr(a,o))}function Gs(e,t,n){var r=!1,a=yo,o=t.contextType;return"object"==typeof o&&null!==o?o=wi(o):(a=ko(t)?wo:vo.current,o=(r=null!=(r=t.contextTypes))?So(e,a):yo),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=qs,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=o),t}function Ys(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&qs.enqueueReplaceState(t,t.state,null)}function Xs(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},_i(e);var o=t.contextType;"object"==typeof o&&null!==o?a.context=wi(o):(o=ko(t)?wo:vo.current,a.context=So(e,o)),a.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Ks(e,t,o,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&qs.enqueueReplaceState(a,a.state,null),Ri(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4194308)}function Js(e,t){try{var n="",r=t;do{n+=Ae(r),r=r.return}while(r);var a=n}catch(e){a="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:a,digest:null}}function Zs(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function el(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var tl="function"==typeof WeakMap?WeakMap:Map;function nl(e,t,n){(n=Li(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Tc||(Tc=!0,Ic=r),el(0,t)},n}function rl(e,t,n){(n=Li(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){el(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){el(0,t),"function"!=typeof r&&(null===Dc?Dc=new Set([this]):Dc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function al(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new tl;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=pu.bind(null,e,t,n),t.then(e,e))}function ol(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function il(e,t,n,r,a){return 1&e.mode?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Li(-1,1)).tag=2,Ni(n,t,1))),n.lanes|=1),e)}var sl=ce.ReactCurrentOwner,ll=!1;function cl(e,t,n,r){t.child=null===e?di(t,null,n,r):ui(t,e.child,n,r)}function ul(e,t,n,r,a){n=n.render;var o=t.ref;return bi(t,a),r=os(e,t,n,r,o,a),n=is(),null===e||ll?(Qo&&n&&Wo(t),t.flags|=1,cl(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Tl(e,t,a))}function dl(e,t,n,r,a){if(null===e){var o=n.type;return"function"!=typeof o||Su(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=xu(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,fl(e,t,o,r,a))}if(o=e.child,0===(e.lanes&a)){var i=o.memoizedProps;if((n=null!==(n=n.compare)?n:Xr)(i,r)&&e.ref===t.ref)return Tl(e,t,a)}return t.flags|=1,(e=ku(o,r)).ref=t.ref,e.return=t,t.child=e}function fl(e,t,n,r,a){if(null!==e){var o=e.memoizedProps;if(Xr(o,r)&&e.ref===t.ref){if(ll=!1,t.pendingProps=r=o,0===(e.lanes&a))return t.lanes=e.lanes,Tl(e,t,a);131072&e.flags&&(ll=!0)}}return ml(e,t,n,r,a)}function hl(e,t,n){var r=t.pendingProps,a=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,go(kc,Sc),Sc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,go(kc,Sc),Sc|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},go(kc,Sc),Sc|=n;else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,go(kc,Sc),Sc|=r;return cl(e,t,a,n),t.child}function pl(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ml(e,t,n,r,a){var o=ko(n)?wo:vo.current;return o=So(t,o),bi(t,a),n=os(e,t,n,r,o,a),r=is(),null===e||ll?(Qo&&r&&Wo(t),t.flags|=1,cl(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Tl(e,t,a))}function gl(e,t,n,r,a){if(ko(n)){var o=!0;_o(t)}else o=!1;if(bi(t,a),null===t.stateNode)Rl(e,t),Gs(t,n,r),Xs(t,n,r,a),r=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var l=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=wi(c):c=So(t,c=ko(n)?wo:vo.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==r||l!==c)&&Ys(t,i,r,c),Ei=!1;var f=t.memoizedState;i.state=f,Ri(t,r,i,a),l=t.memoizedState,s!==r||f!==l||bo.current||Ei?("function"==typeof u&&(Ks(t,n,u,r),l=t.memoizedState),(s=Ei||Qs(t,n,s,r,f,l,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=s):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Mi(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Hs(t.type,s),i.props=c,d=t.pendingProps,f=i.context,"object"==typeof(l=n.contextType)&&null!==l?l=wi(l):l=So(t,l=ko(n)?wo:vo.current);var h=n.getDerivedStateFromProps;(u="function"==typeof h||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==d||f!==l)&&Ys(t,i,r,l),Ei=!1,f=t.memoizedState,i.state=f,Ri(t,r,i,a);var p=t.memoizedState;s!==d||f!==p||bo.current||Ei?("function"==typeof h&&(Ks(t,n,h,r),p=t.memoizedState),(c=Ei||Qs(t,n,c,r,f,p,l)||!1)?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,p,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=l,r=c):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return yl(e,t,n,r,o,a)}function yl(e,t,n,r,a,o){pl(e,t);var i=!!(128&t.flags);if(!r&&!i)return a&&Mo(t,n,!1),Tl(e,t,o);r=t.stateNode,sl.current=t;var s=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=ui(t,e.child,null,o),t.child=ui(t,null,s,o)):cl(e,t,s,o),t.memoizedState=r.state,a&&Mo(t,n,!0),t.child}function vl(e){var t=e.stateNode;t.pendingContext?Co(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Co(0,t.context,!1),ji(e,t.containerInfo)}function bl(e,t,n,r,a){return ri(),ai(a),t.flags|=256,cl(e,t,n,r),t.child}var wl,Sl,kl,xl,Cl={dehydrated:null,treeContext:null,retryLane:0};function El(e){return{baseLanes:e,cachePool:null,transitions:null}}function _l(e,t,n){var r,a=t.pendingProps,o=Vi.current,i=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&o)),r?(i=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),go(Vi,1&o),null===e)return Zo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=a.children,e=a.fallback,i?(a=t.mode,i=t.child,s={mode:"hidden",children:s},1&a||null===i?i=Eu(s,a,0,null):(i.childLanes=0,i.pendingProps=s),e=Cu(e,a,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=El(n),t.memoizedState=Cl,e):Ml(t,s));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,a,o,i){if(n)return 256&t.flags?(t.flags&=-257,Ll(e,t,i,r=Zs(Error(Q(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,a=t.mode,r=Eu({mode:"visible",children:r.children},a,0,null),(o=Cu(o,a,i,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,1&t.mode&&ui(t,e.child,null,i),t.child.memoizedState=El(i),t.memoizedState=Cl,o);if(!(1&t.mode))return Ll(e,t,i,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var s=r.dgst;return r=s,Ll(e,t,i,r=Zs(o=Error(Q(419)),r,void 0))}if(s=0!==(i&e.childLanes),ll||s){if(null!==(r=vc)){switch(i&-i){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=0!==(a&(r.suspendedLanes|i))?0:a)&&a!==o.retryLane&&(o.retryLane=a,Ci(e,a),Hc(r,e,a,-1))}return au(),Ll(e,t,i,r=Zs(Error(Q(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=gu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,qo=Ja(a.nextSibling),Ko=t,Qo=!0,Go=null,null!==e&&(Fo[Oo++]=$o,Fo[Oo++]=Uo,Fo[Oo++]=jo,$o=e.id,Uo=e.overflow,jo=t),t=Ml(t,r.children),t.flags|=4096,t)}(e,t,s,a,r,o,n);if(i){i=a.fallback,s=t.mode,r=(o=e.child).sibling;var l={mode:"hidden",children:a.children};return 1&s||t.child===o?(a=ku(o,l)).subtreeFlags=14680064&o.subtreeFlags:((a=t.child).childLanes=0,a.pendingProps=l,t.deletions=null),null!==r?i=ku(r,i):(i=Cu(i,s,n,null)).flags|=2,i.return=t,a.return=t,a.sibling=i,t.child=a,a=i,i=t.child,s=null===(s=e.child.memoizedState)?El(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Cl,a}return e=(i=e.child).sibling,a=ku(i,{mode:"visible",children:a.children}),!(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Ml(e,t){return(t=Eu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ll(e,t,n,r){return null!==r&&ai(r),ui(t,e.child,null,n),(e=Ml(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Nl(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),vi(e.return,t,n)}function Al(e,t,n,r,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=a)}function Pl(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;if(cl(e,t,r.children,n),2&(r=Vi.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Nl(e,n,t);else if(19===e.tag)Nl(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(go(Vi,r),1&t.mode)switch(a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===Wi(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Al(t,!1,a,n,o);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===Wi(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Al(t,!0,n,null,o);break;case"together":Al(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Rl(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ec|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(Q(153));if(null!==t.child){for(n=ku(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ku(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Il(e,t){if(!Qo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Dl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zl(e,t,n){var r=t.pendingProps;switch(Ho(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dl(t),null;case 1:case 17:return ko(t.type)&&xo(),Dl(t),null;case 3:return r=t.stateNode,$i(),mo(bo),mo(vo),Ki(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ti(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==Go&&(Gc(Go),Go=null))),Sl(e,t),Dl(t),null;case 5:Bi(t);var a=Oi(Fi.current);if(n=t.type,null!==e&&null!=t.stateNode)kl(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(Q(166));return Dl(t),null}if(e=Oi(Di.current),ti(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[to]=t,r[no]=o,e=!!(1&t.mode),n){case"dialog":La("cancel",r),La("close",r);break;case"iframe":case"object":case"embed":La("load",r);break;case"video":case"audio":for(a=0;a<Ca.length;a++)La(Ca[a],r);break;case"source":La("error",r);break;case"img":case"image":case"link":La("error",r),La("load",r);break;case"details":La("toggle",r);break;case"input":je(r,o),La("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},La("invalid",r);break;case"textarea":qe(r,o),La("invalid",r)}for(var i in st(n,o),a=null,o)if(o.hasOwnProperty(i)){var s=o[i];"children"===i?"string"==typeof s?r.textContent!==s&&(!0!==o.suppressHydrationWarning&&Ua(r.textContent,s,e),a=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(!0!==o.suppressHydrationWarning&&Ua(r.textContent,s,e),a=["children",""+s]):Y.hasOwnProperty(i)&&null!=s&&"onScroll"===i&&La("scroll",r)}switch(n){case"input":De(r),Be(r,o,!0);break;case"textarea":De(r),Ge(r);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(r.onclick=Ba)}r=a,t.updateQueue=r,null!==r&&(t.flags|=4)}else{i=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=Ye(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),"select"===n&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[to]=t,e[no]=r,wl(e,t,!1,!1),t.stateNode=e;e:{switch(i=lt(n,r),n){case"dialog":La("cancel",e),La("close",e),a=r;break;case"iframe":case"object":case"embed":La("load",e),a=r;break;case"video":case"audio":for(a=0;a<Ca.length;a++)La(Ca[a],e);a=r;break;case"source":La("error",e),a=r;break;case"img":case"image":case"link":La("error",e),La("load",e),a=r;break;case"details":La("toggle",e),a=r;break;case"input":je(e,r),a=Oe(e,r),La("invalid",e);break;case"option":default:a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=_e({},r,{value:void 0}),La("invalid",e);break;case"textarea":qe(e,r),a=Ke(e,r),La("invalid",e)}for(o in st(n,a),s=a)if(s.hasOwnProperty(o)){var l=s[o];"style"===o?ot(e,l):"dangerouslySetInnerHTML"===o?null!=(l=l?l.__html:void 0)&&et(e,l):"children"===o?"string"==typeof l?("textarea"!==n||""!==l)&&tt(e,l):"number"==typeof l&&tt(e,""+l):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(Y.hasOwnProperty(o)?null!=l&&"onScroll"===o&&La("scroll",e):null!=l&&le(e,o,l,i))}switch(n){case"input":De(e),Be(e,r,!1);break;case"textarea":De(e),Ge(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Te(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?He(e,!!r.multiple,o,!1):null!=r.defaultValue&&He(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Ba)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Dl(t),null;case 6:if(e&&null!=t.stateNode)xl(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Q(166));if(n=Oi(Fi.current),Oi(Di.current),ti(t)){if(r=t.stateNode,n=t.memoizedProps,r[to]=t,(o=r.nodeValue!==n)&&null!==(e=Ko))switch(e.tag){case 3:Ua(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ua(r.nodeValue,n,!!(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[to]=t,t.stateNode=r}return Dl(t),null;case 13:if(mo(Vi),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Qo&&null!==qo&&1&t.mode&&!(128&t.flags))ni(),ri(),t.flags|=98560,o=!1;else if(o=ti(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(Q(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(Q(317));o[to]=t}else ri(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Dl(t),o=!1}else null!==Go&&(Gc(Go),Go=null),o=!0;if(!o)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Vi.current?0===xc&&(xc=3):au())),null!==t.updateQueue&&(t.flags|=4),Dl(t),null);case 4:return $i(),Sl(e,t),null===e&&Pa(t.stateNode.containerInfo),Dl(t),null;case 10:return yi(t.type._context),Dl(t),null;case 19:if(mo(Vi),null===(o=t.memoizedState))return Dl(t),null;if(r=!!(128&t.flags),null===(i=o.rendering))if(r)Il(o,!1);else{if(0!==xc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(i=Wi(e))){for(t.flags|=128,Il(o,!1),null!==(r=i.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(i=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return go(Vi,1&Vi.current|2),t.child}e=e.sibling}null!==o.tail&&$t()>Pc&&(t.flags|=128,r=!0,Il(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Wi(i))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Il(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate&&!Qo)return Dl(t),null}else 2*$t()-o.renderingStartTime>Pc&&1073741824!==n&&(t.flags|=128,r=!0,Il(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(null!==(n=o.last)?n.sibling=i:t.child=i,o.last=i)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=$t(),t.sibling=null,n=Vi.current,go(Vi,r?1&n|2:1&n),t):(Dl(t),null);case 22:case 23:return eu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Sc)&&(Dl(t),6&t.subtreeFlags&&(t.flags|=8192)):Dl(t),null;case 24:case 25:return null}throw Error(Q(156,t.tag))}function Fl(e,t){switch(Ho(t),t.tag){case 1:return ko(t.type)&&xo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return $i(),mo(bo),mo(vo),Ki(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Bi(t),null;case 13:if(mo(Vi),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(Q(340));ri()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return mo(Vi),null;case 4:return $i(),null;case 10:return yi(t.type._context),null;case 22:case 23:return eu(),null;default:return null}}wl=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Sl=function(){},kl=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Oi(Di.current);var o,i=null;switch(n){case"input":a=Oe(e,a),r=Oe(e,r),i=[];break;case"select":a=_e({},a,{value:void 0}),r=_e({},r,{value:void 0}),i=[];break;case"textarea":a=Ke(e,a),r=Ke(e,r),i=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Ba)}for(c in st(n,r),n=null,a)if(!r.hasOwnProperty(c)&&a.hasOwnProperty(c)&&null!=a[c])if("style"===c){var s=a[c];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Y.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(s=null!=a?a[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(null!=l||null!=s))if("style"===c)if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(i=i||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(i=i||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(Y.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&La("scroll",e),i||s===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}},xl=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ol=!1,jl=!1,$l="function"==typeof WeakSet?WeakSet:Set,Ul=null;function Bl(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){hu(e,t,n)}else n.current=null}function Vl(e,t,n){try{n()}catch(n){hu(e,t,n)}}var Wl=!1;function Hl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var o=a.destroy;a.destroy=void 0,void 0!==o&&Vl(t,n,o)}a=a.next}while(a!==r)}}function Kl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ql(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function Ql(e){var t=e.alternate;null!==t&&(e.alternate=null,Ql(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[to],delete t[no],delete t[ao],delete t[oo],delete t[io])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Gl(e){return 5===e.tag||3===e.tag||4===e.tag}function Yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Gl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Xl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ba));else if(4!==r&&null!==(e=e.child))for(Xl(e,t,n),e=e.sibling;null!==e;)Xl(e,t,n),e=e.sibling}function Jl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Jl(e,t,n),e=e.sibling;null!==e;)Jl(e,t,n),e=e.sibling}var Zl=null,ec=!1;function tc(e,t,n){for(n=n.child;null!==n;)nc(e,t,n),n=n.sibling}function nc(e,t,n){if(Qt&&"function"==typeof Qt.onCommitFiberUnmount)try{Qt.onCommitFiberUnmount(qt,n)}catch(e){}switch(n.tag){case 5:jl||Bl(n,t);case 6:var r=Zl,a=ec;Zl=null,tc(e,t,n),ec=a,null!==(Zl=r)&&(ec?(e=Zl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Zl.removeChild(n.stateNode));break;case 18:null!==Zl&&(ec?(e=Zl,n=n.stateNode,8===e.nodeType?Xa(e.parentNode,n):1===e.nodeType&&Xa(e,n),Rn(e)):Xa(Zl,n.stateNode));break;case 4:r=Zl,a=ec,Zl=n.stateNode.containerInfo,ec=!0,tc(e,t,n),Zl=r,ec=a;break;case 0:case 11:case 14:case 15:if(!jl&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){a=r=r.next;do{var o=a,i=o.destroy;o=o.tag,void 0!==i&&(2&o||4&o)&&Vl(n,t,i),a=a.next}while(a!==r)}tc(e,t,n);break;case 1:if(!jl&&(Bl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){hu(n,t,e)}tc(e,t,n);break;case 21:tc(e,t,n);break;case 22:1&n.mode?(jl=(r=jl)||null!==n.memoizedState,tc(e,t,n),jl=r):tc(e,t,n);break;default:tc(e,t,n)}}function rc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new $l),t.forEach(function(t){var r=yu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function ac(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r];try{var o=e,i=t,s=i;e:for(;null!==s;){switch(s.tag){case 5:Zl=s.stateNode,ec=!1;break e;case 3:case 4:Zl=s.stateNode.containerInfo,ec=!0;break e}s=s.return}if(null===Zl)throw Error(Q(160));nc(o,i,a),Zl=null,ec=!1;var l=a.alternate;null!==l&&(l.return=null),a.return=null}catch(e){hu(a,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)oc(t,e),t=t.sibling}function oc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ac(t,e),ic(e),4&r){try{Hl(3,e,e.return),Kl(3,e)}catch(t){hu(e,e.return,t)}try{Hl(5,e,e.return)}catch(t){hu(e,e.return,t)}}break;case 1:ac(t,e),ic(e),512&r&&null!==n&&Bl(n,n.return);break;case 5:if(ac(t,e),ic(e),512&r&&null!==n&&Bl(n,n.return),32&e.flags){var a=e.stateNode;try{tt(a,"")}catch(t){hu(e,e.return,t)}}if(4&r&&null!=(a=e.stateNode)){var o=e.memoizedProps,i=null!==n?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===s&&"radio"===o.type&&null!=o.name&&$e(a,o),lt(s,i);var c=lt(s,o);for(i=0;i<l.length;i+=2){var u=l[i],d=l[i+1];"style"===u?ot(a,d):"dangerouslySetInnerHTML"===u?et(a,d):"children"===u?tt(a,d):le(a,u,d,c)}switch(s){case"input":Ue(a,o);break;case"textarea":Qe(a,o);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var h=o.value;null!=h?He(a,!!o.multiple,h,!1):f!==!!o.multiple&&(null!=o.defaultValue?He(a,!!o.multiple,o.defaultValue,!0):He(a,!!o.multiple,o.multiple?[]:"",!1))}a[no]=o}catch(t){hu(e,e.return,t)}}break;case 6:if(ac(t,e),ic(e),4&r){if(null===e.stateNode)throw Error(Q(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){hu(e,e.return,t)}}break;case 3:if(ac(t,e),ic(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Rn(t.containerInfo)}catch(t){hu(e,e.return,t)}break;case 4:default:ac(t,e),ic(e);break;case 13:ac(t,e),ic(e),8192&(a=e.child).flags&&(o=null!==a.memoizedState,a.stateNode.isHidden=o,!o||null!==a.alternate&&null!==a.alternate.memoizedState||(Ac=$t())),4&r&&rc(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(jl=(c=jl)||u,ac(t,e),jl=c):ac(t,e),ic(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!u&&1&e.mode)for(Ul=e,u=e.child;null!==u;){for(d=Ul=u;null!==Ul;){switch(h=(f=Ul).child,f.tag){case 0:case 11:case 14:case 15:Hl(4,f,f.return);break;case 1:Bl(f,f.return);var p=f.stateNode;if("function"==typeof p.componentWillUnmount){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(e){hu(r,n,e)}}break;case 5:Bl(f,f.return);break;case 22:if(null!==f.memoizedState){uc(d);continue}}null!==h?(h.return=f,Ul=h):uc(d)}u=u.sibling}e:for(u=null,d=e;;){if(5===d.tag){if(null===u){u=d;try{a=d.stateNode,c?"function"==typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none":(s=d.stateNode,i=null!=(l=d.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,s.style.display=at("display",i))}catch(t){hu(e,e.return,t)}}}else if(6===d.tag){if(null===u)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(t){hu(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ac(t,e),ic(e),4&r&&rc(e);case 21:}}function ic(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(Gl(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var a=r.stateNode;32&r.flags&&(tt(a,""),r.flags&=-33),Jl(e,Yl(e),a);break;case 3:case 4:var o=r.stateNode.containerInfo;Xl(e,Yl(e),o);break;default:throw Error(Q(161))}}catch(t){hu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function sc(e,t,n){Ul=e,lc(e)}function lc(e,t,n){for(var r=!!(1&e.mode);null!==Ul;){var a=Ul,o=a.child;if(22===a.tag&&r){var i=null!==a.memoizedState||Ol;if(!i){var s=a.alternate,l=null!==s&&null!==s.memoizedState||jl;s=Ol;var c=jl;if(Ol=i,(jl=l)&&!c)for(Ul=a;null!==Ul;)l=(i=Ul).child,22===i.tag&&null!==i.memoizedState?dc(a):null!==l?(l.return=i,Ul=l):dc(a);for(;null!==o;)Ul=o,lc(o),o=o.sibling;Ul=a,Ol=s,jl=c}cc(e)}else 8772&a.subtreeFlags&&null!==o?(o.return=a,Ul=o):cc(e)}}function cc(e){for(;null!==Ul;){var t=Ul;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:jl||Kl(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!jl)if(null===n)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Hs(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&Ti(t,o,r);break;case 3:var i=t.updateQueue;if(null!==i){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ti(t,i,n)}break;case 5:var s=t.stateNode;if(null===n&&4&t.flags){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var d=u.dehydrated;null!==d&&Rn(d)}}}break;default:throw Error(Q(163))}jl||512&t.flags&&ql(t)}catch(e){hu(t,t.return,e)}}if(t===e){Ul=null;break}if(null!==(n=t.sibling)){n.return=t.return,Ul=n;break}Ul=t.return}}function uc(e){for(;null!==Ul;){var t=Ul;if(t===e){Ul=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ul=n;break}Ul=t.return}}function dc(e){for(;null!==Ul;){var t=Ul;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Kl(4,t)}catch(e){hu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var a=t.return;try{r.componentDidMount()}catch(e){hu(t,a,e)}}var o=t.return;try{ql(t)}catch(e){hu(t,o,e)}break;case 5:var i=t.return;try{ql(t)}catch(e){hu(t,i,e)}}}catch(e){hu(t,t.return,e)}if(t===e){Ul=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Ul=s;break}Ul=t.return}}var fc,hc=Math.ceil,pc=ce.ReactCurrentDispatcher,mc=ce.ReactCurrentOwner,gc=ce.ReactCurrentBatchConfig,yc=0,vc=null,bc=null,wc=0,Sc=0,kc=po(0),xc=0,Cc=null,Ec=0,_c=0,Mc=0,Lc=null,Nc=null,Ac=0,Pc=1/0,Rc=null,Tc=!1,Ic=null,Dc=null,zc=!1,Fc=null,Oc=0,jc=0,$c=null,Uc=-1,Bc=0;function Vc(){return 6&yc?$t():-1!==Uc?Uc:Uc=$t()}function Wc(e){return 1&e.mode?2&yc&&0!==wc?wc&-wc:null!==oi.transition?(0===Bc&&(Bc=an()),Bc):0!==(e=cn)?e:e=void 0===(e=window.event)?16:$n(e.type):1}function Hc(e,t,n,r){if(50<jc)throw jc=0,$c=null,Error(Q(185));sn(e,n,r),2&yc&&e===vc||(e===vc&&(!(2&yc)&&(_c|=n),4===xc&&Yc(e,wc)),Kc(e,r),1===n&&0===yc&&!(1&t.mode)&&(Pc=$t()+500,No&&Ro()))}function Kc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Gt(o),s=1<<i,l=a[i];-1===l?0!==(s&n)&&0===(s&r)||(a[i]=nn(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}(e,t);var r=tn(e,e===vc?wc:0);if(0===r)null!==n&&Ft(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ft(n),1===t)0===e.tag?function(e){No=!0,Po(e)}(Xc.bind(null,e)):Po(Xc.bind(null,e)),Ga(function(){!(6&yc)&&Ro()}),n=null;else{switch(un(r)){case 1:n=Bt;break;case 4:n=Vt;break;case 16:default:n=Wt;break;case 536870912:n=Kt}n=vu(n,qc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function qc(e,t){if(Uc=-1,Bc=0,6&yc)throw Error(Q(327));var n=e.callbackNode;if(du()&&e.callbackNode!==n)return null;var r=tn(e,e===vc?wc:0);if(0===r)return null;if(30&r||0!==(r&e.expiredLanes)||t)t=ou(e,r);else{t=r;var a=yc;yc|=2;var o=ru();for(vc===e&&wc===t||(Rc=null,Pc=$t()+500,tu(e,t));;)try{su();break}catch(t){nu(e,t)}gi(),pc.current=o,yc=a,null!==bc?t=0:(vc=null,wc=0,t=xc)}if(0!==t){if(2===t&&(0!==(a=rn(e))&&(r=a,t=Qc(e,a))),1===t)throw n=Cc,tu(e,0),Yc(e,r),Kc(e,$t()),n;if(6===t)Yc(e,r);else{if(a=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!Yr(o(),a))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)||(t=ou(e,r),2===t&&(o=rn(e),0!==o&&(r=o,t=Qc(e,o))),1!==t)))throw n=Cc,tu(e,0),Yc(e,r),Kc(e,$t()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:case 5:uu(e,Nc,Rc);break;case 3:if(Yc(e,r),(130023424&r)===r&&10<(t=Ac+500-$t())){if(0!==tn(e,0))break;if(((a=e.suspendedLanes)&r)!==r){Vc(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ka(uu.bind(null,e,Nc,Rc),t);break}uu(e,Nc,Rc);break;case 4:if(Yc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,a=-1;0<r;){var i=31-Gt(r);o=1<<i,(i=t[i])>a&&(a=i),r&=~o}if(r=a,10<(r=(120>(r=$t()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hc(r/1960))-r)){e.timeoutHandle=Ka(uu.bind(null,e,Nc,Rc),r);break}uu(e,Nc,Rc);break;default:throw Error(Q(329))}}}return Kc(e,$t()),e.callbackNode===n?qc.bind(null,e):null}function Qc(e,t){var n=Lc;return e.current.memoizedState.isDehydrated&&(tu(e,t).flags|=256),2!==(e=ou(e,t))&&(t=Nc,Nc=n,null!==t&&Gc(t)),e}function Gc(e){null===Nc?Nc=e:Nc.push.apply(Nc,e)}function Yc(e,t){for(t&=~Mc,t&=~_c,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Gt(t),r=1<<n;e[n]=-1,t&=~r}}function Xc(e){if(6&yc)throw Error(Q(327));du();var t=tn(e,0);if(!(1&t))return Kc(e,$t()),null;var n=ou(e,t);if(0!==e.tag&&2===n){var r=rn(e);0!==r&&(t=r,n=Qc(e,r))}if(1===n)throw n=Cc,tu(e,0),Yc(e,t),Kc(e,$t()),n;if(6===n)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,uu(e,Nc,Rc),Kc(e,$t()),null}function Jc(e,t){var n=yc;yc|=1;try{return e(t)}finally{0===(yc=n)&&(Pc=$t()+500,No&&Ro())}}function Zc(e){null!==Fc&&0===Fc.tag&&!(6&yc)&&du();var t=yc;yc|=1;var n=gc.transition,r=cn;try{if(gc.transition=null,cn=1,e)return e()}finally{cn=r,gc.transition=n,!(6&(yc=t))&&Ro()}}function eu(){Sc=kc.current,mo(kc)}function tu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qa(n)),null!==bc)for(n=bc.return;null!==n;){var r=n;switch(Ho(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&xo();break;case 3:$i(),mo(bo),mo(vo),Ki();break;case 5:Bi(r);break;case 4:$i();break;case 13:case 19:mo(Vi);break;case 10:yi(r.type._context);break;case 22:case 23:eu()}n=n.return}if(vc=e,bc=e=ku(e.current,null),wc=Sc=t,xc=0,Cc=null,Mc=_c=Ec=0,Nc=Lc=null,null!==Si){for(t=0;t<Si.length;t++)if(null!==(r=(n=Si[t]).interleaved)){n.interleaved=null;var a=r.next,o=n.pending;if(null!==o){var i=o.next;o.next=a,r.next=i}n.pending=r}Si=null}return e}function nu(e,t){for(;;){var n=bc;try{if(gi(),qi.current=Us,Zi){for(var r=Yi.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}Zi=!1}if(Gi=0,Ji=Xi=Yi=null,es=!1,ts=0,mc.current=null,null===n||null===n.return){xc=1,Cc=t,bc=null;break}e:{var o=e,i=n.return,s=n,l=t;if(t=wc,s.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l,u=s,d=u.tag;if(!(1&u.mode||0!==d&&11!==d&&15!==d)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=ol(i);if(null!==h){h.flags&=-257,il(h,i,s,0,t),1&h.mode&&al(o,c,t),l=c;var p=(t=h).updateQueue;if(null===p){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}if(!(1&t)){al(o,c,t),au();break e}l=Error(Q(426))}else if(Qo&&1&s.mode){var g=ol(i);if(null!==g){!(65536&g.flags)&&(g.flags|=256),il(g,i,s,0,t),ai(Js(l,s));break e}}o=l=Js(l,s),4!==xc&&(xc=2),null===Lc?Lc=[o]:Lc.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Pi(o,nl(0,l,t));break e;case 1:s=l;var y=o.type,v=o.stateNode;if(!(128&o.flags||"function"!=typeof y.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==Dc&&Dc.has(v)))){o.flags|=65536,t&=-t,o.lanes|=t,Pi(o,rl(o,s,t));break e}}o=o.return}while(null!==o)}cu(n)}catch(e){t=e,bc===n&&null!==n&&(bc=n=n.return);continue}break}}function ru(){var e=pc.current;return pc.current=Us,null===e?Us:e}function au(){0!==xc&&3!==xc&&2!==xc||(xc=4),null===vc||!(268435455&Ec)&&!(268435455&_c)||Yc(vc,wc)}function ou(e,t){var n=yc;yc|=2;var r=ru();for(vc===e&&wc===t||(Rc=null,tu(e,t));;)try{iu();break}catch(t){nu(e,t)}if(gi(),yc=n,pc.current=r,null!==bc)throw Error(Q(261));return vc=null,wc=0,xc}function iu(){for(;null!==bc;)lu(bc)}function su(){for(;null!==bc&&!Ot();)lu(bc)}function lu(e){var t=fc(e.alternate,e,Sc);e.memoizedProps=e.pendingProps,null===t?cu(e):bc=t,mc.current=null}function cu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Fl(n,t)))return n.flags&=32767,void(bc=n);if(null===e)return xc=6,void(bc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=zl(n,t,Sc)))return void(bc=n);if(null!==(t=t.sibling))return void(bc=t);bc=t=e}while(null!==t);0===xc&&(xc=5)}function uu(e,t,n){var r=cn,a=gc.transition;try{gc.transition=null,cn=1,function(e,t,n,r){do{du()}while(null!==Fc);if(6&yc)throw Error(Q(327));n=e.finishedWork;var a=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Gt(n),o=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~o}}(e,o),e===vc&&(bc=vc=null,wc=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||zc||(zc=!0,vu(Wt,function(){return du(),null})),o=!!(15990&n.flags),!!(15990&n.subtreeFlags)||o){o=gc.transition,gc.transition=null;var i=cn;cn=1;var s=yc;yc|=4,mc.current=null,function(e,t){if(Va=In,na(e=ta())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var i=0,s=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||0!==a&&3!==d.nodeType||(s=i+a),d!==o||0!==r&&3!==d.nodeType||(l=i+r),3===d.nodeType&&(i+=d.nodeValue.length),null!==(h=d.firstChild);)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++c===a&&(s=i),f===o&&++u===r&&(l=i),null!==(h=d.nextSibling))break;f=(d=f).parentNode}d=h}n=-1===s||-1===l?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wa={focusedElem:e,selectionRange:n},In=!1,Ul=t;null!==Ul;)if(e=(t=Ul).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ul=e;else for(;null!==Ul;){t=Ul;try{var p=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==p){var m=p.memoizedProps,g=p.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Hs(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(Q(163))}}catch(e){hu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ul=e;break}Ul=t.return}p=Wl,Wl=!1}(e,n),oc(n,e),ra(Wa),In=!!Va,Wa=Va=null,e.current=n,sc(n),jt(),yc=s,cn=i,gc.transition=o}else e.current=n;if(zc&&(zc=!1,Fc=e,Oc=a),o=e.pendingLanes,0===o&&(Dc=null),function(e){if(Qt&&"function"==typeof Qt.onCommitFiberRoot)try{Qt.onCommitFiberRoot(qt,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),Kc(e,$t()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Tc)throw Tc=!1,e=Ic,Ic=null,e;!!(1&Oc)&&0!==e.tag&&du(),o=e.pendingLanes,1&o?e===$c?jc++:(jc=0,$c=e):jc=0,Ro()}(e,t,n,r)}finally{gc.transition=a,cn=r}return null}function du(){if(null!==Fc){var e=un(Oc),t=gc.transition,n=cn;try{if(gc.transition=null,cn=16>e?16:e,null===Fc)var r=!1;else{if(e=Fc,Fc=null,Oc=0,6&yc)throw Error(Q(331));var a=yc;for(yc|=4,Ul=e.current;null!==Ul;){var o=Ul,i=o.child;if(16&Ul.flags){var s=o.deletions;if(null!==s){for(var l=0;l<s.length;l++){var c=s[l];for(Ul=c;null!==Ul;){var u=Ul;switch(u.tag){case 0:case 11:case 15:Hl(8,u,o)}var d=u.child;if(null!==d)d.return=u,Ul=d;else for(;null!==Ul;){var f=(u=Ul).sibling,h=u.return;if(Ql(u),u===c){Ul=null;break}if(null!==f){f.return=h,Ul=f;break}Ul=h}}}var p=o.alternate;if(null!==p){var m=p.child;if(null!==m){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}Ul=o}}if(2064&o.subtreeFlags&&null!==i)i.return=o,Ul=i;else e:for(;null!==Ul;){if(2048&(o=Ul).flags)switch(o.tag){case 0:case 11:case 15:Hl(9,o,o.return)}var y=o.sibling;if(null!==y){y.return=o.return,Ul=y;break e}Ul=o.return}}var v=e.current;for(Ul=v;null!==Ul;){var b=(i=Ul).child;if(2064&i.subtreeFlags&&null!==b)b.return=i,Ul=b;else e:for(i=v;null!==Ul;){if(2048&(s=Ul).flags)try{switch(s.tag){case 0:case 11:case 15:Kl(9,s)}}catch(e){hu(s,s.return,e)}if(s===i){Ul=null;break e}var w=s.sibling;if(null!==w){w.return=s.return,Ul=w;break e}Ul=s.return}}if(yc=a,Ro(),Qt&&"function"==typeof Qt.onPostCommitFiberRoot)try{Qt.onPostCommitFiberRoot(qt,e)}catch(e){}r=!0}return r}finally{cn=n,gc.transition=t}}return!1}function fu(e,t,n){e=Ni(e,t=nl(0,t=Js(n,t),1),1),t=Vc(),null!==e&&(sn(e,1,t),Kc(e,t))}function hu(e,t,n){if(3===e.tag)fu(e,e,n);else for(;null!==t;){if(3===t.tag){fu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Dc||!Dc.has(r))){t=Ni(t,e=rl(t,e=Js(n,e),1),1),e=Vc(),null!==t&&(sn(t,1,e),Kc(t,e));break}}t=t.return}}function pu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Vc(),e.pingedLanes|=e.suspendedLanes&n,vc===e&&(wc&n)===n&&(4===xc||3===xc&&(130023424&wc)===wc&&500>$t()-Ac?tu(e,0):Mc|=n),Kc(e,t)}function mu(e,t){0===t&&(1&e.mode?(t=Zt,!(130023424&(Zt<<=1))&&(Zt=4194304)):t=1);var n=Vc();null!==(e=Ci(e,t))&&(sn(e,t,n),Kc(e,n))}function gu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),mu(e,n)}function yu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}null!==r&&r.delete(t),mu(e,n)}function vu(e,t){return zt(e,t)}function bu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wu(e,t,n,r){return new bu(e,t,n,r)}function Su(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ku(e,t){var n=e.alternate;return null===n?((n=wu(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xu(e,t,n,r,a,o){var i=2;if(r=e,"function"==typeof e)Su(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case fe:return Cu(n.children,a,o,t);case he:i=8,a|=8;break;case pe:return(e=wu(12,n,t,2|a)).elementType=pe,e.lanes=o,e;case ve:return(e=wu(13,n,t,a)).elementType=ve,e.lanes=o,e;case be:return(e=wu(19,n,t,a)).elementType=be,e.lanes=o,e;case ke:return Eu(n,a,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case me:i=10;break e;case ge:i=9;break e;case ye:i=11;break e;case we:i=14;break e;case Se:i=16,r=null;break e}throw Error(Q(130,null==e?e:typeof e,""))}return(t=wu(i,n,t,a)).elementType=e,t.type=r,t.lanes=o,t}function Cu(e,t,n,r){return(e=wu(7,e,r,t)).lanes=n,e}function Eu(e,t,n,r){return(e=wu(22,e,r,t)).elementType=ke,e.lanes=n,e.stateNode={isHidden:!1},e}function _u(e,t,n){return(e=wu(6,e,null,t)).lanes=n,e}function Mu(e,t,n){return(t=wu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lu(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=on(0),this.expirationTimes=on(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Nu(e,t,n,r,a,o,i,s,l){return e=new Lu(e,t,n,s,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=wu(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_i(o),e}function Au(e){if(!e)return yo;e:{if(Pt(e=e._reactInternals)!==e||1!==e.tag)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ko(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(Q(171))}if(1===e.tag){var n=e.type;if(ko(n))return Eo(e,n,t)}return t}function Pu(e,t,n,r,a,o,i,s,l){return(e=Nu(n,r,!0,e,0,o,0,s,l)).context=Au(null),n=e.current,(o=Li(r=Vc(),a=Wc(n))).callback=null!=t?t:null,Ni(n,o,a),e.current.lanes=a,sn(e,a,r),Kc(e,r),e}function Ru(e,t,n,r){var a=t.current,o=Vc(),i=Wc(a);return n=Au(n),null===t.context?t.context=n:t.pendingContext=n,(t=Li(o,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ni(a,t,i))&&(Hc(e,a,i,o),Ai(e,a,i)),i}function Tu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Iu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Du(e,t){Iu(e,t),(e=e.alternate)&&Iu(e,t)}fc=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||bo.current)ll=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return ll=!1,function(e,t,n){switch(t.tag){case 3:vl(t),ri();break;case 5:Ui(t);break;case 1:ko(t.type)&&_o(t);break;case 4:ji(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;go(fi,r._currentValue),r._currentValue=a;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(go(Vi,1&Vi.current),t.flags|=128,null):0!==(n&t.child.childLanes)?_l(e,t,n):(go(Vi,1&Vi.current),null!==(e=Tl(e,t,n))?e.sibling:null);go(Vi,1&Vi.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Pl(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),go(Vi,Vi.current),r)break;return null;case 22:case 23:return t.lanes=0,hl(e,t,n)}return Tl(e,t,n)}(e,t,n);ll=!!(131072&e.flags)}else ll=!1,Qo&&1048576&t.flags&&Vo(t,zo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rl(e,t),e=t.pendingProps;var a=So(t,vo.current);bi(t,n),a=os(null,t,r,e,a,n);var o=is();return t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ko(r)?(o=!0,_o(t)):o=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,_i(t),a.updater=qs,t.stateNode=a,a._reactInternals=t,Xs(t,r,e,n),t=yl(null,t,r,!0,o,n)):(t.tag=0,Qo&&o&&Wo(t),cl(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rl(e,t),e=t.pendingProps,r=(a=r._init)(r._payload),t.type=r,a=t.tag=function(e){if("function"==typeof e)return Su(e)?1:0;if(null!=e){if((e=e.$$typeof)===ye)return 11;if(e===we)return 14}return 2}(r),e=Hs(r,e),a){case 0:t=ml(null,t,r,e,n);break e;case 1:t=gl(null,t,r,e,n);break e;case 11:t=ul(null,t,r,e,n);break e;case 14:t=dl(null,t,r,Hs(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,ml(e,t,r,a=t.elementType===r?a:Hs(r,a),n);case 1:return r=t.type,a=t.pendingProps,gl(e,t,r,a=t.elementType===r?a:Hs(r,a),n);case 3:e:{if(vl(t),null===e)throw Error(Q(387));r=t.pendingProps,a=(o=t.memoizedState).element,Mi(e,t),Ri(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=bl(e,t,r,n,a=Js(Error(Q(423)),t));break e}if(r!==a){t=bl(e,t,r,n,a=Js(Error(Q(424)),t));break e}for(qo=Ja(t.stateNode.containerInfo.firstChild),Ko=t,Qo=!0,Go=null,n=di(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ri(),r===a){t=Tl(e,t,n);break e}cl(e,t,r,n)}t=t.child}return t;case 5:return Ui(t),null===e&&Zo(t),r=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,i=a.children,Ha(r,a)?i=null:null!==o&&Ha(r,o)&&(t.flags|=32),pl(e,t),cl(e,t,i,n),t.child;case 6:return null===e&&Zo(t),null;case 13:return _l(e,t,n);case 4:return ji(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ui(t,null,r,n):cl(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,ul(e,t,r,a=t.elementType===r?a:Hs(r,a),n);case 7:return cl(e,t,t.pendingProps,n),t.child;case 8:case 12:return cl(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,i=a.value,go(fi,r._currentValue),r._currentValue=i,null!==o)if(Yr(o.value,i)){if(o.children===a.children&&!bo.current){t=Tl(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var s=o.dependencies;if(null!==s){i=o.child;for(var l=s.firstContext;null!==l;){if(l.context===r){if(1===o.tag){(l=Li(-1,n&-n)).tag=2;var c=o.updateQueue;if(null!==c){var u=(c=c.shared).pending;null===u?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),vi(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(10===o.tag)i=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(i=o.return))throw Error(Q(341));i.lanes|=n,null!==(s=i.alternate)&&(s.lanes|=n),vi(i,n,t),i=o.sibling}else i=o.child;if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===t){i=null;break}if(null!==(o=i.sibling)){o.return=i.return,i=o;break}i=i.return}o=i}cl(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,bi(t,n),r=r(a=wi(a)),t.flags|=1,cl(e,t,r,n),t.child;case 14:return a=Hs(r=t.type,t.pendingProps),dl(e,t,r,a=Hs(r.type,a),n);case 15:return fl(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Hs(r,a),Rl(e,t),t.tag=1,ko(r)?(e=!0,_o(t)):e=!1,bi(t,n),Gs(t,r,a),Xs(t,r,a,n),yl(null,t,r,!0,e,n);case 19:return Pl(e,t,n);case 22:return hl(e,t,n)}throw Error(Q(156,t.tag))};var zu="function"==typeof reportError?reportError:function(e){console.error(e)};function Fu(e){this._internalRoot=e}function Ou(e){this._internalRoot=e}function ju(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function $u(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Uu(){}function Bu(e,t,n,r,a){var o=n._reactRootContainer;if(o){var i=o;if("function"==typeof a){var s=a;a=function(){var e=Tu(i);s.call(e)}}Ru(t,i,e,a)}else i=function(e,t,n,r,a){if(a){if("function"==typeof r){var o=r;r=function(){var e=Tu(i);o.call(e)}}var i=Pu(t,r,e,0,null,!1,0,"",Uu);return e._reactRootContainer=i,e[ro]=i.current,Pa(8===e.nodeType?e.parentNode:e),Zc(),i}for(;a=e.lastChild;)e.removeChild(a);if("function"==typeof r){var s=r;r=function(){var e=Tu(l);s.call(e)}}var l=Nu(e,0,!1,null,0,!1,0,"",Uu);return e._reactRootContainer=l,e[ro]=l.current,Pa(8===e.nodeType?e.parentNode:e),Zc(function(){Ru(t,l,n,r)}),l}(n,t,e,a,r);return Tu(i)}Ou.prototype.render=Fu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(Q(409));Ru(e,t,null,null)},Ou.prototype.unmount=Fu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zc(function(){Ru(null,e,null,null)}),t[ro]=null}},Ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=pn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xn.length&&0!==t&&t<xn[n].priority;n++);xn.splice(n,0,e),0===n&&Mn(e)}},dn=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=en(t.pendingLanes);0!==n&&(ln(t,1|n),Kc(t,$t()),!(6&yc)&&(Pc=$t()+500,Ro()))}break;case 13:Zc(function(){var t=Ci(e,1);if(null!==t){var n=Vc();Hc(t,e,1,n)}}),Du(e,1)}},fn=function(e){if(13===e.tag){var t=Ci(e,134217728);if(null!==t)Hc(t,e,134217728,Vc());Du(e,134217728)}},hn=function(e){if(13===e.tag){var t=Wc(e),n=Ci(e,t);if(null!==n)Hc(n,e,t,Vc());Du(e,t)}},pn=function(){return cn},mn=function(e,t){var n=cn;try{return cn=e,t()}finally{cn=n}},dt=function(e,t,n){switch(t){case"input":if(Ue(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=uo(r);if(!a)throw Error(Q(90));ze(r),Ue(r,a)}}}break;case"textarea":Qe(e,n);break;case"select":null!=(t=n.value)&&He(e,!!n.multiple,t,!1)}},yt=Jc,vt=Zc;var Vu={usingClientEntryPoint:!1,Events:[lo,co,uo,mt,gt,Jc]},Wu={findFiberByHostInstance:so,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hu={bundleType:Wu.bundleType,version:Wu.version,rendererPackageName:Wu.rendererPackageName,rendererConfig:Wu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ce.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=It(e))?null:e.stateNode},findFiberByHostInstance:Wu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ku.isDisabled&&Ku.supportsFiber)try{qt=Ku.inject(Hu),Qt=Ku}catch(Ze){}}B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vu,B.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ju(t))throw Error(Q(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:de,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},B.createRoot=function(e,t){if(!ju(e))throw Error(Q(299));var n=!1,r="",a=zu;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=Nu(e,1,!1,null,0,n,0,r,a),e[ro]=t.current,Pa(8===e.nodeType?e.parentNode:e),new Fu(t)},B.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(Q(188));throw e=Object.keys(e).join(","),Error(Q(268,e))}return e=null===(e=It(t))?null:e.stateNode},B.flushSync=function(e){return Zc(e)},B.hydrate=function(e,t,n){if(!$u(t))throw Error(Q(200));return Bu(null,e,t,!0,n)},B.hydrateRoot=function(e,t,n){if(!ju(e))throw Error(Q(405));var r=null!=n&&n.hydratedSources||null,a=!1,o="",i=zu;if(null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(i=n.onRecoverableError)),t=Pu(t,null,e,1,null!=n?n:null,a,0,o,i),e[ro]=t.current,Pa(e),r)for(e=0;e<r.length;e++)a=(a=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Ou(t)},B.render=function(e,t,n){if(!$u(t))throw Error(Q(200));return Bu(null,e,t,!1,n)},B.unmountComponentAtNode=function(e){if(!$u(e))throw Error(Q(40));return!!e._reactRootContainer&&(Zc(function(){Bu(null,null,e,!1,function(){e._reactRootContainer=null,e[ro]=null})}),!0)},B.unstable_batchedUpdates=Jc,B.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$u(n))throw Error(Q(200));if(null==e||void 0===e._reactInternals)throw Error(Q(38));return Bu(e,t,n,!1,r)},B.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),U.exports=B;var qu,Qu=U.exports;qu=Qu.createRoot,Qu.hydrateRoot;var Gu={exports:{}},Yu={},Xu=j,Ju=Symbol.for("react.element"),Zu=Symbol.for("react.fragment"),ed=Object.prototype.hasOwnProperty,td=Xu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nd={key:!0,ref:!0,__self:!0,__source:!0};function rd(e,t,n){var r,a={},o=null,i=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(i=t.ref),t)ed.call(t,r)&&!nd.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:Ju,type:e,key:o,ref:i,props:a,_owner:td.current}}Yu.Fragment=Zu,Yu.jsx=rd,Yu.jsxs=rd,Gu.exports=Yu;var ad=Gu.exports;function od(e){return{title:e.title,snippet:e.content,relevance:e.score,documentId:e.documentId,fullContent:e.fullContent,downloadUrl:e.downloadUrl,documentName:e.documentName,sourceType:e.sourceType,chunkId:e.chunkId}}class id{constructor(e,t){this.baseUrl=e.replace(/\/$/,""),this.apiKey=t}async chat(e,t){const n=await fetch(`${this.baseUrl}/api/external/chat`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.apiKey},body:JSON.stringify({message:e,sessionId:t?.sessionId,context:t?.context})});if(!n.ok){const e=await n.json().catch(()=>({}));throw new Error(e.message||`HTTP ${n.status}: ${n.statusText}`)}const r=await n.json();return{...r,sources:(r.sources||[]).map(od)}}async chatStream(e,t){const n=await fetch(`${this.baseUrl}/api/external/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":this.apiKey},body:JSON.stringify({message:e,sessionId:t?.sessionId,context:t?.context})});if(!n.ok){const e=await n.json().catch(()=>({}));throw new Error(e.message||`HTTP ${n.status}`)}const r=n.body?.getReader();if(!r)throw new Error("Streaming not supported");const a=new TextDecoder;let o,i="",s="",l=[];try{for(;;){const{done:e,value:n}=await r.read();if(e)break;i+=a.decode(n,{stream:!0});const c=i.split("\n");i=c.pop()||"";for(const e of c)if(e.startsWith("event: "));else if(e.startsWith("data: "))try{const n=JSON.parse(e.slice(6));void 0!==n.text?(s+=n.text,t.onToken?.(n.text)):void 0!==n.sources?(l=(n.sources||[]).map(od),t.onSources?.(l)):void 0!==n.sessionId&&(o=n.sessionId)}catch{}}t.onComplete?.({fullText:s,sessionId:o,sources:l})}catch(e){t.onError?.(e)}}async getGeneralDocs(e){const t=new URLSearchParams;e&&t.set("since",e);const n=`${this.baseUrl}/api/external/docs${t.toString()?"?"+t:""}`,r=await fetch(n,{headers:{"X-API-Key":this.apiKey}});if(!r.ok)throw new Error(`HTTP ${r.status}`);return(await r.json()).documents}async getStatus(){const e=await fetch(`${this.baseUrl}/api/external/status`,{headers:{"X-API-Key":this.apiKey}});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async health(){const e=await fetch(`${this.baseUrl}/api/external/health`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}}let sd,ld;const cd=new WeakMap,ud=new WeakMap,dd=new WeakMap,fd=new WeakMap,hd=new WeakMap;let pd={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return ud.get(e);if("objectStoreNames"===t)return e.objectStoreNames||dd.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return yd(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function md(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(ld||(ld=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(vd(this),t),yd(cd.get(this))}:function(...t){return yd(e.apply(vd(this),t))}:function(t,...n){const r=e.call(vd(this),t,...n);return dd.set(r,t.sort?t.sort():[t]),yd(r)}}function gd(e){return"function"==typeof e?md(e):(e instanceof IDBTransaction&&function(e){if(ud.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});ud.set(e,t)}(e),t=e,(sd||(sd=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,pd):e);var t}function yd(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{t(yd(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",a),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&cd.set(t,e)}).catch(()=>{}),hd.set(t,e),t}(e);if(fd.has(e))return fd.get(e);const t=gd(e);return t!==e&&(fd.set(e,t),hd.set(t,e)),t}const vd=e=>hd.get(e);function bd(e,t,{blocked:n,upgrade:r,blocking:a,terminated:o}={}){const i=indexedDB.open(e,t),s=yd(i);return r&&i.addEventListener("upgradeneeded",e=>{r(yd(i.result),e.oldVersion,e.newVersion,yd(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{o&&e.addEventListener("close",()=>o()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}const wd=["get","getKey","getAll","getAllKeys","count"],Sd=["put","add","delete","clear"],kd=new Map;function xd(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(kd.get(t))return kd.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,a=Sd.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!a&&!wd.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,a?"readwrite":"readonly");let i=o.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),a&&o.done]))[0]};return kd.set(t,o),o}pd=(e=>({...e,get:(t,n,r)=>xd(t,n)||e.get(t,n,r),has:(t,n)=>!!xd(t,n)||e.has(t,n)}))(pd);class Cd{constructor(e){this.db=null,this.dbPromise=null,this.documentCount=0,this.lastSyncAt=null,this.config=e,"indexeddb"===e.storage&&"undefined"!=typeof indexedDB?this.dbPromise=this.initDB():"localstorage"===e.storage&&this.loadLocalStorageMetadata()}loadLocalStorageMetadata(){try{const e=localStorage.getItem("cybernetic-cache-meta");if(e){const t=JSON.parse(e);this.documentCount=t.documentCount||0,this.lastSyncAt=t.lastSyncAt||null}}catch{}}async initDB(){return this.db=await bd("cybernetic-cache",1,{upgrade(e){if(!e.objectStoreNames.contains("documents")){e.createObjectStore("documents",{keyPath:"id"}).createIndex("by-updated","updatedAt")}e.objectStoreNames.contains("metadata")||e.createObjectStore("metadata",{keyPath:"key"})}}),await this.loadMetadata(),this.db}async getDB(){if(this.db)return this.db;if(this.dbPromise)return this.dbPromise;throw new Error("Database not available")}async loadMetadata(){if(!this.db)return;const e=await this.db.get("metadata","documentCount");this.documentCount=e?.value||0;const t=await this.db.get("metadata","lastSyncAt");this.lastSyncAt=t?.value||null}async store(e){if("localstorage"===this.config.storage)return this.storeLocalStorage(e);const t=(await this.getDB()).transaction(["documents","metadata"],"readwrite");for(const n of e)await t.objectStore("documents").put(n);this.documentCount=await t.objectStore("documents").count(),this.lastSyncAt=(new Date).toISOString(),await t.objectStore("metadata").put({key:"documentCount",value:this.documentCount}),await t.objectStore("metadata").put({key:"lastSyncAt",value:this.lastSyncAt}),await t.done}async retrieve(){if("localstorage"===this.config.storage)return this.retrieveLocalStorage();return(await this.getDB()).getAll("documents")}async getLastSync(){return this.lastSyncAt}getStatus(){const e=Date.now()-(this.lastSyncAt?new Date(this.lastSyncAt).getTime():0)>this.config.maxAge;return{documentCount:this.documentCount,lastSyncAt:this.lastSyncAt,cacheSize:5e3*this.documentCount,isStale:e}}async clear(){if("localstorage"===this.config.storage)return localStorage.removeItem("cybernetic-cache-docs"),localStorage.removeItem("cybernetic-cache-meta"),this.documentCount=0,void(this.lastSyncAt=null);const e=(await this.getDB()).transaction(["documents","metadata"],"readwrite");await e.objectStore("documents").clear(),await e.objectStore("metadata").clear(),await e.done,this.documentCount=0,this.lastSyncAt=null}storeLocalStorage(e){try{localStorage.setItem("cybernetic-cache-docs",JSON.stringify(e)),this.documentCount=e.length,this.lastSyncAt=(new Date).toISOString(),localStorage.setItem("cybernetic-cache-meta",JSON.stringify({documentCount:this.documentCount,lastSyncAt:this.lastSyncAt}))}catch{localStorage.removeItem("cybernetic-cache-docs");const t=e.slice(0,50);localStorage.setItem("cybernetic-cache-docs",JSON.stringify(t)),this.documentCount=t.length}}retrieveLocalStorage(){try{const e=localStorage.getItem("cybernetic-cache-docs");return e?JSON.parse(e):[]}catch{return[]}}}class Ed{constructor(){this.documents=[],this.idf=new Map,this.indexed=!1,this.loadedFromExport=!1,this.vocabulary=new Map}isIndexed(){return this.indexed&&this.documents.length>0}async index(e){this.documents=[],this.idf=new Map;const t=new Map;for(const n of e){const e=this.tokenize(n.content),r=new Set(e);for(const e of r)t.set(e,(t.get(e)||0)+1);this.documents.push({id:n.id,title:n.title,content:n.content,tokens:e,tfidf:new Map})}const n=e.length;for(const[e,r]of t)this.idf.set(e,Math.log((n+1)/(r+1))+1);for(const e of this.documents){const t=this.computeTermFrequency(e.tokens);for(const[n,r]of t){const t=this.idf.get(n)||1;e.tfidf.set(n,r*t)}}this.indexed=!0}async ask(e){if(!this.indexed||0===this.documents.length)return{answer:"I don't have any information available offline.",sources:[],topScore:0};const t=this.tokenize(e),n=this.computeTermFrequency(t),r=new Map;for(const[e,t]of n){const n=this.idf.get(e)||1;r.set(e,t*n)}const a=this.documents.map(e=>({doc:e,score:this.cosineSimilarity(r,e.tfidf)}));a.sort((e,t)=>t.score-e.score);const o=a.slice(0,3).filter(e=>e.score>.1);if(0===o.length)return{answer:"I couldn't find relevant information for your question in my offline data.",sources:[],topScore:a[0]?.score||0};const i=o[0].doc;return{answer:this.extractRelevantSnippet(i.content,t),sources:o.map(e=>({title:e.doc.title,snippet:e.doc.content.substring(0,200)+"...",score:e.score})),topScore:o[0].score}}reset(){this.documents=[],this.idf=new Map,this.vocabulary=new Map,this.indexed=!1,this.loadedFromExport=!1,this.exportVersion=void 0,this.exportedAt=void 0}async loadFromExport(e){this.reset(),this.idf=new Map(Object.entries(e.tfidfIndex.idf));let t=0;for(const e of this.idf.keys())this.vocabulary.set(e,t++);for(const t of e.documents){const e=new Map;for(const[n,r]of t.tfidfVector)for(const[t,a]of this.vocabulary)if(a===n){e.set(t,r);break}this.documents.push({id:t.id,title:t.title,content:t.content,tokens:[],tfidf:e})}this.indexed=!0,this.loadedFromExport=!0,this.exportVersion=e.version,this.exportedAt=e.meta.exportedAt,console.log(`[CyberneticLocalRAG] Loaded ${this.documents.length} documents from export (v${e.version})`)}getExportStatus(){return{loaded:this.indexed,loadedFromExport:this.loadedFromExport,documentCount:this.documents.length,chunkCount:this.documents.length,exportVersion:this.exportVersion,exportedAt:this.exportedAt}}tokenize(e){return e.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(e=>e.length>2&&!this.isStopWord(e))}computeTermFrequency(e){const t=new Map;for(const n of e)t.set(n,(t.get(n)||0)+1);const n=Math.max(...t.values());if(n>0)for(const[e,r]of t)t.set(e,r/n);return t}cosineSimilarity(e,t){let n=0,r=0,a=0;for(const[a,o]of e){n+=o*(t.get(a)||0),r+=o*o}for(const e of t.values())a+=e*e;return 0===r||0===a?0:n/(Math.sqrt(r)*Math.sqrt(a))}extractRelevantSnippet(e,t){const n=e.split(/[.!?]+/).filter(e=>e.trim().length>0).map(e=>{const n=new Set(this.tokenize(e));let r=0;for(const e of t)n.has(e)&&r++;return{sentence:e.trim(),score:r}});n.sort((e,t)=>t.score-e.score);const r=n.slice(0,3).filter(e=>e.score>0);return 0===r.length?e.substring(0,300)+"...":r.map(e=>e.sentence).join(". ")+"."}isStopWord(e){return new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","up","about","into","through","during","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","this","that","these","those","it","its","they","them","their","what","which","who","whom","when","where","why","how","all","each","every","both","few","more","most","other","some","such","no","not","only","same","so","than","too","very"]).has(e)}}class _d{constructor(){this.db=null,this.dbPromise=null,this.dbName="cybernetic-offline-vectors",this.dbVersion=1}async initDB(){return this.db?this.db:this.dbPromise?this.dbPromise:(this.dbPromise=bd(this.dbName,this.dbVersion,{upgrade(e){e.objectStoreNames.contains("vectors")||e.createObjectStore("vectors",{keyPath:"id"})}}),this.db=await this.dbPromise,this.db)}async store(e,t){const n=await this.getDB();await n.put("vectors",{id:e,exportVersion:t.version,exportedAt:t.meta.exportedAt,type:t.type,data:t}),console.log(`[CyberneticOfflineStorage] Stored ${t.meta.chunkCount} chunks`)}async retrieve(e){const t=await this.getDB(),n=await t.get("vectors",e);return n?.data??null}async isValid(e,t){const n=await this.getDB(),r=await n.get("vectors",e);if(!r)return!1;const a=new Date(r.exportedAt).getTime();return Date.now()-a<t}async getMeta(e){const t=await this.getDB(),n=await t.get("vectors",e);return n?{version:n.exportVersion,exportedAt:n.exportedAt,documentCount:n.data.meta.documentCount,chunkCount:n.data.meta.chunkCount,type:n.type}:null}async hasData(){const e=await this.getDB();return await e.count("vectors")>0}async getStoredIds(){return(await this.getDB()).getAllKeys("vectors")}async delete(e){const t=await this.getDB();await t.delete("vectors",e)}async clear(){const e=await this.getDB();await e.clear("vectors"),console.log("[CyberneticOfflineStorage] Cache cleared")}async getDB(){return this.db?this.db:this.initDB()}close(){this.db&&(this.db.close(),this.db=null,this.dbPromise=null)}}function Md(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");const n=t.length%4;n&&(t+="=".repeat(4-n));const r=atob(t),a=new Uint8Array(r.length);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return a}function Ld(e){const t=Md(e);return(new TextDecoder).decode(t)}async function Nd(e,t,n){try{const r=await async function(e){const t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return crypto.subtle.importKey("spki",r.buffer,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}(n),a=(new TextEncoder).encode(e),o=new Uint8Array(t).buffer;return await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,o,a)}catch(e){return console.warn("[License] Signature verification failed:",e),!1}}async function Ad(e,t){if(!e||""===e.trim())return{status:"missing",payload:null,error:"No license key provided",inGracePeriod:!1,daysRemaining:null};const n=function(e){try{const t=e.split(".");if(3!==t.length)return null;const[n,r,a]=t;return{header:JSON.parse(Ld(n)),payload:JSON.parse(Ld(r)),signature:Md(a),signedContent:`${n}.${r}`}}catch{return null}}(e);if(!n)return{status:"invalid",payload:null,error:"Invalid license key format",inGracePeriod:!1,daysRemaining:null};const r=function(e){return"string"!=typeof e.iss||"string"!=typeof e.sub||"string"!=typeof e.aud||"number"!=typeof e.iat||"number"!=typeof e.exp||"string"!=typeof e.plan||"number"!=typeof e.seats?null:Array.isArray(e.features)?"number"!=typeof e.licenseVersion?null:{iss:e.iss,sub:e.sub,aud:e.aud,iat:e.iat,exp:e.exp,plan:e.plan,org:"string"==typeof e.org?e.org:void 0,seats:e.seats,features:e.features,graceUntil:"number"==typeof e.graceUntil?e.graceUntil:void 0,licenseVersion:e.licenseVersion}:null}(n.payload);if(!r)return{status:"invalid",payload:null,error:"Invalid license payload structure",inGracePeriod:!1,daysRemaining:null};if("astermind"!==r.iss)return{status:"invalid",payload:null,error:"Invalid license issuer",inGracePeriod:!1,daysRemaining:null};if("cybernetic-chatbot"!==r.aud&&"*"!==r.aud)return{status:"invalid",payload:null,error:"License not valid for this product",inGracePeriod:!1,daysRemaining:null};if("undefined"!=typeof crypto&&crypto.subtle){const e=t||"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhLW7MXHQ0Fuk1OKt9D5CbRw7fUMN\nLJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==\n-----END PUBLIC KEY-----";if(!await Nd(n.signedContent,n.signature,e))return{status:"invalid",payload:null,error:"License signature verification failed",inGracePeriod:!1,daysRemaining:null}}const a=Math.floor(Date.now()/1e3),o=function(e){const t=e-Math.floor(Date.now()/1e3);return Math.floor(t/86400)}(r.exp);return r.exp<a?r.graceUntil&&r.graceUntil>a?{status:"valid",payload:r,inGracePeriod:!0,daysRemaining:o}:{status:"expired",payload:r,error:"License has expired",inGracePeriod:!1,daysRemaining:o}:"eval"===r.plan?{status:"eval",payload:r,inGracePeriod:!1,daysRemaining:o}:{status:"valid",payload:r,inGracePeriod:!1,daysRemaining:o}}const Pd="cybernetic-chatbot-client",Rd="agentic";class Td{constructor(e={}){this.state=null,this.verificationPromise=null,this.hasLoggedWarning=!1,this.loggedMissingFeatures=new Set,this.config=e,this.environment=e.environment||function(){if("undefined"==typeof window)return"production"===process?.env?.NODE_ENV?"production":"development";const e=window.location?.hostname||"",t=["localhost","127.0.0.1","0.0.0.0",".local",".dev",".test",":3000",":5173",":8080",":4200"];for(const n of t)if(e.includes(n)||window.location?.port===n.replace(":",""))return"development";if("file:"===window.location?.protocol)return"development";const n=["staging.","preview.","-preview.",".vercel.app",".netlify.app",".pages.dev"];for(const t of n)if(e.includes(t))return"production";return"production"}(),this.enforcementMode="development"===this.environment?"soft":"hard"}async verify(){if(this.state)return this.state;if(this.verificationPromise)return this.verificationPromise;this.verificationPromise=Ad(this.config.licenseKey,this.config.publicKey);try{return this.state=await this.verificationPromise,this.config.onStatusChange?.(this.state),this.logLicenseStatus(),this.state}finally{this.verificationPromise=null}}getState(){return this.state}isValid(){return!!this.state&&("valid"===this.state.status||"eval"===this.state.status)}requiresAction(){return!this.state||("expired"===this.state.status||"missing"===this.state.status||"invalid"===this.state.status)}getEnvironment(){return this.environment}getEnforcementMode(){return this.enforcementMode}processResponse(e){return this.state?this.isValid()&&!this.state.inGracePeriod?e:"soft"===this.enforcementMode?(this.hasLoggedWarning||(this.logDevelopmentWarning(),this.hasLoggedWarning=!0),e):e+"\n\n---\n⚠️ License Notice: Your AsterMind license key needs to be updated. Please contact support@astermind.ai or visit https://astermind.ai/license to renew your license.":e}getStatusMessage(){if(!this.state)return"License not verified";switch(this.state.status){case"valid":return this.state.inGracePeriod?`License expired but in grace period (${Math.abs(this.state.daysRemaining||0)} days overdue)`:`License valid (${this.state.daysRemaining} days remaining)`;case"eval":return`Evaluation license (${this.state.daysRemaining} days remaining)`;case"expired":return`License expired ${Math.abs(this.state.daysRemaining||0)} days ago`;case"missing":return"No license key provided";case"invalid":return`Invalid license: ${this.state.error}`;default:return"Unknown license status"}}async reVerify(){return this.state=null,this.hasLoggedWarning=!1,this.loggedMissingFeatures.clear(),this.verify()}hasFeature(e){return!!this.state?.payload&&this.state.payload.features.includes(e)}getFeatures(){return this.state?.payload?.features||[]}checkClientFeature(){return this.checkFeatureWithLog(Pd,"CyberneticClient")}checkAgenticFeature(){return this.checkFeatureWithLog(Rd,"Agentic capabilities")}checkFeatureWithLog(e,t){if(!this.state?.payload)return!0;const n=this.state.payload.features.includes(e);return n||this.loggedMissingFeatures.has(e)||(this.loggedMissingFeatures.add(e),this.logMissingFeature(e,t)),n}logMissingFeature(e,t){const n=this.getFeatures(),r=this.state?.payload?.plan||"unknown";console.warn(`[Cybernetic License] ${t} requires the '${e}' feature, which is not included in your license.`),console.info(`[Cybernetic License] Current license plan: ${r}`),console.info(`[Cybernetic License] Licensed features: ${n.length>0?n.join(", "):"(none)"}`),console.info("[Cybernetic License] To add this feature, upgrade your license at https://astermind.ai/license")}logLicenseStatus(){if(!this.state)return;const e="[Cybernetic License]";switch(this.state.status){case"valid":this.state.inGracePeriod?console.warn(`${e} License expired but in grace period. Please renew at https://astermind.ai/license`):null!==this.state.daysRemaining&&this.state.daysRemaining<=30&&console.info(`${e} License expires in ${this.state.daysRemaining} days`);break;case"eval":console.info(`${e} Evaluation license - ${this.state.daysRemaining} days remaining`);break;case"expired":console.error(`${e} License expired. Enforcement mode: ${this.enforcementMode}. Renew at https://astermind.ai/license`);break;case"missing":console.warn(`${e} No license key provided. Enforcement mode: ${this.enforcementMode}. Get a license at https://astermind.ai/license`);break;case"invalid":console.error(`${e} Invalid license: ${this.state.error}. Enforcement mode: ${this.enforcementMode}`)}}logDevelopmentWarning(){console.warn(`[Cybernetic License] Running in development mode with ${this.state?.status||"unknown"} license. In production, a warning will be appended to chatbot responses. Get a license at https://astermind.ai/license`)}}class Id{constructor(e){this.status="connecting",this.lastError=null,this.systemSettings=null,this.settingsLastChecked=0,this.SETTINGS_CHECK_INTERVAL=3e5,this.agenticCapabilities=null,this.offlineStorage=null,this.omegaRAG=null,this.offlineWarningShown=!1,this.config={apiUrl:e.apiUrl,apiKey:e.apiKey,fallback:{enabled:e.fallback?.enabled??!0,cacheMaxAge:e.fallback?.cacheMaxAge??864e5,cacheOnConnect:e.fallback?.cacheOnConnect??!0,cacheStorage:e.fallback?.cacheStorage??"indexeddb"},retry:{maxRetries:e.retry?.maxRetries??2,initialDelay:e.retry?.initialDelay??1e3,exponentialBackoff:e.retry?.exponentialBackoff??!0},agentic:e.agentic??null,offline:e.offline??null,sitemap:e.sitemap??null,sources:{enabled:e.sources?.enabled??!0,showSummary:e.sources?.showSummary??!0,showDownload:e.sources?.showDownload??!0,includeFullContent:e.sources?.includeFullContent??!1,maxSources:e.sources?.maxSources??5},onStatusChange:e.onStatusChange||(()=>{}),onError:e.onError||(()=>{})},this.apiClient=new id(this.config.apiUrl,this.config.apiKey),this.cache=new Cd({storage:this.config.fallback.cacheStorage,maxAge:this.config.fallback.cacheMaxAge}),this.localRAG=new Ed,this.licenseManager=new Td({licenseKey:e.licenseKey}),this.licenseManager.verify().then(()=>{this.licenseManager.checkClientFeature()}).catch(()=>{}),this.monitorConnection(),this.config.fallback.enabled&&this.config.fallback.cacheOnConnect&&this.syncCache().catch(()=>{}),this.config.offline?.enabled&&this.initializeOffline(this.config.offline).catch(e=>{console.warn("[Cybernetic] Failed to initialize offline vectors:",e)})}registerAgentic(e){this.agenticCapabilities=e,console.log("[Cybernetic] Agentic capabilities registered")}isAgenticEnabled(){return null!==this.agenticCapabilities&&!0===this.config.agentic?.enabled&&(this.licenseManager.checkAgenticFeature(),!0)}getAgenticCapabilities(){return this.agenticCapabilities}getAgenticConfig(){return this.config.agentic}getSourcesConfig(){return{...this.config.sources}}isSourceFeatureAvailable(e){return!!this.config.sources.enabled&&("summary"===e?this.config.sources.showSummary:"download"===e&&(this.config.sources.showDownload&&"online"===this.status))}classifyIntent(e){if(!this.isAgenticEnabled()||!this.agenticCapabilities)return null;const t=this.config.agentic;return new(0,this.agenticCapabilities.agent)(t).interpretIntent(e)}async executeAction(e){if(!this.isAgenticEnabled()||!this.agenticCapabilities)return{success:!1,message:"Agentic capabilities not enabled"};const t=this.config.agentic;return new(0,this.agenticCapabilities.agent)(t).executeAction(e)}async smartAsk(e,t){const n=this.classifyIntent(e);if(n&&n.action&&!n.shouldEscalate){if(!1!==this.config.agentic?.requireConfirmation)return{action:n.action};const e=await this.executeAction(n.action);return{action:n.action,actionResult:e}}return{response:await this.ask(e,t)}}async initializeOffline(e){const t=e.storageMode??"hybrid",n=e.cacheMaxAge??6048e5;if("memory"!==t&&(this.offlineStorage=new _d),this.offlineStorage&&"memory"!==t){const e="default";if(await this.offlineStorage.isValid(e,n)){console.log("[Cybernetic] Loading vectors from IndexedDB cache");const t=await this.offlineStorage.retrieve(e);if(t)return await this.localRAG.loadFromExport(t),void console.log("[Cybernetic] Loaded vectors from IndexedDB cache")}}if(e.vectorFileUrl)try{const n=await fetch(e.vectorFileUrl);if(!n.ok)throw new Error(`Failed to fetch vectors: ${n.status}`);const r=await n.json();return this.offlineStorage&&"memory"!==t&&await this.offlineStorage.store("default",r),await this.localRAG.loadFromExport(r),e.omega?.enabled&&await this.initializeOmega(e),void console.log("[Cybernetic] Loaded vectors from URL:",e.vectorFileUrl)}catch(e){console.error("[Cybernetic] Failed to load offline vectors from URL:",e)}if(e.vectorData)return await this.localRAG.loadFromExport(e.vectorData),e.omega?.enabled&&await this.initializeOmega(e),void console.log("[Cybernetic] Loaded inline vector data");this.offlineWarningShown||(console.warn("[Cybernetic] Offline functionality is enabled but no vectors are loaded. Offline responses will be limited. To enable full offline functionality, export vectors from the AsterMind admin panel and configure the vectorFileUrl or vectorData option."),this.offlineWarningShown=!0)}async initializeOmega(e){if(e.omega?.enabled)try{const{OmegaOfflineRAG:t}=await Promise.resolve().then(function(){return mf});this.omegaRAG=new t({reranking:e.omega.reranking,topK:5,verbose:!1}),e.omega.modelUrl?await this.omegaRAG.loadModelFromUrl(e.omega.modelUrl):e.omega.modelData&&await this.omegaRAG.loadModel(e.omega.modelData),console.log("[Cybernetic] Omega RAG initialized")}catch(e){console.warn("[Cybernetic] Failed to initialize Omega RAG:",e),this.omegaRAG=null}}async reloadOfflineVectors(){this.config.offline?.enabled?(this.localRAG.reset(),this.offlineStorage&&await this.offlineStorage.clear(),this.omegaRAG&&this.omegaRAG.clear(),await this.initializeOffline(this.config.offline)):console.warn("[Cybernetic] Offline mode is not enabled")}isOmegaOfflineEnabled(){return this.omegaRAG?.isReady()??!1}getOfflineModelInfo(){return this.omegaRAG?.getModelInfo()??null}getLocalRAGStatus(){return this.localRAG.getExportStatus()}getOfflineStorage(){return this.offlineStorage}async ask(e,t){if(!e||"string"!=typeof e)return this.createErrorResponse("Message is required","none");const n=await this.checkSystemStatus();if(n.maintenanceMode||n.forceOfflineClients)return console.log("[Cybernetic] Maintenance mode active, using cached data"),this.isCacheValid()?await this.fallbackAsk(e):{reply:n.maintenanceMessage||"The service is currently under maintenance. Please try again later.",confidence:"none",sources:[],offline:!0,degradedReason:"Maintenance mode active, no valid cache available"};try{const n=await this.apiWithRetry(e,t);this.setStatus("online");return{reply:this.licenseManager.processResponse(n.reply),confidence:"high",sources:n.sources||[],offline:!1,sessionId:n.sessionId}}catch(n){const r=this.normalizeError(n);return this.lastError=r,this.config.onError(r),"RATE_LIMIT"===r.code?{reply:"I'm receiving too many requests right now. Please try again in a moment.",confidence:"none",sources:[],offline:!1,retryAfter:r.retryAfter}:this.config.fallback.enabled&&!t?.skipFallback?await this.fallbackAsk(e):this.createErrorResponse("Unable to connect to the chatbot service. Please try again later.","none",r.retryAfter)}}async askStream(e,t,n){if(!e||"string"!=typeof e)return void t.onError?.({code:"LOCAL_RAG_ERROR",message:"Message is required"});const r=await this.checkSystemStatus();if(r.maintenanceMode||r.forceOfflineClients){console.log("[Cybernetic] Maintenance mode active, falling back to offline");const n=await this.fallbackAsk(e);return void t.onComplete?.(n)}try{await this.apiClient.chatStream(e,{sessionId:n?.sessionId,context:n?.context,onToken:t.onToken,onSources:t.onSources,onComplete:e=>{this.setStatus("online");const n=this.licenseManager.processResponse(e.fullText);t.onComplete?.({reply:n,confidence:"high",sources:e.sources||[],offline:!1,sessionId:e.sessionId})},onError:e=>{const n=this.normalizeError(e);this.config.onError(n),t.onError?.(n)}})}catch(r){const a=this.normalizeError(r);if(this.lastError=a,this.config.onError(a),this.config.fallback.enabled&&!n?.skipFallback){const n=await this.fallbackAsk(e);t.onComplete?.(n)}else t.onError?.(a)}}async syncCache(){try{const e=await this.cache.getLastSync(),t=await this.apiClient.getGeneralDocs(e);t.length>0&&(await this.cache.store(t),await this.localRAG.index(t),console.log(`[Cybernetic] Cache synced: ${t.length} documents`)),this.setStatus("online")}catch(e){console.warn("[Cybernetic] Cache sync failed:",e)}}getStatus(){return{connection:this.status,cache:this.cache.getStatus(),lastError:this.lastError,systemSettings:this.systemSettings,license:this.licenseManager.getState()}}getLicenseManager(){return this.licenseManager}async clearCache(){await this.cache.clear(),this.localRAG.reset()}async checkConnection(){try{return await this.apiClient.getStatus(),this.setStatus("online"),!0}catch{return this.setStatus("offline"),!1}}async checkSystemStatus(){if(this.systemSettings&&Date.now()-this.settingsLastChecked<this.SETTINGS_CHECK_INTERVAL)return this.systemSettings;try{const e=await this.apiClient.getStatus();return this.systemSettings={cacheRetentionHours:e.systemSettings?.cacheRetentionHours??168,maintenanceMode:e.systemSettings?.maintenanceMode??!1,maintenanceMessage:e.systemSettings?.maintenanceMessage,forceOfflineClients:e.systemSettings?.forceOfflineClients??!1},this.settingsLastChecked=Date.now(),this.systemSettings}catch{return this.systemSettings||{cacheRetentionHours:168,maintenanceMode:!1,forceOfflineClients:!1}}}isMaintenanceMode(){return this.systemSettings?.maintenanceMode??!1}getMaintenanceMessage(){return this.systemSettings?.maintenanceMessage}isCacheValid(){const e=this.cache.getStatus();if(!e.lastSyncAt)return!1;const t=60*(this.systemSettings?.cacheRetentionHours||168)*60*1e3,n=new Date(e.lastSyncAt).getTime();return Date.now()-n<t}async apiWithRetry(e,t){const{maxRetries:n,initialDelay:r,exponentialBackoff:a}=this.config.retry;let o=null;for(let i=0;i<=n;i++)try{return await this.apiClient.chat(e,{sessionId:t?.sessionId,context:t?.context})}catch(e){o=e;const t=this.normalizeError(e);if("AUTH_ERROR"===t.code||"RATE_LIMIT"===t.code)throw e;if(i<n){const e=a?r*Math.pow(2,i):r;await this.sleep(e)}}throw o}async fallbackAsk(e){if(this.setStatus("offline"),this.omegaRAG?.isReady())try{const t=await this.omegaRAG.ask(e);if(!t.degraded){return{reply:this.licenseManager.processResponse(t.answer),confidence:t.confidence,sources:t.sources.map(e=>({title:e.heading,snippet:e.content.substring(0,200)+"...",relevance:e.score})),offline:!0,degradedReason:"Omega hybrid retrieval (offline)"}}}catch(e){console.warn("[Cybernetic] Omega RAG failed, falling back to TF-IDF:",e)}const t=this.localRAG.getExportStatus();if(t.loaded&&t.documentCount>0)try{const n=await this.localRAG.ask(e);let r="medium";n.topScore<.3?r="low":n.topScore>.7&&(r="medium");return{reply:this.licenseManager.processResponse(n.answer),confidence:r,sources:n.sources.map(e=>({title:e.title,snippet:e.snippet,relevance:e.score})),offline:!0,degradedReason:t.loadedFromExport?"Using pre-exported vectors (offline)":"Processed locally with TF-IDF"}}catch(e){console.error("[Cybernetic] Local RAG error:",e)}const n=this.cache.getStatus();if(0===n.documentCount&&!t.loaded)return{reply:"I'm currently offline and don't have any cached information. Please check your connection and try again.",confidence:"none",sources:[],offline:!0,degradedReason:"No cached documents or offline vectors available"};try{const t=await this.cache.retrieve();this.localRAG.isIndexed()||await this.localRAG.index(t);const r=await this.localRAG.ask(e);let a="medium";r.topScore<.3?a="low":r.topScore>.7&&(a="medium");return{reply:this.licenseManager.processResponse(r.answer),confidence:a,sources:r.sources.map(e=>({title:e.title,snippet:e.snippet,relevance:e.score})),offline:!0,degradedReason:n.isStale?"Using stale cached data":"Processed locally without server"}}catch(e){return console.error("[Cybernetic] Local RAG error:",e),{reply:"I'm having trouble processing your request offline. Please try again when you're back online.",confidence:"none",sources:[],offline:!0,degradedReason:"Local RAG processing failed"}}}monitorConnection(){"undefined"!=typeof window&&(window.addEventListener("online",()=>{this.syncCache().catch(()=>{})}),window.addEventListener("offline",()=>{this.setStatus("offline")}),navigator.onLine||this.setStatus("offline"))}setStatus(e){this.status!==e&&(this.status=e,this.config.onStatusChange(e))}normalizeError(e){if(e instanceof Error){if(e.message.includes("401")||e.message.includes("Unauthorized"))return{code:"AUTH_ERROR",message:"Invalid or expired API key",originalError:e};if(e.message.includes("429")||e.message.includes("Rate limit")){const t=e.message.match(/retry after (\d+)/i);return{code:"RATE_LIMIT",message:"Rate limit exceeded",retryAfter:t?parseInt(t[1],10):60,originalError:e}}return e.message.includes("5")||e.message.includes("Server")?{code:"SERVER_ERROR",message:"Server error occurred",originalError:e}:{code:"NETWORK_ERROR",message:e.message||"Network error",originalError:e}}return{code:"NETWORK_ERROR",message:"Unknown error occurred"}}createErrorResponse(e,t,n){return{reply:e,confidence:t,sources:[],offline:!1,retryAfter:n}}sleep(e){return new Promise(t=>setTimeout(t,e))}}const Dd={navigate:[{pattern:/^(go to|navigate to|take me to|open|show me|bring up)\s+(.+)/i,type:"navigate",weight:.9},{pattern:/^(i want to see|i need to go to|let me see)\s+(.+)/i,type:"navigate",weight:.85},{pattern:/^(where is|how do i get to)\s+(.+)/i,type:"navigate",weight:.6}],fillForm:[{pattern:/^(search for|find|look up|search)\s+(.+)/i,type:"fillForm",weight:.88},{pattern:/^(filter by|set .+ to|change .+ to)\s+(.+)/i,type:"fillForm",weight:.85},{pattern:/^(enter|type|put)\s+(.+)\s+(in|into)\s+(.+)/i,type:"fillForm",weight:.9}],clickElement:[{pattern:/^(click|press|hit|tap)\s+(the\s+)?(.+)\s+(button|link)/i,type:"clickElement",weight:.9},{pattern:/^(submit|send|confirm|save|cancel|delete)/i,type:"clickElement",weight:.85}],triggerModal:[{pattern:/^(open|show|display)\s+(the\s+)?(.+)\s+(modal|dialog|popup|window)/i,type:"triggerModal",weight:.9},{pattern:/^(open|show)\s+(help|settings|preferences|options)/i,type:"triggerModal",weight:.85}],scroll:[{pattern:/^(scroll to|jump to|go to)\s+(the\s+)?(.+)\s+(section|area|part)/i,type:"scroll",weight:.85},{pattern:/^(show me|take me to)\s+(the\s+)?(bottom|top|end|beginning)/i,type:"scroll",weight:.8}],highlight:[{pattern:/^(highlight|show me|point to|where is)\s+(the\s+)?(.+)/i,type:"highlight",weight:.7}],custom:[{pattern:/^(export|download|refresh|reload|sync)/i,type:"custom",weight:.85}]};class zd{constructor(e){this.categories=[],this.topicKeywords=new Map,this.config=e,this.siteMapIndex=new Map,this.formIndex=new Map,this.modalIndex=new Map,this.buildIndexes()}buildIndexes(){if(this.config.siteMap)for(const e of this.config.siteMap){const t=[e.name.toLowerCase(),e.path.toLowerCase(),...(e.aliases||[]).map(e=>e.toLowerCase())];for(const n of t)this.siteMapIndex.set(n,e)}if(this.config.forms)for(const[e,t]of Object.entries(this.config.forms)){const n=[e.toLowerCase(),t.name.toLowerCase(),...(t.aliases||[]).map(e=>e.toLowerCase())];for(const e of n)this.formIndex.set(e,t)}if(this.config.modals)for(const[e,t]of Object.entries(this.config.modals)){const n=[e.toLowerCase(),t.id.toLowerCase(),...(t.aliases||[]).map(e=>e.toLowerCase())];for(const e of n)this.modalIndex.set(e,t)}}classify(e){if(!this.config.enabled)return{action:null,shouldEscalate:!0,rawConfidence:0};const t=e.trim().toLowerCase();for(const[t,n]of Object.entries(Dd))for(const{pattern:r,weight:a}of n){const n=e.match(r);if(n){const e=this.buildAction(t,n,a);if(e)return e}}const n=this.fuzzyMatchSiteMap(t);if(n)return n;const r=this.matchCustomAction(t);return r||{action:null,shouldEscalate:!0,rawConfidence:0,matchedPatterns:[]}}buildAction(e,t,n){const r=this.config.confidenceThreshold??.8;switch(e){case"navigate":{const e=this.extractTarget(t),a=this.findSiteMapMatch(e);if(a){const e=n*a.similarity;return{action:{id:`action-${Date.now()}`,type:"navigate",target:a.entry.path,confidence:e,explanation:`Navigate to ${a.entry.name}`},shouldEscalate:e<r,rawConfidence:e,matchedPatterns:["navigate",a.entry.name]}}break}case"fillForm":{const e=this.extractTarget(t),{field:a,value:o}=this.parseFormIntent(t);if(a){const e=.95*n;return{action:{id:`action-${Date.now()}`,type:"fillForm",target:a.selector,params:{value:o},confidence:e,explanation:`Fill "${a.name}" with "${o}"`},shouldEscalate:e<r,rawConfidence:e,matchedPatterns:["fillForm",a.name]}}if(this.config.forms?.search){const t=.9*n;return{action:{id:`action-${Date.now()}`,type:"fillForm",target:this.config.forms.search.selector,params:{value:e},confidence:t,explanation:`Search for "${e}"`},shouldEscalate:t<r,rawConfidence:t,matchedPatterns:["fillForm","search"]}}break}case"clickElement":{const e=this.extractTarget(t),a=this.findButtonSelector(e);if(a){const t=.95*n;return{action:{id:`action-${Date.now()}`,type:"clickElement",target:a,confidence:t,explanation:`Click "${e}" button`},shouldEscalate:t<r,rawConfidence:t,matchedPatterns:["clickElement",e]}}break}case"triggerModal":{const e=this.extractTarget(t),a=this.findModalConfig(e);if(a){const e=.95*n;return{action:{id:`action-${Date.now()}`,type:"triggerModal",target:a.trigger,confidence:e,explanation:`Open ${a.id} modal`},shouldEscalate:e<r,rawConfidence:e,matchedPatterns:["triggerModal",a.id]}}break}case"scroll":{const e=this.extractTarget(t),a=this.findScrollTarget(e);if(a){const t=.9*n;return{action:{id:`action-${Date.now()}`,type:"scroll",target:a,confidence:t,explanation:`Scroll to ${e}`},shouldEscalate:t<r,rawConfidence:t,matchedPatterns:["scroll",e]}}break}case"highlight":{const e=this.extractTarget(t),a=this.findElementByDescription(e);if(a){const t=.85*n;return{action:{id:`action-${Date.now()}`,type:"highlight",target:a,confidence:t,explanation:`Highlight ${e}`},shouldEscalate:t<r,rawConfidence:t,matchedPatterns:["highlight",e]}}break}case"custom":{const e=t[1]?.toLowerCase();if(this.config.customActions?.[e]){const t=.95*n;return{action:{id:`action-${Date.now()}`,type:"custom",target:e,confidence:t,explanation:`Execute ${e} action`},shouldEscalate:t<r,rawConfidence:t,matchedPatterns:["custom",e]}}break}}return null}extractTarget(e){for(let t=e.length-1;t>=1;t--)if(e[t])return e[t].trim();return""}findSiteMapMatch(e){const t=e.toLowerCase().replace(/[^a-z0-9\s]/g,""),n=this.siteMapIndex.get(t);if(n)return{entry:n,similarity:1};let r=null,a=0;for(const[e,n]of this.siteMapIndex){const o=this.calculateSimilarity(t,e);o>a&&o>.6&&(a=o,r=n)}return r?{entry:r,similarity:a}:null}fuzzyMatchSiteMap(e){const t=this.config.confidenceThreshold??.8;for(const[n,r]of this.siteMapIndex)if(e.includes(n)){const e=.75;return{action:{id:`action-${Date.now()}`,type:"navigate",target:r.path,confidence:e,explanation:`Navigate to ${r.name}`},shouldEscalate:e<t,rawConfidence:e,matchedPatterns:["fuzzy-sitemap",n]}}return null}matchCustomAction(e){if(!this.config.customActions)return null;const t=this.config.confidenceThreshold??.8;for(const n of Object.keys(this.config.customActions))if(e.includes(n.toLowerCase())){const e=.85;return{action:{id:`action-${Date.now()}`,type:"custom",target:n,confidence:e,explanation:`Execute ${n}`},shouldEscalate:e<t,rawConfidence:e,matchedPatterns:["custom",n]}}return null}parseFormIntent(e){const t=e[0];for(const[,e]of this.formIndex)if(t.toLowerCase().includes(e.name.toLowerCase())){const n=t.match(new RegExp(`${e.name}[^a-z]*(.+)`,"i"));return{field:e,value:n?.[1]?.trim()||""}}return{field:null,value:this.extractTarget(e)}}findButtonSelector(e){const t=e.toLowerCase();if("undefined"==typeof document)return`button:contains("${e}")`;const n=[`[data-action="${t}"]`,`[aria-label*="${t}" i]`,`.btn-${t}`,`#${t}-button`,`button.${t}`];for(const e of n)try{if(document.querySelector(e))return e}catch{}const r=document.querySelectorAll('button, [role="button"], a.btn');for(const e of r)if(e.textContent?.toLowerCase().includes(t))return this.generateUniqueSelector(e);return null}findModalConfig(e){return this.modalIndex.get(e.toLowerCase())||null}findScrollTarget(e){const t=e.toLowerCase();if("top"===t||"beginning"===t)return"body";if("bottom"===t||"end"===t)return"body:last-child";if("undefined"==typeof document)return`#${t.replace(/\s+/g,"-")}`;const n=[`#${t.replace(/\s+/g,"-")}`,`[data-section="${t}"]`,`.${t.replace(/\s+/g,"-")}-section`,`section[aria-label*="${t}" i]`];for(const e of n)try{if(document.querySelector(e))return e}catch{continue}return null}findElementByDescription(e){const t=e.toLowerCase();if("undefined"==typeof document)return`[aria-label*="${t}" i]`;const n=[`[aria-label*="${t}" i]`,`[data-testid*="${t}" i]`,`[title*="${t}" i]`];for(const e of n)try{if(document.querySelector(e))return e}catch{continue}return null}generateUniqueSelector(e){if(e.id)return`#${e.id}`;if(e.getAttribute("data-testid"))return`[data-testid="${e.getAttribute("data-testid")}"]`;const t=[];let n=e;for(;n&&n!==document.body;){let e=n.tagName.toLowerCase();if(n.className&&"string"==typeof n.className){const t=n.className.split(" ").filter(e=>e&&!e.includes(" "));t.length>0&&(e+=`.${t.slice(0,2).join(".")}`)}t.unshift(e),n=n.parentElement}return t.join(" > ")}calculateSimilarity(e,t){const n=new Set(e.split(/\s+/)),r=new Set(t.split(/\s+/)),a=new Set([...n].filter(e=>r.has(e))),o=new Set([...n,...r]);return a.size/o.size}getConfig(){return this.config}async trainFromExport(e){if(e.categories){this.categories=e.categories;for(const t of e.categories)for(const e of t.keywords){const n=this.topicKeywords.get(t.name)||[];n.push(e.toLowerCase()),this.topicKeywords.set(t.name,n)}}const t=this.extractTopicsFromDocuments(e.documents);for(const[e,n]of t){const t=this.topicKeywords.get(e)||[];t.push(...n),this.topicKeywords.set(e,[...new Set(t)])}e.sitemap&&this.loadSitemapEntries(e.sitemap),console.log(`[CyberneticIntentClassifier] Trained with ${this.categories.length} categories, ${this.topicKeywords.size} topics`)}async loadSitemap(e){if(e.enabled)if(e.sitemapData)this.loadSitemapEntries(e.sitemapData);else if(e.sitemapUrl)try{const t=await fetch(e.sitemapUrl);if(!t.ok)throw new Error(`Failed to fetch sitemap: ${t.status}`);const n=await t.json();this.loadSitemapEntries(n)}catch(e){console.error("[CyberneticIntentClassifier] Failed to load sitemap:",e)}}loadSitemapEntries(e){for(const t of e){const e={path:t.url,name:t.title,description:t.description,aliases:t.keywords},n=[t.title.toLowerCase(),t.url.toLowerCase(),...(t.keywords||[]).map(e=>e.toLowerCase())];if(t.description){const e=t.description.toLowerCase().split(/\s+/).filter(e=>e.length>4);n.push(...e)}for(const t of n)this.siteMapIndex.set(t,e)}console.log(`[CyberneticIntentClassifier] Loaded ${e.length} sitemap entries`)}extractTopicsFromDocuments(e){const t=new Map;for(const n of e){const e=n.title.toLowerCase(),r=[];n.metadata?.keywords&&r.push(...n.metadata.keywords.map(e=>e.toLowerCase()));const a=n.title.toLowerCase().replace(/[^a-z0-9\s]/g,"").split(/\s+/).filter(e=>e.length>3&&!this.isStopWord(e));r.push(...a);const o=n.content.toLowerCase().replace(/[^a-z0-9\s]/g,"").split(/\s+/).filter(e=>e.length>4&&!this.isStopWord(e)),i=new Map;for(const e of o)i.set(e,(i.get(e)||0)+1);const s=[...i.entries()].sort((e,t)=>t[1]-e[1]).slice(0,5).map(([e])=>e);r.push(...s),t.set(e,[...new Set(r)])}return t}isStopWord(e){return new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","up","about","into","through","during","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","this","that","these","those","it","its","they","them","their","what","which","who","whom","when","where","why","how","all","each","every","both","few","more","most","other","some","such","no","not","only","same","so","than","too","very","can","just","dont","now","here","there","also","your","you"]).has(e)}getCategories(){return this.categories}getTopicKeywords(){return this.topicKeywords}isTrained(){return this.categories.length>0||this.topicKeywords.size>0}}class Fd{constructor(e){this.highlightOverlay=null,this.actionCount=0,this.lastActionReset=Date.now(),this.config=e,this.classifier=new zd(e),"undefined"!=typeof document&&this.injectStyles()}interpretIntent(e){return this.classifier.classify(e)}async executeAction(e){const t=Date.now();t-this.lastActionReset>6e4&&(this.actionCount=0,this.lastActionReset=t);const n=this.config.maxActionsPerTurn??5;if(this.actionCount>=n)return{success:!1,message:`Rate limit exceeded. Maximum ${n} actions per minute.`};if(!this.isActionAllowed(e))return{success:!1,message:`Action type "${e.type}" is not allowed`};switch(this.actionCount++,e.type){case"navigate":return this.navigate(e.target,e.params);case"fillForm":return this.fillForm(e.target,e.params?.value);case"clickElement":return this.clickElement(e.target);case"triggerModal":return this.triggerModal(e.target);case"scroll":return this.scrollToElement(e.target);case"highlight":return this.highlightElement(e.target);case"custom":return this.executeCustomAction(e.target,e.params);default:return{success:!1,message:`Unknown action type: ${e.type}`}}}isActionAllowed(e){const t=this.config.allowedActions;if(!t)return!0;const n={navigate:"navigate",fillForm:"fill",clickElement:"click",scroll:"scroll",highlight:"click",triggerModal:"click",custom:"click"}[e.type];return t.includes(n)}isSelectorAllowed(e){if(this.config.blockedSelectors)for(const t of this.config.blockedSelectors)if(e.includes(t))return!1;return!(this.config.allowedSelectors&&this.config.allowedSelectors.length>0)||this.config.allowedSelectors.some(t=>e.includes(t))}async navigate(e,t){try{if(!this.validateNavigationUrl(e))return{success:!1,message:"Invalid or blocked URL"};let n=e;if(t){const e=new URLSearchParams;for(const[n,r]of Object.entries(t))null!=r&&e.set(n,String(r));const r=e.toString();r&&(n+=(n.includes("?")?"&":"?")+r)}return"undefined"==typeof window?{success:!0,message:`Navigation to ${e} would be executed (server-side)`}:this.isInternalUrl(n)?this.tryClientSideNavigation(n)?{success:!0,message:`Navigated to ${e}`}:(window.location.href=n,{success:!0,message:`Navigating to ${e}...`}):(window.open(n,"_blank","noopener,noreferrer"),{success:!0,message:`Opened ${n} in new tab`})}catch(e){return{success:!1,message:"Navigation failed",error:String(e)}}}async fillForm(e,t){if(!this.isSelectorAllowed(e))return{success:!1,message:`Selector "${e}" is not allowed`};const n=this.sanitizeSelector(e);if("undefined"==typeof document)return{success:!0,message:`Form fill would set "${n}" to "${t}" (server-side)`};try{const e=document.querySelector(n);if(!e)return{success:!1,message:`Element not found: ${n}`};if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))return{success:!1,message:"Element is not a form field"};if(e.focus(),e instanceof HTMLSelectElement){const n=Array.from(e.options).find(e=>e.value.toLowerCase()===t.toLowerCase()||e.text.toLowerCase()===t.toLowerCase());if(!n)return{success:!1,message:`Option "${t}" not found`};e.value=n.value}else e.value=t;e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}));const r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;return r&&e instanceof HTMLInputElement&&(r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))),{success:!0,message:`Filled field with "${t}"`}}catch(e){return{success:!1,message:"Failed to fill form field",error:String(e)}}}async clickElement(e){if(!this.isSelectorAllowed(e))return{success:!1,message:`Selector "${e}" is not allowed`};const t=this.sanitizeSelector(e);if("undefined"==typeof document)return{success:!0,message:`Click on "${t}" would be executed (server-side)`};try{const e=document.querySelector(t);return e?e instanceof HTMLElement?(e.scrollIntoView({behavior:"smooth",block:"center"}),await this.sleep(300),e.click(),{success:!0,message:"Element clicked"}):{success:!1,message:"Element is not clickable"}:{success:!1,message:`Element not found: ${t}`}}catch(e){return{success:!1,message:"Failed to click element",error:String(e)}}}async triggerModal(e){return this.clickElement(e)}async scrollToElement(e){if("undefined"==typeof window)return{success:!0,message:`Scroll to "${e}" would be executed (server-side)`};try{if("body"===e)return window.scrollTo({top:0,behavior:"smooth"}),{success:!0,message:"Scrolled to top"};if("body:last-child"===e)return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"}),{success:!0,message:"Scrolled to bottom"};const t=document.querySelector(e);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),{success:!0,message:"Scrolled to element"}):{success:!1,message:`Element not found: ${e}`}}catch(e){return{success:!1,message:"Failed to scroll",error:String(e)}}}async highlightElement(e){if(!this.isSelectorAllowed(e))return{success:!1,message:`Selector "${e}" is not allowed`};if("undefined"==typeof document)return{success:!0,message:`Highlight on "${e}" would be shown (server-side)`};try{const t=document.querySelector(e);if(!t)return{success:!1,message:`Element not found: ${e}`};this.removeHighlight(),t.scrollIntoView({behavior:"smooth",block:"center"}),await this.sleep(300);const n=t.getBoundingClientRect(),r=document.createElement("div");return r.className="astermind-highlight-overlay",r.style.cssText=`\n position: fixed;\n top: ${n.top-4}px;\n left: ${n.left-4}px;\n width: ${n.width+8}px;\n height: ${n.height+8}px;\n border: 3px solid #4F46E5;\n border-radius: 4px;\n pointer-events: none;\n z-index: 999999;\n animation: astermind-highlight-pulse 1s ease-in-out 3;\n `,document.body.appendChild(r),this.highlightOverlay=r,setTimeout(()=>this.removeHighlight(),3e3),{success:!0,message:"Element highlighted"}}catch(e){return{success:!1,message:"Failed to highlight element",error:String(e)}}}async executeCustomAction(e,t){if(!this.isAllowedCustomAction(e))return{success:!1,message:`Custom action "${e}" not found`};const n=this.config.customActions[e];try{return await n(t)}catch(t){return{success:!1,message:`Custom action "${e}" failed`,error:String(t)}}}isInternalUrl(e){if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))return!0;if("undefined"==typeof window)return!0;try{return new URL(e,window.location.href).origin===window.location.origin}catch{return!0}}tryClientSideNavigation(e){if("undefined"==typeof window)return!1;try{return window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),e.includes("#")&&window.dispatchEvent(new HashChangeEvent("hashchange")),!0}catch{return!1}}validateNavigationUrl(e){if(/^(javascript|data):/i.test(e))return!1;if("undefined"==typeof window)return!0;try{return new URL(e,window.location.href).origin===window.location.origin||e.startsWith("/")}catch{return e.startsWith("/")}}sanitizeSelector(e){return e.replace(/[<>'"]/g,"").replace(/javascript:/gi,"").replace(/data:/gi,"").trim()}isAllowedCustomAction(e){return void 0!==this.config.customActions&&Object.prototype.hasOwnProperty.call(this.config.customActions,e)}removeHighlight(){this.highlightOverlay&&(this.highlightOverlay.remove(),this.highlightOverlay=null)}injectStyles(){if("undefined"==typeof document)return;if(document.getElementById("astermind-agent-styles"))return;const e=document.createElement("style");e.id="astermind-agent-styles",e.textContent="\n @keyframes astermind-highlight-pulse {\n 0%, 100% {\n box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);\n }\n 50% {\n box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);\n }\n }\n\n .astermind-highlight-overlay {\n transition: all 0.2s ease-out;\n }\n ",document.head.appendChild(e)}sleep(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return this.config}getClassifier(){return this.classifier}resetActionCount(){this.actionCount=0,this.lastActionReset=Date.now()}}const Od={hiddenUnits:50,activation:"relu",ridgeLambda:.01,weightInit:"xavier",seed:1337,dropout:0,log:{verbose:!0,toFile:!1,modelName:"Unnamed ELM Model",level:"info"}};function jd(e){let t=0,n=0;for(;0===t;)t=e();for(;0===n;)n=e();return Math.sqrt(-2*Math.log(t))*Math.cos(2*Math.PI*n)}Object.assign(Object.assign({},Od),{useTokenizer:!1}),Object.assign(Object.assign({},Od),{useTokenizer:!0,maxLen:30,charSet:"abcdefghijklmnopqrstuvwxyz",tokenizerDelimiter:/\s+/});class $d{constructor(e,t,n=1e-4){this.p=e,this.m=t,this.lambda=n,this.Ainv=new Float64Array(e*e),this.Beta=new Float64Array(e*t);const r=1/Math.max(1e-12,n);for(let t=0;t<e;t++)this.Ainv[t*e+t]=r}update(e,t){const{p:n,m:r,Ainv:a,Beta:o}=this,i=new Float64Array(n);for(let t=0;t<n;t++){let r=0,o=t*n;for(let t=0;t<n;t++)r+=a[o+t]*e[t];i[t]=r}let s=1;for(let t=0;t<n;t++)s+=e[t]*i[t];s=Math.max(s,1e-12);const l=1/s;for(let e=0;e<n;e++){const t=i[e]*l;for(let r=0;r<n;r++)a[e*n+r]-=t*i[r]}for(let t=0;t<n;t++){let r=0,o=t*n;for(let t=0;t<n;t++)r+=a[o+t]*e[t];i[t]=r}for(let e=0;e<n;e++){const n=i[e];for(let a=0;a<r;a++)o[e*r+a]+=n*t[a]}}predict(e){const{p:t,m:n,Beta:r}=this,a=new Float64Array(n);for(let o=0;o<n;o++){let i=0;for(let a=0;a<t;a++)i+=e[a]*r[a*n+o];a[o]=i}return a}}function Ud(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(Math.max(0,t))}function Bd(e,t){var n,r;const a=Math.min(e.length,t.length);if(0===a)return 0;let o=0,i=0,s=0;for(let l=0;l<a;l++){const a=null!==(n=e[l])&&void 0!==n?n:0,c=null!==(r=t[l])&&void 0!==r?r:0;o+=a*c,i+=a*a,s+=c*c}const l=o/Math.sqrt(Math.max(i*s,1e-12));return Number.isFinite(l)?l:0}function Vd(e,t,n,r){return new(n||(n=Promise))(function(a,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,s)}l((r=r.apply(e,t||[])).next())})}function Wd(e){return e.replace(/\s+/g," ").split(/(?<=[.?!])\s+/).map(e=>e.trim()).filter(e=>e.length>8&&/\w/.test(e))}function Hd(e){return e.replace(/```[\s\S]*?```/g," ").replace(/`[^`]+`/g," ").replace(/\[[^\]]*\]\([^)]*\)/g,"").replace(/[-–>•→]/g," ").replace(/\s+/g," ").trim()}function Kd(e,t){return Vd(this,arguments,void 0,function*(e,t,n={}){if(!(null==t?void 0:t.length))return"No results found.";const{dim:r=64,features:a=32,sigma:o=1,rounds:i=3,topSentences:s=8,personality:l="neutral"}=n;let c=Wd(t.map(e=>Hd(e.content)).join(" ")).filter(e=>!function(e){return/^(\*|#)/.test(e)||/chapter/i.test(e)||/part\s*\d+/i.test(e)||/section/i.test(e)||/^\s*[A-Z]\)\s*$/.test(e)||e.length<15}(e)).slice(0,120);if(0===c.length)return Hd(t[0].content).slice(0,400);const u=function(e,t,n=1,r=Math.random){const a=new Float64Array(t*e),o=new Float64Array(t),i=1/Math.max(1e-12,n);for(let n=0;n<t*e;n++)a[n]=jd(r)*i;for(let e=0;e<t;e++)o[e]=2*r()*Math.PI;return{W:a,b:o,D:t,d:e,sigma:n}}(r,a,o),d=new $d(2*a,1,.001),f=e=>{const t=new Float64Array(r),n=Math.min(e.length,r);for(let r=0;r<n;r++)t[r]=e.charCodeAt(r)/255;return function(e,t){const{W:n,b:r,D:a,d:o}=e,i=new Float64Array(2*a);for(let e=0;e<a;e++){let s=r[e];const l=e*o;for(let e=0;e<o;e++)s+=n[l+e]*(t[e]||0);i[e]=Math.cos(s),i[a+e]=Math.sin(s)}let s=0;for(let e=0;e<i.length;e++)s+=i[e]*i[e];const l=1/Math.sqrt(Math.max(s,1e-12));for(let e=0;e<i.length;e++)i[e]*=l;return i}(u,function(e,t=1e-12){const n=Ud(e);if(!(n>t&&Number.isFinite(n)))return new Float64Array(e.length);const r=new Float64Array(e.length),a=1/n;for(let t=0;t<e.length;t++)r[t]=e[t]*a;return r}(t))},h=f(e),p=e.toLowerCase().split(/\W+/).filter(e=>e.length>2),m=c.map(e=>{const t=f(e);let n=Bd(t,h);const r=e.toLowerCase();for(const e of p)r.includes(e)&&(n+=.02);return{s:e,v:t,w:n}});m.sort((e,t)=>t.w-e.w);let g=m.slice(0,s).map(e=>e.s).join(" "),y=new Float64Array(2*a);for(let e=0;e<i;e++){const e=Wd(g).slice(0,s),t=e.map(e=>f(e)),n=t.map(e=>Bd(e,h));for(let e=0;e<t.length;e++)d.update(t[e],new Float64Array([n[e]]));y.fill(0);for(let e=0;e<t.length;e++){const r=t[e],a=n[e];for(let e=0;e<r.length;e++)y[e]+=r[e]*a}const r=Ud(y)||1;for(let e=0;e<y.length;e++)y[e]/=r;const a=e.map(e=>({s:e,w:Bd(f(e),y)}));a.sort((e,t)=>t.w-e.w),g=a.slice(0,Math.max(3,Math.floor(s/2))).map(e=>e.s).join(" ")}g=function(e){return e.replace(/\s+[-–>•→]\s+/g," ").replace(/\s+\.\s+/g,". ").replace(/([a-z]) - ([a-z])/gi,"$1-$2").replace(/\s{2,}/g," ").trim()}(g);return`${"teacher"===l?"Here’s a simple way to think about it:\n\n":"scientist"===l?"From the retrieved material, we can infer:\n\n":""}${g.charAt(0).toUpperCase()+g.slice(1)}\n\n(${t[0].heading||"Answer"}, Ω-synthesized)`})}function qd(e,t){let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function Qd(e,t,n,r){if("cosine"===n){const n=qd(e,t),r=Math.hypot(...e),a=Math.hypot(...t);return r&&a?n/(r*a):0}if("poly2"===n){const n=qd(e,t);return Math.pow(n+1,2)}{let n=0;for(let r=0;r<e.length;r++){const a=e[r]-t[r];n+=a*a}return Math.exp(-n/Math.max(1e-9,2*r*r))}}function Gd(e,t,n,r,a){const o=function(e,t){const n=new Float64Array(t);for(const[t,r]of e)n[t]=r;return n}(e,t),i=new Float64Array(n.length);for(let e=0;e<n.length;e++){const t=n[e];i[e]=Qd(o,t,r,a)}const s=Math.hypot(...i);if(s>0)for(let e=0;e<i.length;e++)i[e]/=s;return i}"function"==typeof SuppressedError&&SuppressedError;const Yd=new Map;function Xd(e){const t=e,n=Yd.get(t);if(n)return n;let r=e.toLowerCase();if(r=r.replace(/^[^a-z0-9]+|[^a-z0-9]+$/g,""),r.length<=2)return Yd.set(t,r),r;r.endsWith("ies")&&r.length>4?r=r.slice(0,-3)+"y":/(xes|ches|shes|zes|sses)$/.test(r)&&r.length>4?r=r.replace(/(xes|ches|shes|zes|sses)$/,e=>"sses"===e?"ss":e.replace(/es$/,"")):r.endsWith("s")&&!/(ss|us)$/.test(r)&&r.length>3&&(r=r.slice(0,-1));const a=[[/ization$|isation$/,"ize"],[/ational$/,"ate"],[/fulness$/,"ful"],[/ousness$/,"ous"],[/iveness$/,"ive"],[/ability$/,"able"],[/ness$/,""],[/ment$/,""],[/ations?$/,"ate"],[/izer$|iser$/,"ize"],[/ally$/,"al"],[/ically$/,"ic"],[/ingly$|edly$/,""],[/ing$|ed$/,""]];for(const[e,t]of a)if(e.test(r)&&r.length-t.length>=4){r=r.replace(e,t);break}return Yd.set(t,r),r}function Jd(e,t){const n=Array.from(e,(e,t)=>t);return n.sort((t,n)=>e[n]-e[t]),n.slice(0,t)}function Zd(e){const{query:t,chunks:n,vocabMap:r,idf:a,tfidfDocs:o,denseDocs:i,landmarksIdx:s,landmarkMat:l,vocabSize:c,kernel:u,sigma:d,alpha:f,beta:h,ridge:p,headingW:m,useStem:g,expandQuery:y,topK:v,prefilter:b}=e,w=y?function(e){const t=[];return/\bmap\b/.test(e)&&t.push("dict key value make"),/\bchan|channel\b/.test(e)&&t.push("goroutine concurrency select buffer"),/\berror\b/.test(e)&&t.push("fmt wrap unwrap sentinel try catch"),/\bstruct\b/.test(e)&&t.push("field method receiver init zero value"),e+" "+t.join(" ")}(t):t,S=function(e,t){const n=e.toLowerCase().replace(/[`*_>~]/g," ").replace(/[^a-z0-9]+/g," ").split(/\s+/).filter(Boolean);if(!t)return n;const r=[];for(const e of n){const t=Xd(e);t&&t.length>1&&r.push(t)}return r}(w,g),k=function(e,t,n,r=1){const a=new Map;for(let t=0;t<e.length;t++){const o=e[t],i=n.get(o);if(void 0===i)continue;const s=t<8?r:1;a.set(i,(a.get(i)||0)+s)}const o=Math.max(1,...a.values()),i=new Map;for(const[e,n]of a){const r=.5+n/o*.5;i.set(e,r*(t[e]||0))}return i}(S,a,r,m),x=Gd(k,c,l,u,d),C=o.map(e=>function(e,t){let n=0,r=0,a=0;for(const[a,o]of e){r+=o*o;const e=t.get(a);e&&(n+=o*e)}for(const[,e]of t)a+=e*e;return r&&a?n/(Math.sqrt(r)*Math.sqrt(a)):0}(e,k)),E=i.map(e=>function(e,t,n,r){if("cosine"===n){const n=qd(e,t),r=Math.hypot(...e),a=Math.hypot(...t);return r&&a?n/(r*a):0}if("poly2"===n){const n=qd(e,t);return Math.pow(n+1,2)}{let n=0;for(let r=0;r<e.length;r++){const a=e[r]-t[r];n+=a*a}return Math.exp(-n/Math.max(1e-9,2*r*r))}}(e,x,u,d)),_=function(e,t){const n=Array.from(new Set(t.toLowerCase().split(/\W+/).filter(e=>e.length>2))),r=/\b(define|declare|syntax|example|function|struct|map|interface)\b/i.test(t);return e.map(e=>{const t=e.rich||e.content||"",a=t.toLowerCase();let o=0;for(const e of n)a.includes(e)&&o++;return r&&/```/.test(t)&&(o+=5),Math.min(1,.03*o)})}(n,t),M=function(e,t,n){return Math.max(t,Math.min(n,e))}(f,0,1),L=null!=p?p:.08,N=E.map((e,t)=>{const n=C[t],r=h*_[t],a=1/(1+L*(e*e+n*n+.5*r*r))*(M*e+(1-M)*n+r);return Math.tanh(a)}),A=Math.max(v,null!=b?b:0),P=Jd(N,A),R=Jd(P.map(e=>N[e]),v).map(e=>P[e]);return{items:R.map(e=>{const t=n[e],r=t.rich&&t.rich.trim()||t.content&&t.content.trim()||"(see subsections)";return{score:N[e],heading:t.heading,content:r,index:e}}),scores:R.map(e=>N[e]),indices:R,tfidfScores:R.map(e=>C[e]),denseScores:R.map(e=>E[e])}}const ef=new Set(["a","an","the","and","or","but","if","then","else","for","to","of","in","on","at","by","with","is","are","was","were","be","been","being","as","from","that","this","it","its","you","your","i","we","they","he","she","them","his","her","our","us","do","does","did","done","not","no","yes","can","could","should","would","may","might","into","about","over","under","between"]);function tf(e){return e.toLowerCase().replace(/[`*_#>~=\[\]{}()!?.:,;'"<>|/\\+-]+/g," ").split(/\s+/).filter(e=>e&&!ef.has(e))}function nf(e){const t=new Map,n=[],r=[];let a=0;for(const o of e){const e=tf(o);r.push(e.length);const i=new Map;for(const n of e){let e=t.get(n);void 0===e&&(e=a++,t.set(n,e)),i.set(e,(i.get(e)||0)+1)}n.push(i)}const o=e.length,i=Array(a).fill(0);for(const e of n)for(const t of e.keys())i[t]+=1;const s=i.map(e=>Math.log((o+1)/(e+1))+1),l=r.reduce((e,t)=>e+t,0)/Math.max(1,o);return{stats:{vocab:t,idf:s,avgLen:l,df:i},tf:n,docLens:r}}function rf(e,t){const n=new Map;let r=0;for(const[a,o]of e){const e=o*(t[a]||0);n.set(a,e),r+=e*e}const a=Math.sqrt(r)||1e-12;for(const[e,t]of n)n.set(e,t/a);return n}function af(e,t){const[n,r]=e.size<t.size?[e,t]:[t,e];let a=0;for(const[e,t]of n){const n=r.get(e);void 0!==n&&(a+=t*n)}return a}function of(e,t,n=1337){const r=new Float64Array(t);for(const[n,a]of e){let e=2654435761*n>>>0;for(let n=0;n<t;n++){e^=e<<13,e^=e>>>17,e^=e<<5;const t=(e>>>0)/4294967296*2-1;r[n]+=a*t}}let a=0;for(let e=0;e<t;e++)a+=r[e]*r[e];const o=Math.sqrt(a)||1e-12;for(let e=0;e<t;e++)r[e]/=o;return r}function sf(e){return/```+\s*go([\s\S]*?)```/i.test(e)||/\bfunc\s+\w+\s*\(.*\)\s*\w*\s*{/.test(e)}function lf(e){return/```+/.test(e)||/{[^}]*}/.test(e)}function cf(e,t){const n=(r=tf(e),Array.from(new Set(r)));var r;const a=new Set(tf(t));if(0===n.length||0===a.size)return 0;let o=0;for(const e of n)a.has(e)&&o++;return o/n.length}function uf(e,t,n,r,a,o,i,s,l,c){var u;const d=[],f=[],h=af(n,r);d.push(h),f.push("cosine_tfidf");const p=function(e,t,n,r,a=1.5,o=.75){let i=0;for(const[s]of e){const e=t.get(s)||0;e<=0||(i+=Math.log(((n.df[s]||0)+.5)/(n.idf.length-(n.df[s]||0)+.5)+1)*(e*(a+1)/(e+a*(1-o+o*(r/(n.avgLen||1)))||1e-12)))}return i}(a,o,i,s);d.push(p),f.push("bm25");const m=cf(t.heading||"",e);d.push(m),f.push("heading_match_frac");const g=function(e,t){const n=new Set(tf(e)),r=new Set(tf(t));let a=0;for(const e of n)r.has(e)&&a++;const o=n.size+r.size-a;return 0===o?0:a/o}(e,t.content||"");d.push(g),f.push("jaccard_tokens");const y=sf(t.rich||t.content||""),v=lf(t.rich||t.content||"");var b;d.push(y?1:0),f.push("flag_go_code"),d.push(v?1:0),f.push("flag_any_code"),d.push((b=t.content||"",!/(golang\.org|go\.dev|pkg\.go\.dev)/i.test(b)?0:1)),f.push("flag_go_spec_link"),d.push(null!==(u=t.score_base)&&void 0!==u?u:0),f.push("prior_score_base");const w=(t.content||"").length;if(d.push(1/Math.sqrt(1+w)),f.push("len_inv_sqrt"),l&&c){let e=0,t=0;for(let n=0;n<l.length;n++)e+=l[n]*c[n],t+=Math.abs(l[n]-c[n]);d.push(e),f.push("proj_dot"),d.push(t/l.length),f.push("proj_l1mean")}return{names:f,values:d}}class df{constructor(){this.w=null,this.mu=null,this.sigma=null}fit(e,t,n=.01){var r;const a=e.length,o=(null===(r=e[0])||void 0===r?void 0:r.length)||0;if(0===a||0===o)return void(this.w=new Float64Array(o));const i=new Float64Array(o),s=new Float64Array(o);for(let t=0;t<o;t++){let n=0;for(let r=0;r<a;r++)n+=e[r][t];n/=a,i[t]=n;let r=0;for(let o=0;o<a;o++){const a=e[o][t]-n;r+=a*a}s[t]=Math.sqrt(r/a)||1}const l=Array.from({length:a},(e,t)=>new Float64Array(o));for(let t=0;t<a;t++)for(let n=0;n<o;n++)l[t][n]=(e[t][n]-i[n])/s[n];const c=Array.from({length:o},()=>new Float64Array(o)),u=new Float64Array(o);for(let e=0;e<a;e++){const n=l[e],r=t[e];for(let e=0;e<o;e++){u[e]+=n[e]*r;const t=n[e];for(let r=0;r<=e;r++)c[e][r]+=t*n[r]}}for(let e=0;e<o;e++){for(let t=0;t<e;t++)c[t][e]=c[e][t];c[e][e]+=n}const d=Array.from({length:o},()=>new Float64Array(o));for(let e=0;e<o;e++)for(let t=0;t<=e;t++){let n=c[e][t];for(let r=0;r<t;r++)n-=d[e][r]*d[t][r];d[e][t]=e===t?Math.sqrt(Math.max(n,1e-12)):n/(d[t][t]||1e-12)}const f=new Float64Array(o);for(let e=0;e<o;e++){let t=u[e];for(let n=0;n<e;n++)t-=d[e][n]*f[n];f[e]=t/(d[e][e]||1e-12)}const h=new Float64Array(o);for(let e=o-1;e>=0;e--){let t=f[e];for(let n=e+1;n<o;n++)t-=d[n][e]*h[n];h[e]=t/(d[e][e]||1e-12)}this.w=h,this.mu=i,this.sigma=s}predict(e){if(!this.w||!this.mu||!this.sigma)return 0;let t=0;for(let n=0;n<this.w.length;n++){const r=(e[n]-this.mu[n])/this.sigma[n];t+=this.w[n]*r}return t}}function ff(e,t,n){var r;const a=t.rich||t.content||"";let o=0;/\bgo\b/.test(e.toLowerCase())&&/(define|declare|function|func)/i.test(e)&&sf(a)&&(o=Math.max(o,1));cf(t.heading||"",e)>=.34&&lf(a)&&(o=Math.max(o,.8));const i=n.names.indexOf("cosine_tfidf"),s=n.names.indexOf("bm25"),l=i>=0?n.values[i]:0,c=s>=0?n.values[s]:0;l>.25&&(o=Math.max(o,.6)),c>1&&(o=Math.max(o,.6));const u=n.names.indexOf("prior_score_base"),d=u>=0?n.values[u]:0;return(null!==(r=t.score_base)&&void 0!==r?r:0)>0&&(o=Math.max(o,Math.min(.6,.2+.5*d))),o}function hf(e,t,n={}){var r,a;const{lambdaRidge:o=.01,randomProjDim:i=32,exposeFeatures:s=!0,attachFeatureNames:l=!1}=n,c=[e,...t.map(e=>e.content||"")],{stats:u,tf:d,docLens:f}=nf(c),h=d.map(e=>rf(e,u.idf)),p=d[0],m=h[0],g=i>0?of(m,i):void 0,y=[],v=[],b=[];for(let n=0;n<t.length;n++){const r=t[n],a=d[n+1],o=h[n+1],s=i>0?of(o,i,1337+n):void 0,l=uf(e,r,m,o,p,a,u,f[n+1]||1,g,s);b.push(l),y.push(l.values);const c=ff(e,r,l);v.push(c)}const w=v.every(e=>Math.abs(e-v[0])<1e-9);if(w){const e=b[0].names.indexOf("cosine_tfidf");if(e>=0)for(let t=0;t<v.length;t++)v[t]=Math.max(0,Math.min(1,.2+.6*y[t][e]))}const S=new df;S.fit(y,v,o);let k=1/0,x=-1/0;const C=y.map(e=>S.predict(e));for(const e of C)e<k&&(k=e),e>x&&(x=e);const E=Math.max(1e-9,x-k),_=l?null!==(a=null===(r=b[0])||void 0===r?void 0:r.names)&&void 0!==a?a:[]:void 0,M=t.map((e,t)=>{const n=(C[t]-k)/E,r=function(e){if(e>=0)return 1/(1+Math.exp(-e));{const t=Math.exp(e);return t/(1+t)}}((C[t]-.5*(k+x))/(.2*E+1e-6)),a=Object.assign(Object.assign({},e),{score_rr:n,p_relevant:r});return s&&(a._features=y[t]),_&&(a._feature_names=_),a});return M.sort((e,t)=>t.score_rr-e.score_rr),M}function pf(e,t={}){const{probThresh:n=.45,epsilonTop:r=.05,useMMR:a=!0,mmrLambda:o=.7,budgetChars:i=1200}=t;if(0===e.length)return[];const s=e[0].score_rr,l=e.filter(e=>e.p_relevant>=n&&e.score_rr>=s-r),c=l.length>0?l:[e[0]];if(!a){const e=[];let t=0;for(const n of c){const r=(n.content||"").length;if(t+r>i&&e.length>0)break;e.push(n),t+=r}return e}return function(e,t=.7,n=1200){const r=[],a=e.map(e=>e.content||""),{stats:o,tf:i}=nf(a),s=i.map(e=>rf(e,o.idf)),l=new Set;let c=0;for(;l.size<e.length;){let a=-1,o=-1/0;for(let n=0;n<e.length;n++){if(l.has(n))continue;const r=e[n];let i=0;for(const e of l){const t=af(s[n],s[e]);t>i&&(i=t)}const c=t*r.score_rr-(1-t)*i;c>o&&(o=c,a=n)}if(a<0)break;const i=e[a],u=(i.content||"").length;if(c+u>n&&r.length>0)break;r.push(i),c+=u,l.add(a)}return r}(e.map(e=>Object.assign(Object.assign({},e),{score_rr:c.includes(e)?e.score_rr+.01:e.score_rr})),o,i)}var mf=Object.freeze({__proto__:null,OmegaOfflineRAG:class{constructor(e){this.modelState=null,this.model=null,this.config={reranking:{enabled:e?.reranking?.enabled??!0,lambdaRidge:e?.reranking?.lambdaRidge??.1,useMMR:e?.reranking?.useMMR??!0,mmrLambda:e?.reranking?.mmrLambda??.5,probThresh:e?.reranking?.probThresh??.1},topK:e?.topK??5,verbose:e?.verbose??!1}}async loadModel(e){const t=performance.now();if(this.model=e,this.modelState=function(e){if("astermind-pro-v1"!==e.version&&"astermind-elm-v1"!==e.version)throw new Error(`Unsupported model version: ${e.version}. Expected 'astermind-pro-v1' or 'astermind-elm-v1'`);const t=JSON.parse(JSON.stringify(e.settings||{})),n=new Map(e.vocab),r=Float64Array.from(e.idf),a=e.chunks.map(e=>({heading:e.heading,content:e.content||"",rich:e.rich,level:e.level,secId:e.secId})),o=e.tfidfDocs.map(e=>{const t=new Map;for(const[n,r]of e)t.set(n,r);return t}),i=Array.from(e.landmarksIdx),s=e.landmarkMat.map(e=>Float64Array.from(e));let l;if(!e.denseDocs||e.denseDocs.length!==o.length)throw new Error("recomputeDense=true but buildDense function not provided");return l=e.denseDocs.map(e=>Float64Array.from(e)),{settings:t,vocabMap:n,idf:r,chunks:a,tfidfDocs:o,landmarksIdx:i,landmarkMat:s,denseDocs:l}}(e),this.config.verbose){const e=performance.now()-t;console.log(`[OmegaOfflineRAG] Model loaded in ${e.toFixed(0)}ms`),console.log(`[OmegaOfflineRAG] ${this.modelState.chunks.length} chunks, ${this.modelState.vocabMap.size} vocab`)}}async loadModelFromUrl(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch model from ${e}: ${t.status}`);const n=await t.json();await this.loadModel(n)}isReady(){return null!==this.modelState}getModelInfo(){return this.model&&this.modelState?{version:this.model.version,savedAt:this.model.savedAt,documentCount:this.modelState.chunks.length,vocabularySize:this.modelState.vocabMap.size,landmarkCount:this.modelState.landmarksIdx.length,hasDenseVectors:this.modelState.denseDocs.length>0,settings:this.model.settings}:null}async ask(e){const t=performance.now();if(!this.modelState||!this.model)return{answer:"Omega model not loaded. Please load a model first.",confidence:"none",sources:[],processingTime:0,degraded:!0,degradedReason:"Model not loaded"};try{const n=this.model.settings,r=n.kernel??"rbf",a=n.sigma??1,o=n.alpha??.5,i=n.beta??.3,s=n.ridge??.001,l=n.headingW??.2,c=n.useStem??!0,u=n.expandQuery??!1,d=n.prefilter??100,f=Zd({query:e,chunks:this.modelState.chunks,vocabMap:this.modelState.vocabMap,idf:this.modelState.idf,tfidfDocs:this.modelState.tfidfDocs,denseDocs:this.modelState.denseDocs,landmarksIdx:this.modelState.landmarksIdx,landmarkMat:this.modelState.landmarkMat,vocabSize:this.modelState.vocabMap.size,kernel:r,sigma:a,alpha:o,beta:i,ridge:s,headingW:l,useStem:c,expandQuery:u,topK:2*this.config.topK,prefilter:d});let h;if(this.config.reranking.enabled&&f.items.length>0){const t=function(e,t,n={}){return pf(hf(e,t,n),n)}(e,f.items.map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score_base:f.scores[t]})),{lambdaRidge:this.config.reranking.lambdaRidge,useMMR:this.config.reranking.useMMR,mmrLambda:this.config.reranking.mmrLambda,probThresh:this.config.reranking.probThresh});h=t.slice(0,this.config.topK).map(e=>({heading:e.heading,content:e.content,rich:e.rich,score:e.score_base??0,rerankScore:e.score_rr,probability:e.p_relevant}))}else h=f.items.slice(0,this.config.topK).map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score:f.scores[t]}));const p=await Kd(e,h.map(e=>({heading:e.heading,content:e.content,score:e.score}))),m=performance.now()-t,g=h[0]?.score??0,y=this.determineConfidence(g,h.length);return{answer:p,confidence:y,sources:h,processingTime:m,degraded:!1,queryClassification:this.classifyQuery(e)}}catch(e){const n=performance.now()-t;return console.error("[OmegaOfflineRAG] Error during retrieval:",e),{answer:"An error occurred while processing your question offline.",confidence:"none",sources:[],processingTime:n,degraded:!0,degradedReason:e instanceof Error?e.message:"Unknown error"}}}async retrieve(e,t){if(!this.modelState||!this.model)return[];const n=t??this.config.topK,r=this.model.settings,a=r.kernel??"rbf",o=r.sigma??1,i=r.alpha??.5,s=r.beta??.3,l=r.ridge??.001,c=r.headingW??.2,u=r.useStem??!0,d=r.expandQuery??!1,f=r.prefilter??100,h=Zd({query:e,chunks:this.modelState.chunks,vocabMap:this.modelState.vocabMap,idf:this.modelState.idf,tfidfDocs:this.modelState.tfidfDocs,denseDocs:this.modelState.denseDocs,landmarksIdx:this.modelState.landmarksIdx,landmarkMat:this.modelState.landmarkMat,vocabSize:this.modelState.vocabMap.size,kernel:a,sigma:o,alpha:i,beta:s,ridge:l,headingW:c,useStem:u,expandQuery:d,topK:n,prefilter:f});return h.items.map((e,t)=>({heading:e.heading,content:e.content,rich:e.rich,score:h.scores[t]}))}classifyQuery(e){const t=e.toLowerCase(),n=t.split(/\s+/),r=["what","who","when","where","which","is","are","was","were"],a=["how","steps","guide","tutorial","process","procedure"],o=["why","explain","describe","meaning","definition","concept"],i=["go to","navigate","find","page","link","take me","show me"];let s="unknown",l=.5;const c=[];for(const e of i)if(t.includes(e)){s="navigational",l=.8,c.push(e);break}if("unknown"===s){const e=n[0];a.includes(e)||a.some(e=>t.includes(e))?(s="procedural",l=.7,c.push(...a.filter(e=>t.includes(e)))):o.includes(e)||o.some(e=>t.includes(e))?(s="conceptual",l=.7,c.push(...o.filter(e=>t.includes(e)))):r.includes(e)&&(s="factual",l=.7,c.push(e))}return{type:s,confidence:l,keywords:c}}determineConfidence(e,t){return 0===t?"none":e>=.7||e>=.4?"medium":"low"}clear(){this.modelState=null,this.model=null}}});function gf({onClick:e,position:t,unreadCount:n=0}){return ad.jsxs("button",{className:`astermind-bubble astermind-bubble--${t}`,onClick:e,"aria-label":"Open chat",type:"button",children:[ad.jsx("svg",{className:"astermind-bubble__icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ad.jsx("path",{d:"M21 11.5C21.0034 12.8199 20.6951 14.1219 20.1 15.3C19.3944 16.7118 18.3098 17.8992 16.9674 18.7293C15.6251 19.5594 14.0782 19.9994 12.5 20C11.1801 20.0035 9.87812 19.6951 8.7 19.1L3 21L4.9 15.3C4.30493 14.1219 3.99656 12.8199 4 11.5C4.00061 9.92179 4.44061 8.37488 5.27072 7.03258C6.10083 5.69028 7.28825 4.6056 8.7 3.90003C9.87812 3.30496 11.1801 2.99659 12.5 3.00003H13C15.0843 3.11502 17.053 3.99479 18.5291 5.47089C20.0052 6.94699 20.885 8.91568 21 11V11.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),n>0&&ad.jsx("span",{className:"astermind-bubble__badge",children:n})]})}function yf({title:e,subtitle:t,onClose:n,children:r}){return ad.jsxs("div",{className:"astermind-header",children:[ad.jsxs("div",{className:"astermind-header__info",children:[ad.jsx("h3",{className:"astermind-header__title",children:e}),t&&ad.jsx("p",{className:"astermind-header__subtitle",children:t})]}),ad.jsxs("div",{className:"astermind-header__actions",children:[r,ad.jsx("button",{className:"astermind-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:ad.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ad.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})}function vf(e){if(!e)return"";return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\n/g,"<br />")}function bf(){return ad.jsxs("svg",{className:"astermind-source__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ad.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),ad.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function wf(){return ad.jsxs("svg",{className:"astermind-source__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ad.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),ad.jsx("polyline",{points:"7 10 12 15 17 10"}),ad.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Sf({source:e,showSummaryButton:t,showDownloadButton:n,onViewSummary:r,onDownload:a}){const[o,i]=j.useState(!1);return ad.jsxs("div",{className:"astermind-source",children:[ad.jsxs("div",{className:"astermind-source__header",children:[ad.jsx("span",{className:"astermind-source__title",children:e.documentName||e.title}),ad.jsxs("div",{className:"astermind-source__actions",children:[t&&ad.jsx("button",{className:"astermind-source__action-btn",onClick:t=>{t.stopPropagation(),e.fullContent&&i(!o),r?.(e)},title:"View summary","aria-label":"View source summary",children:ad.jsx(bf,{})}),n&&ad.jsx("button",{className:"astermind-source__action-btn",onClick:t=>{t.stopPropagation(),a?.(e)},title:"Download source","aria-label":"Download source file",children:ad.jsx(wf,{})}),ad.jsxs("span",{className:"astermind-source__relevance",children:[Math.round(100*e.relevance),"%"]})]})]}),ad.jsx("p",{className:"astermind-source__snippet",children:e.snippet}),o&&e.fullContent&&ad.jsx("div",{className:"astermind-source__full-content",dangerouslySetInnerHTML:{__html:vf(e.fullContent)}})]})}function kf({sources:e,config:t={},isOnline:n=!0,onViewSummary:r,onDownload:a}){const{enabled:o=!0,showSummary:i=!0,showDownload:s=!0}=t;return o&&0!==e.length?ad.jsx("div",{className:"astermind-sources",children:e.map((e,t)=>{const o=i&&!!e.fullContent,l=s&&n&&!!e.downloadUrl;return ad.jsx(Sf,{source:e,showSummaryButton:o,showDownloadButton:l,onViewSummary:r,onDownload:a},e.chunkId||e.documentId||t)})}):null}function xf(e){const t=new Date,n=t.getTime()-e.getTime();if(n<6e4)return"Just now";if(n<36e5){return`${Math.floor(n/6e4)}m ago`}return e.toDateString()===t.toDateString()?e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):e.toLocaleDateString([],{month:"short",day:"numeric"})}function Cf({message:e,sourceConfig:t,isOnline:n=!0,onViewSourceSummary:r,onDownloadSource:a}){const[o,i]=j.useState(!1);return ad.jsxs("div",{className:`astermind-message astermind-message--${e.role}`,children:[ad.jsx("div",{className:"astermind-message__bubble",children:e.isStreaming&&!e.content?ad.jsxs("span",{className:"astermind-message__typing",children:[ad.jsx("span",{}),ad.jsx("span",{}),ad.jsx("span",{})]}):ad.jsx("div",{className:"astermind-message__content",dangerouslySetInnerHTML:{__html:vf(e.content)}})}),ad.jsxs("div",{className:"astermind-message__meta",children:[ad.jsx("span",{className:"astermind-message__time",children:xf(e.timestamp)}),e.offline&&ad.jsx("span",{className:"astermind-message__offline",title:"Offline response",children:"offline"}),e.confidence&&"high"!==e.confidence&&ad.jsx("span",{className:`astermind-message__confidence astermind-message__confidence--${e.confidence}`,title:`Confidence: ${e.confidence}`,children:e.confidence})]}),e.sources&&e.sources.length>0&&ad.jsxs("div",{className:"astermind-message__sources",children:[ad.jsxs("button",{className:"astermind-message__sources-toggle",onClick:()=>i(!o),type:"button",children:[o?"Hide":"Show"," sources (",e.sources.length,")"]}),o&&ad.jsx(kf,{sources:e.sources,config:t,isOnline:n,onViewSummary:r,onDownload:a})]})]})}function Ef(){return ad.jsxs("div",{className:"astermind-typing",children:[ad.jsx("span",{}),ad.jsx("span",{}),ad.jsx("span",{})]})}function _f({messages:e,isProcessing:t,sourceConfig:n,isOnline:r=!0,onViewSourceSummary:a,onDownloadSource:o}){const i=j.useRef(null);return j.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,t]),ad.jsxs("div",{className:"astermind-messages",ref:i,children:[e.map(e=>ad.jsx(Cf,{message:e,sourceConfig:n,isOnline:r,onViewSourceSummary:a,onDownloadSource:o},e.id)),t&&""===e[e.length-1]?.content&&ad.jsx(Ef,{})]})}function Mf({placeholder:e,disabled:t=!1,onSend:n}){const[r,a]=j.useState(""),o=j.useRef(null),i=()=>{r.trim()&&!t&&(n(r.trim()),a(""),o.current?.focus())};return ad.jsxs("div",{className:"astermind-input",children:[ad.jsx("textarea",{ref:o,className:"astermind-input__textarea",value:r,onChange:e=>{const t=e.target;a(t.value),t.style.height="auto",t.style.height=Math.min(t.scrollHeight,120)+"px"},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i())},placeholder:e,disabled:t,rows:1,"aria-label":"Message input"}),ad.jsx("button",{className:"astermind-input__send",onClick:i,disabled:t||!r.trim(),"aria-label":"Send message",type:"button",children:ad.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:ad.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})})})]})}function Lf({action:e,onConfirm:t,onCancel:n}){return ad.jsxs("div",{className:"astermind-action-card",children:[ad.jsxs("div",{className:"astermind-action-card__header",children:[ad.jsx("div",{className:"astermind-action-card__icon",children:(e=>{switch(e){case"navigate":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ad.jsx("polyline",{points:"15,3 21,3 21,9"}),ad.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]});case"fillForm":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ad.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"clickElement":return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("path",{d:"M15 15l-2 5L9 9l11 4-5 2z"}),ad.jsx("path",{d:"M15 15l5 5"})]});default:return ad.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[ad.jsx("circle",{cx:"12",cy:"12",r:"10"}),ad.jsx("polyline",{points:"12,6 12,12 16,14"})]})}})(e.type)}),ad.jsxs("div",{className:"astermind-action-card__title",children:[ad.jsx("span",{className:"astermind-action-card__label",children:(e=>{switch(e){case"navigate":return"Navigate to";case"fillForm":return"Fill form field";case"clickElement":return"Click";case"triggerModal":return"Open modal";case"scroll":return"Scroll to";case"highlight":return"Highlight";case"custom":return"Execute action";default:return"Perform action"}})(e.type)}),ad.jsx("span",{className:"astermind-action-card__target",children:e.target})]})]}),e.explanation&&ad.jsx("p",{className:"astermind-action-card__explanation",children:e.explanation}),ad.jsxs("div",{className:"astermind-action-card__confidence",children:[ad.jsx("div",{className:"astermind-action-card__confidence-bar",style:{width:100*e.confidence+"%"}}),ad.jsxs("span",{children:[Math.round(100*e.confidence),"% confident"]})]}),ad.jsxs("div",{className:"astermind-action-card__actions",children:[ad.jsx("button",{className:"astermind-action-card__cancel",onClick:n,type:"button",children:"Cancel"}),ad.jsx("button",{className:"astermind-action-card__confirm",onClick:t,type:"button",children:"Confirm"})]})]})}function Nf({status:e}){return ad.jsxs("div",{className:`astermind-status astermind-status--${e}`,children:[ad.jsx("span",{className:"astermind-status__dot"}),ad.jsx("span",{className:"astermind-status__label",children:(()=>{switch(e){case"online":return"Online";case"offline":return"Offline";case"connecting":return"Connecting...";case"error":return"Error";default:return"Unknown"}})()})]})}function Af({messages:e,isProcessing:t,connectionStatus:n,pendingAction:r,headerTitle:a,headerSubtitle:o,placeholder:i,showPoweredBy:s,sourceConfig:l,onClose:c,onSendMessage:u,onActionConfirm:d,onActionCancel:f,onViewSourceSummary:h,onDownloadSource:p}){const m="online"===n;return ad.jsxs("div",{className:"astermind-window",children:[ad.jsx(yf,{title:a,subtitle:o,onClose:c,children:ad.jsx(Nf,{status:n})}),ad.jsxs("div",{className:"astermind-window__body",children:[ad.jsx(_f,{messages:e,isProcessing:t,sourceConfig:l,isOnline:m,onViewSourceSummary:h,onDownloadSource:p}),r&&ad.jsx(Lf,{action:r,onConfirm:()=>d(r),onCancel:f})]}),ad.jsxs("div",{className:"astermind-window__footer",children:[ad.jsx(Mf,{placeholder:i,disabled:t||"error"===n,onSend:u}),s&&ad.jsxs("div",{className:"astermind-powered-by",children:["Powered by ",ad.jsx("a",{href:"https://astermind.ai",target:"_blank",rel:"noopener noreferrer",children:"AsterMind"})]})]})]})}const Pf={primaryColor:"#4F46E5",primaryHover:"#4338CA",backgroundColor:"#ffffff",surfaceColor:"#f3f4f6",textColor:"#1f2937",textMuted:"#6b7280",borderColor:"#e5e7eb",userBubbleBackground:"#4F46E5",userBubbleText:"#ffffff",botBubbleBackground:"#f3f4f6",botBubbleText:"#1f2937",widgetWidth:"380px",widgetHeight:"75vh",bubbleSize:"60px",borderRadius:"12px",fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSize:"14px",shadow:"0 4px 20px rgba(0, 0, 0, 0.15)"};const Rf=j.createContext(null);function Tf({theme:e,children:t}){const n=function(e){const t=j.useMemo(()=>({...Pf,...e}),[e]),n=j.useMemo(()=>({"--astermind-primary":t.primaryColor,"--astermind-primary-hover":t.primaryHover,"--astermind-background":t.backgroundColor,"--astermind-surface":t.surfaceColor,"--astermind-text":t.textColor,"--astermind-text-muted":t.textMuted,"--astermind-border":t.borderColor,"--astermind-user-bg":t.userBubbleBackground,"--astermind-user-text":t.userBubbleText,"--astermind-bot-bg":t.botBubbleBackground,"--astermind-bot-text":t.botBubbleText,"--astermind-widget-width":t.widgetWidth,"--astermind-widget-height":t.widgetHeight,"--astermind-bubble-size":t.bubbleSize,"--astermind-border-radius":t.borderRadius,"--astermind-font-family":t.fontFamily,"--astermind-font-size":t.fontSize,"--astermind-shadow":t.shadow}),[t]);return{theme:t,cssVariables:n}}(e);return ad.jsx(Rf.Provider,{value:n,children:ad.jsx("div",{style:n.cssVariables,children:t})})}function If(e){const n=j.useMemo(()=>function(){let e="",n="https://api.astermind.ai";try{t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("astermind-chatbot.min.js",document.baseURI).href}catch{}if(!e&&"undefined"!=typeof process&&process.env&&(e=process.env.REACT_APP_ASTERMIND_RAG_API_KEY||e,n=process.env.REACT_APP_ASTERMIND_RAG_API_SERVER_URL||n),"undefined"!=typeof window){const t=window.__ASTERMIND_CONFIG__;t&&"object"==typeof t&&(e=t.apiKey||e,n=t.apiUrl||n)}return{apiKey:e,apiUrl:n}}(),[]),{apiKey:r,apiUrl:a,throwOnMissingKey:o=!0,position:i="bottom-right",theme:s={},greeting:l="Hi! How can I help you today?",placeholder:c="Type your message...",agent:u,fallback:d={enabled:!0},sourceDisplay:f,showPoweredBy:h=!0,headerTitle:p="AsterMind",headerSubtitle:m="AI Assistant",defaultOpen:g=!1,zIndex:y=9999,onReady:v,onMessage:b,onAction:w,onError:S,onToggle:k}=e,x=r||n.apiKey,C=a||n.apiUrl,[E,_]=j.useState(g),[M,L]=j.useState(null),[N,A]=j.useState([]),[P,R]=j.useState(!1),[T,I]=j.useState(),[D,z]=j.useState(),[F,O]=j.useState("connecting"),$=j.useMemo(()=>{const e=M?.getSourcesConfig?.()||{};return{enabled:f?.enabled??e.enabled??!0,showSummary:f?.showSummary??e.showSummary??!0,showDownload:f?.showDownload??e.showDownload??!0}},[M,f]),U=j.useCallback(e=>{console.log("[AsterMind] View source summary:",e.title)},[]),B=j.useCallback(async e=>{if(e.downloadUrl)try{const t=e.downloadUrl.startsWith("http")?e.downloadUrl:`${C}${e.downloadUrl}`,n=await fetch(t,{headers:{"X-API-Key":x}});if(!n.ok)return void console.error("[AsterMind] Download failed:",n.status,n.statusText);const r=n.headers.get("Content-Disposition");let a=e.documentName||e.title||"download";if(r){const e=r.match(/filename="?(.+?)"?$/);e&&(a=e[1])}const o=await n.blob(),i=window.URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=a,document.body.appendChild(s),s.click(),window.URL.revokeObjectURL(i),document.body.removeChild(s)}catch(e){console.error("[AsterMind] Download error:",e)}else console.warn("[AsterMind] No download URL for source:",e.title)},[C,x]);j.useEffect(()=>{if(!x){const e='AsterMind API key is required. Configure using one of these methods:\n 1. Pass apiKey prop: <ChatbotWidget apiKey="am_..." />\n 2. Set VITE_ASTERMIND_RAG_API_KEY environment variable (Vite)\n 3. Set REACT_APP_ASTERMIND_RAG_API_KEY environment variable (CRA)\n 4. Set window.__ASTERMIND_CONFIG__ = { apiKey: "am_...", apiUrl: "..." }';if(o)throw new Error(e);console.warn("[AsterMind] "+e)}},[x,o]);const V=j.useMemo(()=>{if(u?.enabled)return{enabled:!0,confidenceThreshold:u.confidenceThreshold??.8,siteMap:u.siteMap,customActions:u.customActions,requireConfirmation:!0}},[u]);j.useEffect(()=>{if(!x)return;const e=new Id({apiUrl:C,apiKey:x,fallback:{enabled:d?.enabled??!0,cacheOnConnect:!0},agentic:V,onStatusChange:e=>{O(e)},onError:e=>{S?.(new Error(e.message))}});if(V?.enabled&&(!function(e){const t={agent:Fd,intentClassifier:zd};e.registerAgentic(t)}(e),console.log("[AsterMind] Agentic capabilities enabled")),L(e),l){const e={id:"greeting",role:"assistant",content:l,timestamp:new Date};A([e])}return v?.(),()=>{}},[x,C,d?.enabled,V,l,S,v]);const W=j.useCallback(()=>{const e=!E;_(e),k?.(e)},[E,k]),H=j.useCallback(()=>{_(!1),k?.(!1)},[k]),K=j.useCallback(async e=>{if(!M||!e.trim()||P)return;const t={id:`user-${Date.now()}`,role:"user",content:e.trim(),timestamp:new Date};if(A(e=>[...e,t]),b?.(t),R(!0),M.isAgenticEnabled())try{const t=await M.smartAsk(e,{sessionId:T});if(t.action&&!t.response){const e={id:t.action.id,type:t.action.type,target:t.action.target,params:t.action.params,confidence:t.action.confidence,explanation:t.action.explanation,status:"pending"};return z(e),w?.(e),void R(!1)}if(t.actionResult){const e={id:t.action.id,type:t.action.type,target:t.action.target,params:t.action?.params,confidence:t.action.confidence,explanation:t.action?.explanation,status:t.actionResult.success?"executed":"failed",result:t.actionResult},n={id:`assistant-${Date.now()}`,role:"assistant",content:t.actionResult.success?`✓ ${t.action?.explanation||"Action completed"}`:`✗ ${t.actionResult.message}`,timestamp:new Date,isStreaming:!1};return A(e=>[...e,n]),w?.(e),void R(!1)}if(t.response){const e={id:`assistant-${Date.now()}`,role:"assistant",content:t.response.reply,timestamp:new Date,sources:t.response.sources,confidence:t.response.confidence,offline:t.response.offline,isStreaming:!1};return A(t=>[...t,e]),I(t.response.sessionId),b?.(e),void R(!1)}}catch(e){console.error("[AsterMind] smartAsk error, falling back to standard ask:",e)}const n=`assistant-${Date.now()}`,r={id:n,role:"assistant",content:"",timestamp:new Date,isStreaming:!0};A(e=>[...e,r]);try{let t="";await M.askStream(e,{onToken:e=>{t+=e,A(e=>e.map(e=>e.id===n?{...e,content:t}:e))},onSources:e=>{A(t=>t.map(t=>t.id===n?{...t,sources:e}:t))},onComplete:e=>{const t={id:n,role:"assistant",content:e.reply,timestamp:new Date,sources:e.sources,confidence:e.confidence,offline:e.offline,isStreaming:!1};A(e=>e.map(e=>e.id===n?t:e)),I(e.sessionId),b?.(t)},onError:()=>{q(M,e,n)}},{sessionId:T})}catch{const e={id:n,role:"assistant",content:"I encountered an error processing your request. Please try again.",timestamp:new Date,isStreaming:!1};A(t=>t.map(t=>t.id===n?e:t)),S?.(new Error("Failed to process message"))}finally{R(!1)}},[M,P,T,b,S,w]),q=async(e,t,n)=>{try{const r=await e.ask(t,{sessionId:T}),a={id:n,role:"assistant",content:r.reply,timestamp:new Date,sources:r.sources,confidence:r.confidence,offline:r.offline,isStreaming:!1};A(e=>e.map(e=>e.id===n?a:e)),I(r.sessionId),b?.(a)}catch{const e={id:n,role:"assistant",content:"I'm having trouble connecting. Please try again later.",timestamp:new Date,isStreaming:!1};A(t=>t.map(t=>t.id===n?e:t))}},Q=j.useCallback(async e=>{if(!M)return;const t={...e,status:"confirmed"};z(t);try{const t=await M.executeAction({id:e.id,type:e.type,target:e.target,confidence:e.confidence,params:e.params}),n={...e,status:t.success?"executed":"failed",result:t},r={id:`assistant-${Date.now()}`,role:"assistant",content:t.success?`✓ ${e.explanation||t.message}`:`✗ ${t.message}${t.error?`: ${t.error}`:""}`,timestamp:new Date,isStreaming:!1};A(e=>[...e,r]),z(void 0),w?.(n)}catch(t){const n={...e,status:"failed",result:{success:!1,message:"Failed to execute action",error:String(t)}},r={id:`assistant-${Date.now()}`,role:"assistant",content:`✗ Failed to execute action: ${String(t)}`,timestamp:new Date,isStreaming:!1};A(e=>[...e,r]),z(void 0),w?.(n)}},[D,M,w]),G=j.useCallback(()=>{if(!D)return;const e={...D,status:"cancelled"};z(void 0),w?.(e)},[D,w]);return ad.jsx(Tf,{theme:s,children:ad.jsxs("div",{className:`astermind-chatbot astermind-chatbot--${i}`,style:{zIndex:y},children:[!E&&ad.jsx(gf,{onClick:W,position:i}),E&&ad.jsx(Af,{messages:N,isProcessing:P,connectionStatus:F,pendingAction:D,headerTitle:p,headerSubtitle:m,placeholder:c,showPoweredBy:h,sourceConfig:$,onClose:H,onSendMessage:K,onActionConfirm:Q,onActionCancel:G,onViewSourceSummary:U,onDownloadSource:B})]})})}let Df=null;function zf(e){const t=function(){if("undefined"==typeof document)return{};const e=document.querySelector("script[data-astermind-key]");if(!e)return{};const t={},n=e.getAttribute("data-astermind-key");n&&(t.apiKey=n);const r=e.getAttribute("data-astermind-url");r&&(t.apiUrl=r);const a=e.getAttribute("data-astermind-position");a&&["bottom-right","bottom-left","top-right","top-left"].includes(a)&&(t.position=a);const o=e.getAttribute("data-astermind-greeting");o&&(t.greeting=o);const i=e.getAttribute("data-astermind-title");i&&(t.headerTitle=i);const s=e.getAttribute("data-astermind-subtitle");return s&&(t.headerSubtitle=s),"true"===e.getAttribute("data-astermind-auto-open")&&(t.defaultOpen=!0),t}(),n={...t,...function(){if("undefined"==typeof window)return{};const e=window.astermindConfig;return e&&"object"==typeof e?e:{}}(),...e||{}},{container:r=document.body,...a}=n;a.apiKey||console.warn('[AsterMindChatbot] No API key found. Configure using one of these methods:\n 1. AsterMindChatbot.init({ apiKey: "am_..." })\n 2. window.astermindConfig = { apiKey: "am_..." }\n 3. <script data-astermind-key="am_..." ...>\n 4. Set VITE_ASTERMIND_RAG_API_KEY environment variable (if bundled)');const o="string"==typeof r?document.querySelector(r):r;if(!o)return void console.error("[AsterMindChatbot] Container not found:",r);const i=document.createElement("div");i.id="astermind-chatbot-root",o.appendChild(i),Df=qu(i),Df.render($.createElement(If,a)),console.log("[AsterMindChatbot] Initialized")}function Ff(){Df&&(Df.unmount(),Df=null);const e=document.getElementById("astermind-chatbot-root");e&&e.remove(),console.log("[AsterMindChatbot] Destroyed")}function Of(){return null!==Df}return"undefined"!=typeof window&&(window.AsterMindChatbot={init:zf,destroy:Ff,isInitialized:Of}),e.destroy=Ff,e.init=zf,e.isInitialized=Of,e}({});
|
|
21
21
|
//# sourceMappingURL=astermind-chatbot.min.js.map
|