From 38886ee59ced37a5b2a129c7f9e7521bd47d4063 Mon Sep 17 00:00:00 2001 From: dovvnloading Date: Fri, 17 Jul 2026 10:37:36 -0400 Subject: [PATCH] Harden composer paste and Qt shutdown --- .../{index-oTmdXyMk.js => index-BM0Y10OU.js} | 20 ++-- assets/composer/index.html | 27 +++-- composer_ui/src/ComposerApp.tsx | 17 +++ composer_ui/src/bridge.ts | 28 +++++ graphlink_app/graphlink_composer_bridge.py | 8 ++ graphlink_app/graphlink_composer_popups.py | 107 +++++++++++------- graphlink_app/graphlink_composer_web.py | 29 +++++ .../graphlink_settings_dialogs.py | 31 +++-- graphlink_app/graphlink_window.py | 35 ++++-- graphlink_app/tests/test_composer_bridge.py | 24 +++- .../tests/test_composer_context_ui.py | 10 ++ .../tests/test_ollama_task_model_settings.py | 17 +++ .../tests/test_temp_attachment_encoding.py | 10 ++ 13 files changed, 282 insertions(+), 81 deletions(-) rename assets/composer/assets/{index-oTmdXyMk.js => index-BM0Y10OU.js} (68%) diff --git a/assets/composer/assets/index-oTmdXyMk.js b/assets/composer/assets/index-BM0Y10OU.js similarity index 68% rename from assets/composer/assets/index-oTmdXyMk.js rename to assets/composer/assets/index-BM0Y10OU.js index 26e563a..6ec214f 100644 --- a/assets/composer/assets/index-oTmdXyMk.js +++ b/assets/composer/assets/index-BM0Y10OU.js @@ -1,4 +1,4 @@ -var Df=Object.defineProperty;var jf=(w,z,m)=>z in w?Df(w,z,{enumerable:!0,configurable:!0,writable:!0,value:m}):w[z]=m;var Ci=(w,z,m)=>jf(w,typeof z!="symbol"?z+"":z,m);(function(){const z=document.createElement("link").relList;if(z&&z.supports&&z.supports("modulepreload"))return;for(const A of document.querySelectorAll('link[rel="modulepreload"]'))B(A);new MutationObserver(A=>{for(const D of A)if(D.type==="childList")for(const G of D.addedNodes)G.tagName==="LINK"&&G.rel==="modulepreload"&&B(G)}).observe(document,{childList:!0,subtree:!0});function m(A){const D={};return A.integrity&&(D.integrity=A.integrity),A.referrerPolicy&&(D.referrerPolicy=A.referrerPolicy),A.crossOrigin==="use-credentials"?D.credentials="include":A.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function B(A){if(A.ep)return;A.ep=!0;const D=m(A);fetch(A.href,D)}})();var _i={exports:{}},gr={},Ni={exports:{}},F={};/** +var Df=Object.defineProperty;var jf=(w,N,m)=>N in w?Df(w,N,{enumerable:!0,configurable:!0,writable:!0,value:m}):w[N]=m;var Ci=(w,N,m)=>jf(w,typeof N!="symbol"?N+"":N,m);(function(){const N=document.createElement("link").relList;if(N&&N.supports&&N.supports("modulepreload"))return;for(const U of document.querySelectorAll('link[rel="modulepreload"]'))V(U);new MutationObserver(U=>{for(const D of U)if(D.type==="childList")for(const J of D.addedNodes)J.tagName==="LINK"&&J.rel==="modulepreload"&&V(J)}).observe(document,{childList:!0,subtree:!0});function m(U){const D={};return U.integrity&&(D.integrity=U.integrity),U.referrerPolicy&&(D.referrerPolicy=U.referrerPolicy),U.crossOrigin==="use-credentials"?D.credentials="include":U.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function V(U){if(U.ep)return;U.ep=!0;const D=m(U);fetch(U.href,D)}})();var _i={exports:{}},gr={},Ni={exports:{}},F={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var Df=Object.defineProperty;var jf=(w,z,m)=>z in w?Df(w,z,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Na;function If(){if(Na)return F;Na=1;var w=Symbol.for("react.element"),z=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),G=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ne=Symbol.iterator;function _(c){return c===null||typeof c!="object"?null:(c=ne&&c[ne]||c["@@iterator"],typeof c=="function"?c:null)}var oe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},de=Object.assign,J={};function b(c,v,I){this.props=c,this.context=v,this.refs=J,this.updater=I||oe}b.prototype.isReactComponent={},b.prototype.setState=function(c,v){if(typeof c!="object"&&typeof c!="function"&&c!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,c,v,"setState")},b.prototype.forceUpdate=function(c){this.updater.enqueueForceUpdate(this,c,"forceUpdate")};function vt(){}vt.prototype=b.prototype;function st(c,v,I){this.props=c,this.context=v,this.refs=J,this.updater=I||oe}var Je=st.prototype=new vt;Je.constructor=st,de(Je,b.prototype),Je.isPureReactComponent=!0;var xe=Array.isArray,be=Object.prototype.hasOwnProperty,ze={current:null},Te={key:!0,ref:!0,__self:!0,__source:!0};function We(c,v,I){var U,Q={},W=null,ee=null;if(v!=null)for(U in v.ref!==void 0&&(ee=v.ref),v.key!==void 0&&(W=""+v.key),v)be.call(v,U)&&!Te.hasOwnProperty(U)&&(Q[U]=v[U]);var Y=arguments.length-2;if(Y===1)Q.children=I;else if(1z in w?Df(w,z,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var za;function Ff(){if(za)return gr;za=1;var w=Li(),z=Symbol.for("react.element"),m=Symbol.for("react.fragment"),B=Object.prototype.hasOwnProperty,A=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,D={key:!0,ref:!0,__self:!0,__source:!0};function G(V,$,j){var Z,ne={},_=null,oe=null;j!==void 0&&(_=""+j),$.key!==void 0&&(_=""+$.key),$.ref!==void 0&&(oe=$.ref);for(Z in $)B.call($,Z)&&!D.hasOwnProperty(Z)&&(ne[Z]=$[Z]);if(V&&V.defaultProps)for(Z in $=V.defaultProps,$)ne[Z]===void 0&&(ne[Z]=$[Z]);return{$$typeof:z,type:V,key:_,ref:oe,props:ne,_owner:A.current}}return gr.Fragment=m,gr.jsx=G,gr.jsxs=G,gr}var Ra;function Uf(){return Ra||(Ra=1,_i.exports=Ff()),_i.exports}var q=Uf(),Nt=Li(),Rl={},Pi={exports:{}},Ue={},zi={exports:{}},Ri={};/** + */var za;function Ff(){if(za)return gr;za=1;var w=Li(),N=Symbol.for("react.element"),m=Symbol.for("react.fragment"),V=Object.prototype.hasOwnProperty,U=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,D={key:!0,ref:!0,__self:!0,__source:!0};function J(B,W,j){var ee,le={},te=null,R=null;j!==void 0&&(te=""+j),W.key!==void 0&&(te=""+W.key),W.ref!==void 0&&(R=W.ref);for(ee in W)V.call(W,ee)&&!D.hasOwnProperty(ee)&&(le[ee]=W[ee]);if(B&&B.defaultProps)for(ee in W=B.defaultProps,W)le[ee]===void 0&&(le[ee]=W[ee]);return{$$typeof:N,type:B,key:te,ref:R,props:le,_owner:U.current}}return gr.Fragment=m,gr.jsx=J,gr.jsxs=J,gr}var Ra;function Uf(){return Ra||(Ra=1,_i.exports=Ff()),_i.exports}var Z=Uf(),Nt=Li(),Rl={},Pi={exports:{}},Ue={},zi={exports:{}},Ri={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var Df=Object.defineProperty;var jf=(w,z,m)=>z in w?Df(w,z,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var La;function Af(){return La||(La=1,(function(w){function z(k,M){var C=k.length;k.push(M);e:for(;0>>1,v=k[c];if(0>>1;cA(Q,C))WA(ee,Q)?(k[c]=ee,k[W]=C,c=W):(k[c]=Q,k[U]=C,c=U);else if(WA(ee,C))k[c]=ee,k[W]=C,c=W;else break e}}return M}function A(k,M){var C=k.sortIndex-M.sortIndex;return C!==0?C:k.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;w.unstable_now=function(){return D.now()}}else{var G=Date,V=G.now();w.unstable_now=function(){return G.now()-V}}var $=[],j=[],Z=1,ne=null,_=3,oe=!1,de=!1,J=!1,b=typeof setTimeout=="function"?setTimeout:null,vt=typeof clearTimeout=="function"?clearTimeout:null,st=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Je(k){for(var M=m(j);M!==null;){if(M.callback===null)B(j);else if(M.startTime<=k)B(j),M.sortIndex=M.expirationTime,z($,M);else break;M=m(j)}}function xe(k){if(J=!1,Je(k),!de)if(m($)!==null)de=!0,Me(be);else{var M=m(j);M!==null&&ce(xe,M.startTime-k)}}function be(k,M){de=!1,J&&(J=!1,vt(We),We=-1),oe=!0;var C=_;try{for(Je(M),ne=m($);ne!==null&&(!(ne.expirationTime>M)||k&&!Yt());){var c=ne.callback;if(typeof c=="function"){ne.callback=null,_=ne.priorityLevel;var v=c(ne.expirationTime<=M);M=w.unstable_now(),typeof v=="function"?ne.callback=v:ne===m($)&&B($),Je(M)}else B($);ne=m($)}if(ne!==null)var I=!0;else{var U=m(j);U!==null&&ce(xe,U.startTime-M),I=!1}return I}finally{ne=null,_=C,oe=!1}}var ze=!1,Te=null,We=-1,Pt=5,yt=-1;function Yt(){return!(w.unstable_now()-ytk||125c?(k.sortIndex=C,z(j,k),m($)===null&&k===m(j)&&(J?(vt(We),We=-1):J=!0,ce(xe,C-c))):(k.sortIndex=v,z($,k),de||oe||(de=!0,Me(be))),k},w.unstable_shouldYield=Yt,w.unstable_wrapCallback=function(k){var M=_;return function(){var C=_;_=M;try{return k.apply(this,arguments)}finally{_=C}}}})(Ri)),Ri}var Ta;function Vf(){return Ta||(Ta=1,zi.exports=Af()),zi.exports}/** + */var La;function Af(){return La||(La=1,(function(w){function N(k,M){var C=k.length;k.push(M);e:for(;0>>1,v=k[c];if(0>>1;cU(K,C))YU(ne,K)?(k[c]=ne,k[Y]=C,c=Y):(k[c]=K,k[A]=C,c=A);else if(YU(ne,C))k[c]=ne,k[Y]=C,c=Y;else break e}}return M}function U(k,M){var C=k.sortIndex-M.sortIndex;return C!==0?C:k.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;w.unstable_now=function(){return D.now()}}else{var J=Date,B=J.now();w.unstable_now=function(){return J.now()-B}}var W=[],j=[],ee=1,le=null,te=3,R=!1,b=!1,H=!1,$=typeof setTimeout=="function"?setTimeout:null,vt=typeof clearTimeout=="function"?clearTimeout:null,st=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Je(k){for(var M=m(j);M!==null;){if(M.callback===null)V(j);else if(M.startTime<=k)V(j),M.sortIndex=M.expirationTime,N(W,M);else break;M=m(j)}}function xe(k){if(H=!1,Je(k),!b)if(m(W)!==null)b=!0,Me(be);else{var M=m(j);M!==null&&fe(xe,M.startTime-k)}}function be(k,M){b=!1,H&&(H=!1,vt(We),We=-1),R=!0;var C=te;try{for(Je(M),le=m(W);le!==null&&(!(le.expirationTime>M)||k&&!Yt());){var c=le.callback;if(typeof c=="function"){le.callback=null,te=le.priorityLevel;var v=c(le.expirationTime<=M);M=w.unstable_now(),typeof v=="function"?le.callback=v:le===m(W)&&V(W),Je(M)}else V(W);le=m(W)}if(le!==null)var I=!0;else{var A=m(j);A!==null&&fe(xe,A.startTime-M),I=!1}return I}finally{le=null,te=C,R=!1}}var ze=!1,Te=null,We=-1,Pt=5,yt=-1;function Yt(){return!(w.unstable_now()-ytk||125c?(k.sortIndex=C,N(j,k),m(W)===null&&k===m(j)&&(H?(vt(We),We=-1):H=!0,fe(xe,C-c))):(k.sortIndex=v,N(W,k),b||R||(b=!0,Me(be))),k},w.unstable_shouldYield=Yt,w.unstable_wrapCallback=function(k){var M=te;return function(){var C=te;te=M;try{return k.apply(this,arguments)}finally{te=C}}}})(Ri)),Ri}var Ta;function Vf(){return Ta||(Ta=1,zi.exports=Af()),zi.exports}/** * @license React * react-dom.production.min.js * @@ -30,11 +30,13 @@ var Df=Object.defineProperty;var jf=(w,z,m)=>z in w?Df(w,z,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ma;function Bf(){if(Ma)return Ue;Ma=1;var w=Li(),z=Vf();function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$=Object.prototype.hasOwnProperty,j=/^[: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]*$/,Z={},ne={};function _(e){return $.call(ne,e)?!0:$.call(Z,e)?!1:j.test(e)?ne[e]=!0:(Z[e]=!0,!1)}function oe(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function de(e,t,n,r){if(t===null||typeof t>"u"||oe(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function J(e,t,n,r,l,u,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=i}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new J(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new J(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new J(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new J(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new J(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new J(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new J(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new J(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new J(e,5,!1,e.toLowerCase(),null,!1,!1)});var vt=/[\-:]([a-z])/g;function st(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vt,st);b[t]=new J(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vt,st);b[t]=new J(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vt,st);b[t]=new J(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!0,!0)});function Je(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),W=Object.prototype.hasOwnProperty,j=/^[: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]*$/,ee={},le={};function te(e){return W.call(le,e)?!0:W.call(ee,e)?!1:j.test(e)?le[e]=!0:(ee[e]=!0,!1)}function R(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function b(e,t,n,r){if(t===null||typeof t>"u"||R(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function H(e,t,n,r,l,u,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=i}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$[e]=new H(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$[t]=new H(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){$[e]=new H(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$[e]=new H(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$[e]=new H(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){$[e]=new H(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){$[e]=new H(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){$[e]=new H(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){$[e]=new H(e,5,!1,e.toLowerCase(),null,!1,!1)});var vt=/[\-:]([a-z])/g;function st(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vt,st);$[t]=new H(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vt,st);$[t]=new H(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vt,st);$[t]=new H(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){$[e]=new H(e,1,!1,e.toLowerCase(),null,!1,!1)}),$.xlinkHref=new H("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){$[e]=new H(e,1,!1,e.toLowerCase(),null,!0,!0)});function Je(e,t,n,r){var l=$.hasOwnProperty(t)?$[t]:null;(l!==null?l.type!==0:r||!(2o||l[i]!==u[o]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=o);break}}}finally{I=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?v(e):""}function Q(e){switch(e.tag){case 5:return v(e.type);case 16:return v("Lazy");case 13:return v("Suspense");case 19:return v("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return""}}function W(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Te:return"Fragment";case ze:return"Portal";case Pt:return"Profiler";case We:return"StrictMode";case Ae:return"Suspense";case et:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Yt:return(e.displayName||"Context")+".Consumer";case yt:return(e._context.displayName||"Context")+".Provider";case at:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ct:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case Me:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}function ee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W(t);case 8:return t===We?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ue(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ve(e){var t=ue(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,u.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wr(e){e._valueTracker||(e._valueTracker=Ve(e))}function Ti(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ue(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Tl(e,t){var n=t.checked;return C({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Y(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oi(e,t){t=t.checked,t!=null&&Je(e,"checked",t,!1)}function Ml(e,t){Oi(e,t);var n=Y(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ol(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ol(e,t.type,Y(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Di(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ol(e,t,n){(t!=="number"||Sr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var On=Array.isArray;function sn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=kr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fa=["Webkit","ms","Moz","O"];Object.keys(jn).forEach(function(e){Fa.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jn[t]=jn[e]})});function Vi(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jn.hasOwnProperty(e)&&jn[e]?(""+t).trim():t+"px"}function Bi(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Vi(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ua=C({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Il(e,t){if(t){if(Ua[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(m(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(m(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(m(61))}if(t.style!=null&&typeof t.style!="object")throw Error(m(62))}}function Fl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ul=null;function Al(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vl=null,an=null,cn=null;function Hi(e){if(e=rr(e)){if(typeof Vl!="function")throw Error(m(280));var t=e.stateNode;t&&(t=Qr(t),Vl(e.stateNode,e.type,t))}}function $i(e){an?cn?cn.push(e):cn=[e]:an=e}function Qi(){if(an){var e=an,t=cn;if(cn=an=null,Hi(e),t)for(e=0;e>>=0,e===0?32:31-(qa(e)/Ga|0)|0}var Nr=64,Pr=4194304;function An(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=An(o):(u&=i,u!==0&&(r=An(u)))}else i=n&~l,i!==0?r=An(i):u!==0&&(r=An(u));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=n}function ec(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Xn),wo=" ",So=!1;function ko(e,t){switch(e){case"keyup":return zc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pn=!1;function Lc(e,t){switch(e){case"compositionend":return Eo(t);case"keypress":return t.which!==32?null:(So=!0,wo);case"textInput":return e=t.data,e===wo&&So?null:e;default:return null}}function Tc(e,t){if(pn)return e==="compositionend"||!lu&&ko(e,t)?(e=po(),Or=Jl=Mt=null,pn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ro(n)}}function To(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?To(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mo(){for(var e=window,t=Sr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sr(e.document)}return t}function ou(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Vc(e){var t=Mo(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&To(n.ownerDocument.documentElement,n)){if(r!==null&&ou(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=Lo(n,u);var i=Lo(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,mn=null,su=null,Jn=null,au=!1;function Oo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;au||mn==null||mn!==Sr(r)||(r=mn,"selectionStart"in r&&ou(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jn&&Zn(Jn,r)||(Jn=r,r=Br(su,"onSelect"),0wn||(e.current=ku[wn],ku[wn]=null,wn--)}function te(e,t){wn++,ku[wn]=e.current,e.current=t}var It={},Ce=jt(It),Oe=jt(!1),Gt=It;function Sn(e,t){var n=e.type.contextTypes;if(!n)return It;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function De(e){return e=e.childContextTypes,e!=null}function Wr(){le(Oe),le(Ce)}function Xo(e,t,n){if(Ce.current!==It)throw Error(m(168));te(Ce,t),te(Oe,n)}function qo(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(m(108,ee(e)||"Unknown",l));return C({},n,r)}function Kr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||It,Gt=Ce.current,te(Ce,e),te(Oe,Oe.current),!0}function Go(e,t,n){var r=e.stateNode;if(!r)throw Error(m(169));n?(e=qo(e,t,Gt),r.__reactInternalMemoizedMergedChildContext=e,le(Oe),le(Ce),te(Ce,e)):le(Oe),te(Oe,n)}var wt=null,Yr=!1,Eu=!1;function Zo(e){wt===null?wt=[e]:wt.push(e)}function Jc(e){Yr=!0,Zo(e)}function Ft(){if(!Eu&&wt!==null){Eu=!0;var e=0,t=X;try{var n=wt;for(X=1;e>=i,l-=i,St=1<<32-tt(t)+l|n<O?(Se=T,T=null):Se=T.sibling;var K=h(f,T,d[O],S);if(K===null){T===null&&(T=Se);break}e&&T&&K.alternate===null&&t(f,T),a=u(K,a,O),L===null?R=K:L.sibling=K,L=K,T=Se}if(O===d.length)return n(f,T),ie&&Jt(f,O),R;if(T===null){for(;OO?(Se=T,T=null):Se=T.sibling;var Kt=h(f,T,K.value,S);if(Kt===null){T===null&&(T=Se);break}e&&T&&Kt.alternate===null&&t(f,T),a=u(Kt,a,O),L===null?R=Kt:L.sibling=Kt,L=Kt,T=Se}if(K.done)return n(f,T),ie&&Jt(f,O),R;if(T===null){for(;!K.done;O++,K=d.next())K=g(f,K.value,S),K!==null&&(a=u(K,a,O),L===null?R=K:L.sibling=K,L=K);return ie&&Jt(f,O),R}for(T=r(f,T);!K.done;O++,K=d.next())K=E(T,f,O,K.value,S),K!==null&&(e&&K.alternate!==null&&T.delete(K.key===null?O:K.key),a=u(K,a,O),L===null?R=K:L.sibling=K,L=K);return e&&T.forEach(function(Of){return t(f,Of)}),ie&&Jt(f,O),R}function me(f,a,d,S){if(typeof d=="object"&&d!==null&&d.type===Te&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case be:e:{for(var R=d.key,L=a;L!==null;){if(L.key===R){if(R=d.type,R===Te){if(L.tag===7){n(f,L.sibling),a=l(L,d.props.children),a.return=f,f=a;break e}}else if(L.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Me&&rs(R)===L.type){n(f,L.sibling),a=l(L,d.props),a.ref=lr(f,L,d),a.return=f,f=a;break e}n(f,L);break}else t(f,L);L=L.sibling}d.type===Te?(a=on(d.props.children,f.mode,S,d.key),a.return=f,f=a):(S=kl(d.type,d.key,d.props,null,f.mode,S),S.ref=lr(f,a,d),S.return=f,f=S)}return i(f);case ze:e:{for(L=d.key;a!==null;){if(a.key===L)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{n(f,a);break}else t(f,a);a=a.sibling}a=wi(d,f.mode,S),a.return=f,f=a}return i(f);case Me:return L=d._init,me(f,a,L(d._payload),S)}if(On(d))return N(f,a,d,S);if(M(d))return P(f,a,d,S);Zr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(f,a.sibling),a=l(a,d),a.return=f,f=a):(n(f,a),a=gi(d,f.mode,S),a.return=f,f=a),i(f)):n(f,a)}return me}var Cn=ls(!0),us=ls(!1),Jr=jt(null),br=null,_n=null,zu=null;function Ru(){zu=_n=br=null}function Lu(e){var t=Jr.current;le(Jr),e._currentValue=t}function Tu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){br=e,zu=_n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(je=!0),e.firstContext=null)}function Xe(e){var t=e._currentValue;if(zu!==e)if(e={context:e,memoizedValue:t,next:null},_n===null){if(br===null)throw Error(m(308));_n=e,br.dependencies={lanes:0,firstContext:e}}else _n=_n.next=e;return t}var bt=null;function Mu(e){bt===null?bt=[e]:bt.push(e)}function is(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Mu(t)):(n.next=l.next,l.next=n),t.interleaved=n,Et(e,r)}function Et(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ut=!1;function Ou(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function os(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function At(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(H&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Et(e,n)}return l=r.interleaved,l===null?(t.next=t,Mu(r)):(t.next=l.next,l.next=t),r.interleaved=t,Et(e,n)}function el(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yl(e,n)}}function ss(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tl(e,t,n,r){var l=e.updateQueue;Ut=!1;var u=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var s=o,p=s.next;s.next=null,i===null?u=p:i.next=p,i=s;var y=e.alternate;y!==null&&(y=y.updateQueue,o=y.lastBaseUpdate,o!==i&&(o===null?y.firstBaseUpdate=p:o.next=p,y.lastBaseUpdate=s))}if(u!==null){var g=l.baseState;i=0,y=p=s=null,o=u;do{var h=o.lane,E=o.eventTime;if((r&h)===h){y!==null&&(y=y.next={eventTime:E,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var N=e,P=o;switch(h=t,E=n,P.tag){case 1:if(N=P.payload,typeof N=="function"){g=N.call(E,g,h);break e}g=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=P.payload,h=typeof N=="function"?N.call(E,g,h):N,h==null)break e;g=C({},g,h);break e;case 2:Ut=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[o]:h.push(o))}else E={eventTime:E,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},y===null?(p=y=E,s=g):y=y.next=E,i|=h;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;h=o,o=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(y===null&&(s=g),l.baseState=s,l.firstBaseUpdate=p,l.lastBaseUpdate=y,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);nn|=i,e.lanes=i,e.memoizedState=g}}function as(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Uu.transition;Uu.transition={};try{e(!1),t()}finally{X=n,Uu.transition=r}}function zs(){return qe().memoizedState}function nf(e,t,n){var r=$t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e))Ls(t,n);else if(n=is(e,t,n,r),n!==null){var l=Le();ot(n,e,r,l),Ts(n,t,r)}}function rf(e,t,n){var r=$t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))Ls(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(l.hasEagerState=!0,l.eagerState=o,nt(o,i)){var s=t.interleaved;s===null?(l.next=l,Mu(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=is(e,t,l,r),n!==null&&(l=Le(),ot(n,e,r,l),Ts(n,t,r))}}function Rs(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function Ls(e,t){sr=ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ts(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yl(e,n)}}var ol={readContext:Xe,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},lf={readContext:Xe,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:Xe,useEffect:Ss,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ul(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ul(4194308,4,e,t)},useInsertionEffect:function(e,t){return ul(4,2,e,t)},useMemo:function(e,t){var n=mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=nf.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:gs,useDebugValue:Wu,useDeferredValue:function(e){return mt().memoizedState=e},useTransition:function(){var e=gs(!1),t=e[0];return e=tf.bind(null,e[1]),mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,l=mt();if(ie){if(n===void 0)throw Error(m(407));n=n()}else{if(n=t(),we===null)throw Error(m(349));(tn&30)!==0||ps(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Ss(hs.bind(null,r,u,e),[e]),r.flags|=2048,fr(9,ms.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=mt(),t=we.identifierPrefix;if(ie){var n=kt,r=St;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ar++,0")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=o);break}}}finally{I=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?v(e):""}function K(e){switch(e.tag){case 5:return v(e.type);case 16:return v("Lazy");case 13:return v("Suspense");case 19:return v("SuspenseList");case 0:case 2:case 15:return e=A(e.type,!1),e;case 11:return e=A(e.type.render,!1),e;case 1:return e=A(e.type,!0),e;default:return""}}function Y(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Te:return"Fragment";case ze:return"Portal";case Pt:return"Profiler";case We:return"StrictMode";case Ae:return"Suspense";case et:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Yt:return(e.displayName||"Context")+".Consumer";case yt:return(e._context.displayName||"Context")+".Provider";case at:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ct:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case Me:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}function ne(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y(t);case 8:return t===We?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function X(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ve(e){var t=oe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,u.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wr(e){e._valueTracker||(e._valueTracker=Ve(e))}function Ti(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Tl(e,t){var n=t.checked;return C({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=X(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oi(e,t){t=t.checked,t!=null&&Je(e,"checked",t,!1)}function Ml(e,t){Oi(e,t);var n=X(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ol(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ol(e,t.type,X(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Di(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ol(e,t,n){(t!=="number"||Sr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var On=Array.isArray;function sn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=kr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fa=["Webkit","ms","Moz","O"];Object.keys(jn).forEach(function(e){Fa.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jn[t]=jn[e]})});function Vi(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jn.hasOwnProperty(e)&&jn[e]?(""+t).trim():t+"px"}function Bi(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Vi(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ua=C({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Il(e,t){if(t){if(Ua[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(m(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(m(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(m(61))}if(t.style!=null&&typeof t.style!="object")throw Error(m(62))}}function Fl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ul=null;function Al(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vl=null,an=null,cn=null;function Hi(e){if(e=rr(e)){if(typeof Vl!="function")throw Error(m(280));var t=e.stateNode;t&&(t=Qr(t),Vl(e.stateNode,e.type,t))}}function $i(e){an?cn?cn.push(e):cn=[e]:an=e}function Qi(){if(an){var e=an,t=cn;if(cn=an=null,Hi(e),t)for(e=0;e>>=0,e===0?32:31-(Xa(e)/Ga|0)|0}var Nr=64,Pr=4194304;function An(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=An(o):(u&=i,u!==0&&(r=An(u)))}else i=n&~l,i!==0?r=An(i):u!==0&&(r=An(u));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=n}function ec(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=qn),wo=" ",So=!1;function ko(e,t){switch(e){case"keyup":return zc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pn=!1;function Lc(e,t){switch(e){case"compositionend":return Eo(t);case"keypress":return t.which!==32?null:(So=!0,wo);case"textInput":return e=t.data,e===wo&&So?null:e;default:return null}}function Tc(e,t){if(pn)return e==="compositionend"||!lu&&ko(e,t)?(e=po(),Or=Jl=Mt=null,pn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ro(n)}}function To(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?To(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mo(){for(var e=window,t=Sr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sr(e.document)}return t}function ou(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Vc(e){var t=Mo(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&To(n.ownerDocument.documentElement,n)){if(r!==null&&ou(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=Lo(n,u);var i=Lo(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,mn=null,su=null,Jn=null,au=!1;function Oo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;au||mn==null||mn!==Sr(r)||(r=mn,"selectionStart"in r&&ou(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jn&&Zn(Jn,r)||(Jn=r,r=Br(su,"onSelect"),0wn||(e.current=ku[wn],ku[wn]=null,wn--)}function re(e,t){wn++,ku[wn]=e.current,e.current=t}var It={},Ce=jt(It),Oe=jt(!1),Gt=It;function Sn(e,t){var n=e.type.contextTypes;if(!n)return It;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function De(e){return e=e.childContextTypes,e!=null}function Wr(){ie(Oe),ie(Ce)}function qo(e,t,n){if(Ce.current!==It)throw Error(m(168));re(Ce,t),re(Oe,n)}function Xo(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(m(108,ne(e)||"Unknown",l));return C({},n,r)}function Kr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||It,Gt=Ce.current,re(Ce,e),re(Oe,Oe.current),!0}function Go(e,t,n){var r=e.stateNode;if(!r)throw Error(m(169));n?(e=Xo(e,t,Gt),r.__reactInternalMemoizedMergedChildContext=e,ie(Oe),ie(Ce),re(Ce,e)):ie(Oe),re(Oe,n)}var wt=null,Yr=!1,Eu=!1;function Zo(e){wt===null?wt=[e]:wt.push(e)}function Jc(e){Yr=!0,Zo(e)}function Ft(){if(!Eu&&wt!==null){Eu=!0;var e=0,t=G;try{var n=wt;for(G=1;e>=i,l-=i,St=1<<32-tt(t)+l|n<O?(Se=T,T=null):Se=T.sibling;var q=h(f,T,d[O],S);if(q===null){T===null&&(T=Se);break}e&&T&&q.alternate===null&&t(f,T),a=u(q,a,O),L===null?z=q:L.sibling=q,L=q,T=Se}if(O===d.length)return n(f,T),se&&Jt(f,O),z;if(T===null){for(;OO?(Se=T,T=null):Se=T.sibling;var Kt=h(f,T,q.value,S);if(Kt===null){T===null&&(T=Se);break}e&&T&&Kt.alternate===null&&t(f,T),a=u(Kt,a,O),L===null?z=Kt:L.sibling=Kt,L=Kt,T=Se}if(q.done)return n(f,T),se&&Jt(f,O),z;if(T===null){for(;!q.done;O++,q=d.next())q=g(f,q.value,S),q!==null&&(a=u(q,a,O),L===null?z=q:L.sibling=q,L=q);return se&&Jt(f,O),z}for(T=r(f,T);!q.done;O++,q=d.next())q=E(T,f,O,q.value,S),q!==null&&(e&&q.alternate!==null&&T.delete(q.key===null?O:q.key),a=u(q,a,O),L===null?z=q:L.sibling=q,L=q);return e&&T.forEach(function(Of){return t(f,Of)}),se&&Jt(f,O),z}function me(f,a,d,S){if(typeof d=="object"&&d!==null&&d.type===Te&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case be:e:{for(var z=d.key,L=a;L!==null;){if(L.key===z){if(z=d.type,z===Te){if(L.tag===7){n(f,L.sibling),a=l(L,d.props.children),a.return=f,f=a;break e}}else if(L.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===Me&&rs(z)===L.type){n(f,L.sibling),a=l(L,d.props),a.ref=lr(f,L,d),a.return=f,f=a;break e}n(f,L);break}else t(f,L);L=L.sibling}d.type===Te?(a=on(d.props.children,f.mode,S,d.key),a.return=f,f=a):(S=kl(d.type,d.key,d.props,null,f.mode,S),S.ref=lr(f,a,d),S.return=f,f=S)}return i(f);case ze:e:{for(L=d.key;a!==null;){if(a.key===L)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{n(f,a);break}else t(f,a);a=a.sibling}a=wi(d,f.mode,S),a.return=f,f=a}return i(f);case Me:return L=d._init,me(f,a,L(d._payload),S)}if(On(d))return _(f,a,d,S);if(M(d))return P(f,a,d,S);Zr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(f,a.sibling),a=l(a,d),a.return=f,f=a):(n(f,a),a=gi(d,f.mode,S),a.return=f,f=a),i(f)):n(f,a)}return me}var Cn=ls(!0),us=ls(!1),Jr=jt(null),br=null,_n=null,zu=null;function Ru(){zu=_n=br=null}function Lu(e){var t=Jr.current;ie(Jr),e._currentValue=t}function Tu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){br=e,zu=_n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(je=!0),e.firstContext=null)}function qe(e){var t=e._currentValue;if(zu!==e)if(e={context:e,memoizedValue:t,next:null},_n===null){if(br===null)throw Error(m(308));_n=e,br.dependencies={lanes:0,firstContext:e}}else _n=_n.next=e;return t}var bt=null;function Mu(e){bt===null?bt=[e]:bt.push(e)}function is(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Mu(t)):(n.next=l.next,l.next=n),t.interleaved=n,Et(e,r)}function Et(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ut=!1;function Ou(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function os(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function At(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Q&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Et(e,n)}return l=r.interleaved,l===null?(t.next=t,Mu(r)):(t.next=l.next,l.next=t),r.interleaved=t,Et(e,n)}function el(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yl(e,n)}}function ss(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function tl(e,t,n,r){var l=e.updateQueue;Ut=!1;var u=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var s=o,p=s.next;s.next=null,i===null?u=p:i.next=p,i=s;var y=e.alternate;y!==null&&(y=y.updateQueue,o=y.lastBaseUpdate,o!==i&&(o===null?y.firstBaseUpdate=p:o.next=p,y.lastBaseUpdate=s))}if(u!==null){var g=l.baseState;i=0,y=p=s=null,o=u;do{var h=o.lane,E=o.eventTime;if((r&h)===h){y!==null&&(y=y.next={eventTime:E,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var _=e,P=o;switch(h=t,E=n,P.tag){case 1:if(_=P.payload,typeof _=="function"){g=_.call(E,g,h);break e}g=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=P.payload,h=typeof _=="function"?_.call(E,g,h):_,h==null)break e;g=C({},g,h);break e;case 2:Ut=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[o]:h.push(o))}else E={eventTime:E,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},y===null?(p=y=E,s=g):y=y.next=E,i|=h;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;h=o,o=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(y===null&&(s=g),l.baseState=s,l.firstBaseUpdate=p,l.lastBaseUpdate=y,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);nn|=i,e.lanes=i,e.memoizedState=g}}function as(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Uu.transition;Uu.transition={};try{e(!1),t()}finally{G=n,Uu.transition=r}}function zs(){return Xe().memoizedState}function nf(e,t,n){var r=$t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e))Ls(t,n);else if(n=is(e,t,n,r),n!==null){var l=Le();ot(n,e,r,l),Ts(n,t,r)}}function rf(e,t,n){var r=$t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))Ls(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,o=u(i,n);if(l.hasEagerState=!0,l.eagerState=o,nt(o,i)){var s=t.interleaved;s===null?(l.next=l,Mu(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=is(e,t,l,r),n!==null&&(l=Le(),ot(n,e,r,l),Ts(n,t,r))}}function Rs(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function Ls(e,t){sr=ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ts(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yl(e,n)}}var ol={readContext:qe,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},lf={readContext:qe,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:Ss,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ul(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ul(4194308,4,e,t)},useInsertionEffect:function(e,t){return ul(4,2,e,t)},useMemo:function(e,t){var n=mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=nf.bind(null,ce,e),[r.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:gs,useDebugValue:Wu,useDeferredValue:function(e){return mt().memoizedState=e},useTransition:function(){var e=gs(!1),t=e[0];return e=tf.bind(null,e[1]),mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ce,l=mt();if(se){if(n===void 0)throw Error(m(407));n=n()}else{if(n=t(),we===null)throw Error(m(349));(tn&30)!==0||ps(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Ss(hs.bind(null,r,u,e),[e]),r.flags|=2048,fr(9,ms.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=mt(),t=we.identifierPrefix;if(se){var n=kt,r=St;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ar++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[dt]=t,e[nr]=r,Zs(e,t,!1,!1),t.stateNode=e;e:{switch(i=Fl(n,r),n){case"dialog":re("cancel",e),re("close",e),l=r;break;case"iframe":case"object":case"embed":re("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,dr(u,!1),t.lanes=4194304)}else{if(!r)if(e=nl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!i.alternate&&!ie)return Ne(t),null}else 2*pe()-u.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,dr(u,!1),t.lanes=4194304);u.isBackwards?(i.sibling=t.child,t.child=i):(n=u.last,n!==null?n.sibling=i:t.child=i,u.last=i)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=pe(),t.sibling=null,n=se.current,te(se,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return hi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Qe&1073741824)!==0&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(m(156,t.tag))}function pf(e,t){switch(Cu(t),t.tag){case 1:return De(t.type)&&Wr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(),le(Oe),le(Ce),Fu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ju(t),null;case 13:if(le(se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(m(340));xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(se),null;case 4:return Pn(),null;case 10:return Lu(t.type._context),null;case 22:case 23:return hi(),null;case 24:return null;default:return null}}var fl=!1,Pe=!1,mf=typeof WeakSet=="function"?WeakSet:Set,x=null;function Rn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){fe(e,t,r)}else n.current=null}function ri(e,t,n){try{n()}catch(r){fe(e,t,r)}}var ea=!1;function hf(e,t){if(hu=Tr,e=Mo(),ou(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var i=0,o=-1,s=-1,p=0,y=0,g=e,h=null;t:for(;;){for(var E;g!==n||l!==0&&g.nodeType!==3||(o=i+l),g!==u||r!==0&&g.nodeType!==3||(s=i+r),g.nodeType===3&&(i+=g.nodeValue.length),(E=g.firstChild)!==null;)h=g,g=E;for(;;){if(g===e)break t;if(h===n&&++p===l&&(o=i),h===u&&++y===r&&(s=i),(E=g.nextSibling)!==null)break;g=h,h=g.parentNode}g=E}n=o===-1||s===-1?null:{start:o,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},Tr=!1,x=t;x!==null;)if(t=x,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,x=e;else for(;x!==null;){t=x;try{var N=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var P=N.memoizedProps,me=N.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?P:lt(t.type,P),me);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(m(163))}}catch(S){fe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,x=e;break}x=t.return}return N=ea,ea=!1,N}function pr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&ri(t,n,u)}l=l.next}while(l!==r)}}function dl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function li(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ta(e){var t=e.alternate;t!==null&&(e.alternate=null,ta(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dt],delete t[nr],delete t[Su],delete t[Gc],delete t[Zc])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function na(e){return e.tag===5||e.tag===3||e.tag===4}function ra(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||na(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ui(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$r));else if(r!==4&&(e=e.child,e!==null))for(ui(e,t,n),e=e.sibling;e!==null;)ui(e,t,n),e=e.sibling}function ii(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ii(e,t,n),e=e.sibling;e!==null;)ii(e,t,n),e=e.sibling}var ke=null,ut=!1;function Vt(e,t,n){for(n=n.child;n!==null;)la(e,t,n),n=n.sibling}function la(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(_r,n)}catch{}switch(n.tag){case 5:Pe||Rn(n,t);case 6:var r=ke,l=ut;ke=null,Vt(e,t,n),ke=r,ut=l,ke!==null&&(ut?(e=ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ke.removeChild(n.stateNode));break;case 18:ke!==null&&(ut?(e=ke,n=n.stateNode,e.nodeType===8?wu(e.parentNode,n):e.nodeType===1&&wu(e,n),Wn(e)):wu(ke,n.stateNode));break;case 4:r=ke,l=ut,ke=n.stateNode.containerInfo,ut=!0,Vt(e,t,n),ke=r,ut=l;break;case 0:case 11:case 14:case 15:if(!Pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,i=u.destroy;u=u.tag,i!==void 0&&((u&2)!==0||(u&4)!==0)&&ri(n,t,i),l=l.next}while(l!==r)}Vt(e,t,n);break;case 1:if(!Pe&&(Rn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){fe(n,t,o)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(Pe=(r=Pe)||n.memoizedState!==null,Vt(e,t,n),Pe=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function ua(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mf),t.forEach(function(r){var l=Cf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~u}if(r=l,r=pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yf(r/1960))-r,10e?16:e,Ht===null)var r=!1;else{if(e=Ht,Ht=null,yl=0,(H&6)!==0)throw Error(m(331));var l=H;for(H|=4,x=e.current;x!==null;){var u=x,i=u.child;if((x.flags&16)!==0){var o=u.deletions;if(o!==null){for(var s=0;spe()-ai?ln(e,0):si|=n),Fe(e,t)}function ga(e,t){t===0&&((e.mode&1)===0?t=1:(t=Pr,Pr<<=1,(Pr&130023424)===0&&(Pr=4194304)));var n=Le();e=Et(e,t),e!==null&&(Vn(e,t,n),Fe(e,n))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ga(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(m(314))}r!==null&&r.delete(t),ga(e,n)}var wa;wa=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)je=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return je=!1,ff(e,t,n);je=(e.flags&131072)!==0}else je=!1,ie&&(t.flags&1048576)!==0&&Jo(t,qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cl(e,t),e=t.pendingProps;var l=Sn(t,Ce.current);Nn(t,n),l=Vu(null,t,r,e,l,n);var u=Bu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,De(r)?(u=!0,Kr(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ou(t),l.updater=sl,t.stateNode=l,l._reactInternals=t,Yu(t,r,e,n),t=Zu(null,t,r,!0,u,n)):(t.tag=0,ie&&u&&xu(t),Re(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Nf(r),e=lt(r,e),l){case 0:t=Gu(null,t,r,e,n);break e;case 1:t=Ws(null,t,r,e,n);break e;case 11:t=Vs(null,t,r,e,n);break e;case 14:t=Bs(null,t,r,lt(r.type,e),n);break e}throw Error(m(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Gu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Ws(e,t,r,l,n);case 3:e:{if(Ks(t),e===null)throw Error(m(387));r=t.pendingProps,u=t.memoizedState,l=u.element,os(e,t),tl(t,r,null,n);var i=t.memoizedState;if(r=i.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=zn(Error(m(423)),t),t=Ys(e,t,r,n,l);break e}else if(r!==l){l=zn(Error(m(424)),t),t=Ys(e,t,r,n,l);break e}else for($e=Dt(t.stateNode.containerInfo.firstChild),He=t,ie=!0,rt=null,n=us(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xn(),r===l){t=Ct(e,t,n);break e}Re(e,t,r,n)}t=t.child}return t;case 5:return cs(t),e===null&&Nu(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,i=l.children,yu(r,l)?i=null:u!==null&&yu(r,u)&&(t.flags|=32),Qs(e,t),Re(e,t,i,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return Xs(e,t,n);case 4:return Du(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Cn(t,null,r,n):Re(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Vs(e,t,r,l,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,i=l.value,te(Jr,r._currentValue),r._currentValue=i,u!==null)if(nt(u.value,i)){if(u.children===l.children&&!Oe.current){t=Ct(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var o=u.dependencies;if(o!==null){i=u.child;for(var s=o.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=xt(-1,n&-n),s.tag=2;var p=u.updateQueue;if(p!==null){p=p.shared;var y=p.pending;y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),Tu(u.return,n,t),o.lanes|=n;break}s=s.next}}else if(u.tag===10)i=u.type===t.type?null:u.child;else if(u.tag===18){if(i=u.return,i===null)throw Error(m(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Tu(i,n,t),i=u.sibling}else i=u.child;if(i!==null)i.return=u;else for(i=u;i!==null;){if(i===t){i=null;break}if(u=i.sibling,u!==null){u.return=i.return,i=u;break}i=i.return}u=i}Re(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=Xe(l),r=r(l),t.flags|=1,Re(e,t,r,n),t.child;case 14:return r=t.type,l=lt(r,t.pendingProps),l=lt(r.type,l),Bs(e,t,r,l,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),cl(e,t),t.tag=1,De(r)?(e=!0,Kr(t)):e=!1,Nn(t,n),Os(t,r,l),Yu(t,r,l,n),Zu(null,t,r,!0,e,n);case 19:return Gs(e,t,n);case 22:return $s(e,t,n)}throw Error(m(156,t.tag))};function Sa(e,t){return Ji(e,t)}function _f(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new _f(e,t,n,r)}function yi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nf(e){if(typeof e=="function")return yi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===at)return 11;if(e===ct)return 14}return 2}function Wt(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function kl(e,t,n,r,l,u){var i=2;if(r=e,typeof e=="function")yi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Te:return on(n.children,l,u,t);case We:i=8,l|=8;break;case Pt:return e=Ze(12,n,t,l|2),e.elementType=Pt,e.lanes=u,e;case Ae:return e=Ze(13,n,t,l),e.elementType=Ae,e.lanes=u,e;case et:return e=Ze(19,n,t,l),e.elementType=et,e.lanes=u,e;case ce:return El(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yt:i=10;break e;case Yt:i=9;break e;case at:i=11;break e;case ct:i=14;break e;case Me:i=16,r=null;break e}throw Error(m(130,e==null?e:typeof e,""))}return t=Ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function on(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=ce,e.lanes=n,e.stateNode={isHidden:!1},e}function gi(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function wi(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kl(0),this.expirationTimes=Kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Si(e,t,n,r,l,u,i,o,s){return e=new Pf(e,t,n,o,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Ze(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ou(u),e}function zf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w)}catch(z){console.error(z)}}return w(),Pi.exports=Bf(),Pi.exports}var Da;function $f(){if(Da)return Rl;Da=1;var w=Hf();return Rl.createRoot=w.createRoot,Rl.hydrateRoot=w.hydrateRoot,Rl}var Qf=$f();const Ia={schemaVersion:1,revision:0,draft:{id:"browser-preview",text:"",contextMode:"branch",sendMode:"enter_to_send",restored:!1},context:{anchor:null,items:[],totalTokens:0,reviewAvailable:!1},route:{mode:"ollama",provider:"Ollama",modelId:"",modelLabel:"Select a model",modelOptions:[],reasoning:{level:"Thinking",label:"Thinking",options:[{id:"Quick",label:"Quick",description:"Direct responses with less deliberation."},{id:"Thinking",label:"Thinking",description:"More deliberate reasoning for complex requests."}]},label:"Local · Ollama",available:!0,canChange:!1},request:{id:null,state:"idle",message:"",canSend:!1,canCancel:!1,canRetry:!1},capabilities:{attachments:!0,contextReview:!0,routeSelection:!0,modelSelection:!0,reasoningSelection:!0,settingsShortcut:!0,cancellation:!0},theme:{mode:"dark",accent:"#a0a0a0",surface:"#1d1d1d"}};function Wf(w){try{const z=JSON.parse(w);return(z==null?void 0:z.schemaVersion)!==1||!z.draft||!z.request?null:z}catch{return null}}class Kf{constructor(z){Ci(this,"state",structuredClone(Ia));Ci(this,"listener");this.listener=z}ready(){this.listener(this.state)}updateDraft(z){this.state={...this.state,revision:this.state.revision+1,draft:{...this.state.draft,text:z},request:{...this.state.request,canSend:z.trim().length>0||this.state.context.reviewAvailable}},this.listener(this.state)}send(){this.state.request.canSend&&(this.state={...this.state,revision:this.state.revision+1,request:{...this.state.request,id:"preview-request",state:"generating",message:"Preview mode — waiting for the desktop bridge",canSend:!1,canCancel:!0}},this.listener(this.state))}cancel(){this.state={...this.state,revision:this.state.revision+1,request:{...this.state.request,id:null,state:"canceled",message:"Request canceled",canSend:!0,canCancel:!1}},this.listener(this.state)}reviewContext(){}requestAttachment(){}removeContextItem(){}selectModel(z){const m=this.state.route.modelOptions.find(B=>B.id===z);this.state={...this.state,revision:this.state.revision+1,route:{...this.state.route,modelId:z,modelValue:z,modelLabel:(m==null?void 0:m.label)||z,modelOptions:this.state.route.modelOptions.map(B=>({...B,active:B.id===z}))}},this.listener(this.state)}setReasoningLevel(z){const m=z.toLowerCase()==="thinking"?"Thinking":"Quick";this.state={...this.state,revision:this.state.revision+1,route:{...this.state.route,reasoning:{...this.state.route.reasoning,level:m,label:m}}},this.listener(this.state)}openSettings(){}openModelSelector(){}openReasoningSelector(){}resize(){}dispose(){}}function Yf(w){var $;const z=new Kf(w),m=window;if(!m.QWebChannel||!(($=m.qt)!=null&&$.webChannelTransport))return z;let B=null,A=!1,D=null;const G=j=>{const Z=Wf(j);Z&&w(Z)};new m.QWebChannel(m.qt.webChannelTransport,j=>{B=j.objects.composerBridge,B.stateChanged.connect(G),A=!0,B.ready(),D!==null&&B.resize(D)});const V=(j,...Z)=>{A&&B&&typeof B[j]=="function"&&B[j](...Z)};return{ready:()=>V("ready"),updateDraft:j=>V("updateDraft",j),send:()=>V("send"),cancel:j=>V("cancel",j),reviewContext:()=>V("reviewContext"),requestAttachment:()=>V("requestAttachment"),removeContextItem:j=>V("removeContextItem",j),selectModel:j=>V("selectModel",j),setReasoningLevel:j=>V("setReasoningLevel",j),openSettings:()=>V("openSettings"),openModelSelector:()=>V("openModelSelector"),openReasoningSelector:()=>V("openReasoningSelector"),resize:j=>{D=j,V("resize",j)},dispose:()=>{var j,Z;(Z=B==null?void 0:(j=B.stateChanged).disconnect)==null||Z.call(j,G),B=null}}}function ja(w){return w.request.state==="idle"?"":w.request.message||w.request.state}function Xf(w){return["preparing","uploading","waiting","generating","finalizing"].includes(w.request.state)}function Ll({name:w}){const z={attach:"M12 5.5 6.4 11.1a3.6 3.6 0 0 0 5.1 5.1l6-6a2.5 2.5 0 0 0-3.5-3.5l-6.1 6.1a1.35 1.35 0 0 0 1.9 1.9l5.5-5.5",send:"M3.5 4.6 20.5 12 3.5 19.4l2.2-6.2L15 12 5.7 10.8 3.5 4.6Z",stop:"M6.5 6.5h11v11h-11z",chevron:"m7 10 5 5 5-5"};return q.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"icon",children:q.jsx("path",{d:z[w]})})}function qf(){const[w,z]=Nt.useState(Ia),m=Nt.useRef(null),B=Nt.useRef(null),A=Nt.useRef(null),D=Xf(w),G=w.context.items.length;Nt.useEffect(()=>{const _=Yf(z);return m.current=_,_.ready(),()=>{_.dispose(),m.current=null}},[]),Nt.useEffect(()=>{const _=B.current;if(!_)return;const oe=()=>{var J;(J=m.current)==null||J.resize(Math.ceil(_.getBoundingClientRect().height))},de=typeof ResizeObserver>"u"?null:new ResizeObserver(oe);return de==null||de.observe(_),oe(),()=>de==null?void 0:de.disconnect()},[]),Nt.useLayoutEffect(()=>{const _=A.current;_&&(_.style.height="auto",_.style.height=`${Math.max(42,Math.min(160,_.scrollHeight))}px`)},[w.draft.text]);const V=w.request.canSend&&!D,$=Nt.useMemo(()=>w.route.modelId?w.route.label+" · "+w.route.modelId:w.route.label,[w.route.label,w.route.modelId,w.route.modelLabel]),j=w.route.modelLabel||w.route.modelId||"Select a model";function Z(){var _,oe;D?(_=m.current)==null||_.cancel(w.request.id||void 0):V&&((oe=m.current)==null||oe.send())}function ne(_){const oe=w.draft.sendMode==="enter_to_send"&&_.key==="Enter"&&!_.shiftKey,de=w.draft.sendMode==="ctrl_enter_to_send"&&_.key==="Enter"&&(_.ctrlKey||_.metaKey);(oe||de)&&(_.preventDefault(),Z())}return q.jsxs("main",{ref:B,className:"composer-shell","data-request-state":w.request.state,children:[q.jsx("div",{className:"input-wrap",children:q.jsx("textarea",{ref:A,value:w.draft.text,onChange:_=>{var oe;return(oe=m.current)==null?void 0:oe.updateDraft(_.target.value)},onKeyDown:ne,placeholder:"Ask about this graph…","aria-label":"Message composer",rows:1,spellCheck:!0,disabled:D})}),q.jsxs("footer",{className:"composer-footer",children:[q.jsxs("div",{className:"footer-left",children:[q.jsxs("div",{className:"attachment-control",children:[q.jsx("button",{className:"attach-button",type:"button",onClick:()=>{var _;return(_=m.current)==null?void 0:_.requestAttachment()},disabled:!w.capabilities.attachments||D,"aria-label":"Attach context",title:"Attach context",children:q.jsx(Ll,{name:"attach"})}),G>0&&q.jsx("button",{className:"attachment-count",type:"button",onClick:()=>{var _;return(_=m.current)==null?void 0:_.reviewContext()},disabled:!w.capabilities.contextReview||D,"aria-haspopup":"dialog","aria-label":`Review ${G} attached ${G===1?"item":"items"}`,title:`Review ${G} attached ${G===1?"item":"items"}`,children:G})]}),w.draft.restored&&q.jsx("span",{className:"restored-pill",children:"Restored draft"})]}),q.jsxs("div",{className:"footer-right",children:[q.jsxs("button",{className:"composer-control reasoning-control",type:"button",disabled:!w.capabilities.reasoningSelection||D,"aria-haspopup":"dialog",onClick:()=>{var _;return(_=m.current)==null?void 0:_.openReasoningSelector()},title:"Choose reasoning level",children:[q.jsx("span",{className:"control-kicker",children:"Reasoning"}),q.jsx("span",{className:"control-value",children:w.route.reasoning.label}),q.jsx(Ll,{name:"chevron"})]}),q.jsxs("button",{className:"composer-control model-control",type:"button",disabled:!w.capabilities.modelSelection||!w.route.canChange||D,"aria-haspopup":"dialog",onClick:()=>{var _;return(_=m.current)==null?void 0:_.openModelSelector()},title:$,children:[q.jsxs("span",{className:"control-copy",children:[q.jsx("span",{className:"control-kicker",children:w.route.provider}),q.jsx("span",{className:"control-value",title:j,children:j})]}),q.jsx(Ll,{name:"chevron"})]}),q.jsx("button",{className:"send-button "+(D?"cancel":""),type:"button",onClick:Z,disabled:!D&&!V,"aria-label":D?"Cancel response":"Send message",title:D?"Cancel response":"Send message",children:q.jsx(Ll,{name:D?"stop":"send"})})]})]}),!!ja(w)&&q.jsxs("div",{className:"request-status "+w.request.state,role:"status",children:[q.jsx("span",{children:ja(w)}),w.request.canRetry&&q.jsx("button",{type:"button",onClick:()=>{var _;return(_=m.current)==null?void 0:_.send()},children:"Retry"})]})]})}Qf.createRoot(document.getElementById("root")).render(q.jsx(Nt.StrictMode,{children:q.jsx(qf,{})})); +`+u.stack}return{value:e,source:t,stack:l,digest:null}}function qu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var sf=typeof WeakMap=="function"?WeakMap:Map;function js(e,t,n){n=xt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,ci=r),Xu(e,t)},n}function Is(e,t,n){n=xt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Xu(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){Xu(e,t),typeof r!="function"&&(Bt===null?Bt=new Set([this]):Bt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Fs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sf;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Ef.bind(null,e,t,n),t.then(e,e))}function Us(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function As(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=xt(-1,1),t.tag=2,At(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var af=xe.ReactCurrentOwner,je=!1;function Re(e,t,n,r){t.child=e===null?us(t,null,n,r):Cn(t,e.child,n,r)}function Vs(e,t,n,r,l){n=n.render;var u=t.ref;return Nn(t,l),r=Vu(e,t,n,r,u,l),n=Bu(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ct(e,t,l)):(se&&n&&xu(t),t.flags|=1,Re(e,t,r,l),t.child)}function Bs(e,t,n,r,l){if(e===null){var u=n.type;return typeof u=="function"&&!yi(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,Hs(e,t,u,r,l)):(e=kl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&l)===0){var i=u.memoizedProps;if(n=n.compare,n=n!==null?n:Zn,n(i,r)&&e.ref===t.ref)return Ct(e,t,l)}return t.flags|=1,e=Wt(u,r),e.ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,l){if(e!==null){var u=e.memoizedProps;if(Zn(u,r)&&e.ref===t.ref)if(je=!1,t.pendingProps=r=u,(e.lanes&l)!==0)(e.flags&131072)!==0&&(je=!0);else return t.lanes=e.lanes,Ct(e,t,l)}return Gu(e,t,n,r,l)}function $s(e,t,n){var r=t.pendingProps,l=r.children,u=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},re(Ln,Qe),Qe|=n;else{if((n&1073741824)===0)return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,re(Ln,Qe),Qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=u!==null?u.baseLanes:n,re(Ln,Qe),Qe|=r}else u!==null?(r=u.baseLanes|n,t.memoizedState=null):r=n,re(Ln,Qe),Qe|=r;return Re(e,t,l,n),t.child}function Qs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gu(e,t,n,r,l){var u=De(n)?Gt:Ce.current;return u=Sn(t,u),Nn(t,l),n=Vu(e,t,n,r,u,l),r=Bu(),e!==null&&!je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ct(e,t,l)):(se&&r&&xu(t),t.flags|=1,Re(e,t,n,l),t.child)}function Ws(e,t,n,r,l){if(De(n)){var u=!0;Kr(t)}else u=!1;if(Nn(t,l),t.stateNode===null)cl(e,t),Os(t,n,r),Yu(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var s=i.context,p=n.contextType;typeof p=="object"&&p!==null?p=qe(p):(p=De(n)?Gt:Ce.current,p=Sn(t,p));var y=n.getDerivedStateFromProps,g=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function";g||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||s!==p)&&Ds(t,i,r,p),Ut=!1;var h=t.memoizedState;i.state=h,tl(t,r,i,l),s=t.memoizedState,o!==r||h!==s||Oe.current||Ut?(typeof y=="function"&&(Ku(t,n,y,r),s=t.memoizedState),(o=Ut||Ms(t,n,o,r,h,s,p))?(g||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=p,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,os(e,t),o=t.memoizedProps,p=t.type===t.elementType?o:lt(t.type,o),i.props=p,g=t.pendingProps,h=i.context,s=n.contextType,typeof s=="object"&&s!==null?s=qe(s):(s=De(n)?Gt:Ce.current,s=Sn(t,s));var E=n.getDerivedStateFromProps;(y=typeof E=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==g||h!==s)&&Ds(t,i,r,s),Ut=!1,h=t.memoizedState,i.state=h,tl(t,r,i,l);var _=t.memoizedState;o!==g||h!==_||Oe.current||Ut?(typeof E=="function"&&(Ku(t,n,E,r),_=t.memoizedState),(p=Ut||Ms(t,n,p,r,h,_,s)||!1)?(y||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,_,s),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,_,s)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=_),i.props=r,i.state=_,i.context=s,r=p):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Zu(e,t,n,r,u,l)}function Zu(e,t,n,r,l,u){Qs(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&Go(t,n,!1),Ct(e,t,u);r=t.stateNode,af.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Cn(t,e.child,null,u),t.child=Cn(t,null,o,u)):Re(e,t,o,u),t.memoizedState=r.state,l&&Go(t,n,!0),t.child}function Ks(e){var t=e.stateNode;t.pendingContext?qo(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qo(e,t.context,!1),Du(e,t.containerInfo)}function Ys(e,t,n,r,l){return xn(),Pu(l),t.flags|=256,Re(e,t,n,r),t.child}var Ju={dehydrated:null,treeContext:null,retryLane:0};function bu(e){return{baseLanes:e,cachePool:null,transitions:null}}function qs(e,t,n){var r=t.pendingProps,l=ae.current,u=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),re(ae,l&1),e===null)return Nu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(i=r.children,e=r.fallback,u?(r=t.mode,u=t.child,i={mode:"hidden",children:i},(r&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=i):u=El(i,r,0,null),e=on(e,r,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=bu(n),t.memoizedState=Ju,e):ei(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return cf(e,t,i,r,o,l,n);if(u){u=r.fallback,i=t.mode,l=e.child,o=l.sibling;var s={mode:"hidden",children:r.children};return(i&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=Wt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?u=Wt(o,u):(u=on(u,i,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,i=e.child.memoizedState,i=i===null?bu(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},u.memoizedState=i,u.childLanes=e.childLanes&~n,t.memoizedState=Ju,r}return u=e.child,e=u.sibling,r=Wt(u,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ei(e,t){return t=El({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function al(e,t,n,r){return r!==null&&Pu(r),Cn(t,e.child,null,n),e=ei(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cf(e,t,n,r,l,u,i){if(n)return t.flags&256?(t.flags&=-257,r=qu(Error(m(422))),al(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=r.fallback,l=t.mode,r=El({mode:"visible",children:r.children},l,0,null),u=on(u,l,i,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,(t.mode&1)!==0&&Cn(t,e.child,null,i),t.child.memoizedState=bu(i),t.memoizedState=Ju,u);if((t.mode&1)===0)return al(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,u=Error(m(419)),r=qu(u,r,void 0),al(e,t,i,r)}if(o=(i&e.childLanes)!==0,je||o){if(r=we,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|i))!==0?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,Et(e,l),ot(r,e,l,-1))}return vi(),r=qu(Error(m(421))),al(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=xf.bind(null,e),l._reactRetry=t,null):(e=u.treeContext,$e=Dt(l.nextSibling),He=t,se=!0,rt=null,e!==null&&(Ke[Ye++]=St,Ke[Ye++]=kt,Ke[Ye++]=Zt,St=e.id,kt=e.overflow,Zt=t),t=ei(t,r.children),t.flags|=4096,t)}function Xs(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tu(e.return,t,n)}function ti(e,t,n,r,l){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=r,u.tail=n,u.tailMode=l)}function Gs(e,t,n){var r=t.pendingProps,l=r.revealOrder,u=r.tail;if(Re(e,t,r.children,n),r=ae.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xs(e,n,t);else if(e.tag===19)Xs(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(re(ae,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&nl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ti(t,!1,l,n,u);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&nl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ti(t,!0,n,null,u);break;case"together":ti(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(m(153));if(t.child!==null){for(e=t.child,n=Wt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ff(e,t,n){switch(t.tag){case 3:Ks(t),xn();break;case 5:cs(t);break;case 1:De(t.type)&&Kr(t);break;case 4:Du(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;re(Jr,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(re(ae,ae.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?qs(e,t,n):(re(ae,ae.current&1),e=Ct(e,t,n),e!==null?e.sibling:null);re(ae,ae.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Gs(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),re(ae,ae.current),r)break;return null;case 22:case 23:return t.lanes=0,$s(e,t,n)}return Ct(e,t,n)}var Zs,ni,Js,bs;Zs=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ni=function(){},Js=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,en(pt.current);var u=null;switch(n){case"input":l=Tl(e,l),r=Tl(e,r),u=[];break;case"select":l=C({},l,{value:void 0}),r=C({},r,{value:void 0}),u=[];break;case"textarea":l=Dl(e,l),r=Dl(e,r),u=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=$r)}Il(n,r);var i;n=null;for(p in l)if(!r.hasOwnProperty(p)&&l.hasOwnProperty(p)&&l[p]!=null)if(p==="style"){var o=l[p];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else p!=="dangerouslySetInnerHTML"&&p!=="children"&&p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(U.hasOwnProperty(p)?u||(u=[]):(u=u||[]).push(p,null));for(p in r){var s=r[p];if(o=l!=null?l[p]:void 0,r.hasOwnProperty(p)&&s!==o&&(s!=null||o!=null))if(p==="style")if(o){for(i in o)!o.hasOwnProperty(i)||s&&s.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in s)s.hasOwnProperty(i)&&o[i]!==s[i]&&(n||(n={}),n[i]=s[i])}else n||(u||(u=[]),u.push(p,n)),n=s;else p==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,o=o?o.__html:void 0,s!=null&&o!==s&&(u=u||[]).push(p,s)):p==="children"?typeof s!="string"&&typeof s!="number"||(u=u||[]).push(p,""+s):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&(U.hasOwnProperty(p)?(s!=null&&p==="onScroll"&&ue("scroll",e),u||o===s||(u=[])):(u=u||[]).push(p,s))}n&&(u=u||[]).push("style",n);var p=u;(t.updateQueue=p)&&(t.flags|=4)}},bs=function(e,t,n,r){n!==r&&(t.flags|=4)};function dr(e,t){if(!se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function df(e,t,n){var r=t.pendingProps;switch(Cu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return De(t.type)&&Wr(),Ne(t),null;case 3:return r=t.stateNode,Pn(),ie(Oe),ie(Ce),Fu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rt!==null&&(pi(rt),rt=null))),ni(e,t),Ne(t),null;case 5:ju(t);var l=en(or.current);if(n=t.type,e!==null&&t.stateNode!=null)Js(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(m(166));return Ne(t),null}if(e=en(pt.current),Gr(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[dt]=t,r[nr]=u,e=(t.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[dt]=t,e[nr]=r,Zs(e,t,!1,!1),t.stateNode=e;e:{switch(i=Fl(n,r),n){case"dialog":ue("cancel",e),ue("close",e),l=r;break;case"iframe":case"object":case"embed":ue("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,dr(u,!1),t.lanes=4194304)}else{if(!r)if(e=nl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!i.alternate&&!se)return Ne(t),null}else 2*pe()-u.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,dr(u,!1),t.lanes=4194304);u.isBackwards?(i.sibling=t.child,t.child=i):(n=u.last,n!==null?n.sibling=i:t.child=i,u.last=i)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=pe(),t.sibling=null,n=ae.current,re(ae,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return hi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Qe&1073741824)!==0&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(m(156,t.tag))}function pf(e,t){switch(Cu(t),t.tag){case 1:return De(t.type)&&Wr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(),ie(Oe),ie(Ce),Fu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ju(t),null;case 13:if(ie(ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(m(340));xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(ae),null;case 4:return Pn(),null;case 10:return Lu(t.type._context),null;case 22:case 23:return hi(),null;case 24:return null;default:return null}}var fl=!1,Pe=!1,mf=typeof WeakSet=="function"?WeakSet:Set,x=null;function Rn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){de(e,t,r)}else n.current=null}function ri(e,t,n){try{n()}catch(r){de(e,t,r)}}var ea=!1;function hf(e,t){if(hu=Tr,e=Mo(),ou(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var i=0,o=-1,s=-1,p=0,y=0,g=e,h=null;t:for(;;){for(var E;g!==n||l!==0&&g.nodeType!==3||(o=i+l),g!==u||r!==0&&g.nodeType!==3||(s=i+r),g.nodeType===3&&(i+=g.nodeValue.length),(E=g.firstChild)!==null;)h=g,g=E;for(;;){if(g===e)break t;if(h===n&&++p===l&&(o=i),h===u&&++y===r&&(s=i),(E=g.nextSibling)!==null)break;g=h,h=g.parentNode}g=E}n=o===-1||s===-1?null:{start:o,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},Tr=!1,x=t;x!==null;)if(t=x,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,x=e;else for(;x!==null;){t=x;try{var _=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var P=_.memoizedProps,me=_.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?P:lt(t.type,P),me);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(m(163))}}catch(S){de(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,x=e;break}x=t.return}return _=ea,ea=!1,_}function pr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&ri(t,n,u)}l=l.next}while(l!==r)}}function dl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function li(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ta(e){var t=e.alternate;t!==null&&(e.alternate=null,ta(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dt],delete t[nr],delete t[Su],delete t[Gc],delete t[Zc])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function na(e){return e.tag===5||e.tag===3||e.tag===4}function ra(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||na(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ui(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$r));else if(r!==4&&(e=e.child,e!==null))for(ui(e,t,n),e=e.sibling;e!==null;)ui(e,t,n),e=e.sibling}function ii(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ii(e,t,n),e=e.sibling;e!==null;)ii(e,t,n),e=e.sibling}var ke=null,ut=!1;function Vt(e,t,n){for(n=n.child;n!==null;)la(e,t,n),n=n.sibling}function la(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(_r,n)}catch{}switch(n.tag){case 5:Pe||Rn(n,t);case 6:var r=ke,l=ut;ke=null,Vt(e,t,n),ke=r,ut=l,ke!==null&&(ut?(e=ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ke.removeChild(n.stateNode));break;case 18:ke!==null&&(ut?(e=ke,n=n.stateNode,e.nodeType===8?wu(e.parentNode,n):e.nodeType===1&&wu(e,n),Wn(e)):wu(ke,n.stateNode));break;case 4:r=ke,l=ut,ke=n.stateNode.containerInfo,ut=!0,Vt(e,t,n),ke=r,ut=l;break;case 0:case 11:case 14:case 15:if(!Pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,i=u.destroy;u=u.tag,i!==void 0&&((u&2)!==0||(u&4)!==0)&&ri(n,t,i),l=l.next}while(l!==r)}Vt(e,t,n);break;case 1:if(!Pe&&(Rn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){de(n,t,o)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(Pe=(r=Pe)||n.memoizedState!==null,Vt(e,t,n),Pe=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function ua(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mf),t.forEach(function(r){var l=Cf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~u}if(r=l,r=pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yf(r/1960))-r,10e?16:e,Ht===null)var r=!1;else{if(e=Ht,Ht=null,yl=0,(Q&6)!==0)throw Error(m(331));var l=Q;for(Q|=4,x=e.current;x!==null;){var u=x,i=u.child;if((x.flags&16)!==0){var o=u.deletions;if(o!==null){for(var s=0;spe()-ai?ln(e,0):si|=n),Fe(e,t)}function ga(e,t){t===0&&((e.mode&1)===0?t=1:(t=Pr,Pr<<=1,(Pr&130023424)===0&&(Pr=4194304)));var n=Le();e=Et(e,t),e!==null&&(Vn(e,t,n),Fe(e,n))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ga(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(m(314))}r!==null&&r.delete(t),ga(e,n)}var wa;wa=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)je=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return je=!1,ff(e,t,n);je=(e.flags&131072)!==0}else je=!1,se&&(t.flags&1048576)!==0&&Jo(t,Xr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cl(e,t),e=t.pendingProps;var l=Sn(t,Ce.current);Nn(t,n),l=Vu(null,t,r,e,l,n);var u=Bu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,De(r)?(u=!0,Kr(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ou(t),l.updater=sl,t.stateNode=l,l._reactInternals=t,Yu(t,r,e,n),t=Zu(null,t,r,!0,u,n)):(t.tag=0,se&&u&&xu(t),Re(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Nf(r),e=lt(r,e),l){case 0:t=Gu(null,t,r,e,n);break e;case 1:t=Ws(null,t,r,e,n);break e;case 11:t=Vs(null,t,r,e,n);break e;case 14:t=Bs(null,t,r,lt(r.type,e),n);break e}throw Error(m(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Gu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Ws(e,t,r,l,n);case 3:e:{if(Ks(t),e===null)throw Error(m(387));r=t.pendingProps,u=t.memoizedState,l=u.element,os(e,t),tl(t,r,null,n);var i=t.memoizedState;if(r=i.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=zn(Error(m(423)),t),t=Ys(e,t,r,n,l);break e}else if(r!==l){l=zn(Error(m(424)),t),t=Ys(e,t,r,n,l);break e}else for($e=Dt(t.stateNode.containerInfo.firstChild),He=t,se=!0,rt=null,n=us(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xn(),r===l){t=Ct(e,t,n);break e}Re(e,t,r,n)}t=t.child}return t;case 5:return cs(t),e===null&&Nu(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,i=l.children,yu(r,l)?i=null:u!==null&&yu(r,u)&&(t.flags|=32),Qs(e,t),Re(e,t,i,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return qs(e,t,n);case 4:return Du(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Cn(t,null,r,n):Re(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),Vs(e,t,r,l,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,i=l.value,re(Jr,r._currentValue),r._currentValue=i,u!==null)if(nt(u.value,i)){if(u.children===l.children&&!Oe.current){t=Ct(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var o=u.dependencies;if(o!==null){i=u.child;for(var s=o.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=xt(-1,n&-n),s.tag=2;var p=u.updateQueue;if(p!==null){p=p.shared;var y=p.pending;y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),Tu(u.return,n,t),o.lanes|=n;break}s=s.next}}else if(u.tag===10)i=u.type===t.type?null:u.child;else if(u.tag===18){if(i=u.return,i===null)throw Error(m(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Tu(i,n,t),i=u.sibling}else i=u.child;if(i!==null)i.return=u;else for(i=u;i!==null;){if(i===t){i=null;break}if(u=i.sibling,u!==null){u.return=i.return,i=u;break}i=i.return}u=i}Re(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=qe(l),r=r(l),t.flags|=1,Re(e,t,r,n),t.child;case 14:return r=t.type,l=lt(r,t.pendingProps),l=lt(r.type,l),Bs(e,t,r,l,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:lt(r,l),cl(e,t),t.tag=1,De(r)?(e=!0,Kr(t)):e=!1,Nn(t,n),Os(t,r,l),Yu(t,r,l,n),Zu(null,t,r,!0,e,n);case 19:return Gs(e,t,n);case 22:return $s(e,t,n)}throw Error(m(156,t.tag))};function Sa(e,t){return Ji(e,t)}function _f(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new _f(e,t,n,r)}function yi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nf(e){if(typeof e=="function")return yi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===at)return 11;if(e===ct)return 14}return 2}function Wt(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function kl(e,t,n,r,l,u){var i=2;if(r=e,typeof e=="function")yi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Te:return on(n.children,l,u,t);case We:i=8,l|=8;break;case Pt:return e=Ze(12,n,t,l|2),e.elementType=Pt,e.lanes=u,e;case Ae:return e=Ze(13,n,t,l),e.elementType=Ae,e.lanes=u,e;case et:return e=Ze(19,n,t,l),e.elementType=et,e.lanes=u,e;case fe:return El(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yt:i=10;break e;case Yt:i=9;break e;case at:i=11;break e;case ct:i=14;break e;case Me:i=16,r=null;break e}throw Error(m(130,e==null?e:typeof e,""))}return t=Ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function on(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=fe,e.lanes=n,e.stateNode={isHidden:!1},e}function gi(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function wi(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kl(0),this.expirationTimes=Kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Si(e,t,n,r,l,u,i,o,s){return e=new Pf(e,t,n,o,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Ze(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ou(u),e}function zf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w)}catch(N){console.error(N)}}return w(),Pi.exports=Bf(),Pi.exports}var Da;function $f(){if(Da)return Rl;Da=1;var w=Hf();return Rl.createRoot=w.createRoot,Rl.hydrateRoot=w.hydrateRoot,Rl}var Qf=$f();const Ia={schemaVersion:1,revision:0,draft:{id:"browser-preview",text:"",contextMode:"branch",sendMode:"enter_to_send",restored:!1},context:{anchor:null,items:[],totalTokens:0,reviewAvailable:!1},route:{mode:"ollama",provider:"Ollama",modelId:"",modelLabel:"Select a model",modelOptions:[],reasoning:{level:"Thinking",label:"Thinking",options:[{id:"Quick",label:"Quick",description:"Direct responses with less deliberation."},{id:"Thinking",label:"Thinking",description:"More deliberate reasoning for complex requests."}]},label:"Local · Ollama",available:!0,canChange:!1},request:{id:null,state:"idle",message:"",canSend:!1,canCancel:!1,canRetry:!1},capabilities:{attachments:!0,contextReview:!0,routeSelection:!0,modelSelection:!0,reasoningSelection:!0,settingsShortcut:!0,cancellation:!0},theme:{mode:"dark",accent:"#a0a0a0",surface:"#1d1d1d"}};function Wf(w){try{const N=JSON.parse(w);return(N==null?void 0:N.schemaVersion)!==1||!N.draft||!N.request?null:N}catch{return null}}class Kf{constructor(N){Ci(this,"state",structuredClone(Ia));Ci(this,"listener");this.listener=N}ready(){this.listener(this.state)}updateDraft(N){this.state={...this.state,revision:this.state.revision+1,draft:{...this.state.draft,text:N},request:{...this.state.request,canSend:N.trim().length>0||this.state.context.reviewAvailable}},this.listener(this.state)}send(){this.state.request.canSend&&(this.state={...this.state,revision:this.state.revision+1,request:{...this.state.request,id:"preview-request",state:"generating",message:"Preview mode — waiting for the desktop bridge",canSend:!1,canCancel:!0}},this.listener(this.state))}cancel(){this.state={...this.state,revision:this.state.revision+1,request:{...this.state.request,id:null,state:"canceled",message:"Request canceled",canSend:!0,canCancel:!1}},this.listener(this.state)}reviewContext(){}requestAttachment(){}stageTextAttachment(N){const m=String(N||"");if(!m.trim())return;const V=m.split(` +`).length,D={id:`paste-${this.state.revision+1}`,name:`Pasted Text (${V} lines).txt`,kind:"document",tokenCount:0,preparationState:"ready",contextLabel:"Text"};this.state={...this.state,revision:this.state.revision+1,context:{...this.state.context,items:[...this.state.context.items,D],reviewAvailable:!0},request:{...this.state.request,canSend:!0}},this.listener(this.state)}removeContextItem(){}selectModel(N){const m=this.state.route.modelOptions.find(V=>V.id===N);this.state={...this.state,revision:this.state.revision+1,route:{...this.state.route,modelId:N,modelValue:N,modelLabel:(m==null?void 0:m.label)||N,modelOptions:this.state.route.modelOptions.map(V=>({...V,active:V.id===N}))}},this.listener(this.state)}setReasoningLevel(N){const m=N.toLowerCase()==="thinking"?"Thinking":"Quick";this.state={...this.state,revision:this.state.revision+1,route:{...this.state.route,reasoning:{...this.state.route.reasoning,level:m,label:m}}},this.listener(this.state)}openSettings(){}openModelSelector(){}openReasoningSelector(){}resize(){}dispose(){}}function Yf(w){var W;const N=new Kf(w),m=window;if(!m.QWebChannel||!((W=m.qt)!=null&&W.webChannelTransport))return N;let V=null,U=!1,D=null;const J=j=>{const ee=Wf(j);ee&&w(ee)};new m.QWebChannel(m.qt.webChannelTransport,j=>{V=j.objects.composerBridge,V.stateChanged.connect(J),U=!0,V.ready(),D!==null&&V.resize(D)});const B=(j,...ee)=>{U&&V&&typeof V[j]=="function"&&V[j](...ee)};return{ready:()=>B("ready"),updateDraft:j=>B("updateDraft",j),send:()=>B("send"),cancel:j=>B("cancel",j),reviewContext:()=>B("reviewContext"),requestAttachment:()=>B("requestAttachment"),stageTextAttachment:j=>B("stageTextAttachment",j),removeContextItem:j=>B("removeContextItem",j),selectModel:j=>B("selectModel",j),setReasoningLevel:j=>B("setReasoningLevel",j),openSettings:()=>B("openSettings"),openModelSelector:()=>B("openModelSelector"),openReasoningSelector:()=>B("openReasoningSelector"),resize:j=>{D=j,B("resize",j)},dispose:()=>{var j,ee;(ee=V==null?void 0:(j=V.stateChanged).disconnect)==null||ee.call(j,J),V=null}}}function ja(w){return w.request.state==="idle"?"":w.request.message||w.request.state}function qf(w){return["preparing","uploading","waiting","generating","finalizing"].includes(w.request.state)}const Xf=1400,Gf=24;function Ll({name:w}){const N={attach:"M12 5.5 6.4 11.1a3.6 3.6 0 0 0 5.1 5.1l6-6a2.5 2.5 0 0 0-3.5-3.5l-6.1 6.1a1.35 1.35 0 0 0 1.9 1.9l5.5-5.5",send:"M3.5 4.6 20.5 12 3.5 19.4l2.2-6.2L15 12 5.7 10.8 3.5 4.6Z",stop:"M6.5 6.5h11v11h-11z",chevron:"m7 10 5 5 5-5"};return Z.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"icon",children:Z.jsx("path",{d:N[w]})})}function Zf(){const[w,N]=Nt.useState(Ia),m=Nt.useRef(null),V=Nt.useRef(null),U=Nt.useRef(null),D=qf(w),J=w.context.items.length;Nt.useEffect(()=>{const R=Yf(N);return m.current=R,R.ready(),()=>{R.dispose(),m.current=null}},[]),Nt.useEffect(()=>{const R=V.current;if(!R)return;const b=()=>{var $;($=m.current)==null||$.resize(Math.ceil(R.getBoundingClientRect().height))},H=typeof ResizeObserver>"u"?null:new ResizeObserver(b);return H==null||H.observe(R),b(),()=>H==null?void 0:H.disconnect()},[]),Nt.useLayoutEffect(()=>{const R=U.current;R&&(R.style.height="auto",R.style.height=`${Math.max(42,Math.min(160,R.scrollHeight))}px`)},[w.draft.text]);const B=w.request.canSend&&!D,W=Nt.useMemo(()=>w.route.modelId?w.route.label+" · "+w.route.modelId:w.route.label,[w.route.label,w.route.modelId,w.route.modelLabel]),j=w.route.modelLabel||w.route.modelId||"Select a model";function ee(){var R,b;D?(R=m.current)==null||R.cancel(w.request.id||void 0):B&&((b=m.current)==null||b.send())}function le(R){const b=w.draft.sendMode==="enter_to_send"&&R.key==="Enter"&&!R.shiftKey,H=w.draft.sendMode==="ctrl_enter_to_send"&&R.key==="Enter"&&(R.ctrlKey||R.metaKey);(b||H)&&(R.preventDefault(),ee())}function te(R){var $;if(D||R.clipboardData.files.length>0)return;const b=R.clipboardData.getData("text/plain"),H=b.length>=Xf||b.split(` +`).length>=Gf;!b.trim()||!H||(R.preventDefault(),($=m.current)==null||$.stageTextAttachment(b))}return Z.jsxs("main",{ref:V,className:"composer-shell","data-request-state":w.request.state,children:[Z.jsx("div",{className:"input-wrap",children:Z.jsx("textarea",{ref:U,value:w.draft.text,onChange:R=>{var b;return(b=m.current)==null?void 0:b.updateDraft(R.target.value)},onKeyDown:le,onPaste:te,placeholder:"Ask about this graph…","aria-label":"Message composer",rows:1,spellCheck:!0,disabled:D})}),Z.jsxs("footer",{className:"composer-footer",children:[Z.jsxs("div",{className:"footer-left",children:[Z.jsxs("div",{className:"attachment-control",children:[Z.jsx("button",{className:"attach-button",type:"button",onClick:()=>{var R;return(R=m.current)==null?void 0:R.requestAttachment()},disabled:!w.capabilities.attachments||D,"aria-label":"Attach context",title:"Attach context",children:Z.jsx(Ll,{name:"attach"})}),J>0&&Z.jsx("button",{className:"attachment-count",type:"button",onClick:()=>{var R;return(R=m.current)==null?void 0:R.reviewContext()},disabled:!w.capabilities.contextReview||D,"aria-haspopup":"dialog","aria-label":`Review ${J} attached ${J===1?"item":"items"}`,title:`Review ${J} attached ${J===1?"item":"items"}`,children:J})]}),w.draft.restored&&Z.jsx("span",{className:"restored-pill",children:"Restored draft"})]}),Z.jsxs("div",{className:"footer-right",children:[Z.jsxs("button",{className:"composer-control reasoning-control",type:"button",disabled:!w.capabilities.reasoningSelection||D,"aria-haspopup":"dialog",onClick:()=>{var R;return(R=m.current)==null?void 0:R.openReasoningSelector()},title:"Choose reasoning level",children:[Z.jsx("span",{className:"control-kicker",children:"Reasoning"}),Z.jsx("span",{className:"control-value",children:w.route.reasoning.label}),Z.jsx(Ll,{name:"chevron"})]}),Z.jsxs("button",{className:"composer-control model-control",type:"button",disabled:!w.capabilities.modelSelection||!w.route.canChange||D,"aria-haspopup":"dialog",onClick:()=>{var R;return(R=m.current)==null?void 0:R.openModelSelector()},title:W,children:[Z.jsxs("span",{className:"control-copy",children:[Z.jsx("span",{className:"control-kicker",children:w.route.provider}),Z.jsx("span",{className:"control-value",title:j,children:j})]}),Z.jsx(Ll,{name:"chevron"})]}),Z.jsx("button",{className:"send-button "+(D?"cancel":""),type:"button",onClick:ee,disabled:!D&&!B,"aria-label":D?"Cancel response":"Send message",title:D?"Cancel response":"Send message",children:Z.jsx(Ll,{name:D?"stop":"send"})})]})]}),!!ja(w)&&Z.jsxs("div",{className:"request-status "+w.request.state,role:"status",children:[Z.jsx("span",{children:ja(w)}),w.request.canRetry&&Z.jsx("button",{type:"button",onClick:()=>{var R;return(R=m.current)==null?void 0:R.send()},children:"Retry"})]})]})}Qf.createRoot(document.getElementById("root")).render(Z.jsx(Nt.StrictMode,{children:Z.jsx(Zf,{})})); diff --git a/assets/composer/index.html b/assets/composer/index.html index c63069c..75270bb 100644 --- a/assets/composer/index.html +++ b/assets/composer/index.html @@ -1,15 +1,14 @@ - - - - - - - Graphlink Composer - + + + + + + + Graphlink Composer + - - -
- - - + + +
+ + diff --git a/composer_ui/src/ComposerApp.tsx b/composer_ui/src/ComposerApp.tsx index 3e4b863..0f2427e 100644 --- a/composer_ui/src/ComposerApp.tsx +++ b/composer_ui/src/ComposerApp.tsx @@ -3,6 +3,9 @@ import { ComposerState, initialComposerState } from "./bridgeTypes"; import { ComposerBridge, createComposerBridge } from "./bridge"; import { isBusy, requestLabel } from "./state"; +const LARGE_PASTE_CHAR_THRESHOLD = 1400; +const LARGE_PASTE_LINE_THRESHOLD = 24; + function Icon({ name }: { name: "attach" | "send" | "stop" | "chevron" }) { const paths: Record = { attach: "M12 5.5 6.4 11.1a3.6 3.6 0 0 0 5.1 5.1l6-6a2.5 2.5 0 0 0-3.5-3.5l-6.1 6.1a1.35 1.35 0 0 0 1.9 1.9l5.5-5.5", @@ -84,6 +87,19 @@ function ComposerApp() { } } + function onPaste(event: React.ClipboardEvent) { + if (isRequestBusy || event.clipboardData.files.length > 0) return; + + const pastedText = event.clipboardData.getData("text/plain"); + const isLargePaste = + pastedText.length >= LARGE_PASTE_CHAR_THRESHOLD || + pastedText.split("\n").length >= LARGE_PASTE_LINE_THRESHOLD; + if (!pastedText.trim() || !isLargePaste) return; + + event.preventDefault(); + bridgeRef.current?.stageTextAttachment(pastedText); + } + return (
bridgeRef.current?.updateDraft(event.target.value)} onKeyDown={onKeyDown} + onPaste={onPaste} placeholder={"Ask about this graph\u2026"} aria-label="Message composer" rows={1} diff --git a/composer_ui/src/bridge.ts b/composer_ui/src/bridge.ts index 187d47c..30434aa 100644 --- a/composer_ui/src/bridge.ts +++ b/composer_ui/src/bridge.ts @@ -15,6 +15,7 @@ interface QtComposerObject { cancel: (requestId?: string) => void; reviewContext: () => void; requestAttachment: () => void; + stageTextAttachment: (text: string) => void; removeContextItem: (itemId: string) => void; selectModel: (modelId: string) => void; setReasoningLevel: (level: string) => void; @@ -39,6 +40,7 @@ export interface ComposerBridge { cancel(requestId?: string): void; reviewContext(): void; requestAttachment(): void; + stageTextAttachment(text: string): void; removeContextItem(itemId: string): void; selectModel(modelId: string): void; setReasoningLevel(level: string): void; @@ -119,6 +121,31 @@ class MockComposerBridge implements ComposerBridge { reviewContext(): void {} requestAttachment(): void {} + stageTextAttachment(text: string): void { + const normalized = String(text || ""); + if (!normalized.trim()) return; + const lineCount = normalized.split("\n").length; + const attachmentId = `paste-${this.state.revision + 1}`; + const attachment = { + id: attachmentId, + name: `Pasted Text (${lineCount} lines).txt`, + kind: "document", + tokenCount: 0, + preparationState: "ready", + contextLabel: "Text", + }; + this.state = { + ...this.state, + revision: this.state.revision + 1, + context: { + ...this.state.context, + items: [...this.state.context.items, attachment], + reviewAvailable: true, + }, + request: { ...this.state.request, canSend: true }, + }; + this.listener(this.state); + } removeContextItem(): void {} selectModel(modelId: string): void { const option = this.state.route.modelOptions.find((item) => item.id === modelId); @@ -203,6 +230,7 @@ export function createComposerBridge(listener: StateListener): ComposerBridge { cancel: (requestId) => call("cancel", requestId), reviewContext: () => call("reviewContext"), requestAttachment: () => call("requestAttachment"), + stageTextAttachment: (text) => call("stageTextAttachment", text), removeContextItem: (itemId) => call("removeContextItem", itemId), selectModel: (modelId) => call("selectModel", modelId), setReasoningLevel: (level) => call("setReasoningLevel", level), diff --git a/graphlink_app/graphlink_composer_bridge.py b/graphlink_app/graphlink_composer_bridge.py index 9e566d1..dcf089c 100644 --- a/graphlink_app/graphlink_composer_bridge.py +++ b/graphlink_app/graphlink_composer_bridge.py @@ -146,6 +146,14 @@ def requestAttachment(self): if callable(attach_file): attach_file() + @Slot(str) + def stageTextAttachment(self, text: str): + """Turn a large pasted text payload into a native context attachment.""" + stage_paste = getattr(self.window, "_handle_large_paste_from_input", None) + if callable(stage_paste): + stage_paste(str(text or "")) + self._publish() + @Slot(str) def removeContextItem(self, item_id: str): path = self._attachment_paths.get(str(item_id or "")) diff --git a/graphlink_app/graphlink_composer_popups.py b/graphlink_app/graphlink_composer_popups.py index 3ad94f2..6b52189 100644 --- a/graphlink_app/graphlink_composer_popups.py +++ b/graphlink_app/graphlink_composer_popups.py @@ -471,11 +471,16 @@ def _request_reposition(self): QTimer.singleShot(0, self._reposition_owner) def _reposition_owner(self): - if not self.isVisible(): + try: + if not self.isVisible(): + return + reposition = getattr(self.parentWidget(), "_position_composer_picker", None) + if callable(reposition): + reposition() + except (AttributeError, RuntimeError, SystemError, TypeError): + # A queued reposition can run after the native popup has begun + # closing. Never call back into a partially destroyed Qt wrapper. return - reposition = getattr(self.parentWidget(), "_position_composer_picker", None) - if callable(reposition): - reposition() def _commit_item(self, item: QListWidgetItem | None): if item is None or not (item.flags() & Qt.ItemFlag.ItemIsEnabled): @@ -494,20 +499,27 @@ def _request_settings(self): self.close() def eventFilter(self, watched, event): - if event.type() == QEvent.Type.MouseButtonPress: - global_position = event.globalPosition().toPoint() - if not self.rect().contains(self.mapFromGlobal(global_position)): - self.close() - return False - if watched is self.search and event.type() == QEvent.Type.KeyPress: - if event.key() in (Qt.Key.Key_Down, Qt.Key.Key_Up): - self.list_widget.setFocus() - return True - return super().eventFilter(watched, event) + try: + if event.type() == QEvent.Type.MouseButtonPress: + global_position = event.globalPosition().toPoint() + if not self.rect().contains(self.mapFromGlobal(global_position)): + self.close() + return False + search = getattr(self, "search", None) + if search is not None and watched is search and event.type() == QEvent.Type.KeyPress: + if event.key() in (Qt.Key.Key_Down, Qt.Key.Key_Up): + self.list_widget.setFocus() + return True + return super().eventFilter(watched, event) + except (AttributeError, RuntimeError, SystemError, TypeError): + return False def closeEvent(self, event): - if self._application is not None and self._event_filter_installed: - self._application.removeEventFilter(self) + try: + if self._application is not None and self._event_filter_installed: + self._application.removeEventFilter(self) + self._event_filter_installed = False + except (AttributeError, RuntimeError, SystemError, TypeError): self._event_filter_installed = False super().closeEvent(event) @@ -518,15 +530,22 @@ def showEvent(self, event): QTimer.singleShot(0, self._focus_default) def _install_event_filter(self): - if self.isVisible() and self._application is not None and not self._event_filter_installed: - self._application.installEventFilter(self) - self._event_filter_installed = True + try: + if self.isVisible() and self._application is not None and not self._event_filter_installed: + self._application.installEventFilter(self) + self._event_filter_installed = True + except (AttributeError, RuntimeError, SystemError, TypeError): + self._event_filter_installed = False def _focus_default(self): - if self.search is not None: - self.search.setFocus(Qt.FocusReason.PopupFocusReason) - else: - self.list_widget.setFocus(Qt.FocusReason.PopupFocusReason) + try: + search = getattr(self, "search", None) + if search is not None: + search.setFocus(Qt.FocusReason.PopupFocusReason) + else: + self.list_widget.setFocus(Qt.FocusReason.PopupFocusReason) + except (AttributeError, RuntimeError, SystemError, TypeError): + return def keyPressEvent(self, event): if event.key() == Qt.Key.Key_Escape: @@ -781,11 +800,14 @@ def _request_reposition(self): QTimer.singleShot(0, self._reposition_owner) def _reposition_owner(self): - if not self.isVisible(): + try: + if not self.isVisible(): + return + reposition = getattr(self.parentWidget(), "_position_composer_context_popup", None) + if callable(reposition): + reposition() + except (AttributeError, RuntimeError, SystemError, TypeError): return - reposition = getattr(self.parentWidget(), "_position_composer_context_popup", None) - if callable(reposition): - reposition() def showEvent(self, event): super().showEvent(event) @@ -794,21 +816,30 @@ def showEvent(self, event): QTimer.singleShot(0, self.setFocus) def _install_event_filter(self): - if self.isVisible() and self._application is not None and not self._event_filter_installed: - self._application.installEventFilter(self) - self._event_filter_installed = True + try: + if self.isVisible() and self._application is not None and not self._event_filter_installed: + self._application.installEventFilter(self) + self._event_filter_installed = True + except (AttributeError, RuntimeError, SystemError, TypeError): + self._event_filter_installed = False def eventFilter(self, watched, event): - if event.type() == QEvent.Type.MouseButtonPress: - global_position = event.globalPosition().toPoint() - if not self.rect().contains(self.mapFromGlobal(global_position)): - self.close() - return False - return super().eventFilter(watched, event) + try: + if event.type() == QEvent.Type.MouseButtonPress: + global_position = event.globalPosition().toPoint() + if not self.rect().contains(self.mapFromGlobal(global_position)): + self.close() + return False + return super().eventFilter(watched, event) + except (AttributeError, RuntimeError, SystemError, TypeError): + return False def closeEvent(self, event): - if self._application is not None and self._event_filter_installed: - self._application.removeEventFilter(self) + try: + if self._application is not None and self._event_filter_installed: + self._application.removeEventFilter(self) + self._event_filter_installed = False + except (AttributeError, RuntimeError, SystemError, TypeError): self._event_filter_installed = False super().closeEvent(event) diff --git a/graphlink_app/graphlink_composer_web.py b/graphlink_app/graphlink_composer_web.py index 30344c7..ab9fa70 100644 --- a/graphlink_app/graphlink_composer_web.py +++ b/graphlink_app/graphlink_composer_web.py @@ -8,6 +8,7 @@ from PySide6.QtCore import QRect, QUrl, Qt, Signal from PySide6.QtGui import QColor, QRegion from PySide6.QtWidgets import ( + QApplication, QFrame, QLabel, QPushButton, @@ -154,6 +155,7 @@ def __init__(self, window, controller: ComposerController | None = None, parent= self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True) self._corner_radius = 14 self._placeholder = "Ask about this graph…" + self._shutdown_started = False # These hidden controls preserve the existing ChatWindow styling and # request-state hooks while all visible interaction belongs to React. @@ -193,6 +195,10 @@ def __init__(self, window, controller: ComposerController | None = None, parent= self._apply_native_mask() + app = QApplication.instance() + if app is not None: + app.aboutToQuit.connect(self.prepare_for_shutdown) + def resizeEvent(self, event): super().resizeEvent(event) self._apply_native_mask() @@ -249,6 +255,29 @@ def set_editor_enabled(self, enabled): def on_theme_changed(self): self.bridge._publish() + def prepare_for_shutdown(self): + """Stop web content callbacks before Qt tears down the application.""" + if self._shutdown_started: + return + self._shutdown_started = True + try: + self.bridge.dispose() + except (AttributeError, RuntimeError, SystemError, TypeError): + pass + web_view = self.web_view + if web_view is None: + return + try: + web_view.stop() + web_view.setUpdatesEnabled(False) + web_view.hide() + except (AttributeError, RuntimeError, SystemError, TypeError): + return + + def closeEvent(self, event): + self.prepare_for_shutdown() + super().closeEvent(event) + def _apply_requested_height(self, height: int): bounded = max(COMPOSER_MIN_HEIGHT, min(COMPOSER_MAX_HEIGHT, int(height))) if self.height() == bounded: diff --git a/graphlink_app/graphlink_ui_dialogs/graphlink_settings_dialogs.py b/graphlink_app/graphlink_ui_dialogs/graphlink_settings_dialogs.py index 59bb06d..217352c 100644 --- a/graphlink_app/graphlink_ui_dialogs/graphlink_settings_dialogs.py +++ b/graphlink_app/graphlink_ui_dialogs/graphlink_settings_dialogs.py @@ -426,18 +426,26 @@ def __init__(self, settings_manager, parent=None): self.scan_summary_label.setStyleSheet("color: #A5A5A5;") form_layout.addRow("", self.scan_summary_label) + # Create both synchronized controls before connecting either signal. + # ``setCurrentText(saved_model)`` can emit immediately; connecting the + # combo before ``model_input`` exists caused a startup-time AttributeError + # and left the settings dialog in a partially initialized Qt state. + self.model_input = QLineEdit() + self.model_input.setPlaceholderText("Advanced model ID entry") + self.model_input.setVisible(False) + self.model_input.setText(saved_model) + self.model_combo = SettingsComboBox() self.model_combo.setEditable(True) self.model_combo.setPlaceholderText("Select an installed model or enter a model ID") self.model_combo.addItems([""] + self.models) - self.model_combo.currentTextChanged.connect(self.on_combo_change) + self.model_combo.blockSignals(True) self.model_combo.setCurrentText(saved_model) + self.model_combo.blockSignals(False) + self.model_combo.currentTextChanged.connect(self.on_combo_change) form_layout.addRow("Chat Model:", self.model_combo) - self.model_input = QLineEdit() - self.model_input.setPlaceholderText("Advanced model ID entry") self.model_input.textChanged.connect(self.on_text_change) - self.model_input.setVisible(False) form_layout.addRow("", self.model_input) self.title_model_combo = SettingsComboBox() @@ -458,8 +466,6 @@ def __init__(self, settings_manager, parent=None): layout.addLayout(form_layout) - self.model_input.setText(saved_model) - naming_help = QLabel("Each task can inherit the chat model, choose Auto, or use an explicit installed/custom model. Missing models stay visible as unavailable instead of silently changing routes.") naming_help.setWordWrap(True) naming_help.setStyleSheet("color: #A5A5A5; margin-top: 2px;") @@ -706,18 +712,21 @@ def save_settings(self): self.status_label.setStyleSheet(f"color: {get_semantic_color('status_success').name()}; min-height: 40px;") def on_combo_change(self, text): - if not text: return - self.model_input.textChanged.disconnect(self.on_text_change) + if not text or not hasattr(self, "model_input"): + return + self.model_input.blockSignals(True) self.model_input.setText(text) - self.model_input.textChanged.connect(self.on_text_change) + self.model_input.blockSignals(False) def on_text_change(self, text): - self.model_combo.currentTextChanged.disconnect(self.on_combo_change) + if not hasattr(self, "model_combo"): + return + self.model_combo.blockSignals(True) if text in self.models: self.model_combo.setCurrentText(text) else: self.model_combo.setCurrentIndex(0) - self.model_combo.currentTextChanged.connect(self.on_combo_change) + self.model_combo.blockSignals(False) def validate_model(self): model_name = self.model_input.text().strip() diff --git a/graphlink_app/graphlink_window.py b/graphlink_app/graphlink_window.py index 8a41a3f..5f44413 100644 --- a/graphlink_app/graphlink_window.py +++ b/graphlink_app/graphlink_window.py @@ -765,6 +765,15 @@ def closeEvent(self, event): event.ignore() return + self._close_composer_picker() + self._close_composer_context_popup() + prepare_composer_shutdown = getattr( + getattr(self, "composer", None), + "prepare_for_shutdown", + None, + ) + if callable(prepare_composer_shutdown): + prepare_composer_shutdown() mark_clean_exit() super().closeEvent(event) @@ -1346,12 +1355,20 @@ def clear_attachment(self): self._refresh_attachment_button() def _handle_large_paste_from_input(self, pasted_text): - self.message_input.insertPlainText(pasted_text) - self.notification_banner.show_message( - "Large paste kept in the draft. Attach it explicitly when it should be treated as context.", - 5000, - "info", - ) + stage_result, stage_reason = self._stage_large_paste_as_attachment(pasted_text) + if stage_result == "added": + self.notification_banner.show_message( + "Attached pasted text as context.", + 3000, + "success", + ) + elif stage_result == "rejected": + self.notification_banner.show_message( + stage_reason or "The pasted text could not be attached.", + 5000, + "warning", + ) + self.message_input.setFocus() def _stage_large_paste_as_attachment(self, pasted_text): if not pasted_text or not pasted_text.strip(): @@ -1361,7 +1378,8 @@ def _stage_large_paste_as_attachment(self, pasted_text): try: os.makedirs(base_dir, exist_ok=True) timestamp = datetime.now().strftime("%Y%m%d_%H%M%S_%f") - temp_file_path = os.path.join(base_dir, f"pasted_text_{timestamp}.txt") + suffix = self._guess_text_drop_suffix(pasted_text) + temp_file_path = os.path.join(base_dir, f"pasted_text_{timestamp}{suffix}") # errors="replace" (not "ignore") - unencodable characters (e.g. an # unpaired surrogate from a malformed Windows clipboard/drop payload) become # a visible replacement character instead of silently vanishing from the @@ -1370,7 +1388,8 @@ def _stage_large_paste_as_attachment(self, pasted_text): temp_file.write(pasted_text) line_count = pasted_text.count("\n") + 1 - preview_name = f"Pasted Text ({line_count} lines).txt" + kind_label = "Pasted Code" if self._looks_like_code_text(pasted_text, suffix) else "Pasted Text" + preview_name = f"{kind_label} ({line_count} lines){suffix}" return self._stage_attachment_file(temp_file_path, is_temp=True, display_name=preview_name) except OSError: return "rejected", "Could not create a temporary attachment file." diff --git a/graphlink_app/tests/test_composer_bridge.py b/graphlink_app/tests/test_composer_bridge.py index 3d5e251..4899cbf 100644 --- a/graphlink_app/tests/test_composer_bridge.py +++ b/graphlink_app/tests/test_composer_bridge.py @@ -3,7 +3,7 @@ import json from pathlib import Path -from PySide6.QtCore import QPoint, QRect, QSize +from PySide6.QtCore import QEvent, QPoint, QRect, QSize from graphlink_composer import ComposerController, ComposerRequestState from graphlink_composer_bridge import ( @@ -13,6 +13,7 @@ ) from graphlink_composer_popups import ( ComposerContextPopup, + ComposerPickerPopup, composer_picker_list_height, composer_picker_position, ) @@ -57,6 +58,9 @@ def _handle_attachment_pill_removed(self, path): item for item in self.pending_attachments if item["path"] != path ] + def _handle_large_paste_from_input(self, text): + self.large_paste = text + def test_bridge_publishes_versioned_state_without_attachment_paths(): window = _Window() @@ -94,6 +98,15 @@ def test_bridge_routes_send_and_removes_context_by_opaque_id(): assert json.loads(states[-1])["context"]["items"] == [] +def test_bridge_routes_large_paste_to_native_attachment_staging(): + window = _Window() + bridge = ComposerBridge(window, ComposerController()) + + bridge.stageTextAttachment("def explain_chart():\n return 'context'") + + assert window.large_paste.startswith("def explain_chart") + + def test_bridge_cancel_prefers_window_request_callback(): window = _Window() controller = ComposerController() @@ -194,6 +207,15 @@ def test_composer_native_mask_has_rounded_corners(): assert region.contains(QPoint(12, 0)) +def test_picker_event_filter_is_safe_for_reasoning_popup_without_search_control(): + popup = ComposerPickerPopup("reasoning", {"reasoning": {"options": []}}) + + assert popup.eventFilter(object(), QEvent(QEvent.Type.MouseMove)) is False + + popup.close() + popup.deleteLater() + + def test_inline_bundle_is_self_contained_and_keeps_channel_local(): root = Path(__file__).resolve().parents[2] / "assets" / "composer" document = _inline_bundle(root) diff --git a/graphlink_app/tests/test_composer_context_ui.py b/graphlink_app/tests/test_composer_context_ui.py index 7c0c562..c94dcf4 100644 --- a/graphlink_app/tests/test_composer_context_ui.py +++ b/graphlink_app/tests/test_composer_context_ui.py @@ -30,6 +30,16 @@ def test_attachment_actions_use_fixed_compact_controls(): assert "width: 30px;" in styles +def test_large_pastes_are_staged_as_context_attachments(): + source = (SOURCE_ROOT / "ComposerApp.tsx").read_text(encoding="utf-8") + bridge = (SOURCE_ROOT / "bridge.ts").read_text(encoding="utf-8") + + assert "onPaste={onPaste}" in source + assert "event.preventDefault()" in source + assert "stageTextAttachment(pastedText)" in source + assert "stageTextAttachment" in bridge + + def test_graph_anchor_is_not_part_of_attachment_badge_logic(): source = (SOURCE_ROOT / "ComposerApp.tsx").read_text(encoding="utf-8") diff --git a/graphlink_app/tests/test_ollama_task_model_settings.py b/graphlink_app/tests/test_ollama_task_model_settings.py index 952791a..efa6ef1 100644 --- a/graphlink_app/tests/test_ollama_task_model_settings.py +++ b/graphlink_app/tests/test_ollama_task_model_settings.py @@ -31,6 +31,23 @@ from graphlink_licensing import SettingsManager +def test_ollama_settings_initializes_model_controls_before_wiring_signals(): + source = ( + Path(__file__).resolve().parents[1] + / "graphlink_ui_dialogs" + / "graphlink_settings_dialogs.py" + ).read_text(encoding="utf-8") + + model_input_index = source.index("self.model_input = QLineEdit()") + combo_signal_index = source.index( + "self.model_combo.currentTextChanged.connect(self.on_combo_change)" + ) + + assert model_input_index < combo_signal_index + assert "self.model_input.textChanged.disconnect(self.on_text_change)" not in source + assert "self.model_combo.currentTextChanged.disconnect(self.on_combo_change)" not in source + + def _make_settings_manager(tmp_path): # Bypasses SettingsManager.__init__ (which points state_file at the real # ~/.graphlink/session.dat) so these tests never touch real user data. diff --git a/graphlink_app/tests/test_temp_attachment_encoding.py b/graphlink_app/tests/test_temp_attachment_encoding.py index 35d0946..8a2b487 100644 --- a/graphlink_app/tests/test_temp_attachment_encoding.py +++ b/graphlink_app/tests/test_temp_attachment_encoding.py @@ -40,3 +40,13 @@ def test_replace_semantics_surface_corruption_instead_of_hiding_it(): visibly_replaced = text_with_unpaired_surrogate.encode("utf-8", errors="replace") assert visibly_replaced == b"before?after" # the bad character is visibly marked instead assert len(visibly_replaced) > len(silently_dropped) + + +def test_large_paste_is_staged_as_an_attachment_instead_of_inserted_into_draft(): + source = Path(graphlink_window.__file__).read_text(encoding="utf-8") + handler_start = source.index(" def _handle_large_paste_from_input") + handler_end = source.index(" def _stage_large_paste_as_attachment", handler_start) + handler = source[handler_start:handler_end] + + assert "_stage_large_paste_as_attachment" in handler + assert "message_input.insertPlainText(pasted_text)" not in handler