diff --git a/src/ol_openedx_chat/block.py b/src/ol_openedx_chat/block.py index 8f8d911a..3fa0dde6 100644 --- a/src/ol_openedx_chat/block.py +++ b/src/ol_openedx_chat/block.py @@ -78,8 +78,22 @@ def student_view_aside(self, block, context=None): if getattr(self.runtime, "is_author_mode", False): return self.author_view_aside(block, context) + if getattr(block, "category", None) == "video": + # content, filename, mimetype = get_transcript_from_contentstore(block, 'en', 'txt', block.get_transcripts_info()) + pass + + print("\n\n\n IN ASIDE\n\n\n") fragment = Fragment("") - fragment.add_content(render_template("static/html/student_view.html")) + fragment.add_content( + render_template( + "static/html/student_view.html", + {"block_key": self.scope_ids.usage_id.usage_key.block_id}, + ) + ) + fragment.add_css(get_resource_bytes("static/css/ai_chat.css")) + fragment.add_javascript(get_resource_bytes("static/js/ai_chat.js")) + fragment.add_javascript(get_resource_bytes("static/js/aiChat.umd.js")) + fragment.initialize_js("AiChatAsideView", json_args={"test_arg": "test_value"}) return fragment @XBlockAside.aside_for(AUTHOR_VIEW) @@ -118,6 +132,7 @@ def should_apply_to_block(cls, block): instances, the problem type of the given block needs to be retrieved in different ways. """ # noqa: D401 + print("\n\n\nshould_apply_to_block\n\n\n") return is_aside_applicable_to_block(block=block) @XBlock.handler diff --git a/src/ol_openedx_chat/static/css/ai_chat.css b/src/ol_openedx_chat/static/css/ai_chat.css new file mode 100644 index 00000000..1749702c --- /dev/null +++ b/src/ol_openedx_chat/static/css/ai_chat.css @@ -0,0 +1,14 @@ +/* General Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: Arial, sans-serif; +} + + + +#app-root { + width: 450px; + height: 600px; +} diff --git a/src/ol_openedx_chat/static/html/student_view.html b/src/ol_openedx_chat/static/html/student_view.html index 7509f4f0..4d2c3931 100644 --- a/src/ol_openedx_chat/static/html/student_view.html +++ b/src/ol_openedx_chat/static/html/student_view.html @@ -1,3 +1,3 @@
- +
Hello
diff --git a/src/ol_openedx_chat/static/js/aiChat.umd.js b/src/ol_openedx_chat/static/js/aiChat.umd.js new file mode 100644 index 00000000..66d182c6 --- /dev/null +++ b/src/ol_openedx_chat/static/js/aiChat.umd.js @@ -0,0 +1,161 @@ +(function(xl,va){typeof exports=="object"&&typeof module<"u"?va(exports):typeof define=="function"&&define.amd?define(["exports"],va):(xl=typeof globalThis<"u"?globalThis:xl||self,va(xl.aiChat={}))})(this,function(xl){"use strict";function va(t,l){for(var a=0;au[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function El(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ts={exports:{}},ke={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var eh;function Db(){if(eh)return ke;eh=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.iterator;function x(S){return S===null||typeof S!="object"?null:(S=b&&S[b]||S["@@iterator"],typeof S=="function"?S:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,A={};function U(S,K,oe){this.props=S,this.context=K,this.refs=A,this.updater=oe||v}U.prototype.isReactComponent={},U.prototype.setState=function(S,K){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,K,"setState")},U.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=U.prototype;function N(S,K,oe){this.props=S,this.context=K,this.refs=A,this.updater=oe||v}var O=N.prototype=new T;O.constructor=N,D(O,U.prototype),O.isPureReactComponent=!0;var L=Array.isArray,_={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function G(S,K,oe,w,le,ye){return oe=ye.ref,{$$typeof:t,type:S,key:K,ref:oe!==void 0?oe:null,props:ye}}function ne(S,K){return G(S.type,K,void 0,void 0,void 0,S.props)}function Y(S){return typeof S=="object"&&S!==null&&S.$$typeof===t}function E(S){var K={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(oe){return K[oe]})}var q=/\/+/g;function X(S,K){return typeof S=="object"&&S!==null&&S.key!=null?E(""+S.key):K.toString(36)}function P(){}function te(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(P,P):(S.status="pending",S.then(function(K){S.status==="pending"&&(S.status="fulfilled",S.value=K)},function(K){S.status==="pending"&&(S.status="rejected",S.reason=K)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function ue(S,K,oe,w,le){var ye=typeof S;(ye==="undefined"||ye==="boolean")&&(S=null);var de=!1;if(S===null)de=!0;else switch(ye){case"bigint":case"string":case"number":de=!0;break;case"object":switch(S.$$typeof){case t:case l:de=!0;break;case g:return de=S._init,ue(de(S._payload),K,oe,w,le)}}if(de)return le=le(S),de=w===""?"."+X(S,0):w,L(le)?(oe="",de!=null&&(oe=de.replace(q,"$&/")+"/"),ue(le,K,oe,"",function(_e){return _e})):le!=null&&(Y(le)&&(le=ne(le,oe+(le.key==null||S&&S.key===le.key?"":(""+le.key).replace(q,"$&/")+"/")+de)),K.push(le)),1;de=0;var qe=w===""?".":w+":";if(L(S))for(var Ee=0;Ee>>1,S=J[be];if(0>>1;beo(w,ie))leo(ye,w)?(J[be]=ye,J[le]=ie,be=le):(J[be]=w,J[oe]=ie,be=oe);else if(leo(ye,ie))J[be]=ye,J[le]=ie,be=le;else break e}}return ae}function o(J,ae){var ie=J.sortIndex-ae.sortIndex;return ie!==0?ie:J.id-ae.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var m=[],p=[],g=1,b=null,x=3,v=!1,D=!1,A=!1,U=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function O(J){for(var ae=a(p);ae!==null;){if(ae.callback===null)u(p);else if(ae.startTime<=J)u(p),ae.sortIndex=ae.expirationTime,l(m,ae);else break;ae=a(p)}}function L(J){if(A=!1,O(J),!D)if(a(m)!==null)D=!0,te();else{var ae=a(p);ae!==null&&ue(L,ae.startTime-J)}}var _=!1,R=-1,G=5,ne=-1;function Y(){return!(t.unstable_now()-neJ&&Y());){var be=b.callback;if(typeof be=="function"){b.callback=null,x=b.priorityLevel;var S=be(b.expirationTime<=J);if(J=t.unstable_now(),typeof S=="function"){b.callback=S,O(J),ae=!0;break t}b===a(m)&&u(m),O(J)}else u(m);b=a(m)}if(b!==null)ae=!0;else{var K=a(p);K!==null&&ue(L,K.startTime-J),ae=!1}}break e}finally{b=null,x=ie,v=!1}ae=void 0}}finally{ae?q():_=!1}}}var q;if(typeof N=="function")q=function(){N(E)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,P=X.port2;X.port1.onmessage=E,q=function(){P.postMessage(null)}}else q=function(){U(E,0)};function te(){_||(_=!0,q())}function ue(J,ae){R=U(function(){J(t.unstable_now())},ae)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(J){J.callback=null},t.unstable_continueExecution=function(){D||v||(D=!0,te())},t.unstable_forceFrameRate=function(J){0>J||125be?(J.sortIndex=ie,l(p,J),a(m)===null&&J===a(p)&&(A?(T(R),R=-1):A=!0,ue(L,ie-be))):(J.sortIndex=S,l(m,J),D||v||(D=!0,te())),J},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function(J){var ae=x;return function(){var ie=x;x=ae;try{return J.apply(this,arguments)}finally{x=ie}}}}(ls)),ls}var lh;function zb(){return lh||(lh=1,rs.exports=Mb()),rs.exports}var as={exports:{}},qt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ah;function Nb(){if(ah)return qt;ah=1;var t=lu();function l(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),as.exports=Nb(),as.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var uh;function Lb(){if(uh)return xa;uh=1;var t=zb(),l=lu(),a=Bb();function u(e){var n="https://react.dev/errors/"+e;if(1)":-1s||k[i]!==z[s]){var Q=` +`+k[i].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=i&&0<=s);break}}}finally{te=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?P(r):""}function J(e){switch(e.tag){case 26:case 27:case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function ae(e){try{var n="";do n+=J(e),e=e.return;while(e);return n}catch(r){return` +Error generating stack: `+r.message+` +`+r.stack}}function ie(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,n.flags&4098&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function be(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function S(e){if(ie(e)!==e)throw Error(u(188))}function K(e){var n=e.alternate;if(!n){if(n=ie(e),n===null)throw Error(u(188));return n!==e?null:e}for(var r=e,i=n;;){var s=r.return;if(s===null)break;var f=s.alternate;if(f===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===f.child){for(f=s.child;f;){if(f===r)return S(s),e;if(f===i)return S(s),n;f=f.sibling}throw Error(u(188))}if(r.return!==i.return)r=s,i=f;else{for(var y=!1,C=s.child;C;){if(C===r){y=!0,r=s,i=f;break}if(C===i){y=!0,i=s,r=f;break}C=C.sibling}if(!y){for(C=f.child;C;){if(C===r){y=!0,r=f,i=s;break}if(C===i){y=!0,i=f,r=s;break}C=C.sibling}if(!y)throw Error(u(189))}}if(r.alternate!==i)throw Error(u(190))}if(r.tag!==3)throw Error(u(188));return r.stateNode.current===r?e:n}function oe(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=oe(e),n!==null)return n;e=e.sibling}return null}var w=Array.isArray,le=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},de=[],qe=-1;function Ee(e){return{current:e}}function _e(e){0>qe||(e.current=de[qe],de[qe]=null,qe--)}function fe(e,n){qe++,de[qe]=e.current,e.current=n}var Ne=Ee(null),ge=Ee(null),pe=Ee(null),se=Ee(null);function ve(e,n){switch(fe(pe,n),fe(ge,e),fe(Ne,null),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)&&(n=n.namespaceURI)?ab(n):0;break;default:if(e=e===8?n.parentNode:n,n=e.tagName,e=e.namespaceURI)e=ab(e),n=ib(e,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}_e(Ne),fe(Ne,n)}function Ie(){_e(Ne),_e(ge),_e(pe)}function Ue(e){e.memoizedState!==null&&fe(se,e);var n=Ne.current,r=ib(n,e.type);n!==r&&(fe(ge,e),fe(Ne,r))}function Re(e){ge.current===e&&(_e(Ne),_e(ge)),se.current===e&&(_e(se),Wi._currentValue=ye)}var at=Object.prototype.hasOwnProperty,St=t.unstable_scheduleCallback,un=t.unstable_cancelCallback,Rn=t.unstable_shouldYield,on=t.unstable_requestPaint,De=t.unstable_now,Dt=t.unstable_getCurrentPriorityLevel,I=t.unstable_ImmediatePriority,W=t.unstable_UserBlockingPriority,ce=t.unstable_NormalPriority,Te=t.unstable_LowPriority,He=t.unstable_IdlePriority,Me=t.log,Jt=t.unstable_setDisableYieldValue,Mt=null,_t=null;function Jr(e){if(_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(Mt,e,void 0,(e.current.flags&128)===128)}catch{}}function pt(e){if(typeof Me=="function"&&Jt(e),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(Mt,e)}catch{}}var Tt=Math.clz32?Math.clz32:qk,Dn=Math.log,Vk=Math.LN2;function qk(e){return e>>>=0,e===0?32:31-(Dn(e)/Vk|0)|0}var Yu=128,$u=4194304;function Wr(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fu(e,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,f=e.pingedLanes,y=e.warmLanes;e=e.finishedLanes!==0;var C=r&134217727;return C!==0?(r=C&~s,r!==0?i=Wr(r):(f&=C,f!==0?i=Wr(f):e||(y=C&~y,y!==0&&(i=Wr(y))))):(C=r&~s,C!==0?i=Wr(C):f!==0?i=Wr(f):e||(y=r&~y,y!==0&&(i=Wr(y)))),i===0?0:n!==0&&n!==i&&!(n&s)&&(s=i&-i,y=n&-n,s>=y||s===32&&(y&4194176)!==0)?n:i}function si(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Gk(e,n){switch(e){case 1:case 2:case 4:case 8:return n+250;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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pg(){var e=Yu;return Yu<<=1,!(Yu&4194176)&&(Yu=128),e}function Jg(){var e=$u;return $u<<=1,!($u&62914560)&&($u=4194304),e}function Xc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function ci(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ik(e,n,r,i,s,f){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var C=e.entanglements,k=e.expirationTimes,z=e.hiddenUpdates;for(r=y&~r;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xk=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),iy={},uy={};function Qk(e){return at.call(uy,e)?!0:at.call(iy,e)?!1:Xk.test(e)?uy[e]=!0:(iy[e]=!0,!1)}function Xu(e,n,r){if(Qk(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function Qu(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function Wn(e,n,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+i)}}function bn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oy(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Kk(e){var n=oy(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,f=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return s.call(this)},set:function(y){i=""+y,f.call(this,y)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(y){i=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ku(e){e._valueTracker||(e._valueTracker=Kk(e))}function sy(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=oy(e)?e.checked?"true":"false":e.value),e=i,e!==r?(n.setValue(e),!0):!1}function Zu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Zk=/[\n"\\]/g;function Sn(e){return e.replace(Zk,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Zc(e,n,r,i,s,f,y,C){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+bn(n)):e.value!==""+bn(n)&&(e.value=""+bn(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?Pc(e,y,bn(n)):r!=null?Pc(e,y,bn(r)):i!=null&&e.removeAttribute("value"),s==null&&f!=null&&(e.defaultChecked=!!f),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+bn(C):e.removeAttribute("name")}function cy(e,n,r,i,s,f,y,C){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null))return;r=r!=null?""+bn(r):"",n=n!=null?""+bn(n):r,C||n===e.value||(e.value=n),e.defaultValue=n}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=C?e.checked:!!i,e.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function Pc(e,n,r){n==="number"&&Zu(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Il(e,n,r,i){if(e=e.options,n){n={};for(var s=0;s=yi),Cy=" ",Ty=!1;function wy(e,n){switch(e){case"keyup":return T4.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ay(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xl=!1;function A4(e,n){switch(e){case"compositionend":return Ay(n);case"keypress":return n.which!==32?null:(Ty=!0,Cy);case"textInput":return e=n.data,e===Cy&&Ty?null:e;default:return null}}function k4(e,n){if(Xl)return e==="compositionend"||!sf&&wy(e,n)?(e=yy(),Ju=rf=Tr=null,Xl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ny(r)}}function Ly(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ly(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Uy(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Zu(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Zu(e.document)}return n}function df(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function B4(e,n){var r=Uy(n);n=e.focusedElem;var i=e.selectionRange;if(r!==n&&n&&n.ownerDocument&&Ly(n.ownerDocument.documentElement,n)){if(i!==null&&df(n)){if(e=i.start,r=i.end,r===void 0&&(r=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(r,n.value.length);else if(r=(e=n.ownerDocument||document)&&e.defaultView||window,r.getSelection){r=r.getSelection();var s=n.textContent.length,f=Math.min(i.start,s);i=i.end===void 0?f:Math.min(i.end,s),!r.extend&&f>i&&(s=i,i=f,f=s),s=By(n,f);var y=By(n,i);s&&y&&(r.rangeCount!==1||r.anchorNode!==s.node||r.anchorOffset!==s.offset||r.focusNode!==y.node||r.focusOffset!==y.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),r.removeAllRanges(),f>i?(r.addRange(e),r.extend(y.node,y.offset)):(e.setEnd(y.node,y.offset),r.addRange(e)))}}for(e=[],r=n;r=r.parentNode;)r.nodeType===1&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ql=null,hf=null,xi=null,pf=!1;function Hy(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;pf||Ql==null||Ql!==Zu(i)||(i=Ql,"selectionStart"in i&&df(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xi&&vi(xi,i)||(xi=i,i=Vo(hf,"onSelect"),0>=y,s-=y,er=1<<32-Tt(n)+s|r<xe?(Lt=Se,Se=null):Lt=Se.sibling;var Xe=V(B,Se,H[xe],Z);if(Xe===null){Se===null&&(Se=Lt);break}e&&Se&&Xe.alternate===null&&n(B,Se),M=f(Xe,M,xe),ze===null?he=Xe:ze.sibling=Xe,ze=Xe,Se=Lt}if(xe===H.length)return r(B,Se),Fe&&il(B,xe),he;if(Se===null){for(;xexe?(Lt=Se,Se=null):Lt=Se.sibling;var Yr=V(B,Se,Xe.value,Z);if(Yr===null){Se===null&&(Se=Lt);break}e&&Se&&Yr.alternate===null&&n(B,Se),M=f(Yr,M,xe),ze===null?he=Yr:ze.sibling=Yr,ze=Yr,Se=Lt}if(Xe.done)return r(B,Se),Fe&&il(B,xe),he;if(Se===null){for(;!Xe.done;xe++,Xe=H.next())Xe=ee(B,Xe.value,Z),Xe!==null&&(M=f(Xe,M,xe),ze===null?he=Xe:ze.sibling=Xe,ze=Xe);return Fe&&il(B,xe),he}for(Se=i(Se);!Xe.done;xe++,Xe=H.next())Xe=F(Se,B,xe,Xe.value,Z),Xe!==null&&(e&&Xe.alternate!==null&&Se.delete(Xe.key===null?xe:Xe.key),M=f(Xe,M,xe),ze===null?he=Xe:ze.sibling=Xe,ze=Xe);return e&&Se.forEach(function(W5){return n(B,W5)}),Fe&&il(B,xe),he}function yt(B,M,H,Z){if(typeof H=="object"&&H!==null&&H.type===m&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case d:e:{for(var he=H.key;M!==null;){if(M.key===he){if(he=H.type,he===m){if(M.tag===7){r(B,M.sibling),Z=s(M,H.props.children),Z.return=B,B=Z;break e}}else if(M.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===N&&t0(he)===M.type){r(B,M.sibling),Z=s(M,H.props),_i(Z,H),Z.return=B,B=Z;break e}r(B,M);break}else n(B,M);M=M.sibling}H.type===m?(Z=yl(H.props.children,B.mode,Z,H.key),Z.return=B,B=Z):(Z=Ro(H.type,H.key,H.props,null,B.mode,Z),_i(Z,H),Z.return=B,B=Z)}return y(B);case h:e:{for(he=H.key;M!==null;){if(M.key===he)if(M.tag===4&&M.stateNode.containerInfo===H.containerInfo&&M.stateNode.implementation===H.implementation){r(B,M.sibling),Z=s(M,H.children||[]),Z.return=B,B=Z;break e}else{r(B,M);break}else n(B,M);M=M.sibling}Z=gd(H,B.mode,Z),Z.return=B,B=Z}return y(B);case N:return he=H._init,H=he(H._payload),yt(B,M,H,Z)}if(w(H))return me(B,M,H,Z);if(R(H)){if(he=R(H),typeof he!="function")throw Error(u(150));return H=he.call(H),we(B,M,H,Z)}if(typeof H.then=="function")return yt(B,M,co(H),Z);if(H.$$typeof===v)return yt(B,M,ko(B,H),Z);fo(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,M!==null&&M.tag===6?(r(B,M.sibling),Z=s(M,H),Z.return=B,B=Z):(r(B,M),Z=md(H,B.mode,Z),Z.return=B,B=Z),y(B)):r(B,M)}return function(B,M,H,Z){try{ki=0;var he=yt(B,M,H,Z);return ea=null,he}catch(Se){if(Se===wi)throw Se;var ze=kn(29,Se,null,B.mode);return ze.lanes=Z,ze.return=B,ze}finally{}}}var ol=n0(!0),r0=n0(!1),ta=Ee(null),ho=Ee(0);function l0(e,n){e=dr,fe(ho,e),fe(ta,n),dr=e|n.baseLanes}function Ef(){fe(ho,dr),fe(ta,ta.current)}function Cf(){dr=ho.current,_e(ta),_e(ho)}var Tn=Ee(null),Yn=null;function Ar(e){var n=e.alternate;fe(Ot,Ot.current&1),fe(Tn,e),Yn===null&&(n===null||ta.current!==null||n.memoizedState!==null)&&(Yn=e)}function a0(e){if(e.tag===22){if(fe(Ot,Ot.current),fe(Tn,e),Yn===null){var n=e.alternate;n!==null&&n.memoizedState!==null&&(Yn=e)}}else kr()}function kr(){fe(Ot,Ot.current),fe(Tn,Tn.current)}function nr(e){_e(Tn),Yn===e&&(Yn=null),_e(Ot)}var Ot=Ee(0);function po(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if(n.flags&128)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var V4=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},q4=t.unstable_scheduleCallback,G4=t.unstable_NormalPriority,Rt={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tf(){return{controller:new V4,data:new Map,refCount:0}}function Oi(e){e.refCount--,e.refCount===0&&q4(G4,function(){e.controller.abort()})}var Ri=null,wf=0,na=0,ra=null;function I4(e,n){if(Ri===null){var r=Ri=[];wf=0,na=Dd(),ra={status:"pending",value:void 0,then:function(i){r.push(i)}}}return wf++,n.then(i0,i0),n}function i0(){if(--wf===0&&Ri!==null){ra!==null&&(ra.status="fulfilled");var e=Ri;Ri=null,na=0,ra=null;for(var n=0;nf?f:8;var y=Y.T,C={};Y.T=C,Gf(e,!1,n,r);try{var k=s(),z=Y.S;if(z!==null&&z(C,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Q=Y4(k,i);zi(e,n,Q,hn(e))}else zi(e,n,i,hn(e))}catch(ee){zi(e,n,{then:function(){},status:"rejected",reason:ee},hn())}finally{le.p=f,Y.T=y}}function K4(){}function Vf(e,n,r,i){if(e.tag!==5)throw Error(u(476));var s=U0(e).queue;L0(e,s,n,ye,r===null?K4:function(){return H0(e),r(i)})}function U0(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:ye},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function H0(e){var n=U0(e).next.queue;zi(e,n,{},hn())}function qf(){return $t(Wi)}function j0(){return At().memoizedState}function V0(){return At().memoizedState}function Z4(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=hn();e=Mr(r);var i=zr(n,e,r);i!==null&&(Xt(i,n,r),Li(i,n,r)),n={cache:Tf()},e.payload=n;return}n=n.return}}function P4(e,n,r){var i=hn();r={lane:i,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},Co(e)?G0(n,r):(r=yf(e,n,r,i),r!==null&&(Xt(r,e,i),I0(r,n,i)))}function q0(e,n,r){var i=hn();zi(e,n,r,i)}function zi(e,n,r,i){var s={lane:i,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(Co(e))G0(n,s);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,C=f(y,r);if(s.hasEagerState=!0,s.eagerState=C,sn(C,y))return ao(e,n,s,0),it===null&&lo(),!1}catch{}finally{}if(r=yf(e,n,s,i),r!==null)return Xt(r,e,i),I0(r,n,i),!0}return!1}function Gf(e,n,r,i){if(i={lane:2,revertLane:Dd(),action:i,hasEagerState:!1,eagerState:null,next:null},Co(e)){if(n)throw Error(u(479))}else n=yf(e,r,i,2),n!==null&&Xt(n,e,2)}function Co(e){var n=e.alternate;return e===Oe||n!==null&&n===Oe}function G0(e,n){la=go=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function I0(e,n,r){if(r&4194176){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,ey(e,r)}}var $n={readContext:$t,use:So,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt};$n.useCacheRefresh=vt,$n.useMemoCache=vt,$n.useHostTransitionStatus=vt,$n.useFormState=vt,$n.useActionState=vt,$n.useOptimistic=vt;var fl={readContext:$t,use:So,useCallback:function(e,n){return tn().memoizedState=[e,n===void 0?null:n],e},useContext:$t,useEffect:_0,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,xo(4194308,4,D0.bind(null,n,e),r)},useLayoutEffect:function(e,n){return xo(4194308,4,e,n)},useInsertionEffect:function(e,n){xo(4,2,e,n)},useMemo:function(e,n){var r=tn();n=n===void 0?null:n;var i=e();if(cl){pt(!0);try{e()}finally{pt(!1)}}return r.memoizedState=[i,n],i},useReducer:function(e,n,r){var i=tn();if(r!==void 0){var s=r(n);if(cl){pt(!0);try{r(n)}finally{pt(!1)}}}else s=n;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=P4.bind(null,Oe,e),[i.memoizedState,e]},useRef:function(e){var n=tn();return e={current:e},n.memoizedState=e},useState:function(e){e=Bf(e);var n=e.queue,r=q0.bind(null,Oe,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Hf,useDeferredValue:function(e,n){var r=tn();return jf(r,e,n)},useTransition:function(){var e=Bf(!1);return e=L0.bind(null,Oe,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var i=Oe,s=tn();if(Fe){if(r===void 0)throw Error(u(407));r=r()}else{if(r=n(),it===null)throw Error(u(349));Ge&60||d0(i,n,r)}s.memoizedState=r;var f={value:r,getSnapshot:n};return s.queue=f,_0(p0.bind(null,i,f,e),[e]),i.flags|=2048,ia(9,h0.bind(null,i,f,r,n),{destroy:void 0},null),r},useId:function(){var e=tn(),n=it.identifierPrefix;if(Fe){var r=tr,i=er;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,n=":"+n+"R"+r,r=yo++,0 title"))),Vt(f,i,r),f[Yt]=e,zt(f),i=f;break e;case"link":var y=gb("link","href",s).get(i+(r.href||""));if(y){for(var C=0;C<\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?s.createElement(r,{is:i.is}):s.createElement(r)}}e[Yt]=n,e[Wt]=i;e:for(s=n.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}n.stateNode=e;e:switch(Vt(e,r,i),r){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&cr(n)}}return ct(n),n.flags&=-16777217,null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&cr(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(u(166));if(e=pe.current,Ei(n)){if(e=n.stateNode,r=n.memoizedProps,i=null,s=Ft,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[Yt]=n,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||lb(e.nodeValue,r)),e||ul(n)}else e=Go(e).createTextNode(i),e[Yt]=n,n.stateNode=e}return ct(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ei(n),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=n.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[Yt]=n}else Ci(),!(n.flags&128)&&(n.memoizedState=null),n.flags|=4;ct(n),s=!1}else zn!==null&&(Td(zn),zn=null),s=!0;if(!s)return n.flags&256?(nr(n),n):(nr(n),null)}if(nr(n),n.flags&128)return n.lanes=r,n;if(r=i!==null,e=e!==null&&e.memoizedState!==null,r){i=n.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool);var f=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==s&&(i.flags|=2048)}return r!==e&&r&&(n.child.flags|=8192),Do(n,n.updateQueue),ct(n),null;case 4:return Ie(),e===null&&Bd(n.stateNode.containerInfo),ct(n),null;case 10:return ir(n.type),ct(n),null;case 19:if(_e(Ot),s=n.memoizedState,s===null)return ct(n),null;if(i=(n.flags&128)!==0,f=s.rendering,f===null)if(i)Ii(s,!1);else{if(gt!==0||e!==null&&e.flags&128)for(e=n.child;e!==null;){if(f=po(e),f!==null){for(n.flags|=128,Ii(s,!1),e=f.updateQueue,n.updateQueue=e,Do(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)M1(r,e),r=r.sibling;return fe(Ot,Ot.current&1|2),n.child}e=e.sibling}s.tail!==null&&De()>Mo&&(n.flags|=128,i=!0,Ii(s,!1),n.lanes=4194304)}else{if(!i)if(e=po(f),e!==null){if(n.flags|=128,i=!0,e=e.updateQueue,n.updateQueue=e,Do(n,e),Ii(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Fe)return ct(n),null}else 2*De()-s.renderingStartTime>Mo&&r!==536870912&&(n.flags|=128,i=!0,Ii(s,!1),n.lanes=4194304);s.isBackwards?(f.sibling=n.child,n.child=f):(e=s.last,e!==null?e.sibling=f:n.child=f,s.last=f)}return s.tail!==null?(n=s.tail,s.rendering=n,s.tail=n.sibling,s.renderingStartTime=De(),n.sibling=null,e=Ot.current,fe(Ot,i?e&1|2:e&1),n):(ct(n),null);case 22:case 23:return nr(n),Cf(),i=n.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?r&536870912&&!(n.flags&128)&&(ct(n),n.subtreeFlags&6&&(n.flags|=8192)):ct(n),r=n.updateQueue,r!==null&&Do(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048),e!==null&&_e(sl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ir(Rt),ct(n),null;case 25:return null}throw Error(u(156,n.tag))}function l5(e,n){switch(Sf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ir(Rt),Ie(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Re(n),null;case 13:if(nr(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(u(340));Ci()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return _e(Ot),null;case 4:return Ie(),null;case 10:return ir(n.type),null;case 22:case 23:return nr(n),Cf(),e!==null&&_e(sl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ir(Rt),null;case 25:return null;default:return null}}function B1(e,n){switch(Sf(n),n.tag){case 3:ir(Rt),Ie();break;case 26:case 27:case 5:Re(n);break;case 4:Ie();break;case 13:nr(n);break;case 19:_e(Ot);break;case 10:ir(n.type);break;case 22:case 23:nr(n),Cf(),e!==null&&_e(sl);break;case 24:ir(Rt)}}var a5={getCacheForType:function(e){var n=$t(Rt),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r}},i5=typeof WeakMap=="function"?WeakMap:Map,ft=0,it=null,Be=null,Ge=0,ut=0,dn=null,fr=!1,ca=!1,yd=!1,dr=0,gt=0,Hr=0,bl=0,bd=0,_n=0,fa=0,Yi=null,Fn=null,Sd=!1,vd=0,Mo=1/0,zo=null,jr=null,No=!1,Sl=null,$i=0,xd=0,Ed=null,Fi=0,Cd=null;function hn(){if(ft&2&&Ge!==0)return Ge&-Ge;if(Y.T!==null){var e=na;return e!==0?e:Dd()}return ny()}function L1(){_n===0&&(_n=!(Ge&536870912)||Fe?Pg():536870912);var e=Tn.current;return e!==null&&(e.flags|=32),_n}function Xt(e,n,r){(e===it&&ut===2||e.cancelPendingCommit!==null)&&(da(e,0),hr(e,Ge,_n,!1)),ci(e,r),(!(ft&2)||e!==it)&&(e===it&&(!(ft&2)&&(bl|=r),gt===4&&hr(e,Ge,_n,!1)),Xn(e))}function U1(e,n,r){if(ft&6)throw Error(u(327));var i=!r&&(n&60)===0&&(n&e.expiredLanes)===0||si(e,n),s=i?s5(e,n):kd(e,n,!0),f=i;do{if(s===0){ca&&!i&&hr(e,n,0,!1);break}else if(s===6)hr(e,n,0,!fr);else{if(r=e.current.alternate,f&&!u5(r)){s=kd(e,n,!1),f=!1;continue}if(s===2){if(f=n,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var C=e;s=Yi;var k=C.current.memoizedState.isDehydrated;if(k&&(da(C,y).flags|=256),y=kd(C,y,!1),y!==2){if(yd&&!k){C.errorRecoveryDisabledLanes|=f,bl|=f,s=4;break e}f=Fn,Fn=s,f!==null&&Td(f)}s=y}if(f=!1,s!==2)continue}}if(s===1){da(e,0),hr(e,n,0,!0);break}e:{switch(i=e,s){case 0:case 1:throw Error(u(345));case 4:if((n&4194176)===n){hr(i,n,_n,!fr);break e}break;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(u(329))}if(i.finishedWork=r,i.finishedLanes=n,(n&62914560)===n&&(f=vd+300-De(),10r?32:r,Y.T=null,Sl===null)var f=!1;else{r=Ed,Ed=null;var y=Sl,C=$i;if(Sl=null,$i=0,ft&6)throw Error(u(331));var k=ft;if(ft|=4,R1(y.current),k1(y,y.current,C,r),ft=k,Xi(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(Mt,y)}catch{}f=!0}return f}finally{le.p=s,Y.T=i,F1(e,n)}}return!1}function X1(e,n,r){n=xn(r,n),n=$f(e.stateNode,n,2),e=zr(e,n,2),e!==null&&(ci(e,2),Xn(e))}function nt(e,n,r){if(e.tag===3)X1(e,e,r);else for(;n!==null;){if(n.tag===3){X1(n,e,r);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(jr===null||!jr.has(i))){e=xn(r,e),r=Z0(2),i=zr(n,r,2),i!==null&&(P0(r,i,n,e),ci(i,2),Xn(i));break}}n=n.return}}function _d(e,n,r){var i=e.pingCache;if(i===null){i=e.pingCache=new i5;var s=new Set;i.set(n,s)}else s=i.get(n),s===void 0&&(s=new Set,i.set(n,s));s.has(r)||(yd=!0,s.add(r),e=d5.bind(null,e,n,r),n.then(e,e))}function d5(e,n,r){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,it===e&&(Ge&r)===r&&(gt===4||gt===3&&(Ge&62914560)===Ge&&300>De()-vd?!(ft&2)&&da(e,0):bd|=r,fa===Ge&&(fa=0)),Xn(e)}function Q1(e,n){n===0&&(n=Jg()),e=wr(e,n),e!==null&&(ci(e,n),Xn(e))}function h5(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Q1(e,r)}function p5(e,n){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(n),Q1(e,r)}function m5(e,n){return St(e,n)}var Uo=null,ma=null,Od=!1,Ho=!1,Rd=!1,vl=0;function Xn(e){e!==ma&&e.next===null&&(ma===null?Uo=ma=e:ma=ma.next=e),Ho=!0,Od||(Od=!0,y5(g5))}function Xi(e,n){if(!Rd&&Ho){Rd=!0;do for(var r=!1,i=Uo;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var f=0;else{var y=i.suspendedLanes,C=i.pingedLanes;f=(1<<31-Tt(42|e)+1)-1,f&=s&~(y&~C),f=f&201326677?f&201326677|1:f?f|2:0}f!==0&&(r=!0,P1(i,f))}else f=Ge,f=Fu(i,i===it?f:0),!(f&3)||si(i,f)||(r=!0,P1(i,f));i=i.next}while(r);Rd=!1}}function g5(){Ho=Od=!1;var e=0;vl!==0&&(w5()&&(e=vl),vl=0);for(var n=De(),r=null,i=Uo;i!==null;){var s=i.next,f=K1(i,n);f===0?(i.next=null,r===null?Uo=s:r.next=s,s===null&&(ma=r)):(r=i,(e!==0||f&3)&&(Ho=!0)),i=s}Xi(e)}function K1(e,n){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,f=e.pendingLanes&-62914561;0"u"?null:document;function db(e,n,r){var i=ya;if(i&&typeof n=="string"&&n){var s=Sn(n);s='link[rel="'+e+'"][href="'+s+'"]',typeof r=="string"&&(s+='[crossorigin="'+r+'"]'),fb.has(s)||(fb.add(s),e={rel:e,crossOrigin:r,href:n},i.querySelector(s)===null&&(n=i.createElement("link"),Vt(n,"link",e),zt(n),i.head.appendChild(n)))}}function z5(e){pr.D(e),db("dns-prefetch",e,null)}function N5(e,n){pr.C(e,n),db("preconnect",e,n)}function B5(e,n,r){pr.L(e,n,r);var i=ya;if(i&&e&&n){var s='link[rel="preload"][as="'+Sn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(s+='[imagesrcset="'+Sn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(s+='[imagesizes="'+Sn(r.imageSizes)+'"]')):s+='[href="'+Sn(e)+'"]';var f=s;switch(n){case"style":f=ba(e);break;case"script":f=Sa(e)}On.has(f)||(e=E({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),On.set(f,e),i.querySelector(s)!==null||n==="style"&&i.querySelector(Zi(f))||n==="script"&&i.querySelector(Pi(f))||(n=i.createElement("link"),Vt(n,"link",e),zt(n),i.head.appendChild(n)))}}function L5(e,n){pr.m(e,n);var r=ya;if(r&&e){var i=n&&typeof n.as=="string"?n.as:"script",s='link[rel="modulepreload"][as="'+Sn(i)+'"][href="'+Sn(e)+'"]',f=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Sa(e)}if(!On.has(f)&&(e=E({rel:"modulepreload",href:e},n),On.set(f,e),r.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Pi(f)))return}i=r.createElement("link"),Vt(i,"link",e),zt(i),r.head.appendChild(i)}}}function U5(e,n,r){pr.S(e,n,r);var i=ya;if(i&&e){var s=ql(i).hoistableStyles,f=ba(e);n=n||"default";var y=s.get(f);if(!y){var C={loading:0,preload:null};if(y=i.querySelector(Zi(f)))C.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":n},r),(r=On.get(f))&&Yd(e,r);var k=y=i.createElement("link");zt(k),Vt(k,"link",e),k._p=new Promise(function(z,Q){k.onload=z,k.onerror=Q}),k.addEventListener("load",function(){C.loading|=1}),k.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Yo(y,n,i)}y={type:"stylesheet",instance:y,count:1,state:C},s.set(f,y)}}}function H5(e,n){pr.X(e,n);var r=ya;if(r&&e){var i=ql(r).hoistableScripts,s=Sa(e),f=i.get(s);f||(f=r.querySelector(Pi(s)),f||(e=E({src:e,async:!0},n),(n=On.get(s))&&$d(e,n),f=r.createElement("script"),zt(f),Vt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(s,f))}}function j5(e,n){pr.M(e,n);var r=ya;if(r&&e){var i=ql(r).hoistableScripts,s=Sa(e),f=i.get(s);f||(f=r.querySelector(Pi(s)),f||(e=E({src:e,async:!0,type:"module"},n),(n=On.get(s))&&$d(e,n),f=r.createElement("script"),zt(f),Vt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(s,f))}}function hb(e,n,r,i){var s=(s=pe.current)?Io(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=ba(r.href),r=ql(s).hoistableStyles,i=r.get(n),i||(i={type:"style",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=ba(r.href);var f=ql(s).hoistableStyles,y=f.get(e);if(y||(s=s.ownerDocument||s,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=s.querySelector(Zi(e)))&&!f._p&&(y.instance=f,y.state.loading=5),On.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},On.set(e,r),f||V5(s,e,r,y.state))),n&&i===null)throw Error(u(528,""));return y}if(n&&i!==null)throw Error(u(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Sa(r),r=ql(s).hoistableScripts,i=r.get(n),i||(i={type:"script",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function ba(e){return'href="'+Sn(e)+'"'}function Zi(e){return'link[rel="stylesheet"]['+e+"]"}function pb(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function V5(e,n,r,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Vt(n,"link",r),zt(n),e.head.appendChild(n))}function Sa(e){return'[src="'+Sn(e)+'"]'}function Pi(e){return"script[async]"+e}function mb(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var i=e.querySelector('style[data-href~="'+Sn(r.href)+'"]');if(i)return n.instance=i,zt(i),i;var s=E({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),zt(i),Vt(i,"style",s),Yo(i,r.precedence,e),n.instance=i;case"stylesheet":s=ba(r.href);var f=e.querySelector(Zi(s));if(f)return n.state.loading|=4,n.instance=f,zt(f),f;i=pb(r),(s=On.get(s))&&Yd(i,s),f=(e.ownerDocument||e).createElement("link"),zt(f);var y=f;return y._p=new Promise(function(C,k){y.onload=C,y.onerror=k}),Vt(f,"link",i),n.state.loading|=4,Yo(f,r.precedence,e),n.instance=f;case"script":return f=Sa(r.src),(s=e.querySelector(Pi(f)))?(n.instance=s,zt(s),s):(i=r,(s=On.get(f))&&(i=E({},r),$d(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),zt(s),Vt(s,"link",i),e.head.appendChild(s),n.instance=s);case"void":return null;default:throw Error(u(443,n.type))}else n.type==="stylesheet"&&!(n.state.loading&4)&&(i=n.instance,n.state.loading|=4,Yo(i,r.precedence,e));return n.instance}function Yo(e,n,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,f=s,y=0;y title"):null)}function q5(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function bb(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Ji=null;function G5(){}function I5(e,n,r){if(Ji===null)throw Error(u(475));var i=Ji;if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var s=ba(r.href),f=e.querySelector(Zi(s));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Fo.bind(i),e.then(i,i)),n.state.loading|=4,n.instance=f,zt(f);return}f=e.ownerDocument||e,r=pb(r),(s=On.get(s))&&Yd(r,s),f=f.createElement("link"),zt(f);var y=f;y._p=new Promise(function(C,k){y.onload=C,y.onerror=k}),Vt(f,"link",r),n.instance=f}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(n,e),(e=n.state.preload)&&!(n.state.loading&3)&&(i.count++,n=Fo.bind(i),e.addEventListener("load",n),e.addEventListener("error",n))}}function Y5(){if(Ji===null)throw Error(u(475));var e=Ji;return e.stylesheets&&e.count===0&&Fd(e,e.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(l){console.error(l)}}return t(),ns.exports=Lb(),ns.exports}var Hb=Ub();function is(){return is=Object.assign?Object.assign.bind():function(t){for(var l=1;l0?Ut(Tl,--Qt):0,Cl--,xt===10&&(Cl=1,ou--),xt}function nn(){return xt=Qt2||wa(xt)>3?"":" "}function eS(t,l){for(;--l&&nn()&&!(xt<48||xt>102||xt>57&&xt<65||xt>70&&xt<97););return Ta(t,cu()+(l<6&&Un()==32&&nn()==32))}function fs(t){for(;nn();)switch(xt){case t:return Qt;case 34:case 39:t!==34&&t!==39&&fs(xt);break;case 40:t===41&&fs(t);break;case 92:nn();break}return Qt}function tS(t,l){for(;nn()&&t+xt!==57;)if(t+xt===84&&Un()===47)break;return"/*"+Ta(l,Qt-1)+"*"+iu(t===47?t:nn())}function nS(t){for(;!wa(Un());)nn();return Ta(t,Qt)}function rS(t){return mh(du("",null,null,null,[""],t=ph(t),0,[0],t))}function du(t,l,a,u,o,c,d,h,m){for(var p=0,g=0,b=d,x=0,v=0,D=0,A=1,U=1,T=1,N=0,O="",L=o,_=c,R=u,G=O;U;)switch(D=N,N=nn()){case 40:if(D!=108&&Ut(G,b-1)==58){ss(G+=Ke(fu(N),"&","&\f"),"&\f")!=-1&&(T=-1);break}case 34:case 39:case 91:G+=fu(N);break;case 9:case 10:case 13:case 32:G+=Wb(D);break;case 92:G+=eS(cu()-1,7);continue;case 47:switch(Un()){case 42:case 47:uu(lS(tS(nn(),cu()),l,a),m);break;default:G+="/"}break;case 123*A:h[p++]=Ln(G)*T;case 125*A:case 59:case 0:switch(N){case 0:case 125:U=0;case 59+g:T==-1&&(G=Ke(G,/\f/g,"")),v>0&&Ln(G)-b&&uu(v>32?yh(G+";",u,a,b-1):yh(Ke(G," ","")+";",u,a,b-2),m);break;case 59:G+=";";default:if(uu(R=gh(G,l,a,p,g,o,h,O,L=[],_=[],b),c),N===123)if(g===0)du(G,l,R,R,L,c,b,h,_);else switch(x===99&&Ut(G,3)===110?100:x){case 100:case 108:case 109:case 115:du(t,R,R,u&&uu(gh(t,R,R,0,0,o,h,O,o,L=[],b),_),o,_,b,h,u?L:_);break;default:du(G,R,R,R,[""],_,0,h,_)}}p=g=v=0,A=T=1,O=G="",b=d;break;case 58:b=1+Ln(G),v=D;default:if(A<1){if(N==123)--A;else if(N==125&&A++==0&&Jb()==125)continue}switch(G+=iu(N),N*A){case 38:T=g>0?1:(G+="\f",-1);break;case 44:h[p++]=(Ln(G)-1)*T,T=1;break;case 64:Un()===45&&(G+=fu(nn())),x=Un(),g=b=Ln(O=G+=nS(cu())),N++;break;case 45:D===45&&Ln(G)==2&&(A=0)}}return c}function gh(t,l,a,u,o,c,d,h,m,p,g){for(var b=o-1,x=o===0?c:[""],v=cs(x),D=0,A=0,U=0;D0?x[T]+" "+N:Ke(N,/&\f/g,x[T])))&&(m[U++]=O);return su(t,l,a,o===0?us:h,m,p,g)}function lS(t,l,a){return su(t,l,a,ch,iu(Pb()),Ea(t,2,-2),0)}function yh(t,l,a,u){return su(t,l,a,os,Ea(t,0,u),Ea(t,u+1,-1),u)}function wl(t,l){for(var a="",u=cs(t),o=0;o6)switch(Ut(t,l+1)){case 109:if(Ut(t,l+4)!==45)break;case 102:return Ke(t,/(.+:)(.+)-([^]+)/,"$1"+Qe+"$2-$3$1"+au+(Ut(t,l+3)==108?"$3":"$2-$3"))+t;case 115:return~ss(t,"stretch")?Sh(Ke(t,"stretch","fill-available"),l)+t:t}break;case 4949:if(Ut(t,l+1)!==115)break;case 6444:switch(Ut(t,Ln(t)-3-(~ss(t,"!important")&&10))){case 107:return Ke(t,":",":"+Qe)+t;case 101:return Ke(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Qe+(Ut(t,14)===45?"inline-":"")+"box$3$1"+Qe+"$2$3$1"+Gt+"$2box$3")+t}break;case 5936:switch(Ut(t,l+11)){case 114:return Qe+t+Gt+Ke(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Qe+t+Gt+Ke(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Qe+t+Gt+Ke(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Qe+t+Gt+t+t}return t}var hS=function(l,a,u,o){if(l.length>-1&&!l.return)switch(l.type){case os:l.return=Sh(l.value,l.length);break;case fh:return wl([Ca(l,{value:Ke(l.value,"@","@"+Qe)})],o);case us:if(l.length)return Zb(l.props,function(c){switch(Kb(c,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Ca(l,{props:[Ke(c,/:(read-\w+)/,":"+au+"$1")]})],o);case"::placeholder":return wl([Ca(l,{props:[Ke(c,/:(plac\w+)/,":"+Qe+"input-$1")]}),Ca(l,{props:[Ke(c,/:(plac\w+)/,":"+au+"$1")]}),Ca(l,{props:[Ke(c,/:(plac\w+)/,Gt+"input-$1")]})],o)}return""})}},pS=[hS],mS=function(l){var a=l.key;if(a==="css"){var u=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(u,function(A){var U=A.getAttribute("data-emotion");U.indexOf(" ")!==-1&&(document.head.appendChild(A),A.setAttribute("data-s",""))})}var o=l.stylisPlugins||pS,c={},d,h=[];d=l.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+a+' "]'),function(A){for(var U=A.getAttribute("data-emotion").split(" "),T=1;T=4;++u,o-=4)a=t.charCodeAt(u)&255|(t.charCodeAt(++u)&255)<<8|(t.charCodeAt(++u)&255)<<16|(t.charCodeAt(++u)&255)<<24,a=(a&65535)*1540483477+((a>>>16)*59797<<16),a^=a>>>24,l=(a&65535)*1540483477+((a>>>16)*59797<<16)^(l&65535)*1540483477+((l>>>16)*59797<<16);switch(o){case 3:l^=(t.charCodeAt(u+2)&255)<<16;case 2:l^=(t.charCodeAt(u+1)&255)<<8;case 1:l^=t.charCodeAt(u)&255,l=(l&65535)*1540483477+((l>>>16)*59797<<16)}return l^=l>>>13,l=(l&65535)*1540483477+((l>>>16)*59797<<16),((l^l>>>15)>>>0).toString(36)}var ES={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},CS=/[A-Z]|^ms/g,TS=/_EMO_([^_]+?)_([^]*?)_EMO_/g,wh=function(l){return l.charCodeAt(1)===45},Ah=function(l){return l!=null&&typeof l!="boolean"},ps=sh(function(t){return wh(t)?t:t.replace(CS,"-$&").toLowerCase()}),kh=function(l,a){switch(l){case"animation":case"animationName":if(typeof a=="string")return a.replace(TS,function(u,o,c){return Hn={name:o,styles:c,next:Hn},o})}return ES[l]!==1&&!wh(l)&&typeof a=="number"&&a!==0?a+"px":a};function Aa(t,l,a){if(a==null)return"";var u=a;if(u.__emotion_styles!==void 0)return u;switch(typeof a){case"boolean":return"";case"object":{var o=a;if(o.anim===1)return Hn={name:o.name,styles:o.styles,next:Hn},o.name;var c=a;if(c.styles!==void 0){var d=c.next;if(d!==void 0)for(;d!==void 0;)Hn={name:d.name,styles:d.styles,next:Hn},d=d.next;var h=c.styles+";";return h}return wS(t,l,a)}case"function":{if(t!==void 0){var m=Hn,p=a(t);return Hn=m,Aa(t,l,p)}break}}var g=a;if(l==null)return g;var b=l[g];return b!==void 0?b:g}function wS(t,l,a){var u="";if(Array.isArray(a))for(var o=0;o96?RS:DS},Bh=function(l,a,u){var o;if(a){var c=a.shouldForwardProp;o=l.__emotion_forwardProp&&c?function(d){return l.__emotion_forwardProp(d)&&c(d)}:c}return typeof o!="function"&&u&&(o=l.__emotion_forwardProp),o},MS=function(l){var a=l.cache,u=l.serialized,o=l.isStringTag;return Ch(a,u,o),kS(function(){return Th(a,u,o)}),null},zS=function t(l,a){var u=l.__emotion_real===l,o=u&&l.__emotion_base||l,c,d;a!==void 0&&(c=a.label,d=a.target);var h=Bh(l,a,u),m=h||Nh(o),p=!m("as");return function(){var g=arguments,b=u&&l.__emotion_styles!==void 0?l.__emotion_styles.slice(0):[];if(c!==void 0&&b.push("label:"+c+";"),g[0]==null||g[0].raw===void 0)b.push.apply(b,g);else{b.push(g[0][0]);for(var x=g.length,v=1;va.searchParams.append("args[]",u)),`Minified MUI error #${t}; visit ${a} for the full message.`}const gr="$$material";function gs(t,...l){const a=new URL(`https://mui.com/production-error/?code=${t}`);return l.forEach(u=>a.searchParams.append("args[]",u)),`Minified MUI error #${t}; visit ${a} for the full message.`}var ys={exports:{}},Oa={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Hh;function BS(){if(Hh)return Oa;Hh=1;var t=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(u,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:t,type:u,key:d,ref:o!==void 0?o:null,props:c}}return Oa.Fragment=l,Oa.jsx=a,Oa.jsxs=a,Oa}var jh;function LS(){return jh||(jh=1,ys.exports=BS()),ys.exports}var Ye=LS();function US(t){return t==null||Object.keys(t).length===0}function Vh(t){const{styles:l,defaultTheme:a={}}=t,u=typeof l=="function"?o=>l(US(o)?a:o):l;return Ye.jsx(OS,{styles:u})}/** + * @mui/styled-engine v6.1.6 + * + * @license MIT + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */function HS(t,l){return ot(t,l)}function jS(t,l){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=l(t.__emotion_styles))}const qh=[];function Gh(t){return qh[0]=t,hu(qh)}function $r(t){if(typeof t!="object"||t===null)return!1;const l=Object.getPrototypeOf(t);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ih(t){if(!$r(t))return t;const l={};return Object.keys(t).forEach(a=>{l[a]=Ih(t[a])}),l}function Fr(t,l,a={clone:!0}){const u=a.clone?{...t}:t;return $r(t)&&$r(l)&&Object.keys(l).forEach(o=>{$r(l[o])&&Object.prototype.hasOwnProperty.call(t,o)&&$r(t[o])?u[o]=Fr(t[o],l[o],a):a.clone?u[o]=$r(l[o])?Ih(l[o]):l[o]:u[o]=l[o]}),u}const VS=t=>{const l=Object.keys(t).map(a=>({key:a,val:t[a]}))||[];return l.sort((a,u)=>a.val-u.val),l.reduce((a,u)=>({...a,[u.key]:u.val}),{})};function qS(t){const{values:l={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:a="px",step:u=5,...o}=t,c=VS(l),d=Object.keys(c);function h(x){return`@media (min-width:${typeof l[x]=="number"?l[x]:x}${a})`}function m(x){return`@media (max-width:${(typeof l[x]=="number"?l[x]:x)-u/100}${a})`}function p(x,v){const D=d.indexOf(v);return`@media (min-width:${typeof l[x]=="number"?l[x]:x}${a}) and (max-width:${(D!==-1&&typeof l[d[D]]=="number"?l[d[D]]:v)-u/100}${a})`}function g(x){return d.indexOf(x)+1u.startsWith("@container")).sort((u,o)=>{var d,h;const c=/min-width:\s*([0-9.]+)/;return+(((d=u.match(c))==null?void 0:d[1])||0)-+(((h=o.match(c))==null?void 0:h[1])||0)});return a.length?a.reduce((u,o)=>{const c=l[o];return delete u[o],u[o]=c,u},{...l}):l}function IS(t,l){return l==="@"||l.startsWith("@")&&(t.some(a=>l.startsWith(`@${a}`))||!!l.match(/^@\d/))}function YS(t,l){const a=l.match(/^@([^/]+)?\/?(.+)?$/);if(!a)return null;const[,u,o]=a,c=Number.isNaN(+u)?u||0:+u;return t.containerQueries(o).up(c)}function $S(t){const l=(c,d)=>c.replace("@media",d?`@container ${d}`:"@container");function a(c,d){c.up=(...h)=>l(t.breakpoints.up(...h),d),c.down=(...h)=>l(t.breakpoints.down(...h),d),c.between=(...h)=>l(t.breakpoints.between(...h),d),c.only=(...h)=>l(t.breakpoints.only(...h),d),c.not=(...h)=>{const m=l(t.breakpoints.not(...h),d);return m.includes("not all and")?m.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):m}}const u={},o=c=>(a(u,c),u);return a(o),{...t,containerQueries:o}}const FS={borderRadius:4};function Ra(t,l){return l?Fr(t,l,{clone:!1}):t}const pu={xs:0,sm:600,md:900,lg:1200,xl:1536},Yh={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${pu[t]}px)`},XS={containerQueries:t=>({up:l=>{let a=typeof l=="number"?l:pu[l]||l;return typeof a=="number"&&(a=`${a}px`),t?`@container ${t} (min-width:${a})`:`@container (min-width:${a})`}})};function Qn(t,l,a){const u=t.theme||{};if(Array.isArray(l)){const c=u.breakpoints||Yh;return l.reduce((d,h,m)=>(d[c.up(c.keys[m])]=a(l[m]),d),{})}if(typeof l=="object"){const c=u.breakpoints||Yh;return Object.keys(l).reduce((d,h)=>{if(IS(c.keys,h)){const m=YS(u.containerQueries?u:XS,h);m&&(d[m]=a(l[h],h))}else if(Object.keys(c.values||pu).includes(h)){const m=c.up(h);d[m]=a(l[h],h)}else{const m=h;d[m]=l[m]}return d},{})}return a(l)}function QS(t={}){var a;return((a=t.keys)==null?void 0:a.reduce((u,o)=>{const c=t.up(o);return u[c]={},u},{}))||{}}function KS(t,l){return t.reduce((a,u)=>{const o=a[u];return(!o||Object.keys(o).length===0)&&delete a[u],a},l)}function $h(t){if(typeof t!="string")throw new Error(gs(7));return t.charAt(0).toUpperCase()+t.slice(1)}function mu(t,l,a=!0){if(!l||typeof l!="string")return null;if(t&&t.vars&&a){const u=`vars.${l}`.split(".").reduce((o,c)=>o&&o[c]?o[c]:null,t);if(u!=null)return u}return l.split(".").reduce((u,o)=>u&&u[o]!=null?u[o]:null,t)}function gu(t,l,a,u=a){let o;return typeof t=="function"?o=t(a):Array.isArray(t)?o=t[a]||u:o=mu(t,a)||u,l&&(o=l(o,u,t)),o}function bt(t){const{prop:l,cssProperty:a=t.prop,themeKey:u,transform:o}=t,c=d=>{if(d[l]==null)return null;const h=d[l],m=d.theme,p=mu(m,u)||{};return Qn(d,h,b=>{let x=gu(p,o,b);return b===x&&typeof b=="string"&&(x=gu(p,o,`${l}${b==="default"?"":$h(b)}`,b)),a===!1?x:{[a]:x}})};return c.propTypes={},c.filterProps=[l],c}function ZS(t){const l={};return a=>(l[a]===void 0&&(l[a]=t(a)),l[a])}const PS={m:"margin",p:"padding"},JS={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Fh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},WS=ZS(t=>{if(t.length>2)if(Fh[t])t=Fh[t];else return[t];const[l,a]=t.split(""),u=PS[l],o=JS[a]||"";return Array.isArray(o)?o.map(c=>u+c):[u+o]}),bs=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ss=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...bs,...Ss];function Da(t,l,a,u){const o=mu(t,l,!0)??a;return typeof o=="number"||typeof o=="string"?c=>typeof c=="string"?c:typeof o=="string"?`calc(${c} * ${o})`:o*c:Array.isArray(o)?c=>{if(typeof c=="string")return c;const d=Math.abs(c),h=o[d];return c>=0?h:typeof h=="number"?-h:`-${h}`}:typeof o=="function"?o:()=>{}}function vs(t){return Da(t,"spacing",8)}function Ma(t,l){return typeof l=="string"||l==null?l:t(l)}function ev(t,l){return a=>t.reduce((u,o)=>(u[o]=Ma(l,a),u),{})}function tv(t,l,a,u){if(!l.includes(a))return null;const o=WS(a),c=ev(o,u),d=t[a];return Qn(t,d,c)}function Xh(t,l){const a=vs(t.theme);return Object.keys(t).map(u=>tv(t,l,u,a)).reduce(Ra,{})}function dt(t){return Xh(t,bs)}dt.propTypes={},dt.filterProps=bs;function ht(t){return Xh(t,Ss)}ht.propTypes={},ht.filterProps=Ss;function Qh(t=8,l=vs({spacing:t})){if(t.mui)return t;const a=(...u)=>(u.length===0?[1]:u).map(c=>{const d=l(c);return typeof d=="number"?`${d}px`:d}).join(" ");return a.mui=!0,a}function yu(...t){const l=t.reduce((u,o)=>(o.filterProps.forEach(c=>{u[c]=o}),u),{}),a=u=>Object.keys(u).reduce((o,c)=>l[c]?Ra(o,l[c](u)):o,{});return a.propTypes={},a.filterProps=t.reduce((u,o)=>u.concat(o.filterProps),[]),a}function pn(t){return typeof t!="number"?t:`${t}px solid`}function mn(t,l){return bt({prop:t,themeKey:"borders",transform:l})}const nv=mn("border",pn),rv=mn("borderTop",pn),lv=mn("borderRight",pn),av=mn("borderBottom",pn),iv=mn("borderLeft",pn),uv=mn("borderColor"),ov=mn("borderTopColor"),sv=mn("borderRightColor"),cv=mn("borderBottomColor"),fv=mn("borderLeftColor"),dv=mn("outline",pn),hv=mn("outlineColor"),bu=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const l=Da(t.theme,"shape.borderRadius",4),a=u=>({borderRadius:Ma(l,u)});return Qn(t,t.borderRadius,a)}return null};bu.propTypes={},bu.filterProps=["borderRadius"],yu(nv,rv,lv,av,iv,uv,ov,sv,cv,fv,bu,dv,hv);const Su=t=>{if(t.gap!==void 0&&t.gap!==null){const l=Da(t.theme,"spacing",8),a=u=>({gap:Ma(l,u)});return Qn(t,t.gap,a)}return null};Su.propTypes={},Su.filterProps=["gap"];const vu=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const l=Da(t.theme,"spacing",8),a=u=>({columnGap:Ma(l,u)});return Qn(t,t.columnGap,a)}return null};vu.propTypes={},vu.filterProps=["columnGap"];const xu=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const l=Da(t.theme,"spacing",8),a=u=>({rowGap:Ma(l,u)});return Qn(t,t.rowGap,a)}return null};xu.propTypes={},xu.filterProps=["rowGap"];const pv=bt({prop:"gridColumn"}),mv=bt({prop:"gridRow"}),gv=bt({prop:"gridAutoFlow"}),yv=bt({prop:"gridAutoColumns"}),bv=bt({prop:"gridAutoRows"}),Sv=bt({prop:"gridTemplateColumns"}),vv=bt({prop:"gridTemplateRows"}),xv=bt({prop:"gridTemplateAreas"}),Ev=bt({prop:"gridArea"});yu(Su,vu,xu,pv,mv,gv,yv,bv,Sv,vv,xv,Ev);function kl(t,l){return l==="grey"?l:t}const Cv=bt({prop:"color",themeKey:"palette",transform:kl}),Tv=bt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:kl}),wv=bt({prop:"backgroundColor",themeKey:"palette",transform:kl});yu(Cv,Tv,wv);function rn(t){return t<=1&&t!==0?`${t*100}%`:t}const Av=bt({prop:"width",transform:rn}),xs=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const l=a=>{var o,c,d,h,m;const u=((d=(c=(o=t.theme)==null?void 0:o.breakpoints)==null?void 0:c.values)==null?void 0:d[a])||pu[a];return u?((m=(h=t.theme)==null?void 0:h.breakpoints)==null?void 0:m.unit)!=="px"?{maxWidth:`${u}${t.theme.breakpoints.unit}`}:{maxWidth:u}:{maxWidth:rn(a)}};return Qn(t,t.maxWidth,l)}return null};xs.filterProps=["maxWidth"];const kv=bt({prop:"minWidth",transform:rn}),_v=bt({prop:"height",transform:rn}),Ov=bt({prop:"maxHeight",transform:rn}),Rv=bt({prop:"minHeight",transform:rn});bt({prop:"size",cssProperty:"width",transform:rn}),bt({prop:"size",cssProperty:"height",transform:rn});const Dv=bt({prop:"boxSizing"});yu(Av,xs,kv,_v,Ov,Rv,Dv);const Eu={border:{themeKey:"borders",transform:pn},borderTop:{themeKey:"borders",transform:pn},borderRight:{themeKey:"borders",transform:pn},borderBottom:{themeKey:"borders",transform:pn},borderLeft:{themeKey:"borders",transform:pn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:pn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:bu},color:{themeKey:"palette",transform:kl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:kl},backgroundColor:{themeKey:"palette",transform:kl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:dt},mt:{style:dt},mr:{style:dt},mb:{style:dt},ml:{style:dt},mx:{style:dt},my:{style:dt},margin:{style:dt},marginTop:{style:dt},marginRight:{style:dt},marginBottom:{style:dt},marginLeft:{style:dt},marginX:{style:dt},marginY:{style:dt},marginInline:{style:dt},marginInlineStart:{style:dt},marginInlineEnd:{style:dt},marginBlock:{style:dt},marginBlockStart:{style:dt},marginBlockEnd:{style:dt},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Su},rowGap:{style:xu},columnGap:{style:vu},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:rn},maxWidth:{style:xs},minWidth:{transform:rn},height:{transform:rn},maxHeight:{transform:rn},minHeight:{transform:rn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Mv(...t){const l=t.reduce((u,o)=>u.concat(Object.keys(o)),[]),a=new Set(l);return t.every(u=>a.size===Object.keys(u).length)}function zv(t,l){return typeof t=="function"?t(l):t}function Nv(){function t(a,u,o,c){const d={[a]:u,theme:o},h=c[a];if(!h)return{[a]:u};const{cssProperty:m=a,themeKey:p,transform:g,style:b}=h;if(u==null)return null;if(p==="typography"&&u==="inherit")return{[a]:u};const x=mu(o,p)||{};return b?b(d):Qn(d,u,D=>{let A=gu(x,g,D);return D===A&&typeof D=="string"&&(A=gu(x,g,`${a}${D==="default"?"":$h(D)}`,D)),m===!1?A:{[m]:A}})}function l(a){const{sx:u,theme:o={}}=a||{};if(!u)return null;const c=o.unstable_sxConfig??Eu;function d(h){let m=h;if(typeof h=="function")m=h(o);else if(typeof h!="object")return h;if(!m)return null;const p=QS(o.breakpoints),g=Object.keys(p);let b=p;return Object.keys(m).forEach(x=>{const v=zv(m[x],o);if(v!=null)if(typeof v=="object")if(c[x])b=Ra(b,t(x,v,o,c));else{const D=Qn({theme:o},v,A=>({[x]:A}));Mv(D,v)?b[x]=l({sx:v,theme:o}):b=Ra(b,D)}else b=Ra(b,t(x,v,o,c))}),GS(o,KS(g,b))}return Array.isArray(u)?u.map(d):d(u)}return l}const Xr=Nv();Xr.filterProps=["sx"];function Bv(t,l){var u;const a=this;if(a.vars){if(!((u=a.colorSchemes)!=null&&u[t])||typeof a.getColorSchemeSelector!="function")return{};let o=a.getColorSchemeSelector(t);return o==="&"?l:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:l})}return a.palette.mode===t?l:{}}function Es(t={},...l){const{breakpoints:a={},palette:u={},spacing:o,shape:c={},...d}=t,h=qS(a),m=Qh(o);let p=Fr({breakpoints:h,direction:"ltr",components:{},palette:{mode:"light",...u},spacing:m,shape:{...FS,...c}},d);return p=$S(p),p.applyStyles=Bv,p=l.reduce((g,b)=>Fr(g,b),p),p.unstable_sxConfig={...Eu,...d==null?void 0:d.unstable_sxConfig},p.unstable_sx=function(b){return Xr({sx:b,theme:this})},p}function Lv(t){return Object.keys(t).length===0}function Kh(t=null){const l=j.useContext(ka);return!l||Lv(l)?t:l}const Uv=Es();function Hv(t=Uv){return Kh(t)}function jv({styles:t,themeId:l,defaultTheme:a={}}){const u=Hv(a),o=typeof t=="function"?t(l&&u[l]||u):t;return Ye.jsx(Vh,{styles:o})}function Zh(t){const{variants:l,...a}=t,u={variants:l,style:Gh(a),isProcessed:!0};return u.style===a||l&&l.forEach(o=>{typeof o.style!="function"&&(o.style=Gh(o.style))}),u}const Vv=Es();function Cs(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function qv(t){return t?(l,a)=>a[t]:null}function Gv(t,l,a){t.theme=$v(t.theme)?a:t.theme[l]||t.theme}function Cu(t,l){const a=typeof l=="function"?l(t):l;if(Array.isArray(a))return a.flatMap(u=>Cu(t,u));if(Array.isArray(a==null?void 0:a.variants)){let u;if(a.isProcessed)u=a.style;else{const{variants:o,...c}=a;u=c}return Ph(t,a.variants,[u])}return a!=null&&a.isProcessed?a.style:a}function Ph(t,l,a=[]){var o;let u;e:for(let c=0;c{jS(h,_=>_.filter(R=>R!==Xr));const{name:p,slot:g,skipVariantsResolver:b,skipSx:x,overridesResolver:v=qv(Xv(g)),...D}=m,A=b!==void 0?b:g&&g!=="Root"&&g!=="root"||!1,U=x||!1;let T=Cs;g==="Root"||g==="root"?T=u:g?T=o:Fv(h)&&(T=void 0);const N=HS(h,{shouldForwardProp:T,label:Yv(),...D}),O=_=>{if(typeof _=="function"&&_.__emotion_real!==_)return function(G){return Cu(G,_)};if($r(_)){const R=Zh(_);return R.variants?function(ne){return Cu(ne,R)}:R.style}return _},L=(..._)=>{const R=[],G=_.map(O),ne=[];if(R.push(c),p&&v&&ne.push(function(X){var J,ae;const te=(ae=(J=X.theme.components)==null?void 0:J[p])==null?void 0:ae.styleOverrides;if(!te)return null;const ue={};for(const ie in te)ue[ie]=Cu(X,te[ie]);return v(X,ue)}),p&&!A&&ne.push(function(X){var ue,J;const P=X.theme,te=(J=(ue=P==null?void 0:P.components)==null?void 0:ue[p])==null?void 0:J.variants;return te?Ph(X,te):null}),U||ne.push(Xr),Array.isArray(G[0])){const q=G.shift(),X=new Array(R.length).fill(""),P=new Array(ne.length).fill("");let te;te=[...X,...q,...P],te.raw=[...X,...q.raw,...P],R.unshift(te)}const Y=[...R,...G,...ne],E=N(...Y);return h.muiName&&(E.muiName=h.muiName),E};return N.withConfig&&(L.withConfig=N.withConfig),L}}function Yv(t,l){return void 0}function $v(t){for(const l in t)return!1;return!0}function Fv(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Xv(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}function Ts(t,l){const a={...l};for(const u in t)if(Object.prototype.hasOwnProperty.call(t,u)){const o=u;if(o==="components"||o==="slots")a[o]={...t[o],...a[o]};else if(o==="componentsProps"||o==="slotProps"){const c=t[o],d=l[o];if(!d)a[o]=c||{};else if(!c)a[o]=d;else{a[o]={...d};for(const h in c)if(Object.prototype.hasOwnProperty.call(c,h)){const m=h;a[o][m]=Ts(c[m],d[m])}}}else a[o]===void 0&&(a[o]=t[o])}return a}function Qv(t,l=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(l,Math.min(t,a))}function ws(t,l=0,a=1){return Qv(t,l,a)}function Kv(t){t=t.slice(1);const l=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let a=t.match(l);return a&&a[0].length===1&&(a=a.map(u=>u+u)),a?`rgb${a.length===4?"a":""}(${a.map((u,o)=>o<3?parseInt(u,16):Math.round(parseInt(u,16)/255*1e3)/1e3).join(", ")})`:""}function yr(t){if(t.type)return t;if(t.charAt(0)==="#")return yr(Kv(t));const l=t.indexOf("("),a=t.substring(0,l);if(!["rgb","rgba","hsl","hsla","color"].includes(a))throw new Error(gs(9,t));let u=t.substring(l+1,t.length-1),o;if(a==="color"){if(u=u.split(" "),o=u.shift(),u.length===4&&u[3].charAt(0)==="/"&&(u[3]=u[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(gs(10,o))}else u=u.split(",");return u=u.map(c=>parseFloat(c)),{type:a,values:u,colorSpace:o}}const Zv=t=>{const l=yr(t);return l.values.slice(0,3).map((a,u)=>l.type.includes("hsl")&&u!==0?`${a}%`:a).join(" ")},za=(t,l)=>{try{return Zv(t)}catch{return t}};function Tu(t){const{type:l,colorSpace:a}=t;let{values:u}=t;return l.includes("rgb")?u=u.map((o,c)=>c<3?parseInt(o,10):o):l.includes("hsl")&&(u[1]=`${u[1]}%`,u[2]=`${u[2]}%`),l.includes("color")?u=`${a} ${u.join(" ")}`:u=`${u.join(", ")}`,`${l}(${u})`}function Jh(t){t=yr(t);const{values:l}=t,a=l[0],u=l[1]/100,o=l[2]/100,c=u*Math.min(o,1-o),d=(p,g=(p+a/30)%12)=>o-c*Math.max(Math.min(g-3,9-g,1),-1);let h="rgb";const m=[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)];return t.type==="hsla"&&(h+="a",m.push(l[3])),Tu({type:h,values:m})}function As(t){t=yr(t);let l=t.type==="hsl"||t.type==="hsla"?yr(Jh(t)).values:t.values;return l=l.map(a=>(t.type!=="color"&&(a/=255),a<=.03928?a/12.92:((a+.055)/1.055)**2.4)),Number((.2126*l[0]+.7152*l[1]+.0722*l[2]).toFixed(3))}function Pv(t,l){const a=As(t),u=As(l);return(Math.max(a,u)+.05)/(Math.min(a,u)+.05)}function Wh(t,l){return t=yr(t),l=ws(l),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${l}`:t.values[3]=l,Tu(t)}function wu(t,l,a){try{return Wh(t,l)}catch{return t}}function ks(t,l){if(t=yr(t),l=ws(l),t.type.includes("hsl"))t.values[2]*=1-l;else if(t.type.includes("rgb")||t.type.includes("color"))for(let a=0;a<3;a+=1)t.values[a]*=1-l;return Tu(t)}function et(t,l,a){try{return ks(t,l)}catch{return t}}function _s(t,l){if(t=yr(t),l=ws(l),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*l;else if(t.type.includes("rgb"))for(let a=0;a<3;a+=1)t.values[a]+=(255-t.values[a])*l;else if(t.type.includes("color"))for(let a=0;a<3;a+=1)t.values[a]+=(1-t.values[a])*l;return Tu(t)}function tt(t,l,a){try{return _s(t,l)}catch{return t}}function Jv(t,l=.15){return As(t)>.5?ks(t,l):_s(t,l)}function Au(t,l,a){try{return Jv(t,l)}catch{return t}}const ep=j.createContext(null);function Os(){return j.useContext(ep)}const Wv=typeof Symbol=="function"&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function ex(t,l){return typeof l=="function"?l(t):{...t,...l}}function tx(t){const{children:l,theme:a}=t,u=Os(),o=j.useMemo(()=>{const c=u===null?{...a}:ex(u,a);return c!=null&&(c[Wv]=u!==null),c},[a,u]);return Ye.jsx(ep.Provider,{value:o,children:l})}const nx=j.createContext();function rx({value:t,...l}){return Ye.jsx(nx.Provider,{value:t??!0,...l})}const tp=j.createContext(void 0);function lx({value:t,children:l}){return Ye.jsx(tp.Provider,{value:t,children:l})}function ax(t){const{theme:l,name:a,props:u}=t;if(!l||!l.components||!l.components[a])return u;const o=l.components[a];return o.defaultProps?Ts(o.defaultProps,u):!o.styleOverrides&&!o.variants?Ts(o,u):u}function ix({props:t,name:l}){const a=j.useContext(tp);return ax({props:t,name:l,theme:{components:a}})}const np={};function rp(t,l,a,u=!1){return j.useMemo(()=>{const o=t&&l[t]||l;if(typeof a=="function"){const c=a(o),d=t?{...l,[t]:c}:c;return u?()=>d:d}return t?{...l,[t]:a}:{...l,...a}},[t,l,a,u])}function lp(t){const{children:l,theme:a,themeId:u}=t,o=Kh(np),c=Os()||np,d=rp(u,o,a),h=rp(u,c,a,!0),m=d.direction==="rtl";return Ye.jsx(tx,{theme:h,children:Ye.jsx(ka.Provider,{value:d,children:Ye.jsx(rx,{value:m,children:Ye.jsx(lx,{value:d==null?void 0:d.components,children:l})})})})}const ap={theme:void 0};function ux(t){let l,a;return function(o){let c=l;return(c===void 0||o.theme!==a)&&(ap.theme=o.theme,c=Zh(t(ap)),l=c,a=o.theme),c}}const Rs="mode",Ds="color-scheme",ox="data-color-scheme";function sx(t){const{defaultMode:l="system",defaultLightColorScheme:a="light",defaultDarkColorScheme:u="dark",modeStorageKey:o=Rs,colorSchemeStorageKey:c=Ds,attribute:d=ox,colorSchemeNode:h="document.documentElement",nonce:m}=t;let p="",g=d;if(d==="class"&&(g=".%s"),d==="data"&&(g="[data-%s]"),g.startsWith(".")){const x=g.substring(1);p+=`${h}.classList.remove('${x}'.replace('%s', light), '${x}'.replace('%s', dark)); + ${h}.classList.add('${x}'.replace('%s', colorScheme));`}const b=g.match(/\[([^\]]+)\]/);if(b){const[x,v]=b[1].split("=");v||(p+=`${h}.removeAttribute('${x}'.replace('%s', light)); + ${h}.removeAttribute('${x}'.replace('%s', dark));`),p+=` + ${h}.setAttribute('${x}'.replace('%s', colorScheme), ${v?`${v}.replace('%s', colorScheme)`:'""'});`}else p+=`${h}.setAttribute('${g}', colorScheme);`;return Ye.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(function() { +try { + let colorScheme = ''; + const mode = localStorage.getItem('${o}') || '${l}'; + const dark = localStorage.getItem('${c}-dark') || '${u}'; + const light = localStorage.getItem('${c}-light') || '${a}'; + if (mode === 'system') { + // handle system mode + const mql = window.matchMedia('(prefers-color-scheme: dark)'); + if (mql.matches) { + colorScheme = dark + } else { + colorScheme = light + } + } + if (mode === 'light') { + colorScheme = light; + } + if (mode === 'dark') { + colorScheme = dark; + } + if (colorScheme) { + ${p} + } +} catch(e){}})();`}},"mui-color-scheme-init")}function ip(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function up(t,l){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return l("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return l("dark")}function cx(t){return up(t,l=>{if(l==="light")return t.lightColorScheme;if(l==="dark")return t.darkColorScheme})}function Ms(t,l){if(typeof window>"u")return;let a;try{a=localStorage.getItem(t)||void 0,a||localStorage.setItem(t,l)}catch{}return a||l}function fx(t){const{defaultMode:l="light",defaultLightColorScheme:a,defaultDarkColorScheme:u,supportedColorSchemes:o=[],modeStorageKey:c=Rs,colorSchemeStorageKey:d=Ds,storageWindow:h=typeof window>"u"?void 0:window}=t,m=o.join(","),p=o.length>1,[g,b]=j.useState(()=>{const O=Ms(c,l),L=Ms(`${d}-light`,a),_=Ms(`${d}-dark`,u);return{mode:O,systemMode:ip(O),lightColorScheme:L,darkColorScheme:_}}),[,x]=j.useState(!1),v=j.useRef(!1);j.useEffect(()=>{p&&x(!0),v.current=!0},[p]);const D=cx(g),A=j.useCallback(O=>{b(L=>{if(O===L.mode)return L;const _=O??l;try{localStorage.setItem(c,_)}catch{}return{...L,mode:_,systemMode:ip(_)}})},[c,l]),U=j.useCallback(O=>{O?typeof O=="string"?O&&!m.includes(O)?console.error(`\`${O}\` does not exist in \`theme.colorSchemes\`.`):b(L=>{const _={...L};return up(L,R=>{try{localStorage.setItem(`${d}-${R}`,O)}catch{}R==="light"&&(_.lightColorScheme=O),R==="dark"&&(_.darkColorScheme=O)}),_}):b(L=>{const _={...L},R=O.light===null?a:O.light,G=O.dark===null?u:O.dark;if(R)if(!m.includes(R))console.error(`\`${R}\` does not exist in \`theme.colorSchemes\`.`);else{_.lightColorScheme=R;try{localStorage.setItem(`${d}-light`,R)}catch{}}if(G)if(!m.includes(G))console.error(`\`${G}\` does not exist in \`theme.colorSchemes\`.`);else{_.darkColorScheme=G;try{localStorage.setItem(`${d}-dark`,G)}catch{}}return _}):b(L=>{try{localStorage.setItem(`${d}-light`,a),localStorage.setItem(`${d}-dark`,u)}catch{}return{...L,lightColorScheme:a,darkColorScheme:u}})},[m,d,a,u]),T=j.useCallback(O=>{g.mode==="system"&&b(L=>{const _=O!=null&&O.matches?"dark":"light";return L.systemMode===_?L:{...L,systemMode:_}})},[g.mode]),N=j.useRef(T);return N.current=T,j.useEffect(()=>{if(typeof window.matchMedia!="function"||!p)return;const O=(..._)=>N.current(..._),L=window.matchMedia("(prefers-color-scheme: dark)");return L.addListener(O),O(L),()=>{L.removeListener(O)}},[p]),j.useEffect(()=>{if(h&&p){const O=L=>{const _=L.newValue;typeof L.key=="string"&&L.key.startsWith(d)&&(!_||m.match(_))&&(L.key.endsWith("light")&&U({light:_}),L.key.endsWith("dark")&&U({dark:_})),L.key===c&&(!_||["light","dark","system"].includes(_))&&A(_||l)};return h.addEventListener("storage",O),()=>{h.removeEventListener("storage",O)}}},[U,A,c,d,m,l,h,p]),{...g,mode:v.current||!p?g.mode:void 0,systemMode:v.current||!p?g.systemMode:void 0,colorScheme:v.current||!p?D:void 0,setMode:A,setColorScheme:U}}const dx="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function hx(t){const{themeId:l,theme:a={},modeStorageKey:u=Rs,colorSchemeStorageKey:o=Ds,disableTransitionOnChange:c=!1,defaultColorScheme:d,resolveTheme:h}=t,m={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},p=j.createContext(void 0),g=()=>j.useContext(p)||m;function b(A){var Rn,on,De,Dt,I;const{children:U,theme:T,modeStorageKey:N=u,colorSchemeStorageKey:O=o,disableTransitionOnChange:L=c,storageWindow:_=typeof window>"u"?void 0:window,documentNode:R=typeof document>"u"?void 0:document,colorSchemeNode:G=typeof document>"u"?void 0:document.documentElement,disableNestedContext:ne=!1,disableStyleSheetGeneration:Y=!1,defaultMode:E="system"}=A,q=j.useRef(!1),X=Os(),P=j.useContext(p),te=!!P&&!ne,ue=j.useMemo(()=>T||(typeof a=="function"?a():a),[T]),J=ue[l],{colorSchemes:ae={},components:ie={},cssVarPrefix:be,...S}=J||ue,K=Object.keys(ae).filter(W=>!!ae[W]).join(","),oe=j.useMemo(()=>K.split(","),[K]),w=typeof d=="string"?d:d.light,le=typeof d=="string"?d:d.dark,ye=ae[w]&&ae[le]?E:((on=(Rn=ae[S.defaultColorScheme])==null?void 0:Rn.palette)==null?void 0:on.mode)||((De=S.palette)==null?void 0:De.mode),{mode:de,setMode:qe,systemMode:Ee,lightColorScheme:_e,darkColorScheme:fe,colorScheme:Ne,setColorScheme:ge}=fx({supportedColorSchemes:oe,defaultLightColorScheme:w,defaultDarkColorScheme:le,modeStorageKey:N,colorSchemeStorageKey:O,defaultMode:ye,storageWindow:_});let pe=de,se=Ne;te&&(pe=P.mode,se=P.colorScheme);const ve=se||S.defaultColorScheme,Ie=((Dt=S.generateThemeVars)==null?void 0:Dt.call(S))||S.vars,Ue={...S,components:ie,colorSchemes:ae,cssVarPrefix:be,vars:Ie};if(typeof Ue.generateSpacing=="function"&&(Ue.spacing=Ue.generateSpacing()),ve){const W=ae[ve];W&&typeof W=="object"&&Object.keys(W).forEach(ce=>{W[ce]&&typeof W[ce]=="object"?Ue[ce]={...Ue[ce],...W[ce]}:Ue[ce]=W[ce]})}const Re=S.colorSchemeSelector;j.useEffect(()=>{if(se&&G&&Re&&Re!=="media"){const W=Re;let ce=Re;if(W==="class"&&(ce=".%s"),W==="data"&&(ce="[data-%s]"),W!=null&&W.startsWith("data-")&&!W.includes("%s")&&(ce=`[${W}="%s"]`),ce.startsWith("."))G.classList.remove(...oe.map(Te=>ce.substring(1).replace("%s",Te))),G.classList.add(ce.substring(1).replace("%s",se));else{const Te=ce.replace("%s",se).match(/\[([^\]]+)\]/);if(Te){const[He,Me]=Te[1].split("=");Me||oe.forEach(Jt=>{G.removeAttribute(He.replace(se,Jt))}),G.setAttribute(He,Me?Me.replace(/"|'/g,""):"")}else G.setAttribute(ce,se)}}},[se,Re,G,oe]),j.useEffect(()=>{let W;if(L&&q.current&&R){const ce=R.createElement("style");ce.appendChild(R.createTextNode(dx)),R.head.appendChild(ce),window.getComputedStyle(R.body),W=setTimeout(()=>{R.head.removeChild(ce)},1)}return()=>{clearTimeout(W)}},[se,L,R]),j.useEffect(()=>(q.current=!0,()=>{q.current=!1}),[]);const at=j.useMemo(()=>({allColorSchemes:oe,colorScheme:se,darkColorScheme:fe,lightColorScheme:_e,mode:pe,setColorScheme:ge,setMode:qe,systemMode:Ee}),[oe,se,fe,_e,pe,ge,qe,Ee]);let St=!0;(Y||S.cssVariables===!1||te&&(X==null?void 0:X.cssVarPrefix)===be)&&(St=!1);const un=Ye.jsxs(j.Fragment,{children:[Ye.jsx(lp,{themeId:J?l:void 0,theme:h?h(Ue):Ue,children:U}),St&&Ye.jsx(Vh,{styles:((I=Ue.generateStyleSheets)==null?void 0:I.call(Ue))||[]})]});return te?un:Ye.jsx(p.Provider,{value:at,children:un})}const x=typeof d=="string"?d:d.light,v=typeof d=="string"?d:d.dark;return{CssVarsProvider:b,useColorScheme:g,getInitColorSchemeScript:A=>sx({colorSchemeStorageKey:o,defaultLightColorScheme:x,defaultDarkColorScheme:v,modeStorageKey:u,...A})}}function px(t=""){function l(...u){if(!u.length)return"";const o=u[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${o}${l(...u.slice(1))})`:`, ${o}`}return(u,...o)=>`var(--${t?`${t}-`:""}${u}${l(...o)})`}const op=(t,l,a,u=[])=>{let o=t;l.forEach((c,d)=>{d===l.length-1?Array.isArray(o)?o[Number(c)]=a:o&&typeof o=="object"&&(o[c]=a):o&&typeof o=="object"&&(o[c]||(o[c]=u.includes(c)?[]:{}),o=o[c])})},mx=(t,l,a)=>{function u(o,c=[],d=[]){Object.entries(o).forEach(([h,m])=>{(!a||!a([...c,h]))&&m!=null&&(typeof m=="object"&&Object.keys(m).length>0?u(m,[...c,h],Array.isArray(m)?[...d,h]:d):l([...c,h],m,d))})}u(t)},gx=(t,l)=>typeof l=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(u=>t.includes(u))||t[t.length-1].toLowerCase().includes("opacity")?l:`${l}px`:l;function zs(t,l){const{prefix:a,shouldSkipGeneratingVar:u}=l||{},o={},c={},d={};return mx(t,(h,m,p)=>{if((typeof m=="string"||typeof m=="number")&&(!u||!u(h,m))){const g=`--${a?`${a}-`:""}${h.join("-")}`,b=gx(h,m);Object.assign(o,{[g]:b}),op(c,h,`var(${g})`,p),op(d,h,`var(${g}, ${b})`,p)}},h=>h[0]==="vars"),{css:o,vars:c,varsWithDefaults:d}}function yx(t,l={}){const{getSelector:a=U,disableCssColorScheme:u,colorSchemeSelector:o}=l,{colorSchemes:c={},components:d,defaultColorScheme:h="light",...m}=t,{vars:p,css:g,varsWithDefaults:b}=zs(m,l);let x=b;const v={},{[h]:D,...A}=c;if(Object.entries(A||{}).forEach(([O,L])=>{const{vars:_,css:R,varsWithDefaults:G}=zs(L,l);x=Fr(x,G),v[O]={css:R,vars:_}}),D){const{css:O,vars:L,varsWithDefaults:_}=zs(D,l);x=Fr(x,_),v[h]={css:O,vars:L}}function U(O,L){var R,G;let _=o;if(o==="class"&&(_=".%s"),o==="data"&&(_="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(_=`[${o}="%s"]`),O){if(_==="media")return t.defaultColorScheme===O?":root":{[`@media (prefers-color-scheme: ${((G=(R=c[O])==null?void 0:R.palette)==null?void 0:G.mode)||O})`]:{":root":L}};if(_)return t.defaultColorScheme===O?`:root, ${_.replace("%s",String(O))}`:_.replace("%s",String(O))}return":root"}return{vars:x,generateThemeVars:()=>{let O={...p};return Object.entries(v).forEach(([,{vars:L}])=>{O=Fr(O,L)}),O},generateStyleSheets:()=>{var ne,Y;const O=[],L=t.defaultColorScheme||"light";function _(E,q){Object.keys(q).length&&O.push(typeof E=="string"?{[E]:{...q}}:E)}_(a(void 0,{...g}),g);const{[L]:R,...G}=v;if(R){const{css:E}=R,q=(Y=(ne=c[L])==null?void 0:ne.palette)==null?void 0:Y.mode,X=!u&&q?{colorScheme:q,...E}:{...E};_(a(L,{...X}),X)}return Object.entries(G).forEach(([E,{css:q}])=>{var te,ue;const X=(ue=(te=c[E])==null?void 0:te.palette)==null?void 0:ue.mode,P=!u&&X?{colorScheme:X,...q}:{...q};_(a(E,{...P}),P)}),O}}}function bx(t){return function(a){return t==="media"?`@media (prefers-color-scheme: ${a})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${a}"] &`:t==="class"?`.${a} &`:t==="data"?`[data-${a}] &`:`${t.replace("%s",a)} &`:"&"}}function br(t){if(typeof t!="object"||t===null)return!1;const l=Object.getPrototypeOf(t);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function sp(t){if(!br(t))return t;const l={};return Object.keys(t).forEach(a=>{l[a]=sp(t[a])}),l}function Qr(t,l,a={clone:!0}){const u=a.clone?{...t}:t;return br(t)&&br(l)&&Object.keys(l).forEach(o=>{br(l[o])&&Object.prototype.hasOwnProperty.call(t,o)&&br(t[o])?u[o]=Qr(t[o],l[o],a):a.clone?u[o]=br(l[o])?sp(l[o]):l[o]:u[o]=l[o]}),u}const Na={black:"#000",white:"#fff"},Sx={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},_l={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Ol={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ba={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Rl={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Dl={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Ml={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function cp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Na.white,default:Na.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const vx=cp();function fp(){return{text:{primary:Na.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Na.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const dp=fp();function hp(t,l,a,u){const o=u.light||u,c=u.dark||u*1.5;t[l]||(t.hasOwnProperty(a)?t[l]=t[a]:l==="light"?t.light=_s(t.main,o):l==="dark"&&(t.dark=ks(t.main,c)))}function xx(t="light"){return t==="dark"?{main:Rl[200],light:Rl[50],dark:Rl[400]}:{main:Rl[700],light:Rl[400],dark:Rl[800]}}function Ex(t="light"){return t==="dark"?{main:_l[200],light:_l[50],dark:_l[400]}:{main:_l[500],light:_l[300],dark:_l[700]}}function Cx(t="light"){return t==="dark"?{main:Ol[500],light:Ol[300],dark:Ol[700]}:{main:Ol[700],light:Ol[400],dark:Ol[800]}}function Tx(t="light"){return t==="dark"?{main:Dl[400],light:Dl[300],dark:Dl[700]}:{main:Dl[700],light:Dl[500],dark:Dl[900]}}function wx(t="light"){return t==="dark"?{main:Ml[400],light:Ml[300],dark:Ml[700]}:{main:Ml[800],light:Ml[500],dark:Ml[900]}}function Ax(t="light"){return t==="dark"?{main:Ba[400],light:Ba[300],dark:Ba[700]}:{main:"#ed6c02",light:Ba[500],dark:Ba[900]}}function Ns(t){const{mode:l="light",contrastThreshold:a=3,tonalOffset:u=.2,...o}=t,c=t.primary||xx(l),d=t.secondary||Ex(l),h=t.error||Cx(l),m=t.info||Tx(l),p=t.success||wx(l),g=t.warning||Ax(l);function b(A){return Pv(A,dp.text.primary)>=a?dp.text.primary:vx.text.primary}const x=({color:A,name:U,mainShade:T=500,lightShade:N=300,darkShade:O=700})=>{if(A={...A},!A.main&&A[T]&&(A.main=A[T]),!A.hasOwnProperty("main"))throw new Error(Al(11,U?` (${U})`:"",T));if(typeof A.main!="string")throw new Error(Al(12,U?` (${U})`:"",JSON.stringify(A.main)));return hp(A,"light",N,u),hp(A,"dark",O,u),A.contrastText||(A.contrastText=b(A.main)),A};let v;return l==="light"?v=cp():l==="dark"&&(v=fp()),Qr({common:{...Na},mode:l,primary:x({color:c,name:"primary"}),secondary:x({color:d,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:x({color:h,name:"error"}),warning:x({color:g,name:"warning"}),info:x({color:m,name:"info"}),success:x({color:p,name:"success"}),grey:Sx,contrastThreshold:a,getContrastText:b,augmentColor:x,tonalOffset:u,...v},o)}function kx(t){const l={};return Object.entries(t).forEach(u=>{const[o,c]=u;typeof c=="object"&&(l[o]=`${c.fontStyle?`${c.fontStyle} `:""}${c.fontVariant?`${c.fontVariant} `:""}${c.fontWeight?`${c.fontWeight} `:""}${c.fontStretch?`${c.fontStretch} `:""}${c.fontSize||""}${c.lineHeight?`/${c.lineHeight} `:""}${c.fontFamily||""}`)}),l}const pp=t=>t,_x=(()=>{let t=pp;return{configure(l){t=l},generate(l){return t(l)},reset(){t=pp}}})(),Ox={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Bs(t,l,a="Mui"){const u=Ox[l];return u?`${a}-${u}`:`${_x.generate(t)}-${l}`}function Rx(t,l){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...l}}function Dx(t){return Math.round(t*1e5)/1e5}const mp={textTransform:"uppercase"},gp='"Roboto", "Helvetica", "Arial", sans-serif';function yp(t,l){const{fontFamily:a=gp,fontSize:u=14,fontWeightLight:o=300,fontWeightRegular:c=400,fontWeightMedium:d=500,fontWeightBold:h=700,htmlFontSize:m=16,allVariants:p,pxToRem:g,...b}=typeof l=="function"?l(t):l,x=u/14,v=g||(U=>`${U/m*x}rem`),D=(U,T,N,O,L)=>({fontFamily:a,fontWeight:U,fontSize:v(T),lineHeight:N,...a===gp?{letterSpacing:`${Dx(O/T)}em`}:{},...L,...p}),A={h1:D(o,96,1.167,-1.5),h2:D(o,60,1.2,-.5),h3:D(c,48,1.167,0),h4:D(c,34,1.235,.25),h5:D(c,24,1.334,0),h6:D(d,20,1.6,.15),subtitle1:D(c,16,1.75,.15),subtitle2:D(d,14,1.57,.1),body1:D(c,16,1.5,.15),body2:D(c,14,1.43,.15),button:D(d,14,1.75,.4,mp),caption:D(c,12,1.66,.4),overline:D(c,12,2.66,1,mp),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qr({htmlFontSize:m,pxToRem:v,fontFamily:a,fontSize:u,fontWeightLight:o,fontWeightRegular:c,fontWeightMedium:d,fontWeightBold:h,...A},b,{clone:!1})}const Mx=.2,zx=.14,Nx=.12;function st(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Mx})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${zx})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${Nx})`].join(",")}const Bx=["none",st(0,2,1,-1,0,1,1,0,0,1,3,0),st(0,3,1,-2,0,2,2,0,0,1,5,0),st(0,3,3,-2,0,3,4,0,0,1,8,0),st(0,2,4,-1,0,4,5,0,0,1,10,0),st(0,3,5,-1,0,5,8,0,0,1,14,0),st(0,3,5,-1,0,6,10,0,0,1,18,0),st(0,4,5,-2,0,7,10,1,0,2,16,1),st(0,5,5,-3,0,8,10,1,0,3,14,2),st(0,5,6,-3,0,9,12,1,0,3,16,2),st(0,6,6,-3,0,10,14,1,0,4,18,3),st(0,6,7,-4,0,11,15,1,0,4,20,3),st(0,7,8,-4,0,12,17,2,0,5,22,4),st(0,7,8,-4,0,13,19,2,0,5,24,4),st(0,7,9,-4,0,14,21,2,0,5,26,4),st(0,8,9,-5,0,15,22,2,0,6,28,5),st(0,8,10,-5,0,16,24,2,0,6,30,5),st(0,8,11,-5,0,17,26,2,0,6,32,5),st(0,9,11,-5,0,18,28,2,0,7,34,6),st(0,9,12,-6,0,19,29,2,0,7,36,6),st(0,10,13,-6,0,20,31,3,0,8,38,7),st(0,10,13,-6,0,21,33,3,0,8,40,7),st(0,10,14,-6,0,22,35,3,0,8,42,7),st(0,11,14,-7,0,23,36,3,0,9,44,8),st(0,11,15,-7,0,24,38,3,0,9,46,8)],Lx={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Ux={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function bp(t){return`${Math.round(t)}ms`}function Hx(t){if(!t)return 0;const l=t/36;return Math.min(Math.round((4+15*l**.25+l/5)*10),3e3)}function jx(t){const l={...Lx,...t.easing},a={...Ux,...t.duration};return{getAutoHeightDuration:Hx,create:(o=["all"],c={})=>{const{duration:d=a.standard,easing:h=l.easeInOut,delay:m=0,...p}=c;return(Array.isArray(o)?o:[o]).map(g=>`${g} ${typeof d=="string"?d:bp(d)} ${h} ${typeof m=="string"?m:bp(m)}`).join(",")},...t,easing:l,duration:a}}const Vx={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function qx(t){return br(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function Sp(t={}){const l={...t};function a(u){const o=Object.entries(u);for(let c=0;cQr(v,D),x),x.unstable_sxConfig={...Eu,...p==null?void 0:p.unstable_sxConfig},x.unstable_sx=function(D){return Xr({sx:D,theme:this})},x.toRuntimeSource=Sp,x}function Gx(t){let l;return t<1?l=5.11916*t**2:l=4.5*Math.log(t+1)+2,Math.round(l*10)/1e3}const Ix=[...Array(25)].map((t,l)=>{if(l===0)return"none";const a=Gx(l);return`linear-gradient(rgba(255 255 255 / ${a}), rgba(255 255 255 / ${a}))`});function vp(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function xp(t){return t==="dark"?Ix:[]}function Yx(t){const{palette:l={mode:"light"},opacity:a,overlays:u,...o}=t,c=Ns(l);return{palette:c,opacity:{...vp(c.mode),...a},overlays:u||xp(c.mode),...o}}function $x(t){var l;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((l=t[1])!=null&&l.match(/(mode|contrastThreshold|tonalOffset)/))}const Fx=t=>[...[...Array(25)].map((l,a)=>`--${t?`${t}-`:""}overlays-${a}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],Xx=t=>(l,a)=>{const u=t.rootSelector||":root",o=t.colorSchemeSelector;let c=o;if(o==="class"&&(c=".%s"),o==="data"&&(c="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(c=`[${o}="%s"]`),t.defaultColorScheme===l){if(l==="dark"){const d={};return Fx(t.cssVarPrefix).forEach(h=>{d[h]=a[h],delete a[h]}),c==="media"?{[u]:a,"@media (prefers-color-scheme: dark)":{[u]:d}}:c?{[c.replace("%s",l)]:d,[`${u}, ${c.replace("%s",l)}`]:a}:{[u]:{...a,...d}}}if(c&&c!=="media")return`${u}, ${c.replace("%s",String(l))}`}else if(l){if(c==="media")return{[`@media (prefers-color-scheme: ${String(l)})`]:{[u]:a}};if(c)return c.replace("%s",String(l))}return u};function Qx(t,l){l.forEach(a=>{t[a]||(t[a]={})})}function $(t,l,a){!t[l]&&a&&(t[l]=a)}function La(t){return!t||!t.startsWith("hsl")?t:Jh(t)}function Kn(t,l){`${l}Channel`in t||(t[`${l}Channel`]=za(La(t[l])))}function Kx(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const jn=t=>{try{return t()}catch{}},Zx=(t="mui")=>px(t);function Us(t,l,a,u){if(!l)return;l=l===!0?{}:l;const o=u==="dark"?"dark":"light";if(!a){t[u]=Yx({...l,palette:{mode:o,...l==null?void 0:l.palette}});return}const{palette:c,...d}=Ls({...a,palette:{mode:o,...l==null?void 0:l.palette}});return t[u]={...l,palette:c,opacity:{...vp(o),...l==null?void 0:l.opacity},overlays:(l==null?void 0:l.overlays)||xp(o)},d}function Px(t={},...l){const{colorSchemes:a={light:!0},defaultColorScheme:u,disableCssColorScheme:o=!1,cssVarPrefix:c="mui",shouldSkipGeneratingVar:d=$x,colorSchemeSelector:h=a.light&&a.dark?"media":void 0,rootSelector:m=":root",...p}=t,g=Object.keys(a)[0],b=u||(a.light&&g!=="light"?"light":g),x=Zx(c),{[b]:v,light:D,dark:A,...U}=a,T={...U};let N=v;if((b==="dark"&&!("dark"in a)||b==="light"&&!("light"in a))&&(N=!0),!N)throw new Error(Al(21,b));const O=Us(T,N,p,b);D&&!T.light&&Us(T,D,void 0,"light"),A&&!T.dark&&Us(T,A,void 0,"dark");let L={defaultColorScheme:b,...O,cssVarPrefix:c,colorSchemeSelector:h,rootSelector:m,getCssVar:x,colorSchemes:T,font:{...kx(O.typography),...O.font},spacing:Kx(p.spacing)};Object.keys(L.colorSchemes).forEach(Y=>{const E=L.colorSchemes[Y].palette,q=X=>{const P=X.split("-"),te=P[1],ue=P[2];return x(X,E[te][ue])};if(E.mode==="light"&&($(E.common,"background","#fff"),$(E.common,"onBackground","#000")),E.mode==="dark"&&($(E.common,"background","#000"),$(E.common,"onBackground","#fff")),Qx(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){$(E.Alert,"errorColor",et(E.error.light,.6)),$(E.Alert,"infoColor",et(E.info.light,.6)),$(E.Alert,"successColor",et(E.success.light,.6)),$(E.Alert,"warningColor",et(E.warning.light,.6)),$(E.Alert,"errorFilledBg",q("palette-error-main")),$(E.Alert,"infoFilledBg",q("palette-info-main")),$(E.Alert,"successFilledBg",q("palette-success-main")),$(E.Alert,"warningFilledBg",q("palette-warning-main")),$(E.Alert,"errorFilledColor",jn(()=>E.getContrastText(E.error.main))),$(E.Alert,"infoFilledColor",jn(()=>E.getContrastText(E.info.main))),$(E.Alert,"successFilledColor",jn(()=>E.getContrastText(E.success.main))),$(E.Alert,"warningFilledColor",jn(()=>E.getContrastText(E.warning.main))),$(E.Alert,"errorStandardBg",tt(E.error.light,.9)),$(E.Alert,"infoStandardBg",tt(E.info.light,.9)),$(E.Alert,"successStandardBg",tt(E.success.light,.9)),$(E.Alert,"warningStandardBg",tt(E.warning.light,.9)),$(E.Alert,"errorIconColor",q("palette-error-main")),$(E.Alert,"infoIconColor",q("palette-info-main")),$(E.Alert,"successIconColor",q("palette-success-main")),$(E.Alert,"warningIconColor",q("palette-warning-main")),$(E.AppBar,"defaultBg",q("palette-grey-100")),$(E.Avatar,"defaultBg",q("palette-grey-400")),$(E.Button,"inheritContainedBg",q("palette-grey-300")),$(E.Button,"inheritContainedHoverBg",q("palette-grey-A100")),$(E.Chip,"defaultBorder",q("palette-grey-400")),$(E.Chip,"defaultAvatarColor",q("palette-grey-700")),$(E.Chip,"defaultIconColor",q("palette-grey-700")),$(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),$(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),$(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),$(E.LinearProgress,"primaryBg",tt(E.primary.main,.62)),$(E.LinearProgress,"secondaryBg",tt(E.secondary.main,.62)),$(E.LinearProgress,"errorBg",tt(E.error.main,.62)),$(E.LinearProgress,"infoBg",tt(E.info.main,.62)),$(E.LinearProgress,"successBg",tt(E.success.main,.62)),$(E.LinearProgress,"warningBg",tt(E.warning.main,.62)),$(E.Skeleton,"bg",`rgba(${q("palette-text-primaryChannel")} / 0.11)`),$(E.Slider,"primaryTrack",tt(E.primary.main,.62)),$(E.Slider,"secondaryTrack",tt(E.secondary.main,.62)),$(E.Slider,"errorTrack",tt(E.error.main,.62)),$(E.Slider,"infoTrack",tt(E.info.main,.62)),$(E.Slider,"successTrack",tt(E.success.main,.62)),$(E.Slider,"warningTrack",tt(E.warning.main,.62));const X=Au(E.background.default,.8);$(E.SnackbarContent,"bg",X),$(E.SnackbarContent,"color",jn(()=>E.getContrastText(X))),$(E.SpeedDialAction,"fabHoverBg",Au(E.background.paper,.15)),$(E.StepConnector,"border",q("palette-grey-400")),$(E.StepContent,"border",q("palette-grey-400")),$(E.Switch,"defaultColor",q("palette-common-white")),$(E.Switch,"defaultDisabledColor",q("palette-grey-100")),$(E.Switch,"primaryDisabledColor",tt(E.primary.main,.62)),$(E.Switch,"secondaryDisabledColor",tt(E.secondary.main,.62)),$(E.Switch,"errorDisabledColor",tt(E.error.main,.62)),$(E.Switch,"infoDisabledColor",tt(E.info.main,.62)),$(E.Switch,"successDisabledColor",tt(E.success.main,.62)),$(E.Switch,"warningDisabledColor",tt(E.warning.main,.62)),$(E.TableCell,"border",tt(wu(E.divider,1),.88)),$(E.Tooltip,"bg",wu(E.grey[700],.92))}if(E.mode==="dark"){$(E.Alert,"errorColor",tt(E.error.light,.6)),$(E.Alert,"infoColor",tt(E.info.light,.6)),$(E.Alert,"successColor",tt(E.success.light,.6)),$(E.Alert,"warningColor",tt(E.warning.light,.6)),$(E.Alert,"errorFilledBg",q("palette-error-dark")),$(E.Alert,"infoFilledBg",q("palette-info-dark")),$(E.Alert,"successFilledBg",q("palette-success-dark")),$(E.Alert,"warningFilledBg",q("palette-warning-dark")),$(E.Alert,"errorFilledColor",jn(()=>E.getContrastText(E.error.dark))),$(E.Alert,"infoFilledColor",jn(()=>E.getContrastText(E.info.dark))),$(E.Alert,"successFilledColor",jn(()=>E.getContrastText(E.success.dark))),$(E.Alert,"warningFilledColor",jn(()=>E.getContrastText(E.warning.dark))),$(E.Alert,"errorStandardBg",et(E.error.light,.9)),$(E.Alert,"infoStandardBg",et(E.info.light,.9)),$(E.Alert,"successStandardBg",et(E.success.light,.9)),$(E.Alert,"warningStandardBg",et(E.warning.light,.9)),$(E.Alert,"errorIconColor",q("palette-error-main")),$(E.Alert,"infoIconColor",q("palette-info-main")),$(E.Alert,"successIconColor",q("palette-success-main")),$(E.Alert,"warningIconColor",q("palette-warning-main")),$(E.AppBar,"defaultBg",q("palette-grey-900")),$(E.AppBar,"darkBg",q("palette-background-paper")),$(E.AppBar,"darkColor",q("palette-text-primary")),$(E.Avatar,"defaultBg",q("palette-grey-600")),$(E.Button,"inheritContainedBg",q("palette-grey-800")),$(E.Button,"inheritContainedHoverBg",q("palette-grey-700")),$(E.Chip,"defaultBorder",q("palette-grey-700")),$(E.Chip,"defaultAvatarColor",q("palette-grey-300")),$(E.Chip,"defaultIconColor",q("palette-grey-300")),$(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),$(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),$(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),$(E.LinearProgress,"primaryBg",et(E.primary.main,.5)),$(E.LinearProgress,"secondaryBg",et(E.secondary.main,.5)),$(E.LinearProgress,"errorBg",et(E.error.main,.5)),$(E.LinearProgress,"infoBg",et(E.info.main,.5)),$(E.LinearProgress,"successBg",et(E.success.main,.5)),$(E.LinearProgress,"warningBg",et(E.warning.main,.5)),$(E.Skeleton,"bg",`rgba(${q("palette-text-primaryChannel")} / 0.13)`),$(E.Slider,"primaryTrack",et(E.primary.main,.5)),$(E.Slider,"secondaryTrack",et(E.secondary.main,.5)),$(E.Slider,"errorTrack",et(E.error.main,.5)),$(E.Slider,"infoTrack",et(E.info.main,.5)),$(E.Slider,"successTrack",et(E.success.main,.5)),$(E.Slider,"warningTrack",et(E.warning.main,.5));const X=Au(E.background.default,.98);$(E.SnackbarContent,"bg",X),$(E.SnackbarContent,"color",jn(()=>E.getContrastText(X))),$(E.SpeedDialAction,"fabHoverBg",Au(E.background.paper,.15)),$(E.StepConnector,"border",q("palette-grey-600")),$(E.StepContent,"border",q("palette-grey-600")),$(E.Switch,"defaultColor",q("palette-grey-300")),$(E.Switch,"defaultDisabledColor",q("palette-grey-600")),$(E.Switch,"primaryDisabledColor",et(E.primary.main,.55)),$(E.Switch,"secondaryDisabledColor",et(E.secondary.main,.55)),$(E.Switch,"errorDisabledColor",et(E.error.main,.55)),$(E.Switch,"infoDisabledColor",et(E.info.main,.55)),$(E.Switch,"successDisabledColor",et(E.success.main,.55)),$(E.Switch,"warningDisabledColor",et(E.warning.main,.55)),$(E.TableCell,"border",et(wu(E.divider,1),.68)),$(E.Tooltip,"bg",wu(E.grey[700],.92))}Kn(E.background,"default"),Kn(E.background,"paper"),Kn(E.common,"background"),Kn(E.common,"onBackground"),Kn(E,"divider"),Object.keys(E).forEach(X=>{const P=E[X];P&&typeof P=="object"&&(P.main&&$(E[X],"mainChannel",za(La(P.main))),P.light&&$(E[X],"lightChannel",za(La(P.light))),P.dark&&$(E[X],"darkChannel",za(La(P.dark))),P.contrastText&&$(E[X],"contrastTextChannel",za(La(P.contrastText))),X==="text"&&(Kn(E[X],"primary"),Kn(E[X],"secondary")),X==="action"&&(P.active&&Kn(E[X],"active"),P.selected&&Kn(E[X],"selected")))})}),L=l.reduce((Y,E)=>Qr(Y,E),L);const _={prefix:c,disableCssColorScheme:o,shouldSkipGeneratingVar:d,getSelector:Xx(L)},{vars:R,generateThemeVars:G,generateStyleSheets:ne}=yx(L,_);return L.vars=R,Object.entries(L.colorSchemes[L.defaultColorScheme]).forEach(([Y,E])=>{L[Y]=E}),L.generateThemeVars=G,L.generateStyleSheets=ne,L.generateSpacing=function(){return Qh(p.spacing,vs(this))},L.getColorSchemeSelector=bx(h),L.spacing=L.generateSpacing(),L.shouldSkipGeneratingVar=d,L.unstable_sxConfig={...Eu,...p==null?void 0:p.unstable_sxConfig},L.unstable_sx=function(E){return Xr({sx:E,theme:this})},L.toRuntimeSource=Sp,L}function Ep(t,l,a){t.colorSchemes&&a&&(t.colorSchemes[l]={...a!==!0&&a,palette:Ns({...a===!0?{}:a.palette,mode:l})})}function ku(t={},...l){const{palette:a,cssVariables:u=!1,colorSchemes:o=a?void 0:{light:!0},defaultColorScheme:c=a==null?void 0:a.mode,...d}=t,h=c||"light",m=o==null?void 0:o[h],p={...o,...a?{[h]:{...typeof m!="boolean"&&m,palette:a}}:void 0};if(u===!1){if(!("colorSchemes"in t))return Ls(t,...l);let g=a;"palette"in t||p[h]&&(p[h]!==!0?g=p[h].palette:h==="dark"&&(g={mode:"dark"}));const b=Ls({...t,palette:g},...l);return b.defaultColorScheme=h,b.colorSchemes=p,b.palette.mode==="light"&&(b.colorSchemes.light={...p.light!==!0&&p.light,palette:b.palette},Ep(b,"dark",p.dark)),b.palette.mode==="dark"&&(b.colorSchemes.dark={...p.dark!==!0&&p.dark,palette:b.palette},Ep(b,"light",p.light)),b}return!a&&!("light"in p)&&h==="light"&&(p.light=!0),Px({...d,colorSchemes:p,defaultColorScheme:h,...typeof u!="boolean"&&u},...l)}function Jx(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Wx(t){return parseFloat(t)}const Cp=ku();function eE(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Hs=Iv({themeId:gr,defaultTheme:Cp,rootShouldForwardProp:t=>eE(t)&&t!=="classes"});function Tp({theme:t,...l}){const a=gr in t?t[gr]:void 0;return Ye.jsx(lp,{...l,themeId:a?gr:void 0,theme:a||t})}const _u={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:tE,useColorScheme:r_,getInitColorSchemeScript:l_}=hx({themeId:gr,theme:()=>ku({cssVariables:!0}),colorSchemeStorageKey:_u.colorSchemeStorageKey,modeStorageKey:_u.modeStorageKey,defaultColorScheme:{light:_u.defaultLightColorScheme,dark:_u.defaultDarkColorScheme},resolveTheme:t=>{const l={...t,typography:yp(t.palette,t.typography)};return l.unstable_sx=function(u){return Xr({sx:u,theme:this})},l}}),nE=tE;function rE({theme:t,...l}){return typeof t=="function"?Ye.jsx(Tp,{theme:t,...l}):"colorSchemes"in(gr in t?t[gr]:t)?Ye.jsx(nE,{theme:t,...l}):Ye.jsx(Tp,{theme:t,...l})}function lE(t){return Ye.jsx(jv,{...t,defaultTheme:Cp,themeId:gr})}function aE(t){return function(a){return Ye.jsx(lE,{styles:typeof t=="function"?u=>t({theme:u,...a}):t})}}const js=ux;function wp(t){return ix(t)}function Ap(t,l,a="Mui"){const u={};return l.forEach(o=>{u[o]=Bs(t,o,a)}),u}function iE(t){return Bs("MuiSkeleton",t)}Ap("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const uE=t=>{const{classes:l,variant:a,animation:u,hasChildren:o,width:c,height:d}=t;return Uh({root:["root",a,u,o&&"withChildren",o&&!c&&"fitContent",o&&!d&&"heightAuto"]},iE,l)},Vs=zh` + 0% { + opacity: 1; + } + + 50% { + opacity: 0.4; + } + + 100% { + opacity: 1; + } +`,qs=zh` + 0% { + transform: translateX(-100%); + } + + 50% { + /* +0.5s of delay between each loop */ + transform: translateX(100%); + } + + 100% { + transform: translateX(100%); + } +`,oE=typeof Vs!="string"?_a` + animation: ${Vs} 2s ease-in-out 0.5s infinite; + `:null,sE=typeof qs!="string"?_a` + &::after { + animation: ${qs} 2s linear 0.5s infinite; + } + `:null,cE=Hs("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(t,l)=>{const{ownerState:a}=t;return[l.root,l[a.variant],a.animation!==!1&&l[a.animation],a.hasChildren&&l.withChildren,a.hasChildren&&!a.width&&l.fitContent,a.hasChildren&&!a.height&&l.heightAuto]}})(js(({theme:t})=>{const l=Jx(t.shape.borderRadius)||"px",a=Wx(t.shape.borderRadius);return{display:"block",backgroundColor:t.vars?t.vars.palette.Skeleton.bg:Wh(t.palette.text.primary,t.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${a}${l}/${Math.round(a/.6*10)/10}${l}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:({ownerState:u})=>u.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:u})=>u.hasChildren&&!u.width,style:{maxWidth:"fit-content"}},{props:({ownerState:u})=>u.hasChildren&&!u.height,style:{height:"auto"}},{props:{animation:"pulse"},style:oE||{animation:`${Vs} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( + 90deg, + transparent, + ${(t.vars||t).palette.action.hover}, + transparent + )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:sE||{"&::after":{animation:`${qs} 2s linear 0.5s infinite`}}}]}})),Gs=j.forwardRef(function(l,a){const u=wp({props:l,name:"MuiSkeleton"}),{animation:o="pulse",className:c,component:d="span",height:h,style:m,variant:p="text",width:g,...b}=u,x={...u,animation:o,component:d,variant:p,hasChildren:!!b.children},v=uE(x);return Ye.jsx(cE,{as:d,ref:a,className:ms(v.root,c),ownerState:x,...b,style:{width:g,height:h,...m}})});function Is(t){if(typeof t!="string")throw new Error(Al(7));return t.charAt(0).toUpperCase()+t.slice(1)}function fE(t,l=166){let a;function u(...o){const c=()=>{t.apply(this,o)};clearTimeout(a),a=setTimeout(c,l)}return u.clear=()=>{clearTimeout(a)},u}function dE(t){return t&&t.ownerDocument||document}function kp(t){return dE(t).defaultView||window}function hE(t,l){typeof t=="function"?t(l):t&&(t.current=l)}const Ys=typeof window<"u"?j.useLayoutEffect:j.useEffect;function _p(...t){return j.useMemo(()=>t.every(l=>l==null)?null:l=>{t.forEach(a=>{hE(a,l)})},t)}function Ou(t){return parseInt(t,10)||0}const pE={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function mE(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const gE=j.forwardRef(function(l,a){const{onChange:u,maxRows:o,minRows:c=1,style:d,value:h,...m}=l,{current:p}=j.useRef(h!=null),g=j.useRef(null),b=_p(a,g),x=j.useRef(null),v=j.useRef(null),D=j.useCallback(()=>{const T=g.current,O=kp(T).getComputedStyle(T);if(O.width==="0px")return{outerHeightStyle:0,overflowing:!1};const L=v.current;L.style.width=O.width,L.value=T.value||l.placeholder||"x",L.value.slice(-1)===` +`&&(L.value+=" ");const _=O.boxSizing,R=Ou(O.paddingBottom)+Ou(O.paddingTop),G=Ou(O.borderBottomWidth)+Ou(O.borderTopWidth),ne=L.scrollHeight;L.value="x";const Y=L.scrollHeight;let E=ne;c&&(E=Math.max(Number(c)*Y,E)),o&&(E=Math.min(Number(o)*Y,E)),E=Math.max(E,Y);const q=E+(_==="border-box"?R+G:0),X=Math.abs(E-ne)<=1;return{outerHeightStyle:q,overflowing:X}},[o,c,l.placeholder]),A=j.useCallback(()=>{const T=D();if(mE(T))return;const N=T.outerHeightStyle,O=g.current;x.current!==N&&(x.current=N,O.style.height=`${N}px`),O.style.overflow=T.overflowing?"hidden":""},[D]);Ys(()=>{const T=()=>{A()};let N;const O=fE(T),L=g.current,_=kp(L);_.addEventListener("resize",O);let R;return typeof ResizeObserver<"u"&&(R=new ResizeObserver(T),R.observe(L)),()=>{O.clear(),cancelAnimationFrame(N),_.removeEventListener("resize",O),R&&R.disconnect()}},[D,A]),Ys(()=>{A()});const U=T=>{p||A(),u&&u(T)};return Ye.jsxs(j.Fragment,{children:[Ye.jsx("textarea",{value:h,onChange:U,ref:b,rows:c,style:d,...m}),Ye.jsx("textarea",{"aria-hidden":!0,className:l.className,readOnly:!0,ref:v,tabIndex:-1,style:{...pE.shadow,...d,paddingTop:0,paddingBottom:0}})]})});function Op(t){return typeof t=="string"}function yE({props:t,states:l,muiFormControl:a}){return l.reduce((u,o)=>(u[o]=t[o],a&&typeof t[o]>"u"&&(u[o]=a[o]),u),{})}const Rp=j.createContext(void 0);function bE(){return j.useContext(Rp)}function Dp(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function SE(t,l=!1){return t&&(Dp(t.value)&&t.value!==""||l&&Dp(t.defaultValue)&&t.defaultValue!=="")}function vE(t){return Bs("MuiInputBase",t)}const $s=Ap("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Mp;const xE=(t,l)=>{const{ownerState:a}=t;return[l.root,a.formControl&&l.formControl,a.startAdornment&&l.adornedStart,a.endAdornment&&l.adornedEnd,a.error&&l.error,a.size==="small"&&l.sizeSmall,a.multiline&&l.multiline,a.color&&l[`color${Is(a.color)}`],a.fullWidth&&l.fullWidth,a.hiddenLabel&&l.hiddenLabel]},EE=(t,l)=>{const{ownerState:a}=t;return[l.input,a.size==="small"&&l.inputSizeSmall,a.multiline&&l.inputMultiline,a.type==="search"&&l.inputTypeSearch,a.startAdornment&&l.inputAdornedStart,a.endAdornment&&l.inputAdornedEnd,a.hiddenLabel&&l.inputHiddenLabel]},CE=t=>{const{classes:l,color:a,disabled:u,error:o,endAdornment:c,focused:d,formControl:h,fullWidth:m,hiddenLabel:p,multiline:g,readOnly:b,size:x,startAdornment:v,type:D}=t,A={root:["root",`color${Is(a)}`,u&&"disabled",o&&"error",m&&"fullWidth",d&&"focused",h&&"formControl",x&&x!=="medium"&&`size${Is(x)}`,g&&"multiline",v&&"adornedStart",c&&"adornedEnd",p&&"hiddenLabel",b&&"readOnly"],input:["input",u&&"disabled",D==="search"&&"inputTypeSearch",g&&"inputMultiline",x==="small"&&"inputSizeSmall",p&&"inputHiddenLabel",v&&"inputAdornedStart",c&&"inputAdornedEnd",b&&"readOnly"]};return Uh(A,vE,l)},TE=Hs("div",{name:"MuiInputBase",slot:"Root",overridesResolver:xE})(js(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${$s.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:l})=>l.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:l,size:a})=>l.multiline&&a==="small",style:{paddingTop:1}},{props:({ownerState:l})=>l.fullWidth,style:{width:"100%"}}]}))),wE=Hs("input",{name:"MuiInputBase",slot:"Input",overridesResolver:EE})(js(({theme:t})=>{const l=t.palette.mode==="light",a={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:l?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},u={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:l?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":a,"&::-moz-placeholder":a,"&::-ms-input-placeholder":a,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${$s.formControl} &`]:{"&::-webkit-input-placeholder":u,"&::-moz-placeholder":u,"&::-ms-input-placeholder":u,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${$s.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:c})=>!c.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:c})=>c.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),zp=aE({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),AE=j.forwardRef(function(l,a){const u=wp({props:l,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:c,autoFocus:d,className:h,color:m,components:p={},componentsProps:g={},defaultValue:b,disabled:x,disableInjectingGlobalStyles:v,endAdornment:D,error:A,fullWidth:U=!1,id:T,inputComponent:N="input",inputProps:O={},inputRef:L,margin:_,maxRows:R,minRows:G,multiline:ne=!1,name:Y,onBlur:E,onChange:q,onClick:X,onFocus:P,onKeyDown:te,onKeyUp:ue,placeholder:J,readOnly:ae,renderSuffix:ie,rows:be,size:S,slotProps:K={},slots:oe={},startAdornment:w,type:le="text",value:ye,...de}=u,qe=O.value!=null?O.value:ye,{current:Ee}=j.useRef(qe!=null),_e=j.useRef(),fe=j.useCallback(Me=>{},[]),Ne=_p(_e,L,O.ref,fe),[ge,pe]=j.useState(!1),se=bE(),ve=yE({props:u,muiFormControl:se,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ve.focused=se?se.focused:ge,j.useEffect(()=>{!se&&x&&ge&&(pe(!1),E&&E())},[se,x,ge,E]);const Ie=se&&se.onFilled,Ue=se&&se.onEmpty,Re=j.useCallback(Me=>{SE(Me)?Ie&&Ie():Ue&&Ue()},[Ie,Ue]);Ys(()=>{Ee&&Re({value:qe})},[qe,Re,Ee]);const at=Me=>{P&&P(Me),O.onFocus&&O.onFocus(Me),se&&se.onFocus?se.onFocus(Me):pe(!0)},St=Me=>{E&&E(Me),O.onBlur&&O.onBlur(Me),se&&se.onBlur?se.onBlur(Me):pe(!1)},un=(Me,...Jt)=>{if(!Ee){const Mt=Me.target||_e.current;if(Mt==null)throw new Error(Al(1));Re({value:Mt.value})}O.onChange&&O.onChange(Me,...Jt),q&&q(Me,...Jt)};j.useEffect(()=>{Re(_e.current)},[]);const Rn=Me=>{_e.current&&Me.currentTarget===Me.target&&_e.current.focus(),X&&X(Me)};let on=N,De=O;ne&&on==="input"&&(be?De={type:void 0,minRows:be,maxRows:be,...De}:De={type:void 0,maxRows:R,minRows:G,...De},on=gE);const Dt=Me=>{Re(Me.animationName==="mui-auto-fill-cancel"?_e.current:{value:"x"})};j.useEffect(()=>{se&&se.setAdornedStart(!!w)},[se,w]);const I={...u,color:ve.color||"primary",disabled:ve.disabled,endAdornment:D,error:ve.error,focused:ve.focused,formControl:se,fullWidth:U,hiddenLabel:ve.hiddenLabel,multiline:ne,size:ve.size,startAdornment:w,type:le},W=CE(I),ce=oe.root||p.Root||TE,Te=K.root||g.root||{},He=oe.input||p.Input||wE;return De={...De,...K.input??g.input},Ye.jsxs(j.Fragment,{children:[!v&&typeof zp=="function"&&(Mp||(Mp=Ye.jsx(zp,{}))),Ye.jsxs(ce,{...Te,ref:a,onClick:Rn,...de,...!Op(ce)&&{ownerState:{...I,...Te.ownerState}},className:ms(W.root,Te.className,h,ae&&"MuiInputBase-readOnly"),children:[w,Ye.jsx(Rp.Provider,{value:null,children:Ye.jsx(He,{"aria-invalid":ve.error,"aria-describedby":o,autoComplete:c,autoFocus:d,defaultValue:b,disabled:ve.disabled,id:T,onAnimationStart:Dt,name:Y,placeholder:J,readOnly:ae,required:ve.required,rows:be,value:qe,onKeyDown:te,onKeyUp:ue,type:le,...De,...!Op(He)&&{as:on,ownerState:{...I,...De.ownerState}},ref:Ne,className:ms(W.input,De.className,ae&&"MuiInputBase-readOnly"),onBlur:St,onChange:un,onFocus:at})}),D,ie?ie({...ve,startAdornment:w}):null]})]})});var Fs={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/var Np;function kE(){return Np||(Np=1,function(t){(function(){var l={}.hasOwnProperty;function a(){for(var c="",d=0;d_a([(t==="small"||t==="medium")&&{...l.typography.body2},(t==="large"||t==="hero")&&{".remixicon":{width:"24px",height:"24px"},...l.typography.body1},t==="medium"&&{paddingLeft:"12px",paddingRight:"12px"},t==="small"&&!a&&{height:"32px"},t==="medium"&&!a&&{height:"40px"},t==="large"&&!a&&{height:"48px"},t==="hero"&&!a&&{height:"72px"},t==="small"&&{padding:"0 8px",".Mit-AdornmentButton":{width:"32px",".remixicon":{width:"16px",height:"16px"}}},t==="medium"&&{padding:"0 12px",".Mit-AdornmentButton":{width:"40px",".remixicon":{width:"20px",height:"20px"}}},t==="large"&&{padding:"0 16px",".Mit-AdornmentButton":{width:"48px"}},t==="hero"&&{padding:"0 24px",".Mit-AdornmentButton":{width:"72px"}}]),ME=t=>({backgroundColor:"white",color:t.custom.colors.darkGray2,borderColor:t.custom.colors.silverGrayLight,borderWidth:"1px",borderStyle:"solid",borderRadius:"4px","&.Mui-disabled":{backgroundColor:t.custom.colors.lightGray1},"&:hover:not(.Mui-disabled):not(.Mui-focused)":{borderColor:t.custom.colors.darkGray2},"&.Mui-focused":{borderColor:"transparent",outline:"2px solid currentcolor",outlineOffset:"-2px"},"&.Mui-error":{borderColor:t.custom.colors.red,outlineColor:t.custom.colors.red},"& input::placeholder, textarea::placeholder":{color:t.custom.colors.silverGrayDark,opacity:1},"& input:placeholder-shown, textarea:placeholder-shown":{textOverflow:"ellipsis"},"& textarea":{paddingTop:"8px",paddingBottom:"8px"},"&.MuiInputBase-adornedStart":{paddingLeft:"0",input:{paddingLeft:"8px"}},"&.MuiInputBase-adornedEnd":{paddingRight:"0",input:{paddingRight:"8px"}}}),zE=Object.keys({responsive:!0}),NE=ot(AE,{shouldForwardProp:t=>!zE.includes(t)})(({theme:t,size:l=RE.size,multiline:a,responsive:u})=>[ME(t),Bp({size:l,theme:t,multiline:a}),u&&{[t.breakpoints.down("sm")]:Bp({size:DE[l],theme:t,multiline:a})}]);ot.button(({theme:t})=>({...t.typography.button,display:"flex",flexShrink:0,justifyContent:"center",alignItems:"center",border:"none",background:"transparent",transition:`background ${t.transitions.duration.short}ms`,cursor:"pointer",":disabled":{cursor:"default"},":hover":{background:"rgba(0, 0, 0, 0.06)"},color:t.custom.colors.silverGray,".MuiInputBase-root:hover &":{color:"inherit"},".MuiInputBase-root.Mui-focused &":{color:"inherit"},".MuiInputBase-root.Mui-disabled &":{color:"inherit"},height:"100%"}));const Et={text:{roman:400,medium:500,bold:700}},Ve=t=>`${t/16}rem`,Lp={fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeightLight:Et.text.roman,fontWeightRegular:Et.text.roman,fontWeightMedium:Et.text.medium,fontWeightBold:Et.text.bold,h1:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.bold,fontStyle:"normal",fontSize:Ve(52),lineHeight:Ve(60)},h2:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.bold,fontStyle:"normal",fontSize:Ve(34),lineHeight:Ve(40)},h3:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.bold,fontStyle:"normal",fontSize:Ve(28),lineHeight:Ve(36)},h4:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.bold,fontStyle:"normal",fontSize:Ve(24),lineHeight:Ve(30)},h5:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(18),lineHeight:Ve(22)},subtitle1:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(16),lineHeight:Ve(20)},subtitle2:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(14),lineHeight:Ve(18)},subtitle3:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(12),lineHeight:Ve(16)},subtitle4:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(10),lineHeight:Ve(14)},body1:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.roman,fontStyle:"normal",fontSize:Ve(16),lineHeight:Ve(20)},body2:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.roman,fontStyle:"normal",fontSize:Ve(14),lineHeight:Ve(18)},body3:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.roman,fontStyle:"normal",fontSize:Ve(12),lineHeight:Ve(16)},body4:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.roman,fontStyle:"normal",fontSize:Ve(10),lineHeight:Ve(14)},buttonLarge:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(16),lineHeight:Ve(20)},button:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(14),lineHeight:Ve(18),textTransform:"none"},buttonSmall:{fontFamily:"neue-haas-grotesk-text, sans-serif",fontWeight:Et.text.medium,fontStyle:"normal",fontSize:Ve(12),lineHeight:Ve(16)}},BE={defaultProps:{variantMapping:{h1:"span",h2:"span",h3:"span",h4:"span",h5:"span",body1:"p",body2:"p",body3:"p",body4:"p",subtitle1:"p",subtitle2:"p",subtitle3:"p",subtitle4:"p",button:"span"}}};ku({typography:Lp,custom:{}});const LE=ot.a({color:"inherit",textDecoration:"none"}),UE=j.forwardRef(function({Component:l,...a},u){const o=_S(),c=l??o.custom.LinkAdapter;return j.createElement(LE,{as:c,ref:u,...a})}),HE={variant:!0,size:!0,edge:!0,startIcon:!0,endIcon:!0,responsive:!0,color:!0},Up=t=>!HE[t],Xs={variant:"primary",size:"medium",edge:"rounded",responsive:!1},Hp={small:1,medium:1,large:2},jp={small:"small",medium:"small",large:"medium"},Vp=(t,l,a)=>{const u=l?Hp[t]:0;return[{boxSizing:"border-box",borderWidth:Hp[t]},t==="large"&&{padding:`${14-u}px 24px`,...a.typography.buttonLarge},t==="medium"&&{padding:`${11-u}px 16px`,...a.typography.button},t==="small"&&{padding:`${8-u}px 12px`,...a.typography.buttonSmall}]},qp=t=>{const{size:l,variant:a,edge:u,theme:o,color:c,responsive:d}={...Xs,...t},{colors:h}=o.custom,m=a==="secondary"||a==="bordered";return _a([{color:o.palette.text.primary,textAlign:"center",display:"inline-flex",justifyContent:"center",alignItems:"center",transition:`background ${o.transitions.duration.short}ms`,cursor:"pointer",":disabled":{cursor:"default"},minWidth:"100px"},...Vp(l,m,o),d&&{[o.breakpoints.down("sm")]:Vp(jp[l],m,o)},a==="primary"&&{backgroundColor:h.mitRed,color:h.white,border:"none",boxShadow:"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 3px 8px 0px rgba(37, 38, 43, 0.12)",":hover:not(:disabled)":{backgroundColor:h.red,boxShadow:"none"},":disabled":{backgroundColor:h.silverGray,boxShadow:"none"}},a==="unstable_success"&&{backgroundColor:h.darkGreen,color:h.white,border:"none",boxShadow:"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 3px 8px 0px rgba(37, 38, 43, 0.12)",":hover:not(:disabled)":{backgroundColor:h.darkGreen,boxShadow:"none"},":disabled":{backgroundColor:h.silverGray,boxShadow:"none"}},a==="secondary"&&{color:h.red,backgroundColor:"transparent",borderColor:"currentcolor",borderStyle:"solid",":hover:not(:disabled)":{backgroundColor:"rgba(255, 20, 35, 0.06)"},":disabled":{color:h.silverGray}},a==="text"&&{backgroundColor:"transparent",borderStyle:"none",color:h.darkGray2,":hover:not(:disabled)":{backgroundColor:"rgba(64, 70, 76, 0.06)"},":disabled":{color:h.silverGray}},a==="bordered"&&{backgroundColor:h.white,color:h.silverGrayDark,border:`1px solid ${h.silverGrayLight}`,":hover:not(:disabled)":{backgroundColor:h.lightGray1,color:h.darkGray2},":disabled":{backgroundColor:h.lightGray2,border:`1px solid ${h.lightGray2}`,color:h.silverGrayDark}},a==="unstable_noBorder"&&{backgroundColor:h.white,color:h.darkGray2,border:"none",":hover:not(:disabled)":{backgroundColor:"rgba(64, 70, 76, 0.06)"},":disabled":{color:h.silverGray}},a==="tertiary"&&{color:h.darkGray2,border:"none",backgroundColor:h.lightGray2,":hover:not(:disabled)":{backgroundColor:h.white},":disabled":{backgroundColor:h.lightGray2,color:h.silverGrayLight}},a==="unstable_inverted"&&{backgroundColor:h.white,color:h.mitRed,borderColor:h.mitRed,borderStyle:"solid"},u==="rounded"&&{borderRadius:"4px"},u==="circular"&&{borderRadius:"100vh"},c==="secondary"&&{color:o.custom.colors.silverGray,borderColor:o.custom.colors.silverGray,":hover:not(:disabled)":{backgroundColor:o.custom.colors.lightGray1}}])},Gp=ot("button",{shouldForwardProp:Up})(qp),Ip=ot(UE,{shouldForwardProp:Up})(qp),Yp=ot.span(({size:t,side:l})=>[{height:"1em",display:"flex",alignItems:"center"},l==="start"&&{marginLeft:"-4px",marginRight:"8px"},l==="end"&&{marginLeft:"8px",marginRight:"-4px"},{"& svg, & .MuiSvgIcon-root":{width:"1em",height:"1em",fontSize:Ve({small:16,medium:20,large:24}[t])}}]),$p=t=>{const{children:l,size:a=Xs.size}=t;return j.createElement(j.Fragment,null,t.startIcon?j.createElement(Yp,{size:a,side:"start"},t.startIcon):null,l,t.endIcon?j.createElement(Yp,{size:a,side:"end"},t.endIcon):null)},jE=j.forwardRef(({children:t,...l},a)=>j.createElement(Gp,{ref:a,type:"button",...l},j.createElement($p,{...l},t)));jE.displayName="Button";const VE=j.forwardRef(({children:t,Component:l,...a},u)=>j.createElement(Ip,{Component:l,ref:u,...a},j.createElement($p,{...a},t)));VE.displayName="ButtonLink";const Fp=t=>({minWidth:"auto",padding:0,height:{small:"32px",medium:"40px",large:"48px"}[t],width:{small:"32px",medium:"40px",large:"48px"}[t],"& svg, & .MuiSvgIcon-root":{width:"1em",height:"1em",fontSize:Ve({small:20,medium:24,large:32}[t])}}),Qs=ot(j.forwardRef(function(l,a){return j.createElement(Gp,{ref:a,type:"button",...l})}))(({size:t=Xs.size,responsive:l,theme:a})=>[Fp(t),l&&{[a.breakpoints.down("sm")]:Fp(jp[t])}]);Qs.displayName="ActionButton";const qE=Qs.withComponent(({Component:t,...l})=>j.createElement(Ip,{Component:t,...l}));qE.displayName="ActionButtonLink";const GE=({color:t="currentColor",size:l=24,className:a,...u})=>mr.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:t,...u,className:"remixicon "+(a||"")},mr.createElement("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})),IE=({color:t="currentColor",size:l=24,className:a,...u})=>mr.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:t,...u,className:"remixicon "+(a||"")},mr.createElement("path",{d:"M1.94607 9.31543C1.42353 9.14125 1.4194 8.86022 1.95682 8.68108L21.043 2.31901C21.5715 2.14285 21.8746 2.43866 21.7265 2.95694L16.2733 22.0432C16.1223 22.5716 15.8177 22.59 15.5944 22.0876L11.9999 14L17.9999 6.00005L9.99992 12L1.94607 9.31543Z"}));var Xp="vercel.ai.error",YE=Symbol.for(Xp),Qp,$E=class Rb extends Error{constructor({name:l,message:a,cause:u}){super(a),this[Qp]=!0,this.name=l,this.cause=u}static isInstance(l){return Rb.hasMarker(l,Xp)}static hasMarker(l,a){const u=Symbol.for(a);return l!=null&&typeof l=="object"&&u in l&&typeof l[u]=="boolean"&&l[u]===!0}};Qp=YE;var zl=$E;function Kp(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Zp="AI_InvalidArgumentError",Pp=`vercel.ai.error.${Zp}`,FE=Symbol.for(Pp),Jp,XE=class extends zl{constructor({message:t,cause:l,argument:a}){super({name:Zp,message:t,cause:l}),this[Jp]=!0,this.argument=a}static isInstance(t){return zl.hasMarker(t,Pp)}};Jp=FE;var Wp="AI_JSONParseError",em=`vercel.ai.error.${Wp}`,QE=Symbol.for(em),tm,nm=class extends zl{constructor({text:t,cause:l}){super({name:Wp,message:`JSON parsing failed: Text: ${t}. +Error message: ${Kp(l)}`,cause:l}),this[tm]=!0,this.text=t}static isInstance(t){return zl.hasMarker(t,em)}};tm=QE;var rm="AI_TypeValidationError",lm=`vercel.ai.error.${rm}`,KE=Symbol.for(lm),am,ZE=class Wd extends zl{constructor({value:l,cause:a}){super({name:rm,message:`Type validation failed: Value: ${JSON.stringify(l)}. +Error message: ${Kp(a)}`,cause:a}),this[am]=!0,this.value=l}static isInstance(l){return zl.hasMarker(l,lm)}static wrap({value:l,cause:a}){return Wd.isInstance(a)&&a.value===l?a:new Wd({value:l,cause:a})}};am=KE;var im=ZE;let PE=(t,l=21)=>(a=l)=>{let u="",o=a;for(;o--;)u+=t[Math.random()*t.length|0];return u};var Kr={exports:{}},um;function JE(){if(um)return Kr.exports;um=1;const t=typeof Buffer<"u",l=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,a=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function u(h,m,p){p==null&&m!==null&&typeof m=="object"&&(p=m,m=void 0),t&&Buffer.isBuffer(h)&&(h=h.toString()),h&&h.charCodeAt(0)===65279&&(h=h.slice(1));const g=JSON.parse(h,m);if(g===null||typeof g!="object")return g;const b=p&&p.protoAction||"error",x=p&&p.constructorAction||"error";if(b==="ignore"&&x==="ignore")return g;if(b!=="ignore"&&x!=="ignore"){if(l.test(h)===!1&&a.test(h)===!1)return g}else if(b!=="ignore"&&x==="ignore"){if(l.test(h)===!1)return g}else if(a.test(h)===!1)return g;return o(g,{protoAction:b,constructorAction:x,safe:p&&p.safe})}function o(h,{protoAction:m="error",constructorAction:p="error",safe:g}={}){let b=[h];for(;b.length;){const x=b;b=[];for(const v of x){if(m!=="ignore"&&Object.prototype.hasOwnProperty.call(v,"__proto__")){if(g===!0)return null;if(m==="error")throw new SyntaxError("Object contains forbidden prototype property");delete v.__proto__}if(p!=="ignore"&&Object.prototype.hasOwnProperty.call(v,"constructor")&&Object.prototype.hasOwnProperty.call(v.constructor,"prototype")){if(g===!0)return null;if(p==="error")throw new SyntaxError("Object contains forbidden prototype property");delete v.constructor}for(const D in v){const A=v[D];A&&typeof A=="object"&&b.push(A)}}}return h}function c(h,m,p){const g=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return u(h,m,p)}finally{Error.stackTraceLimit=g}}function d(h,m){const p=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return u(h,m,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=p}}return Kr.exports=c,Kr.exports.default=c,Kr.exports.parse=c,Kr.exports.safeParse=d,Kr.exports.scan=o,Kr.exports}var WE=JE();const e2=El(WE);var t2=({prefix:t,size:l=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:u="-"}={})=>{const o=PE(a,l);if(t==null)return o;if(a.includes(u))throw new XE({argument:"separator",message:`The separator "${u}" must not be part of the alphabet "${a}".`});return c=>`${t}${u}${o(c)}`},om=t2(),Ks=Symbol.for("vercel.ai.validator");function n2(t){return{[Ks]:!0,validate:t}}function r2(t){return typeof t=="object"&&t!==null&&Ks in t&&t[Ks]===!0&&"validate"in t}function l2(t){return r2(t)?t:a2(t)}function a2(t){return n2(l=>{const a=t.safeParse(l);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}})}function i2({value:t,schema:l}){const a=l2(l);try{if(a.validate==null)return{success:!0,value:t};const u=a.validate(t);return u.success?u:{success:!1,error:im.wrap({value:t,cause:u.error})}}catch(u){return{success:!1,error:im.wrap({value:t,cause:u})}}}function sm({text:t,schema:l}){try{const a=e2.parse(t);return l==null?{success:!0,value:a}:i2({value:a,schema:l})}catch(a){return{success:!1,error:nm.isInstance(a)?a:new nm({text:t,cause:a})}}}var Ua={code:"0",name:"text",parse:t=>{if(typeof t!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:t}}},Ha={code:"3",name:"error",parse:t=>{if(typeof t!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:t}}},ja={code:"4",name:"assistant_message",parse:t=>{if(t==null||typeof t!="object"||!("id"in t)||!("role"in t)||!("content"in t)||typeof t.id!="string"||typeof t.role!="string"||t.role!=="assistant"||!Array.isArray(t.content)||!t.content.every(l=>l!=null&&typeof l=="object"&&"type"in l&&l.type==="text"&&"text"in l&&l.text!=null&&typeof l.text=="object"&&"value"in l.text&&typeof l.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:t}}},Va={code:"5",name:"assistant_control_data",parse:t=>{if(t==null||typeof t!="object"||!("threadId"in t)||!("messageId"in t)||typeof t.threadId!="string"||typeof t.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:t.threadId,messageId:t.messageId}}}},qa={code:"6",name:"data_message",parse:t=>{if(t==null||typeof t!="object"||!("role"in t)||!("data"in t)||typeof t.role!="string"||t.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:t}}},u2=[Ua,Ha,ja,Va,qa];Ua.code+"",Ha.code+"",ja.code+"",Va.code+"",qa.code+"",Ua.name+"",Ua.code,Ha.name+"",Ha.code,ja.name+"",ja.code,Va.name+"",Va.code,qa.name+"",qa.code,u2.map(t=>t.code);function o2(t){const l=["ROOT"];let a=-1,u=null;function o(m,p,g){switch(m){case'"':{a=p,l.pop(),l.push(g),l.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=p,u=p,l.pop(),l.push(g),l.push("INSIDE_LITERAL");break}case"-":{l.pop(),l.push(g),l.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=p,l.pop(),l.push(g),l.push("INSIDE_NUMBER");break}case"{":{a=p,l.pop(),l.push(g),l.push("INSIDE_OBJECT_START");break}case"[":{a=p,l.pop(),l.push(g),l.push("INSIDE_ARRAY_START");break}}}function c(m,p){switch(m){case",":{l.pop(),l.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=p,l.pop();break}}}function d(m,p){switch(m){case",":{l.pop(),l.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=p,l.pop();break}}}for(let m=0;m=0;m--)switch(l[m]){case"INSIDE_STRING":{h+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{h+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{h+="]";break}case"INSIDE_LITERAL":{const g=t.substring(u,t.length);"true".startsWith(g)?h+="true".slice(g.length):"false".startsWith(g)?h+="false".slice(g.length):"null".startsWith(g)&&(h+="null".slice(g.length))}}return h}function s2(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let l=sm({text:t});return l.success?{value:l.value,state:"successful-parse"}:(l=sm({text:o2(t)}),l.success?{value:l.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Ga={code:"0",name:"text",parse:t=>{if(typeof t!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:t}}},Ia={code:"2",name:"data",parse:t=>{if(!Array.isArray(t))throw new Error('"data" parts expect an array value.');return{type:"data",value:t}}},Ya={code:"3",name:"error",parse:t=>{if(typeof t!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:t}}},$a={code:"8",name:"message_annotations",parse:t=>{if(!Array.isArray(t))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:t}}},Fa={code:"9",name:"tool_call",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("toolName"in t)||typeof t.toolName!="string"||!("args"in t)||typeof t.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:t}}},Xa={code:"a",name:"tool_result",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("result"in t))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:t}}},Qa={code:"b",name:"tool_call_streaming_start",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("toolName"in t)||typeof t.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:t}}},Ka={code:"c",name:"tool_call_delta",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("argsTextDelta"in t)||typeof t.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:t}}},Za={code:"d",name:"finish_message",parse:t=>{if(t==null||typeof t!="object"||!("finishReason"in t)||typeof t.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const l={finishReason:t.finishReason};return"usage"in t&&t.usage!=null&&typeof t.usage=="object"&&"promptTokens"in t.usage&&"completionTokens"in t.usage&&(l.usage={promptTokens:typeof t.usage.promptTokens=="number"?t.usage.promptTokens:Number.NaN,completionTokens:typeof t.usage.completionTokens=="number"?t.usage.completionTokens:Number.NaN}),{type:"finish_message",value:l}}},Pa={code:"e",name:"finish_step",parse:t=>{if(t==null||typeof t!="object"||!("finishReason"in t)||typeof t.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const l={finishReason:t.finishReason,isContinued:!1};return"usage"in t&&t.usage!=null&&typeof t.usage=="object"&&"promptTokens"in t.usage&&"completionTokens"in t.usage&&(l.usage={promptTokens:typeof t.usage.promptTokens=="number"?t.usage.promptTokens:Number.NaN,completionTokens:typeof t.usage.completionTokens=="number"?t.usage.completionTokens:Number.NaN}),"isContinued"in t&&typeof t.isContinued=="boolean"&&(l.isContinued=t.isContinued),{type:"finish_step",value:l}}},c2=[Ga,Ia,Ya,$a,Fa,Xa,Qa,Ka,Za,Pa],f2={[Ga.code]:Ga,[Ia.code]:Ia,[Ya.code]:Ya,[$a.code]:$a,[Fa.code]:Fa,[Xa.code]:Xa,[Qa.code]:Qa,[Ka.code]:Ka,[Za.code]:Za,[Pa.code]:Pa};Ga.name+"",Ga.code,Ia.name+"",Ia.code,Ya.name+"",Ya.code,$a.name+"",$a.code,Fa.name+"",Fa.code,Xa.name+"",Xa.code,Qa.name+"",Qa.code,Ka.name+"",Ka.code,Za.name+"",Za.code,Pa.name+"",Pa.code;var d2=c2.map(t=>t.code),h2=t=>{const l=t.indexOf(":");if(l===-1)throw new Error("Failed to parse stream string. No separator found.");const a=t.slice(0,l);if(!d2.includes(a))throw new Error(`Failed to parse stream string. Invalid code ${a}.`);const u=a,o=t.slice(l+1),c=JSON.parse(o);return f2[u].parse(c)},p2=10;function m2(t,l){const a=new Uint8Array(l);let u=0;for(const o of t)a.set(o,u),u+=o.length;return t.length=0,a}async function g2({stream:t,onTextPart:l,onDataPart:a,onErrorPart:u,onToolCallStreamingStartPart:o,onToolCallDeltaPart:c,onToolCallPart:d,onToolResultPart:h,onMessageAnnotationsPart:m,onFinishMessagePart:p,onFinishStepPart:g}){const b=t.getReader(),x=new TextDecoder,v=[];let D=0;for(;;){const{value:A}=await b.read();if(A&&(v.push(A),D+=A.length,A[A.length-1]!==p2))continue;if(v.length===0)break;const U=m2(v,D);D=0;const T=x.decode(U,{stream:!0}).split(` +`).filter(N=>N!=="").map(h2);for(const{type:N,value:O}of T)switch(N){case"text":await(l==null?void 0:l(O));break;case"data":await(a==null?void 0:a(O));break;case"error":await(u==null?void 0:u(O));break;case"message_annotations":await(m==null?void 0:m(O));break;case"tool_call_streaming_start":await(o==null?void 0:o(O));break;case"tool_call_delta":await(c==null?void 0:c(O));break;case"tool_call":await(d==null?void 0:d(O));break;case"tool_result":await(h==null?void 0:h(O));break;case"finish_message":await(p==null?void 0:p(O));break;case"finish_step":await(g==null?void 0:g(O));break;default:{const L=N;throw new Error(`Unknown stream part type: ${L}`)}}}}function y2({promptTokens:t,completionTokens:l}){return{promptTokens:t,completionTokens:l,totalTokens:t+l}}async function b2({stream:t,update:l,onToolCall:a,onFinish:u,generateId:o=om,getCurrentDate:c=()=>new Date}){const d=c();let h,m=!0;const p=[],g=[];let b;const x={};let v={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},D="unknown";function A(){const T=[...g];if(h==null){l(p,T);return}b!=null&&b.length&&(h.annotations=b);const N={...JSON.parse(JSON.stringify(h)),revisionId:o(),createdAt:h.createdAt};l([...p,N],T)}function U(){return(m||h==null)&&(h!=null&&p.push(h),m=!1,h={id:o(),role:"assistant",content:"",createdAt:d}),h}await g2({stream:t,onTextPart(T){const N=U();h={...N,content:N.content+T},A()},onToolCallStreamingStartPart(T){const N=U();N.toolInvocations==null&&(N.toolInvocations=[]),x[T.toolCallId]={text:"",toolName:T.toolName,index:N.toolInvocations.length},N.toolInvocations.push({state:"partial-call",toolCallId:T.toolCallId,toolName:T.toolName,args:void 0}),A()},onToolCallDeltaPart(T){const N=U(),O=x[T.toolCallId];O.text+=T.argsTextDelta;const{value:L}=s2(O.text);N.toolInvocations[O.index]={state:"partial-call",toolCallId:T.toolCallId,toolName:O.toolName,args:L},A()},async onToolCallPart(T){const N=U();if(x[T.toolCallId]!=null?N.toolInvocations[x[T.toolCallId].index]={state:"call",...T}:(N.toolInvocations==null&&(N.toolInvocations=[]),N.toolInvocations.push({state:"call",...T})),a){const O=await a({toolCall:T});O!=null&&(N.toolInvocations[N.toolInvocations.length-1]={state:"result",...T,result:O})}A()},onToolResultPart(T){const O=U().toolInvocations;if(O==null)throw new Error("tool_result must be preceded by a tool_call");const L=O.findIndex(_=>_.toolCallId===T.toolCallId);if(L===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");O[L]={...O[L],state:"result",...T},A()},onDataPart(T){g.push(...T),A()},onMessageAnnotationsPart(T){b==null?b=[...T]:b.push(...T),A()},onFinishStepPart(T){m=!T.isContinued},onFinishMessagePart(T){D=T.finishReason,T.usage!=null&&(v=y2(T.usage))},onErrorPart(T){throw new Error(T)}}),u==null||u({message:h,finishReason:D,usage:v})}async function S2({stream:t,onTextPart:l}){const a=t.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:u,value:o}=await a.read();if(u)break;await l(o)}}var v2=()=>fetch;async function x2({api:t,body:l,streamProtocol:a="data",credentials:u,headers:o,abortController:c,restoreMessagesOnFailure:d,onResponse:h,onUpdate:m,onFinish:p,onToolCall:g,generateId:b,fetch:x=v2()}){var v,D;const A=await x(t,{method:"POST",body:JSON.stringify(l),headers:{"Content-Type":"application/json",...o},signal:(v=c==null?void 0:c())==null?void 0:v.signal,credentials:u}).catch(U=>{throw d(),U});if(h)try{await h(A)}catch(U){throw U}if(!A.ok)throw d(),new Error((D=await A.text())!=null?D:"Failed to fetch the chat response.");if(!A.body)throw new Error("The response body is empty.");switch(a){case"text":{const U={id:b(),createdAt:new Date,role:"assistant",content:""};await S2({stream:A.body,onTextPart:T=>{U.content+=T,m([{...U}],[])}}),p==null||p(U,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"});return}case"data":{await b2({stream:A.body,update:m,onToolCall:g,onFinish({message:U,finishReason:T,usage:N}){p&&U!=null&&p(U,{usage:N,finishReason:T})},generateId:b});return}default:{const U=a;throw new Error(`Unknown stream protocol: ${U}`)}}}async function cm(t){if(!t)return[];if(t instanceof FileList)return Promise.all(Array.from(t).map(async l=>{const{name:a,type:u}=l,o=await new Promise((c,d)=>{const h=new FileReader;h.onload=m=>{var p;c((p=m.target)==null?void 0:p.result)},h.onerror=m=>d(m),h.readAsDataURL(l)});return{name:a,contentType:u,url:o}}));if(Array.isArray(t))return t;throw new Error("Invalid attachments type")}var Zs={exports:{}},Ps={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var fm;function E2(){if(fm)return Ps;fm=1;var t=lu();function l(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var a=typeof Object.is=="function"?Object.is:l,u=t.useState,o=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function h(b,x){var v=x(),D=u({inst:{value:v,getSnapshot:x}}),A=D[0].inst,U=D[1];return c(function(){A.value=v,A.getSnapshot=x,m(A)&&U({inst:A})},[b,v,x]),o(function(){return m(A)&&U({inst:A}),b(function(){m(A)&&U({inst:A})})},[b]),d(v),v}function m(b){var x=b.getSnapshot;b=b.value;try{var v=x();return!a(b,v)}catch{return!0}}function p(b,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return Ps.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,Ps}var dm;function C2(){return dm||(dm=1,Zs.exports=E2()),Zs.exports}var T2=C2();const Sr=()=>{},Kt=Sr(),Js=Object,$e=t=>t===Kt,Vn=t=>typeof t=="function",vr=(t,l)=>({...t,...l}),w2=t=>Vn(t.then),Ru=new WeakMap;let A2=0;const Ja=t=>{const l=typeof t,a=t&&t.constructor,u=a==Date;let o,c;if(Js(t)===t&&!u&&a!=RegExp){if(o=Ru.get(t),o)return o;if(o=++A2+"~",Ru.set(t,o),a==Array){for(o="@",c=0;cMu&&typeof window.requestAnimationFrame!=ec,hm=(t,l)=>{const a=Zn.get(t);return[()=>!$e(l)&&t.get(l)||Ws,u=>{if(!$e(l)){const o=t.get(l);l in Du||(Du[l]=o),a[5](l,vr(o,u),o||Ws)}},a[6],()=>!$e(l)&&l in Du?Du[l]:!$e(l)&&t.get(l)||Ws]};let nc=!0;const _2=()=>nc,[rc,lc]=Mu&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Sr,Sr],O2=()=>{const t=tc&&document.visibilityState;return $e(t)||t!=="hidden"},R2=t=>(tc&&document.addEventListener("visibilitychange",t),rc("focus",t),()=>{tc&&document.removeEventListener("visibilitychange",t),lc("focus",t)}),D2=t=>{const l=()=>{nc=!0,t()},a=()=>{nc=!1};return rc("online",l),rc("offline",a),()=>{lc("online",l),lc("offline",a)}},M2={isOnline:_2,isVisible:O2},z2={initFocus:R2,initReconnect:D2},pm=!mr.useId,Wa=!Mu||"Deno"in window,N2=t=>k2()?window.requestAnimationFrame(t):setTimeout(t,1),ac=Wa?j.useEffect:j.useLayoutEffect,ic=typeof navigator<"u"&&navigator.connection,mm=!Wa&&ic&&(["slow-2g","2g"].includes(ic.effectiveType)||ic.saveData),uc=t=>{if(Vn(t))try{t=t()}catch{t=""}const l=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?Ja(t):"",[t,l]};let B2=0;const oc=()=>++B2,gm=0,ym=1,bm=2;var ei={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:gm,MUTATE_EVENT:bm,RECONNECT_EVENT:ym};async function Sm(...t){const[l,a,u,o]=t,c=vr({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let d=c.populateCache;const h=c.rollbackOnError;let m=c.optimisticData;const p=x=>typeof h=="function"?h(x):h!==!1,g=c.throwOnError;if(Vn(a)){const x=a,v=[],D=l.keys();for(const A of D)!/^\$(inf|sub)\$/.test(A)&&x(l.get(A)._k)&&v.push(A);return Promise.all(v.map(b))}return b(a);async function b(x){const[v]=uc(x);if(!v)return;const[D,A]=hm(l,v),[U,T,N,O]=Zn.get(l),L=()=>{const P=U[v];return(Vn(c.revalidate)?c.revalidate(D().data,x):c.revalidate!==!1)&&(delete N[v],delete O[v],P&&P[0])?P[0](bm).then(()=>D().data):D().data};if(t.length<3)return L();let _=u,R;const G=oc();T[v]=[G,0];const ne=!$e(m),Y=D(),E=Y.data,q=Y._c,X=$e(q)?E:q;if(ne&&(m=Vn(m)?m(X,E):m,A({data:m,_c:X})),Vn(_))try{_=_(X)}catch(P){R=P}if(_&&w2(_))if(_=await _.catch(P=>{R=P}),G!==T[v][0]){if(R)throw R;return _}else R&&ne&&p(R)&&(d=!0,A({data:X,_c:Kt}));if(d&&!R)if(Vn(d)){const P=d(_,X);A({data:P,error:Kt,_c:Kt})}else A({data:_,error:Kt,_c:Kt});if(T[v][1]=oc(),Promise.resolve(L()).then(()=>{A({_c:Kt})}),R){if(g)throw R;return}return _}}const vm=(t,l)=>{for(const a in t)t[a][0]&&t[a][0](l)},L2=(t,l)=>{if(!Zn.has(t)){const a=vr(z2,l),u={},o=Sm.bind(Kt,t);let c=Sr;const d={},h=(g,b)=>{const x=d[g]||[];return d[g]=x,x.push(b),()=>x.splice(x.indexOf(b),1)},m=(g,b,x)=>{t.set(g,b);const v=d[g];if(v)for(const D of v)D(b,x)},p=()=>{if(!Zn.has(t)&&(Zn.set(t,[u,{},{},{},o,m,h]),!Wa)){const g=a.initFocus(setTimeout.bind(Kt,vm.bind(Kt,u,gm))),b=a.initReconnect(setTimeout.bind(Kt,vm.bind(Kt,u,ym)));c=()=>{g&&g(),b&&b(),Zn.delete(t)}}};return p(),[t,o,p,c]}return[t,Zn.get(t)[4]]},U2=(t,l,a,u,o)=>{const c=a.errorRetryCount,d=o.retryCount,h=~~((Math.random()+.5)*(1<<(d<8?d:8)))*a.errorRetryInterval;!$e(c)&&d>c||setTimeout(u,h,o)},H2=(t,l)=>Ja(t)==Ja(l),[xm,j2]=L2(new Map),V2=vr({onLoadingSlow:Sr,onSuccess:Sr,onError:Sr,onErrorRetry:U2,onDiscarded:Sr,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:mm?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:mm?5e3:3e3,compare:H2,isPaused:()=>!1,cache:xm,mutate:j2,fallback:{}},M2),q2=(t,l)=>{const a=vr(t,l);if(l){const{use:u,fallback:o}=t,{use:c,fallback:d}=l;u&&c&&(a.use=u.concat(c)),o&&d&&(a.fallback=vr(o,d))}return a},G2=j.createContext({}),I2="$inf$",Em=Mu&&window.__SWR_DEVTOOLS_USE__,Y2=Em?window.__SWR_DEVTOOLS_USE__:[],$2=()=>{Em&&(window.__SWR_DEVTOOLS_REACT__=mr)},F2=t=>Vn(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],X2=()=>vr(V2,j.useContext(G2)),Q2=t=>(l,a,u)=>t(l,a&&((...c)=>{const[d]=uc(l),[,,,h]=Zn.get(xm);if(d.startsWith(I2))return a(...c);const m=h[d];return $e(m)?a(...c):(delete h[d],m)}),u),K2=Y2.concat(Q2),Z2=t=>function(...a){const u=X2(),[o,c,d]=F2(a),h=q2(u,d);let m=t;const{use:p}=h,g=(p||[]).concat(K2);for(let b=g.length;b--;)m=g[b](m);return m(o,c||h.fetcher||null,h)},P2=(t,l,a)=>{const u=l[t]||(l[t]=[]);return u.push(a),()=>{const o=u.indexOf(a);o>=0&&(u[o]=u[u.length-1],u.pop())}};$2();const Cm=mr.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(l=>{t.status="fulfilled",t.value=l},l=>{t.status="rejected",t.reason=l}),t)}),sc={dedupe:!0},zu=Z2((t,l,a)=>{const{cache:u,compare:o,suspense:c,fallbackData:d,revalidateOnMount:h,revalidateIfStale:m,refreshInterval:p,refreshWhenHidden:g,refreshWhenOffline:b,keepPreviousData:x}=a,[v,D,A,U]=Zn.get(u),[T,N]=uc(t),O=j.useRef(!1),L=j.useRef(!1),_=j.useRef(T),R=j.useRef(l),G=j.useRef(a),ne=()=>G.current,Y=()=>ne().isVisible()&&ne().isOnline(),[E,q,X,P]=hm(u,T),te=j.useRef({}).current,ue=$e(d)?a.fallback[T]:d,J=(ge,pe)=>{for(const se in te){const ve=se;if(ve==="data"){if(!o(ge[ve],pe[ve])&&(!$e(ge[ve])||!o(ye,pe[ve])))return!1}else if(pe[ve]!==ge[ve])return!1}return!0},ae=j.useMemo(()=>{const ge=!T||!l?!1:$e(h)?ne().isPaused()||c?!1:$e(m)?!0:m:h,pe=at=>{const St=vr(at);return delete St._k,ge?{isValidating:!0,isLoading:!0,...St}:St},se=E(),ve=P(),Ie=pe(se),Ue=se===ve?Ie:pe(ve);let Re=Ie;return[()=>{const at=pe(E());return J(at,Re)?(Re.data=at.data,Re.isLoading=at.isLoading,Re.isValidating=at.isValidating,Re.error=at.error,Re):(Re=at,at)},()=>Ue]},[u,T]),ie=T2.useSyncExternalStore(j.useCallback(ge=>X(T,(pe,se)=>{J(se,pe)||ge()}),[u,T]),ae[0],ae[1]),be=!O.current,S=v[T]&&v[T].length>0,K=ie.data,oe=$e(K)?ue:K,w=ie.error,le=j.useRef(oe),ye=x?$e(K)?le.current:K:oe,de=S&&!$e(w)?!1:be&&!$e(h)?h:ne().isPaused()?!1:c?$e(oe)?!1:m:$e(oe)||m,qe=!!(T&&l&&be&&de),Ee=$e(ie.isValidating)?qe:ie.isValidating,_e=$e(ie.isLoading)?qe:ie.isLoading,fe=j.useCallback(async ge=>{const pe=R.current;if(!T||!pe||L.current||ne().isPaused())return!1;let se,ve,Ie=!0;const Ue=ge||{},Re=!A[T]||!Ue.dedupe,at=()=>pm?!L.current&&T===_.current&&O.current:T===_.current,St={isValidating:!1,isLoading:!1},un=()=>{q(St)},Rn=()=>{const De=A[T];De&&De[1]===ve&&delete A[T]},on={isValidating:!0};$e(E().data)&&(on.isLoading=!0);try{if(Re&&(q(on),a.loadingTimeout&&$e(E().data)&&setTimeout(()=>{Ie&&at()&&ne().onLoadingSlow(T,a)},a.loadingTimeout),A[T]=[pe(N),oc()]),[se,ve]=A[T],se=await se,Re&&setTimeout(Rn,a.dedupingInterval),!A[T]||A[T][1]!==ve)return Re&&at()&&ne().onDiscarded(T),!1;St.error=Kt;const De=D[T];if(!$e(De)&&(ve<=De[0]||ve<=De[1]||De[1]===0))return un(),Re&&at()&&ne().onDiscarded(T),!1;const Dt=E().data;St.data=o(Dt,se)?Dt:se,Re&&at()&&ne().onSuccess(se,T,a)}catch(De){Rn();const Dt=ne(),{shouldRetryOnError:I}=Dt;Dt.isPaused()||(St.error=De,Re&&at()&&(Dt.onError(De,T,Dt),(I===!0||Vn(I)&&I(De))&&(!ne().revalidateOnFocus||!ne().revalidateOnReconnect||Y())&&Dt.onErrorRetry(De,T,Dt,W=>{const ce=v[T];ce&&ce[0]&&ce[0](ei.ERROR_REVALIDATE_EVENT,W)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return Ie=!1,un(),!0},[T,u]),Ne=j.useCallback((...ge)=>Sm(u,_.current,...ge),[]);if(ac(()=>{R.current=l,G.current=a,$e(K)||(le.current=K)}),ac(()=>{if(!T)return;const ge=fe.bind(Kt,sc);let pe=0;const ve=P2(T,v,(Ie,Ue={})=>{if(Ie==ei.FOCUS_EVENT){const Re=Date.now();ne().revalidateOnFocus&&Re>pe&&Y()&&(pe=Re+ne().focusThrottleInterval,ge())}else if(Ie==ei.RECONNECT_EVENT)ne().revalidateOnReconnect&&Y()&&ge();else{if(Ie==ei.MUTATE_EVENT)return fe();if(Ie==ei.ERROR_REVALIDATE_EVENT)return fe(Ue)}});return L.current=!1,_.current=T,O.current=!0,q({_k:N}),de&&($e(oe)||Wa?ge():N2(ge)),()=>{L.current=!0,ve()}},[T]),ac(()=>{let ge;function pe(){const ve=Vn(p)?p(E().data):p;ve&&ge!==-1&&(ge=setTimeout(se,ve))}function se(){!E().error&&(g||ne().isVisible())&&(b||ne().isOnline())?fe(sc).then(pe):pe()}return pe(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[p,g,b,T]),j.useDebugValue(ye),c&&$e(oe)&&T){if(!pm&&Wa)throw new Error("Fallback data is required when using suspense in SSR.");R.current=l,G.current=a,L.current=!1;const ge=U[T];if(!$e(ge)){const pe=Ne(ge);Cm(pe)}if($e(w)){const pe=fe(sc);$e(ye)||(pe.status="fulfilled",pe.value=!0),Cm(pe)}else throw w}return{mutate:Ne,get data(){return te.data=!0,ye},get error(){return te.error=!0,w},get isValidating(){return te.isValidating=!0,Ee},get isLoading(){return te.isLoading=!0,_e}}});var cc,Tm;function J2(){if(Tm)return cc;Tm=1;function t(l,a){if(typeof l!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof l}\`.`);let u,o=0;return function(...d){clearTimeout(u);const h=Date.now(),m=h-o,p=a-m;p<=0?(o=h,l.apply(this,d)):u=setTimeout(()=>{o=Date.now(),l.apply(this,d)},p)}}return cc=t,cc}var W2=J2();const eC=El(W2);function wm(t,l){return l!=null?eC(t,l):t}var tC=async(t,l,a,u,o,c,d,h,m,p,g,b,x,v,D,A,U)=>{var T;const N=d.current;a(l.messages,!1);const O=v?l.messages:l.messages.map(({role:_,content:R,experimental_attachments:G,data:ne,annotations:Y,toolInvocations:E})=>({role:_,content:R,...G!==void 0&&{experimental_attachments:G},...ne!==void 0&&{data:ne},...Y!==void 0&&{annotations:Y},...E!==void 0&&{toolInvocations:E}})),L=o.current;return await x2({api:t,body:(T=D==null?void 0:D({messages:l.messages,requestData:l.data,requestBody:l.body}))!=null?T:{messages:O,data:l.data,...c.current.body,...l.body},streamProtocol:p,credentials:c.current.credentials,headers:{...c.current.headers,...l.headers},abortController:()=>h.current,restoreMessagesOnFailure(){U||a(N,!1)},onResponse:b,onUpdate(_,R){a([...l.messages,..._],!1),R!=null&&R.length&&u([...L??[],...R],!1)},onToolCall:x,onFinish:g,generateId:m,fetch:A})};function nC({api:t="/api/chat",id:l,initialMessages:a,initialInput:u="",sendExtraMessageFields:o,onToolCall:c,experimental_prepareRequestBody:d,maxSteps:h=1,streamProtocol:m="data",onResponse:p,onFinish:g,onError:b,credentials:x,headers:v,body:D,generateId:A=om,fetch:U,keepLastMessageOnError:T=!0,experimental_throttle:N}={}){const O=j.useId(),L=l??O,_=typeof t=="string"?[t,L]:L,[R]=j.useState([]),{data:G,mutate:ne}=zu([_,"messages"],null,{fallbackData:a??R}),Y=j.useRef(G||[]);j.useEffect(()=>{Y.current=G||[]},[G]);const{data:E,mutate:q}=zu([_,"streamData"],null),X=j.useRef(E);j.useEffect(()=>{X.current=E},[E]);const{data:P=!1,mutate:te}=zu([_,"loading"],null),{data:ue=void 0,mutate:J}=zu([_,"error"],null),ae=j.useRef(null),ie=j.useRef({credentials:x,headers:v,body:D});j.useEffect(()=>{ie.current={credentials:x,headers:v,body:D}},[x,v,D]);const be=j.useCallback(async fe=>{const Ne=Y.current.length;try{te(!0),J(void 0);const se=new AbortController;ae.current=se,await tC(t,fe,wm(ne,N),wm(q,N),X,ie,Y,ae,A,m,g,p,c,o,d,U,T),ae.current=null}catch(se){if(se.name==="AbortError")return ae.current=null,null;b&&se instanceof Error&&b(se),J(se)}finally{te(!1)}const ge=Y.current,pe=ge[ge.length-1];ge.length>Ne&&pe!=null&&h>1&&Am(pe)&&rC(ge){var ve,Ie;const Ue=await cm(se),Re=Y.current.concat({...fe,id:(ve=fe.id)!=null?ve:A(),createdAt:(Ie=fe.createdAt)!=null?Ie:new Date,experimental_attachments:Ue.length>0?Ue:void 0});return be({messages:Re,headers:ge,body:pe,data:Ne})},[be,A]),K=j.useCallback(async({data:fe,headers:Ne,body:ge}={})=>{const pe=Y.current;if(pe.length===0)return null;const se=pe[pe.length-1];return be({messages:se.role==="assistant"?pe.slice(0,-1):pe,headers:Ne,body:ge,data:fe})},[be]),oe=j.useCallback(()=>{ae.current&&(ae.current.abort(),ae.current=null)},[]),w=j.useCallback(fe=>{typeof fe=="function"&&(fe=fe(Y.current)),ne(fe,!1),Y.current=fe},[ne]),le=j.useCallback(fe=>{typeof fe=="function"&&(fe=fe(X.current)),q(fe,!1),X.current=fe},[q]),[ye,de]=j.useState(u),qe=j.useCallback(async(fe,Ne={},ge)=>{var pe;if((pe=fe==null?void 0:fe.preventDefault)==null||pe.call(fe),!ye&&!Ne.allowEmptySubmit)return;ge&&(ie.current={...ie.current,...ge});const se=await cm(Ne.experimental_attachments),Ie={messages:!ye&&!se.length&&Ne.allowEmptySubmit?Y.current:Y.current.concat({id:A(),createdAt:new Date,role:"user",content:ye,experimental_attachments:se.length>0?se:void 0}),headers:Ne.headers,body:Ne.body,data:Ne.data};be(Ie),de("")},[ye,A,be]);return{messages:G||[],setMessages:w,data:E,setData:le,error:ue,append:S,reload:K,stop:oe,input:ye,setInput:de,handleInputChange:fe=>{de(fe.target.value)},handleSubmit:qe,isLoading:P,addToolResult:({toolCallId:fe,result:Ne})=>{const ge=Y.current.map((se,ve,Ie)=>ve===Ie.length-1&&se.role==="assistant"&&se.toolInvocations?{...se,toolInvocations:se.toolInvocations.map(Ue=>Ue.toolCallId===fe?{...Ue,result:Ne,state:"result"}:Ue)}:se);ne(ge,!1);const pe=ge[ge.length-1];Am(pe)&&be({messages:ge})}}}function Am(t){return t.role==="assistant"&&t.toolInvocations&&t.toolInvocations.length>0&&t.toolInvocations.every(l=>"result"in l)}function rC(t){let l=0;for(let a=t.length-1;a>=0&&t[a].role==="assistant";a--)l++;return l}var lC=nC;const aC=t=>t,iC=t=>async(l,a)=>{if(typeof(a==null?void 0:a.body)!="string")return console.error("Unexpected body type."),window.fetch(l,a);const u=JSON.parse(a==null?void 0:a.body).messages,o=t.transformBody??aC,c={...a,body:JSON.stringify(o(u)),headers:{...a==null?void 0:a.headers,"Content-Type":"application/json",...t.headersOpts},...t.fetchOpts};return fetch(l,c)},uC=(t,l)=>{const a=j.useMemo(()=>iC(t),[t]);return lC({api:t.apiUrl,streamProtocol:"text",fetch:a,...l})};function u_(){}function o_(){}function oC(t,l){const a={};return(t[t.length-1]===""?[...t,""]:t).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const sC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fC={};function km(t,l){return(fC.jsx?cC:sC).test(t)}const dC=/[ \t\n\f\r]/g;function hC(t){return typeof t=="object"?t.type==="text"?_m(t.value):!1:_m(t)}function _m(t){return t.replace(dC,"")===""}class ti{constructor(l,a,u){this.property=l,this.normal=a,u&&(this.space=u)}}ti.prototype.property={},ti.prototype.normal={},ti.prototype.space=null;function Om(t,l){const a={},u={};let o=-1;for(;++o4&&a.slice(0,4)==="data"&&bC.test(l)){if(l.charAt(4)==="-"){const c=l.slice(5).replace(Hm,EC);u="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=l.slice(4);if(!Hm.test(c)){let d=c.replace(SC,xC);d.charAt(0)!=="-"&&(d="-"+d),l="data"+d}}o=pc}return new o(u,l)}function xC(t){return"-"+t.toLowerCase()}function EC(t){return t.charAt(1).toUpperCase()}const CC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},TC=Om([zm,Mm,Lm,Um,gC],"html"),mc=Om([zm,Mm,Lm,Um,yC],"svg");function wC(t){return t.join(" ").trim()}var ni={},gc,jm;function AC(){if(jm)return gc;jm=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l=/\n/g,a=/^\s*/,u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,h=/^\s+|\s+$/g,m=` +`,p="/",g="*",b="",x="comment",v="declaration";gc=function(A,U){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];U=U||{};var T=1,N=1;function O(P){var te=P.match(l);te&&(T+=te.length);var ue=P.lastIndexOf(m);N=~ue?P.length-ue:N+P.length}function L(){var P={line:T,column:N};return function(te){return te.position=new _(P),ne(),te}}function _(P){this.start=P,this.end={line:T,column:N},this.source=U.source}_.prototype.content=A;function R(P){var te=new Error(U.source+":"+T+":"+N+": "+P);if(te.reason=P,te.filename=U.source,te.line=T,te.column=N,te.source=A,!U.silent)throw te}function G(P){var te=P.exec(A);if(te){var ue=te[0];return O(ue),A=A.slice(ue.length),te}}function ne(){G(a)}function Y(P){var te;for(P=P||[];te=E();)te!==!1&&P.push(te);return P}function E(){var P=L();if(!(p!=A.charAt(0)||g!=A.charAt(1))){for(var te=2;b!=A.charAt(te)&&(g!=A.charAt(te)||p!=A.charAt(te+1));)++te;if(te+=2,b===A.charAt(te-1))return R("End of comment missing");var ue=A.slice(2,te-2);return N+=2,O(ue),A=A.slice(te),N+=2,P({type:x,comment:ue})}}function q(){var P=L(),te=G(u);if(te){if(E(),!G(o))return R("property missing ':'");var ue=G(c),J=P({type:v,property:D(te[0].replace(t,b)),value:ue?D(ue[0].replace(t,b)):b});return G(d),J}}function X(){var P=[];Y(P);for(var te;te=q();)te!==!1&&(P.push(te),Y(P));return P}return ne(),X()};function D(A){return A?A.replace(h,b):b}return gc}var Vm;function kC(){if(Vm)return ni;Vm=1;var t=ni.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=a;var l=t(AC());function a(u,o){var c=null;if(!u||typeof u!="string")return c;var d=(0,l.default)(u),h=typeof o=="function";return d.forEach(function(m){if(m.type==="declaration"){var p=m.property,g=m.value;h?o(p,g,m):g&&(c=c||{},c[p]=g)}}),c}return ni}var _C=kC();const qm=El(_C),OC=qm.default||qm,Gm=Im("end"),yc=Im("start");function Im(t){return l;function l(a){const u=a&&a.position&&a.position[t]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function RC(t){const l=yc(t),a=Gm(t);if(l&&a)return{start:l,end:a}}function ri(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Ym(t.position):"start"in t||"end"in t?Ym(t):"line"in t||"column"in t?bc(t):""}function bc(t){return $m(t&&t.line)+":"+$m(t&&t.column)}function Ym(t){return bc(t&&t.start)+"-"+bc(t&&t.end)}function $m(t){return t&&typeof t=="number"?t:1}class It extends Error{constructor(l,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let o="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof l=="string"?o=l:!c.cause&&l&&(d=!0,o=l.message,c.cause=l),!c.ruleId&&!c.source&&typeof u=="string"){const m=u.indexOf(":");m===-1?c.ruleId=u:(c.source=u.slice(0,m),c.ruleId=u.slice(m+1))}if(!c.place&&c.ancestors&&c.ancestors){const m=c.ancestors[c.ancestors.length-1];m&&(c.place=m.position)}const h=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=h?h.line:void 0,this.name=ri(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual,this.expected,this.note,this.url}}It.prototype.file="",It.prototype.name="",It.prototype.reason="",It.prototype.message="",It.prototype.stack="",It.prototype.column=void 0,It.prototype.line=void 0,It.prototype.ancestors=void 0,It.prototype.cause=void 0,It.prototype.fatal=void 0,It.prototype.place=void 0,It.prototype.ruleId=void 0,It.prototype.source=void 0;const Sc={}.hasOwnProperty,DC=new Map,MC=/[A-Z]/g,zC=/-([a-z])/g,NC=new Set(["table","tbody","thead","tfoot","tr"]),BC=new Set(["td","th"]),Fm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function LC(t,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=l.filePath||void 0;let u;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=YC(a,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=IC(a,l.jsx,l.jsxs)}const o={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:u,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?mc:TC,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},c=Xm(o,t,void 0);return c&&typeof c!="string"?c:o.create(t,o.Fragment,{children:c||void 0},void 0)}function Xm(t,l,a){if(l.type==="element")return UC(t,l,a);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return HC(t,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return VC(t,l,a);if(l.type==="mdxjsEsm")return jC(t,l);if(l.type==="root")return qC(t,l,a);if(l.type==="text")return GC(t,l)}function UC(t,l,a){const u=t.schema;let o=u;l.tagName.toLowerCase()==="svg"&&u.space==="html"&&(o=mc,t.schema=o),t.ancestors.push(l);const c=Km(t,l.tagName,!1),d=$C(t,l);let h=xc(t,l);return NC.has(l.tagName)&&(h=h.filter(function(m){return typeof m=="string"?!hC(m):!0})),Qm(t,d,c,l),vc(d,h),t.ancestors.pop(),t.schema=u,t.create(l,c,d,a)}function HC(t,l){if(l.data&&l.data.estree&&t.evaluater){const u=l.data.estree.body[0];return u.type,t.evaluater.evaluateExpression(u.expression)}li(t,l.position)}function jC(t,l){if(l.data&&l.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(l.data.estree);li(t,l.position)}function VC(t,l,a){const u=t.schema;let o=u;l.name==="svg"&&u.space==="html"&&(o=mc,t.schema=o),t.ancestors.push(l);const c=l.name===null?t.Fragment:Km(t,l.name,!0),d=FC(t,l),h=xc(t,l);return Qm(t,d,c,l),vc(d,h),t.ancestors.pop(),t.schema=u,t.create(l,c,d,a)}function qC(t,l,a){const u={};return vc(u,xc(t,l)),t.create(l,t.Fragment,u,a)}function GC(t,l){return l.value}function Qm(t,l,a,u){typeof a!="string"&&a!==t.Fragment&&t.passNode&&(l.node=u)}function vc(t,l){if(l.length>0){const a=l.length>1?l:l[0];a&&(t.children=a)}}function IC(t,l,a){return u;function u(o,c,d,h){const p=Array.isArray(d.children)?a:l;return h?p(c,d,h):p(c,d)}}function YC(t,l){return a;function a(u,o,c,d){const h=Array.isArray(c.children),m=yc(u);return l(o,c,d,h,{columnNumber:m?m.column-1:void 0,fileName:t,lineNumber:m?m.line:void 0},void 0)}}function $C(t,l){const a={};let u,o;for(o in l.properties)if(o!=="children"&&Sc.call(l.properties,o)){const c=XC(t,o,l.properties[o]);if(c){const[d,h]=c;t.tableCellAlignToStyle&&d==="align"&&typeof h=="string"&&BC.has(l.tagName)?u=h:a[d]=h}}if(u){const c=a.style||(a.style={});c[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function FC(t,l){const a={};for(const u of l.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&t.evaluater){const c=u.data.estree.body[0];c.type;const d=c.expression;d.type;const h=d.properties[0];h.type,Object.assign(a,t.evaluater.evaluateExpression(h.argument))}else li(t,l.position);else{const o=u.name;let c;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&t.evaluater){const h=u.value.data.estree.body[0];h.type,c=t.evaluater.evaluateExpression(h.expression)}else li(t,l.position);else c=u.value===null?!0:u.value;a[o]=c}return a}function xc(t,l){const a=[];let u=-1;const o=t.passKeys?new Map:DC;for(;++uo?0:o+l:l=l>o?o:l,a=a>0?a:0,u.length<1e4)d=Array.from(u),d.unshift(l,a),t.splice(...d);else for(a&&t.splice(l,a);c0?(Pn(t,t.length,0,l),t):l}const Wm={}.hasOwnProperty;function nT(t){const l={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ll(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qn=xr(/[A-Za-z]/),an=xr(/[\dA-Za-z]/),aT=xr(/[#-'*+\--9=?A-Z^-~]/);function Tc(t){return t!==null&&(t<32||t===127)}const wc=xr(/\d/),iT=xr(/[\dA-Fa-f]/),uT=xr(/[!-/:-@[-`{-~]/);function Ce(t){return t!==null&&t<-2}function Zt(t){return t!==null&&(t<0||t===32)}function Ze(t){return t===-2||t===-1||t===32}const oT=xr(new RegExp("\\p{P}|\\p{S}","u")),sT=xr(/\s/);function xr(t){return l;function l(a){return a!==null&&a>-1&&t.test(String.fromCharCode(a))}}function Ul(t){const l=[];let a=-1,u=0,o=0;for(;++a55295&&c<57344){const h=t.charCodeAt(a+1);c<56320&&h>56319&&h<57344?(d=String.fromCharCode(c,h),o=1):d="�"}else d=String.fromCharCode(c);d&&(l.push(t.slice(u,a),encodeURIComponent(d)),u=a+o+1,d=""),o&&(a+=o,o=0)}return l.join("")+t.slice(u)}function lt(t,l,a,u){const o=u?u-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(m){return Ze(m)?(t.enter(a),h(m)):l(m)}function h(m){return Ze(m)&&c++d))return;const G=l.events.length;let ne=G,Y,E;for(;ne--;)if(l.events[ne][0]==="exit"&&l.events[ne][1].type==="chunkFlow"){if(Y){E=l.events[ne][1].end;break}Y=!0}for(T(u),R=G;RO;){const _=a[L];l.containerState=_[1],_[0].exit.call(l,t)}a.length=O}function N(){o.write([null]),c=void 0,o=void 0,l.containerState._closeFlow=void 0}}function pT(t,l,a){return lt(t,t.attempt(this.parser.constructs.document,l,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ng(t){if(t===null||Zt(t)||sT(t))return 1;if(oT(t))return 2}function Ac(t,l,a){const u=[];let o=-1;for(;++o1&&t[a][1].end.offset-t[a][1].start.offset>1?2:1;const b=Object.assign({},t[u][1].end),x=Object.assign({},t[a][1].start);rg(b,-m),rg(x,m),d={type:m>1?"strongSequence":"emphasisSequence",start:b,end:Object.assign({},t[u][1].end)},h={type:m>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[a][1].start),end:x},c={type:m>1?"strongText":"emphasisText",start:Object.assign({},t[u][1].end),end:Object.assign({},t[a][1].start)},o={type:m>1?"strong":"emphasis",start:Object.assign({},d.start),end:Object.assign({},h.end)},t[u][1].end=Object.assign({},d.start),t[a][1].start=Object.assign({},h.end),p=[],t[u][1].end.offset-t[u][1].start.offset&&(p=yn(p,[["enter",t[u][1],l],["exit",t[u][1],l]])),p=yn(p,[["enter",o,l],["enter",d,l],["exit",d,l],["enter",c,l]]),p=yn(p,Ac(l.parser.constructs.insideSpan.null,t.slice(u+1,a),l)),p=yn(p,[["exit",c,l],["enter",h,l],["exit",h,l],["exit",o,l]]),t[a][1].end.offset-t[a][1].start.offset?(g=2,p=yn(p,[["enter",t[a][1],l],["exit",t[a][1],l]])):g=0,Pn(t,u-1,a-u+3,p),a=u+p.length-g-2;break}}for(a=-1;++a0&&Ze(R)?lt(t,N,"linePrefix",c+1)(R):N(R)}function N(R){return R===null||Ce(R)?t.check(ug,A,L)(R):(t.enter("codeFlowValue"),O(R))}function O(R){return R===null||Ce(R)?(t.exit("codeFlowValue"),N(R)):(t.consume(R),O)}function L(R){return t.exit("codeFenced"),l(R)}function _(R,G,ne){let Y=0;return E;function E(ue){return R.enter("lineEnding"),R.consume(ue),R.exit("lineEnding"),q}function q(ue){return R.enter("codeFencedFence"),Ze(ue)?lt(R,X,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):X(ue)}function X(ue){return ue===h?(R.enter("codeFencedFenceSequence"),P(ue)):ne(ue)}function P(ue){return ue===h?(Y++,R.consume(ue),P):Y>=d?(R.exit("codeFencedFenceSequence"),Ze(ue)?lt(R,te,"whitespace")(ue):te(ue)):ne(ue)}function te(ue){return ue===null||Ce(ue)?(R.exit("codeFencedFence"),G(ue)):ne(ue)}}}function AT(t,l,a){const u=this;return o;function o(d){return d===null?a(d):(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c)}function c(d){return u.parser.lazy[u.now().line]?a(d):l(d)}}const _c={name:"codeIndented",tokenize:_T},kT={tokenize:OT,partial:!0};function _T(t,l,a){const u=this;return o;function o(p){return t.enter("codeIndented"),lt(t,c,"linePrefix",5)(p)}function c(p){const g=u.events[u.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?d(p):a(p)}function d(p){return p===null?m(p):Ce(p)?t.attempt(kT,d,m)(p):(t.enter("codeFlowValue"),h(p))}function h(p){return p===null||Ce(p)?(t.exit("codeFlowValue"),d(p)):(t.consume(p),h)}function m(p){return t.exit("codeIndented"),l(p)}}function OT(t,l,a){const u=this;return o;function o(d){return u.parser.lazy[u.now().line]?a(d):Ce(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),o):lt(t,c,"linePrefix",5)(d)}function c(d){const h=u.events[u.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(d):Ce(d)?o(d):a(d)}}const RT={name:"codeText",tokenize:zT,resolve:DT,previous:MT};function DT(t){let l=t.length-4,a=3,u,o;if((t[a][1].type==="lineEnding"||t[a][1].type==="space")&&(t[l][1].type==="lineEnding"||t[l][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return lthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(l,a,u){const o=a||0;this.setCursor(Math.trunc(l));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return u&&ai(this.left,u),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),ai(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),ai(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l=4?l(d):t.interrupt(u.parser.constructs.flow,a,l)(d)}}function cg(t,l,a,u,o,c,d,h,m){const p=m||Number.POSITIVE_INFINITY;let g=0;return b;function b(T){return T===60?(t.enter(u),t.enter(o),t.enter(c),t.consume(T),t.exit(c),x):T===null||T===32||T===41||Tc(T)?a(T):(t.enter(u),t.enter(d),t.enter(h),t.enter("chunkString",{contentType:"string"}),A(T))}function x(T){return T===62?(t.enter(c),t.consume(T),t.exit(c),t.exit(o),t.exit(u),l):(t.enter(h),t.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===62?(t.exit("chunkString"),t.exit(h),x(T)):T===null||T===60||Ce(T)?a(T):(t.consume(T),T===92?D:v)}function D(T){return T===60||T===62||T===92?(t.consume(T),v):v(T)}function A(T){return!g&&(T===null||T===41||Zt(T))?(t.exit("chunkString"),t.exit(h),t.exit(d),t.exit(u),l(T)):g999||v===null||v===91||v===93&&!m||v===94&&!h&&"_hiddenFootnoteSupport"in d.parser.constructs?a(v):v===93?(t.exit(c),t.enter(o),t.consume(v),t.exit(o),t.exit(u),l):Ce(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),g):(t.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===null||v===91||v===93||Ce(v)||h++>999?(t.exit("chunkString"),g(v)):(t.consume(v),m||(m=!Ze(v)),v===92?x:b)}function x(v){return v===91||v===92||v===93?(t.consume(v),h++,b):b(v)}}function dg(t,l,a,u,o,c){let d;return h;function h(x){return x===34||x===39||x===40?(t.enter(u),t.enter(o),t.consume(x),t.exit(o),d=x===40?41:x,m):a(x)}function m(x){return x===d?(t.enter(o),t.consume(x),t.exit(o),t.exit(u),l):(t.enter(c),p(x))}function p(x){return x===d?(t.exit(c),m(d)):x===null?a(x):Ce(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),lt(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===d||x===null||Ce(x)?(t.exit("chunkString"),p(x)):(t.consume(x),x===92?b:g)}function b(x){return x===d||x===92?(t.consume(x),g):g(x)}}function ii(t,l){let a;return u;function u(o){return Ce(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a=!0,u):Ze(o)?lt(t,u,a?"linePrefix":"lineSuffix")(o):l(o)}}const qT={name:"definition",tokenize:IT},GT={tokenize:YT,partial:!0};function IT(t,l,a){const u=this;let o;return c;function c(v){return t.enter("definition"),d(v)}function d(v){return fg.call(u,t,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function h(v){return o=Ll(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),m):a(v)}function m(v){return Zt(v)?ii(t,p)(v):p(v)}function p(v){return cg(t,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return t.attempt(GT,b,b)(v)}function b(v){return Ze(v)?lt(t,x,"whitespace")(v):x(v)}function x(v){return v===null||Ce(v)?(t.exit("definition"),u.parser.defined.push(o),l(v)):a(v)}}function YT(t,l,a){return u;function u(h){return Zt(h)?ii(t,o)(h):a(h)}function o(h){return dg(t,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return Ze(h)?lt(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Ce(h)?l(h):a(h)}}const $T={name:"hardBreakEscape",tokenize:FT};function FT(t,l,a){return u;function u(c){return t.enter("hardBreakEscape"),t.consume(c),o}function o(c){return Ce(c)?(t.exit("hardBreakEscape"),l(c)):a(c)}}const XT={name:"headingAtx",tokenize:KT,resolve:QT};function QT(t,l){let a=t.length-2,u=3,o,c;return t[u][1].type==="whitespace"&&(u+=2),a-2>u&&t[a][1].type==="whitespace"&&(a-=2),t[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&t[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u&&(o={type:"atxHeadingText",start:t[u][1].start,end:t[a][1].end},c={type:"chunkText",start:t[u][1].start,end:t[a][1].end,contentType:"text"},Pn(t,u,a-u+1,[["enter",o,l],["enter",c,l],["exit",c,l],["exit",o,l]])),t}function KT(t,l,a){let u=0;return o;function o(g){return t.enter("atxHeading"),c(g)}function c(g){return t.enter("atxHeadingSequence"),d(g)}function d(g){return g===35&&u++<6?(t.consume(g),d):g===null||Zt(g)?(t.exit("atxHeadingSequence"),h(g)):a(g)}function h(g){return g===35?(t.enter("atxHeadingSequence"),m(g)):g===null||Ce(g)?(t.exit("atxHeading"),l(g)):Ze(g)?lt(t,h,"whitespace")(g):(t.enter("atxHeadingText"),p(g))}function m(g){return g===35?(t.consume(g),m):(t.exit("atxHeadingSequence"),h(g))}function p(g){return g===null||g===35||Zt(g)?(t.exit("atxHeadingText"),h(g)):(t.consume(g),p)}}const ZT=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],hg=["pre","script","style","textarea"],PT={name:"htmlFlow",tokenize:tw,resolveTo:ew,concrete:!0},JT={tokenize:rw,partial:!0},WT={tokenize:nw,partial:!0};function ew(t){let l=t.length;for(;l--&&!(t[l][0]==="enter"&&t[l][1].type==="htmlFlow"););return l>1&&t[l-2][1].type==="linePrefix"&&(t[l][1].start=t[l-2][1].start,t[l+1][1].start=t[l-2][1].start,t.splice(l-2,2)),t}function tw(t,l,a){const u=this;let o,c,d,h,m;return p;function p(w){return g(w)}function g(w){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(w),b}function b(w){return w===33?(t.consume(w),x):w===47?(t.consume(w),c=!0,A):w===63?(t.consume(w),o=3,u.interrupt?l:S):qn(w)?(t.consume(w),d=String.fromCharCode(w),U):a(w)}function x(w){return w===45?(t.consume(w),o=2,v):w===91?(t.consume(w),o=5,h=0,D):qn(w)?(t.consume(w),o=4,u.interrupt?l:S):a(w)}function v(w){return w===45?(t.consume(w),u.interrupt?l:S):a(w)}function D(w){const le="CDATA[";return w===le.charCodeAt(h++)?(t.consume(w),h===le.length?u.interrupt?l:X:D):a(w)}function A(w){return qn(w)?(t.consume(w),d=String.fromCharCode(w),U):a(w)}function U(w){if(w===null||w===47||w===62||Zt(w)){const le=w===47,ye=d.toLowerCase();return!le&&!c&&hg.includes(ye)?(o=1,u.interrupt?l(w):X(w)):ZT.includes(d.toLowerCase())?(o=6,le?(t.consume(w),T):u.interrupt?l(w):X(w)):(o=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(w):c?N(w):O(w))}return w===45||an(w)?(t.consume(w),d+=String.fromCharCode(w),U):a(w)}function T(w){return w===62?(t.consume(w),u.interrupt?l:X):a(w)}function N(w){return Ze(w)?(t.consume(w),N):E(w)}function O(w){return w===47?(t.consume(w),E):w===58||w===95||qn(w)?(t.consume(w),L):Ze(w)?(t.consume(w),O):E(w)}function L(w){return w===45||w===46||w===58||w===95||an(w)?(t.consume(w),L):_(w)}function _(w){return w===61?(t.consume(w),R):Ze(w)?(t.consume(w),_):O(w)}function R(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(t.consume(w),m=w,G):Ze(w)?(t.consume(w),R):ne(w)}function G(w){return w===m?(t.consume(w),m=null,Y):w===null||Ce(w)?a(w):(t.consume(w),G)}function ne(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Zt(w)?_(w):(t.consume(w),ne)}function Y(w){return w===47||w===62||Ze(w)?O(w):a(w)}function E(w){return w===62?(t.consume(w),q):a(w)}function q(w){return w===null||Ce(w)?X(w):Ze(w)?(t.consume(w),q):a(w)}function X(w){return w===45&&o===2?(t.consume(w),J):w===60&&o===1?(t.consume(w),ae):w===62&&o===4?(t.consume(w),K):w===63&&o===3?(t.consume(w),S):w===93&&o===5?(t.consume(w),be):Ce(w)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(JT,oe,P)(w)):w===null||Ce(w)?(t.exit("htmlFlowData"),P(w)):(t.consume(w),X)}function P(w){return t.check(WT,te,oe)(w)}function te(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),ue}function ue(w){return w===null||Ce(w)?P(w):(t.enter("htmlFlowData"),X(w))}function J(w){return w===45?(t.consume(w),S):X(w)}function ae(w){return w===47?(t.consume(w),d="",ie):X(w)}function ie(w){if(w===62){const le=d.toLowerCase();return hg.includes(le)?(t.consume(w),K):X(w)}return qn(w)&&d.length<8?(t.consume(w),d+=String.fromCharCode(w),ie):X(w)}function be(w){return w===93?(t.consume(w),S):X(w)}function S(w){return w===62?(t.consume(w),K):w===45&&o===2?(t.consume(w),S):X(w)}function K(w){return w===null||Ce(w)?(t.exit("htmlFlowData"),oe(w)):(t.consume(w),K)}function oe(w){return t.exit("htmlFlow"),l(w)}}function nw(t,l,a){const u=this;return o;function o(d){return Ce(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):a(d)}function c(d){return u.parser.lazy[u.now().line]?a(d):l(d)}}function rw(t,l,a){return u;function u(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Nu,l,a)}}const lw={name:"htmlText",tokenize:aw};function aw(t,l,a){const u=this;let o,c,d;return h;function h(S){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(S),m}function m(S){return S===33?(t.consume(S),p):S===47?(t.consume(S),_):S===63?(t.consume(S),O):qn(S)?(t.consume(S),ne):a(S)}function p(S){return S===45?(t.consume(S),g):S===91?(t.consume(S),c=0,D):qn(S)?(t.consume(S),N):a(S)}function g(S){return S===45?(t.consume(S),v):a(S)}function b(S){return S===null?a(S):S===45?(t.consume(S),x):Ce(S)?(d=b,ae(S)):(t.consume(S),b)}function x(S){return S===45?(t.consume(S),v):b(S)}function v(S){return S===62?J(S):S===45?x(S):b(S)}function D(S){const K="CDATA[";return S===K.charCodeAt(c++)?(t.consume(S),c===K.length?A:D):a(S)}function A(S){return S===null?a(S):S===93?(t.consume(S),U):Ce(S)?(d=A,ae(S)):(t.consume(S),A)}function U(S){return S===93?(t.consume(S),T):A(S)}function T(S){return S===62?J(S):S===93?(t.consume(S),T):A(S)}function N(S){return S===null||S===62?J(S):Ce(S)?(d=N,ae(S)):(t.consume(S),N)}function O(S){return S===null?a(S):S===63?(t.consume(S),L):Ce(S)?(d=O,ae(S)):(t.consume(S),O)}function L(S){return S===62?J(S):O(S)}function _(S){return qn(S)?(t.consume(S),R):a(S)}function R(S){return S===45||an(S)?(t.consume(S),R):G(S)}function G(S){return Ce(S)?(d=G,ae(S)):Ze(S)?(t.consume(S),G):J(S)}function ne(S){return S===45||an(S)?(t.consume(S),ne):S===47||S===62||Zt(S)?Y(S):a(S)}function Y(S){return S===47?(t.consume(S),J):S===58||S===95||qn(S)?(t.consume(S),E):Ce(S)?(d=Y,ae(S)):Ze(S)?(t.consume(S),Y):J(S)}function E(S){return S===45||S===46||S===58||S===95||an(S)?(t.consume(S),E):q(S)}function q(S){return S===61?(t.consume(S),X):Ce(S)?(d=q,ae(S)):Ze(S)?(t.consume(S),q):Y(S)}function X(S){return S===null||S===60||S===61||S===62||S===96?a(S):S===34||S===39?(t.consume(S),o=S,P):Ce(S)?(d=X,ae(S)):Ze(S)?(t.consume(S),X):(t.consume(S),te)}function P(S){return S===o?(t.consume(S),o=void 0,ue):S===null?a(S):Ce(S)?(d=P,ae(S)):(t.consume(S),P)}function te(S){return S===null||S===34||S===39||S===60||S===61||S===96?a(S):S===47||S===62||Zt(S)?Y(S):(t.consume(S),te)}function ue(S){return S===47||S===62||Zt(S)?Y(S):a(S)}function J(S){return S===62?(t.consume(S),t.exit("htmlTextData"),t.exit("htmlText"),l):a(S)}function ae(S){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),ie}function ie(S){return Ze(S)?lt(t,be,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):be(S)}function be(S){return t.enter("htmlTextData"),d(S)}}const Oc={name:"labelEnd",tokenize:fw,resolveTo:cw,resolveAll:sw},iw={tokenize:dw},uw={tokenize:hw},ow={tokenize:pw};function sw(t){let l=-1;for(;++l=3&&(p===null||Ce(p))?(t.exit("thematicBreak"),l(p)):a(p)}function m(p){return p===o?(t.consume(p),u++,m):(t.exit("thematicBreakSequence"),Ze(p)?lt(t,h,"whitespace")(p):h(p))}}const Pt={name:"list",tokenize:Cw,continuation:{tokenize:Tw},exit:Aw},xw={tokenize:kw,partial:!0},Ew={tokenize:ww,partial:!0};function Cw(t,l,a){const u=this,o=u.events[u.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return h;function h(v){const D=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(D==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:wc(v)){if(u.containerState.type||(u.containerState.type=D,t.enter(D,{_container:!0})),D==="listUnordered")return t.enter("listItemPrefix"),v===42||v===45?t.check(Bu,a,p)(v):p(v);if(!u.interrupt||v===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),m(v)}return a(v)}function m(v){return wc(v)&&++d<10?(t.consume(v),m):(!u.interrupt||d<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(t.exit("listItemValue"),p(v)):a(v)}function p(v){return t.enter("listItemMarker"),t.consume(v),t.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,t.check(Nu,u.interrupt?a:g,t.attempt(xw,x,b))}function g(v){return u.containerState.initialBlankLine=!0,c++,x(v)}function b(v){return Ze(v)?(t.enter("listItemPrefixWhitespace"),t.consume(v),t.exit("listItemPrefixWhitespace"),x):a(v)}function x(v){return u.containerState.size=c+u.sliceSerialize(t.exit("listItemPrefix"),!0).length,l(v)}}function Tw(t,l,a){const u=this;return u.containerState._closeFlow=void 0,t.check(Nu,o,c);function o(h){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,lt(t,l,"listItemIndent",u.containerState.size+1)(h)}function c(h){return u.containerState.furtherBlankLines||!Ze(h)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,d(h)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,t.attempt(Ew,l,d)(h))}function d(h){return u.containerState._closeFlow=!0,u.interrupt=void 0,lt(t,t.attempt(Pt,l,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function ww(t,l,a){const u=this;return lt(t,o,"listItemIndent",u.containerState.size+1);function o(c){const d=u.events[u.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===u.containerState.size?l(c):a(c)}}function Aw(t){t.exit(this.containerState.type)}function kw(t,l,a){const u=this;return lt(t,o,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const d=u.events[u.events.length-1];return!Ze(c)&&d&&d[1].type==="listItemPrefixWhitespace"?l(c):a(c)}}const pg={name:"setextUnderline",tokenize:Ow,resolveTo:_w};function _w(t,l){let a=t.length,u,o,c;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){u=a;break}t[a][1].type==="paragraph"&&(o=a)}else t[a][1].type==="content"&&t.splice(a,1),!c&&t[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:Object.assign({},t[o][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[o][1].type="setextHeadingText",c?(t.splice(o,0,["enter",d,l]),t.splice(c+1,0,["exit",t[u][1],l]),t[u][1].end=Object.assign({},t[c][1].end)):t[u][1]=d,t.push(["exit",d,l]),t}function Ow(t,l,a){const u=this;let o;return c;function c(p){let g=u.events.length,b;for(;g--;)if(u.events[g][1].type!=="lineEnding"&&u.events[g][1].type!=="linePrefix"&&u.events[g][1].type!=="content"){b=u.events[g][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||b)?(t.enter("setextHeadingLine"),o=p,d(p)):a(p)}function d(p){return t.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===o?(t.consume(p),h):(t.exit("setextHeadingLineSequence"),Ze(p)?lt(t,m,"lineSuffix")(p):m(p))}function m(p){return p===null||Ce(p)?(t.exit("setextHeadingLine"),l(p)):a(p)}}const Rw={tokenize:Dw};function Dw(t){const l=this,a=t.attempt(Nu,u,t.attempt(this.parser.constructs.flowInitial,o,lt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(LT,o)),"linePrefix")));return a;function u(c){if(c===null){t.consume(c);return}return t.enter("lineEndingBlank"),t.consume(c),t.exit("lineEndingBlank"),l.currentConstruct=void 0,a}function o(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l.currentConstruct=void 0,a}}const Mw={resolveAll:gg()},zw=mg("string"),Nw=mg("text");function mg(t){return{tokenize:l,resolveAll:gg(t==="text"?Bw:void 0)};function l(a){const u=this,o=this.parser.constructs[t],c=a.attempt(o,d,h);return d;function d(g){return p(g)?c(g):h(g)}function h(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),m}function m(g){return p(g)?(a.exit("data"),c(g)):(a.consume(g),m)}function p(g){if(g===null)return!0;const b=o[g];let x=-1;if(b)for(;++x-1){const h=d[0];typeof h=="string"?d[0]=h.slice(u):d.shift()}c>0&&d.push(t[o].slice(0,c))}return d}function Hw(t,l){let a=-1;const u=[];let o;for(;++a0){const Me=ce.tokenStack[ce.tokenStack.length-1];(Me[1]||vg).call(ce,void 0,Me[0])}for(W.position={start:Er(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Er(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(l,m);const p={type:"element",tagName:"sup",properties:{},children:[m]};return t.patch(l,p),t.applyData(l,p)}function nA(t,l){const a={type:"element",tagName:"h"+l.depth,properties:{},children:t.all(l)};return t.patch(l,a),t.applyData(l,a)}function rA(t,l){if(t.options.allowDangerousHtml){const a={type:"raw",value:l.value};return t.patch(l,a),t.applyData(l,a)}}function xg(t,l){const a=l.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+u}];const o=t.all(l),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const d=o[o.length-1];return d&&d.type==="text"?d.value+=u:o.push({type:"text",value:u}),o}function lA(t,l){const a=String(l.identifier).toUpperCase(),u=t.definitionById.get(a);if(!u)return xg(t,l);const o={src:Ul(u.url||""),alt:l.alt};u.title!==null&&u.title!==void 0&&(o.title=u.title);const c={type:"element",tagName:"img",properties:o,children:[]};return t.patch(l,c),t.applyData(l,c)}function aA(t,l){const a={src:Ul(l.url)};l.alt!==null&&l.alt!==void 0&&(a.alt=l.alt),l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"img",properties:a,children:[]};return t.patch(l,u),t.applyData(l,u)}function iA(t,l){const a={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};t.patch(l,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return t.patch(l,u),t.applyData(l,u)}function uA(t,l){const a=String(l.identifier).toUpperCase(),u=t.definitionById.get(a);if(!u)return xg(t,l);const o={href:Ul(u.url||"")};u.title!==null&&u.title!==void 0&&(o.title=u.title);const c={type:"element",tagName:"a",properties:o,children:t.all(l)};return t.patch(l,c),t.applyData(l,c)}function oA(t,l){const a={href:Ul(l.url)};l.title!==null&&l.title!==void 0&&(a.title=l.title);const u={type:"element",tagName:"a",properties:a,children:t.all(l)};return t.patch(l,u),t.applyData(l,u)}function sA(t,l,a){const u=t.all(l),o=a?cA(a):Eg(l),c={},d=[];if(typeof l.checked=="boolean"){const g=u[0];let b;g&&g.type==="element"&&g.tagName==="p"?b=g:(b={type:"element",tagName:"p",properties:{},children:[]},u.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h1}function fA(t,l){const a={},u=t.all(l);let o=-1;for(typeof l.start=="number"&&l.start!==1&&(a.start=l.start);++o0){const d={type:"element",tagName:"tbody",properties:{},children:t.wrap(a,!0)},h=yc(l.children[1]),m=Gm(l.children[l.children.length-1]);h&&m&&(d.position={start:h,end:m}),o.push(d)}const c={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(l,c),t.applyData(l,c)}function gA(t,l,a){const u=a?a.children:void 0,c=(u?u.indexOf(l):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,h=d?d.length:l.children.length;let m=-1;const p=[];for(;++m0,!0),u[0]),o=u.index+u[0].length,u=a.exec(l);return c.push(wg(l.slice(o),o>0,!1)),c.join("")}function wg(t,l,a){let u=0,o=t.length;if(l){let c=t.codePointAt(u);for(;c===Cg||c===Tg;)u++,c=t.codePointAt(u)}if(a){let c=t.codePointAt(o-1);for(;c===Cg||c===Tg;)o--,c=t.codePointAt(o-1)}return o>u?t.slice(u,o):""}function SA(t,l){const a={type:"text",value:bA(String(l.value))};return t.patch(l,a),t.applyData(l,a)}function vA(t,l){const a={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(l,a),t.applyData(l,a)}const xA={blockquote:Zw,break:Pw,code:Jw,delete:Ww,emphasis:eA,footnoteReference:tA,heading:nA,html:rA,imageReference:lA,image:aA,inlineCode:iA,linkReference:uA,link:oA,listItem:sA,list:fA,paragraph:dA,root:hA,strong:pA,table:mA,tableCell:yA,tableRow:gA,text:SA,thematicBreak:vA,toml:Lu,yaml:Lu,definition:Lu,footnoteDefinition:Lu};function Lu(){}const Ag=-1,Uu=0,Hu=1,ju=2,Dc=3,Mc=4,zc=5,Nc=6,kg=7,_g=8,Og=typeof self=="object"?self:globalThis,EA=(t,l)=>{const a=(o,c)=>(t.set(c,o),o),u=o=>{if(t.has(o))return t.get(o);const[c,d]=l[o];switch(c){case Uu:case Ag:return a(d,o);case Hu:{const h=a([],o);for(const m of d)h.push(u(m));return h}case ju:{const h=a({},o);for(const[m,p]of d)h[u(m)]=u(p);return h}case Dc:return a(new Date(d),o);case Mc:{const{source:h,flags:m}=d;return a(new RegExp(h,m),o)}case zc:{const h=a(new Map,o);for(const[m,p]of d)h.set(u(m),u(p));return h}case Nc:{const h=a(new Set,o);for(const m of d)h.add(u(m));return h}case kg:{const{name:h,message:m}=d;return a(new Og[h](m),o)}case _g:return a(BigInt(d),o);case"BigInt":return a(Object(BigInt(d)),o)}return a(new Og[c](d),o)};return u},Rg=t=>EA(new Map,t)(0),Hl="",{toString:CA}={},{keys:TA}=Object,ui=t=>{const l=typeof t;if(l!=="object"||!t)return[Uu,l];const a=CA.call(t).slice(8,-1);switch(a){case"Array":return[Hu,Hl];case"Object":return[ju,Hl];case"Date":return[Dc,Hl];case"RegExp":return[Mc,Hl];case"Map":return[zc,Hl];case"Set":return[Nc,Hl]}return a.includes("Array")?[Hu,a]:a.includes("Error")?[kg,a]:[ju,a]},Vu=([t,l])=>t===Uu&&(l==="function"||l==="symbol"),wA=(t,l,a,u)=>{const o=(d,h)=>{const m=u.push(d)-1;return a.set(h,m),m},c=d=>{if(a.has(d))return a.get(d);let[h,m]=ui(d);switch(h){case Uu:{let g=d;switch(m){case"bigint":h=_g,g=d.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return o([Ag],d)}return o([h,g],d)}case Hu:{if(m)return o([m,[...d]],d);const g=[],b=o([h,g],d);for(const x of d)g.push(c(x));return b}case ju:{if(m)switch(m){case"BigInt":return o([m,d.toString()],d);case"Boolean":case"Number":case"String":return o([m,d.valueOf()],d)}if(l&&"toJSON"in d)return c(d.toJSON());const g=[],b=o([h,g],d);for(const x of TA(d))(t||!Vu(ui(d[x])))&&g.push([c(x),c(d[x])]);return b}case Dc:return o([h,d.toISOString()],d);case Mc:{const{source:g,flags:b}=d;return o([h,{source:g,flags:b}],d)}case zc:{const g=[],b=o([h,g],d);for(const[x,v]of d)(t||!(Vu(ui(x))||Vu(ui(v))))&&g.push([c(x),c(v)]);return b}case Nc:{const g=[],b=o([h,g],d);for(const x of d)(t||!Vu(ui(x)))&&g.push(c(x));return b}}const{message:p}=d;return o([h,{name:m,message:p}],d)};return c},Dg=(t,{json:l,lossy:a}={})=>{const u=[];return wA(!(l||a),!!l,new Map,u)(t),u},qu=typeof structuredClone=="function"?(t,l)=>l&&("json"in l||"lossy"in l)?Rg(Dg(t,l)):structuredClone(t):(t,l)=>Rg(Dg(t,l));function AA(t,l){const a=[{type:"text",value:"↩"}];return l>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),a}function kA(t,l){return"Back to reference "+(t+1)+(l>1?"-"+l:"")}function _A(t){const l=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=t.options.footnoteBackContent||AA,u=t.options.footnoteBackLabel||kA,o=t.options.footnoteLabel||"Footnotes",c=t.options.footnoteLabelTagName||"h2",d=t.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let m=-1;for(;++m0&&D.push({type:"text",value:" "});let N=typeof a=="string"?a:a(m,v);typeof N=="string"&&(N={type:"text",value:N}),D.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(m,v),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const U=g[g.length-1];if(U&&U.type==="element"&&U.tagName==="p"){const N=U.children[U.children.length-1];N&&N.type==="text"?N.value+=" ":U.children.push({type:"text",value:" "}),U.children.push(...D)}else g.push(...D);const T={type:"element",tagName:"li",properties:{id:l+"fn-"+x},children:t.wrap(g,!0)};t.patch(p,T),h.push(T)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...qu(d),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:` +`}]}}const Mg=function(t){if(t==null)return MA;if(typeof t=="function")return Gu(t);if(typeof t=="object")return Array.isArray(t)?OA(t):RA(t);if(typeof t=="string")return DA(t);throw new Error("Expected function, string, or object as test")};function OA(t){const l=[];let a=-1;for(;++a":""))+")"})}return x;function x(){let v=zg,D,A,U;if((!l||c(m,p,g[g.length-1]||void 0))&&(v=UA(a(m,g)),v[0]===Ng))return v;if("children"in m&&m.children){const T=m;if(T.children&&v[0]!==BA)for(A=(u?T.children.length:-1)+d,U=g.concat(T);A>-1&&A0&&a.push({type:"text",value:` +`}),a}function Lg(t){let l=0,a=t.charCodeAt(l);for(;a===9||a===32;)l++,a=t.charCodeAt(l);return t.slice(l)}function Ug(t,l){const a=jA(t,l),u=a.one(t,void 0),o=_A(a),c=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return o&&c.children.push({type:"text",value:` +`},o),c}function YA(t,l){return t&&"run"in t?async function(a,u){const o=Ug(a,{file:u,...l});await t.run(o,u)}:function(a,u){return Ug(a,{file:u,...t||l})}}function Hg(t){if(t)throw t}var Lc,jg;function $A(){if(jg)return Lc;jg=1;var t=Object.prototype.hasOwnProperty,l=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):l.call(p)==="[object Array]"},c=function(p){if(!p||l.call(p)!=="[object Object]")return!1;var g=t.call(p,"constructor"),b=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!b)return!1;var x;for(x in p);return typeof x>"u"||t.call(p,x)},d=function(p,g){a&&g.name==="__proto__"?a(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},h=function(p,g){if(g==="__proto__")if(t.call(p,g)){if(u)return u(p,g).value}else return;return p[g]};return Lc=function m(){var p,g,b,x,v,D,A=arguments[0],U=1,T=arguments.length,N=!1;for(typeof A=="boolean"&&(N=A,A=arguments[1]||{},U=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});Ud.length;let m;h&&d.push(o);try{m=t.apply(this,d)}catch(p){const g=p;if(h&&a)throw g;return o(g)}h||(m&&m.then&&typeof m.then=="function"?m.then(c,o):m instanceof Error?o(m):c(m))}function o(d,...h){a||(a=!0,l(d,...h))}function c(d){o(null,d)}}const Gn={basename:KA,dirname:ZA,extname:PA,join:JA,sep:"/"};function KA(t,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');oi(t);let a=0,u=-1,o=t.length,c;if(l===void 0||l.length===0||l.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(c){a=o+1;break}}else u<0&&(c=!0,u=o+1);return u<0?"":t.slice(a,u)}if(l===t)return"";let d=-1,h=l.length-1;for(;o--;)if(t.codePointAt(o)===47){if(c){a=o+1;break}}else d<0&&(c=!0,d=o+1),h>-1&&(t.codePointAt(o)===l.codePointAt(h--)?h<0&&(u=o):(h=-1,u=d));return a===u?u=d:u<0&&(u=t.length),t.slice(a,u)}function ZA(t){if(oi(t),t.length===0)return".";let l=-1,a=t.length,u;for(;--a;)if(t.codePointAt(a)===47){if(u){l=a;break}}else u||(u=!0);return l<0?t.codePointAt(0)===47?"/":".":l===1&&t.codePointAt(0)===47?"//":t.slice(0,l)}function PA(t){oi(t);let l=t.length,a=-1,u=0,o=-1,c=0,d;for(;l--;){const h=t.codePointAt(l);if(h===47){if(d){u=l+1;break}continue}a<0&&(d=!0,a=l+1),h===46?o<0?o=l:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||a<0||c===0||c===1&&o===a-1&&o===u+1?"":t.slice(o,a)}function JA(...t){let l=-1,a;for(;++l0&&t.codePointAt(t.length-1)===47&&(a+="/"),l?"/"+a:a}function ek(t,l){let a="",u=0,o=-1,c=0,d=-1,h,m;for(;++d<=t.length;){if(d2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),o=d,c=0;continue}}else if(a.length>0){a="",u=0,o=d,c=0;continue}}l&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+t.slice(o+1,d):a=t.slice(o+1,d),u=d-o-1;o=d,c=0}else h===46&&c>-1?c++:c=-1}return a}function oi(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const tk={cwd:nk};function nk(){return"/"}function jc(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function rk(t){if(typeof t=="string")t=new URL(t);else if(!jc(t)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(t.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return lk(t)}function lk(t){if(t.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const l=t.pathname;let a=-1;for(;++a0){let[v,...D]=g;const A=u[x][1];Hc(A)&&Hc(v)&&(v=Uc(!0,A,v)),u[x]=[p,v,...D]}}}}const ok=new Ic().freeze();function Yc(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function $c(t,l){if(typeof l!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Fc(t,l){if(l)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gg(t){if(!Hc(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ig(t,l,a){if(!a)throw new Error("`"+t+"` finished async. Use `"+l+"` instead")}function Iu(t){return sk(t)?t:new Vg(t)}function sk(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ck(t){return typeof t=="string"||fk(t)}function fk(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const dk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yg=[],$g={allowDangerousHtml:!0},hk=/^(https?|ircs?|mailto|xmpp)$/i,pk=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function mk(t){const l=t.allowedElements,a=t.allowElement,u=t.children||"",o=t.className,c=t.components,d=t.disallowedElements,h=t.rehypePlugins||Yg,m=t.remarkPlugins||Yg,p=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...$g}:$g,g=t.skipHtml,b=t.unwrapDisallowed,x=t.urlTransform||gk,v=ok().use(Kw).use(m).use(YA,p).use(h),D=new Vg;typeof u=="string"&&(D.value=u);for(const N of pk)Object.hasOwn(t,N.from)&&(""+N.from+(N.to?"use `"+N.to+"` instead":"remove it")+dk+N.id,void 0);const A=v.parse(D);let U=v.runSync(A,D);return o&&(U={type:"element",tagName:"div",properties:{className:o},children:U.type==="root"?U.children:[U]}),Bg(U,T),LC(U,{Fragment:Ye.Fragment,components:c,ignoreInvalidStyle:!0,jsx:Ye.jsx,jsxs:Ye.jsxs,passKeys:!0,passNode:!0});function T(N,O,L){if(N.type==="raw"&&L&&typeof O=="number")return g?L.children.splice(O,1):L.children[O]={type:"text",value:N.value},O;if(N.type==="element"){let _;for(_ in Ec)if(Object.hasOwn(Ec,_)&&Object.hasOwn(N.properties,_)){const R=N.properties[_],G=Ec[_];(G===null||G.includes(N.tagName))&&(N.properties[_]=x(String(R||""),_,N))}}if(N.type==="element"){let _=l?!l.includes(N.tagName):d?d.includes(N.tagName):!1;if(!_&&a&&typeof O=="number"&&(_=!a(N,O,L)),_&&L&&typeof O=="number")return b&&N.children?L.children.splice(O,1,...N.children):L.children.splice(O,1),O}}}function gk(t){const l=t.indexOf(":"),a=t.indexOf("?"),u=t.indexOf("#"),o=t.indexOf("/");return l<0||o>-1&&l>o||a>-1&&l>a||u>-1&&l>u||hk.test(t.slice(0,l))?t:""}const yk=(...t)=>l=>{t.forEach(a=>{typeof a=="function"?a(l):a&&(a.current=l)})},Fg=t=>t.scrollHeight-t.clientHeight-t.scrollTop,bk=t=>{t.scrollTop=t.scrollHeight},Sk=ot.div({overflow:"auto"}),vk=j.forwardRef(function({children:l,threshold:a=2,className:u},o){const c=j.useRef(),[d,h]=j.useState(l),m=j.useRef(null);return j.useLayoutEffect(()=>{c.current&&(m.current=Fg(c.current){if(!c.current)return;const p=Fg(c.current){var d;const[u,o]=j.useState(-1);j.useEffect(()=>{o(-1)},[l,a]),j.useEffect(()=>{const h=a[u+1];if(!l||!h)return()=>{};const m=setTimeout(()=>{o(u+1)},h.delay);return()=>{clearTimeout(m)}},[l,u,a]);const c=(d=a[u])==null?void 0:d.text;return j.createElement(xk,{"aria-atomic":"true","aria-live":"polite"},l?c:t)},Tk=ot.div(({theme:t})=>({width:"100%",height:"100%",border:`1px solid ${t.custom.colors.silverGrayLight}`,backgroundColor:t.custom.colors.lightGray1,display:"flex",flexDirection:"column"})),wk=ot(vk)({display:"flex",flexDirection:"column",flex:1,padding:"24px",paddingBottom:"0px",overflow:"auto"}),Xg=ot.div(({reverse:t})=>[{margin:"8px 0",display:"flex",width:"100%",flexDirection:t?"row-reverse":"row"}]),Qg=ot.div({}),Kg=ot.div(({theme:t})=>({border:`1px solid ${t.custom.colors.silverGrayLight}`,backgroundColor:t.custom.colors.white,borderRadius:"24px",padding:"4px 16px",...t.typography.body2,"p:first-of-type":{marginTop:0},"p:last-of-type":{marginBottom:0},a:{color:t.custom.colors.mitRed,textDecoration:"none"},"a:hover":{color:t.custom.colors.red,textDecoration:"underline"}})),Ak=ot.div({alignSelf:"flex-end",display:"flex",flexDirection:"column",gap:"4px"}),kk=ot.button(({theme:t})=>({border:`1px solid ${t.custom.colors.silverGrayLight}`,backgroundColor:t.custom.colors.white,borderRadius:"24px",padding:"4px 16px",...t.typography.body2,cursor:"pointer","&:hover":{backgroundColor:t.custom.colors.lightGray1}})),_k=ot.div(({theme:t})=>({display:"flex",justifyContent:"space-around",padding:"12px 24px",backgroundColor:t.custom.colors.white})),Ok=ot.form(()=>({display:"flex",width:"80%",gap:"12px",alignItems:"center"})),Rk=ot.span(({theme:t})=>({display:"inline-flex",gap:"4px",".MuiSkeleton-root":{backgroundColor:t.custom.colors.silverGray}})),Dk=()=>j.createElement(Rk,null,j.createElement(Gs,{variant:"circular",width:"8px",height:"8px"}),j.createElement(Gs,{variant:"circular",width:"8px",height:"8px"}),j.createElement(Gs,{variant:"circular",width:"8px",height:"8px"})),Pr={root:"MitAiChat--root",conversationStarter:"MitAiChat--conversationStarter",messagesContainer:"MitAiChat--messagesContainer",messageRow:"MitAiChat--messageRow",message:"MitAiChat--message",avatar:"MitAiChat--avatar",input:"MitAiChat--input"},Mk=function({className:l,conversationStarters:a,requestOpts:u,initialMessages:o,parseContent:c,srLoadingMessages:d}){var _;const[h,m]=j.useState(!0),p=j.useRef(null),g=j.useMemo(()=>{const R=Math.random().toString().slice(2);return o.map((G,ne)=>({...G,id:`initial-${R}-${ne}`}))},[o]),{messages:b,input:x,handleInputChange:v,handleSubmit:D,append:A,isLoading:U}=uC(u,{initialMessages:g}),T=j.useMemo(()=>{const R=g.map(G=>G.id);return b.map(G=>{if(G.role==="assistant"&&!R.includes(G.id)){const ne=c?c(G.content):G.content;return{...G,content:ne}}return G})},[c,b,g]),N=!h&&((_=T[T.length-1])==null?void 0:_.role)==="user",O=()=>{var R;(R=p.current)==null||R.scrollBy({behavior:"instant",top:p.current.scrollHeight})},L=T[T.length-1];return j.createElement(Tk,{className:OE(l,Pr.root)},j.createElement(wk,{className:Pr.messagesContainer,ref:p},T.map(R=>j.createElement(Xg,{key:R.id,reverse:R.role==="user","data-chat-role":R.role,className:Pr.messageRow},j.createElement(Qg,null),j.createElement(Kg,{className:Pr.message},j.createElement(mk,null,R.content)))),h?j.createElement(Ak,null,a==null?void 0:a.map(R=>j.createElement(kk,{className:Pr.conversationStarter,key:R.content,onClick:()=>{m(!1),O(),A({role:"user",content:R.content})}},R.content))):null,N?j.createElement(Xg,{key:"loading"},j.createElement(Qg,{className:Pr.avatar}),j.createElement(Kg,null,j.createElement(Dk,null))):null),j.createElement(_k,null,j.createElement(Ok,{onSubmit:R=>{m(!1),O(),D(R)}},j.createElement(NE,{className:Pr.input,placeholder:"Type a message...",name:"message",sx:{flex:1},value:x,onChange:v}),j.createElement(Qs,{"aria-label":"Send",type:"submit",disabled:U||!x},j.createElement(IE,null)))),j.createElement(Ck,{isLoading:U,loadingMessages:d,message:L.role==="assistant"?L.content:""}))},zk={defaultProps:{disableRipple:!0},styleOverrides:{root:{":focus-visible":{outline:"revert"}}}},Le={mitRed:"#750014",brightRed:"#FF1423",black:"#000000",white:"#FFFFFF",darkGray2:"#212326",darkGray1:"#40464C",silverGrayDark:"#626A73",silverGray:"#8B959E",silverGrayLight:"#B8C2CC",lightGray2:"#DDE1E6",lightGray1:"#F3F4F8",navGray:"#303337",darkPink:"#750062",pink:"#FF14F0",lightPink:"#FFB3FF",darkPurple:"#3E006B",purple:"#93F",lightPurple:"#BFB3FF",darkBlue:"#002896",blue:"#1966FF",lightBlue:"#99EBFF",darkGreen:"#004D1A",green:"#00AD00",lightGreen:"#AF3",darkRed:"#83192A",red:"#A31F34",lightRed:"#D02E44",orange:"#FAB005",yellow:"#FFEB00"},Nk={defaultProps:{size:"medium",color:"default",variant:"outlined",deleteIcon:j.createElement(GE,{"aria-hidden":"true"})},styleOverrides:{root:{borderRadius:"100vh",borderWidth:"1px"},deleteIcon:{"&:hover":{color:"inherit"},"&.MuiChip-deleteIconLarge":{width:"16px",height:"16px"},"&.MuiChip-deleteIconMedium":{width:"14px",height:"14px"},margin:"0 -2px 0 8px",color:"inherit"},icon:{margin:"0 8px 0 -2px",color:"inherit","&.MuiChip-iconLarge":{width:"16px",height:"16px"},"&.MuiChip-iconMedium":{width:"14px",height:"14px"}}},variants:[{props:{size:"medium"},style:({theme:t})=>({...t.typography.body3,boxSizing:"border-box",height:"24px",paddingRight:"12px",paddingLeft:"12px",".MuiChip-label":{paddingLeft:"0px",paddingRight:"0px"}})},{props:{size:"large"},style:({theme:t})=>({...t.typography.body2,height:"32px",paddingLeft:"16px",paddingRight:"16px",".MuiChip-label":{paddingLeft:"0px",paddingRight:"0px"}})},{props:{variant:"outlined"},style:{borderColor:Le.silverGrayLight,color:Le.darkGray1,"&.Mui-focusVisible":{backgroundColor:"transparent"},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{color:Le.darkGray1,borderColor:Le.silverGrayDark,backgroundColor:"transparent"}}},{props:{variant:"outlinedWhite"},style:{backgroundColor:"white",border:"1px solid",borderColor:Le.silverGrayLight,color:Le.darkGray1,"&.Mui-focusVisible":{backgroundColor:"white"},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{color:Le.darkGray1,borderColor:Le.silverGrayDark,backgroundColor:"white"}}},{props:{variant:"gray"},style:{backgroundColor:Le.lightGray2,border:"none",color:Le.darkGray2,"&.Mui-focusVisible":{backgroundColor:Le.lightGray2},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{color:Le.darkGray1,backgroundColor:Le.silverGrayLight}}},{props:{variant:"dark"},style:{backgroundColor:Le.silverGrayDark,border:"none",color:Le.white,"&.Mui-focusVisible":{backgroundColor:Le.silverGrayDark},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{backgroundColor:Le.darkGray1}}},{props:{variant:"darker"},style:{backgroundColor:Le.darkGray2,border:`1px solid ${Le.darkGray1}`,color:Le.white,"&.Mui-focusVisible":{backgroundColor:Le.darkGray2},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{backgroundColor:Le.black,border:`1px solid ${Le.silverGray}`}}},{props:{variant:"filled"},style:{backgroundColor:Le.mitRed,border:"none",color:Le.white,"&.Mui-focusVisible":{backgroundColor:Le.mitRed},"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover":{backgroundColor:Le.red}}}]},Bk={colors:Le,dimensions:{headerHeight:"72px",headerHeightSm:"60px"}},Lk={values:{xs:0,sm:600,md:900,lg:1320,xl:1536}},Zg={custom:Bk,palette:{primary:{main:Le.mitRed,light:Le.lightRed,active:Le.red,contrastText:Le.white},secondary:{light:Le.darkGray2,active:Le.silverGrayDark,main:Le.black,contrastText:Le.white}},shape:{borderRadius:8},spacing:8,typography:Lp,breakpoints:Lk,components:{MuiButtonBase:zk,MuiTypography:BE,MuiTabPanel:{styleOverrides:{root:{padding:"0px"}}},MuiMenu:{styleOverrides:{paper:{borderRadius:"4px"}}},MuiAutocomplete:{styleOverrides:{paper:{borderRadius:"4px"},popupIndicator:{paddingRight:0,marginRight:0}}},MuiChip:Nk}},Uk=(t=>ku({...Zg,custom:{...Zg.custom,...t==null?void 0:t.custom}}))(),Hk=({children:t,theme:l=Uk})=>j.createElement(rE,{theme:l},t);ot.span(({theme:t})=>({color:t.custom.colors.lightRed,marginLeft:"4px"})),ot.div(({theme:t,error:l})=>[{...t.typography.body2,color:l?t.custom.colors.lightRed:t.custom.colors.silverGrayDark},l&&{textIndent:"-24px",paddingLeft:"24px","> svg:first-of-type":{marginRight:"4px",transform:"translateY(2px)",width:"18px",height:"18px",position:"relative",top:"2px"}}]),ot.div(({fullWidth:t})=>[{display:"inline-flex",flexDirection:"column",alignItems:"start","> *:not(:last-child)":{marginBottom:"4px"}},t&&{width:"100%"}]);const jk=t=>{const l=t.root;Hb.createRoot(l).render(j.createElement(Hk,null,j.createElement(Mk,{...t})))};xl.aiChat=jk,Object.defineProperty(xl,Symbol.toStringTag,{value:"Module"})}); diff --git a/src/ol_openedx_chat/static/js/ai_chat.js b/src/ol_openedx_chat/static/js/ai_chat.js new file mode 100644 index 00000000..51118022 --- /dev/null +++ b/src/ol_openedx_chat/static/js/ai_chat.js @@ -0,0 +1,37 @@ +function AiChatAsideView(runtime, element, block_element, init_args) { + console.log("INSIDE AiChatAsideView") + const INITIAL_MESSAGES = [ + { + content: "Hi! What are you interested in learning about?", + role: "assistant", + }, + ] + + const STARTERS = [ + { content: "I'm interested in quantum computing" }, + { content: "I want to understand global warming. " }, + { content: "I am curious about AI applications for business" }, + ] + + const REQUEST_OPTS = { + apiUrl: "http://ai.open.odl.local:8002/http/recommendation_agent/", + transformBody(messages) { + const message = messages[messages.length - 1].content + return { message } + }, + } + + const el = document.getElementById("app-root") + /** + * Accepts all options of https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-aichat--docs,\ + * plus root element + */ + aiChat.aiChat({ + root: el, + initialMessages: INITIAL_MESSAGES, + conversationStarters: STARTERS, + requestOpts: REQUEST_OPTS, + className: "ai-chat", + }) + console.log(init_args) +}