pi-webapp 0.1.57 → 0.1.58-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/launcher-diagnostics.mjs +179 -0
- package/bin/launcher-logs.mjs +145 -0
- package/bin/pi-webapp.mjs +183 -39
- package/dist/extension.js +71 -71
- package/dist/hosted-recovery.js +2 -2
- package/dist/hosted-worker.js +2 -2
- package/docs/desktop.md +16 -5
- package/package.json +3 -2
- package/web/dist/.vite/manifest.json +80 -64
- package/web/dist/assets/{MarkdownText-Ca6_qCyr.js → MarkdownText-BmWua1fx.js} +11 -11
- package/web/dist/assets/WorkspacePanel.module-q1UBTZQr.js +2 -0
- package/web/dist/assets/app-Bl_vjH4f.js +53 -0
- package/web/dist/assets/app.css +1 -1
- package/web/dist/assets/app.js +4 -4
- package/web/dist/assets/{code-editor-B5kVAtku.js → code-editor-bWuZTiS2.js} +4 -4
- package/web/dist/assets/{icons-D8yiYkWB.js → code-file-types-BZAEsqNG.js} +3 -3
- package/web/dist/assets/{dist-CWWynAS-.js → dist-B8Mp_VTU.js} +2 -2
- package/web/dist/assets/{dist-o-4nubru.js → dist-BD_2QeWa.js} +2 -2
- package/web/dist/assets/{dist-Im2q9dJ0.js → dist-C2WSXtwq.js} +2 -2
- package/web/dist/assets/{dist-BRYLL4VU.js → dist-C7kRRV1b.js} +2 -2
- package/web/dist/assets/{dist-CaNhruaD.js → dist-CCfANS3F.js} +2 -2
- package/web/dist/assets/{dist-BFhI7cEI.js → dist-CP5SBgQB.js} +2 -2
- package/web/dist/assets/{dist-DAlictfL.js → dist-CmPE8_f_.js} +2 -2
- package/web/dist/assets/{dist-CszBAiM6.js → dist-D-nx7RRS.js} +2 -2
- package/web/dist/assets/{dist-BYJ4SXpR.js → dist-DFTCmV51.js} +2 -2
- package/web/dist/assets/{dist-CsFhAvz7.js → dist-Dr0qO3Zr.js} +2 -2
- package/web/dist/assets/{dist-CqXTRhJp.js → dist-Nlb4zANG.js} +2 -2
- package/web/dist/assets/{graphql-Cz1_wnUp.js → graphql-B5jxVvgN.js} +2 -2
- package/web/dist/assets/{http-CTlzQwRP.js → http-C6M1fy61.js} +2 -2
- package/web/dist/assets/{php-BHNgHgMp.js → php-B61pLHqK.js} +2 -2
- package/web/dist/assets/{plugin-D1z0mcl1.js → plugin-CE1WaS8V.js} +4 -4
- package/web/dist/assets/plugin-CsVaeNQM.js +6 -0
- package/web/dist/assets/plugin-Cyidq4oP.js +2 -0
- package/web/dist/assets/plugin-Gwwlx9MU.js +4 -0
- package/web/dist/assets/plugin.css +1 -1
- package/web/dist/assets/plugin2.css +1 -1
- package/web/dist/assets/plugin3.css +1 -0
- package/web/dist/assets/{rst-BdGjFUxD.js → rst-950N-2sy.js} +2 -2
- package/web/dist/assets/{ruby-D7-ny0V-.js → ruby-Qm2HAXfx.js} +2 -2
- package/web/dist/assets/{svelte-DoD3sicb.js → svelte-CoZSSs0h.js} +2 -2
- package/web/dist/assets/{vue-BYLUelN7.js → vue-as6FrWIW.js} +2 -2
- package/web/dist/assets/WorkspacePanel.module-V6gI-nG1.js +0 -2
- package/web/dist/assets/app-CIlV3hYO.js +0 -49
- package/web/dist/assets/plugin-CZx51rmJ.js +0 -6
- package/web/dist/assets/plugin-CvqNiFRV.js +0 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownText-BmWua1fx.js","assets/rolldown-runtime-CgmABjMJ.js","assets/react-CLFE7TFE.js","assets/clsx-DQAHfk8w.js","assets/code-file-types-BZAEsqNG.js","assets/app.js","assets/MarkdownText.css","assets/plugin-CsVaeNQM.js","assets/WorkspacePanel.module-q1UBTZQr.js","assets/WorkspacePanel.css","assets/plugin-CE1WaS8V.js","assets/plugin3.css","assets/plugin-Gwwlx9MU.js","assets/plugin2.css","assets/plugin-Cyidq4oP.js","assets/plugin.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`778559b6-dc1a-49e7-8cd7-b63baf223622`,e._sentryDebugIdIdentifier=`sentry-dbid-778559b6-dc1a-49e7-8cd7-b63baf223622`)}catch{}})();import{n as e,r as t,t as n}from"./rolldown-runtime-CgmABjMJ.js";import{t as r}from"./react-CLFE7TFE.js";import{a as i}from"./code-file-types-BZAEsqNG.js";import{a,d as o,i as s,n as c,o as l,r as u,s as d,t as f,u as p}from"./app.js";import{n as m,t as h}from"./clsx-DQAHfk8w.js";import{a as g,c as _,i as v,l as y,o as b,s as x,t as S,u as C}from"./WorkspacePanel.module-q1UBTZQr.js";var w=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),T=n(((e,t)=>{t.exports=w()})),E=n((e=>{var t=T(),n=r(),a=i();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var b=null,x=null;function S(e,t,n){return e===n||e===t&&(b=e,!0)}function C(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),F=Symbol.for(`react.forward_ref`),I=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),L=Symbol.for(`react.memo`),R=Symbol.for(`react.lazy`),z=Symbol.for(`react.activity`),ne=Symbol.for(`react.legacy_hidden`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.for(`react.view_transition`),B=Symbol.for(`react.recoverable`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case M:return`Profiler`;case ee:return`StrictMode`;case I:return`Suspense`;case te:return`SuspenseList`;case z:return`Activity`;case ie:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case F:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case L:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case R:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function he(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function ge(e,t){pe++,fe[pe]=e.current,e.current=t}var _e=me(null),ve=me(null),ye=me(null),be=me(null);function xe(e,t){switch(ge(ye,t),ge(ve,e),ge(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}he(_e),ge(_e,e)}function Se(){he(_e),he(ve),he(ye)}function Ce(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,ge(be,e)),t=_e.current;var n=hp(t,e.type);t!==n&&(ge(ve,e),ge(_e,n))}function we(e){ve.current===e&&(he(_e),he(ve)),be.current===e&&(he(be),lh._currentValue=de)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=ue.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function _t(e,t){var n=ue.p;try{return ue.p=e,t()}finally{ue.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hm(e);e!==null;){if(n=e[yt])return n;e=hm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var Ut=!1;function Wt(){var e=Ut;return Ut=!1,e}function Gt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Xt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zt(e){if(!e._valueTracker){var t=Yt(e)?`checked`:`value`;e._valueTracker=Xt(e,t,``+e[t])}}function Qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var $t=/[\n"\\]/g;function en(e){return e.replace($t,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function tn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):rn(e,Jt(n)):o===`number`&&e.value==t?rn(e,Jt(e.value)):rn(e,Jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Jt(s):e.removeAttribute(`name`)}function nn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Zt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Zt(e)}function rn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function an(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function on(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(le(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Zt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function un(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Ut=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(un(e,i,r),Ut=!0)}else for(var a in t)t.hasOwnProperty(a)&&un(e,a,t[a])}function fn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var pn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),mn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hn(e){return mn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var _n=null;function vn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(tn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+en(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[bt]||null;if(!i)throw Error(o(90));tn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Qt(r)}break a;case`textarea`:on(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&an(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Bd(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,n=t.length,r,i=`value`in On?On.value:On.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return An=i.slice(e,1<r?1-r:void 0)}function Mn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Nn(){return!0}function Pn(){return!1}function Fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Nn:Pn,this.isPropagationStopped=Pn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=D({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=D({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(D({},Un,{dataTransfer:0})),H=Fn(D({},Rn,{relatedTarget:0})),Kn=Fn(D({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),qn=Fn(D({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Jn=Fn(D({},In,{data:0})),Yn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Xn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zn[e])?!!t[e]:!1}function $n(){return Qn}var er=Fn(D({},Rn,{key:function(e){if(e.key){var t=Yn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Fn(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nr=Fn(D({},In,{submitter:0})),rr=Fn(D({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),ir=Fn(D({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),ar=Fn(D({},Un,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=Fn(D({},In,{newState:0,oldState:0,source:0})),sr=[9,13,27,32],cr=Tn&&`CompositionEvent`in window,lr=null;Tn&&`documentMode`in document&&(lr=document.documentMode);var ur=Tn&&`TextEvent`in window&&!lr,dr=Tn&&(!cr||lr&&8<lr&&11>=lr),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return sr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function U(e,t){if(gr)return e===`compositionend`||!cr&&mr(e,t)?(e=jn(),An=kn=On=null,gr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return dr&&t.locale!==`ko`?null:t.data;default:return null}}var vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Uf(e,0)}function wr(e){if(Qt(jt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Tn){var Dr;if(Tn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,vn(e)),Cn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Gr=Tn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&Rr(Jr,r)||(Jr=r,r=Zf(qr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function W(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:W(`Animation`,`AnimationEnd`),animationiteration:W(`Animation`,`AnimationIteration`),animationstart:W(`Animation`,`AnimationStart`),transitionrun:W(`Transition`,`TransitionRun`),transitionstart:W(`Transition`,`TransitionStart`),transitioncancel:W(`Transition`,`TransitionCancel`),transitionend:W(`Transition`,`TransitionEnd`)},Qr={},$r={};Tn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Lt(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=xd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=kd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Ad)throw Ad=0,jd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(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&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ai(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ji(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,_e.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case z:return e=Di(31,n,t,i),e.elementType=z,e.lanes=a,e;case j:return Mi(n.children,i,a,t);case ee:s=8,i|=24;break;case M:return e=Di(12,n,t,i|2),e.elementType=M,e.lanes=a,e;case I:return e=Di(13,n,t,i),e.elementType=I,e.lanes=a,e;case te:return e=Di(19,n,t,i),e.elementType=te,e.lanes=a,e;case ne:case ie:return e=i|32,e=Di(30,n,t,e),e.elementType=ie,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case P:s=10;break a;case N:s=9;break a;case F:s=11;break a;case L:s=14;break a;case R:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Ye(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(o(519));function ia(e){throw ua(Li(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:Wf(`cancel`,t),Wf(`close`,t);break;case`iframe`:case`object`:case`embed`:Wf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Vf.length;n++)Wf(Vf[n],t);break;case`source`:Wf(`error`,t);break;case`img`:case`image`:case`link`:Wf(`error`,t),Wf(`load`,t);break;case`details`:Wf(`toggle`,t);break;case`input`:Wf(`invalid`,t),nn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Wf(`invalid`,t);break;case`textarea`:Wf(`invalid`,t),sn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||rp(t.textContent,n)?(r.popover!=null&&(Wf(`beforetoggle`,t),Wf(`toggle`,t)),r.onScroll!=null&&Wf(`scroll`,t),r.onScrollEnd!=null&&Wf(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));$i=mm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));$i=mm(e)}else t===27?(t=$i,Ep(e.type)?(e=pm,pm=null,$i=e):$i=t):$i=Qi?fm(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=me(null),fa=null,pa=null;function ma(e,t,n){ge(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,he(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ga(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ga(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ga(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function va(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Lr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===be.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}i=i.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(o(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=If(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=V.S;V.S=function(e,t){if(gd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Sf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Sf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=me(null);function Ha(){var e=Va.current;return e===null?Zu.pooledCache:e}function Ua(e,t){t===null?ge(Va,Va.current):ge(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(o(460)),Ka=Error(o(474)),qa=Error(o(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(o(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(o(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ki(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ni(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===R&&Za(a)===t.type)?(t=i(t,n.props),io(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Fi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Mi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case R:return t=Za(t),f(e,t,n)}if(le(t)||oe(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===P)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case R:return n=Za(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===P)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case R:return r=Za(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===P)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ea&&qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return ea&&qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ea&&qi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),ea&&qi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return ea&&qi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),ea&&qi(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===j&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case k:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===j){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),io(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===R&&Za(l)===r.type){n(e,r.sibling),c=i(r,a.props),io(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===j?(c=Mi(a.props.children,e.mode,c,a.key),io(c,a),c.return=e,e=c):(c=ji(a.type,a.key,a.props,null,e.mode,c),io(c,a),c.return=e,e=c)}return s(e);case A:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Fi(a,e.mode,c),c.return=e,e=c}return s(e);case R:return a=Za(a),_(e,r,a,c)}if(le(a))return h(e,r,a,c);if(oe(a)){if(l=oe(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,ro(a),c);if(a.$$typeof===P)return _(e,r,Sa(e,a),c);ao(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Ni(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?($u&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=me(null),Co=me(0);function wo(e,t){e=ad,ge(Co,e),ge(So,t),ad=e|t.baseLanes}function To(){ge(Co,ad),ge(So,So.current)}function Eo(){ad=Co.current,he(So),he(Co)}var Do=me(null),Oo=null;function ko(e){var t=e.alternate;ge(Po,Po.current&1),ge(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){ge(Po,Po.current),ge(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(ge(Po,Po.current),ge(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){ge(Po,Po.current),ge(Do,Do.current)}function No(e){he(Do),Oo===e&&(Oo=null),he(Po)}var Po=me(0);function Fo(e,t){ge(Do,Do.current),ge(Po,t)}function Io(e){he(Po),he(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lm(n)||um(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ro=0,G=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(o(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Ro=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?dc:fc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){V.H=q;var t=zo!==null&&zo.next!==null;if(Ro=0,Bo=zo=G=null,Vo=!1,Go=0,Ko=null,t)throw Error(o(300));e===null||kc||(e=e.dependencies,e!==null&&ya(e)&&(kc=!0))}function Qo(e,t,n,r){G=e;var i=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=i)throw Error(o(301));if(i+=1,Bo=zo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}V.H=pc,a=t(n,r)}while(Ho);return a}function $o(){var e=V.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(G.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Ro=0,Bo=zo=G=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?G.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw G.alternate===null?Error(o(467)):Error(o(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?G.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Xa(Ko,e,t),t=G,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?dc:fc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===B)return;if(e.$$typeof===P)return xa(e)}throw Error(o(438,String(e)))}function cs(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:($u&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,G.lanes|=p,sd|=p;f=u.action,Uo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,G.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Lr(a,e.memoizedState)&&(kc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Lr(a,t.memoizedState)||(kc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ps(e,t,n){var r=G,i=is(),a=ea;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Lr((zo||i).memoizedState,n);if(s&&(i.memoizedState=n,kc=!0),i=i.queue,K(gs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(o(349));a||Ro&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=as(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function vs(e){var t=Si(e,2);t!==null&&Fd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,i){if(cc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};V.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ss(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=V.T,o={};o.types=a===null?null:a.types,V.T=o;try{var s=n(i,r),c=V.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),V.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(ea){var n=Zu.formState;if(n!==null){a:{var r=G;if(ea){if($i){b:{for(var i=$i,a=na;i.nodeType!==8;)if(!a||(i=fm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=fm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=ac.bind(null,G,r),r.dispatch=n,r=ys(!1),a=sc.bind(null,G,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ga?qa:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=as(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();G.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(G.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function K(e,t){Is(2048,8,e,t)}function Rs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=as(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=is().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(Xu&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Is(4,2,e,t)}function Vs(e,t){return Is(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Ro&1073741824&&!($u&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nd(),G.lanes|=e,sd|=e,n)}function Js(e,t,n,r){return Lr(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!($u&261930)?(kc=!0,e.memoizedState=n):(e=Nd(),G.lanes|=e,sd|=e,t):(e=qs(e,n,r),Lr(e,t)||(kc=!0),e)}function Ys(e,t,n,r,i){var a=ue.p;ue.p=a!==0&&8>a?a:8;var o=V.T,s={};s.types=o===null?null:o.types,V.T=s,sc(e,!1,t,n);try{var c=i(),l=V.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,za(c,r),Md(e)):oc(e,t,r,Md(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},Md())}finally{ue.p=a,o!==null&&s.types!==null&&(o.types=s.types),V.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Qs(e).queue;Ys(e,i,t,de,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},Md())}function ec(){return xa(lh)}function tc(){return is().memoizedState}function nc(){return is().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=po(n);var r=mo(t,e,n);r!==null&&(Fd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=Md();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=xi(e,t,n,r),n!==null&&(Fd(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,Md())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return bi(e,t,i,0),Zu===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Fd(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:If(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(o(479))}else t=xi(e,n,r,2),t!==null&&Fd(t,e,2)}function cc(e){var t=e.alternate;return e===G||t!==null&&t===G}function lc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var q={readContext:xa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},dc={readContext:xa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ic.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=ac.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Ys.bind(null,G,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,i=rs();if(ea){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Zu===null)throw Error(o(349));$u&127||ms(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ls(gs.bind(null,r,a,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,a,n,t),null),n},useId:function(){var e=rs(),t=Zu.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=rc.bind(null,G)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(Xu&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:xa,use:ss,useCallback:Gs,useContext:xa,useEffect:K,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:tc,useHostTransitionStatus:ec,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:nc,useEffectEvent:zs},pc={readContext:xa,use:ss,useCallback:Gs,useContext:xa,useEffect:K,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=is();return zo===null?qs(n,e,t):Js(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:tc,useHostTransitionStatus:ec,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:nc,useEffectEvent:zs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Md(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Fd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Md(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Fd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Md(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Fd(t,e,n),ho(t,e,n))}};function gc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function _c(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hc.enqueueReplaceState(t,t.state,null)}function vc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){hi(e)}function bc(e){console.error(e)}function xc(e){hi(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=po(e),e.tag=3,e}function Ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(yd===null?yd=new Set([this]):yd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,i,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?qd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),gf(e,r,i)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),gf(e,r,i)),!1}throw Error(o(435,n.tag))}return gf(e,r,i),qd(),!1}if(ea)return t=Do.current,t===null?(r!==ra&&(t=Error(o(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Li(r,n),i=wc(e.stateNode,r,i),go(e,i),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ra&&(e=Error(o(422),{cause:r}),ua(Li(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Li(a,n),fd===null?fd=[a]:fd.push(a),od!==4&&(od=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=wc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(yd===null||!yd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Tc(i),Ec(i,e,n,r),go(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(o(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function jc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!kc?(ts(e,t,i),al(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Ac(e,t,r,i),t.child)}function Mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Nc(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ol(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return al(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,ol(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,al(e,t,i)}}return Vc(e,t,n,r,i)}function Pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ic(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Lc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rc(e,t,n){return so(t,e.child,null,n),e=Lc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function zc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=Lc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fc(null,e);if(Ao(t),(e=$i)?(e=cm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Lc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Ao(t),i){if(t.flags&256)t.flags&=-257,t=Rc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(kc||va(e,t,n,!1),i=(n&e.childLanes)!==0,kc||i){if(So.current===null){if(r=Zu,r!==null&&(s=pt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Si(e,s),Fd(r,e,s),Oc;qd()}t=Rc(e,t,n)}else e=a.treeContext,$i=fm(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Lc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vc(e,t,n,r,i){return ba(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!kc?(ts(e,t,i),al(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Hc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!kc?(ts(e,t,a),al(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Uc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&hc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&_c(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=lo||gc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&_c(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=lo||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Bc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=al(e,t,i),e}function Wc(e,t,n,r){return ca(),t.flags|=256,Ac(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wa()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?ko(t):Mo(),(e=$i)?(e=cm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=um(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(null,r)):(ko(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Qc(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Fc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ki(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function Zc(e,t,n){return so(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qc(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,Zc(e,t,c)):t.memoizedState===null?(Mo(),a=i.fallback,s=t.mode,i=Xc({mode:`visible`,children:i.children},s),a=Mi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,so(t,e.child,null,c),i=t.child,i.memoizedState=Kc(c),i.childLanes=qc(e,r,c),t.memoizedState=Gc,Fc(null,i)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),um(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,ua({value:i,source:null,stack:null})),Zc(e,t,c)}if(kc||va(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(So.current!==null)return Zc(e,t,c);if(r=Zu,r!==null&&(i=pt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Si(e,i),Fd(r,e,i),Oc;return lm(a)||qd(),Zc(e,t,c)}return lm(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=fm(a.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Yc(t,i.children),t.flags|=134221824,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function el(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function tl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function nl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function rl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(nl(e),Ac(e,t,r,n),nl(e)):Ac(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$c(e,n,t);else if(e.tag===19)$c(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,nl(t)),tl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tl(t,!0,n,null,a,r);break;case`together`:tl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tl(t,!1,i,n,a,r)}return t.child}function il(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function al(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ol(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function sl(e,t,n){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ce(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(ko(t),e=al(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return rl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return rl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Pc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return al(e,t,n)}function cl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!ol(e,n)&&!(t.flags&128))return kc=!1,sl(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=vc(e,r),t.tag=1,t=Uc(null,t,e,r,n)):(t.tag=0,t=Vc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===F){t.tag=11,t=jc(null,t,e,r,n);break a}if(i===L){t.tag=14,t=Mc(null,t,e,r,n);break a}if(i===P){t.tag=10,t.type=e,t=il(null,t,n);break a}}throw t=ce(e)||e,Error(o(306,t,``))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=vc(r,t.pendingProps),Uc(e,t,r,i,n);case 3:a:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0),vo(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Wc(e,t,r,n);break a}if(r!==i){i=Li(Error(o(424)),t),ua(i),t=Wc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=fm(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===i){t=al(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return Bc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=gp(t.type,t.pendingProps,ye.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&ea&&(r=t.stateNode=_m(t.type,t.pendingProps,ye.current),Qi=t,na=!0,i=$i,Ep(t.type)?(pm=i,$i=fm(r.firstChild)):$i=i),Ac(e,t,t.pendingProps.children,n),Bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((i=r=$i)&&(r=om(r,t.type,t.pendingProps,na),r===null?i=!1:(t.stateNode=r,Qi=t,$i=fm(r.firstChild),na=!1,i=!0)),i||ia(t)),Ce(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,_p(i,a)?r=null:s!==null&&_p(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Xo(e,t,$o,null,null,n),lh._currentValue=i),Bc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=sm(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Jc(e,t,n);case 4:return xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Bc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return il(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ba(t),i=xa(i),r=r(i),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return Mc(e,t,t.type,t.pendingProps,n);case 15:return Nc(e,t,t.type,t.pendingProps,n);case 19:return rl(e,t,n);case 31:return zc(e,t,n);case 22:return Pc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(i=Ha(),i===null&&(i=Zu,a=Oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},uo(t),ma(t,Da,i)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ma(t,Da,r),r!==i.cache&&_a(t,[Da],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ma(t,Da,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Bc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ll(e){e.flags|=4}function ul(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Wd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Wd())e.flags|=8192;else throw Qa=Ja,Ka}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,dd|=t)}function pl(e,t){if(!ea)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ml(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),Se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),ml(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(ll(t),a===null?(ml(t),ul(t,i,null,r,n)):(ml(t),dl(t,a))):a?a===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,a)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,i,e,r,n)),null;case 27:if(we(t),n=ye.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}e=_e.current,sa(t)?aa(t,e):(e=_m(i,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ml(t),t.subtreeFlags&=-33554433,null}if(a=_e.current,sa(t))aa(t,a);else{var s=pp(ye.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[yt]=t,a[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(op(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=ye.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Qi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||ia(t,!0)}else e=pp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(o(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),i=!1}else i=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(No(t),t):(No(t),null)}return No(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fl(t,t.updateQueue),ml(t),null);case 4:return Se(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return ha(t.type),ml(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return ml(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)pl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Lo(e),a!==null){for(t.flags|=128,pl(r,!1),e=a.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Fo(t,Po.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>_d&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Lo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!ea)return ml(t),null}else 2*Le()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,i=!0,pl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,a=Po.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Fo(t,a):(n=a,ge(Do,t),ge(Po,n),Oo===null&&(Oo=t)),ea&&qi(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&he(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(o(156,t.tag))}function gl(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),Se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Se(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&he(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function _l(e,t){switch(Xi(t),t.tag){case 3:ha(Da),Se();break;case 26:case 27:case 5:we(t);break;case 4:Se();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&he(Va);break;case 24:ha(Da)}}function vl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){hf(t,t.return,e)}}function yl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){hf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){hf(t,t.return,e)}}function bl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){hf(e,e.return,t)}}}function xl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){hf(e,t,n)}}function Sl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);m(e.child,!1,tm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){hf(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){hf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){hf(e,t,n)}else n.current=null}}function wl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)rm(e.stateNode,t[n])}function Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&rm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&im(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){hf(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[bt]=t}catch(t){hf(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ep(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),wl(e,r),Ut=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),Ut=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[yt]=e,t[bt]=n}catch(t){hf(e,e.return,t)}}var Il=!1,Ll=null;function Rl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var zl=null;function Bl(){var e=zl;return zl=null,e}var Vl=0;function J(e,t,n,r,i){return Vl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Il=!0,kp(o,Vl===0?t:t+`_`+Vl,n),Vl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ul(e.child,t),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=mi(t.default,t.share),t!==`none`&&(J(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):J(e,i,a,null,!1)?(Wl(e),n.paired||t||Pd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Ll!==null&&Ll.size!==0){var t=Ll;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=mi(n.default,n.share);if(a!==`none`&&(J(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Pd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Ll===null?void 0:Ll.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(J(e,n,i,null,!1)?r===void 0?Pd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ll.delete(n),Pd(e,t.onShare)):Ul(e.child,!1)),Ll!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Ll!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&J(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Vl<a.length){var l=a[Vl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Vl===0?n:n+`_`+Vl,i),s&&e.flags&4||(zl===null&&(zl=[]),zl.push(c,Vl===0?r:r+`_`+Vl,t.memoizedProps)),Vl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Vl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Pd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,Y=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,dp=vh,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Rl(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Rl(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&Jl(e),uu(n))}}Ll=null}function uu(e){for(;iu!==null;){var t=iu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=vc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){hf(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)am(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:am(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=fi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=mi(i.default,i.update),i!==`none`&&J(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&vl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){hf(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){hf(n,n.return,e)}}}r&64&&bl(n),r&512&&Sl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){hf(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:ju(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=yf.bind(null,n),dm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||Y;t=eu,i=Y,eu=r,(Y=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),eu=t,Y=i}break;case 30:ju(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){hf(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ut=!0}catch(t){hf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){hf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:Y||Cl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Y&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Y||Cl(n,t),El(n);var r=gu,i=_u;Ep(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:Y||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),Ut=!0}catch(e){hf(n,t,e)}else try{gu.removeChild(n.stateNode),Ut=!0}catch(e){hf(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Dp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:yl(2,n,t),Y||yl(4,n,t),vu(e,t,n);break;case 1:Y||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&xl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:Y=(r=Y)||n.memoizedState!==null,vu(e,t,n),Y=r;break;case 30:Cl(n,t),vu(e,t,n);break;case 7:Y||Cl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){hf(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){hf(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(o(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=bf.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(o(160));yu(s,c,a),gu=null,_u=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),i&4&&(yl(3,e,e.return),vl(3,e),yl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),i&512&&(Y||r===null||Cl(r,r.return)),i&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Tu,wu(t,e,n),Du(e),i&512&&(Y||r===null||Cl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),op(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(a=qm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=qm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else eu||Jm(a,e.type,e.stateNode)}else e.stateNode=Hm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||Y||t.parentNode.removeChild(t)):i.count--,n===null?eu||Jm(a,e.type,e.stateNode):Hm(a,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),i&512&&(Y||r===null||Cl(r,r.return)),r!==null&&i&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=tu,tu=!1,wu(t,e,n),tu=a,Du(e),i&512&&(Y||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),Ut=!0}catch(t){hf(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),i&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ut=!0}catch(t){hf(e,e.return,t)}}break;case 3:if(Ut=!1,Km=null,a=Tu,Tu=Sm(t.containerInfo),wu(t,e,n),Tu=a,Du(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){hf(e,e.return,t)}nu&&(nu=!1,Ou(e)),Ut=!1;break;case 4:i=tu,tu=eu,r=Wt(),a=Tu,Tu=Sm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=a,Ut&&ou&&(su=!0),Ut=r,tu=i;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=Le()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=Y,u=tu;eu=c||a,tu=u||a,Y=l||s,wu(t,e,n),Y=l,tu=u,eu=c,Du(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||eu||Y||(t=s||Y,n=eu,r=Y,eu=a||eu,Y=t,Mu(e,2),eu=n,Y=r),!a&&tu||fu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:i&512&&(Y||r===null||Cl(r,r.return)),i=Wt(),a=ou,s=(n&335544064)===n,c=e.memoizedProps,ou=s&&mi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&Ut&&(e.flags|=4),ou=a,Ut=i;break;case 21:break;case 7:i&512&&(Y||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ol(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Dl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(o(161))}}catch(t){hf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else $l(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,Bl(),ku(t,e),!au&&!su){if(e=zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}zl=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Gl(e,!1));break;case 30:r=au,i=Bl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Vl=0,t=Ql(e,n,t,o,s,a,!0),Vl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Pd(e,e.memoizedProps.onUpdate),zl=i):i!==null&&(i.push.apply(i,zl),zl=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:yl(4,n,n.return),Mu(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&xl(n,n.return,i),Mu(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),Mu(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Y||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:Cl(n,n.return),Mu(n,r);break;case 7:Cl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),vl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){hf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){hf(r,r.return,e)}}s&&o&64&&bl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Jm(Sm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),Sl(a,a.return);break;case 30:Nu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&vl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){hf(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=Tu;Tu=Sm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ll===null&&(Ll=new Map),Ll.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&yl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:yl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:yl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,Xu=0,Zu=null,Qu=null,$u=0,ed=0,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,pd=null,md=!1,hd=0,gd=0,_d=1/0,vd=null,yd=null,bd=0,xd=null,Sd=null,Cd=0,wd=0,Td=null,Ed=null,Dd=null,Od=null,kd=null,Ad=0,jd=null;function Md(){return Xu&2&&$u!==0?$u&-$u:V.T===null?gt():If()}function Nd(){if(ud===0){if(!($u&536870912)||ea){var e=et;et<<=1,!(et&3932160)&&(et=262144),ud=e}else ud=536870912}return e=Do.current,e!==null&&(e.flags|=32),ud}function Pd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(fi(e.memoizedProps,n))),Od===null&&(Od=[]),Od.push(t.bind(null,r))}}function Fd(e,t,n){(e===Zu&&(ed===2||ed===9)||e.cancelPendingCommit!==null)&&(Hd(e,0),zd(e,$u,ud,!1)),lt(e,n),Xu&2&&e===Zu||(e===Zu&&(!(Xu&2)&&(cd|=n),od===4&&zd(e,$u,ud,!1)),Of(e))}function Id(e,t,n){if(Xu&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),i=r?Xd(e,t):Jd(e,t,!0),a=r;do{if(i===0){rd&&!r&&zd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Rd(n))i=Jd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Hd(c,s).flags|=256),s=Jd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=a,cd|=a,i=4;break a}a=pd,pd=i,a!==null&&(pd===null?pd=a:pd.push.apply(pd,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){Hd(e,0),zd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:zd(r,t,ud,!nd);break a;case 2:pd=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=hd+300-Le(),10<i)){if(zd(r,t,ud,!nd),rt(r,0,!0)!==0)break a;Cd=t,r.timeoutHandle=bp(Ld.bind(null,r,n,pd,vd,md,t,ud,cd,dd,nd,a,`Throttled`,-0,0),i);break a}Ld(r,n,pd,vd,md,t,ud,cd,dd,nd,a,null,-0,0)}break}}while(1);Of(e)}function Ld(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Ll=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?hd-Le():(a&4194048)===a?gd-Le():0,m=nh(d,m),m!==null)?(Cd=a,e.cancelPendingCommit=m(rf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),zd(e,a,o,!l)):rf(e,t,a,n,r,i,o,s,c,l,u,d)}function Rd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zd(e,t,n,r){t=at(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Bd(){return Xu&6?!0:(kf(0,!1),!1)}function Vd(){if(Qu!==null){if(ed===0)var e=Qu.return;else e=Qu,pa=fa=null,ns(e),to=null,no=0,e=Qu;for(;e!==null;)_l(e.alternate,e),e=e.return;Qu=null}}function Hd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Cd=0,Vd(),Zu=e,Qu=n=ki(e.current,null),$u=t,ed=0,td=null,nd=!1,rd=it(e,t),id=!1,dd=ud=ld=cd=sd=od=0,pd=fd=null,md=!1,ad=at(e,t),yi(),n}function Ud(e,t){G=null,V.H=q,t===Ga||t===qa?(t=$a(),ed=3):t===Ka?(t=$a(),ed=4):ed=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,Qu===null&&(od=1,Sc(e,Li(t,e.current)))}function Wd(){var e=Do.current;return e===null?!0:($u&4194048)===$u?Oo===null:($u&62914560)===$u||$u&536870912?e===Oo:!1}function Gd(){var e=V.H;return V.H=q,e===null?q:e}function Kd(){var e=V.A;return V.A=Ju,e}function qd(){od=4,nd||($u&4194048)!==$u&&Do.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||Zu===null||zd(Zu,$u,ud,!1)}function Jd(e,t,n){var r=Xu;Xu|=2;var i=Gd(),a=Kd();(Zu!==e||$u!==t)&&(vd=null,Hd(e,t)),t=!1;var o=od;a:do try{if(ed!==0&&Qu!==null){var s=Qu,c=td;switch(ed){case 8:Vd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=ed;if(ed=0,td=null,ef(e,s,c,l),n&&rd){o=0;break a}break;default:l=ed,ed=0,td=null,ef(e,s,c,l)}}Yd(),o=od;break}catch(t){Ud(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Xu=r,V.H=i,V.A=a,Qu===null&&(Zu=null,$u=0,yi()),o}function Yd(){for(;Qu!==null;)Qd(Qu)}function Xd(e,t){var n=Xu;Xu|=2;var r=Gd(),i=Kd();Zu!==e||$u!==t?(vd=null,_d=Le()+500,Hd(e,t)):rd=it(e,t);a:do try{if(ed!==0&&Qu!==null){t=Qu;var a=td;b:switch(ed){case 1:ed=0,td=null,ef(e,t,a,1);break;case 2:case 9:if(Ya(a)){ed=0,td=null,$d(t);break}t=function(){ed!==2&&ed!==9||Zu!==e||(ed=7),Of(e)},a.then(t,t);break a;case 3:ed=7;break a;case 4:ed=5;break a;case 7:Ya(a)?(ed=0,td=null,$d(t)):(ed=0,td=null,ef(e,t,a,7));break;case 5:var s=null;switch(Qu.tag){case 26:s=Qu.memoizedState;case 5:case 27:var c=Qu;if(s?Zm(s):c.stateNode.complete){ed=0,td=null;var l=c.sibling;if(l!==null)Qu=l;else{var u=c.return;u===null?Qu=null:(Qu=u,tf(u))}break b}}ed=0,td=null,ef(e,t,a,5);break;case 6:ed=0,td=null,ef(e,t,a,6);break;case 8:Vd(),od=6;break a;default:throw Error(o(462))}}Zd();break}catch(t){Ud(e,t)}while(1);return pa=fa=null,V.H=r,V.A=i,Xu=n,Qu===null?(Zu=null,$u=0,yi(),od):0}function Zd(){for(;Qu!==null&&!Fe();)Qd(Qu)}function Qd(e){var t=cl(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?tf(e):Qu=t}function $d(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hc(n,t,t.pendingProps,t.type,void 0,$u);break;case 11:t=Hc(n,t,t.pendingProps,t.type.render,t.ref,$u);break;case 5:ns(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:_l(n,t),t=Qu=Ai(t,ad),t=cl(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?tf(e):Qu=t}function ef(e,t,n,r){pa=fa=null,ns(t),to=null,no=0;var i=t.return;try{if(Dc(e,i,t,n,$u)){od=1,Sc(e,Li(n,e.current)),Qu=null;return}}catch(t){if(i!==null)throw Qu=i,t;od=1,Sc(e,Li(n,e.current)),Qu=null;return}t.flags&32768?(ea||r===1?e=!0:rd||$u&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),nf(t,e)):tf(t)}function tf(e){var t=e;do{if(t.flags&32768){nf(t,nd);return}e=t.return;var n=hl(t.alternate,t,ad);if(n!==null){Qu=n;return}if(t=t.sibling,t!==null){Qu=t;return}Qu=t=e}while(t!==null);od===0&&(od=5)}function nf(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,Qu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Qu=e;return}Qu=e=n}while(e!==null);od=6,Qu=null}function rf(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do ff();while(bd!==0);if(Xu&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===Zu&&(Qu=Zu=null,$u=0),Sd=t,xd=e,Cd=n,Td=i,Ed=r,af(e,t,n,s,c,l,f)}}function af(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(wd=s,s|=vi,ut(e,n,s,r,i,a),Od=null,(n&335544064)===n?(kd=Ma(e),r=10262):(kd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,xf(Ve,function(){return pf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=V.T,V.T=null,i=ue.p,ue.p=2,a=Xu,Xu|=4;try{lu(e,t,n)}finally{Xu=a,ue.p=i,V.T=r}}bd=1,Il?Dd=Ip(o,e.containerInfo,kd,cf,lf,sf,uf,pf,of,null,null):(cf(),lf(),uf())}function of(e){if(bd!==0){var t=xd.onRecoverableError;t(e,{componentStack:null})}}function sf(){bd===3&&(bd=0,Au(Sd,xd),bd=4)}function cf(){if(bd===1){bd=0;var e=xd,t=Sd,n=Cd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=V.T,V.T=null;var i=ue.p;ue.p=2;var a=Xu;Xu|=4;try{ou=su=!1,Eu(t,e,n),n=fp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vh=!!dp,fp=dp=null}finally{Xu=a,ue.p=i,V.T=r}}e.current=t,bd=2}}function lf(){if(bd===2){bd=0;var e=xd,t=Sd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=V.T,V.T=null;var r=ue.p;ue.p=2;var i=Xu;Xu|=4;try{du(e,t.alternate,t)}finally{Xu=i,ue.p=r,V.T=n}}bd=3}}function uf(){if(bd===4||bd===3){bd=0;var e=Dd;Dd=null,Ie();var t=xd,n=Sd,r=Cd,i=Ed,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?bd=5:(bd=0,Sd=xd=null,df(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=V.T,a=ue.p,ue.p=2,V.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{V.T=n,ue.p=a}}if(i=Od,o=kd,kd=null,i!==null&&(Od=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Cd&3&&ff(),Of(t),a=t.pendingLanes,r&261930&&a&42?t===jd?Ad++:(Ad=0,jd=t):(Ad=0,jd=null),kf(0,!1)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function ff(){return Dd!==null&&(Dd.skipTransition(),Dd=null),cf(),lf(),uf(),pf()}function pf(){if(bd!==5)return!1;var e=xd,t=wd;wd=0;var n=ht(Cd),r=V.T,i=ue.p;try{ue.p=32>n?32:n,V.T=null,n=Td,Td=null;var a=xd,s=Cd;if(bd=0,Sd=xd=null,Cd=0,Xu&6)throw Error(o(331));var c=Xu;if(Xu|=4,Gu(a.current),Lu(a,a.current,s,n),Xu=c,kf(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,a)}catch{}return!0}finally{ue.p=i,V.T=r,df(e,t)}}function mf(e,t,n){t=Li(n,t),t=wc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(lt(e,2),Of(e))}function hf(e,t,n){if(e.tag===3)mf(e,e,n);else for(;t!==null;){if(t.tag===3){mf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Li(n,e),n=Tc(2),r=mo(t,n,2),r!==null&&(Ec(n,r,t,e),lt(r,2),Of(r));break}}t=t.return}}function gf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(id=!0,i.add(n),e=_f.bind(null,e,t,n),t.then(e,e))}function _f(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&($u&n)===n&&(od===4||od===3&&($u&62914560)===$u&&300>Le()-hd?Xu&2?ld|=n:Hd(e,0):ld|=n,dd===$u&&(dd=0)),Of(e)}function vf(e,t){t===0&&(t=st()),e=Si(e,t),e!==null&&(lt(e,t),Of(e))}function yf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vf(e,n)}function bf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),vf(e,n)}function xf(e,t){return Ne(e,t)}var Sf=null,Cf=null,wf=!1,Tf=!1,Ef=!1,Df=0;function Of(e){e!==Cf&&e.next===null&&(Cf===null?Sf=Cf=e:Cf=Cf.next=e),Tf=!0,wf||(wf=!0,Ff())}function kf(e,t){if(!Ef&&Tf){Ef=!0;do for(var n=!1,r=Sf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Pf(r,a))}else a=$u,a=rt(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Pf(r,a))}r=r.next}while(n);Ef=!1}}function Af(){jf()}function jf(){Tf=wf=!1;var e=0;Df!==0&&yp()&&(e=Df);for(var t=Le(),n=null,r=Sf;r!==null;){var i=r.next,a=Mf(r,t);a===0?(r.next=null,n===null?Sf=i:n.next=i,i===null&&(Cf=n)):(n=r,(e!==0||a&3)&&(Tf=!0)),r=i}bd!==0&&bd!==5||kf(e,!1),Df!==0&&(Df=0)}function Mf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=$u,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ed===2||ed===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=Nf.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function Nf(e,t){if(bd!==0&&bd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ff()&&e.callbackNode!==n)return null;var r=$u;return r=rt(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Id(e,r,t),Mf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?Nf.bind(null,e):null)}function Pf(e,t){if(ff())return null;Id(e,t,!0)}function Ff(){wp(function(){Xu&6?Ne(ze,Af):jf()})}function If(){if(Df===0){var e=Fa;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Df=e}return Df}function Lf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:hn(e)}function Rf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Lf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Lf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Df!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var zf=0;zf<li.length;zf++){var Bf=li[zf];ui(Bf.toLowerCase(),`on`+(Bf[0].toUpperCase()+Bf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Vf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Hf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Vf));function Uf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}}}}function Wf(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Gf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Kf=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Kf]){e[Kf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(Hf.has(t)||Gf(t,!1,e),Gf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kf]||(t[Kf]=!0,Gf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!En||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Yf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=kt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Cn(function(){var r=a,i=vn(n),o=[];a:{var s=ci.get(e);if(s!==void 0){var l=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=H;break;case`focusout`:u=`blur`,l=H;break;case`beforeblur`:case`afterblur`:l=H;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=rr;break;case ti:case ni:case ri:l=Kn;break;case si:l=ir;break;case`scroll`:case`scrollend`:l=zn;break;case`wheel`:l=ar;break;case`copy`:case`cut`:case`paste`:l=qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=nr;break;case`toggle`:case`beforetoggle`:l=or}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=wn(m,p),g!=null&&d.push(Xf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,l&&n!==_n&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(s||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(l=n.relatedTarget||n.toElement,s=r,l=l?kt(l):null,l!==null&&(f=c(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(s=null,l=r),s!==l&&(d=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:jt(s),h=l==null?u:jt(l),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&l?E(s,l,Qf):null,s!==null&&$f(o,u,s,d,!1),l!==null&&f!==null&&$f(o,f,l,d,!0)))}a:{if(s=r?jt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var _=Tr;else if(yr(s)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&fn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?jt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(o,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(o,n,i)}var y;if(cr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(dr&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,gr=!0)),v=Zf(r,b),0<v.length&&(b=new Jn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=ur?_r(e,n):U(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Jn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Rf(o,e,r,n,i)}Uf(o,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=wn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=wn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=wn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=wn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
|
|
10
|
+
`).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:dn(e,r,a);return;case`data`:if(t!==`object`){Kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,i.name,i,null),ip(e,t,`formEncType`,i.formEncType,i,null),ip(e,t,`formMethod`,i.formMethod,i,null),ip(e,t,`formTarget`,i.formTarget,i,null)):(ip(e,t,`encType`,i.encType,i,null),ip(e,t,`method`,i.method,i,null),ip(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&Wf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Wf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=hn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Wf(`beforetoggle`,e),Wf(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=pn.get(n)||n,Gt(e,n,r);else return}Ut=!0}function ap(e,t,n,r,i,a){switch(n){case`style`:dn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&Wf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Wf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}Ut=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}Ut=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Wf(`error`,e),Wf(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ip(e,t,a,s,n,null)}}i&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:Wf(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:ip(e,t,r,d,n,null)}}nn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in Wf(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ip(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&an(e,!!r,n,!0):an(e,!!r,t,!1);return;case`textarea`:for(s in Wf(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:ip(e,t,s,c,n,null)}sn(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ip(e,t,l,r,n,null)}return;case`dialog`:Wf(`beforetoggle`,e),Wf(`toggle`,e),Wf(`cancel`,e),Wf(`close`,e);break;case`iframe`:case`object`:Wf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Vf.length;r++)Wf(Vf[r],e);break;case`image`:Wf(`error`,e),Wf(`load`,e);break;case`details`:Wf(`toggle`,e);break;case`embed`:case`source`:case`link`:Wf(`error`,e),Wf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:ip(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ip(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ut=!0),a=m;break;case`name`:m!==f&&(Ut=!0),i=m;break;case`checked`:m!==f&&(Ut=!0),u=m;break;case`defaultChecked`:m!==f&&(Ut=!0),d=m;break;case`value`:m!==f&&(Ut=!0),s=m;break;case`defaultValue`:m!==f&&(Ut=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}tn(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||ip(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(Ut=!0),p=a;break;case`defaultValue`:a!==l&&(Ut=!0),c=a;break;case`multiple`:a!==l&&(Ut=!0),s=a;default:a!==l&&ip(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?an(e,!!n,n?[]:``,!1):an(e,!!n,t,!0)):an(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ip(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(Ut=!0),p=i;break;case`defaultValue`:i!==a&&(Ut=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&ip(e,t,s,i,r,a)}on(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ip(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ut=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ip(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:ip(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&lp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&lp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function hp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function gp(e,t,n,r){return n=pp(n).createElement(e),n[yt]=r,n[bt]=t,op(n,e,t),Nt(n),n}function _p(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Op(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Up(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Vp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,X,e,s,r)}this._eventListeners=a}};function X(e,t,n,r){return y(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Up(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Vp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Bp,e,n,i),r.splice(t,1),a!==null&&a()}};function Bp(e,t,n,r){return y(e).removeEventListener(t,n,r),!1}function Vp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Hp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Up(e,t,n,r){if(e.length===0)return-1;r=Hp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Hp(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=y(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Vp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Vp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=y(e),Z(e,t))}zp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Gp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Wp(t[n],e);n--);};function Gp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=y(e),e=pp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0))};function Kp(e,t){return e.tag!==6&&(e=y(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,qp,e,void 0,void 0)};function qp(e,t){return e.tag===6||(e=y(e),t.observe(e)),!1}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0);for(var n=t=0;n<Yp.length;n++){var r=Yp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Yp[t++]=r}Yp.length=t}};function Jp(e,t){return e.tag===6||(e=y(e),t.unobserve(e)),!1}var Yp=[],Xp=!1;function Zp(e,t,n){Yp.push({fragmentInstance:e,observer:t,instance:n}),Xp||(Xp=!0,gm(function(){Xp=!1;var e=Yp;Yp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0),e};function Qp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:y(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Gp,n,void 0,void 0);var r=y(t);if(n.length===0){if(n=r,g(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=y(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),i=y(n[n.length-1]);var a=g(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||$p(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function $p(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,w),t===null?t=!1:(m(t,!0,S,a,n),a=b,b=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,w),t===null?t=!1:(m(t,!0,C,a,r),a=b,x=b=null,t=a!==null)),t):!1}function em(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];m(this._fragmentFiber.child,!1,Gp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=_(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=y(r),em(e,n);return}if(r=y(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=y(i),em(i,n)):y(i).scrollIntoView(e),r+=n?-1:1}};function tm(e,t){return e=y(e),nm(e,t),!1}function nm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function rm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Vp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Yp.length;i++){var a=Yp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Yp[r++]=a)}Yp.length=r,n.observe(e)}),nm(e,t))}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Vp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Zp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function am(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:am(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function om(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=fm(e.nextSibling),e===null)break}return null}function sm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=fm(e.nextSibling),e===null))return null;return e}function cm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=fm(e.nextSibling),e===null))return null;return e}function lm(e){return e.data===`$?`||e.data===`$~`}function um(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function dm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function fm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var pm=null;function mm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return fm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Z(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function gm(e){Cp(function(){Cp(function(t){return e(t)})})}function _m(e,t,n){switch(t=pp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),Ot(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var bm=new Map,xm=new Set;function Sm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Cm=ue.d;ue.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=Bd();return e||t}function Tm(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=en(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+en(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+en(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+en(n.imageSizes)+`"]`)):i+=`[href="`+en(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+en(r)+`"][href="`+en(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),op(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Mt(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Nt(c),op(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Mt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Nt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Mt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Nt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var i=(i=ye.current)?Sm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Im(n.href),t=Mt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Im(n.href);var a=Mt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Lm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=bm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bm.set(e,a)),zm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Bm(n),t=Mt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Im(e){return`href="`+en(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),op(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Bm(e){return`[src="`+en(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+en(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var i=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),op(r,`style`,i),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Im(n.href);var a=e.querySelector(Lm(i));if(a)return t.state.loading|=4,t.instance=a,Nt(a),a;r=Rm(n),(i=bm.get(i))&&Wm(r,i),a=(e.ownerDocument||e).createElement(`link`),Nt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(a,`link`,r),t.state.loading|=4,Um(a,n.precedence,e),t.instance=a;case`script`:return a=Bm(n.src),(i=e.querySelector(Vm(a)))?(t.instance=i,Nt(i),i):(r=n,(i=bm.get(a))&&(r=D({},n),Gm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Nt(i),op(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Um(r,n.precedence,e));return t.instance}function Um(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ih.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lh={$$typeof:P,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function uh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function fh(e){return e?(e=Ti,e):Ti}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Fd(n,e,t),ho(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Fd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Md();t=mt(t);var n=Si(e,t);n!==null&&Fd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=V.T;V.T=null;var a=ue.p;try{ue.p=2,xh(e,t,n,r)}finally{ue.p=a,V.T=i}}function bh(e,t,n,r){var i=V.T;V.T=null;var a=ue.p;try{ue.p=8,xh(e,t,n,r)}finally{ue.p=a,V.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)Yf(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Of(a),!(Xu&6)&&(_d=Le()+500,kf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Fd(s,a,2),Bd(),hh(a,2)}if(a=Sh(r),a===null&&Yf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function Sh(e){return e=vn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=kt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ch=e,null}function Th(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=kt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,_t(e.priority,function(){_h(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,_t(e.priority,function(){_h(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_n=r,n.target.dispatchEvent(r),_n=null}else return t=At(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(wh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Kh(e){this._internalRoot=e}qh.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;ph(n,Md(),e,t,null,null)},qh.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Bd(),t[xt]=null}};function qh(e){this._internalRoot=e}qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var Jh=n.version;if(Jh!==`19.3.1`)throw Error(o(527,Jh,`19.3.1`));ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Yh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:V,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Ke=Xh.inject(Yh),qe=Xh}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=yc,a=bc,c=xc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,r,null,i,a,c,Gh),e[xt]=t.current,qf(e),new Kh(t)}})),D=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),O=t(r(),1),k=D(),A=`pi-web-locale`,j=new Set;function ee(){return typeof navigator>`u`||(navigator.languages?.[0]??navigator.language??`zh`).toLowerCase().startsWith(`zh`)?`zh`:`en`}function M(){try{let e=localStorage.getItem(A);if(e===`zh`||e===`en`)return e}catch{}return ee()}var N=M();function P(e){N!==e&&(N=e,typeof document<`u`&&(document.documentElement.lang=e===`zh`?`zh-CN`:`en`),j.forEach(e=>e()))}function F(){document.documentElement.lang=N===`zh`?`zh-CN`:`en`,window.addEventListener(`storage`,e=>{e.key===A&&P(M())})}function I(e){try{localStorage.setItem(A,e)}catch{}P(e)}function te(){return(0,O.useSyncExternalStore)(e=>(j.add(e),()=>{j.delete(e)}),()=>N)}function L(e,t,n){return e===`zh`?t:n}function R(e,t){return L(N,e,t)}var z=m(),ne=class extends O.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){u(e,{stage:`react`,componentStack:t.componentStack??``})}render(){return this.state.failed?(0,z.jsxs)(`main`,{role:`alert`,children:[(0,z.jsx)(`p`,{children:R(`页面遇到错误,请刷新后重试。`,`The page encountered an error. Refresh to try again.`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>location.reload(),children:R(`刷新页面`,`Refresh page`)})]}):this.props.children}},re=1024,ie=.7;function B(e,t){return e>=t+72?`focus`:e<=228?`collapse`:null}function ae(e,t){return e>t?t+Math.min(24,(e-t)/3):e<300?300-Math.min(24,(300-e)/3):null}function oe(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function se(e,t,n){let r=t===0?56:oe(t,264,420),i=e-r-400,a=n===0||i<300?0:Math.min(i,oe(n,300,e*ie));return{sidebar:r,center:Math.max(0,e-r-a),rightbar:a}}function ce(e,t,n){let r=(0,O.useRef)(n);r.current=n,(0,O.useEffect)(()=>{let n=e.current;if(!t||!n)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...n.querySelectorAll(`button, input, select, textarea, a[href], [tabindex]`)].filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.getClientRects().length>0);(n.querySelector(`[data-sidebar-toggle]`)??a()[0]??n).focus();let o=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);if(t[t.length-1]!==n)return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),r.current();return}if(e.key!==`Tab`)return;let i=a(),o=i[0]??n,s=i.at(-1)??n;e.shiftKey&&(document.activeElement===o||!C(n,document.activeElement))?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s&&C(n,document.activeElement)||(e.preventDefault(),o.focus())},s=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);t[t.length-1]===n&&!C(n,e.target)&&(a()[0]??n).focus()};return document.addEventListener(`keydown`,o),document.addEventListener(`focusin`,s),()=>{document.removeEventListener(`keydown`,o),document.removeEventListener(`focusin`,s),i?.isConnected&&i.getClientRects().length>0?i.focus():document.querySelector(`[data-sidebar-toggle]`)?.focus()}},[e,t])}function le({productTitle:e}){return(0,O.useEffect)(()=>(document.title=e,()=>{document.title=e}),[e]),null}var V={frame:`_frame_uzw7i_1`,sidebarCol:`_sidebarCol_uzw7i_27`,centerCol:`_centerCol_uzw7i_36`,drawerMask:`_drawerMask_uzw7i_52`,handle:`_handle_uzw7i_67`,snapHint:`_snapHint_uzw7i_87`,rightbarCol:`_rightbarCol_uzw7i_124`,overlayLayer:`_overlayLayer_uzw7i_132`};function ue(e){return(0,z.jsx)(`div`,{className:V.centerCol,children:e.children})}function de({usePanelInfo:e,renderSlot:t}){return t(`main`,{},{entryKey:e(e=>e.activePanelId)??`conversation`})}function fe(e){return(0,z.jsx)(`div`,{className:V.rightbarCol,"data-rightbar-col":!0,children:e.children})}function pe(e){let[t,n]=(0,O.useState)(!1),r=(0,O.useRef)(0),i=(0,O.useRef)(0),a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=(0,O.useRef)({onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd});s.current={onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd};let c=(0,O.useCallback)((e=!0)=>{let t=o.current;t!==null&&(o.current=null,a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),t.element.hasPointerCapture(t.id)&&t.element.releasePointerCapture(t.id),n(!1),s.current.onEnd(i.current-r.current,e))},[]);(0,O.useEffect)(()=>c,[c]);let l=(0,O.useCallback)(e=>{e.button===0&&o.current===null&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),o.current={element:e.currentTarget,id:e.pointerId},r.current=e.clientX,i.current=e.clientX,s.current.onStart(),n(!0))},[]),u=(0,O.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,a.current??=requestAnimationFrame(()=>{a.current=null,s.current.onDrag(i.current-r.current)}))},[]),d=(0,O.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,s.current.onDrag(e.clientX-r.current),c(!1))},[c]),f=(0,O.useCallback)(e=>{o.current?.id===e.pointerId&&c()},[c]);return(0,z.jsx)(`div`,{className:V.handle,style:{left:e.left},"data-side":e.side,"data-dragging":t||void 0,onPointerDown:l,onPointerMove:u,onPointerUp:d,onPointerCancel:f,onLostPointerCapture:f})}function me({useStore:e,usePanelInfo:t,actions:n,renderSlot:r,t:i}){let a=e(e=>e.layoutInfo),o=(0,O.useRef)(null),s=a.viewportWidth;(0,O.useLayoutEffect)(()=>{let e=o.current;if(e===null)return;let t=null,r=!1,i=()=>{let t=e.getBoundingClientRect().width;t>0&&n.setViewportWidth(t)};i();let a=new ResizeObserver(()=>{r||(t??=requestAnimationFrame(()=>{t=null,i()}))});return a.observe(e),()=>{r=!0,a.disconnect(),t!==null&&cancelAnimationFrame(t)}},[n]);let c=s<re,l=a.rightbarFullscreen&&s>=767,u=l||(c?!a.narrowExpanded:a.sidebar===0),d=u?0:a.sidebar===0?280:a.sidebar,f=a.rightbar??s*.45,p=se(s,!a.rightbarShown&&c?0:d,f),m=c&&!u,h=(0,O.useRef)(null);ce(h,m,n.closeSidebar),(0,O.useEffect)(()=>{if(!m)return;let e=o.current?.querySelectorAll(`.${V.centerCol}, .${V.rightbarCol}`)??[];for(let t of e)t.setAttribute(`inert`,``);return()=>{for(let t of e)t.removeAttribute(`inert`)}},[m]);let g=se(s,c?0:d,a.rightbarTrack?f:0),[_,v]=(0,O.useState)(null),[b,x]=(0,O.useState)(null),S=s-g.sidebar,C=l?s-56:a.rightbarFocus?S:_??p.rightbar,w=l&&a.rightbarTrack?C:a.rightbarFocus&&a.rightbarTrack?S:_!==null&&a.rightbarTrack?_:g.rightbar,T=m?Math.min(d,Math.max(0,s-48)):g.sidebar,E=(0,O.useRef)(g);E.current=g;let D=(0,O.useRef)(p.rightbar);D.current=p.rightbar;let k=(0,O.useRef)(0),A=(0,O.useRef)(0),[j,ee]=(0,O.useState)(!1),M=(0,O.useCallback)(()=>{ee(!1)},[]),N=(0,O.useCallback)(()=>{k.current=E.current.sidebar,ee(!0)},[]),P=(0,O.useCallback)(e=>{n.setSidebar(k.current+e)},[n]),F=Math.min(s*ie,s-g.sidebar-400),I=(0,O.useRef)(F),te=(0,O.useRef)(!1),L=(0,O.useCallback)(()=>{A.current=D.current,I.current=F,te.current=!1,v(null),x(null),ee(!0)},[F]),R=(0,O.useCallback)(e=>{if(te.current)return;let t=A.current-e,r=B(t,I.current);r?(te.current=!0,v(null),x(null),ee(!1),r===`focus`?n.focusRightbar():n.collapseRightbar()):(n.setRightbar(t),v(ae(t,I.current)),x(t>I.current?`focus`:t<300?`collapse`:null))},[n]),ne=(0,O.useCallback)(()=>{v(null),x(null),ee(!1)},[]),oe=i(`brand.localBuild`),me=(0,O.useMemo)(()=>r(`sidebar`,{collapsed:u,width:T}),[r,u,T]),he=(0,O.useMemo)(()=>(0,z.jsx)(de,{usePanelInfo:t,renderSlot:r}),[t,r]),ge=(0,O.useMemo)(()=>r(`shell.overlay`,{}),[r]);return(0,z.jsxs)(`div`,{ref:o,className:V.frame,style:{gridTemplateColumns:`${g.sidebar}px minmax(0, 1fr) ${w}px`},"data-sidebar-collapsed":u||void 0,"data-sidebar-drawer":m||void 0,"data-rightbar-collapsed":g.rightbar===0||void 0,"data-rightbar-fullscreen":a.rightbarFullscreen||void 0,"data-rightbar-focus":a.rightbarFocus||void 0,"data-rightbar-instant":a.rightbarInstant||void 0,"data-dragging":j||void 0,"data-rightbar-elastic":b??void 0,children:[(0,z.jsx)(le,{productTitle:oe}),m&&(0,z.jsx)(`button`,{type:`button`,className:V.drawerMask,tabIndex:-1,"aria-label":i(`sidebar.close`),onClick:n.closeSidebar}),(0,z.jsx)(`div`,{ref:h,className:V.sidebarCol,style:m?{width:T}:void 0,role:m?`dialog`:void 0,"aria-modal":m||void 0,"aria-label":m?i(`sidebar.label`):void 0,tabIndex:m?-1:void 0,children:(0,z.jsx)(y.Provider,{value:m?h:null,children:me})}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ue,{children:he}),(0,z.jsx)(fe,{children:r(`rightbar`,{width:C,viewportWidth:s,canShow:p.rightbar>0})})]}),(0,z.jsx)(`div`,{className:V.overlayLayer,"data-shell-overlay":!0,children:ge}),!u&&!c&&(0,z.jsx)(pe,{side:`sidebar`,left:g.sidebar,onStart:N,onDrag:P,onEnd:M}),a.rightbarShown&&!a.rightbarFullscreen&&!a.rightbarFocus&&p.rightbar>0&&(0,z.jsx)(pe,{side:`rightbar`,left:s-C,onStart:L,onDrag:R,onEnd:ne}),b&&(0,z.jsx)(`div`,{className:V.snapHint,role:`status`,style:{left:s-C},children:i(b===`focus`?`rightbar.drag.focus`:`rightbar.drag.collapse`)})]})}var he=`data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%3E%0A%20%20%3Ctitle%3Epi-webapp%3C%2Ftitle%3E%0A%20%20%3Cpath%20d%3D%22M5.2%209.1c0-1.5%201.2-2.7%202.7-2.7h16.2c1.5%200%202.7%201.2%202.7%202.7v1.1H5.2V9.1Z%22%20fill%3D%22%23172943%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M8.7%2010.2h3.8v12.6c0%202.5-1.8%204.3-4.3%204.3h-.5V10.2h1Z%22%20fill%3D%22%23172943%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M20.7%2010.2h3.8v12.3c0%201%20.6%201.6%201.6%201.6h1.2v3h-1.4c-3.3%200-5.2-1.9-5.2-4.6V10.2Z%22%20fill%3D%22%23172943%22%2F%3E%0A%3C%2Fsvg%3E%0A`;function ge({size:e=24,className:t}){return(0,z.jsx)(`span`,{className:t,"aria-hidden":`true`,style:{display:`inline-block`,flexShrink:0,width:e,height:e,backgroundColor:`currentColor`,maskImage:`url("${he}")`,WebkitMaskImage:`url("${he}")`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}})}var _e={bubble:`_bubble_1nw3t_1`,"tooltip-in":`_tooltip-in_1nw3t_1`};function ve({label:e,side:t=`right`,delayMs:n=0,disabled:r=!1,maxWidth:i,children:a}){let o=(0,O.useRef)(null),s=a.props.ref,c=(0,O.useCallback)(e=>{o.current=e,typeof s==`function`?s(e):s!=null&&(s.current=e)},[s]),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(t),p=(0,O.useRef)(null),m=l===null?null:typeof e==`function`?e():e,h=l===null?0:d===`right`?l.top+(l.bottom-l.top)/2:d===`top`?l.top-8:l.bottom+8;(0,O.useLayoutEffect)(()=>{if(l===null)return;let e=()=>{let e=p.current;if(e===null)return;e.style.left=`${l.x}px`;let n=e.getBoundingClientRect(),r=0;if(n.right>window.innerWidth-12&&(r=window.innerWidth-12-n.right),n.left+r<12&&(r=12-n.left),e.style.left=`${l.x+r}px`,t===`right`)return;let i=l.bottom+8+n.height<=window.innerHeight-12,a=l.top-8-n.height>=12;d===`bottom`&&!i&&a&&f(`top`),d===`top`&&!a&&i&&f(`bottom`)};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[d,l,m,t]);let g=(0,O.useRef)(null),_=(0,O.useRef)({hover:!1,focus:!1}),v=(0,O.useCallback)(()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);(0,O.useEffect)(()=>(r&&(v(),_.current={hover:!1,focus:!1},u(null)),v),[v,r]);let y=()=>{if(r)return;let e=o.current;if(e===null)return;let n=e.getBoundingClientRect();f(t),u({x:t===`right`?n.right+10:n.left+n.width/2,top:n.top,bottom:n.bottom})},b=()=>{v(),n<=0?y():g.current=setTimeout(()=>{g.current=null,y()},n)},x=()=>{v(),!_.current.hover&&!_.current.focus&&u(null)};return(0,z.jsxs)(z.Fragment,{children:[(0,O.cloneElement)(a,{ref:c,onMouseEnter:e=>{a.props.onMouseEnter?.(e),_.current.hover=!0,b()},onMouseLeave:e=>{a.props.onMouseLeave?.(e),_.current.hover=!1,v(),u(null)},onFocus:e=>{a.props.onFocus?.(e),_.current.focus=!0,v(),y()},onBlur:e=>{a.props.onBlur?.(e),_.current.focus=!1,x()}}),l!==null&&(0,z.jsx)(`span`,{ref:p,className:_e.bubble,"data-side":d,style:{left:l.x,top:h,...i===void 0?{}:{maxWidth:i}},role:`tooltip`,children:m})]})}var ye={dot:`_dot_1cjbl_3`,matrix:`_matrix_1cjbl_4`,cell:`_cell_1cjbl_62`,"piw-state-dot-chase":`_piw-state-dot-chase_1cjbl_1`},be=[[0,0],[4,0],[8,0],[8,4],[8,8],[4,8],[0,8],[0,4]];function xe({state:e,size:t=10,className:n}){return e===`ongoing`?(0,z.jsx)(`svg`,{className:h(ye.matrix,n),"data-state":`ongoing`,width:t,height:t,viewBox:`0 0 10 10`,shapeRendering:`crispEdges`,"aria-hidden":`true`,children:be.map(([e,t],n)=>(0,z.jsx)(`rect`,{className:ye.cell,x:e,y:t,width:`2`,height:`2`,style:{animationDelay:`${(n-be.length)*125}ms`}},`${e}-${t}`))}):(0,z.jsx)(`span`,{className:h(ye.dot,n),"data-state":e,style:{width:t,height:t},"aria-hidden":`true`})}var Se=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M8.00003 0.3237C3.76075 0.3237 0.32373 3.76072 0.32373 8C0.32373 9.17603 0.589121 10.2922 1.0632 11.2901L1.35291 11.8989L2.5705 11.3205L2.28079 10.7117C1.89079 9.89074 1.67301 8.97167 1.67301 8C1.67301 4.50546 4.50549 1.67298 8.00003 1.67298C11.4946 1.67298 14.3271 4.50546 14.3271 8C14.3271 11.4945 11.4946 14.327 8.00003 14.327C7.28473 14.327 6.76077 14.277 6.29621 14.1487C5.83857 14.0224 5.40441 13.8109 4.88514 13.4488C4.12569 12.919 3.03778 12.7316 2.141 13.2978L2.12682 13.307L2.11264 13.3171L1.34886 13.854L1.79659 15.188L2.86122 14.4384C3.19068 14.2305 3.68325 14.2542 4.11326 14.5539C4.72789 14.9826 5.30042 15.2724 5.93762 15.4484C6.56803 15.6224 7.22776 15.6763 8.00003 15.6763C12.2393 15.6763 15.6763 12.2393 15.6763 8C15.6763 3.76072 12.2393 0.3237 8.00003 0.3237ZM7.32033 4.82535V7.32536H4.82538V8.67464H7.32033V11.1747H8.6696V8.67464H11.1747V7.32536H8.6696V4.82535H7.32033Z`,fill:`currentColor`})}),Ce=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M11.894845 6.647401C11.894845 3.725463 9.534486 1.356779 6.623219 1.35657C3.711786 1.35657 1.351635 3.725338 1.351635 6.647401C1.351843 9.569296 3.711911 11.938273 6.623219 11.938273C9.534361 11.938064 11.894637 9.569171 11.894845 6.647401ZM13.245462 6.647401C13.245254 10.317935 10.280401 13.293613 6.623219 13.293821C2.965871 13.293821 0.000204 10.31806 0 6.647401C0 2.976574 2.965746 0 6.623219 0C10.280526 0.000205 13.245462 2.9767 13.245462 6.647401Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z`,fill:`currentColor`})]}),we=({size:e=14,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsxs)(`g`,{clipPath:`url(#clip0_2580_121189)`,children:[(0,z.jsx)(`path`,{d:`M12.1192 4.91016C11.9392 4.52714 11.7007 4.1292 11.4483 3.78809C11.385 3.70258 11.3517 3.68409 11.2462 3.67383C10.7419 3.6248 10.2318 3.69454 9.72662 3.64551C9.29108 3.60318 8.93739 3.40341 8.67682 3.05176C8.38762 2.66127 8.19217 2.20926 7.90338 1.81934C7.83985 1.73359 7.80848 1.71542 7.70221 1.70508C7.24758 1.6609 6.7511 1.66104 6.29791 1.70508C6.19164 1.71542 6.16027 1.73359 6.09674 1.81934C5.80775 2.20954 5.61248 2.66131 5.3233 3.05176C5.06273 3.40341 4.70904 3.60318 4.2735 3.64551C3.76831 3.69454 3.25825 3.6248 2.75397 3.67383C2.6484 3.68409 2.61509 3.70258 2.55182 3.78809C2.30019 4.12814 2.06125 4.52646 1.88092 4.91016C1.83256 5.01309 1.83242 5.04912 1.88092 5.15235C2.07954 5.57482 2.37449 5.94529 2.5733 6.36817C2.76971 6.78606 2.76964 7.21293 2.5733 7.63086C2.37462 8.05374 2.07947 8.42453 1.88092 8.84668C1.83235 8.95004 1.83257 8.98695 1.88092 9.08985C2.06098 9.47285 2.2994 9.87079 2.55182 10.2119C2.61509 10.2974 2.6484 10.3159 2.75397 10.3262C3.25879 10.3753 3.76834 10.3055 4.2735 10.3545C4.70904 10.3968 5.06273 10.5966 5.3233 10.9482C5.6125 11.3387 5.80795 11.7907 6.09674 12.1807C6.16027 12.2664 6.19164 12.2846 6.29791 12.2949C6.7511 12.339 7.24758 12.3391 7.70221 12.2949C7.80848 12.2846 7.83985 12.2664 7.90338 12.1807C8.19237 11.7905 8.38764 11.3387 8.67682 10.9482C8.93739 10.5966 9.29108 10.3968 9.72662 10.3545C10.2318 10.3055 10.7419 10.3752 11.2462 10.3262C11.3517 10.3159 11.385 10.2974 11.4483 10.2119C11.7007 9.87079 11.9391 9.47285 12.1192 9.08985C12.1675 8.98695 12.1678 8.95004 12.1192 8.84668C11.9205 8.42428 11.6255 8.05377 11.4268 7.63086C11.2305 7.21293 11.2304 6.78606 11.4268 6.36817C11.6256 5.94531 11.9207 5.5746 12.1192 5.15235C12.1677 5.04912 12.1676 5.01309 12.1192 4.91016ZM13.2051 5.66309C13.0064 6.08573 12.7114 6.45579 12.5128 6.87793C12.4642 6.98123 12.4645 7.01829 12.5128 7.1211C12.7112 7.54328 13.0064 7.91405 13.2051 8.33692C13.4015 8.75487 13.4015 9.18169 13.2051 9.59961C12.9911 10.0551 12.7109 10.5221 12.4122 10.9258C12.1522 11.277 11.7974 11.4782 11.3624 11.5205C10.8573 11.5696 10.3477 11.4999 9.84283 11.5488C9.73621 11.5592 9.70429 11.5772 9.64069 11.6631C9.35229 12.0526 9.15705 12.5044 8.86823 12.8945C8.60854 13.2452 8.25275 13.447 7.81842 13.4893C7.28749 13.5409 6.71096 13.5407 6.1817 13.4893C5.74737 13.447 5.39158 13.2452 5.1319 12.8945C4.84312 12.5045 4.64808 12.0529 4.35944 11.6631C4.29583 11.5772 4.26392 11.5592 4.15729 11.5488C3.65283 11.5 3.14295 11.5696 2.63776 11.5205C2.20274 11.4782 1.84796 11.277 1.58795 10.9258C1.28834 10.5209 1.00864 10.0543 0.794982 9.59961C0.598644 9.18169 0.598598 8.75487 0.794982 8.33692C0.993688 7.91405 1.28889 7.54328 1.48737 7.1211C1.53567 7.01829 1.53593 6.98123 1.48737 6.87793C1.28887 6.45603 0.993667 6.08569 0.794982 5.66309C0.598535 5.24516 0.59869 4.81829 0.794982 4.40039C1.00898 3.94492 1.28922 3.47791 1.58795 3.07422C1.84796 2.723 2.20274 2.5218 2.63776 2.47949C3.14295 2.43038 3.65283 2.50003 4.15729 2.45117C4.26391 2.44081 4.29583 2.4228 4.35944 2.33692C4.64783 1.94742 4.84308 1.49557 5.1319 1.10547C5.39158 0.754835 5.74737 0.553005 6.1817 0.510744C6.71263 0.459147 7.28917 0.459309 7.81842 0.510744C8.25275 0.553005 8.60854 0.754835 8.86823 1.10547C9.157 1.49551 9.35204 1.94708 9.64069 2.33692C9.70429 2.4228 9.73621 2.44081 9.84283 2.45117C10.3477 2.50007 10.8573 2.43039 11.3624 2.47949C11.7974 2.5218 12.1522 2.723 12.4122 3.07422C12.7118 3.47909 12.9915 3.94567 13.2051 4.40039C13.4014 4.81829 13.4016 5.24516 13.2051 5.66309Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.9317 7C7.9317 6.48569 7.51438 6.06836 7.00006 6.06836C6.48575 6.06836 6.06842 6.48569 6.06842 7C6.06842 7.51432 6.48575 7.93164 7.00006 7.93164C7.51438 7.93164 7.9317 7.51432 7.9317 7ZM9.13092 7C9.13092 8.17706 8.17712 9.13086 7.00006 9.13086C5.823 9.13086 4.8692 8.17706 4.8692 7C4.8692 5.82294 5.823 4.86914 7.00006 4.86914C8.17712 4.86914 9.13092 5.82294 9.13092 7Z`,fill:`currentColor`})]}),(0,z.jsx)(`defs`,{children:(0,z.jsx)(`clipPath`,{id:`clip0_2580_121189`,children:(0,z.jsx)(`rect`,{width:14,height:14,fill:`currentColor`})})})]}),Te=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsxs)(`g`,{clipPath:`url(#clip0_1450_63327)`,children:[(0,z.jsx)(`path`,{d:`M14.0861 5.51366C13.8717 5.0575 13.588 4.58542 13.2889 4.18108C13.208 4.07172 13.1596 4.04373 13.0243 4.03054C12.4277 3.97255 11.8245 4.05527 11.2269 3.9972C10.7224 3.94816 10.3133 3.71661 10.0115 3.30919C9.66986 2.84777 9.43973 2.31343 9.09824 1.85234C9.01771 1.74365 8.96805 1.71589 8.83354 1.70282C8.29432 1.65044 7.70402 1.65061 7.16656 1.70282C7.03205 1.71589 6.98239 1.74365 6.90186 1.85234C6.56067 2.31303 6.33025 2.84774 5.98855 3.30919C5.68681 3.71661 5.27774 3.94816 4.77317 3.9972C4.17564 4.05527 3.57239 3.97255 2.97585 4.03054C2.84046 4.04373 2.79208 4.07172 2.71115 4.18108C2.41212 4.58542 2.12835 5.0575 1.91403 5.51366C1.85299 5.64359 1.85286 5.7018 1.91403 5.8319C2.14865 6.33077 2.49748 6.76892 2.73237 7.26854C2.9594 7.7515 2.96041 8.24717 2.73338 8.73044C2.49837 9.23061 2.14891 9.66837 1.91403 10.1681C1.85291 10.2982 1.85299 10.3564 1.91403 10.4863C2.12856 10.9429 2.41185 11.4142 2.71115 11.8189C2.79208 11.9283 2.84046 11.9563 2.97585 11.9694C3.57239 12.0274 4.17564 11.9447 4.77317 12.0028C5.27774 12.0518 5.68681 12.2834 5.98855 12.6908C6.33024 13.1522 6.56037 13.6866 6.90186 14.1476C6.98239 14.2563 7.03205 14.2841 7.16656 14.2972C7.70402 14.3494 8.29432 14.3495 8.83354 14.2972C8.96805 14.2841 9.01771 14.2563 9.09824 14.1476C9.43944 13.687 9.66985 13.1522 10.0115 12.6908C10.3133 12.2834 10.7224 12.0518 11.2269 12.0028C11.8244 11.9447 12.4271 12.0275 13.0243 11.9694C13.1596 11.9563 13.208 11.9283 13.2889 11.8189C13.5891 11.4131 13.872 10.942 14.0861 10.4863C14.1471 10.3564 14.1472 10.2982 14.0861 10.1681C13.8513 9.66861 13.5017 9.23061 13.2667 8.73044C13.0397 8.24717 13.0407 7.7515 13.2677 7.26854C13.5026 6.7689 13.8513 6.33106 14.0861 5.8319C14.1472 5.7018 14.1471 5.64359 14.0861 5.51366ZM15.3035 6.40373C15.0685 6.90359 14.7188 7.34119 14.4841 7.84037C14.4231 7.97025 14.423 8.02855 14.4841 8.15861C14.7189 8.65833 15.0685 9.09611 15.3035 9.59626C15.5308 10.0801 15.5308 10.5744 15.3035 11.0582C15.052 11.5933 14.7225 12.1426 14.37 12.6191C14.0685 13.0265 13.6581 13.259 13.1536 13.3081C12.5566 13.366 11.9541 13.2835 11.3573 13.3414C11.2228 13.3545 11.1731 13.3823 11.0926 13.491C10.7511 13.9521 10.521 14.4864 10.1793 14.9478C9.87828 15.3542 9.46719 15.5869 8.96387 15.6358C8.34008 15.6964 7.66194 15.6966 7.03623 15.6358C6.53291 15.5869 6.12182 15.3542 5.82084 14.9478C5.47911 14.4863 5.24878 13.9517 4.90753 13.491C4.82701 13.3823 4.77734 13.3545 4.64284 13.3414C4.04647 13.2835 3.44373 13.366 2.84653 13.3081C2.34201 13.259 1.93164 13.0265 1.63013 12.6191C1.27867 12.144 0.948453 11.5941 0.696621 11.0582C0.469315 10.5744 0.469279 10.0801 0.696621 9.59626C0.931628 9.09613 1.2813 8.65807 1.51597 8.15861C1.57708 8.02855 1.57702 7.97025 1.51597 7.84037C1.28117 7.34095 0.931635 6.9036 0.696621 6.40373C0.469213 5.91992 0.469367 5.42562 0.696621 4.94183C0.948441 4.40587 1.27868 3.85598 1.63013 3.38092C1.93164 2.97349 2.34201 2.74095 2.84653 2.6919C3.44353 2.63397 4.04599 2.71649 4.64284 2.65856C4.77734 2.64549 4.82701 2.61774 4.90753 2.50904C5.24905 2.04792 5.47913 1.51362 5.82084 1.05219C6.12182 0.645806 6.53291 0.413119 7.03623 0.364178C7.66002 0.303556 8.33816 0.303369 8.96387 0.364178C9.46719 0.413119 9.87828 0.645806 10.1793 1.05219C10.521 1.51365 10.7513 2.04828 11.0926 2.50904C11.1731 2.61774 11.2228 2.64549 11.3573 2.65856C11.9541 2.71649 12.5566 2.63397 13.1536 2.6919C13.6581 2.74095 14.0685 2.97349 14.37 3.38092C14.7214 3.85598 15.0517 4.40587 15.3035 4.94183C15.5307 5.42562 15.5309 5.91992 15.3035 6.40373Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M9.13764 7.99999C9.13764 7.3715 8.62855 6.8624 8.00005 6.8624C7.37155 6.8624 6.86246 7.3715 6.86246 7.99999C6.86246 8.62849 7.37155 9.13759 8.00005 9.13759C8.62855 9.13759 9.13764 8.62849 9.13764 7.99999ZM10.4834 7.99999C10.4834 9.37126 9.37132 10.4833 8.00005 10.4833C6.62878 10.4833 5.51674 9.37126 5.51674 7.99999C5.51674 6.62873 6.62878 5.51669 8.00005 5.51669C9.37132 5.51669 10.4834 6.62873 10.4834 7.99999Z`,fill:`currentColor`})]}),(0,z.jsx)(`defs`,{children:(0,z.jsx)(`clipPath`,{id:`clip0_1450_63327`,children:(0,z.jsx)(`rect`,{width:16,height:16,fill:`currentColor`})})})]}),Ee=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z`,fill:`currentColor`})}),De=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M4.55146 8.00001C4.55146 8.63513 4.03659 9.15001 3.40146 9.15001C2.76634 9.15001 2.25146 8.63513 2.25146 8.00001C2.25146 7.36488 2.76634 6.85001 3.40146 6.85001C4.03659 6.85001 4.55146 7.36488 4.55146 8.00001Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M9.1476 8.00001C9.1476 8.63513 8.63273 9.15001 7.9976 9.15001C7.36248 9.15001 6.8476 8.63513 6.8476 8.00001C6.8476 7.36488 7.36248 6.85001 7.9976 6.85001C8.63273 6.85001 9.1476 7.36488 9.1476 8.00001Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M13.7486 8.00001C13.7486 8.63513 13.2338 9.15001 12.5986 9.15001C11.9635 9.15001 11.4486 8.63513 11.4486 8.00001C11.4486 7.36488 11.9635 6.85001 12.5986 6.85001C13.2338 6.85001 13.7486 7.36488 13.7486 8.00001Z`,fill:`currentColor`})]}),Oe=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M8.64453 1.5V7.34961H14.5V8.65039H8.64453V14.5H7.34473V8.65039H1.5V7.34961H7.34473V1.5H8.64453Z`,fill:`currentColor`})}),ke=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M15.0498 3.92579L8.49512 12.3818C8.25774 12.6881 8.04517 12.9645 7.84668 13.1689C7.63957 13.3823 7.38732 13.5841 7.04492 13.6719C6.86373 13.7183 6.6757 13.7346 6.48926 13.7197C6.13666 13.6915 5.8528 13.5355 5.6123 13.3604C5.38201 13.1926 5.12573 12.9567 4.83984 12.6953L1.03125 9.21289L1.96875 8.1875L5.77734 11.6699C6.08684 11.9529 6.27773 12.1249 6.43066 12.2363C6.50183 12.2882 6.54699 12.3135 6.57324 12.3252C6.58525 12.3305 6.59269 12.3322 6.5957 12.333C6.59802 12.3336 6.59961 12.334 6.59961 12.334C6.63317 12.3367 6.66758 12.3335 6.7002 12.3252C6.7002 12.3252 6.70211 12.3251 6.7041 12.3242C6.70698 12.3229 6.71348 12.319 6.72461 12.3115C6.74849 12.2956 6.78843 12.2642 6.84961 12.2012C6.98138 12.0654 7.13957 11.8628 7.39648 11.5313L13.9502 3.07422L15.0498 3.92579Z`,fill:`currentColor`})}),Ae=({size:e=14,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z`,fill:`currentColor`})}),je=({size:e=14,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M5.5 2.15137L5.92383 2.57617L8.65137 5.30273C8.90706 5.55843 9.13382 5.78438 9.29785 5.98828C9.46883 6.20088 9.61756 6.44405 9.66602 6.75C9.69222 6.91565 9.69222 7.08435 9.66602 7.25C9.61756 7.55595 9.46883 7.79912 9.29785 8.01172C9.13382 8.21561 8.90706 8.44157 8.65137 8.69727L5.92383 11.4238L5.5 11.8486L4.65137 11L5.07617 10.5762L7.80273 7.84863C8.07732 7.57405 8.24849 7.40124 8.3623 7.25977C8.46904 7.12709 8.47813 7.07728 8.48047 7.0625C8.48703 7.02105 8.48703 6.97895 8.48047 6.9375C8.47813 6.92272 8.46904 6.87291 8.3623 6.74023C8.24848 6.59876 8.07732 6.42595 7.80273 6.15137L5.07617 3.42383L4.65137 3L5.5 2.15137Z`,fill:`currentColor`})}),Me=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M14.1168 13.197L13.197 14.1167L1.8833 2.80303L2.80309 1.88324L14.1168 13.197Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M13.197 1.88326L14.1168 2.80305L2.80309 14.1168L1.8833 13.197L13.197 1.88326Z`,fill:`currentColor`})]}),Ne=({size:e=14,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M10.6074 4.40278L8.00975 6.99973L10.6074 9.59739L9.59736 10.6074L6.9997 8.00978L4.40274 10.6074L3.3927 9.59739L5.98966 6.99973L3.3927 4.40278L4.40274 3.39273L6.9997 5.98969L9.59736 3.39273L10.6074 4.40278Z`,fill:`currentColor`})}),Pe=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M6.14929 4.02032C7.11197 4.02032 7.87983 4.02016 8.49597 4.07598C9.12128 4.13269 9.65792 4.25188 10.1415 4.53106C10.7202 4.8653 11.2008 5.3459 11.535 5.92462C11.8142 6.40818 11.9334 6.94481 11.9901 7.57012C12.0459 8.18625 12.0458 8.95419 12.0458 9.9168C12.0458 10.8795 12.0459 11.6473 11.9901 12.2635C11.9334 12.8888 11.8142 13.4254 11.535 13.909C11.2008 14.4877 10.7202 14.9683 10.1415 15.3025C9.65792 15.5817 9.12128 15.7009 8.49597 15.7576C7.87984 15.8134 7.11196 15.8133 6.14929 15.8133C5.18667 15.8133 4.41874 15.8134 3.80261 15.7576C3.1773 15.7009 2.64067 15.5817 2.1571 15.3025C1.5784 14.9683 1.09778 14.4877 0.76355 13.909C0.484366 13.4254 0.365184 12.8888 0.308472 12.2635C0.252649 11.6473 0.252808 10.8795 0.252808 9.9168C0.252808 8.95418 0.252664 8.18625 0.308472 7.57012C0.365184 6.94481 0.484366 6.40818 0.76355 5.92462C1.09777 5.34589 1.57839 4.86529 2.1571 4.53106C2.64067 4.25188 3.1773 4.13269 3.80261 4.07598C4.41874 4.02017 5.18666 4.02032 6.14929 4.02032ZM6.14929 5.37774C5.16181 5.37774 4.46634 5.37761 3.92566 5.42657C3.39434 5.47472 3.07859 5.56574 2.83582 5.70587C2.4632 5.92106 2.15354 6.2307 1.93835 6.60333C1.79823 6.8461 1.70721 7.16185 1.65906 7.69317C1.6101 8.23385 1.61023 8.92933 1.61023 9.9168C1.61023 10.9043 1.61009 11.5998 1.65906 12.1404C1.70721 12.6717 1.79823 12.9875 1.93835 13.2303C2.15356 13.6029 2.46321 13.9126 2.83582 14.1277C3.07859 14.2679 3.39434 14.3589 3.92566 14.407C4.46634 14.456 5.16182 14.4559 6.14929 14.4559C7.13682 14.4559 7.83224 14.456 8.37292 14.407C8.90425 14.3589 9.21999 14.2679 9.46277 14.1277C9.83535 13.9126 10.145 13.6029 10.3602 13.2303C10.5004 12.9875 10.5914 12.6717 10.6395 12.1404C10.6885 11.5998 10.6884 10.9043 10.6884 9.9168C10.6884 8.92934 10.6885 8.23384 10.6395 7.69317C10.5914 7.16185 10.5004 6.8461 10.3602 6.60333C10.1451 6.23071 9.83536 5.92107 9.46277 5.70587C9.21999 5.56574 8.90424 5.47472 8.37292 5.42657C7.83224 5.3776 7.13682 5.37774 6.14929 5.37774ZM9.80164 0.367975C10.7638 0.367975 11.5314 0.36788 12.1473 0.423639C12.7726 0.480307 13.3093 0.598759 13.7928 0.877741C14.3717 1.21192 14.8521 1.69355 15.1864 2.27227C15.4655 2.75574 15.5857 3.29164 15.6425 3.9168C15.6983 4.53301 15.6971 5.3016 15.6971 6.26446V7.82989C15.6971 8.29264 15.6989 8.58993 15.6649 8.84844C15.4668 10.3525 14.401 11.5738 12.9833 11.9988V10.5467C13.6973 10.1903 14.2105 9.49662 14.3192 8.67169C14.3387 8.52347 14.3407 8.3358 14.3407 7.82989V6.26446C14.3407 5.27706 14.3398 4.58149 14.2909 4.04083C14.2428 3.50968 14.1526 3.19372 14.0126 2.95098C13.7974 2.57849 13.4876 2.26869 13.1151 2.05352C12.8724 1.91347 12.5564 1.82237 12.0253 1.77423C11.4847 1.72528 10.7888 1.7254 9.80164 1.7254H7.71472C6.7562 1.72558 5.92665 2.27697 5.52332 3.07891H4.07019C4.54221 1.51132 5.9932 0.368186 7.71472 0.367975H9.80164Z`,fill:`currentColor`})}),Fe=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M9.94076 1.34942C10.7047 0.90231 11.6503 0.902415 12.4143 1.34942C12.7061 1.52015 12.9688 1.79118 13.3104 2.13284C13.6521 2.47448 13.9231 2.73721 14.0939 3.02894C14.5408 3.79294 14.5409 4.73856 14.0939 5.50251C13.9231 5.79415 13.652 6.05704 13.3104 6.39861L6.65932 13.0497C6.28068 13.4284 6.00695 13.7108 5.66543 13.9097C5.32391 14.1085 4.94315 14.2074 4.42705 14.3498L3.24394 14.6761C2.77527 14.8054 2.34538 14.9262 2.00131 14.9684C1.65196 15.0112 1.17964 15.0013 0.810764 14.6325C0.441921 14.2637 0.432107 13.7913 0.47486 13.442C0.517035 13.0979 0.6379 12.668 0.767181 12.1993L1.09352 11.0162C1.23588 10.5001 1.33481 10.1193 1.5336 9.77784C1.7325 9.43632 2.0149 9.1626 2.39355 8.78395L9.04466 2.13284C9.38625 1.79126 9.64911 1.52016 9.94076 1.34942ZM15.5427 14.8398H7.55223L8.96707 13.425H15.5427V14.8398ZM3.39382 9.78422C2.965 10.213 2.84244 10.3436 2.75709 10.49C2.67183 10.6366 2.61862 10.8079 2.45733 11.3925L2.13099 12.5756C2.00183 13.0439 1.92194 13.3419 1.88863 13.5536C2.10041 13.5204 2.39872 13.4416 2.86764 13.3123L4.05075 12.9859C4.63544 12.8246 4.80669 12.7715 4.95323 12.6862C5.09968 12.6008 5.23022 12.4783 5.65905 12.0494L10.721 6.98644L8.45577 4.72121L3.39382 9.78422ZM11.7 2.57079C11.3774 2.38198 10.9777 2.38198 10.6551 2.57079C10.5602 2.62647 10.4487 2.72931 10.0449 3.13311L9.45604 3.72094L11.7213 5.98617L12.3102 5.39833C12.7139 4.99457 12.8168 4.88307 12.8725 4.78818C13.0613 4.46561 13.0612 4.06585 12.8725 3.74326C12.8169 3.64827 12.7146 3.53752 12.3102 3.13311C11.9057 2.72863 11.795 2.6264 11.7 2.57079Z`,fill:`currentColor`})}),Ie=({size:e=14,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M7.06431 5.93342C7.68763 5.93342 8.19307 6.43904 8.19322 7.06233C8.19322 7.68573 7.68772 8.19123 7.06431 8.19123C6.44099 8.19113 5.9354 7.68567 5.9354 7.06233C5.93555 6.43911 6.44108 5.93353 7.06431 5.93342Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.6815 0.963693C10.1169 0.447019 11.6266 0.374829 12.5633 1.31135C13.5 2.24805 13.4277 3.75776 12.911 5.19319C12.7126 5.74431 12.4386 6.31796 12.0965 6.89729C12.4969 7.54638 12.8141 8.19018 13.036 8.80647C13.5527 10.2419 13.6251 11.7516 12.6883 12.6883C11.7516 13.625 10.242 13.5527 8.8065 13.036C8.19022 12.8141 7.54641 12.4969 6.89732 12.0965C6.31797 12.4386 5.74435 12.7125 5.19322 12.911C3.75777 13.4276 2.2481 13.5 1.31138 12.5633C0.374859 11.6266 0.447049 10.1168 0.963724 8.68147C1.17185 8.10338 1.46321 7.50063 1.82896 6.8924C1.52182 6.35711 1.27235 5.82825 1.08872 5.31819C0.572068 3.88278 0.499714 2.37306 1.43638 1.43635C2.37308 0.499655 3.8828 0.572044 5.31822 1.08869C5.82828 1.27232 6.35715 1.5218 6.89243 1.82893C7.50066 1.46318 8.10341 1.17181 8.6815 0.963693ZM11.3573 8.01154C10.9083 8.62253 10.3901 9.22873 9.80943 9.8094C9.22877 10.3901 8.62255 10.9083 8.01158 11.3572C8.4257 11.5841 8.8287 11.7688 9.21275 11.9071C10.5456 12.3868 11.4246 12.2547 11.8397 11.8397C12.2548 11.4246 12.3869 10.5456 11.9071 9.21272C11.7688 8.82866 11.5841 8.42568 11.3573 8.01154ZM2.56529 8.02912C2.37344 8.39322 2.21495 8.74796 2.09263 9.08772C1.61291 10.4204 1.74512 11.2995 2.16001 11.7147C2.57505 12.1297 3.45415 12.2618 4.78697 11.7821C5.11057 11.6656 5.44786 11.5164 5.7938 11.3367C5.249 10.9223 4.70922 10.4533 4.19029 9.9344C3.57578 9.31987 3.03169 8.67633 2.56529 8.02912ZM6.90708 3.2469C6.24065 3.70479 5.5646 4.26321 4.91392 4.91389C4.26325 5.56456 3.70482 6.24063 3.24693 6.90705C3.72674 7.63325 4.32777 8.37459 5.03892 9.08576C5.64943 9.69627 6.28183 10.2265 6.90806 10.6678C7.59368 10.2025 8.2908 9.63076 8.96079 8.96076C9.6308 8.29075 10.2025 7.59366 10.6678 6.90803C10.2265 6.2818 9.69631 5.6494 9.08579 5.03889C8.37462 4.32773 7.63328 3.72672 6.90708 3.2469ZM11.7147 2.15998C11.2996 1.74509 10.4204 1.61288 9.08775 2.0926C8.74835 2.21479 8.39382 2.37271 8.03013 2.56428C8.67728 3.03065 9.31995 3.5758 9.93443 4.19026C10.4534 4.7092 10.9223 5.24896 11.3368 5.79377C11.5164 5.44785 11.6656 5.11052 11.7821 4.78694C12.2618 3.45416 12.1297 2.57502 11.7147 2.15998ZM4.91197 2.2176C3.57922 1.73788 2.70004 1.86995 2.28501 2.28498C1.87001 2.70003 1.73791 3.5792 2.21763 4.91194C2.31709 5.18822 2.44112 5.47427 2.58677 5.7674C3.01931 5.1887 3.51474 4.6158 4.06529 4.06526C4.61584 3.5147 5.18872 3.01928 5.76743 2.58674C5.47431 2.4411 5.18824 2.31706 4.91197 2.2176Z`,fill:`currentColor`})]}),Le=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M14.4782 4.84067L14.2138 10.1152C14.1102 12.1872 14.067 13.0115 13.3866 13.9607C13.1044 14.3546 12.7498 14.6912 12.3424 14.9535C11.8239 15.2872 11.2415 15.4316 10.5585 15.4998C9.88727 15.5668 9.04946 15.5656 7.99998 15.5656C6.95051 15.5656 6.1127 15.5668 5.44142 15.4998C4.75851 15.4316 4.17602 15.2872 3.65753 14.9535C3.25012 14.6912 2.89559 14.3546 2.61332 13.9607C1.93296 13.0115 1.88979 12.1872 1.78619 10.1152L1.52179 4.84067L2.89006 4.77277L3.15343 10.0463C3.26221 12.2218 3.32452 12.6015 3.72646 13.1624C3.90825 13.4161 4.13686 13.6334 4.39927 13.8023C4.66204 13.9714 5.00263 14.0792 5.57825 14.1367C6.16562 14.1953 6.92298 14.1963 7.99998 14.1963C9.07699 14.1963 9.83434 14.1953 10.4217 14.1367C10.9973 14.0792 11.3379 13.9714 11.6007 13.8023C11.8631 13.6334 12.0917 13.4161 12.2735 13.1624C12.6755 12.6015 12.7378 12.2218 12.8465 10.0463L13.1099 4.77277L14.4782 4.84067ZM5.43011 6.22849H6.7994V11.3909H5.43011V6.22849ZM9.20056 6.22849H10.5699V11.3909H9.20056V6.22849ZM8.53597 0.434431C9.17976 0.434431 9.6522 0.426926 10.0966 0.571258C10.2357 0.616451 10.3717 0.672554 10.502 0.738948C10.9182 0.951107 11.2464 1.29099 11.7015 1.74612L12.4978 2.54136H15.3742V3.91169H0.625732V2.54136H3.50218L4.29845 1.74612C4.75358 1.29099 5.08174 0.951107 5.49801 0.738948C5.62831 0.672554 5.76425 0.616451 5.90334 0.571258C6.34776 0.426926 6.82021 0.434431 7.46399 0.434431H8.53597ZM7.46399 1.80476C6.73208 1.80476 6.51641 1.81187 6.32617 1.87369C6.25545 1.89667 6.18668 1.92533 6.12041 1.95907C5.96398 2.03878 5.82348 2.16253 5.44142 2.54136H10.5585C10.1765 2.16253 10.036 2.03878 9.87955 1.95907C9.81329 1.92533 9.74452 1.89667 9.6738 1.87369C9.48356 1.81187 9.26789 1.80476 8.53597 1.80476H7.46399Z`,fill:`currentColor`})}),Re=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M15.3695 11.411L15.1234 12.8866C14.8869 14.3042 13.6603 15.3436 12.223 15.3436H3.77673C2.33958 15.3434 1.1128 14.3042 0.876343 12.8866L0.630249 11.411L2.05408 11.1747L2.29919 12.6493C2.41973 13.3713 3.04475 13.9001 3.77673 13.9003H12.223C12.9551 13.9002 13.58 13.3713 13.7006 12.6493L13.9457 11.1747L15.3695 11.411ZM8.72205 8.994C8.77717 8.93934 8.83792 8.88106 8.90271 8.81627L12.4828 5.23424L13.5043 6.25572L9.92224 9.8358C9.6395 10.1185 9.38763 10.3732 9.15857 10.5575C8.91892 10.7503 8.63953 10.9224 8.2865 10.9784C8.09711 11.0083 7.90363 11.0083 7.71423 10.9784C7.36106 10.9224 7.0809 10.7503 6.84119 10.5575C6.61215 10.3732 6.36022 10.1185 6.07751 9.8358L2.49646 6.25572L3.51697 5.23424L7.09705 8.81627C7.16219 8.88142 7.22331 8.94006 7.27869 8.99498V1.3065H8.72205V8.994Z`,fill:`currentColor`})}),ze=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.3368 1.53569L11.931 4.43172H14.8086V5.79673H11.7404L11.1962 9.67859H14.2839V11.0436H11.0056L10.4994 14.6529L9.14873 14.4643L9.62731 11.0436H5.75876L5.25252 14.6529L3.90186 14.4643L4.38043 11.0436H1.69141V9.67859H4.57104L5.11417 5.79673H2.21609V4.43172H5.30581L5.73724 1.34713L7.08995 1.53569L6.68414 4.43172H10.5527L10.9841 1.34713L12.3368 1.53569ZM5.94937 9.67859H9.81791L10.361 5.79673H6.49353L5.94937 9.67859Z`,fill:`currentColor`})}),Be=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,z.jsx)(`path`,{transform:`translate(1.292 1.3)`,d:`M10.3232 9.18164C11.2868 9.18164 12.0985 9.82833 12.3506 10.7109L13.415 10.7109L13.415 11.8711L12.3496 11.8711C12.0971 12.7532 11.2864 13.3994 10.3232 13.3994C9.36031 13.3992 8.55012 12.7531 8.29785 11.8711L0 11.8711L0 10.7109L8.29688 10.7109C8.54876 9.82845 9.35988 9.18186 10.3232 9.18164ZM10.3232 10.3418C9.7999 10.3421 9.37534 10.7667 9.375 11.29C9.375 11.8137 9.79969 12.239 10.3232 12.2393C10.847 12.2393 11.2725 11.8138 11.2725 11.29C11.2721 10.7666 10.8468 10.3418 10.3232 10.3418ZM12.4326 11.291C12.4326 11.3549 12.4284 11.418 12.4229 11.4805C12.4287 11.4181 12.4326 11.355 12.4326 11.291ZM8.21484 11.2832C8.21484 11.2856 8.21484 11.2886 8.21484 11.291L8.21484 11.29C8.21484 11.2878 8.21484 11.2855 8.21484 11.2832ZM3.08301 4.59082C4.04605 4.59095 4.85696 5.23717 5.10938 6.11914L13.415 6.11914L13.415 7.2793L5.11035 7.2793C4.85833 8.16202 4.04648 8.80846 3.08301 8.80859C2.11972 8.80843 1.30963 8.16179 1.05762 7.2793L0 7.2793L0 6.11914L1.05762 6.11914C1.30994 5.23728 2.12006 4.59098 3.08301 4.59082ZM3.08301 5.75098C2.55962 5.75117 2.13512 6.17587 2.13477 6.69922C2.13477 7.22287 2.5594 7.64824 3.08301 7.64844C3.60665 7.64828 4.03223 7.2229 4.03223 6.69922C4.03187 6.17585 3.60643 5.75113 3.08301 5.75098ZM5.19238 6.69922C5.19238 6.763 5.18816 6.82633 5.18262 6.88867C5.18846 6.82629 5.19238 6.76313 5.19238 6.69922C5.19236 6.63495 5.18853 6.57152 5.18262 6.50879C5.18826 6.57154 5.19236 6.635 5.19238 6.69922ZM0.982422 6.52344C0.977382 6.58136 0.97463 6.63999 0.974609 6.69922C0.974609 6.75775 0.977496 6.81579 0.982422 6.87305C0.977758 6.81579 0.974609 6.75767 0.974609 6.69922C0.974628 6.64 0.977618 6.58142 0.982422 6.52344ZM10.3232 0C11.2869 0 12.0986 0.646596 12.3506 1.5293L13.415 1.5293L13.415 2.68945L12.3496 2.68945C12.363 2.64266 12.3754 2.59488 12.3857 2.54688C12.1838 3.50118 11.3376 4.21777 10.3232 4.21777C9.36037 4.21756 8.55018 3.57139 8.29785 2.68945L0 2.68945L0 1.5293L8.29688 1.5293C8.5487 0.646717 9.35981 0.00021854 10.3232 0ZM10.3232 1.16016C9.79984 1.16042 9.37524 1.58499 9.375 2.1084C9.375 2.63201 9.79969 3.05735 10.3232 3.05762C10.847 3.05762 11.2725 2.63217 11.2725 2.1084C11.2722 1.58483 10.8469 1.16016 10.3232 1.16016ZM12.4229 2.29883C12.4287 2.23641 12.4326 2.17331 12.4326 2.10938C12.4326 2.17327 12.4284 2.23638 12.4229 2.29883ZM8.21484 2.10938L8.21484 2.1084L8.21484 2.10938ZM8.22266 1.93359C8.21785 1.98897 8.21506 2.04499 8.21484 2.10156C8.21503 2.04501 8.2181 1.98902 8.22266 1.93359ZM8.22266 11.1162C8.2179 11.1713 8.21507 11.227 8.21484 11.2832C8.21504 11.227 8.21814 11.1713 8.22266 11.1162Z`,fill:`currentColor`})}),Ve=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,z.jsx)(`path`,{transform:`translate(9.52 2.52)`,d:`M3.55246 0L3.55246 2.44252L6 2.44252L6 3.55748L3.55246 3.55748L3.55246 6L2.43834 6L2.43834 3.55748L0 3.55748L0 2.44252L2.43834 2.44252L2.43834 0L3.55246 0Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{transform:`translate(0.3496 2.35)`,d:`M4.76367 0C5.36861 1.80598e-05 5.93113 0.310294 6.25488 0.821289L6.78027 1.64941C6.79685 1.67558 6.81791 1.69775 6.83887 1.71973C6.72186 2.15521 6.65702 2.61192 6.65137 3.08301C6.25601 2.96045 5.90909 2.70478 5.68164 2.3457L5.15723 1.5166C5.07183 1.38189 4.92318 1.3008 4.76367 1.30078L2.32422 1.30078C1.7589 1.30078 1.30078 1.7589 1.30078 2.32422L1.30078 10.1338C1.30078 10.6991 1.7589 11.1572 2.32422 11.1572L11.9766 11.1572C12.5419 11.1572 13 10.6991 13 10.1338L13 8.58398C13.4545 8.5135 13.8903 8.38748 14.3008 8.21289L14.3008 10.1338C14.3008 11.4171 13.2598 12.458 11.9766 12.458L2.32422 12.458C1.04093 12.458 0 11.4171 0 10.1338L0 2.32422C0 1.04093 1.04093 0 2.32422 0L4.76367 0Z`,fill:`currentColor`})]}),He=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,z.jsx)(`path`,{d:`M5.19629 1.57104C5.81144 1.5711 6.38623 1.8786 6.72754 2.39038L7.19922 3.09839C7.28454 3.22635 7.42824 3.30344 7.58203 3.30347H12.1699C13.5039 3.30348 14.5859 4.38548 14.5859 5.71948V6.62671C15.2694 7.02689 15.6605 7.85012 15.4385 8.68726L14.3848 12.658C14.1037 13.7164 13.1449 14.4527 12.0498 14.4529H2.91699C1.51651 14.4529 0.451662 13.2814 0.501954 11.9519V3.98706C0.501954 2.65305 1.58396 1.57104 2.91797 1.57104H5.19629ZM3.7793 7.75562C3.30994 7.75562 2.89883 8.07153 2.77832 8.52515L1.91602 11.7722C1.74167 12.4291 2.23734 13.073 2.91699 13.073H12.0498C12.5191 13.0728 12.9304 12.757 13.0508 12.3035L14.1045 8.33374C14.1819 8.04202 13.9619 7.756 13.6602 7.75562H3.7793ZM2.91797 2.9519C2.34625 2.9519 1.88281 3.41534 1.88281 3.98706V7.2937C2.33068 6.7269 3.02249 6.37476 3.7793 6.37476H13.2051V5.71948C13.2051 5.14777 12.7416 4.68434 12.1699 4.68433H7.58203C6.96675 4.6843 6.39209 4.37595 6.05078 3.86401L5.5791 3.15601C5.49379 3.02821 5.34995 2.95196 5.19629 2.9519H2.91797Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{opacity:`0.2`,d:`M13.6602 7.75525C13.9618 7.7556 14.1815 8.04179 14.1045 8.33337L13.0508 12.3031C12.9304 12.7567 12.5191 13.0725 12.0498 13.0726H2.91701C2.23744 13.0725 1.7417 12.4287 1.91603 11.7719L2.77834 8.52478C2.89898 8.07146 3.31018 7.75532 3.77931 7.75525H13.6602ZM5.1963 2.95154C5.34985 2.95159 5.49377 3.02803 5.57912 3.15564L6.0508 3.86365C6.39205 4.37553 6.96685 4.68385 7.58205 4.68396H12.1699C12.7416 4.68396 13.2049 5.14754 13.2051 5.71912V6.37439H3.77931C3.02267 6.37444 2.33067 6.72671 1.88283 7.29333V3.98669C1.88299 3.4152 2.34649 2.95168 2.91798 2.95154H5.1963Z`,fill:`currentColor`})]}),Ue=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,z.jsx)(`path`,{transform:`translate(1.5 2.429)`,d:`M5.05582 0.518756L4.50669 0.86654L5.05582 0.518756ZM13 9.4837L13.65 9.4837L13.65 3.53962L13 3.53962L12.35 3.53962L12.35 9.4837L13 9.4837ZM11.3264 1.86603L11.3264 1.21603L6.52313 1.21603L6.52313 1.86603L6.52313 2.51603L11.3264 2.51603L11.3264 1.86603ZM5.58054 1.34727L6.12968 0.999489L5.60495 0.170972L5.05582 0.518756L4.50669 0.86654L5.03141 1.69506L5.58054 1.34727ZM4.11323 1.23058e-13L4.11323 -0.65L1.67359 -0.65L1.67359 5.00699e-14L1.67359 0.65L4.11323 0.65L4.11323 1.23058e-13ZM0 1.67359L-0.65 1.67359L-0.65 9.4837L0 9.4837L0.65 9.4837L0.65 1.67359L0 1.67359ZM11.3264 11.1573L11.3264 10.5073L1.67359 10.5073L1.67359 11.1573L1.67359 11.8073L11.3264 11.8073L11.3264 11.1573ZM0 9.4837L-0.65 9.4837C-0.65 10.767 0.390308 11.8073 1.67359 11.8073L1.67359 11.1573L1.67359 10.5073C1.10828 10.5073 0.65 10.049 0.65 9.4837L0 9.4837ZM1.67359 5.00699e-14L1.67359 -0.65C0.390307 -0.65 -0.65 0.390309 -0.65 1.67359L0 1.67359L0.65 1.67359C0.65 1.10828 1.10828 0.65 1.67359 0.65L1.67359 5.00699e-14ZM5.05582 0.518756L5.60495 0.170972C5.28121 -0.340193 4.71829 -0.65 4.11323 -0.65L4.11323 1.23058e-13L4.11323 0.65C4.27282 0.65 4.4213 0.731715 4.50669 0.86654L5.05582 0.518756ZM6.52313 1.86603L6.52313 1.21603C6.36354 1.21603 6.21507 1.13431 6.12968 0.999489L5.58054 1.34727L5.03141 1.69506C5.35515 2.20622 5.91808 2.51603 6.52313 2.51603L6.52313 1.86603ZM13 3.53962L13.65 3.53962C13.65 2.25634 12.6097 1.21603 11.3264 1.21603L11.3264 1.86603L11.3264 2.51603C11.8917 2.51603 12.35 2.97431 12.35 3.53962L13 3.53962ZM13 9.4837L12.35 9.4837C12.35 10.049 11.8917 10.5073 11.3264 10.5073L11.3264 11.1573L11.3264 11.8073C12.6097 11.8073 13.65 10.767 13.65 9.4837L13 9.4837Z`,fill:`currentColor`})}),We=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M11.3496 8C11.3496 6.14985 9.85015 4.65039 8 4.65039C6.14985 4.65039 4.65039 6.14985 4.65039 8C4.65039 9.85015 6.14985 11.3496 8 11.3496C9.85015 11.3496 11.3496 9.85015 11.3496 8ZM12.6504 8C12.6504 10.5681 10.5681 12.6504 8 12.6504C5.43188 12.6504 3.34961 10.5681 3.34961 8C3.34961 5.43188 5.43188 3.34961 8 3.34961C10.5681 3.34961 12.6504 5.43188 12.6504 8Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M8.65039 0.5V2.5H7.34961V0.5H8.65039Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M8.65039 13.5V15.5H7.34961V13.5H8.65039Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M3.15808 2.24035L4.57229 3.65456L3.6525 4.57435L2.23829 3.16014L3.15808 2.24035Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M12.3505 11.4327L13.7647 12.8469L12.8449 13.7667L11.4307 12.3525L12.3505 11.4327Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.24537 12.8469L3.65958 11.4327L4.57937 12.3525L3.16516 13.7667L2.24537 12.8469Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M11.4377 3.65455L12.852 2.24033L13.7718 3.16012L12.3575 4.57434L11.4377 3.65455Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M0.5 7.35461H2.5V8.6554H0.5L0.5 7.35461Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M13.5 7.35461H15.5V8.6554H13.5V7.35461Z`,fill:`currentColor`})]}),Ge=({size:e=16,className:t})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,z.jsx)(`path`,{d:`M13.2764 9.52324C12.5607 9.97754 11.7177 10.242 10.7812 10.242C8.11386 10.2419 5.95042 8.07997 5.9502 5.41289C5.9502 4.48128 6.21453 3.61071 6.67188 2.87285C4.30332 3.4658 2.54992 5.60845 2.5498 8.16093C2.5498 11.1712 4.99103 13.6102 8 13.6102C10.5383 13.6102 12.6709 11.8724 13.2764 9.52324ZM7.05078 5.41289C7.051 7.47224 8.72116 9.1423 10.7812 9.14238C11.9248 9.14238 12.887 8.63397 13.5781 7.8084C13.7266 7.63106 13.9701 7.56547 14.1875 7.64433C14.4049 7.72329 14.5497 7.9297 14.5498 8.16093C14.5498 11.7766 11.6161 14.7098 8 14.7098C4.38402 14.7098 1.4502 11.7792 1.4502 8.16093C1.45033 4.54322 4.3812 1.61015 8 1.61015C8.23027 1.61015 8.43585 1.75352 8.51562 1.96953C8.59536 2.18554 8.53241 2.42829 8.35742 2.57793C7.55573 3.26311 7.05078 4.27876 7.05078 5.41289Z`,fill:`currentColor`})}),Ke=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M12.1665 13.5811V14.7803H3.66651V13.5811H12.1665Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M13.4453 7.02379C13.4453 6.04702 13.4452 5.3616 13.3887 4.83434C13.3333 4.31828 13.2302 4.02378 13.0723 3.80309C12.9446 3.62475 12.7877 3.46883 12.6094 3.34117C12.3887 3.18328 12.0942 3.08007 11.5781 3.02477C11.0508 2.96829 10.3655 2.96715 9.38867 2.96715H6.61035C5.63359 2.96715 4.94816 2.96827 4.4209 3.02477C3.90486 3.0801 3.61034 3.18321 3.38965 3.34117C3.21143 3.46878 3.05534 3.62487 2.92774 3.80309C2.76977 4.02377 2.66667 4.3183 2.61133 4.83434C2.55483 5.3616 2.55371 6.04702 2.55371 7.02379C2.55371 8.0006 2.55485 8.68596 2.61133 9.21324C2.66663 9.72936 2.76983 10.0238 2.92774 10.2445C3.0554 10.4228 3.21131 10.5797 3.38965 10.7074C3.61034 10.8654 3.90484 10.9685 4.4209 11.0238C4.94816 11.0803 5.63359 11.0804 6.61035 11.0804H9.38867C10.3654 11.0804 11.0508 11.0803 11.5781 11.0238C12.0941 10.9685 12.3887 10.8652 12.6094 10.7074C12.7877 10.5797 12.9446 10.4229 13.0723 10.2445C13.2301 10.0238 13.3334 9.72927 13.3887 9.21324C13.4452 8.68596 13.4453 8.00058 13.4453 7.02379ZM14.6455 7.02379C14.6455 7.97428 14.646 8.73509 14.5811 9.34117C14.5149 9.95828 14.3756 10.4858 14.0479 10.9437C13.8436 11.229 13.5938 11.4788 13.3086 11.683C12.8507 12.0108 12.3232 12.15 11.7061 12.2162C11.1 12.2811 10.3391 12.2806 9.38867 12.2806H6.61035C5.66018 12.2806 4.89991 12.2811 4.29395 12.2162C3.67684 12.15 3.14935 12.0108 2.69141 11.683C2.40613 11.4788 2.15639 11.229 1.95215 10.9437C1.62436 10.4858 1.4841 9.95828 1.41797 9.34117C1.35305 8.73511 1.35449 7.97424 1.35449 7.02379C1.35449 6.07366 1.35308 5.31333 1.41797 4.70738C1.4841 4.09028 1.62436 3.56279 1.95215 3.10485C2.15638 2.81956 2.40613 2.56982 2.69141 2.36559C3.14935 2.03779 3.67684 1.89753 4.29395 1.83141C4.8999 1.76652 5.66022 1.76793 6.61035 1.76793H9.38867C10.3391 1.76793 11.1 1.76649 11.7061 1.83141C12.3232 1.89753 12.8507 2.03779 13.3086 2.36559C13.5939 2.56982 13.8436 2.81957 14.0479 3.10485C14.3756 3.56279 14.5149 4.09028 14.5811 4.70738C14.646 5.31335 14.6455 6.07362 14.6455 7.02379Z`,fill:`currentColor`})]}),qe=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.0997 8.54554C12.2905 8.54989 12.3541 8.58056 12.4535 8.74614L12.8849 9.46387C12.9851 9.63071 13.0464 9.66013 13.2388 9.66447H14.1138C14.3417 9.66448 14.3512 9.66937 14.4686 9.86507L14.892 10.5717C14.9942 10.7422 14.9948 10.8247 14.892 10.9961L14.4756 11.6906C14.3741 11.8677 14.3694 11.9379 14.4756 12.115L14.892 12.8096C14.9942 12.9801 14.9947 13.0625 14.892 13.234L14.4686 13.9406C14.3643 14.1028 14.3063 14.1354 14.1138 14.1412H13.2388C13.0465 14.1456 12.985 14.1752 12.8849 14.3418L12.4535 15.0595C12.353 15.2195 12.2895 15.2558 12.0997 15.2601H11.2237C10.9962 15.2601 10.9871 15.2548 10.8699 15.0595L10.4384 14.3418C10.3383 14.175 10.2767 14.1456 10.0846 14.1412H9.2096C9.01854 14.1355 8.95761 14.1006 8.85477 13.9406L8.43139 13.234C8.32562 13.0576 8.33148 12.9862 8.43139 12.8096L8.84771 12.115C8.95165 11.9416 8.94659 11.863 8.84771 11.6906L8.43139 10.9961C8.32767 10.8232 8.33411 10.7437 8.43139 10.5717L8.85477 9.86507C8.95447 9.69891 9.01875 9.67017 9.2096 9.66447H10.0846C10.2741 9.66441 10.3414 9.62547 10.4384 9.46387L10.8699 8.74614C10.987 8.55106 10.9963 8.54554 11.2237 8.54554H12.0997ZM11.6612 10.232C11.3326 10.7798 10.8155 11.0948 10.1743 11.106C10.4443 11.61 10.4425 12.1976 10.1743 12.6987C10.803 12.7096 11.3391 13.0359 11.6612 13.5727C11.9855 13.0323 12.5131 12.7098 13.148 12.6987C12.879 12.196 12.8789 11.6086 13.148 11.106C12.5076 11.0948 11.9894 10.7794 11.6612 10.232Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.51205 0.790627C9.19055 0.790649 10.7401 1.0691 11.892 1.54364C12.4664 1.78029 12.9719 2.07885 13.3436 2.4408C13.7171 2.80467 13.9916 3.27253 13.9918 3.82384V7.90442C13.6067 7.69532 13.1907 7.53597 12.7529 7.43366V5.66454C12.4928 5.82898 12.2028 5.97601 11.892 6.10405C10.74 6.57865 9.19071 6.85706 7.51205 6.85706C5.8337 6.85703 4.285 6.57852 3.13309 6.10405C2.82215 5.97593 2.53164 5.8291 2.27121 5.66454V7.4135C2.27134 7.75678 2.6066 8.27106 3.62502 8.73405C4.58641 9.17097 5.95762 9.45591 7.50499 9.45681C7.24582 9.83133 7.03684 10.2434 6.88706 10.6826C5.44388 10.6162 4.12516 10.3216 3.11192 9.86104C2.81708 9.72698 2.53185 9.56866 2.27121 9.38928V11.2542C2.27158 11.5974 2.60697 12.1109 3.62502 12.5737C4.41933 12.9347 5.4937 13.1898 6.71569 13.2693C6.80349 13.7128 6.9513 14.1345 7.14814 14.5273C5.60324 14.4862 4.18593 14.1889 3.11192 13.7007C2.01039 13.1998 1.03366 12.3814 1.03333 11.2542V3.82384C1.03352 3.27273 1.30721 2.80461 1.68049 2.4408C2.05211 2.07893 2.55887 1.78026 3.13309 1.54364C4.28492 1.06926 5.83393 0.790683 7.51205 0.790627ZM7.51205 2.02851C5.95492 2.02857 4.57354 2.29079 3.60486 2.68979C3.11958 2.88977 2.76667 3.11253 2.5454 3.32788C2.32671 3.54101 2.2714 3.7089 2.27121 3.82384C2.27121 3.93882 2.32624 4.10625 2.5454 4.3198C2.76667 4.53527 3.11927 4.75781 3.60486 4.9579C4.5736 5.35699 5.95467 5.61914 7.51205 5.61918C9.06942 5.61918 10.4505 5.35695 11.4192 4.9579C11.9051 4.75773 12.2584 4.53536 12.4797 4.3198C12.6988 4.10627 12.7529 3.93882 12.7529 3.82384C12.7527 3.70889 12.6984 3.54104 12.4797 3.32788C12.2584 3.11239 11.9049 2.88989 11.4192 2.68979C10.4505 2.29079 9.06925 2.02853 7.51205 2.02851Z`,fill:`currentColor`})]}),Je=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`ellipse`,{cx:`8`,cy:`3.6`,rx:`5.75`,ry:`2.4`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,z.jsx)(`path`,{d:`M2.25 3.6V12.3A5.75 2.4 0 0 0 13.75 12.3V3.6`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,z.jsx)(`path`,{d:`M2.25 7.95A5.75 2.4 0 0 0 13.75 7.95`,stroke:`currentColor`,strokeWidth:`1.25`})]}),Ye=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M12.5113 15.4067C12.4395 15.6249 12.1308 15.6249 12.059 15.4067L11.643 14.1416C11.454 13.567 11.0033 13.1164 10.4288 12.9274L9.16369 12.5113C8.94544 12.4395 8.94544 12.1308 9.16369 12.059L10.4288 11.643C11.0033 11.454 11.454 11.0033 11.643 10.4288L12.059 9.16369C12.1308 8.94544 12.4395 8.94544 12.5113 9.16369L12.9274 10.4288C13.1164 11.0033 13.567 11.454 14.1416 11.643L15.4067 12.059C15.6249 12.1308 15.6249 12.4395 15.4067 12.5113L14.1416 12.9274C13.567 13.1164 13.1164 13.567 12.9274 14.1416L12.5113 15.4067Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M9.02246 0.546878C9.9822 0.546878 10.7564 0.545403 11.374 0.612307C12.0042 0.680586 12.5515 0.826244 13.0273 1.17188C13.3052 1.37376 13.5501 1.61868 13.752 1.89649C14.0975 2.37225 14.2432 2.91984 14.3115 3.54981C14.3784 4.16727 14.377 4.94206 14.377 5.90137V8.51367C13.9611 8.29533 13.5071 8.13985 13.0273 8.06055V5.90137C13.0273 4.9121 13.0259 4.22322 12.9688 3.69532C12.9129 3.18044 12.8098 2.89782 12.6592 2.69043C12.5406 2.52724 12.3966 2.38326 12.2334 2.26465C12.026 2.11404 11.7437 2.0109 11.2285 1.95508C10.7005 1.89789 10.0122 1.89649 9.02246 1.89649H6.55371C5.56395 1.89649 4.87569 1.89787 4.34766 1.95508C3.83242 2.01092 3.55022 2.11398 3.34278 2.26465C3.17953 2.38329 3.03564 2.52719 2.91699 2.69043C2.76642 2.89782 2.66325 3.18042 2.60742 3.69532C2.55027 4.22322 2.54883 4.9121 2.54883 5.90137V10.0986C2.54883 11.0878 2.55031 11.7768 2.60742 12.3047C2.66326 12.8196 2.76642 13.1032 2.91699 13.3105C3.03558 13.4736 3.17966 13.6178 3.34278 13.7363C3.5502 13.8869 3.83265 13.9901 4.34766 14.0459C4.87568 14.1031 5.56398 14.1035 6.55371 14.1035H8.08399C8.27443 14.6025 8.55077 15.0585 8.89551 15.4541H6.55371C5.59402 15.4541 4.81976 15.4546 4.20215 15.3877C3.57204 15.3194 3.02468 15.1738 2.54883 14.8281C2.27111 14.6263 2.02606 14.3813 1.82422 14.1035C1.47883 13.6278 1.33293 13.08 1.26465 12.4502C1.19783 11.8327 1.19922 11.0579 1.19922 10.0986V5.90137C1.19922 4.94206 1.1978 4.16727 1.26465 3.54981C1.33295 2.91984 1.47867 2.37225 1.82422 1.89649C2.02613 1.61864 2.27098 1.37379 2.54883 1.17188C3.02472 0.826181 3.57197 0.6806 4.20215 0.612307C4.81976 0.545393 5.594 0.546877 6.55371 0.546878H9.02246ZM9.19629 9.14649H4.5459V7.84571H9.19629V9.14649ZM11.0303 6.10645H4.5459V4.80567H11.0303V6.10645Z`,fill:`currentColor`})]}),Xe=({size:e=14,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M12.5757 7.00012C12.5757 3.92085 10.0794 1.42463 7.00012 1.42456C3.9208 1.42456 1.42456 3.9208 1.42456 7.00012C1.42463 10.0794 3.92085 12.5757 7.00012 12.5757C10.0793 12.5756 12.5756 10.0793 12.5757 7.00012ZM13.8002 7.00012C13.8001 10.7559 10.7559 13.8001 7.00012 13.8002C3.2443 13.8002 0.199291 10.7559 0.199219 7.00012C0.199219 3.24426 3.24426 0.199219 7.00012 0.199219C10.7559 0.199291 13.8002 3.2443 13.8002 7.00012Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M6.18042 8.68184C6.18043 8.09153 6.32893 7.34655 6.92127 6.8481C7.28566 6.54148 7.76104 6.27318 8.0022 6.10811C8.28964 5.91137 8.42234 5.76562 8.48328 5.58944C8.57774 5.31609 8.53121 5.00904 8.34912 4.76741C8.17409 4.53522 7.83879 4.32222 7.28186 4.32222C5.99668 4.32225 5.46969 5.11832 5.46949 5.78939H4.24414C4.24436 4.39942 5.36327 3.09691 7.28186 3.09688C8.17773 3.09688 8.89489 3.45606 9.32752 4.02999C9.75287 4.59438 9.86938 5.32775 9.64026 5.99019C9.44847 6.5444 9.04722 6.87743 8.69434 7.11898C8.29506 7.39226 8.02318 7.52192 7.70996 7.78548C7.51943 7.94582 7.40577 8.24899 7.40577 8.68184V8.75533H6.18042V8.68184Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.39455 9.44026V10.8109H6.16921V9.44026H7.39455Z`,fill:`currentColor`})]}),Ze=({size:e=20,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.8659 2.05975C17.2603 2.05995 18.3913 3.19096 18.3914 4.58527V5.4874C18.3914 6.02747 18.2192 6.52672 17.9303 6.93735C17.9336 6.96524 17.9388 6.99318 17.9388 7.02195V12.8884C17.9388 13.6345 17.9395 14.2379 17.8996 14.7254C17.8642 15.1593 17.7936 15.5499 17.6373 15.9141L17.5654 16.0685C17.278 16.6328 16.8405 17.1046 16.3038 17.434L16.0679 17.5661C15.66 17.7739 15.2196 17.8598 14.7237 17.9003C14.2362 17.9401 13.6327 17.9405 12.8867 17.9405H7.11122C6.36511 17.9405 5.76171 17.9401 5.27418 17.9003C4.84051 17.8649 4.44949 17.7952 4.08545 17.6391L3.93104 17.5661C3.36673 17.2785 2.89392 16.8414 2.56465 16.3044L2.43245 16.0685C2.22473 15.6608 2.13878 15.2211 2.09825 14.7254C2.05841 14.2379 2.05912 13.6345 2.05912 12.8884V7.02195C2.05912 6.99284 2.06422 6.96449 2.06758 6.93629C1.77931 6.52592 1.60858 6.02687 1.60858 5.4874V4.58527C1.60876 3.19084 2.73962 2.05975 4.1341 2.05975H15.8659ZM16.4984 7.92936C16.296 7.98169 16.0847 8.01288 15.8659 8.01291H4.1341C3.91478 8.01291 3.70246 7.98194 3.49955 7.92936V12.8884C3.49955 13.6582 3.50053 14.1927 3.53445 14.608C3.56769 15.0146 3.62923 15.244 3.71635 15.415L3.7925 15.5514C3.98339 15.8627 4.25749 16.1165 4.58464 16.2833L4.72529 16.3435C4.88095 16.3993 5.08638 16.4402 5.39158 16.4651C5.80685 16.4991 6.34138 16.5001 7.11122 16.5001H12.8867C13.6564 16.5001 14.1911 16.499 14.6063 16.4651C15.0128 16.432 15.2423 16.3703 15.4133 16.2833L15.5508 16.2061C15.8618 16.0152 16.116 15.7419 16.2827 15.415L16.3429 15.2732C16.3985 15.1177 16.4396 14.9128 16.4645 14.608C16.4985 14.1927 16.4984 13.6583 16.4984 12.8884V7.92936ZM4.1341 3.50019C3.53511 3.50019 3.0492 3.98631 3.04902 4.58527V5.4874C3.04902 6.08649 3.535 6.57248 4.1341 6.57248H15.8659C16.4648 6.57228 16.951 6.08638 16.951 5.4874V4.58527C16.9509 3.98644 16.4647 3.50038 15.8659 3.50019H4.1341Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M12.7962 12.5661V11.0832H7.20548V12.5661L12.7962 12.5661Z`,fill:`currentColor`})]}),Qe=i(),$e={viewport:`_viewport_1agok_1`,toast:`_toast_1agok_14`,"toast-in":`_toast-in_1agok_1`,body:`_body_1agok_30`,message:`_message_1agok_31`,detail:`_detail_1agok_32`,action:`_action_1agok_35`,close:`_close_1agok_37`,"toast-in-up":`_toast-in-up_1agok_1`},et=4e3,tt=8e3,nt=[],rt=new Set,it=new Map,at=0;function ot(e){nt=e;for(let e of rt)e()}function st(e){let t=e.key??`toast-${++at}`,n={key:t,tone:e.tone??`error`,message:e.message,detail:e.detail,detailLabel:e.detailLabel,action:e.action};return ot([...nt.filter(e=>e.key!==t),n].slice(-4)),ct(t),lt(t),t}function ct(e){clearTimeout(it.get(e)),it.delete(e)}function lt(e){let t=nt.find(t=>t.key===e);t&&!t.action&&it.set(e,setTimeout(()=>ut(e),t.tone===`info`?et:tt))}function ut(e){ct(e),nt.some(t=>t.key===e)&&ot(nt.filter(t=>t.key!==e))}function dt(e,t,n,r){(0,O.useEffect)(()=>{t&&st({key:e,message:t,detail:n&&n!==t?n:void 0,detailLabel:r})},[e,t,n,r])}var ft=e=>(rt.add(e),()=>{rt.delete(e)}),pt=()=>nt;function mt({closeLabel:e=`Dismiss`,detailLabel:t=`Details`}){let n=(0,O.useSyncExternalStore)(ft,pt,pt);return typeof document>`u`?null:(0,Qe.createPortal)((0,z.jsx)(`div`,{className:$e.viewport,"data-toast-viewport":!0,children:n.map(n=>(0,z.jsxs)(`div`,{className:$e.toast,"data-tone":n.tone,role:n.tone===`error`?`alert`:`status`,onMouseEnter:()=>ct(n.key),onMouseLeave:()=>lt(n.key),children:[(0,z.jsxs)(`div`,{className:$e.body,children:[(0,z.jsx)(`p`,{className:$e.message,children:n.message}),n.detail&&(0,z.jsxs)(`details`,{className:$e.detail,children:[(0,z.jsx)(`summary`,{children:n.detailLabel??t}),(0,z.jsx)(`pre`,{children:n.detail})]}),n.action&&(0,z.jsx)(`button`,{type:`button`,className:$e.action,onClick:()=>{ut(n.key),n.action.onClick()},children:n.action.label})]}),(0,z.jsx)(`button`,{type:`button`,className:$e.close,"aria-label":e,onClick:()=>ut(n.key),children:`×`})]},n.key))}),document.body)}var ht={root:`_root_1axg2_9`,collapsed:`_collapsed_1axg2_6`,quietBars:`_quietBars_1axg2_20`,fading:`_fading_1axg2_4`,wide:`_wide_1axg2_53`,"wide-in":`_wide-in_1axg2_1`,railIn:`_railIn_1axg2_64`,iconButton:`_iconButton_1axg2_66`,newSession:`_newSession_1axg2_67`,panelList:`_panelList_1axg2_68`,regionArea:`_regionArea_1axg2_69`,"rail-in":`_rail-in_1axg2_1`,footArea:`_footArea_1axg2_73`,"rail-fade-in":`_rail-fade-in_1axg2_1`,logoRow:`_logoRow_1axg2_91`,brand:`_brand_1axg2_115`,brandIdentity:`_brandIdentity_1axg2_130`,brandMark:`_brandMark_1axg2_138`,brandName:`_brandName_1axg2_145`,fallbackBrandName:`_fallbackBrandName_1axg2_157`,localBuildBrand:`_localBuildBrand_1axg2_163`,localBuildTitle:`_localBuildTitle_1axg2_174`,toggle:`_toggle_1axg2_208`,panelIcon:`_panelIcon_1axg2_208`,railMark:`_railMark_1axg2_216`,buildVersion:`_buildVersion_1axg2_232`,newSessionLabel:`_newSessionLabel_1axg2_290`,panelRow:`_panelRow_1axg2_308`,panelActive:`_panelActive_1axg2_330`,panelGlyph:`_panelGlyph_1axg2_341`,panelTitle:`_panelTitle_1axg2_348`,settingsArea:`_settingsArea_1axg2_396`,footerActions:`_footerActions_1axg2_397`},gt=150,_t=2e3;function vt({id:e,label:t,wide:n,usePanelInfo:r,selectPanel:i,renderSlot:a}){let o=r(t=>t.activePanelId===e);return(0,z.jsx)(ve,{label:t,delayMs:500,disabled:n,children:(0,z.jsxs)(`button`,{type:`button`,className:h(ht.panelRow,o&&ht.panelActive),"aria-label":t,"aria-current":o?`page`:void 0,onClick:()=>{i(e)},children:[(0,z.jsx)(`span`,{className:ht.panelGlyph,"aria-hidden":`true`,children:a(`sidebar.panellist`,{size:n?16:18,active:o},{only:e})}),n&&(0,z.jsx)(`span`,{className:h(ht.panelTitle,ht.wide),children:t})]})})}function yt({collapsed:e,width:t,startSession:n,sessionBusy:r=!1,toggleSidebar:i,selectPanel:a,usePanels:o,usePanelInfo:s,t:c,renderSlot:l}){let u=o(e=>e),[d,f]=(0,O.useState)(e);(0,O.useEffect)(()=>{if(!e){f(!1);return}let t=window.setTimeout(()=>{f(!0)},gt);return()=>{window.clearTimeout(t)}},[e]);let p=!e||!d,m=(0,O.useRef)(t);e||(m.current=t);let g=(0,O.useRef)(!e);e||(g.current=!0);let _=(0,O.useRef)(null),[v,y]=(0,O.useState)(!1),b=(0,O.useRef)(void 0),x=()=>{b.current===void 0&&(b.current=window.setTimeout(()=>{b.current=void 0,y(!1)},_t))},S=()=>{window.clearTimeout(b.current),b.current=void 0};return(0,O.useEffect)(()=>{if(!v)return;let e=e=>{let t=_.current?.getBoundingClientRect();t!==void 0&&(e.clientX>=t.left&&e.clientX<t.right&&e.clientY>=t.top&&e.clientY<t.bottom?S():x())};return document.addEventListener(`pointermove`,e),()=>{document.removeEventListener(`pointermove`,e),S()}},[v]),(0,z.jsxs)(`div`,{ref:_,className:h(ht.root,!p&&ht.collapsed,!p&&g.current&&ht.railIn,e&&p&&ht.fading,!v&&ht.quietBars),style:p?{width:e?m.current:t}:void 0,onPointerEnter:()=>{S(),y(!0)},onPointerLeave:()=>{x()},children:[(0,z.jsxs)(`div`,{className:ht.logoRow,children:[p&&(0,z.jsx)(`button`,{type:`button`,className:h(ht.brand,ht.wide),"aria-label":c(`session.new.label`),disabled:r,onClick:()=>{n()},children:(0,z.jsxs)(`span`,{className:ht.brandIdentity,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{className:ht.brandMark,children:l(`sidebar.brand.mark`,{size:24},{fallback:(0,z.jsx)(ge,{size:24})})}),(0,z.jsx)(`span`,{className:ht.brandName,children:l(`sidebar.brand.name`,{},{fallback:(0,z.jsx)(`span`,{className:ht.fallbackBrandName,children:c(`brand.localBuild`)})})})]})}),(0,z.jsx)(ve,{label:c(e?`toggle.open`:`toggle.collapse`),delayMs:500,children:(0,z.jsxs)(`button`,{type:`button`,className:h(ht.iconButton,ht.toggle),"aria-label":c(e?`toggle.open`:`toggle.collapse`),"aria-expanded":!e,"data-sidebar-toggle":!0,onClick:()=>{i()},children:[!p&&(0,z.jsx)(`span`,{className:ht.railMark,"aria-hidden":`true`,children:l(`sidebar.brand.mark`,{size:24},{fallback:(0,z.jsx)(ge,{size:24})})}),(0,z.jsx)(Ee,{className:ht.panelIcon,size:p?16:18})]})})]}),(0,z.jsx)(ve,{label:c(`session.new.label`),delayMs:500,disabled:p,children:(0,z.jsxs)(`button`,{type:`button`,className:ht.newSession,"aria-label":c(`session.new.label`),disabled:r,onClick:()=>{n()},children:[(0,z.jsx)(Se,{size:p?14:18}),p&&(0,z.jsx)(`span`,{className:h(ht.newSessionLabel,ht.wide),children:c(`session.new`)})]})}),u.length>0&&(0,z.jsx)(`nav`,{className:ht.panelList,"aria-label":c(`panels.label`),children:u.map(({id:e,label:t})=>(0,z.jsx)(vt,{id:e,label:t,wide:p,usePanelInfo:s,selectPanel:a,renderSlot:l},e))}),(0,z.jsx)(`div`,{className:ht.regionArea,children:l(`sidebar.workspaces`,{wide:p,expandSidebar:()=>{e&&i()}})}),(0,z.jsxs)(`div`,{className:ht.footArea,children:[(0,z.jsx)(`div`,{className:ht.footerActions,children:l(`sidebar.footer.action`,{wide:p})}),(0,z.jsx)(`div`,{className:ht.settingsArea,children:l(`sidebar.settings`,{wide:p})})]})]})}function bt(e,t){let n=e.replaceAll(`\\`,`/`).replace(/\/+$/,``),r=t.replaceAll(`\\`,`/`);if(/^(?:\/|[a-z]:\/)/i.test(r)){let e=/^[a-z]:\//i.test(n),i=`${n}/`;if(!(e?r.toLowerCase().startsWith(i.toLowerCase()):r.startsWith(i)))return t;r=r.slice(i.length)}let i=[];for(let e of r.split(`/`))if(e&&e!==`.`){if(e===`..`){if(!i.length)return t;i.pop()}else i.push(e)}return i.join(`/`)||t}var xt={root:`_root_xhk35_5`,stack:`_stack_xhk35_15`,headline:`_headline_xhk35_29`,titleGroup:`_titleGroup_xhk35_51`,previewBadge:`_previewBadge_xhk35_62`,logoFrame:`_logoFrame_xhk35_77`,logo:`_logo_xhk35_77`,"logo-breathe":`_logo-breathe_xhk35_1`,body:`_body_xhk35_98`,workspaceRow:`_workspaceRow_xhk35_114`,workspace:`_workspace_xhk35_114`,folder:`_folder_xhk35_155`,workspaceLabel:`_workspaceLabel_xhk35_160`,chevron:`_chevron_xhk35_167`,modalInput:`_modalInput_xhk35_175`,modalAction:`_modalAction_xhk35_198`,modalError:`_modalError_xhk35_202`};function St({t:e,renderSlot:t,children:n}){return(0,z.jsxs)(`div`,{className:xt.root,children:[(0,z.jsxs)(`div`,{className:xt.stack,children:[(0,z.jsxs)(`div`,{className:xt.headline,children:[(0,z.jsx)(`span`,{className:xt.logoFrame,children:t(`conversation.hero.brand.mark`,{size:34,className:xt.logo},{fallback:(0,z.jsx)(ge,{size:34,className:xt.logo})})}),(0,z.jsxs)(`span`,{className:xt.titleGroup,children:[(0,z.jsx)(`span`,{children:e(`hero.headline`)}),(0,z.jsx)(`span`,{className:xt.previewBadge,children:e(`hero.preview`)})]})]}),(0,z.jsx)(`div`,{className:xt.body})]}),n]})}var Ct={root:`_root_orhlf_1`,heroTools:`_heroTools_orhlf_44`,header:`_header_orhlf_51`,headerHidden:`_headerHidden_orhlf_61`,titleRow:`_titleRow_orhlf_65`,titleCluster:`_titleCluster_orhlf_72`,crumbs:`_crumbs_orhlf_80`,crumbSeg:`_crumbSeg_orhlf_89`,crumbSep:`_crumbSep_orhlf_96`,crumb:`_crumb_orhlf_80`,crumbSubagent:`_crumbSubagent_orhlf_118`,crumbCurrent:`_crumbCurrent_orhlf_127`,headerActions:`_headerActions_orhlf_133`,headerUtilities:`_headerUtilities_orhlf_140`,headerCorner:`_headerCorner_orhlf_156`,tabs:`_tabs_orhlf_170`,tab:`_tab_orhlf_40`,tabActive:`_tabActive_orhlf_208`,viewArea:`_viewArea_orhlf_216`,widthHandle:`_widthHandle_orhlf_235`,composerStack:`_composerStack_orhlf_303`,composerSeat:`_composerSeat_orhlf_314`,body:`_body_orhlf_224`,scrollBody:`_scrollBody_orhlf_350`,composerHero:`_composerHero_orhlf_451`,heroWorkspaceRow:`_heroWorkspaceRow_orhlf_464`},wt={root:`_root_1d5y2_2`,hero:`_hero_1d5y2_20`,notice:`_notice_1d5y2_27`,card:`_card_1d5y2_39`,cardWorkspaceTrigger:`_cardWorkspaceTrigger_1d5y2_79`,accessory:`_accessory_1d5y2_107`,overlayAnchor:`_overlayAnchor_1d5y2_116`,scroll:`_scroll_1d5y2_125`,grow:`_grow_1d5y2_143`,pending:`_pending_1d5y2_148`,"input-pending":`_input-pending_1d5y2_1`,input:`_input_1d5y2_128`,placeholder:`_placeholder_1d5y2_202`,inputDisabled:`_inputDisabled_1d5y2_221`,row:`_row_1d5y2_248`,tools:`_tools_1d5y2_266`,modes:`_modes_1d5y2_267`,trailing:`_trailing_1d5y2_268`,add:`_add_1d5y2_297`,select:`_select_1d5y2_322`,primary:`_primary_1d5y2_355`,retry:`_retry_1d5y2_385`,suspended:`_suspended_1d5y2_397`},Tt={root:`_root_14jhb_1`,scroll:`_scroll_14jhb_9`,column:`_column_14jhb_37`,flowItem:`_flowItem_14jhb_48`,callRow:`_callRow_14jhb_72`,turnStatus:`_turnStatus_14jhb_81`,"piw-turn-status-shimmer":`_piw-turn-status-shimmer_14jhb_1`,turnStatusClock:`_turnStatusClock_14jhb_113`,hint:`_hint_14jhb_138`,openError:`_openError_14jhb_144`,older:`_older_14jhb_150`,toBottomSlot:`_toBottomSlot_14jhb_173`,toBottom:`_toBottom_14jhb_173`,modalAction:`_modalAction_14jhb_220`},Et={userRow:`_userRow_1dwc7_4`,userStack:`_userStack_1dwc7_11`,bubble:`_bubble_1dwc7_23`,referenceSummary:`_referenceSummary_1dwc7_43`,contextRow:`_contextRow_1dwc7_48`,compactionRow:`_compactionRow_1dwc7_55`,compactionButton:`_compactionButton_1dwc7_59`,compactionLeading:`_compactionLeading_1dwc7_82`,compactionContextIcon:`_compactionContextIcon_1dwc7_99`,compactionDisclosureIcon:`_compactionDisclosureIcon_1dwc7_100`,compactionTitle:`_compactionTitle_1dwc7_121`,compactionSep:`_compactionSep_1dwc7_128`,compactionSummary:`_compactionSummary_1dwc7_137`,compactionBody:`_compactionBody_1dwc7_148`,retryRow:`_retryRow_1dwc7_156`,retrySummary:`_retrySummary_1dwc7_162`,retryText:`_retryText_1dwc7_199`,"retry-shimmer":`_retry-shimmer_1dwc7_1`,retryDetails:`_retryDetails_1dwc7_224`,retryDetailLabel:`_retryDetailLabel_1dwc7_234`,turnErrorRow:`_turnErrorRow_1dwc7_238`,turnErrorDot:`_turnErrorDot_1dwc7_248`,turnErrorCopy:`_turnErrorCopy_1dwc7_252`,turnErrorTitle:`_turnErrorTitle_1dwc7_257`,turnErrorMessage:`_turnErrorMessage_1dwc7_263`,turnErrorCode:`_turnErrorCode_1dwc7_267`,maxTokensTitle:`_maxTokensTitle_1dwc7_272`,attachmentRow:`_attachmentRow_1dwc7_296`,fileCard:`_fileCard_1dwc7_304`,fileIcon:`_fileIcon_1dwc7_318`,fileContent:`_fileContent_1dwc7_324`,fileName:`_fileName_1dwc7_331`,fileMeta:`_fileMeta_1dwc7_341`},Dt=()=>a(()=>import(`./MarkdownText-BmWua1fx.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6])),Ot=(0,O.lazy)(()=>Dt().then(e=>({default:e.MarkdownText})));function kt(){let e=te();return(0,O.useMemo)(()=>({code:{copyLabel:R(`复制`,`Copy`),copiedLabel:R(`已复制`,`Copied`),toolbarLabels:{codeLabel:R(`代码块`,`Code block`),wrapLabel:R(`自动换行`,`Wrap`),unwrapLabel:R(`取消换行`,`Unwrap`)}},footnotes:R(`脚注`,`Footnotes`)}),[e])}function At({text:e,streaming:t,labels:n,pathImages:r}){return(0,z.jsx)(O.Suspense,{fallback:(0,z.jsx)(`div`,{className:`pi-markdown-pending`,children:e}),children:(0,z.jsx)(Ot,{text:e,streaming:t,labels:n,pathImages:r})})}var jt=(0,O.memo)(function({text:e,streaming:t=!1}){let n=kt();return(0,z.jsx)(`div`,{className:`pi-markdown`,children:(0,z.jsx)(At,{text:e,streaming:t,labels:n})})}),Mt={root:`_root_rf6yg_9`,row:`_row_rf6yg_16`,leading:`_leading_rf6yg_29`,iconIdle:`_iconIdle_rf6yg_57`,chevronHover:`_chevronHover_rf6yg_63`,title:`_title_rf6yg_79`};function Nt({icon:e,title:t,open:n,onToggle:r,collapsedContent:i,children:a,rowClassName:o,leadingClassName:s,titleClassName:c,chevronClassName:l}){return(0,z.jsxs)(`div`,{className:Mt.root,"data-open":n||void 0,children:[(0,z.jsxs)(`div`,{className:`${Mt.row} ${o??``}`,"data-disclosure-row":!0,"data-expandable":!0,role:`button`,tabIndex:0,"aria-expanded":n,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},children:[(0,z.jsx)(`span`,{className:`${Mt.leading} ${s??``}`,children:n?(0,z.jsx)(Ae,{className:l}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Mt.iconIdle,children:e}),(0,z.jsx)(Ae,{className:`${Mt.chevronHover} ${l??``}`})]})}),(0,z.jsx)(`span`,{className:`${Mt.title} ${c??``}`,children:t}),!n&&i]}),n&&a]})}var Pt={root:`_root_b8edg_1`,row:`_row_b8edg_11`,"piw-reasoning-row-sweep":`_piw-reasoning-row-sweep_b8edg_1`,leading:`_leading_b8edg_37`,chevron:`_chevron_b8edg_41`,title:`_title_b8edg_45`,separator:`_separator_b8edg_49`,summary:`_summary_b8edg_61`,summaryText:`_summaryText_b8edg_71`,thinkBody:`_thinkBody_b8edg_91`};function Ft({text:e,running:t}){let[n,r]=(0,O.useState)(!1),i=e.trimEnd(),a=(t?i.slice(i.lastIndexOf(`
|
|
11
|
+
`)+1):e.split(`
|
|
12
|
+
`,1)[0]).replaceAll(`**`,``);return(0,z.jsx)(`div`,{className:Pt.root,"data-variant":`think`,"data-state":t?`running`:`ok`,"data-expanded":n||void 0,children:(0,z.jsx)(Nt,{icon:(0,z.jsx)(Ie,{size:14}),title:R(`思考`,`Thinking`),open:n,onToggle:()=>r(e=>!e),rowClassName:Pt.row,leadingClassName:Pt.leading,titleClassName:Pt.title,chevronClassName:Pt.chevron,collapsedContent:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Pt.separator,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:Pt.summary,"data-follow-end":t||void 0,children:(0,z.jsx)(`span`,{className:Pt.summaryText,children:a})})]}),children:(0,z.jsx)(`div`,{className:Pt.thinkBody,children:e})})})}function It(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}d ${r}h ${i}m ${a}s`:r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}var Lt={root:`_root_l3xvn_1`,icon:`_icon_l3xvn_12`,"agent-activity-breathe":`_agent-activity-breathe_l3xvn_1`,core:`_core_l3xvn_25`,"agent-activity-breathe-core":`_agent-activity-breathe-core_l3xvn_1`,ripple:`_ripple_l3xvn_29`,"agent-activity-ripple":`_agent-activity-ripple_l3xvn_1`,rippleLate:`_rippleLate_l3xvn_34`,orbit:`_orbit_l3xvn_36`,"agent-activity-orbit":`_agent-activity-orbit_l3xvn_1`,copy:`_copy_l3xvn_42`};function Rt({state:e,elapsedSeconds:t}){return(0,z.jsxs)(`div`,{className:Lt.root,"data-agent-activity":e,children:[(0,z.jsx)(`span`,{className:Lt.icon,"aria-hidden":`true`,children:(0,z.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,children:[(0,z.jsx)(`circle`,{className:Lt.orbit,cx:`10`,cy:`10`,r:`9`,strokeWidth:`1`,strokeDasharray:`3.5 2.5`,strokeLinecap:`round`}),(0,z.jsx)(`circle`,{className:Lt.ripple,cx:`10`,cy:`10`,r:`7.5`,strokeWidth:`1.25`}),(0,z.jsx)(`circle`,{className:`${Lt.ripple} ${Lt.rippleLate}`,cx:`10`,cy:`10`,r:`7.5`,strokeWidth:`1.25`}),(0,z.jsx)(`circle`,{className:Lt.core,cx:`10`,cy:`10`,r:`4`,fill:`currentColor`,stroke:`none`})]})}),(0,z.jsxs)(`span`,{className:`${Tt.turnStatus} ${Lt.copy}`,children:[(0,z.jsx)(`span`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:e===`sending`?R(`正在发送`,`Sending`):R(`正在处理`,`Working`)}),(0,z.jsx)(`span`,{"data-agent-elapsed":t,"aria-hidden":`true`,children:` · ${It(t)}`})]})]})}function zt(e,t,n,r){return!!e&&n===`connected`&&!e.interactions?.length&&!t?.error&&(r||!e.idle)}function Bt(e,t,n,r){return!zt(e,t,n,r)||t?.blocks.some(e=>e.kind===`toolCall`||e.text.trim())?null:r?`sending`:`working`}function Vt(e,t,n=0){let r=(0,O.useRef)(new Map),[i,a]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!e||!t){t&&r.current.delete(t),a(null);return}let i=r.current.get(t),o=i?.activityId===n?i.started:performance.now();i?.activityId!==n&&r.current.set(t,{activityId:n,started:o});let s=()=>a({sessionId:t,activityId:n,seconds:Math.max(0,Math.floor((performance.now()-o)/1e3))});s();let c=window.setInterval(s,1e3);return()=>window.clearInterval(c)},[e,t,n]),e&&i&&i.sessionId===t&&i.activityId===n?i.seconds:0}var Ht=t(n(((e,t)=>{var n=[[{color:`0, 0, 0`,class:`ansi-black`},{color:`187, 0, 0`,class:`ansi-red`},{color:`0, 187, 0`,class:`ansi-green`},{color:`187, 187, 0`,class:`ansi-yellow`},{color:`0, 0, 187`,class:`ansi-blue`},{color:`187, 0, 187`,class:`ansi-magenta`},{color:`0, 187, 187`,class:`ansi-cyan`},{color:`255,255,255`,class:`ansi-white`}],[{color:`85, 85, 85`,class:`ansi-bright-black`},{color:`255, 85, 85`,class:`ansi-bright-red`},{color:`0, 255, 0`,class:`ansi-bright-green`},{color:`255, 255, 85`,class:`ansi-bright-yellow`},{color:`85, 85, 255`,class:`ansi-bright-blue`},{color:`255, 85, 255`,class:`ansi-bright-magenta`},{color:`85, 255, 255`,class:`ansi-bright-cyan`},{color:`255, 255, 255`,class:`ansi-bright-white`}]],r=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm;t.exports=class e{static escapeForHtml(t){return new e().escapeForHtml(t)}static linkify(t){return new e().linkify(t)}static ansiToHtml(t,n){return new e().ansiToHtml(t,n)}static ansiToJson(t,n){return new e().ansiToJson(t,n)}static ansiToText(t){return new e().ansiToText(t)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let e=0;e<2;++e)for(let t=0;t<8;++t)this.PALETTE_COLORS.push(n[e][t].color);let e=[0,95,135,175,215,255],t=(t,n,r)=>e[t]+`, `+e[n]+`, `+e[r];for(let e=0;e<6;++e)for(let n=0;n<6;++n)for(let r=0;r<6;++r)this.PALETTE_COLORS.push(t(e,n,r));let r=8;for(let e=0;e<24;++e,r+=10)this.PALETTE_COLORS.push(r+`, `+r+`, `+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,e=>e==`&`?`&`:e==`"`?`"`:e==`<`?`<`:e==`>`?`>`:``)}linkify(e){return e.replace(r,e=>`<a href="${e}">${e}</a>`)}ansiToHtml(e,t){return this.process(e,t,!0)}ansiToJson(e,t){return t||={},t.json=!0,t.clearLine=!1,this.process(e,t,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,t,n){let r=this,i=e.split(/\033\[/),a=i.shift();t??={},t.clearLine=/\r/.test(e);let o=i.map(e=>this.processChunk(e,t,n));if(t&&t.json){let e=r.processChunkJson(``);return e.content=a,e.clearLine=t.clearLine,o.unshift(e),t.remove_empty&&(o=o.filter(e=>!e.isEmpty())),o}return o.unshift(a),o.join(``)}processChunkJson(e,t,r){t=t===void 0?{}:t;let i=t.use_classes=t.use_classes!==void 0&&t.use_classes,a=t.key=i?`class`:`color`,o={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:t.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!o.content},s=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!s)return o;o.content=s[4];let c=s[2].split(`;`);if(s[1]!==``||s[3]!==`m`||!r)return o;let l=this;for(;c.length>0;){let e=c.shift(),t=parseInt(e);if(isNaN(t)||t===0)l.fg=l.bg=null,l.decorations=[];else if(t===1)l.decorations.push(`bold`);else if(t===2)l.decorations.push(`dim`);else if(t===3)l.decorations.push(`italic`);else if(t===4)l.decorations.push(`underline`);else if(t===5)l.decorations.push(`blink`);else if(t===7)l.decorations.push(`reverse`);else if(t===8)l.decorations.push(`hidden`);else if(t===9)l.decorations.push(`strikethrough`);else if(t===21)l.removeDecoration(`bold`);else if(t===22)l.removeDecoration(`bold`),l.removeDecoration(`dim`);else if(t===23)l.removeDecoration(`italic`);else if(t===24)l.removeDecoration(`underline`);else if(t===25)l.removeDecoration(`blink`);else if(t===27)l.removeDecoration(`reverse`);else if(t===28)l.removeDecoration(`hidden`);else if(t===29)l.removeDecoration(`strikethrough`);else if(t===39)l.fg=null;else if(t===49)l.bg=null;else if(t>=30&&t<38)l.fg=n[0][t%10][a];else if(t>=90&&t<98)l.fg=n[1][t%10][a];else if(t>=40&&t<48)l.bg=n[0][t%10][a];else if(t>=100&&t<108)l.bg=n[1][t%10][a];else if(t===38||t===48){let e=t===38;if(c.length>=1){let t=c.shift();if(t===`5`&&c.length>=1){let t=parseInt(c.shift());if(t>=0&&t<=255){if(!i)this.PALETTE_COLORS||l.setupPalette(),e?l.fg=this.PALETTE_COLORS[t]:l.bg=this.PALETTE_COLORS[t];else{let r=t>=16?`ansi-palette-`+t:n[+(t>7)][t%8].class;e?l.fg=r:l.bg=r}}}else if(t===`2`&&c.length>=3){let t=parseInt(c.shift()),n=parseInt(c.shift()),r=parseInt(c.shift());if(t>=0&&t<=255&&n>=0&&n<=255&&r>=0&&r<=255){let a=t+`, `+n+`, `+r;i?e?(l.fg=`ansi-truecolor`,l.fg_truecolor=a):(l.bg=`ansi-truecolor`,l.bg_truecolor=a):e?l.fg=a:l.bg=a}}}}}return l.fg===null&&l.bg===null&&l.decorations.length===0||(o.fg=l.fg,o.bg=l.bg,o.fg_truecolor=l.fg_truecolor,o.bg_truecolor=l.bg_truecolor,o.decorations=l.decorations,o.decoration=l.decorations.slice(-1).pop()||null,o.was_processed=!0),o}processChunk(e,t,r){t||={};let i=this.processChunkJson(e,t,r),a=t.use_classes;if(i.decorations=i.decorations.filter(e=>{if(e===`reverse`){i.fg||=n[0][7][a?`class`:`color`],i.bg||=n[0][0][a?`class`:`color`];let e=i.fg;i.fg=i.bg,i.bg=e;let t=i.fg_truecolor;return i.fg_truecolor=i.bg_truecolor,i.bg_truecolor=t,i.isInverted=!0,!1}return!0}),t.json)return i;if(i.isEmpty())return``;if(!i.was_processed)return i.content;let o=[],s=[],c=[],l={},u=e=>{let t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push(`data-`+n+`="`+this.escapeForHtml(e[n])+`"`);return t.length>0?` `+t.join(` `):``};return i.isInverted&&(l[`ansi-is-inverted`]=`true`),i.fg&&(a?(o.push(i.fg+`-fg`),i.fg_truecolor!==null&&(l[`ansi-truecolor-fg`]=i.fg_truecolor,i.fg_truecolor=null)):o.push(`color:rgb(`+i.fg+`)`)),i.bg&&(a?(o.push(i.bg+`-bg`),i.bg_truecolor!==null&&(l[`ansi-truecolor-bg`]=i.bg_truecolor,i.bg_truecolor=null)):o.push(`background-color:rgb(`+i.bg+`)`)),i.decorations.forEach(e=>{a?s.push(`ansi-`+e):e===`bold`?s.push(`font-weight:bold`):e===`dim`?s.push(`opacity:0.5`):e===`italic`?s.push(`font-style:italic`):e===`hidden`?s.push(`visibility:hidden`):e===`strikethrough`?c.push(`line-through`):c.push(e)}),c.length&&s.push(`text-decoration:`+c.join(` `)),a?`<span class="`+o.concat(s).join(` `)+`"`+u(l)+`>`+i.content+`</span>`:`<span style="`+o.concat(s).join(`;`)+`"`+u(l)+`>`+i.content+`</span>`}removeDecoration(e){let t=this.decorations.indexOf(e);t>=0&&this.decorations.splice(t,1)}}}))(),1),Ut={"0,0,0":`var(--dsw-alias-label-primary)`,"255,255,255":`var(--dsw-alias-label-primary)`,"85,85,85":`var(--dsw-alias-label-tertiary)`,"187,0,0":`var(--dsw-alias-state-error-primary)`,"255,85,85":`var(--dsw-alias-state-error-secondary)`,"0,187,0":`var(--dsw-alias-state-success-primary)`,"0,255,0":`var(--dsw-alias-state-success-secondary)`,"187,187,0":`var(--dsw-alias-state-warn-primary)`,"255,255,85":`var(--dsw-alias-state-warn-secondary)`,"0,0,187":`var(--dsw-alias-state-business-primary)`,"85,85,255":`var(--dsw-static-blue-400)`},Wt={bold:{fontWeight:700},dim:{opacity:.7},italic:{fontStyle:`italic`},underline:{textDecoration:`underline`},strikethrough:{textDecoration:`line-through`},hidden:{visibility:`hidden`}},Gt=/\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/g,Kt=/\u001b(?!\[)[\u0020-\u002f]*[\u0030-\u007e]?/g,qt=/[\u0000-\u0007\u000b-\u001a\u001c-\u001f\u007f]/g,Jt=/\r|\u0008|\u001b\[[\u0030-\u003f]*[\u0020-\u002f]*K/,Yt=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*m/g,Xt=8,Zt=/^[\p{Mn}\p{Me}\p{Cf}\u200b-\u200f\u2060]$/u,Qt=RegExp(`\\p{Script=Han}|\\p{Script=Hiragana}|\\p{Script=Katakana}|\\p{Script=Hangul}|\\p{Emoji_Presentation}|[\\uff01-\\uff60\\u3000-\\u303e]`,`u`);function $t(e){let t=e.codePointAt(0);return t===void 0||t<4352?!1:Qt.test(e)}var en={fg:``,bg:``,attrs:[]},tn={22:[`1`,`2`],23:[`3`],24:[`4`],25:[`5`,`6`],27:[`7`],28:[`8`],29:[`9`]};function nn(e,t){let n=t===``?[`0`]:t.split(`;`),r=e;for(let e=0;e<n.length;e++){let t=String(n[e]);if(t===``||t===`0`){r=en;continue}if(t===`38`||t===`48`){let i=n[e+1]??``,a=i===`2`?4:i===`5`?2:0,o=n.slice(e,e+a+1).join(`;`);r=t===`38`?{...r,fg:o}:{...r,bg:o},e+=a;continue}let i=tn[t];if(i!==void 0){r={...r,attrs:r.attrs.filter(e=>!i.includes(e))};continue}let a=Number(t);t===`39`?r={...r,fg:``}:t===`49`?r={...r,bg:``}:a>=30&&a<=37||a>=90&&a<=97?r={...r,fg:t}:a>=40&&a<=47||a>=100&&a<=107?r={...r,bg:t}:r.attrs.includes(t)||(r={...r,attrs:[...r.attrs,t]})}return r}function rn(e){let t=[...e.attrs];return e.fg!==``&&t.push(e.fg),e.bg!==``&&t.push(e.bg),t.length===0?``:`\u001b[${t.join(`;`)}m`}function an(e,t){return e.fg===t.fg&&e.bg===t.bg&&e.attrs.length===t.attrs.length&&e.attrs.every((e,n)=>e===t.attrs[n])}function on(e,t){let n=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*([\u0040-\u007e])/g,r=[],i=0,a=t,o=0,s=(e,t)=>{let n=r[e];n?.spacer===!0&&e>0?r[e-1]={sgr:a,char:t}:n!==void 0&&$t(n.char)&&r[e+1]?.spacer===!0&&(r[e+1]={sgr:a,char:t}),r[e]={sgr:a,char:t}},c=e=>{for(let t of e)if(t===`\r`)i=0;else if(t===`\b`)i=Math.max(0,i-1);else if(t===` `){let e=i+Xt-i%Xt;for(;i<e;i++)r[i]??={sgr:a,char:` `}}else if(Zt.test(t)){let e=i>0?r[i-1]:void 0;e!==void 0&&(r[i-1]={sgr:e.sgr,char:e.char+t})}else s(i,` `),r[i]={sgr:a,char:t},i++,$t(t)&&(r[i]={sgr:a,char:``,spacer:!0},i++)};for(let t of e.matchAll(n)){c(e.slice(o,t.index)),o=t.index+t[0].length;let n=String(t[1]),l=String(t[2]);if(l===`K`){let e=String(n.split(`;`)[0]);if(e===`1`)for(let e=0;e<=i;e++)s(e,` `);else r.length=e===`2`?0:i}else l===`m`&&(a=nn(a,n))}c(e.slice(o));let l=``,u=t;for(let e=0;e<r.length;e++){let t=r[e]??{sgr:en,char:` `};an(t.sgr,u)||(an(u,en)||(l+=`\x1B[0m`),l+=rn(t.sgr),u=t.sgr);let n=e>0&&$t(r[e-1]?.char??``);l+=t.spacer===!0&&!n?` `:t.char}return an(u,a)||(an(u,en)||(l+=`\x1B[0m`),l+=rn(a)),{text:l,sgr:a}}function sn(e){let t=[],n=en;for(let r of e.split(`
|
|
13
|
+
`)){let e=r.replace(/\r+$/,``);if(Jt.test(e)){let r=on(e,n);t.push(r.text),n=r.sgr}else{t.push(e);for(let t of e.matchAll(Yt))n=nn(n,String(t[1]))}}return t.join(`
|
|
14
|
+
`)}function cn(e){return sn(e.replace(Gt,``).replace(Kt,``)).replace(qt,``)}function ln(e){let t={},n=e.bg===null?void 0:`rgb(${e.bg})`;if(n!==void 0&&(t.backgroundColor=n),e.fg!==null){let r=`rgb(${e.fg})`;t.color=n===void 0?Ut[e.fg.replace(/\s+/g,``)]??r:r}for(let n of e.decorations)Object.assign(t,Wt[n]);return Object.keys(t).length===0?void 0:t}function un(e){let t=[],n=[t];for(let r of Ht.default.ansiToJson(cn(e),{json:!0,remove_empty:!0})){let e=ln(r);for(let[i,a]of r.content.split(`
|
|
15
|
+
`).entries())i>0&&(t=[],n.push(t)),a!==``&&t.push({text:a,style:e})}return n}function dn(e,t,n){let r=e-t,i=Math.ceil(t/2);return{hidden:r,capped:r>0&&!n,headLines:i,tailLines:t-i}}async function fn(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}let t=typeof document.execCommand==`function`?document.execCommand.bind(document):void 0;if(t===void 0)return!1;let n=document.activeElement instanceof HTMLElement?document.activeElement:null,r=document.createElement(`textarea`);r.value=e,r.setAttribute(`readonly`,``),r.style.position=`fixed`,r.style.left=`-9999px`,document.body.appendChild(r),r.select();try{return t(`copy`)}catch{return!1}finally{r.remove(),n?.focus({preventScroll:!0})}}var pn=1e3;function mn(e){let[t,n]=(0,O.useState)(!1);return{copied:t,onCopy:(0,O.useCallback)(()=>{t||fn(e).then(e=>{e&&(n(!0),window.setTimeout(()=>{n(!1)},pn))})},[t,e])}}var hn={pill:`_pill_e3ygd_1`,interactive:`_interactive_e3ygd_15`,active:`_active_e3ygd_23`};function gn({active:e=!1,className:t,children:n,onClick:r,...i}){return r?(0,z.jsx)(`button`,{type:`button`,className:h(hn.pill,hn.interactive,e&&hn.active,t),onClick:r,...i,children:n}):(0,z.jsx)(`span`,{className:h(hn.pill,e&&hn.active,t),children:n})}var _n={block:`_block_1gdtu_1`,header:`_header_1gdtu_32`,prompt:`_prompt_1gdtu_70`,promptLine:`_promptLine_1gdtu_78`,runState:`_runState_1gdtu_91`,runStateLabel:`_runStateLabel_1gdtu_99`,cwd:`_cwd_1gdtu_108`,command:`_command_1gdtu_116`,status:`_status_1gdtu_128`,copyButton:`_copyButton_1gdtu_136`,output:`_output_1gdtu_156`,line:`_line_1gdtu_180`,expand:`_expand_1gdtu_185`,empty:`_empty_1gdtu_201`};function vn(e,t){let n=e.replace(/[/\\]+$/,``);if(t!==void 0&&n===t.replace(/[/\\]+$/,``))return`~`;let r=n.split(/[/\\]/).pop();return r===void 0||r===``?e:r}function yn(e,t,n){if(t!==void 0)return n.signal(t);if(e!==void 0&&e!==0)return n.exitCode(e)}function bn(e,t,n,r){return e?{state:`ongoing`,label:r.running}:yn(t,n,r)===void 0?{state:`done`,label:r.done}:{state:`error`,label:r.failed}}function xn(e){return e.map((e,t)=>e.style===void 0?e.text:(0,z.jsx)(`span`,{style:e.style,children:e.text},t))}function Sn({command:e,cwd:t,home:n,output:r,exitCode:i,signal:a,running:o=!1,maxLines:s=16,className:c,labels:l}){let u=l,d=r??``,f=(0,O.useMemo)(()=>{let e=un(d),t=e[e.length-1];return e.length>1&&t!==void 0&&t.every(e=>e.text===``)?e.slice(0,-1):e},[d]),[p,m]=(0,O.useState)(!1),{copied:g,onCopy:_}=mn(d),v=(0,O.useCallback)(()=>{m(e=>!e)},[]),y=yn(i,a,u),b=bn(o,i,a,u),x=(0,O.useMemo)(()=>(e.endsWith(`
|
|
16
|
+
`)?e.slice(0,-1):e).split(`
|
|
17
|
+
`),[e]),S=f.every(e=>e.every(e=>e.text.trim()===``)),{hidden:C,capped:w,headLines:T,tailLines:E}=dn(f.length,s,p);return(0,z.jsxs)(`div`,{className:h(_n.block,c),"data-terminal":``,"data-running":o?``:void 0,children:[(0,z.jsxs)(`div`,{className:_n.header,children:[(0,z.jsxs)(`div`,{className:_n.prompt,children:[(0,z.jsx)(`span`,{className:_n.runStateLabel,children:b.label}),x.map((e,r)=>(0,z.jsxs)(`div`,{className:_n.promptLine,children:[r===0&&(0,z.jsx)(xe,{state:b.state,className:_n.runState}),(0,z.jsx)(`span`,{className:_n.cwd,children:r>0||t===void 0?`$`:vn(t,n)}),(0,z.jsx)(`span`,{className:_n.command,children:e})]},r))]}),y!==void 0&&(0,z.jsx)(gn,{className:_n.status,children:y}),!o&&!S&&(0,z.jsx)(`button`,{type:`button`,className:_n.copyButton,onClick:_,children:g?u.copied:u.copy})]}),!o&&(S?(0,z.jsx)(`div`,{className:_n.empty,children:u.noOutput}):(0,z.jsxs)(`div`,{className:_n.output,children:[(w?f.slice(0,T):f).map((e,t)=>(0,z.jsx)(`div`,{className:_n.line,children:xn(e)},t)),C>0&&(0,z.jsx)(`button`,{type:`button`,className:_n.expand,"aria-expanded":p,"aria-label":p?u.collapseAria:u.expandAria(C),onClick:v,children:p?u.collapse:u.expand(C)}),w&&f.slice(f.length-E).map((e,t)=>(0,z.jsx)(`div`,{className:_n.line,children:xn(e)},t))]}))]})}var Cn={root:`_root_1xitv_9`,row:`_row_1xitv_14`,"piw-tool-row-sweep":`_piw-tool-row-sweep_1xitv_1`,leading:`_leading_1xitv_45`,title:`_title_1xitv_52`,sep:`_sep_1xitv_60`,chevron:`_chevron_1xitv_64`,summary:`_summary_1xitv_81`,summarySuffix:`_summarySuffix_1xitv_97`,diffStat:`_diffStat_1xitv_113`,fileLink:`_fileLink_1xitv_126`,errorSummary:`_errorSummary_1xitv_154`,bodyWrap:`_bodyWrap_1xitv_159`,inspectButton:`_inspectButton_1xitv_168`,bodyScroll:`_bodyScroll_1xitv_203`,ioCard:`_ioCard_1xitv_212`,ioSection:`_ioSection_1xitv_224`,ioLabel:`_ioLabel_1xitv_253`,ioDivider:`_ioDivider_1xitv_262`,ioText:`_ioText_1xitv_268`,codeBody:`_codeBody_1xitv_288`,terminalBody:`_terminalBody_1xitv_289`,diffBody:`_diffBody_1xitv_290`,readBody:`_readBody_1xitv_291`,imageBody:`_imageBody_1xitv_292`,searchBody:`_searchBody_1xitv_293`,webBody:`_webBody_1xitv_294`,searchRecovery:`_searchRecovery_1xitv_301`,imageLabel:`_imageLabel_1xitv_312`,imageMeta:`_imageMeta_1xitv_324`,visuallyHidden:`_visuallyHidden_1xitv_350`},wn={root:`_root_1ulqw_1`,chevron:`_chevron_1ulqw_21`,label:`_label_1ulqw_35`},Tn={root:`_root_xlier_4`,trigger:`_trigger_xlier_19`,label:`_label_xlier_39`},En={panel:`_panel_105wx_10`,title:`_title_105wx_35`,titleRule:`_titleRule_105wx_45`,titleValue:`_titleValue_105wx_50`,titleLabel:`_titleLabel_105wx_55`,details:`_details_105wx_68`,route:`_route_105wx_88`,reasoning:`_reasoning_105wx_92`},Dn={actions:`_actions_qoqwk_5`,timeStart:`_timeStart_qoqwk_15`,timeEnd:`_timeEnd_qoqwk_26`,action:`_action_qoqwk_5`,visuallyHidden:`_visuallyHidden_qoqwk_94`};function On(e){try{let t=JSON.parse(e.text),n=t.command??t.file_path??t.path??t.url??t.query??t.pattern;if(typeof n==`string`)return n}catch{}return e.text}function kn({block:e,result:t,running:n,onInspect:r,cwd:i}){let[a,o]=(0,O.useState)(!1),s=t?.blocks.map(e=>e.text).join(`
|
|
18
|
+
`)??null,c=t?.isError?`error`:t?`ok`:n?`running`:`pending`,l=e.toolName===`bash`||e.toolName===`pwsh`,u={bash:`Bash`,pwsh:`PowerShell`,read:R(`读取`,`Read`),write:R(`写入`,`Write`),edit:R(`编辑`,`Edit`),grep:R(`搜索`,`Search`),glob:R(`搜索`,`Search`)}[e.toolName||``]||e.toolName||R(`工具调用`,`Tool call`),d=On(e);return(0,z.jsx)(`div`,{className:Cn.root,"data-state":c,"data-tool":e.toolName,children:(0,z.jsx)(Nt,{icon:(0,z.jsx)(ze,{size:14}),title:u,open:a,onToggle:()=>o(e=>!e),rowClassName:Cn.row,leadingClassName:Cn.leading,titleClassName:Cn.title,chevronClassName:Cn.chevron,collapsedContent:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Cn.sep,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`${Cn.summary} ${c===`error`?Cn.errorSummary:``}`,children:c===`error`?s?.split(`
|
|
19
|
+
`,1)[0]:d})]}),children:(0,z.jsxs)(`div`,{className:Cn.bodyWrap,children:[l?(0,z.jsx)(Sn,{command:d,cwd:i,output:s??void 0,running:s===null,exitCode:t?.isError?1:t?0:void 0,maxLines:1/0,className:Cn.terminalBody,labels:{signal:e=>R(`信号 ${e}`,`Signal ${e}`),exitCode:e=>R(`退出码 ${e}`,`Exit code ${e}`),running:R(`运行中`,`Running`),failed:R(`失败`,`Failed`),done:R(`已完成`,`Done`),copy:R(`复制`,`Copy`),copied:R(`已复制`,`Copied`),noOutput:R(`无输出`,`No output`),collapseAria:R(`收起输出`,`Collapse output`),collapse:R(`收起`,`Collapse`),expandAria:e=>R(`展开其余 ${e} 行输出`,`Expand remaining ${e} output lines`),expand:e=>R(`… 其余 ${e} 行`,`… ${e} more lines`)}}):(0,z.jsxs)(`div`,{className:Cn.ioCard,children:[(0,z.jsxs)(`div`,{className:Cn.ioSection,children:[(0,z.jsx)(`span`,{className:Cn.ioLabel,children:`IN`}),(0,z.jsx)(`span`,{className:Cn.ioText,children:e.text})]}),s!==null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:Cn.ioDivider,"aria-hidden":!0}),(0,z.jsxs)(`div`,{className:Cn.ioSection,children:[(0,z.jsx)(`span`,{className:Cn.ioLabel,children:`OUT`}),(0,z.jsx)(`span`,{className:Cn.ioText,"data-error":t?.isError||void 0,children:s||R(`无文本输出`,`No text output`)})]})]})]}),r&&(0,z.jsx)(`button`,{className:Cn.inspectButton,type:`button`,onClick:r,children:R(`查看轨迹`,`View trajectory`)})]})})})}function An({toolCount:e,messageCount:t,open:n,onToggle:r}){let i=[e>0&&R(`${e} 次工具调用`,`${e} tool calls`),t>0&&R(`${t} 条消息`,`${t} messages`)].filter(Boolean);return(0,z.jsxs)(`button`,{type:`button`,className:wn.root,"data-open":n||void 0,"aria-expanded":n,onClick:r,children:[(0,z.jsx)(`span`,{className:wn.label,children:i.length?i.join(` · `):R(`已思考`,`Thought`)}),(0,z.jsx)(Ae,{className:wn.chevron})]})}function jn(e){return`${e.toLocaleString()} tok`}function Mn({usage:e,model:t}){let[n,r]=(0,O.useState)(!1),i=(0,O.useRef)(null),a=(0,O.useRef)(null),[o,s]=(0,O.useState)(null);(0,O.useLayoutEffect)(()=>{if(!n)return;let e=()=>{let e=i.current?.getBoundingClientRect(),t=a.current?.getBoundingClientRect();e&&t&&s({top:Math.max(12,Math.min(window.innerHeight-t.height-12,e.top-t.height-8)),left:Math.max(12,Math.min(e.left,window.innerWidth-t.width-12))})};e();let t=e=>{!i.current?.contains(e.target)&&!a.current?.contains(e.target)&&r(!1)},o=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,o),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,o),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[n]);let c=e.input+e.cacheRead+e.cacheWrite,l=c>0?Math.round(e.cacheRead/c*100):null;return(0,z.jsxs)(`span`,{ref:i,className:Tn.root,children:[(0,z.jsxs)(`button`,{type:`button`,className:Tn.trigger,"aria-haspopup":`dialog`,"aria-expanded":n,onClick:()=>r(e=>!e),children:[(0,z.jsx)(Je,{}),(0,z.jsxs)(`span`,{className:Tn.label,children:[R(`用量`,`Usage`),` `,jn(e.totalTokens)]})]}),n&&(0,Qe.createPortal)((0,z.jsxs)(`div`,{ref:a,className:En.panel,role:`dialog`,"aria-label":R(`本轮用量`,`Turn usage`),style:o??{top:-1e3,left:-1e3},children:[(0,z.jsxs)(`div`,{className:En.title,children:[(0,z.jsxs)(`span`,{className:En.titleLabel,children:[(0,z.jsx)(Je,{}),R(`本轮用量`,`Turn usage`)]}),(0,z.jsx)(`span`,{className:En.titleValue,children:jn(e.totalTokens)})]}),(0,z.jsx)(`div`,{className:En.titleRule,"aria-hidden":!0}),(0,z.jsxs)(`dl`,{className:En.details,children:[t&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:R(`提供方 / 模型`,`Provider / model`)}),(0,z.jsx)(`dd`,{className:En.route,children:t})]}),l!==null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:R(`缓存命中`,`Cache hit`)}),(0,z.jsxs)(`dd`,{children:[l,`%`]})]}),(0,z.jsx)(`dt`,{children:R(`未缓存输入`,`Uncached input`)}),(0,z.jsx)(`dd`,{children:jn(e.input)}),(0,z.jsx)(`dt`,{children:R(`缓存读取`,`Cache read`)}),(0,z.jsx)(`dd`,{children:jn(e.cacheRead)}),(0,z.jsx)(`dt`,{children:R(`缓存写入`,`Cache write`)}),(0,z.jsx)(`dd`,{children:jn(e.cacheWrite)}),(0,z.jsx)(`dt`,{children:R(`输出`,`Output`)}),(0,z.jsxs)(`dd`,{children:[jn(e.output),e.reasoning!==void 0&&(0,z.jsx)(`span`,{className:En.reasoning,children:R(`(其中推理 ${jn(e.reasoning)})`,` (including ${jn(e.reasoning)} reasoning)`)})]})]})]}),document.body)]})}function Nn({text:e,timestamp:t,usage:n,model:r}){let{copied:i,onCopy:a}=mn(e);return(0,z.jsxs)(`div`,{className:Dn.actions,children:[e&&(0,z.jsx)(`button`,{className:Dn.action,type:`button`,"aria-label":i?R(`已复制`,`Copied`):R(`复制回复`,`Copy reply`),onClick:a,children:(0,z.jsx)(Pe,{})}),n&&(0,z.jsx)(Mn,{usage:n,model:r}),t&&(0,z.jsx)(`time`,{className:Dn.timeEnd,dateTime:t,children:new Date(t).toLocaleTimeString(R(`zh-CN`,`en-US`),{hour:`2-digit`,minute:`2-digit`})})]})}var Pn=class{port=null;pending=new Map;sequence=0;disposed=!1;connection=0;frame;identity;host;timeoutMs;constructor(e,t,n,r=1e4){this.frame=e,this.identity=t,this.host=n,this.timeoutMs=r}async connect(e,t){if(this.disposed||this.port)throw Error(`Frame already connected or disposed`);let n=new URL(e,location.href);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password)throw Error(`Invalid frame document URL`);n.searchParams.set(`parentOrigin`,location.origin);for(let e of[`pluginId`,`generation`,`mountId`])n.searchParams.set(e,String(this.identity[e]));let r=++this.connection;if(await new Promise((e,t)=>{let r=setTimeout(()=>i(Error(`Frame document timed out`)),this.timeoutMs),i=n=>{clearTimeout(r),this.frame.removeEventListener(`load`,o),this.frame.removeEventListener(`error`,a),this.cancelLoad=null,n?t(n):e()},a=()=>i(Error(`Frame document failed`)),o=()=>i();this.cancelLoad=()=>i(Error(`Frame disposed`)),this.frame.addEventListener(`load`,o,{once:!0}),this.frame.addEventListener(`error`,a,{once:!0}),this.frame.src=n.href}),this.disposed||r!==this.connection||!this.frame.contentWindow)throw Error(`Frame connection superseded`);let i=this.frame.contentWindow,a=new MessageChannel;this.port=a.port1,this.port.onmessage=e=>{!this.disposed&&this.frame.contentWindow===i&&r===this.connection&&this.receive(e.data)},this.port.onmessageerror=()=>this.dispose(),this.port.start(),i.postMessage({type:`pi:hosted:connect`,protocol:1,pluginId:this.identity.pluginId,generation:this.identity.generation,mountId:this.identity.mountId},n.origin,[a.port2]),this.frame.addEventListener(`load`,this.navigated),await this.call(`initialize`,t)}cancelLoad=null;navigated=()=>this.dispose();async receive(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.id==`string`){if(t.type===`response`){let e=this.pending.get(t.id);if(!e)return;this.pending.delete(t.id),clearTimeout(e.timer),t.ok===!0?e.resolve(t.value):e.reject(Object.assign(Error(t.error?.message??`Frame RPC failed`),t.error))}else if(t.type===`request`&&typeof t.method==`string`)try{let e=await this.host(t.method,t.input);this.port?.postMessage({type:`response`,id:t.id,ok:!0,value:e})}catch(e){let n=e;this.port?.postMessage({type:`response`,id:t.id,ok:!1,error:{code:n.code??`host_error`,message:n.message??String(e),status:n.status,reason:n.reason}})}}}call(e,t){if(this.disposed||!this.port)return Promise.reject(Error(`Frame is not connected`));let n=`${this.identity.mountId}:${++this.sequence}`;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(Error(`Frame ${e} timed out; edits were not acknowledged`))},this.timeoutMs);this.pending.set(n,{resolve:r,reject:i,timer:a});try{this.port.postMessage({type:`request`,id:n,method:e,input:t})}catch(e){clearTimeout(a),this.pending.delete(n),i(e)}})}dispose(){if(!this.disposed){this.disposed=!0,++this.connection,this.cancelLoad?.(),this.frame.removeEventListener(`load`,this.navigated);for(let e of this.pending.values())clearTimeout(e.timer),e.reject(Error(`Frame disposed`));this.pending.clear(),this.port?.close(),this.port=null}}},Fn=new class{frames=new Set;incarnations=new Map;incarnation(e,t){return this.incarnations.get(`${e}/${t}`)??0}add(e){return this.frames.add(e),()=>this.frames.delete(e)}async retireWithin(e,t){let n=[...this.frames].filter(n=>n.identity.sessionId===e&&t.contains(n.adapter.frame));await Promise.all(n.map(async e=>{if(await e.ready,!e.retire)throw Error(`View cannot retire safely`);await e.retire()}))}async retireTools(e,t){let n=[...this.frames].filter(n=>n.identity.sessionId===e&&n.toolCallId&&t.includes(n.toolCallId));await Promise.all(n.map(async e=>{if(await e.ready,!e.retire)throw Error(`View cannot retire safely`);await e.retire()}));for(let t of n){let n=`${e}/${t.toolCallId}`;this.incarnations.set(n,(this.incarnations.get(n)??0)+1)}}async flush(e){let t=[...this.frames].filter(t=>t.identity.sessionId===e),n=(await Promise.allSettled(t.map(async e=>{await e.ready,await e.adapter.call(`flush`),await e.afterFlush?.()}))).find(e=>e.status===`rejected`);if(n?.status===`rejected`)throw n.reason;if(t.length!==[...this.frames].filter(t=>t.identity.sessionId===e).length||t.some(e=>!this.frames.has(e)))throw Error(`Plugin views changed during flush; retry without losing your prompt`)}};function In(e){let t=[];for(let n of e){(n.role===`user`||t.length===0)&&t.push({id:n.id,index:t.length+1,messages:[],usage:null});let e=t[t.length-1];if(e.messages.push(n),n.usage){let t=e.usage;e.usage={input:(t?.input??0)+n.usage.input,output:(t?.output??0)+n.usage.output,cacheRead:(t?.cacheRead??0)+n.usage.cacheRead,cacheWrite:(t?.cacheWrite??0)+n.usage.cacheWrite,totalTokens:(t?.totalTokens??0)+n.usage.totalTokens,cost:(t?.cost??0)+n.usage.cost,...t?.reasoning!==void 0||n.usage.reasoning!==void 0?{reasoning:(t?.reasoning??0)+(n.usage.reasoning??0)}:{}}}}return t}function Ln(e,t){let n=new Map;for(let r of e)r.role===`assistant`&&r.blocks.forEach((e,i)=>{if(e.kind!==`toolCall`||!t.includes(e.toolName??``))return;let a=e.toolCallId??`${r.id}-${i}`,o=n.get(a),s=r.id===`stream`;o&&!o.streaming&&s||n.set(a,{key:a,call:e,streaming:s})});return[...n.values()].map(({key:e,call:t})=>({key:e,call:t}))}function Rn(e,t){let n=Ln(e.messages,t)[0];return n?`tool:${n.key}`:`message:${e.id}`}function zn(e,t){return e===t||e.length===t.length&&e.every((e,n)=>e===t[n]||JSON.stringify(e)===JSON.stringify(t[n]))}function Bn(e){let t=new Set(e.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId)));return new Map(e.filter(e=>e.role===`tool`&&e.toolCallId&&t.has(e.toolCallId)).map(e=>[e.toolCallId,e]))}function Vn(e){let t=e?.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
20
|
+
`)??``;return/"status"\s*:\s*"pending[_a-z]*"/u.test(t)}function Hn(e,t,n){let r=e=>e.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&n.includes(e.toolName??``)).map(e=>e.toolCallId)),i=new Set(r(t));return r(e).filter(e=>!i.has(e))}function Un(e,t,n){let r=(0,O.useRef)(t);r.current=t;let[i,a]=(0,O.useState)({sessionId:e,messages:t,retiring:[]}),[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(0);if(i.sessionId!==e)a({sessionId:e,messages:t,retiring:[]});else if(!i.retiring.length&&!zn(i.messages,t)){let e=Hn(i.messages,t,n).length?Hn(i.messages,[],n):[];a(e.length?{...i,retiring:e}:{...i,messages:t})}let u=JSON.stringify(i.retiring);return(0,O.useEffect)(()=>{if(!e||!i.retiring.length)return;let t=!0;return Fn.retireTools(e,i.retiring).then(()=>{t&&(s(``),a(e=>({...e,messages:r.current,retiring:[]})))}).catch(e=>{t&&s(`Removed plugin view retained for recovery: ${String(e)}`)}),()=>{t=!1}},[e,u,c]),{messages:i.messages,error:o,retry:()=>l(e=>e+1)}}function Wn({status:e,description:t}){let n=e===`completed`?R(`子代理已完成`,`Subagent completed`):e===`failed`?R(`子代理执行失败`,`Subagent failed`):e===`cancelled`?R(`子代理已取消`,`Subagent cancelled`):R(`子代理任务更新`,`Subagent task update`);return t?`${n}${R(`:`,`: `)}${t}`:n}var Gn={root:`_root_10hwk_2`,ledger:`_ledger_10hwk_16`},H={split:`_split_m0qel_1`,tablePane:`_tablePane_m0qel_15`,historyLoading:`_historyLoading_m0qel_25`,historyLoadingBar:`_historyLoadingBar_m0qel_34`,historyLoadingSpinner:`_historyLoadingSpinner_m0qel_48`,"history-loading-spin":`_history-loading-spin_m0qel_1`,table:`_table_m0qel_15`,historyLoadRow:`_historyLoadRow_m0qel_59`,historyLoadButton:`_historyLoadButton_m0qel_69`,visuallyHidden:`_visuallyHidden_m0qel_97`,eventColumn:`_eventColumn_m0qel_136`,contentColumn:`_contentColumn_m0qel_140`,eventHeader:`_eventHeader_m0qel_163`,virtualSpacer:`_virtualSpacer_m0qel_178`,turnRail:`_turnRail_m0qel_220`,requestBoundaryControl:`_requestBoundaryControl_m0qel_233`,requestBoundaryControlActive:`_requestBoundaryControlActive_m0qel_294`,event:`_event_m0qel_136`,selectionRail:`_selectionRail_m0qel_330`,turnLabel:`_turnLabel_m0qel_392`,turnLabelFull:`_turnLabelFull_m0qel_412`,turnLabelCompact:`_turnLabelCompact_m0qel_413`,turnLabelActive:`_turnLabelActive_m0qel_426`,eventInner:`_eventInner_m0qel_435`,kindSlot:`_kindSlot_m0qel_443`,content:`_content_m0qel_140`,kindTag:`_kindTag_m0qel_463`,kindTagIcon:`_kindTagIcon_m0qel_479`,kindTagLabel:`_kindTagLabel_m0qel_491`,message:`_message_m0qel_499`,user:`_user_m0qel_594`,systemNeutral:`_systemNeutral_m0qel_599`,contextGreen:`_contextGreen_m0qel_604`,compacted:`_compacted_m0qel_613`,compactedSummary:`_compactedSummary_m0qel_618`,promptDiffSections:`_promptDiffSections_m0qel_624`,promptDiffSection:`_promptDiffSection_m0qel_624`,promptDiffTitle:`_promptDiffTitle_m0qel_637`,promptDiff:`_promptDiff_m0qel_624`,promptDiffLinemeta:`_promptDiffLinemeta_m0qel_659`,promptDiffLinecontext:`_promptDiffLinecontext_m0qel_665`,promptDiffLineadded:`_promptDiffLineadded_m0qel_669`,promptDiffLineremoved:`_promptDiffLineremoved_m0qel_678`,assistantVioletBright:`_assistantVioletBright_m0qel_687`,toolAmber:`_toolAmber_m0qel_704`,subtoolAmber:`_subtoolAmber_m0qel_709`,contentText:`_contentText_m0qel_722`,toolCallOnly:`_toolCallOnly_m0qel_730`,collapsedTurnContent:`_collapsedTurnContent_m0qel_753`,collapsedTurnEllipsis:`_collapsedTurnEllipsis_m0qel_762`,collapsedTurnText:`_collapsedTurnText_m0qel_770`,resultPreview:`_resultPreview_m0qel_777`,resultRequest:`_resultRequest_m0qel_791`,inlineResultText:`_inlineResultText_m0qel_792`,toolCallNameTypeface:`_toolCallNameTypeface_m0qel_799`,toolCallPayload:`_toolCallPayload_m0qel_805`,inlineResult:`_inlineResult_m0qel_792`,noOutputText:`_noOutputText_m0qel_830`,arrow:`_arrow_m0qel_834`,error:`_error_m0qel_840`,overview:`_overview_m0qel_844`,details:`_details_m0qel_848`,errorPayload:`_errorPayload_m0qel_848`,resultBlockText:`_resultBlockText_m0qel_852`,jsonPayload:`_jsonPayload_m0qel_856`,jsonPreview:`_jsonPreview_m0qel_857`,detailsResizeHandle:`_detailsResizeHandle_m0qel_879`,detailsHeader:`_detailsHeader_m0qel_898`,detailsTitle:`_detailsTitle_m0qel_909`,requestDetailsDot:`_requestDetailsDot_m0qel_917`,requestDetailsName:`_requestDetailsName_m0qel_926`,detailsLocation:`_detailsLocation_m0qel_931`,close:`_close_m0qel_940`,detailTabs:`_detailTabs_m0qel_962`,detailTab:`_detailTab_m0qel_962`,detailTabActive:`_detailTabActive_m0qel_1000`,detailBody:`_detailBody_m0qel_1021`,detailBodySummary:`_detailBodySummary_m0qel_1030`,summaryScrollRegion:`_summaryScrollRegion_m0qel_1051`,markdownPayload:`_markdownPayload_m0qel_1062`,overviewParentLinks:`_overviewParentLinks_m0qel_1072`,overviewHierarchyNavLink:`_overviewHierarchyNavLink_m0qel_1077`,overviewHierarchyJumpIconTight:`_overviewHierarchyJumpIconTight_m0qel_1092`,requestTokenDetail:`_requestTokenDetail_m0qel_1116`,usagePanel:`_usagePanel_m0qel_1120`,usageGroup:`_usageGroup_m0qel_1124`,usageHeading:`_usageHeading_m0qel_1128`,timestampToggle:`_timestampToggle_m0qel_1153`,overviewSections:`_overviewSections_m0qel_1166`,overviewSection:`_overviewSection_m0qel_1166`,overviewHeading:`_overviewHeading_m0qel_1188`,overviewTitle:`_overviewTitle_m0qel_1203`,overviewTitleIcon:`_overviewTitleIcon_m0qel_1220`,overviewPreview:`_overviewPreview_m0qel_1238`,schemaTree:`_schemaTree_m0qel_1252`,markdownPreview:`_markdownPreview_m0qel_1268`,assistantContent:`_assistantContent_m0qel_1340`,payload:`_payload_m0qel_1341`,thinkingQuote:`_thinkingQuote_m0qel_1345`,thinkingQuoteOnlyPreview:`_thinkingQuoteOnlyPreview_m0qel_1353`,assistantContentRendered:`_assistantContentRendered_m0qel_1357`,thinkingToggle:`_thinkingToggle_m0qel_1361`,thinkingChevron:`_thinkingChevron_m0qel_1376`,assistantOutput:`_assistantOutput_m0qel_1403`,schema:`_schema_m0qel_1252`,schemaPreview:`_schemaPreview_m0qel_1429`,schemaIntro:`_schemaIntro_m0qel_1433`,schemaName:`_schemaName_m0qel_1441`,schemaDescription:`_schemaDescription_m0qel_1447`,schemaParameters:`_schemaParameters_m0qel_1454`,schemaParametersTitle:`_schemaParametersTitle_m0qel_1458`,payloadPreview:`_payloadPreview_m0qel_1483`,sourceBlocks:`_sourceBlocks_m0qel_1488`,sourceBlock:`_sourceBlock_m0qel_1488`,sourceBlockHeader:`_sourceBlockHeader_m0qel_1498`,sourceBlockJumpTarget:`_sourceBlockJumpTarget_m0qel_1499`,sourceBlockLabel:`_sourceBlockLabel_m0qel_1519`,sourceBlockJumpIcon:`_sourceBlockJumpIcon_m0qel_1524`,sourceBlockContent:`_sourceBlockContent_m0qel_1541`,messageImages:`_messageImages_m0qel_1551`,messageImagesPreview:`_messageImagesPreview_m0qel_1558`,assistantToolCalls:`_assistantToolCalls_m0qel_1563`,assistantToolCallsPreview:`_assistantToolCallsPreview_m0qel_1573`,assistantToolCallButton:`_assistantToolCallButton_m0qel_1582`,assistantToolCallIcon:`_assistantToolCallIcon_m0qel_1606`,assistantToolCallText:`_assistantToolCallText_m0qel_1617`,assistantToolCallName:`_assistantToolCallName_m0qel_1625`,assistantToolCallArgs:`_assistantToolCallArgs_m0qel_1632`,systemPrompt:`_systemPrompt_m0qel_1640`,toolCatalog:`_toolCatalog_m0qel_1644`,toolCatalogItem:`_toolCatalogItem_m0qel_1649`,toolCatalogSummary:`_toolCatalogSummary_m0qel_1653`,toolCatalogChevron:`_toolCatalogChevron_m0qel_1680`,toolCatalogIcon:`_toolCatalogIcon_m0qel_1681`,toolCatalogName:`_toolCatalogName_m0qel_1693`,toolCatalogDescription:`_toolCatalogDescription_m0qel_1698`,toolCatalogDefinition:`_toolCatalogDefinition_m0qel_1707`,toolCatalogFullDescription:`_toolCatalogFullDescription_m0qel_1712`,toolCatalogTree:`_toolCatalogTree_m0qel_1720`,resultBlocks:`_resultBlocks_m0qel_1725`,resultBlocksPreview:`_resultBlocksPreview_m0qel_1734`,noPayload:`_noPayload_m0qel_1750`},Kn={root:`_root_wxaz8_1`,plot:`_plot_wxaz8_14`,labels:`_labels_wxaz8_22`,track:`_track_wxaz8_53`,earlierHistory:`_earlierHistory_wxaz8_64`,empty:`_empty_wxaz8_104`,lanes:`_lanes_wxaz8_118`,turnBoundaries:`_turnBoundaries_wxaz8_127`,turnBoundary:`_turnBoundary_wxaz8_144`,span:`_span_wxaz8_153`,selection:`_selection_wxaz8_253`,selectionEdges:`_selectionEdges_wxaz8_272`,hoverLine:`_hoverLine_wxaz8_283`},qn={timelineButton:`_timelineButton_1dmz1_1`,turnLabelButton:`_turnLabelButton_1dmz1_3`,empty:`_empty_1dmz1_5`};function Jn(e,t,n){return Math.min(n,Math.max(t,e))}function Yn({t:e,model:t,actualTime:n,selectedIndex:r,matchingIndexes:i,range:a,onRangeChange:o,onSelect:s}){let c=(0,O.useRef)(null),l=(0,O.useRef)(null),u=(0,O.useRef)(null),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(null),[h,g]=(0,O.useState)(null),[_,v]=(0,O.useState)(!1),y=Math.max(1,(t?.end??1)-(t?.start??0)),b=p&&t?Jn(p.end-p.start,1,y):y,x=t?Jn(p?.start??t.start,t.start,t.end-b):0,S=e=>{let t=e.currentTarget.getBoundingClientRect();return Jn((e.clientX-t.left)/Math.max(1,t.width),0,1)},C=e=>{let t=e.target instanceof Element?e.target.closest(`[data-timeline-record-index]`):null,n=Number(t?.dataset.timelineRecordIndex);return t&&Number.isFinite(n)?n:null};if((0,O.useEffect)(()=>{m(null),o(null)},[n]),(0,O.useEffect)(()=>{t&&p&&(p.end<t.start||p.start>t.end)&&m(null)},[t,p]),(0,O.useEffect)(()=>{if(!t||!p||r===null)return;let e=t.spans.find(e=>e.index===r);if(!e||e.start>=x&&e.start<=x+b)return;let n=Jn(e.start-b/2,t.start,t.end-b);m({start:n,end:n+b})},[t,r]),(0,O.useEffect)(()=>{let e=c.current;if(!e||!t)return;let r=e=>{e.preventDefault();let r=l.current?.getBoundingClientRect();if(!r)return;let i=Jn((e.clientX-r.left)/Math.max(1,r.width),0,1),a=Jn(b*Math.exp(e.deltaY*.0015),Math.min(n?20:4,y),y);if(a>=y*.999){m(null);return}let o=Jn(x+i*(b-a),t.start,t.end-a);m({start:o,end:o+a})};return e.addEventListener(`wheel`,r,{passive:!1}),()=>e.removeEventListener(`wheel`,r)},[t,x,b,y,n]),!t)return(0,z.jsx)(`section`,{ref:c,className:Kn.root,"aria-label":e(`会话时间线`,`Session timeline`),children:(0,z.jsxs)(`div`,{className:Kn.plot,children:[(0,z.jsxs)(`div`,{className:Kn.labels,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{children:e(`输入`,`Input`)}),(0,z.jsx)(`span`,{children:e(`模型`,`Model`)}),(0,z.jsx)(`span`,{children:e(`工具`,`Tool`)})]}),(0,z.jsx)(`div`,{className:Kn.track,children:(0,z.jsx)(`span`,{className:Kn.empty,children:e(`暂无轨迹`,`No trajectory yet`)})})]})});let w={"--trajectory-domain-left":`${-(x-t.start)/b*100}%`,"--trajectory-domain-width":`${y/b*100}%`},T=d??a,E=T?{"--trajectory-selection-left":`${(T.start-x)/b*100}%`,"--trajectory-selection-width":`${(T.end-T.start)/b*100}%`}:void 0;return(0,z.jsx)(`section`,{ref:c,className:Kn.root,"aria-label":e(`会话时间线`,`Session timeline`),children:(0,z.jsxs)(`div`,{className:Kn.plot,children:[(0,z.jsxs)(`div`,{className:Kn.labels,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{children:e(`输入`,`Input`)}),(0,z.jsx)(`span`,{children:e(`模型`,`Model`)}),(0,z.jsx)(`span`,{children:e(`工具`,`Tool`)})]}),(0,z.jsxs)(`div`,{ref:l,className:Kn.track,"data-panning":_||void 0,"aria-label":e(`时间线概览;拖动选择范围,滚轮缩放,右键拖动平移`,`Timeline overview; drag to select, scroll to zoom, right drag to pan`),tabIndex:0,onKeyDown:e=>{e.key===`Escape`&&(o(null),m(null))},onDoubleClick:()=>o(null),onContextMenu:e=>e.preventDefault(),onPointerDown:e=>{if(e.button!==0&&e.button!==2)return;let t=x+S(e)*b;u.current={pointerId:e.pointerId,clientX:e.clientX,time:t,index:C(e),pan:e.button===2,viewportStart:x},e.currentTarget.setPointerCapture(e.pointerId),e.button===2?v(!0):f({start:t,end:t})},onPointerMove:e=>{g(S(e));let n=u.current;if(n&&n.pointerId===e.pointerId){if(n.pan){if(!p)return;let r=e.currentTarget.getBoundingClientRect(),i=Jn(n.viewportStart-(e.clientX-n.clientX)/Math.max(1,r.width)*b,t.start,t.end-b);m({start:i,end:i+b})}else{let t=x+S(e)*b;f({start:Math.min(n.time,t),end:Math.max(n.time,t)})}}},onPointerUp:e=>{let n=u.current;if(!n||n.pointerId!==e.pointerId)return;if(u.current=null,e.currentTarget.releasePointerCapture(e.pointerId),v(!1),f(null),n.pan){Math.abs(e.clientX-n.clientX)<3&&o(null);return}if(Math.abs(e.clientX-n.clientX)<3&&n.index!==null){o(null),s(n.index);return}let r=x+S(e)*b,i=Math.min(b,y/t.spans.length),a=(n.time+r)/2,c=Math.max(i,Math.abs(r-n.time)),l=Jn(a-c/2,t.start,t.end-c);o({start:l,end:l+c})},onPointerCancel:()=>{u.current=null,f(null),v(!1)},onPointerLeave:()=>{u.current||g(null)},children:[h!==null&&!d&&(0,z.jsx)(`div`,{className:Kn.hoverLine,style:{"--trajectory-hover-left":`${h*100}%`},"aria-hidden":`true`}),E&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:Kn.selection,style:E,"aria-hidden":`true`}),(0,z.jsx)(`div`,{className:Kn.selectionEdges,style:E,"aria-hidden":`true`})]}),(0,z.jsx)(`div`,{className:Kn.turnBoundaries,style:w,"aria-hidden":`true`,children:t.boundaries.slice(1).map(e=>(0,z.jsx)(`span`,{className:Kn.turnBoundary,style:{"--trajectory-turn-left":`${(e.time-t.start)/y*100}%`}},e.turn))}),(0,z.jsx)(`div`,{className:Kn.lanes,style:w,children:t.spans.map(a=>{let o=(a.end-a.start)/y*100;return(0,z.jsx)(`button`,{type:`button`,className:`${Kn.span} ${qn.timelineButton}`,"data-timeline-record-index":a.index,"data-timeline-span":a.lane===0?`user`:a.lane===2?`tool`:`message`,"data-equal-duration":n&&a.end===a.start||void 0,"data-current":r===a.index||void 0,"data-error":a.error||void 0,"data-selected":T?a.start<=T.end&&a.end>=T.start?`true`:`false`:void 0,"data-search-match":i?i.has(a.index)?`true`:`false`:void 0,"aria-label":e(`第 ${a.index} 条轨迹`,`Trajectory record ${a.index}`),title:e(`第 ${a.index} 条 · ${n?new Date(a.start).toLocaleTimeString():`事件顺序`}`,`Record ${a.index} · ${n?new Date(a.start).toLocaleTimeString():`event order`}`),style:{"--trajectory-span-left":`${(a.start-t.start)/y*100}%`,"--trajectory-span-width":`${o}%`,"--trajectory-span-gap":`min(${o*.08}%, 1px)`,"--trajectory-span-lane":a.lane},onClick:e=>{e.detail===0&&s(a.index)}},a.index)})})]})]})})}function Xn(e,t){if(e.length===0)return null;let n=e.map(e=>Date.parse(e.timestamp)).find(Number.isFinite)??0,r=e.map((e,n)=>{let r=Date.parse(e.timestamp),i=t&&Number.isFinite(r)?r:n,a=e.endTimestamp?Date.parse(e.endTimestamp):NaN;return{index:e.index,start:i,end:t&&Number.isFinite(a)&&a>i?a:t?i:n+1,lane:e.kind===`user`?0:e.kind===`tool`?2:1,error:e.error===!0}}),i=e.flatMap((t,n)=>n===0||t.turn!==e[n-1].turn?[{turn:t.turn,time:r[n].start}]:[]),a=t?Math.min(n,...r.map(e=>e.start)):0,o=Math.max(...r.map(e=>e.end));return{start:a,end:t?o+Math.max(1,(o-a)/100):e.length,spans:r,boundaries:i}}function Zn(e,t,n){return new Set(e.spans.filter(e=>e.start<=n&&e.end>=t).map(e=>e.index))}var Qn={root:`_root_15786_1`,inner:`_inner_15786_12`,actions:`_actions_15786_22`,toggle:`_toggle_15786_29`,toggleIcon:`_toggleIcon_15786_59`,control:`_control_15786_69`,controlTrack:`_controlTrack_15786_107`,controlThumb:`_controlThumb_15786_118`,action:`_action_15786_22`,actionIcon:`_actionIcon_15786_163`,search:`_search_15786_168`,searchIcon:`_searchIcon_15786_192`,searchInput:`_searchInput_15786_196`};function $n(e){return e.replace(/\s+/g,` `).trim()}function er(e){try{return JSON.stringify(JSON.parse(e))}catch{return $n(e)}}function tr(e){let t=new Map(e.filter(e=>e.role===`tool`&&e.toolCallId).map(e=>[e.toolCallId,e])),n=0;return In(e).flatMap(e=>{let r=[],i=new Set(e.messages.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId)));for(let a of e.messages)if(!(a.role===`tool`&&a.toolCallId&&i.has(a.toolCallId))){if(a.role===`notice`&&a.subagentNotice)r.push({id:`${a.id}-notice`,kind:`message`,label:R(`子代理`,`Subagent`),preview:Wn(a.subagentNotice),text:a.blocks.map(e=>e.text).join(`
|
|
21
|
+
|
|
22
|
+
`)||R(`没有结果预览`,`No result preview`),timestamp:a.timestamp,error:a.subagentNotice.status===`failed`,turn:e.index,index:++n});else for(let[i,o]of a.blocks.entries()){let s=a.role===`user`?`user`:a.role===`tool`||o.kind===`toolCall`?`tool`:`message`,c=o.kind===`toolCall`&&o.toolCallId?t.get(o.toolCallId):void 0;r.push({id:`${a.id}-${i}`,...o.toolCallId||a.toolCallId?{callId:o.toolCallId??a.toolCallId}:{},kind:s,label:s===`tool`?R(`工具`,`Tool`):a.subagentInput===`dispatch`?R(`主 Agent 派发`,`Parent agent dispatch`):a.subagentInput===`steering`?R(`主 Agent 补充指令`,`Parent agent steering`):a.role===`user`?R(`用户`,`User`):R(`助手`,`Assistant`),...s===`tool`?{toolName:o.kind===`toolCall`?o.toolName||R(`工具`,`Tool`):a.toolName||R(`工具`,`Tool`)}:{},text:o.text,preview:o.kind===`toolCall`?er(o.text):$n(o.text),...c?{result:$n(c.blocks.map(e=>e.text).join(` `))}:{},timestamp:a.timestamp,...c?{endTimestamp:c.timestamp}:{},...a.usage&&i===a.blocks.length-1?{usage:a.usage}:{},...a.isError||c?.isError?{error:!0}:{},turn:e.index,index:++n})}}return r})}function nr(e){return e===void 0?``:e.toLocaleString()}function rr(e,t){return Math.round(Math.min(Math.max(e,320),Math.max(320,Math.min(720,t-280))))}function ir({messages:e,inspectCallId:t,renderCallAction:n}){let r=te(),i=(0,O.useMemo)(()=>tr(e),[e,r]),a=i.at(-1)?.turn??0,[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(new Set),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(null),b=(0,O.useRef)(null),x=(0,O.useRef)(null);(0,O.useEffect)(()=>{t&&l(i.find(e=>e.callId===t)?.id??null)},[t,i]);let S=i.find(e=>e.id===c)??null,C=o.trim().toLocaleLowerCase(),w=(0,O.useMemo)(()=>Xn(i,m),[i,m]),T=w&&g?Zn(w,g.start,g.end):null,E=C?new Set(i.filter(e=>`${e.label} ${e.toolName??``} ${e.preview} ${e.result??``}`.toLocaleLowerCase().includes(C)).map(e=>e.index)):null,D=i.filter(e=>!u.has(e.turn)&&(!f||e.kind!==`tool`)&&(!C||`${e.label} ${e.toolName??``} ${e.preview} ${e.result??``}`.toLocaleLowerCase().includes(C))),k=new Map;for(let e of D){let t=k.get(e.turn)??[];t.push(e),k.set(e.turn,t)}let A=new Map;for(let e of i)A.set(e.turn,(A.get(e.turn)??0)+1);let j=Array.from({length:a},(e,t)=>t+1).flatMap(e=>u.has(e)?[{type:`collapsed`,turn:e,count:A.get(e)??0}]:(k.get(e)??[]).map((e,t)=>({type:`record`,record:e,firstInTurn:t===0}))),ee=e=>{l(e.id),x.current?.querySelector(`[data-record-index="${e.index}"]`)?.scrollIntoView({block:`center`,behavior:`smooth`})};return(0,z.jsxs)(`div`,{className:Gn.root,"data-conversation-composer-overlay":!0,"aria-label":R(`会话轨迹`,`Session trajectory`),children:[(0,z.jsx)(`div`,{className:Qn.root,role:`toolbar`,"aria-label":R(`轨迹工具栏`,`Trajectory toolbar`),children:(0,z.jsxs)(`div`,{className:Qn.inner,children:[(0,z.jsxs)(`div`,{className:Qn.actions,children:[(0,z.jsxs)(`button`,{type:`button`,className:Qn.toggle,"aria-pressed":m,title:m?R(`按事件顺序排列`,`Arrange by event order`):R(`按记录时间排列`,`Arrange by recorded time`),onClick:()=>h(e=>!e),children:[(0,z.jsxs)(`svg`,{className:Qn.toggleIcon,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.25`}),(0,z.jsx)(`path`,{d:`M8 4.75V8l2.25 1.5`})]}),R(`时长`,`Duration`)]}),(0,z.jsxs)(`button`,{type:`button`,className:Qn.action,"aria-pressed":a>0&&u.size===a,"aria-label":a>0&&u.size===a?R(`展开轮次`,`Expand turns`):R(`折叠轮次`,`Collapse turns`),onClick:()=>d(e=>e.size===a?new Set:new Set(Array.from({length:a},(e,t)=>t+1))),children:[(0,z.jsx)(`span`,{className:Qn.actionIcon,"aria-hidden":`true`,children:u.size===a?`⊞`:`⊟`}),R(`轮次`,`Turns`)]}),(0,z.jsxs)(`button`,{type:`button`,className:Qn.action,"aria-pressed":f,"aria-label":f?R(`展开调用`,`Expand calls`):R(`折叠调用`,`Collapse calls`),onClick:()=>p(e=>!e),children:[(0,z.jsx)(`span`,{className:Qn.actionIcon,"aria-hidden":`true`,children:f?`⊞`:`⊟`}),R(`调用`,`Calls`)]})]}),(0,z.jsxs)(`label`,{className:Qn.search,children:[(0,z.jsx)(Ce,{size:11,className:Qn.searchIcon}),(0,z.jsx)(`input`,{type:`search`,className:Qn.searchInput,"aria-label":R(`搜索轨迹`,`Search trajectory`),placeholder:R(`搜索`,`Search`),value:o,onChange:e=>s(e.target.value)})]})]})}),(0,z.jsx)(Yn,{t:R,model:w,actualTime:m,selectedIndex:S?.index??null,matchingIndexes:E,range:g,onRangeChange:_,onSelect:e=>{let t=i.find(t=>t.index===e);t&&ee(t)}}),(0,z.jsxs)(`div`,{className:Gn.ledger,children:[(0,z.jsx)(`div`,{ref:x,className:H.tablePane,children:(0,z.jsxs)(`table`,{className:H.table,"data-scroll-ready":`true`,"aria-label":R(`轨迹记录`,`Trajectory records`),children:[(0,z.jsxs)(`colgroup`,{children:[(0,z.jsx)(`col`,{className:H.eventColumn}),(0,z.jsx)(`col`,{className:H.contentColumn})]}),(0,z.jsxs)(`tbody`,{children:[j.map(e=>e.type===`collapsed`?(0,z.jsxs)(`tr`,{tabIndex:0,"data-collapsed-summary":`turn`,"data-turn-start":`true`,"aria-label":R(`展开第 ${e.turn} 轮`,`Expand turn ${e.turn}`),onClick:()=>d(t=>{let n=new Set(t);return n.delete(e.turn),n}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),d(t=>{let n=new Set(t);return n.delete(e.turn),n}))},children:[(0,z.jsx)(`td`,{className:H.event,children:(0,z.jsx)(`span`,{className:H.turnLabel,children:R(`第 ${e.turn} 轮`,`Turn ${e.turn}`)})}),(0,z.jsx)(`td`,{className:H.content,children:(0,z.jsxs)(`span`,{className:H.collapsedTurnContent,children:[(0,z.jsx)(`span`,{className:H.collapsedTurnEllipsis,children:`…`}),(0,z.jsx)(`span`,{className:H.collapsedTurnText,children:R(`${e.count} 条记录,点击展开`,`${e.count} records, click to expand`)})]})})]},`collapsed-${e.turn}`):(0,z.jsxs)(`tr`,{tabIndex:0,"data-record-index":e.record.index,"data-kind":e.record.kind,"data-turn-start":e.firstInTurn||void 0,"data-error":e.record.error||void 0,"data-selected":c===e.record.id||void 0,"data-timeline-focus":T?T.has(e.record.index)?`inside`:`outside`:void 0,"aria-selected":c===e.record.id,"aria-label":R(`第 ${e.record.turn} 轮,${e.record.label},${e.record.preview}`,`Turn ${e.record.turn}, ${e.record.label}, ${e.record.preview}`),onClick:()=>ee(e.record),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),ee(e.record))},children:[(0,z.jsxs)(`td`,{className:H.event,children:[e.firstInTurn&&(0,z.jsx)(`button`,{type:`button`,className:qn.turnLabelButton,"aria-label":R(`折叠第 ${e.record.turn} 轮`,`Collapse turn ${e.record.turn}`),onClick:t=>{t.stopPropagation(),d(t=>new Set([...t,e.record.turn]))},children:(0,z.jsx)(`span`,{className:H.turnLabel,children:R(`第 ${e.record.turn} 轮`,`Turn ${e.record.turn}`)})}),(0,z.jsx)(`div`,{className:H.eventInner,children:(0,z.jsx)(`span`,{className:H.kindSlot,children:(0,z.jsx)(`span`,{className:`${H.kindTag} ${e.record.kind===`user`?H.user:e.record.kind===`tool`?H.toolAmber:H.assistantVioletBright}`,children:(0,z.jsx)(`span`,{className:H.kindTagLabel,children:e.record.label})})})}),c===e.record.id&&(0,z.jsx)(`span`,{className:H.selectionRail,"aria-hidden":`true`})]}),(0,z.jsx)(`td`,{className:H.content,children:(0,z.jsxs)(`span`,{className:e.record.result===void 0?H.contentText:H.resultPreview,title:e.record.result===void 0?e.record.preview:`${e.record.label} ${e.record.preview} → ${e.record.result}`,children:[(0,z.jsxs)(`span`,{className:e.record.result===void 0?void 0:H.resultRequest,children:[e.record.kind===`tool`&&(0,z.jsx)(`span`,{className:H.toolCallNameTypeface,children:e.record.toolName}),(0,z.jsx)(`span`,{className:e.record.kind===`tool`?H.toolCallPayload:void 0,children:e.record.preview})]}),e.record.result!==void 0&&(0,z.jsxs)(`span`,{className:`${H.inlineResult} ${e.record.error?H.error:``}`,children:[(0,z.jsx)(`span`,{className:H.arrow,children:`→`}),(0,z.jsx)(`span`,{className:H.inlineResultText,children:e.record.result})]})]})})]},e.record.id)),j.length===0&&(0,z.jsx)(`tr`,{children:(0,z.jsx)(`td`,{colSpan:2,className:qn.empty,children:i.length===0?R(`暂无轨迹`,`No trajectory yet`):R(`没有匹配的记录`,`No matching records`)})})]})]})}),S&&(0,z.jsxs)(`aside`,{id:`trajectory-detail-panel`,className:H.details,"aria-label":R(`轨迹详情`,`Trajectory details`),style:v===null?void 0:{width:v},children:[(0,z.jsx)(`div`,{className:H.detailsResizeHandle,role:`separator`,"aria-label":R(`调整轨迹详情宽度`,`Resize trajectory details`),"aria-controls":`trajectory-detail-panel`,"aria-orientation":`vertical`,tabIndex:0,title:R(`拖动调整详情宽度,双击恢复`,`Drag to resize details; double click to reset`),onDoubleClick:()=>y(null),onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.parentElement,n=t?.parentElement?.getBoundingClientRect().width;t&&n&&(b.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t.getBoundingClientRect().width,splitWidth:n},e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:e=>{let t=b.current;t&&t.pointerId===e.pointerId&&y(rr(t.startWidth+t.startX-e.clientX,t.splitWidth))},onPointerUp:e=>{b.current?.pointerId===e.pointerId&&(b.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{b.current=null},onKeyDown:e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=e.currentTarget.parentElement,n=t?.parentElement?.getBoundingClientRect().width;t&&n&&(y(rr(t.getBoundingClientRect().width+(e.key===`ArrowLeft`?16:-16),n)),e.preventDefault())}}),(0,z.jsxs)(`div`,{className:H.detailsHeader,children:[(0,z.jsxs)(`span`,{className:H.detailsTitle,children:[S.kind===`tool`?(0,z.jsx)(`span`,{className:H.requestDetailsDot}):(0,z.jsx)(Je,{size:14}),(0,z.jsx)(`span`,{className:H.requestDetailsName,children:S.toolName??S.label}),(0,z.jsxs)(`span`,{className:H.detailsLocation,children:[R(`第 ${S.turn} 轮`,`Turn ${S.turn}`),` · #`,S.index]})]}),(0,z.jsx)(`button`,{type:`button`,className:H.close,"aria-label":R(`关闭详情`,`Close details`),onClick:()=>l(null),children:(0,z.jsx)(Me,{})})]}),(0,z.jsxs)(`div`,{className:H.detailBody,children:[S.callId&&n?.(S.callId),(0,z.jsxs)(`dl`,{className:H.overview,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`时间`,`Time`)}),(0,z.jsx)(`dd`,{children:new Date(S.timestamp).toLocaleString(R(`zh-CN`,`en-US`))})]}),S.callId&&(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`调用 ID`,`Call ID`)}),(0,z.jsx)(`dd`,{children:S.callId})]}),S.usage&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`输入`,`Input`)}),(0,z.jsx)(`dd`,{children:nr(S.usage.input)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`缓存读取`,`Cache read`)}),(0,z.jsx)(`dd`,{children:nr(S.usage.cacheRead)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`缓存写入`,`Cache write`)}),(0,z.jsx)(`dd`,{children:nr(S.usage.cacheWrite)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`dt`,{children:R(`输出`,`Output`)}),(0,z.jsx)(`dd`,{children:nr(S.usage.output)})]})]})]}),(0,z.jsx)(`div`,{className:H.overviewHeading,children:R(`内容`,`Content`)}),S.kind===`tool`?(0,z.jsx)(`pre`,{className:H.payload,children:S.text}):(0,z.jsx)(`div`,{className:H.markdownPayload,children:(0,z.jsx)(jt,{text:S.text})}),S.result!==void 0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:H.overviewHeading,children:R(`结果`,`Result`)}),(0,z.jsx)(`pre`,{className:H.payload,children:S.result})]})]})]})]})]})}var ar={root:`_root_vpfjh_1`,trigger:`_trigger_vpfjh_9`,triggerLabel:`_triggerLabel_vpfjh_45`,triggerEffort:`_triggerEffort_vpfjh_56`,triggerIcon:`_triggerIcon_vpfjh_67`,chevron:`_chevron_vpfjh_88`,chevronOpen:`_chevronOpen_vpfjh_94`,menu:`_menu_vpfjh_101`,status:`_status_vpfjh_129`,empty:`_empty_vpfjh_130`,error:`_error_vpfjh_137`,warning:`_warning_vpfjh_138`,retry:`_retry_vpfjh_157`,groups:`_groups_vpfjh_121`,group:`_group_vpfjh_121`,groupTitle:`_groupTitle_vpfjh_177`,option:`_option_vpfjh_189`,selected:`_selected_vpfjh_214`,optionCopy:`_optionCopy_vpfjh_223`,modelName:`_modelName_vpfjh_230`,check:`_check_vpfjh_240`,cell:`_cell_vpfjh_250`,cellLabel:`_cellLabel_vpfjh_273`,cellValue:`_cellValue_vpfjh_278`,cellChevron:`_cellChevron_vpfjh_288`,compact:`_compact_vpfjh_294`};function or({openSignal:e=0,compact:t=!1,current:n,models:r,disabled:i,onSelect:a,thinkingLevel:o,thinkingLevels:s,onSelectThinkingLevel:c}){let l={off:R(`关闭`,`Off`),minimal:R(`极低`,`Minimal`),low:R(`低`,`Low`),medium:R(`中`,`Medium`),high:R(`高`,`High`),xhigh:R(`极高`,`Extra high`)},[u,d]=(0,O.useState)(!1),f=(0,O.useRef)(e);(0,O.useEffect)(()=>{e!==f.current&&(f.current=e,i||d(!0))},[e,i]);let[p,m]=(0,O.useState)(`root`),[h,g]=(0,O.useState)(!1),[v,y]=(0,O.useState)({visibility:`hidden`,left:0,top:0}),b=(0,O.useId)(),x=(0,O.useRef)(null),S=(0,O.useRef)(null),C=(0,O.useRef)(null),w=(0,O.useMemo)(()=>{let e=new Map;for(let t of r)e.set(t.provider,[...e.get(t.provider)??[],t]);return[...e]},[r]),T=r.find(e=>`${e.provider}/${e.id}`===n)?.name||(n&&n!==`unknown/unknown`?n:R(`选择模型`,`Choose a model`)),E=s.length>1&&o?l[o]??o:null,D=(e=!1)=>{d(!1),m(`root`),e&&S.current?.focus()};(0,O.useEffect)(()=>{if(!u)return;let e=e=>{!x.current?.contains(e.target)&&!C.current?.contains(e.target)&&D()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),(0,O.useLayoutEffect)(()=>{if(!u||!S.current||!C.current)return;let e=()=>{if(!S.current||!C.current)return;let e=S.current.getBoundingClientRect(),t=C.current.getBoundingClientRect(),n=Math.max(16,Math.min(e.right-t.width,innerWidth-t.width-16)),r=e.top-t.height-8>=16?e.top-t.height-8:Math.min(e.bottom+8,innerHeight-t.height-16);y({left:n,top:r})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[u,p,r.length]);let k=e=>{if(e.key===`Escape`){e.preventDefault(),p===`root`?D(!0):m(`root`);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...C.current?.querySelectorAll(`button[role^="menuitem"]`)??[]].filter(e=>!e.disabled);t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},A=async e=>{if(`${e.provider}/${e.id}`===n)D(!0);else{g(!0);try{await a(e.provider,e.id),D(!0)}catch{}finally{g(!1)}}},j=async e=>{if(e===o)D(!0);else{g(!0);try{await c(e),D(!0)}catch{}finally{g(!1)}}};return(0,z.jsxs)(`div`,{ref:x,className:ar.root,onKeyDown:k,children:[(0,z.jsxs)(`button`,{ref:S,className:`${ar.trigger} ${t?ar.compact:``}`,"data-compact":t||void 0,type:`button`,"aria-label":R(`切换模型,当前 ${T}${E?`,推理强度${E}`:``}`,`Change model, current ${T}${E?`, reasoning effort ${E}`:``}`),"aria-haspopup":`menu`,"aria-expanded":u,"aria-controls":u?`${b}-menu`:void 0,title:E?`${T} · ${E}`:T,disabled:i||h,onClick:()=>u?D():d(!0),children:[(0,z.jsx)(qe,{className:ar.triggerIcon,size:16}),!t&&(0,z.jsx)(`span`,{className:ar.triggerLabel,children:T}),!t&&E&&(0,z.jsx)(`span`,{className:ar.triggerEffort,children:E}),!t&&(0,z.jsx)(Ae,{className:`${ar.chevron} ${u?ar.chevronOpen:``}`})]}),u&&(0,Qe.createPortal)((0,z.jsx)(_,{ref:C,id:`${b}-menu`,role:`menu`,"aria-label":R(`选择模型`,`Choose model`),className:ar.menu,style:v,children:p===`root`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ar.cell,onClick:()=>m(`model`),children:[(0,z.jsx)(`span`,{className:ar.cellLabel,children:R(`模型`,`Model`)}),(0,z.jsx)(`span`,{className:ar.cellValue,children:T}),(0,z.jsx)(je,{className:ar.cellChevron})]}),E&&(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ar.cell,onClick:()=>m(`effort`),children:[(0,z.jsx)(`span`,{className:ar.cellLabel,children:R(`推理强度`,`Reasoning effort`)}),(0,z.jsx)(`span`,{className:ar.cellValue,children:E}),(0,z.jsx)(je,{className:ar.cellChevron})]})]}):p===`model`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:ar.groups,children:w.map(([e,t])=>(0,z.jsxs)(`section`,{className:ar.group,role:`group`,"aria-label":e,children:[(0,z.jsx)(`div`,{className:ar.groupTitle,children:e}),t?.map(e=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":`${e.provider}/${e.id}`===n,className:`${ar.option} ${`${e.provider}/${e.id}`===n?ar.selected:``}`,title:e.name||e.id,disabled:h,onClick:()=>{A(e)},children:[(0,z.jsx)(`span`,{className:ar.optionCopy,children:(0,z.jsx)(`span`,{className:ar.modelName,children:e.name||e.id})}),(0,z.jsx)(`span`,{className:ar.check,children:`${e.provider}/${e.id}`===n&&(0,z.jsx)(ke,{})})]},e.id))]},e))}),r.length===0&&(0,z.jsx)(`div`,{className:ar.empty,children:R(`暂无可用模型`,`No models available`)})]}):(0,z.jsx)(`div`,{className:ar.groups,children:s.map(e=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===o,className:`${ar.option} ${e===o?ar.selected:``}`,disabled:h,onClick:()=>{j(e)},children:[(0,z.jsx)(`span`,{className:ar.optionCopy,children:(0,z.jsx)(`span`,{className:ar.modelName,children:l[e]??e})}),(0,z.jsx)(`span`,{className:ar.check,children:e===o&&(0,z.jsx)(ke,{})})]},e))})}),document.body)]})}var sr={backdrop:`_backdrop_1x9ns_1`,mask:`_mask_1x9ns_13`,image:`_image_1x9ns_20`,close:`_close_1x9ns_30`};function cr({src:e,alt:t,labels:n,onClose:r}){let i=(0,O.useRef)(null),a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i.current?.focus();let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e),a.current?.focus()}},[r]),(0,Qe.createPortal)((0,z.jsxs)(`div`,{className:sr.backdrop,role:`dialog`,"aria-modal":`true`,"aria-label":n.dialog,children:[(0,z.jsx)(`div`,{className:sr.mask,"aria-hidden":`true`,onMouseDown:r}),(0,z.jsx)(`img`,{className:sr.image,src:e,alt:t}),(0,z.jsx)(`button`,{ref:i,type:`button`,className:sr.close,"aria-label":n.close,onClick:r,children:(0,z.jsx)(Me,{size:16})})]}),document.body)}function lr(e){if(e<1024)return`${e}B`;let t=e/1024;if(t<1024)return`${t<10?t.toFixed(1):Math.round(t)}KB`;let n=t/1024;if(n<1024)return`${n<10?n.toFixed(1):Math.round(n)}MB`;let r=n/1024;return`${r<10?r.toFixed(1):Math.round(r)}GB`}var ur={card:`_card_p20fp_1`,failed:`_failed_p20fp_16`,icon:`_icon_p20fp_20`,spinner:`_spinner_p20fp_29`,"file-card-spin":`_file-card-spin_p20fp_1`,body:`_body_p20fp_43`,retry:`_retry_p20fp_51`,name:`_name_p20fp_61`,meta:`_meta_p20fp_71`,metaFailed:`_metaFailed_p20fp_80`,remove:`_remove_p20fp_84`,removeFailed:`_removeFailed_p20fp_126`,progressTrack:`_progressTrack_p20fp_132`,progressBar:`_progressBar_p20fp_143`,"file-card-progress":`_file-card-progress_p20fp_1`};function dr({name:e,bytes:t,status:n,error:r,onRemove:i,onRetry:a}){let o=x(e).toUpperCase().slice(0,8),s=n===`uploading`?R(`上传中…`,`Uploading…`):n===`error`?r||R(`上传失败`,`Upload failed`):`${o} ${lr(t)}`;return(0,z.jsxs)(`div`,{className:`${ur.card} ${n===`error`?ur.failed:``}`,title:e,children:[(0,z.jsx)(`span`,{className:ur.icon,"aria-hidden":`true`,children:n===`uploading`?(0,z.jsx)(`span`,{className:ur.spinner}):(0,z.jsx)(b,{path:e,size:28})}),n===`error`?(0,z.jsxs)(`button`,{type:`button`,className:`${ur.body} ${ur.retry}`,onClick:a,"aria-label":R(`重试上传 ${e}`,`Retry upload ${e}`),children:[(0,z.jsx)(`span`,{className:ur.name,children:e}),(0,z.jsx)(`span`,{className:`${ur.meta} ${ur.metaFailed}`,children:s})]}):(0,z.jsxs)(`span`,{className:ur.body,"aria-label":R(`待发送文件 ${e}`,`Pending file ${e}`),children:[(0,z.jsx)(`span`,{className:ur.name,children:e}),(0,z.jsx)(`span`,{className:ur.meta,children:s})]}),(0,z.jsx)(`button`,{type:`button`,className:`${ur.remove} ${n===`error`?ur.removeFailed:``}`,"aria-label":R(`移除 ${e}`,`Remove ${e}`),onClick:i,children:(0,z.jsx)(Ne,{size:12})}),n===`uploading`&&(0,z.jsx)(`span`,{className:ur.progressTrack,"aria-hidden":`true`,children:(0,z.jsx)(`span`,{className:ur.progressBar})})]})}var fr={rail:`_rail_1b0gl_1`,imageItem:`_imageItem_1b0gl_9`,thumbnail:`_thumbnail_1b0gl_15`,remove:`_remove_1b0gl_33`,retryImage:`_retryImage_1b0gl_58`};function pr({file:e,status:t,error:n,onRemove:r,onRetry:i}){let[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(!1),l=(0,O.useCallback)(()=>c(!1),[]),u=/^(image\/(png|jpeg|webp|gif))$/.test(e.type)||/\.(png|jpe?g|webp|gif)$/i.test(e.name);return(0,O.useEffect)(()=>{if(!u)return;let t=URL.createObjectURL(e);return o(t),()=>URL.revokeObjectURL(t)},[e,u]),u?(0,z.jsxs)(`div`,{className:fr.imageItem,title:e.name,children:[(0,z.jsx)(`button`,{type:`button`,className:fr.thumbnail,"aria-label":R(`预览 ${e.name}`,`Preview ${e.name}`),disabled:a===null,onClick:()=>c(!0),children:a&&(0,z.jsx)(`img`,{src:a,alt:e.name})}),(0,z.jsx)(`button`,{type:`button`,className:fr.remove,"aria-label":R(`移除 ${e.name}`,`Remove ${e.name}`),onClick:r,children:(0,z.jsx)(Ne,{size:12})}),t===`uploading`&&(0,z.jsx)(`span`,{className:`pi-image-uploading`,role:`status`,children:R(`上传中`,`Uploading`)}),t===`error`&&(0,z.jsx)(`button`,{type:`button`,className:fr.retryImage,"aria-label":R(`重试上传 ${e.name}`,`Retry upload ${e.name}`),title:n||R(`上传失败`,`Upload failed`),onClick:i,children:R(`重试`,`Retry`)}),s&&a&&(0,z.jsx)(cr,{src:a,alt:e.name,labels:{dialog:R(`图片预览`,`Image preview`),close:R(`关闭预览`,`Close preview`)},onClose:l})]}):(0,z.jsx)(dr,{name:e.name,bytes:e.size,status:t,error:n,onRemove:r,onRetry:i})}var mr={gallery:`_gallery_33xub_1`,frame:`_frame_33xub_18`,loading:`_loading_33xub_51`,error:`_error_33xub_52`};function hr(e,t){let n=e/t,r=Math.min(4,Math.max(.25,n)),i=r>=1?{width:240,height:240/r}:{width:240*r,height:240},a=Math.min(1,e/i.width,t/i.height);return{width:Math.max(1,Math.round(i.width*a)),height:Math.max(1,Math.round(i.height*a)),objectPosition:n<.25?`center top`:n>4?`left center`:`center`}}function gr({name:e,messageId:t,index:n,file:r,tile:i,loadImage:a}){let[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(0),[m,h]=(0,O.useState)(null),g=(0,O.useRef)(a);g.current=a,(0,O.useEffect)(()=>{let e=!0,i=null;return s(null),l(!1),h(null),r?(i=URL.createObjectURL(r),s(i)):g.current(t,n).then(t=>{let n=URL.createObjectURL(t);e?(i=n,s(n)):URL.revokeObjectURL(n)}).catch(()=>{e&&l(!0)}),()=>{e=!1,i&&URL.revokeObjectURL(i)}},[r,t,n,f]);let _=!i&&m?hr(m.width,m.height):null;return c?(0,z.jsx)(`button`,{type:`button`,className:mr.error,"data-variant":i?`tile`:`single`,onClick:()=>p(e=>e+1),children:R(`图片加载失败,重试`,`Image failed to load. Retry`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,className:mr.frame,"data-variant":i?`tile`:`single`,"aria-label":R(`预览 ${e}`,`Preview ${e}`),title:R(`查看原图`,`View original image`),disabled:!o,onClick:()=>d(!0),style:_?{width:_.width,height:_.height}:void 0,children:o?(0,z.jsx)(`img`,{src:o,alt:e,onLoad:e=>h({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight}),onError:()=>l(!0),style:_?{objectPosition:_.objectPosition}:void 0}):(0,z.jsx)(`span`,{className:mr.loading,children:R(`加载中`,`Loading`)})}),u&&o&&(0,z.jsx)(cr,{src:o,alt:e,labels:{dialog:R(`图片预览`,`Image preview`),close:R(`关闭预览`,`Close preview`)},onClose:()=>d(!1)})]})}function _r(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function U(e,...t){throw _r(e,...t)}function vr(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yr(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var br=yr();function xr(){return br&&`documentMode`in document?document.documentMode:null}var Sr=xr();function Cr(e){return br&&e.test(navigator.platform)}function wr(e){return br&&e.test(navigator.userAgent)}var Tr=Cr(/Mac|iPod|iPhone|iPad/),Er=wr(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Dr(){return!(!br||!(`InputEvent`in window)||Sr)&&`getTargetRanges`in new window.InputEvent(`input`)}var Or=Dr();function kr(){return br&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Ar=kr(),jr=wr(/Android/),Mr=wr(/Version\/[\d.]+.*Safari/)&&!jr,Nr=wr(/^(?=.*Chrome).*/i),Pr=br&&jr&&Nr,Fr=wr(/AppleWebKit\/[\d.]+/)&&Tr&&!Nr;function Ir(){return 2047}var Lr=Ir(),Rr=Mr||Ar||Fr?`\xA0`:``,zr=`
|
|
23
|
+
|
|
24
|
+
`,Br=Er?`\xA0`:Rr,Vr={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Hr={directionless:1,unmergeable:2},Ur={center:2,end:6,justify:4,left:1,right:3,start:5};function Wr(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Gr=Wr(Ur),Kr={normal:0,segmented:2,token:1},qr=Wr(Kr),Jr=Symbol.for(`@lexical/ctrlOrOtherKey`),Yr=`$config`;function Xr(e){return()=>{}}function W(e){return{type:e}}var Zr=W(`SELECTION_CHANGE_COMMAND`),Qr=W(`CLICK_COMMAND`),$r=W(`BEFORE_INPUT_COMMAND`),ei=W(`INPUT_COMMAND`),ti=W(`COMPOSITION_START_COMMAND`),ni=W(`COMPOSITION_END_COMMAND`),ri=W(`DELETE_CHARACTER_COMMAND`),ii=W(`INSERT_LINE_BREAK_COMMAND`),ai=W(`INSERT_PARAGRAPH_COMMAND`),oi=W(`CONTROLLED_TEXT_INSERTION_COMMAND`),si=W(`PASTE_COMMAND`),ci=W(`REMOVE_TEXT_COMMAND`),li=W(`DELETE_WORD_COMMAND`),ui=W(`DELETE_LINE_COMMAND`),di=W(`FORMAT_TEXT_COMMAND`),fi=W(`UNDO_COMMAND`),pi=W(`REDO_COMMAND`),mi=W(`KEYDOWN_COMMAND`),hi=W(`KEY_ARROW_RIGHT_COMMAND`),gi=W(`MOVE_TO_END`),_i=W(`KEY_ARROW_LEFT_COMMAND`),vi=W(`MOVE_TO_START`),yi=W(`KEY_ARROW_UP_COMMAND`),bi=W(`KEY_ARROW_DOWN_COMMAND`),xi=W(`KEY_ENTER_COMMAND`),Si=W(`KEY_SPACE_COMMAND`),Ci=W(`KEY_BACKSPACE_COMMAND`),wi=W(`KEY_ESCAPE_COMMAND`),Ti=W(`KEY_DELETE_COMMAND`),Ei=W(`KEY_TAB_COMMAND`),Di=W(`DROP_COMMAND`),Oi=W(`DRAGSTART_COMMAND`),ki=W(`DRAGOVER_COMMAND`),Ai=W(`DRAGEND_COMMAND`),ji=W(`COPY_COMMAND`),Mi=W(`CUT_COMMAND`),Ni=W(`SELECT_ALL_COMMAND`),Pi=W(`CLEAR_EDITOR_COMMAND`),Fi=W(`CLEAR_HISTORY_COMMAND`),Ii=W(`CAN_REDO_COMMAND`),Li=W(`CAN_UNDO_COMMAND`),Ri=W(`FOCUS_COMMAND`),zi=W(`BLUR_COMMAND`),Bi=W(`KEY_MODIFIER_COMMAND`);function Vi(e,t){return{...t,[Jr]:e}}var Hi=Vi(`metaKey`,{ctrlKey:!Tr,metaKey:Tr}),Ui=Vi(`altKey`,{altKey:Tr,ctrlKey:!Tr}),Wi=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Gi(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Ki=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||U(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of Wi){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Gi(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Gi(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Gi(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of Wi)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function qi(e){let t=new Ki;for(let n of e)t.add(n);return t}function Ji(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Yi(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Xi=Yi(),Zi=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},Qi=null;function $i(e,t=1e3){return e instanceof ea?e.clone():e.size<t?new Map(e):new ea().init(new Map(e),void 0,e.size)}var ea=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===Qi?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===Qi?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==Qi&&n!==void 0||(this._size++,n===Qi&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,Qi),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==Qi&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===Qi||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},ta=!1;function na(e,t,...n){let r=ta,i;try{ta=e,i=t()}finally{ta=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||U(421),i}function ra(){return ta}function ia(e){let t=e.exportJSON(ta),n=e.constructor;return t.type!==n.getType()&&U(130,n.name),K(e)&&!Array.isArray(t.children)&&U(59,n.name),t}function aa(){return Mu()._blockCursorElement}function oa(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var sa=Fr||Ar||Mr;function ca(){let e=mu().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function la(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var ua=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&U(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&U(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&U(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=da(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=da(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function da(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var fa=class e extends ua{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;oa(t);)e=t,t=t.nextSibling;la(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===aa()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;oa(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===aa()&&(t=t.previousSibling);return la(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(ca(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(ca(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&oa(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&sa;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=mu().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=mu().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=aa(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=pa(t,n);i.push(r);let a=pa(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function pa(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&U(225),n.reverse()}var ma=!1,ha=0;function ga(){ha=performance.now()}function _a(e){return wu(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function va(e,t,n){let r=su(Zl(n)),i=r&&_u(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&jl(t,s,a,o,!1)}function ya(e,t,n){if(X(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return nl(t)&&n.isAttached()}function ba(e,t,n){for(let r=e;r&&!Ku(r);r=Ul(r)){let e=hl(r,t);if(e!==void 0){let t=fl(e,n);if(t)return Bs(t)||!wu(r)?void 0:[r,t]}}}function xa(e,t,n,r){ma=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-ha>100;try{Mf(e,()=>{let a=Z()||function(e){return e.read(`latest`,()=>{let e=Z();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=ba(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?q(m)&&m.isAttached()&&m.markDirty():i&&q(m)&&nl(d)&&ya(a,d,m)&&va(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=hl(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&wu(t)&&t.hasAttribute(`data-lexical-slot`)||Ku(t)))){if(Er){let e=(wu(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||la(e)||_a(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||hl(n,e)||_a(n)||n.remove();n.takeRecords(),a!==null&&(l&&Sl(a),Er&&Vl(e)&&a.insertRawText(u))})}finally{ma=!1}}function Sa(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&xa(e,i,r,t)}}function Ca(e){(function(e){Zl(e).addEventListener(`textInput`,ga,!0)})(e),e._observer=new MutationObserver((t,n)=>{xa(e,t,n)})}function wa(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Ta(e,t){return wa(e,t,e.defaultValue)}function Ea(e){return typeof e==`object`&&!!e}function Da(e,t){let n=Ma(e,t).getter;return Ea(n)&&n.getterTable!==void 0||U(405,t),ja(n.getterTable)}function Oa(e,t){let n=Ma(e,t).setter;return Ea(n)&&n.setterTable!==void 0||U(406,t),ja(n.setterTable)}function ka(e,t,n){let{meta:r}=Ma(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return ja(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:U(407,t,String(n))}function Aa(e,t){let n=Ma(e,t),{setter:r}=n;Ea(r)&&r.setterTable!==void 0||U(408,t);let i=String(n.defaultValue);return za(r.setterTable,i)||U(409,t,i),r.setterTable[i]}function ja(e){return Object.assign(Object.create(null),e)}function Ma(e,t){let n=e.get(t);return n===void 0&&U(410,t),n}function Na(e,t,n,r,i){i!==void 0&&Pa.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&La(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Pa=new WeakSet,Fa=new WeakSet;function Ia(e){return typeof e==`object`&&e&&Fa.add(e),e}function La(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Fa.has(e)){Object.freeze(e);for(let t of Object.values(e))La(t)}}function Ra(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Ra(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Ta(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function za(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ba(e=``){return Na(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var Va=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ha(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&Va.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Na(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function Ua(e,...t){let n=Ia(t.length===0?e[0]:t[0]),r=new Set(e);return Na(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function Wa(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Ga(e,t){let n=e=>typeof e==`string`&&za(t,e);return Na(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Ra(e,t))}function Ka(e,t){return Ja(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function qa(e,t){return Ja(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function Ja(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Ya=`latest`,Xa=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||so).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>wa(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Za(e,t){return new Xa(e,t)}function Qa(e,t,n=Ya){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function $a(e,t,n){let r;if(ff(),typeof n==`function`){let i=e.getLatest(),a=Qa(i,t);if(r=eo(t,n(a)),t.isEqual(a,r))return i}else r=eo(t,n);let i=e.getWritable();return io(i).updateFromKnown(t,r),i}function eo(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function to(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Sd(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var no=new Set([`__proto__`,`constructor`,`prototype`]),ro=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return oo(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(no.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=oo(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(no.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function io(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new ro(t,function(e){return e.__state?e.__state.sharedNodeState:Gc(Mu(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function ao(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&io(e).updateFromJSON(r),n}function oo(e){if(e)for(let t in e)return e}function so(e){return e}function co(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function lo(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function uo(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function fo(e){return!Us(e)&&e.getTextContent!==Ls.prototype.getTextContent}var po=Symbol.for(`@lexical/CachedTextSize`);function mo(e,t){return jo.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Ao.get(r);if(i===void 0&&U(345,r),K(i)){let a=Mo.get(r);if(a!==void 0&&K(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=No.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&U(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(Jo(i).size>0)n+=i.getTextContentSize();else{let e=i[po];e===void 0&&U(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:vo})}function ho(e){K(e)||Jo(e).size>0||e[po]===void 0&&(e[po]=q(e)?e.__text.length:e.getTextContentSize())}var go=4,_o,vo,yo,bo=``,xo=null,So=null,Co=null;function wo(){return{firstTextKey:Co,format:xo,style:So}}function To(e){e.firstTextKey!==null&&(xo=e.format,So=e.style,Co=e.firstTextKey)}function Eo(e){if(Co!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&U(348),t===null)return;let n=Mo.get(t);q(n)&&(xo=n.getFormat(),So=n.getStyle(),Co=t)}var Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo=!1,Ro=!1;function G(e,t){let n=Ao.get(e),r=Mo.has(e);if(t!==null){let n=ls(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(vo._keyToDOMMap.delete(e),K(n)){let e=Td(n,Ao);zo(e,0,e.length-1,null)}if(n!==void 0){for(let e of Jo(n).values()){let t=Xo(e);G(e,null),t!==null&&t.remove()}Rl(Fo,yo,Do,n,`destroyed`)}}}function zo(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&G(t,r)}}function Bo(e,t){e.setProperty(`text-align`,t)}var Vo=`40px`;function Ho(e,t){let n=_o.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Vo}))`),Il(e,`class`),Il(e,`style`)}function Uo(e,t){let n=e.style;t===0?Bo(n,``):t===1?Bo(n,`left`):t===2?Bo(n,`center`):t===3?Bo(n,`right`):t===4?Bo(n,`justify`):t===5?Bo(n,`start`):t===6&&Bo(n,`end`),Il(e,`style`)}function Wo(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Us(e))return null;let n=e.getParent();return n===null||Y(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Go(e){let t=mu().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function Ko(e,t,n){t||e.contentEditable===`false`?qu(n,vo):n.removeAttribute(`contenteditable`)}function qo(e,t,n){let r=bo,i=wo();bo=``;let a=``,o=Bs(e);for(let[r,i]of n){let n=Go(r);Ko(t,o,n),t.appendChild(n),bo=``;let s=wo();Qo(i,Pu(e,n,vo)),To(s),Yo(e,r,t,n),a+=bo}return To(i),bo=r,a}function Jo(e){return Vm(e)&&e.__slots!==null?e.__slots:Bm}function Yo(e,t,n,r){let i=Io.$getSlotTargetElement(e,t,n,vo);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function Xo(e){let t=No.get(e);return t===void 0?null:t.parentElement}function Zo(e,t,n){let r=Jo(e),i=Jo(t);for(let[e,t]of r)if(!i.has(e)){let e=Xo(t);G(t,null),e!==null&&e.remove()}let a=bo,o=wo(),s=``,c=null,l=Bs(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:Xo(i);bo=``;let u=wo();if(o===null){o=Go(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),Qo(a,Pu(t,o,vo))}else i===a?is(a,o):(i!==void 0&&G(i,o),Qo(a,Pu(t,o,vo)));if(To(u),Ko(n,l,o),Yo(t,e,n,o),s+=bo,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return To(o),bo=a,s}function Qo(e,t){let n=Mo.get(e);if(n===void 0&&U(60),t!==null){let r=Ao.get(e);if(r!==void 0){let i=No.get(e);if(i!==void 0){let a=Hm(r)?r.__slotHost:null,o=Hm(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),is(e,t.element)}}}let r=Io.$createDOM(n,vo);if(function(e,t,n){let r=n._keyToDOMMap;ml(t,n,e),r.set(e,t)}(e,r,vo),q(n)?r.setAttribute(`data-lexical-text`,`true`):Bs(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),Gu(r,{captureSelection:!0})),K(n)){let e=bo,t=n.__indent,i=n.__size;Wo(r,n),t!==0&&Ho(r,t);let a=Jo(n),o=a.size>0?qo(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,bo+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if($o(Td(n,Mo),n,0,t,Pu(n,r,vo)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,bo=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(fo(n)){let t=n.getTextContent();r.__lexicalTextContent=t,bo=e+t}let s=n.__format;s!==0&&Uo(r,s),n.isInline()||(ns(0,n,r),ts(n,r))}else{let t=n.getTextContent();if(Bs(n)){let t=n.decorate(vo,_o);t!==null&&as(e,t),r.contentEditable=`false`;let i=Jo(n);i.size>0&&qo(n,r,i)}bo+=t}return t!==null&&t.insertChild(r),Io.$decorateDOM(n,null,r,vo),ho(n),Rl(Fo,yo,Do,n,`created`),r}function $o(e,t,n,r,i){let a=bo,o=wo();bo=``,xo=null,So=null,Co=null;let s=n;for(;s<=r;++s){let t=wo();Qo(e[s],i);let n=Mo.get(e[s]);n!==null&&q(n)?xo===null&&(xo=n.getFormat(),So=n.getStyle(),Co=n.__key):K(n)&&s<r&&!n.isInline()&&(bo+=zr),To(t)}let c=vo._keyToDOMMap.get(t.__key);c===void 0&&U(349,t.__key),c.__lexicalTextContent=bo,c.__lexicalFirstTextKey=Co,bo=a+bo,To(o)}function es(e){return Bs(e)&&!e.isInline()}function ts(e,t,n=Pu(e,t,vo)){n.setDecoratorBoundaryAnchor(`leading`,es(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,es(e.getLastChild()))}function ns(e,t,n){let r=Pu(t,n,vo),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return Vd(e)?`line-break`:Bs(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,Mo);r.setManagedLineBreak(i)}function rs(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=Mo.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=Mo.get(r);if(q(e))return xo=e.getFormat(),void(So=e.getStyle())}}t.__lexicalFirstTextKey=Co}function is(e,t){let n=Ao.get(e),r=Mo.get(e);n!==void 0&&r!==void 0||U(61);let i=Lo||ko.has(e)||Oo.has(e),a=Hl(vo,e);if(n===r&&!i){let e;if(K(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&U(355,n.getType()),e=t,Eo(a)}else e=n.getTextContent();return bo+=e,a}if(n!==r&&i&&Rl(Fo,yo,Do,r,`updated`),Io.$updateDOM(r,n,a,vo)){let n=Qo(e,null);return t===null&&U(62),t.replaceChild(n,a),G(e,null),n}if(K(n)){K(r)||U(334,e);let t=r.__indent;(Lo||t!==n.__indent)&&Ho(a,t);let o=r.__format;(Lo||o!==n.__format)&&Uo(a,o);let s=i&&(Jo(r).size>0||Jo(n).size>0)?Zo(n,r,a):``;if(i){let e=bo;if(function(e,t,n){var r;xo=null,So=null,Co=null,function(e,t,n){let r=bo,i=e.__size,a=t.__size;bo=``;let o=n.element,s=vo._keyToDOMMap.get(t.__key);s===void 0&&U(351,t.__key);let c=a-i;if(!Lo&&Math.abs(c)<=1&&i>=go&&e.__first===t.__first&&(c!==0||!vo._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Po.get(e.__key);if(!Lo&&!fo(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=Mo.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=mo(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=Mo.get(n);if(e===void 0)break;let t=wo();is(n,o),q(e)&&xo===null&&(xo=e.getFormat(),So=e.getStyle(),Co=e.__key),To(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=Mo.get(n);if(e===void 0)break;let t;if(K(e)){let r=vo._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&U(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&K(e)&&!e.isInline()&&(d+=zr),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,bo=r+m,rs(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Ao.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=Mo.get(a),d=Ao.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=Mo.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Ao.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=mo(l,c);for(let e of _){let t=wo();if(e.kind===`reconcile`)is(e.key,n.element);else if(e.kind===`destroy`)G(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=vo._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}Qo(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=Mo.get(e.key);t&&q(t)&&xo===null&&(xo=t.getFormat(),So=t.getStyle(),Co=t.__key)}To(t)}let x=``;for(let e=0;e<o;e++){let t=Mo.get(f[e]);if(t===void 0)return!1;let n;if(K(t)){let r=vo._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&U(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&K(t)&&!t.isInline()&&(x+=zr)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&U(353),bo=r+e,rs(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Mo.get(t);if(e===void 0)break;let r=Lo||ko.has(t)||Oo.has(t),i=wo();if(r)is(t,o);else{let n,r;if(K(e)){r=No.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&U(354,e.getType()),n=i}else n=e.getTextContent();bo+=n,r!==void 0&&Eo(r)}q(e)?xo===null&&(xo=e.getFormat(),So=e.getStyle(),Co=e.__key):K(e)&&n<a-1&&!e.isInline()&&(bo+=zr),To(i),t=e.__next,n++}s.__lexicalTextContent=bo,s.__lexicalFirstTextKey=Co,bo=r+bo;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)is(r,o);else{let e=ls(r),t=Qo(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}G(r,null)}let a=Mo.get(i);q(a)&&xo===null&&(xo=a.getFormat(),So=a.getStyle(),Co=a.__key)}else{let r=Td(e,Ao),s=Td(t,Mo);if(r.length!==i&&U(227),s.length!==a&&U(228),i===0)a!==0&&$o(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&Jo(t).size===0&&n.element.__lexicalLineBreak==null;zo(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=wo();if(e===r)u=os(is(r,a.element)),d++,f++;else{if(l===void 0&&(l=ss(n,f)),c===void 0)c=ss(t,d);else if(!c.has(e)){d++,To(i);continue}if(!l.has(e)){let t=ls(e);t.parentNode===a.element&&(u=os(t)),G(e,a.element),d++,c.delete(e),To(i);continue}if(c.has(r)){let e=Hl(vo,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=os(is(r,a.element)),d++,f++}else Qo(r,a.withBefore(u??a.before)),f++}let o=Mo.get(r);o!==null&&q(o)?xo===null&&(xo=o.getFormat(),So=o.getStyle(),Co=o.__key):K(o)&&f<=s&&!o.isInline()&&(bo+=zr),To(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:vo.getElementByKey(t);$o(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&zo(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=bo,s.__lexicalFirstTextKey=Co,bo=r+bo}(e,t,Pu(t,n,vo)),Y(t)||(r=t,xo==null||xo===r.__textFormat||Ro||r.setTextFormat(xo),function(e){So==null||So===e.__textStyle||Ro||e.setTextStyle(So)}(t))}(n,r,a),r.isInline()||(Us(r)||ns(0,r,a),ts(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,bo=e+s+t,a.__lexicalSlotTextLength=s.length}else(Jo(r).size>0||Jo(n).size>0)&&(a.__lexicalSlotTextLength=0);if(fo(r)){let t=r.getTextContent();a.__lexicalTextContent=t,bo=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&U(356,n.getType()),bo+=e,Eo(a)}if((Lo||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Wo(a,r),Us(r)&&!Lo))for(let e of r.getChildren())K(e)&&Wo(Hl(vo,e.getKey()),e)}else{let t=r.getTextContent();if(Bs(r)){let t=r.decorate(vo,_o);t!==null&&as(e,t),i&&(Jo(r).size>0||Jo(n).size>0)&&Zo(n,r,a)}bo+=t}if(!Ro&&Us(r)){let e=r.getLatest();if(e.__cachedText!==bo){let t=e.getWritable();t.__cachedText=bo,r=t}}return Io.$decorateDOM(r,n,a,vo),ho(r),a}function as(e,t){let n=vo._pendingDecorators,r=vo._decorators;if(n===null){if(r[e]===t)return;n=_l(vo)}n[e]=t}function os(e){let t=e.nextSibling;return t!==null&&t===vo._blockCursorElement&&(t=t.nextSibling),t}function ss(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function cs(e,t,n,r,i,a){bo=``,xo=null,So=null,Co=null,Lo=r===2,vo=n,_o=n._config,Io=n._config.dom||Jd,yo=n._nodes,Do=vo._listeners.mutation,Oo=i,ko=a,Ao=e._nodeMap,jo=e,Mo=t._nodeMap,Ro=t._readOnly,No=$i(n._keyToDOMMap),Po=function(){let e=new Map,t=t=>{for(let n of t){let t=Mo.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Oo.keys()),t(ko),e}();let o=new Map;return Fo=o,is(`root`,null),vo=void 0,yo=void 0,Oo=void 0,ko=void 0,Ao=void 0,jo=void 0,Mo=void 0,_o=void 0,No=void 0,Po=void 0,Fo=void 0,Io=Jd,o}function ls(e){let t=No.get(e);return t===void 0&&U(75,e),t}function us(e,t,n){ff();let r=e.__key,i=e.getParent();if(i===null)return void(Um(e)!==null&&U(367,r,String(Um(e))));let a=function(e){let t=Z();if(!X(t)||!K(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Yl(i,e)&&n.set(e.__key,0,`element`),Yl(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(X(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(ym(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(ym(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Vp(a)&&t&&e.isSelected()&&e.selectPrevious();Im(e.getWritable(),t&&!o&&X(a)?a:null),n||Y(i)||i.canBeEmpty()||!i.isEmpty()||us(i,t),t&&a&&Us(i)&&i.isEmpty()&&i.selectEnd()}var ds=Symbol.for(`ephemeral`);function fs(e){return e[ds]||!1}var ps={configurable:!0,enumerable:!1,value:void 0,writable:!0},ms=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=hd(this);return e===void 0&&U(64,this.name),e}static clone(e){U(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Ed(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",ps),Object.defineProperty(this,po,ps),ol(this,e)}getType(){return this.__type}isInline(){U(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=fl(e);if(t===null)break;e=t.__parent===null?Um(t):t.__parent}return!1}isSelected(e){let t=e||Z();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(q(this))return n;if(X(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Bs(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:fl(e)}getParentOrThrow(){let e=this.getParent();return e===null&&U(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Y(t)||Um(e)!==null)return K(e)||e===this&&Bs(e)||U(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&U(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:fl(e)}getPreviousSiblings(){return zm(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:fl(e)}getNextSiblings(){return zm(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Hh(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?zh(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&U(279),!1)))}isParentOf(e){return Yl(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&K(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=gf()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(fs(this))return this;let e=fl(this.__key);return e===null&&U(442,this.__key,this.__type),e}getWritable(){if(fs(this))return this;ff();let e=mf(),t=gf(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return cl(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&U(442,n,this.__type);let c=Bu(s);return r.set(n,c),o.set(n,c),cl(c),c}getTextContent(){return rh(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){U(70)}updateDOM(e,t,n){U(71)}getDOMSlot(e){return new ua(e)}exportDOM(e){return{element:Nu(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=Qu(Zu(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return K(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=ud(e)[a.field];o=a.getterTable===void 0?t:za(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!dd(a,o)&&a.when.call(e)||(o=void 0)),r&&dd(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){U(18,this.name)}updateFromJSON(e){return md(ao(this,e),e)}static transform(){return null}remove(e){us(this,!0,e)}replace(e,t){ff();let n=Z();n!==null&&(n=n.clone()),ru(this,e);let r=this.getLatest(),i=this.__key,a=Wm(r);a!==null&&U(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();Im(s,X(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();us(r,!1,!0),Pm(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(K(this)&&K(s)||U(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),X(n)){Sl(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):Pp(e,s))}return ul()===i&&ll(o),s}insertAfter(e,t=!0){return Lm(this,`next`,e,t)}insertBefore(e,t=!0){return Lm(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return Fc()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return Rm(xh(this,`previous`),e,t)}selectNext(e,t){return Rm(xh(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function hs(e){return e instanceof ms}function gs(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&co(n,e,t)||t&&co(n,t,e)||e&&lo(n,e,t)||t&&lo(n,t,e))}(c,l))}function _s(e,t){let n=e.mergeWithSibling(t),r=gf()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function vs(e){let t,n,r=e;if(!dl(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!dl(t);){if(t.__text!==``){if(gs(t,r)){r=_s(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&q(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!dl(n);){if(n.__text!==``){if(gs(r,n)){r=_s(r,n);break}break}n.remove()}}else r.remove()}}function ys(e){return bs(e.anchor),bs(e.focus),e}function bs(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),q(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!K(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var xs=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ss(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!xs.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Cs(e,t,n,r,i){let a=Ss(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var ws=e=>{let t=Da(e,`format`),n=Oa(e,`format`),r=Aa(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Cs(t.indent,0,0,1/0),e.__textFormat=Ss(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Ts(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Es=e=>{let t=Da(e,`mode`),n=ka(e,`detail`,0),r=ka(e,`format`,0),i=Oa(e,`mode`),a=Aa(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:Ss(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:Ss(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Ts}},Ds=e=>{let t=Da(e,`format`),n=Oa(e,`format`),r=Aa(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Cs(t.indent,0,0,1/0),e.__textFormat=Ss(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Os=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),ks=e=>{let t=Da(e,`mode`),n=ka(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:Ss(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}};function As(e){return!1}function js(){return{...Gr,0:``}}function Ms(){return{...Ur,"":0}}var Ns=js(),Ps=Ms(),Fs=Wa()({direction:Ka(Ua([null,`ltr`,`rtl`]),{field:`__dir`}),format:Ka(Ua([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:Ns,setter:`setFormat`,setterTable:Ps}),indent:Ka(Ha(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:qa(Ha(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:qa(Ba(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function Is(e){if(Y(e)&&!As(gf())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var Ls=class extends ms{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:Is,extends:ms,generated:ws,json:Fs})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return Gr[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return zm(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Ym(this).length===0}isDirty(){let e=gf()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Ym(this)){let n=Xm(this,t);if(K(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(q(t)&&e.push(t),K(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;K(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;K(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return K(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:fl(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&U(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:fl(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&U(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=rh(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),K(i)&&r!==n-1&&!i.isInline()&&(e+=zr)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of Jm(e).values()){let e=fl(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),K(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Ur[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Vr[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return al(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){ff();let n=Z(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(q(e)||K(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(q(e)||K(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return X(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):lm(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&Ur[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){fs(this)&&U(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||U(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&U(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return Mm(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(Nm(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,Fm(t);let n=e.__key;Pm(i,t,d,c&&c.getWritable()),e.__key===a&&U(76),o.push(n),d=t}if(i.__size=u,s.length){let e=Z();if(X(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])Rs(r,t,n)&&ym(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||Y(this)||this.remove()}}return i}getDOMSlot(e){return new fa(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(wu(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(Y(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(q(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=Pu(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=hl(s,t))&&Ku(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}ts(this,e,n)})}};function K(e){return e instanceof Ls}function Rs(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var zs=class extends ms{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&U(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Bs(e){return e instanceof zs}function Vs(e){let t=e.getLatest().__cachedText;return t===null||!df()&&gf()._dirtyType!==0?null:t}var Hs=class extends Ls{__cachedText;$config(){return this.config(`root`,{extends:Ls})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){U(51)}getTextContent(){let e=Vs(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=Vs(this);return e===null?super.getTextContentSize():e.length}remove(){U(52)}replace(e){U(53)}insertBefore(e){U(54)}insertAfter(e){U(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)K(e)||Bs(e)||U(282);return super.splice(e,t,n)}static importJSON(e){return bl().updateFromJSON(e)}collapseAtStart(){return!0}};function Us(e){return e instanceof Hs}function Ws(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function Gs(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Ks(e,t,n=``){if(t===n)return;let r=Ws(n),i=Ws(t);for(let t in i)delete r[t],Gs(e,t,i[t]);for(let t in r)e.removeProperty(t)}var qs=Wa()({detail:Ka(Ga(Ha(),Hr),{field:`__detail`}),format:Ka(Ga(Ha(),Vr),{field:`__format`}),mode:Ka(Ua([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:qr,setterTable:Kr}),style:Ka(Ba(),{field:`__style`}),text:Ka(Ba(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function Js(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function Ys(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Xs(e,t,n,r,i){let a=r.classList,o=Ll(i,`base`);o!==void 0&&a.add(...o),o=Ll(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Vr){let r=Vr[e];if(o=Ll(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}Il(r,`class`)}function Zs(e,t,n){let r=n.isComposing(),i=e+(r?Rr:``),a=Mu(),o=Nu(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(mu().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Er||Nr){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function Qs(e,t,n,r,i,a){Zs(i,e,t);let o=a.theme.text;o!==void 0&&Xs(0,0,r,e,o)}function $s(e,t){let n=mu().createElement(t);return n.appendChild(e),n}function ec(e){return e!=null&&!0===e.__isInlineFormattable}var tc=class extends ms{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:ms,generated:Es,importDOM:{"#text":()=>({conversion:oc,priority:0}),b:()=>({conversion:rc,priority:0}),code:()=>({conversion:lc,priority:0}),em:()=>({conversion:lc,priority:0}),i:()=>({conversion:lc,priority:0}),mark:()=>({conversion:lc,priority:0}),s:()=>({conversion:lc,priority:0}),span:()=>({conversion:nc,priority:0}),strong:()=>({conversion:lc,priority:0}),sub:()=>({conversion:lc,priority:0}),sup:()=>({conversion:lc,priority:0}),u:()=>({conversion:lc,priority:0})},json:qs})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return qr[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===ul()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Vr[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return al(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Js(0,n),i=Ys(0,n),a=r===null?i:r,o=mu().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=mu().createElement(i),o.appendChild(s)),Qs(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Ks(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Js(0,i),s=Js(0,a),c=Ys(0,i),l=Ys(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??U(48);let i=mu().createElement(l);return Qs(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??U(49)),Zs(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Xs(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(Ks(t.style,p,f),Il(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return wu(t)||U(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=$s(t,`b`)),this.hasFormat(`italic`)&&(t=$s(t,`i`)),this.hasFormat(`strikethrough`)&&(t=$s(t,`s`)),this.hasFormat(`underline`)&&(t=$s(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Vr[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Hr[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=al(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Kr[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){ff();let n=e,r=t,i=Z(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!X(i))return lm(o,n,o,r,`text`,`text`);{let e=ul();e!==i.anchor.key&&e!==i.focus.key||ll(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=Z();if(r&&X(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ff();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=ul(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=Z();if(X(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=uc(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=uo(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=uc(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=uo(t,n);let a=n.__key;i===r&&ll(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&cl(t),n!==null&&cl(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),X(v)&&vm(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||U(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;ul()===r&&ll(n);let o=Z();if(X(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&bm(i,t,n,e,a),s!==null&&s.key===r&&bm(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function nc(e){return{forChild:dc(e.style),node:null}}function rc(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:dc(t.style,n?void 0:`bold`),node:null}}var ic=new WeakMap;function ac(e){if(!wu(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function oc(e){let t=e;e.parentElement===null&&U(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ic.get(n))===void 0&&!ac(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ic.set(r[e],i);return i}(t)!==null)return{node:Tm(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=sc(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=sc(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:uc(n)}}function sc(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,wu(n)){let e=n.style.display;if(e===``&&!Ou(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(nl(n))return n;if(n.nodeName===`BR`)return null}}var cc={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function lc(e){let t=cc[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:dc(e.style,t),node:null}}function uc(e=``){return nu(new tc(e))}function q(e){return e instanceof tc}function dc(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((q(e)||ec(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function fc(e,t){let{type:n,key:r,offset:i}=e,a=iu(e.key);return n===`text`?(q(a)||U(266,a.getType(),r),Sh(a,t,i)):(K(a)||U(267,a.getType(),r),Tc(a,e.offset,t))}function pc(e,t){let{origin:n,direction:r}=t,i=r===`next`;hh(t)?e.set(n.getKey(),t.offset,`text`):gh(t)?q(n)?e.set(n.getKey(),Ch(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(_h(t)&&K(n)||U(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function mc(e){let t=Z(),n=X(t)?t:um();return hc(n,e),Sl(n),n}function hc(e,t){pc(e.anchor,t.anchor),pc(e.focus,t.focus)}function gc(e){let{anchor:t,focus:n}=e,r=fc(t,`next`),i=fc(n,`next`),a=Ih(r,i)<=0?`next`:`previous`;return Ph(jh(r,a),jh(i,a))}function _c(e){let{direction:t,origin:n}=e,r=xh(n,dh(t)).getNodeAtCaret();return r?xh(r,t):Th(n.getParentOrThrow(),t)}function vc(e,t=`root`){let n=[e];for(let r=_h(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(_c(r));return n}function yc(e){return!!e&&e.origin.isAttached()}function bc(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=wc(e,r),o=a.anchor.origin;for(;o!==null&&!Y(o);)o=o.getParent();let s=K(o)?o.getFirstChild():null,c=vc(a.anchor,n),l=vc(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(_h(e))u.add(e.origin.getKey());else if(gh(e)){let{origin:t}=e;K(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),sl(e)}for(let e of f)!e.canBeEmpty()&&!Y(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=_c(xh(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=uc(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Sh(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=xc(c),m=xc(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&Hh(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(Y(i))return;t&&!n.has(i.__key)||!ju(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&Ym(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;Th(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(_h(e)){let t=e.origin;if(ju(t))return t}else{let t=e.getParentAtCaret();if(t&&ju(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(eu);if(e&&t&&!Us(t)&&e.isEmpty()&&u.has(e.getKey())&&Ym(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!Us(n)&&n.isEmpty();){let e=n.getParent();if(e&&Us(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}xl(o,s)!==null||o===null||o.isAttached()||xl(bl(),null);let g=xc([p,m,...c,...l]);if(g)return Nh(jh(g,e.direction));U(269,JSON.stringify(c.map(e=>e.origin.__key)))}function xc(e){let t=e.find(yc);return t&&Sc(t)}function Sc(e){let t=function(e){let t=e;for(;_h(t);){let e=Dh(t);if(!_h(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(q(t.origin))return hh(t)?t:Sh(t.origin,n,n);let r=t.getAdjacentCaret();return gh(r)&&q(r.origin)?Sh(r.origin,n,dh(n)):t}function Cc(e){return hh(e)&&e.offset!==Ch(e.origin,e.direction)}function wc(e,t){return e.direction===t?e:Ph(jh(e.focus,t),jh(e.anchor,t))}function Tc(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?Th(e,n):xh(a,n)}function Ec(e){let{origin:t,offset:n,direction:r}=e;if(n===Ch(t,r))return e.getSiblingCaret();if(n===Ch(t,dh(r)))return _c(e.getSiblingCaret());let[i]=t.splitText(n);return q(i)||U(281),jh(xh(i,`next`),r)}function Dc(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Oc(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&_m(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==Z()&&vm(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function kc(e,t){return!0}function Ac(e,{$copyElementNode:t=tu,$splitTextPointCaretNext:n=Ec,rootMode:r=`shadowRoot`,$shouldSplit:i=kc,removeEmptyDestination:a=!1}={}){if(hh(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(_h(e)){let e=_c(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=zm((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function jc(e,t,n){let r=jh(t,`next`);hh(r)&&(r.offset===0?r=xh(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=xh(r.origin,`next`))),r.origin.is(e)&&(gh(r)||U(342,e.getKey(),e.getType()),r=_c(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Ac(e,n))r=e;return hh(r)&&U(283),r.insert(e.isInline()?Fc().append(e):e),jh(xh(e.getLatest(),`next`),t.direction)}function Mc(e,t){let n=wc(X(t)?gc(t):t,`next`),r=Km(n.anchor.origin),i=Km(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Sc(Th(e,`next`)),o=jh(Sc(Th(e,`previous`)),`next`);return Ih(n.anchor,a)<=0&&Ih(n.focus,o)>=0}var Nc=class extends Ls{$config(){return this.config(`paragraph`,{children:`inline`,extends:Ls,generated:Ds,importDOM:{p:()=>({conversion:Pc,priority:0})}})}createDOM(e){let t=mu().createElement(`p`),n=Ll(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(wu(t)){this.isEmpty()&&t.append(mu().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(q),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!X(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(Mc(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=Fc();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>q(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Pc(e){let t=Fc();if(Wu(t,e),Hu(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Ur&&t.setFormat(n)}return Uu(t,e),{node:t}}function Fc(){return nu(new Nc)}function Ic(e){return e instanceof Nc}var Lc=Wa()({detail:qa(Ha(2),{getter:{field:`__detail`},setter:null}),mode:qa(Ua([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:qa(Ba(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),Rc=class extends tc{$config(){return this.config(`tab`,{extends:tc,generated:ks,json:Lc})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=Ll(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||U(286),this}setDetail(e){return e!==2&&U(127),this}setMode(e){return e!==`normal`&&U(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function zc(){return nu(new Rc)}function Bc(e){return e instanceof Rc}var Vc=null;function Hc(e){Vc=e}var Uc=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),Wc=1;function Gc(e,t){let n=Kc(e,t);return n===void 0&&U(30,t),n}function Kc(e,t){return e._nodes.get(t)}var qc=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function Jc(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return rl(t)||lu(t)?Su(t):null})():t;if(!wu(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=gl(n),i=n.nodeName;return hs(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&$c(n)==null)}function Yc(e){let t=e===null?null:Cu(e);return Tu(t)&&Jc(t)}function Xc(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return Qc(t)===e&&e.read(`latest`,()=>!Jc(t))}function Zc(e){return e instanceof Qd}function Qc(e){let t=e;for(;t!=null;){let e=$c(t);if(Zc(e))return e;t=Ul(t)}return null}function $c(e){return e?e.__lexicalEditor:null}function el(e){return Bc(e)||e.isToken()}function tl(e){return el(e)||e.isSegmented()}function nl(e){return Tu(e)&&e.nodeType===3}function rl(e){return Tu(e)&&e.nodeType===9}function il(e){let t=e;for(;t!=null;){if(nl(t))return t;t=t.firstChild}return null}function al(e,t,n){let r=Vr[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Vr.superscript:t===`superscript`?i&=~Vr.subscript:t===`lowercase`?(i&=~Vr.uppercase,i&=~Vr.capitalize):t===`uppercase`?(i&=~Vr.lowercase,i&=~Vr.capitalize):t===`capitalize`&&(i&=~Vr.lowercase,i&=~Vr.uppercase),i}function ol(e,t){let n=function(){let e=Vc;return Vc=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);ff(),pf();let r=gf(),i=mf(),a=``+Wc++;i._nodeMap.set(a,e),K(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function sl(e){Fm(e.getParent()===null?e:e.getWritable())}function cl(e){pf(),fs(e)&&U(323,e.__key,e.__type);let t=e.__parent===null?Hm(e)?e.__slotHost:null:e.__parent,n=mf(),r=gf(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Hm(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),K(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function ll(e){ff();let t=gf(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=fl(n);e!==null&&e.getWritable()}if(e!==null){let t=fl(e);t!==null&&t.getWritable()}}}function ul(){return df()?null:gf()._compositionKey}function dl(e){return!Ar&&(Mr||Fr)&&e.__text===``&&e.__key===gf()._compositionKey}function fl(e,t){let n=(t||mf())._nodeMap.get(e);return n===void 0?null:n}function pl(e,t){let n=hl(e,gf());return n===void 0?null:fl(n,t)}function ml(e,t,n){e[`__lexicalKey_${t._key}`]=n}function hl(e,t){return e[`__lexicalKey_${t._key}`]}function gl(e,t){let n=e;for(;n!=null;){let e=pl(n,t);if(e!==null)return e;n=Ul(n)}return null}function _l(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function vl(e){return e.read(()=>bl().getTextContent())}function yl(e,t){let n=zu(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=fl(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function bl(){return mf()._nodeMap.get(`root`)}function xl(e,t){if(!(Y(e)&&e.isAttached()&&(Us(e)?e.getChildrenSize()===0:e.isEmpty())&&(Us(e)||t!==null&&ju(t))))return null;let n=Fc();return e.append(n),n}function Sl(e){ff();let t=mf();e!==null&&(e.dirty=!0,e.setCachedNodes(null),X(e)&&gf()._slotsUsed&&am(e)),t._selection=e}function Cl(e){ff(),Sa(gf(),e)}function wl(e){let t=function(e,t){let n=e;for(;n!=null;){let e=hl(n,t);if(e!==void 0)return e;n=Ul(n)}return null}(e,gf());return t===null?null:fl(t)}function Tl(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function El(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Dl=0;function Ol(){return br?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Dl).toString(36)}`}function kl(e){return nl(e)?e.nodeValue:null}function Al(e,t,n){let r=su(Zl(t));if(r===null)return;let i=_u(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=kl(a),r=gl(a);if(t!==null&&q(r)){if((t===Rr||t===Br)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&jl(r,t,o,s,e)}}}function jl(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Ar&&(Mr||Fr);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Rr)||s&&t===a.getTextContent()||(c=t.slice(0,-Rr.length)),i&&!s)){let e=Br,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=Z();if(c===``){if(o&&!i&&s)return void Ml(a,``,t);if(ll(null),Mr||Ar||Fr)a.remove();else{let e=gf();Ml(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=gm(),d=a.getTextContentSize(),f=ul(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||X(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!X(t)||n===null||r===null)return void Ml(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=uc(a.getTextContent());a.replace(e),a=e}Ml(a,c,t)}}}function Ml(e,t,n){if(e.setTextContent(t),X(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Ch(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Nl(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(Us(e))return t;t=e}return null}function Pl(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(ys(e),!Us(t))return e;let u=Nl(n.getNode());return K(u)&&u.isShadowRoot()&&u.is(Nl(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function Fl(e){let t=bl();if(X(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(Us(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),Pl(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(K(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),Pl(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),Pl(e,a),e)}{let e=t.select(0,t.getChildrenSize());return Sl(Pl(e,t)),e}}function Il(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function Ll(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Wh(i);return n[t]=e,e}return i}function Rl(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&U(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function zl(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Bl(e,t){let n=e.offset;if(e.type===`element`)return zl(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?zl(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Vl(e){let t=Zl(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function J(e,t,...n){return Of(e,t,n[0],e)}function Hl(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function Ul(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return lu(n)?n.host:null}function Wl(e){return rl(e)?e:wu(e)?e.ownerDocument:null}function Gl(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function Kl(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+Gl(o.scrollPaddingLeft,i)*l,p=d+(i-Gl(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function ql(e){ff(),gf()._updateTags.add(e)}function Jl(e){ff(),gf()._deferred.push(e)}function Yl(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Xl(e){let t=Wl(e);return t?t.defaultView:null}function Zl(e){let t=e._window;return t===null&&U(78),t}function Ql(e){return K(e)&&e.isInline()||Bs(e)&&e.isInline()}function $l(e){let t=e.getLatest();for(;t!==null;){if(Um(t)!==null&&K(t))return t;let e=t.getParentOrThrow();if(Y(e))return e;t=e}return t}function eu(e){return K(e)&&e.isShadowRoot()}function Y(e){return Us(e)||eu(e)}function tu(e,t=!1){let n=e.constructor.clone(e,Uc);return ol(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function nu(e){let t=gf(),n=e.getType(),r=Kc(t,n);r===void 0&&U(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||U(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||U(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&U(203,e.constructor.name,n,r.name,r.getType()),t}return e}function ru(e,t){!Us(e.getParent())||K(t)||Bs(t)||U(99)}function iu(e){let t=fl(e);return t===null&&U(63,e),t}function au(e){if(!e||e.isInline())return!1;if(Bs(e))return!0;if(K(e)){if(e.isShadowRoot()){let t=e.getParent();return!(K(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function ou(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function su(e){return br?(e||window).getSelection():null}function cu(e){let t=Xl(e);return t?t.getSelection():null}function lu(e){return Eu(e)&&`host`in e}var uu=[];function du(e){let t=e.getRootNode();if(t===e||!lu(t))return uu;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!lu(e))break;n.push(e),r=e.host}return n}function*fu(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(rl(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function pu(e){return e===null?document:e.ownerDocument}function mu(){let e=yf();return pu(e===null?null:e._rootElement)}function hu(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=du(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function gu(e,t){let n=hu(e,t);if(n!==null){let e=vu(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function _u(e,t){let n=hu(e,t);return n===null?e:yu(n,bu(e))}function vu(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function yu(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function bu(e){return e.direction}function xu(e){let t=e.getRootNode();return rl(t)||lu(t)?t.activeElement:null}function Su(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Cu(e){let t=e.target;if(t!==null&&wu(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function wu(e){return Tu(e)&&e.nodeType===1}function Tu(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Eu(e){return Tu(e)&&e.nodeType===11}var Du=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Ou(e){return!(!wu(e)||!e.style.display.startsWith(`inline`))||Du.test(e.nodeName)}var ku=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Au(e){return(!wu(e)||!e.style.display.startsWith(`inline`))&&ku.test(e.nodeName)}function ju(e){if(Bs(e)&&!e.isInline())return!0;if(!K(e)||Y(e))return!1;let t=e.getFirstChild(),n=t===null||Vd(t)||q(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Mu(){return gf()}function Nu(e=Mu()){return e._config.dom||Jd}function Pu(e,t,n=Mu()){let r=Nu(n).$getDOMSlot(e,t,n);return K(e)&&(Fu(r)||U(344,e.getKey(),e.getType())),r}function Fu(e){return e instanceof fa}function Iu(e,t,n=Mu()){return il(Pu(e,t,n).element)}var Lu=new WeakMap,Ru=new Map;function zu(e){if(!e._readOnly&&e.isEmpty())return Ru;e._readOnly||U(192);let t=Lu.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Lu.set(e,t)),t}function Bu(e){let t=e.constructor.clone(e,Uc);return t.afterCloneFrom(e),t}function Vu(e){return(t=Bu(e))[ds]=!0,t;var t}function Hu(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function Uu(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Wu(e,t){let n=t.style.textAlign;return n&&n in Ur?e.setFormat(n):e}function Gu(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Ku(e){return!0===e.__lexicalUnmanaged}function qu(e,t=Mu()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Ju(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(wu(n)&&n.hasAttribute(`data-lexical-slot`)||hl(n,t)!==void 0)return!1;n=Ul(n)}return!1}function Yu(e,t){return za(e,t)&&e[t]!==ms[t]}var Xu=new WeakMap;function Zu(e){let t=Xu.get(e);return t===void 0?function(e){let t=e.prototype!=null&&Yr in e.prototype?e.prototype[Yr]():void 0,n=function(e){if(!(e===ms||e.prototype instanceof ms)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{Qd.version&&(n=JSON.parse(Qd.version))}catch{}U(290,e.name,t,n)}return e===zs||e===Ls||e===ms}(e),r=!n&&Yu(e,`getType`)?e.getType:void 0,i=r&&!($u in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:za(e.prototype,Yr),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Xu.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=od(e);for(let[i,a]of r){let r=ld(e,i,a);if(r===null)continue;if(Ea(r)){let t=r.field;if(t===`__proto__`&&U(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])za(t,String(r))||U(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&U(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?ed:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of od(e).fieldsDerivedFirst){let a=cd(e,r,i);if(a===null)continue;if(Ea(a)){let o=a.field;o===`__proto__`&&U(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&U(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&U(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?sd:[...n.values()]}(e),i=od(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Sd(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,Qu(Zu(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:fd(r),setters:t},function(e,t,n,r){if(!t&&n){if(!Yu(e,`getType`)){let t=e,r=function(){return this===t?n:ms.getType.call(this)};r[$u]=!0,e.getType=r}if(Yu(e,`clone`)||(e.clone=(t,n)=>{Hc(t);let r=new e;return n!==Uc&&r.afterCloneFrom(t),r}),Yu(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Cd(e);return n.updateFromJSON===ms.prototype.updateFromJSON?function(e,t){return md(e.__state||t.$!==void 0?ao(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!Yu(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;za(t,`getTextContent`)&&!za(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=ms.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Sd(e)){let e=t.prototype;if(za(e,`afterCloneFrom`))continue;let r=xd(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?Qu(Zu(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[yd]=!0}}(e),function(e,t){t&&t.inline!==void 0&&za(e.prototype,Yr)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?gd:_d,writable:!0})}(e,a)}catch(t){throw Xu.delete(e),t}return s}(e):t}function Qu(e){let{compiled:t}=e;return t===void 0&&U(422,e.config.klass.name),t}var $u=Symbol(`lexical.synthesizedGetType`),ed=[];function td(e,t,n,r){let i=n.method===void 0?r:n.method,a=od(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return nd(o,s,i)&&nd(o,s,r)?n:i}function nd(e,t,n){return e[n]===t[n]}function rd(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function id(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var ad={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function od(e){let t=Zu(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Sd(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?ad:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}var sd=[];function cd(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?id(t):r;return Ea(i)?td(e,t,i,id(t)):i}function ld(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?rd(t):r;return Ea(i)?td(e,t,i,rd(t)):i}function ud(e){return e}function dd(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function fd(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&dd(i,r)}}function pd(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function md(e,t){let{flatStates:n,generated:r,setters:i}=Qu(Zu(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=$a(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?ud(e)[i.field]=i.setterTable===void 0?a:za(i.setterTable,a)?i.setterTable[a]:pd(i):i.setter.call(e,a)}return e}(a,t,i)}function hd(e){return Zu(e).config}function gd(){return!0}function _d(){return!1}function vd(e){let t=[];for(let n of[e.getter,e.setter])Ea(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var yd=`__lexicalSynthesizedAfterCloneFrom`;function bd(e){let{declaredBy:t,fieldsBaseFirst:n}=od(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of vd(a))r.includes(e)||r.push(e);return r}function xd(e){let t=bd(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of Sd(e))if(t!==e)for(let e of bd(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Sd(e){for(let t=e;t&&(t===ms||hs(t.prototype));){let e=hd(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Ed(t)}}function Cd(e){let t=Mu();ff();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:nu(r)}var wd=(e,t)=>{let n=e;for(;n!=null&&!Us(n);){if(t(n))return n;n=n.getParent()}return null};function Td(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?fl(r):t.get(r);e??U(174),n.push(r),r=e.__next}return n}function Ed(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function Dd(e){return new jd($i(e._nodeMap),null,e._slotsUsed)}function Od(){return new jd(new Map([[`root`,new Hs]]),null,!1)}function kd(e){let t=e.constructor,n=ia(e);if(K(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(kd(r[e]))}let r=Ym(e);if(r.length>0){let i={};for(let n of r){let r=Xm(e,n);r===null&&U(366,t.name,n),i[n]=kd(r)}n.$slots=i}return n}function Ad(e){return e instanceof jd}var jd=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return wf(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return na(typeof e==`boolean`&&e,()=>wf(null,this,()=>({root:kd(bl())})))}},Md=`history-push`,Nd=`history-merge`,Pd=`skip-dom-selection`,Fd=`skip-selection-focus`,Id=`composition-end`,Ld=class extends Ls{$config(){return this.config(`artificial`,{extends:Ls})}createDOM(e){return mu().createElement(`div`)}},Rd=class extends ms{$config(){return this.config(`linebreak`,{extends:ms,generated:Os,importDOM:{br:e=>Hd(e)||Ud(e)?null:{conversion:zd,priority:0}}})}getTextContent(){return`
|
|
25
|
+
`}createDOM(){return mu().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function zd(e){return{node:Bd()}}function Bd(){return nu(new Rd)}function Vd(e){return e instanceof Rd}function Hd(e){let t=e.parentElement;if(t!==null&&Au(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Wd(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&Wd(n))return!0}}return!1}function Ud(e){let t=e.parentElement;if(t!==null&&Au(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Wd(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&Wd(r))return!0}return!1}function Wd(e){return nl(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Gd(e){console.warn(e)}function Kd(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=Od(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&Zf(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),ml(n,e,`root`))}function qd(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Sd(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var Jd={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=Kc(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>K(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>K(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function Yd(e){let t=e||{},n=yf(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Od(),s=t.namespace||(i===null?Ol():i._config.namespace),c=t.editorState,l=[Hs,tc,Rd,Rc,Nc,Ld,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===ms||n.prototype instanceof ms)){let r=`<unknown>`;try{r=JSON.parse(Xi)}catch{}U(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}hd(n);let a=n.getType(),o=qd(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:to(l[e]),transforms:o})}}let h=new Qd(o,i,m,{disableEvents:a,dom:{...Jd,...e&&e.dom},namespace:s,theme:r},u||console.error,d||Gd,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand($r,sp,0),e.registerCommand(ei,lp,0),e.registerCommand(ti,dp,0),e.registerCommand(ni,fp,0),e.registerCommand(mi,Cp,0)}(h),h}function Xd(e,t){let n=e.get(t);e.delete(t),n&&n()}function Zd(e,t,n){return e.set(t,n),Xd.bind(null,e,t)}var Qd=class{static version=Xi;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new ea,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ol(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return Zd(this._listeners.update,e)}registerEditableListener(e){return Zd(this._listeners.editable,e)}registerDecoratorListener(e){return Zd(this._listeners.decorator,e)}registerTextContentListener(e){return Zd(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Nf(Zd(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&U(35);let r=this._commands;r.has(e)||r.set(e,[new Zi,new Zi,new Zi,new Zi,new Zi]);let i=r.get(e);i===void 0&&U(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&U(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=zu(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return yl(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return J(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Ll(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Kd(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=Lf.get(e);if(t===void 0)return void Ap();let n=Rf.get(t);if(n===void 0)return void Ap();Lf.delete(e);let r=$c(e);Zc(r)?(function(e){if(e._parentEditor!==null){let t=El(e),n=t[t.length-1]._key;Ep.get(n)===e&&Ep.delete(n)}else Ep.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&U(198);let i=wp(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=Xl(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Ca(this),this._updateTags.add(Nd),Tf(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;Lf.set(e,n);let r=Rf.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},Rf.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=wp(e);i.push(zf.register(n));let a={blur:zi,click:Kf,compositionend:hp,compositionstart:up,copy:ji,cut:Mi,dragend:Ai,dragover:ki,dragstart:Oi,drop:Di,focus:Ri,input:cp,keydown:gp,paste:si,pointerdown:Qf,...Or&&{beforeinput:op},...Ar&&{keyup:_p,mousedown:Yf}};for(let[n,r]of Object.entries(a))i.push(Pf(e,n,i=>{kp(i)||(Op(i),n===`blur`&&(Zf(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):J(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,Mf(t,()=>{let o=su(Zl(t));if(a.type!==`mousedown`){let r=c&&o&&X(Z())&&mm(gm(),o,t,new Event(`selectionchange`));return r&&Sl(r),ep(t,n,c&&o?_u(o,e).focusNode:null)}let l=fm(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Tp(t,o,new Event(`selectionchange`),r),ep(t,a,_u(o,e).focusNode);let n=Z();X(n)&&n.isCollapsed()&&!n.is(gm())&&Gf(t,n)}})};i.push(Ff(n,{pointercancel:c,pointermove:c,pointerup:c},!0),Pf(Zl(t),`blur`,s),t.registerEditableListener(s),Ff(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||Ju(Cu(e),t)?null:e}}),Pf(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Ar&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return Nf(Pf(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),Pf(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=qf&&Math.abs(r.clientY-n.y)<=qf&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(Xf(e,t,n)||(Su(n.ownerDocument)===n&&n.blur(),Zf(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Nd),Tf(this);Ef(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=Dd(e),r._selection=e._selection?e._selection.clone():null),Sa(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Tf(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Mf(this,()=>{if(a&&this._updateTags.add(a),n&&(vr(38),bl().append(Fc())),e._parsed)for(let[e,t]of r._nodeMap.entries())K(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=Od(),i=ef,a=nf,o=tf,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,ef=r,nf=!1,tf=t,Hc(null);try{let i=t._nodes;Cf(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,ef=i,nf=a,tf=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(cf.has(this)||Tf(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):jf(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Mf(this,()=>{let r=Z(),i=bl();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Sl(r.clone()),ql(`focus`),Jl(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=su(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ef(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>_f()))}toJSON(){return{editorState:this._editorState.toJSON(ra())}}};function $d(e,t,n,r,i,a){if(K(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=K(e);e.__parent!==t||s&&a.has(o)||((s||Vm(e)&&e.__slots!==null)&&$d(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of Vm(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Hm(e)&&e.__slotHost===t&&((K(e)||Vm(e)&&e.__slots!==null)&&$d(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var ef=null,tf=null,nf=!1,rf=!1,af=!1,of=new Set,sf=new Set,cf=new Set,lf=0,uf={characterData:!0,childList:!0,subtree:!0};function df(){return nf||ef!==null&&ef._readOnly}function ff(){nf&&U(13)}function pf(){lf>99&&U(14)}function mf(){return ef===null&&U(195,vf()),ef}function hf(e){mf()!==null&&tf===null&&(tf=e),tf!==e&&vr(378)}function gf(){return tf===null&&U(337,vf()),tf}function _f(){gf()._dirtyType=2}function vf(){let e=0,t=new Set,n=Qd.version;if(typeof window<`u`)for(let r of fu(document)){let i=$c(r);if(Zc(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function yf(){return tf}function bf(e,t,n){let r=t.__type,i=Gc(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function xf(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Sf(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Cf(e,t){let n=e.type,r=t.get(n);r===void 0&&U(17,n);let i=r.klass;e.type!==i.getType()&&U(18,i.name);let a=i.importJSON(e),o=e.children;if(K(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Cf(o[e],t);a.append(n)}let s=e.$slots;if(s){Vm(a)||U(379,i.name);for(let e in s)ah(a,e,Cf(s[e],t))}return a}function wf(e,t,n){let r=ef,i=nf,a=tf;ef=t,nf=!0,tf=e;try{return n()}finally{ef=r,nf=i,tf=a}}function Tf(e,t){e._pendingEditorState!==null&&tf!==e&&Sa(e,!1,!0);let n=af;af=!0;try{let n=function(e){if(sf.has(e))return!1;sf.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!Df(e,n))return!1;let i=(n===null||X(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;jf(e,()=>e.dispatchCommand(Zr),void 0,!0)}return!1}finally{sf.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&kf(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=ef,u=nf,d=tf,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){tf=e,ef=n,nf=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=cs(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),rf)throw t;Kd(e,null,r,n),Ca(e),e._dirtyType=2,rf=!0,Tf(e,a),rf=!1;return}finally{p.observe(r,uf),e._updating=f,ef=l,nf=u,tf=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=_l(e)),delete r[a])}(e,n);let b=i?null:su(Zl(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){tf=e,ef=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&ou(t,e,r),Cm(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(X(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(xu(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())au(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&au(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=Pu(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=mu().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Wh(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&ou(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,uf),tf=d,ef=l}}let x=cf.has(e);cf.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,Ef(`decorator`,e,!0,r)),function(e,t,n){let r=vl(t),i=vl(n);r!==i&&Ef(`textcontent`,e,!0,i)}(e,t||a,n),Ef(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||cf.delete(e)}f||kf(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){of.has(e)||(of.add(e),setTimeout(()=>{of.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(_r(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;jf(e,t,r)}}(e)})(e,t),n&&e._onWarn(_r(436))}finally{af=n}}function Ef(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Df(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Of(e,t,n,r){let i=El(e),a;if(!af)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===Zr){if(tf!==e||nf){let i=!1;return Mf(e,()=>{i=Of(e,t,n,r)}),i}let i=mf()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Mf(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Of(a,t,n,r)}),!1}function kf(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Af(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&U(191),a._flushSync=!0),o&&e._deferred.push(o),Sf(e,i.tag)),a==null?jf(e,n,i):n()}}return r}function jf(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,Sf(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=Dd(l||c),u=!0),l._flushSync=s;let d=ef,f=nf,p=tf,m=e._updating,h=e._lastNotifiedSelection;ef=l,nf=!1,e._updating=!0,tf=e;let g=e._headless||e.getRootElement()===null;Hc(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=su(Zl(e));return X(n)||n==null?mm(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Af(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(X(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);q(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&vs(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=ul(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);q(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&vs(r),r!==void 0&&xf(r,a)&&bf(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){lf++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&xf(c,a)&&bf(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,lf++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Af(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(K(t)&&$d(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Vm(t)&&t.__slots!==null&&$d(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=gf(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(X(i)){e._slotsUsed&&am(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||U(19)}else Vp(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Tf(e);return}finally{ef=d,nf=f,tf=p,e._updating=m,lf=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Tf(e)):u&&qc(()=>{Tf(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function Mf(e,t,n){tf===e&&n===void 0?df()?jf(e,t,n):t():jf(e,t,n)}function Nf(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Pf(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function Ff(e,t,n){return Nf(...Object.entries(t).map(([t,r])=>Pf(e,t,r,n)))}var If=30,Lf=new WeakMap,Rf=new WeakMap,zf=Ji(e=>(e.addEventListener(`selectionchange`,Dp),()=>e.removeEventListener(`selectionchange`,Dp)));function Bf(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=gf(),u;if(a!==void 0)u=a;else{let e=su(Zl(l));u=e===null?null:_u(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!q(c)||(!i&&(!Or||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||Tl(n))&&o.offset!==s.offset&&!c.isComposing()||tl(c)||c.isDirty()&&m>1||(i||!Or)&&p!==null&&!c.isComposing()&&d!==Iu(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=el(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(q(t)||K(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function Vf(e,t){return nl(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Hf(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=_u(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,Vf(r,i)&&Vf(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}Mf(t,()=>{if(!n)return void Sl(null);if(!Xc(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||ep(t,c,a);let l=$f.has(c),u=Z();if(s.postDeleteSelectionToRestore&&X(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),Sl(u))}if(s.postDeleteSelectionToRestore=null,X(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),Gf(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=Lr,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(q(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||Df(e,t))&&e.dispatchCommand(Zr)})(t,u,u!==null&&(u.dirty&&!l||!X(u)))})}function Uf(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Wf(e,t){Uf(e,t.getFormat(),t.getStyle())}function Gf(e,t){let n=t.anchor,r=n.getNode(),i=Zl(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?Uf(t,o,s):n.type===`text`?(q(r)||U(141),Wf(t,r)):(e.isComposing()||bl().getTextContent()!==``)&&(K(r)||U(259),r.isEmpty()?hm(t,``):Uf(t,t.format,``))}function Kf(e,t){Mf(t,()=>{let n=Z(),r=su(Zl(t)),i=gm();if(r){if(X(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!Us(t)&&bl().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Ar&&t._inputState.lastPointerType!==`mouse`){let n=_u(r,t._rootElement).anchorNode;(wu(n)||nl(n))&&Sl(mm(i,r,t,e))}}if(Er&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(wu(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=mm(i,r,t,e);s===null?r.removeAllRanges():Sl(s)}}J(t,Qr,e)})}var qf=10,Jf=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function Yf(e,t){let n=t.getRootElement();n!==null&&(Xf(e,t,n)?(e.preventDefault(),Su(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):Zf(t,n))}function Xf(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=Cu(e);if(!Tu(r))return!1;let i=!1;for(let e=r;e!==null;e=Ul(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(Jf))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function Zf(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function Qf(e,t){let n=Cu(e),r=e.pointerType;Tu(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Mf(t,()=>{Ju(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var $f=new WeakSet;function ep(e,t,n=null){let r=Z(),i=r&&r.clone();(function(e,t,n){let r=gm(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&gl(n);Bs(o)&&(i?a&&o.isInline()&&o.selectPrevious():X(r)&&Sl(r.clone()));let s=Z(),c=s||(a?um():X(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!X(c)||a&&!c.isCollapsed()||!rl(u)&&!lu(u))return;let{anchor:d,focus:f}=c;if(!i&&X(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&gl(h),_=(e,t)=>K(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=K(g)&&!g.isInline()&&(Us(g)?wd(f.getNode(),cm):g);for(let e of y?Th(y,`next`):[])v.push(xh(e.origin,`previous`),e);let b=Zl(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!Bs(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle(Ul(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),E=T&&e.getElementByKey(T.getKey()),D=E?E.getClientRects():[],O=D[C?0:D.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||Vd(T)||O&&(C===y?2*O.right>u+h:2*O.left<u+h))){if(!n.is(_(Bl(f,C),w))){let e=xh(n,w);pc(f,e),a&&pc(d,e)}s||Sl(c);return}}if(Bs(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:lu(u)?[u]:[]}),r=n&&em(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=Z(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&$f.add(o),t.type===`mousedown`&&X(a)&&hm(a,X(i)?i.anchor.key:``)}function tp(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function np(e){let{lastKeyCode:t}=gf()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
|
26
|
+
`:t===`Tab`?` `:null;if(!n)return;let r=Z();if(!X(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!q(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
|
|
27
|
+
`){if(Ar)return;if(Vd(e))e.selectEnd();else if(!e){let e=wd(i,cm),t=e&&e.getNextSibling();K(t)&&t.selectStart()}}else n===` `?Bc(e)&&e.selectEnd():q(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function rp(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function ip(e){Tr&&!Ar&&Nr&&(rp(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>rp(e),0))}function ap(e,t){let n=Cu(e);if(wu(n)&&Ju(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Su(r.ownerDocument);return i!==null&&r.contains(i)&&(Ju(i,t)||Jc(r,i))}function op(e,t){let n=e.inputType;n===`deleteCompositionText`||Er&&Vl(t)||n!==`insertCompositionText`&&Mf(t,()=>{ap(e,t)||J(t,$r,e)},{event:e})}function sp(e){let t=e.inputType,n=tp(e),r=gf(),i=r._inputState,a=Z();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(rp(i),e.preventDefault(),X(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=gm();if(!X(e))return!0;Sl(e.clone())}if(X(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+If}(i,e.timeStamp)&&r.isComposing()&&t){if(ll(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Mf(r,()=>{ll(null)})},If),X(a)){let e=a.anchor.getNode();e.markDirty(),q(e)||U(142),Wf(a,e)}}else{if(ll(null),Ar&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Pr&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!Bs(Bl(a.anchor,!0))),!u){J(r,ri,!0);let e=Z();Pr&&X(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!X(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),J(r,t===`historyUndo`?fi:pi)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&Al(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!Us(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&nm(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=Mp(e,i,o),{anchor:r,focus:u}=a,d=!im(nm(r),c)||!im(nm(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
28
|
+
`)e.preventDefault(),J(r,ii,!1);else if(o===zr)e.preventDefault(),J(r,ai);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&Bf(a,n,o,e.timeStamp,!0)?(e.preventDefault(),J(r,oi,o),np(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:J(r,oi,e),np((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;ll(null),t||J(r,oi,e),pp(n);break}case`insertLineBreak`:ll(null),i.isInsertLineBreak=!1,J(r,ii,!1);break;case`insertParagraph`:ll(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,J(r,ii,!1)):J(r,ai);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:J(r,si,e);break;case`deleteByComposition`:(function(e,t){return e!==t||K(e)||K(t)||!el(e)||!el(t)})(u,d)&&J(r,ci,e);break;case`deleteByDrag`:ql(Fd),J(r,ci,e);break;case`deleteByCut`:J(r,ci,e);break;case`deleteContent`:J(r,ri,!1);break;case`deleteWordBackward`:J(r,li,!0);break;case`deleteWordForward`:J(r,li,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:J(r,ui,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:J(r,s?ri:ui,!1);break;case`formatStrikeThrough`:J(r,di,`strikethrough`);break;case`formatBold`:J(r,di,`bold`);break;case`formatItalic`:J(r,di,`italic`);break;case`formatUnderline`:J(r,di,`underline`);break;case`historyUndo`:J(r,fi);break;case`historyRedo`:J(r,pi)}return!0}function cp(e,t){e.stopPropagation();let n=t._inputState;rp(n),Mf(t,()=>{ap(e,t)||t.dispatchCommand(ei,e)},{event:e}),n.unprocessedBeforeInputData=null}function lp(e){let t=gf(),n=t._inputState,r=Z(),i=e.data,a=tp(e),o=!1,s=!1;if(i!=null&&X(r)){let c=su(Zl(t)),l=c===null?null:_u(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&q(d)&&tl(d);if(!u&&!f&&Bf(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=mp(t,i);if(n.compositionPhase=`idle`,e)return ql(Id),Cl(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;Or&&!r.isCollapsed()&&q(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===kl(l.anchorNode)||(J(t,oi,i),s=e.inputType===`insertText`);let p=i.length;Er&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),Pr&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,ll(null))}}return o||(Al(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(mp(t,i||void 0),ql(`composition-end`),n.compositionPhase=`idle`)),Cl(s),!0}function up(e,t){J(t,ti,e)}function dp(e){let t=gf(),n=t._inputState,r=Z();if(X(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(ll(i.key),ql(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+If||i.type===`element`||!r.isCollapsed()||!Pr&&(a.getFormat()!==r.format||q(a)&&a.getStyle()!==r.style)||q(a)&&(tl(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Ar||!Mr&&!Fr?J(t,oi,Br):function(e){Ip(e,``,!0)}(r);let e=Z();X(e)&&ll(e.anchor.key)}}return!0}function fp(e){let t=gf();return t._inputState.compositionPhase=`idle`,mp(t,e.data),ql(Id),!0}function pp(e){let t=gf()._inputState,n=t.composedSegmentedKey;if(t.composedSegmentedKey=null,e===null||e!==n)return;let r=fl(e);if(!q(r)||r.getType()===`text`||tl(r)||!r.isAttached())return;let i=Z(),a=X(i)&&i.anchor.key===e?i.anchor.offset:null,o=uc(r.getTextContent());if(o.setFormat(r.getFormat()),o.setStyle(r.getStyle()),r.replace(o),a!==null){let e=Math.min(a,o.getTextContentSize());o.select(e,e)}}function mp(e,t){let n=e._compositionKey;if(ll(null),n!==null&&t!=null){if(t===``){let t=fl(n),r=e.getElementByKey(n),i=r!==null&&q(t)?Iu(t,r,e):null;if(i!==null&&i.nodeValue!==null&&q(t)){let n=su(Zl(e)),r=n&&_u(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),jl(t,i.nodeValue,a,o,!0)}return pp(n),!1}if(t[t.length-1]===`
|
|
29
|
+
`){let t=Z();if(X(t)||Vp(t)){if(X(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return J(e,xi,null),pp(n),!1}}let r=fl(n);if(r!==null&&q(r)&&tl(r)){r.markDirty();let e=Z(),i=r.getTextContentSize(),a=X(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return Al(!0,e,t),pp(n),!1}function hp(e,t){let n=t._inputState;Er?n.compositionPhase=`ending-firefox`:(e.data===``||Ar||!Mr&&!Fr)&&J(t,ni,e)}function gp(e,t){let n=t._inputState;Ar&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&rp(n),t.isComposing()||!Ar&&(Mr||Fr)&&e.keyCode===229||J(t,mi,e)}function _p(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var vp={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},yp={ctrlKey:!0},bp={metaKey:!0},xp={shiftKey:`any`},Sp={altKey:`any`,shiftKey:`any`};function Cp(e){let t=gf();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=qi(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{J(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),J(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!Ar||r.isShiftKeyDown),J(n,xi,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:Hi,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||X(r)||Yc(e)||(e.preventDefault(),J(n,t,e))}});return[e(`ArrowRight`,xp,hi),e(`ArrowLeft`,xp,_i),e(`ArrowUp`,Sp,yi),e(`ArrowDown`,Sp,bi),n({...vp,shiftKey:!0},!0),n({...vp,shiftKey:!1},!1),e(` `,vp,Si),{key:`Backspace`,modifiers:xp,onMatch:(e,t)=>{J(t,Ci,e)&&ip(t._inputState)}},e(`Escape`,vp,wi),e(`Delete`,{},Ti),t(`Backspace`,Ui,li,!0),t(`Delete`,Ui,li,!1),t(`b`,Hi,di,`bold`),t(`u`,Hi,di,`underline`),t(`i`,Hi,di,`italic`),e(`Tab`,xp,Ei),t(`z`,Hi,fi,void 0),t(`z`,{...Hi,shiftKey:!0},pi,void 0),...Tr?[{key:`o`,modifiers:yp,onMatch:(e,t)=>{e.preventDefault(),J(t,ii,!0)}},e(`ArrowLeft`,{metaKey:!0,...xp},vi),e(`ArrowRight`,{metaKey:!0,...xp},gi),t(`h`,yp,ri,!0),t(`d`,yp,ri,!1),t(`Backspace`,bp,ui,!0),t(`Delete`,bp,ui,!1),t(`k`,yp,ui,!1)]:[e(`Home`,xp,vi),e(`End`,xp,gi),t(`y`,yp,pi,void 0)],{key:`a`,modifiers:Hi,onMatch:(e,t)=>{e.preventDefault(),J(t,Ni,e)&&ip(t._inputState)}},r(`c`,ji),r(`x`,Mi)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Bi,e),!0}function wp(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function Tp(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=_u(t,e._rootElement).anchorNode;(wu(i)||nl(i))&&Sl(mm(gm(),t,e,n))}var Ep=new Map;function Dp(e){let t=e.target;if(wu(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=cu(t);if(n===null)return;let r=Wl(t),i=null,a=r===null?void 0:Rf.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&lu(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=_u(n,e).anchorNode;if(a!==null&&Qc(a)===r){if(lu(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||wu(e)&&e.shadowRoot!==null||(i=Qc(e))}}if(i===null){let e=Su(r);i=e===null?null:Qc(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&Mf(i,()=>Tp(i,n,e,a));let o=El(i),s=o[o.length-1],c=s._key,l=Ep.get(c),u=l||s;u!==i&&Hf(n,u,!1),Hf(n,i,!0),i===s?l&&Ep.delete(c):Ep.set(c,i)}function Op(e){e._lexicalHandled=!0}function kp(e){return!0===e._lexicalHandled}var Ap=Xr(),jp=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Ih(Sc(fc(this,`next`)),Sc(fc(e,`next`)))<0}getNode(){let e=fl(this.key);return e===null&&U(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,df()||(ul()===a&&ll(e),i!==null&&(i.setCachedNodes(null),X(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function Mp(e,t,n){return new jp(e,t,n)}function Np(e,t){let n=t.__key,r=e.offset,i=`element`;if(q(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!K(t)){let e=t.getNextSibling();if(q(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Pp(e,t){if(K(t)){let n=t.getLastDescendant();K(n)||q(n)?Np(e,n):Np(e,t)}else Np(e,t)}function Fp(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=uc();if(o.setFormat(n),o.setStyle(r),Ic(a))a.splice(0,0,[o]);else if(a!==null){let e=Y(i)?Fc().append(o):o;a.insertBefore(e)}else if(Y(i)){let e=i.getLastChild();K(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(Fc().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function Ip(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(q(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(ul()===null)return e.anchor.type===`element`&&Fp(e.anchor,e.focus,r,i),void Lp(e,t,r,i)}e.anchor.type===`element`&&Fp(e.anchor,e.focus,r,i);let a=e.anchor.getNode();q(a)||U(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(tl(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(ul()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),gf()._inputState.composedSegmentedKey=a.getKey();else{let t=uc(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=Z()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&Z()!==e&&Sl(e)}(t!==``||n)&&Ip(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=xh(a,l).getNodeAtCaret(),d;q(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!tl(u)?d=u:(d=uc().setFormat(r).setStyle(i),xh((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),Ip(e,t,n);return}let l=uc(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void Lp(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function Lp(e,t,n,r){let i=e.anchor.getNode();q(i)||U(398);let a=e.anchor.offset,o=uc(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))xh(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var Rp=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Vp(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>Um(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(q(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=fl(e);t!==null&&n.push(t)}return df()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>Um(e)===null);if((Z()||gm())===this&&e[0]){let t=xh(e[0],`next`);mc(Ph(t,t))}for(let t of e)t.remove();zp()}};function zp(){let e=bl();if(e.getChildrenSize()===0&&qm(Z())===null){let t=Fc();e.append(t),t.select()}}function X(e){return e instanceof Bp}var Bp=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!X(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if(_h(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;K(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),gh(e.focus)&&K(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=Th(e.focus.origin,`previous`);_h(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Dh(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!K(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Sc(e.anchor),r=Sc(e.anchor.getFlipped()),i=e=>hh(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(wc(gc(this),`next`));return df()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=gc(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(K(a)&&!a.isInline()){r||(n+=`
|
|
30
|
+
`);let e=``;for(let t of Ym(a)){let n=Xm(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,q(a)){let e=Dc(t,a);n+=e?e.getTextContent():a.getTextContent()}else(Bs(a)||Vd(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=gf(),n=t.getEditorState()._selection,r=sm(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),ys(this)}clone(){let t=this.anchor,n=this.focus;return new e(Mp(t.key,t.offset,t.type),Mp(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=al(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Vr[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(Tm(e))}insertText(e){Ip(this,e,!1)}removeText(){let e=Z()===this,t=this.anchor.key;hc(this,bc(gc(this))),this.isCollapsed()&&hm(this,t),e&&Z()!==this&&Sl(this)}formatText(e,t=null){Wp(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&K(t)&&t.isShadowRoot()&&Um(t)!==null){let n=t.getFirstChild()??t.append(Fc()).getFirstChild();if(n!==null&&!K(n)){let e=Fc();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=Z();return X(t)||U(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&Y(t)){let n=Am(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=wd(r,ju),a=e[e.length-1];if(K(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=Dm(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(K(e)||Bs(e))&&!e.isInline())){K(i)||U(211,r.constructor.name,r.getType());let[t,n]=Dm(this,!0);(K(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=Am(e),n=t.getLastDescendant(),r=fc(this.anchor,`next`);for(let e of t.getChildren())r=jc(e,r);n!==null&&n.selectEnd();return}if(K(i)&&(Um(i)!==null||!i.isParentRequired()&&!Y(i.getParentOrThrow()))){let[,t]=Dm(this),n=Em(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=Am(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&K(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!ju(e)&&!Y(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return Vd(t)&&Vd(t.getPreviousSibling())}(n),u=K(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=wd(r,ju));let d=c[c.length-1],f=c[0];var p=f;l||!K(p)||!ju(p)||p.isEmpty()||!K(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(K(i)||U(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&U(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||U(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=wd(s,ju),h=s.selectEnd();u&&(K(m)&&(u.canMergeWhenEmpty()||ju(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),K(i)&&i.isEmpty()&&i.remove();let g=K(i)?i.getLastChild():null;Vd(g)&&m!==i&&g.remove();let _=Sc(fc(h.anchor,`next`));pc(h.anchor,_),pc(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&Y(e)){let t=Fc();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Dm(this),n=wd(this.anchor.getNode(),ju);if(n!==null&&Um(n)!==null)return null;K(n)||U(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=Bd();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=gc(this).getTextSlices(),r=[];for(let t of e){let e=Dc(n,t),i=e?Oc(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&q(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(jm(this,e,t,n))return;let r=e===`move`,i=gf(),a=su(Zl(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!K(c)||c.isInline()||c.canBeEmpty()||ou(o,i,s);let l=Hl(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=q(c)?Iu(c,l,i):null),this.dirty){let e=Hl(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=q(n)?Iu(n,e,i):null}t&&u&&xm(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&q(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=xh(c,t?`previous`:`next`).getNodeAtCaret();if(q(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?Iu(e,n,i):null;if(r){let e=t?r.length:0;xm(a,r,e,r,e)}}}}if(qp(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=hu(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=Us(o)?o:$l(o);this.applyDOMRange(n),this.dirty=!0,r||(Jp(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||Kp(this))}n===`lineboundary`&&jm(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&K(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(K(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=K(n)?n.getNextSibling():null;if(!(K(n)&&n.isEmpty()&&K(e)&&e.isShadowRoot()))return}let r=fc(t,e?`previous`:`next`),i=Mh(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(K(e)&&au(e)){let t=e.getParent();e.remove();let n=xl(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(_h(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(K(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Sc(t);hc(this,Ph(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(gh(t)){if(K(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Bs(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&K(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=dm();e.add(t.origin.getKey()),Sl(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=xl(n,e);r!==null&&r.selectStart()}}return}if(Vd(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Ym(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(hc(this,Ph(!t.origin.isEmpty()&&n.isEmpty()?_c(xh(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(Um(e)!==null)return;if(K(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(Yp(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(K(n)){if(n.collapseAtStart(e))return!0;if(Y(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void $p(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void $p(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!Tl(a=i.getTextContent().slice(c,l))&&!Qp(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||Gp(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&zp()}deleteLine(e){Hp(this,e,`lineboundary`)}deleteWord(e){Hp(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return df()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function Vp(e){return e instanceof Rp}function Hp(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=Yp(e,t,n),n===`lineboundary`&&function(e){for(let t of gc(e).iterNodeCarets(`shadowRoot`))if(gh(t)&&Vd(t.origin))return void pc(e.focus,_c(t))}(e)}n!==`lineboundary`||e.isCollapsed()||wd(i.getNode(),ju)===wd(a.getNode(),ju)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||Gp(e),e.removeText())}function Up(e,t){if(Vp(e)){for(let n of e.getNodes())ec(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?gc(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(q(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=Dc(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!tl(l)?Oc(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else K(l)?l.setTextFormat(t(l.getTextFormat())):ec(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),ll(null))}function Wp(e,t,n=null){let r=n===null&&X(e)?al(e.format,t,null):n;Up(e,e=>al(e,t,r))}function Gp(e){let t=bl();!t.isEmpty()&&Mc(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function Kp(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function qp(e,t,n,r,i){let a=r===`character`?_u(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=_u(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function Jp(e,t,n){let r=e.getNodes(),i=r.filter(e=>Yl(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=K(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function Yp(e,t,n){if(jm(e,`extend`,t,n))return!1;let r=gf(),i=su(Zl(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!K(c)||c.isInline()||c.canBeEmpty()||ou(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&q(t)?Iu(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(xm(i,h,g,h,g),qp(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=hu(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&nl(v)&&Qc(v)===r){let e=wl(v);if(Bs(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&q(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=xh(u,t?`previous`:`next`).getNodeAtCaret();if(q(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&gl(v),x=b?Km(u):null,S=b?Km(b):null;if(b&&!im(S,x)&&Xp(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,E]=t?[v,y,d,f]:[d,f,v,y],D=Us(u)?u:$l(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:E,startContainer:C,startOffset:w}),e.dirty=!0,!Jp(e,t,D)&&t&&Kp(e),!1}function Xp(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=Wm(e);n!==null;){let e=Km(n);if(im(e,t))return e!==null||n.isAttached()?n:null;n=e&&Wm(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!K(t))return t!==null&&function(e,t,n){K(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(q(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!K(i)||Y(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function Zp(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var Qp=Zp();function $p(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function em(e,t,n,r){let i,a=t,o=!1;if(wu(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),hl(e,r)!==void 0||Ju(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=wl(d),q(i))a=Ch(i,s?`next`:`previous`);else{let c=wl(e);if(c===null)return null;if(K(c)){let o=r.getElementByKey(c.getKey());o===null&&U(214);let l=Pu(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),K(c)||U(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(K(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=K(u)?u:u.getParentOrThrow()),a=0}q(u)?(i=u,c=null,a=Ch(u,s?`next`:`previous`)):u!==c&&s&&!f&&(K(c)||U(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=Wm(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&wl(e)===c){let n=Pu(c,s,r);n.element===s?t===0&&Bs(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(K(c))return[Mp(c.__key,a,`element`),o]}}else i=wl(e);return q(i)?[Mp(i.__key,Ch(i,a,`clamp`),`text`),o]:null}function tm(e,t,n){let r=e.getNode();if(dl(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=xh(r,a).getNodeAtCaret();if(i===t||!K(o)||!o.isInline()||i&&n){if(i&&!t)q(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(K(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=xh(t,a).getNodeAtCaret();q(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function nm(e){let t=fl(e.key);return t===null?null:Km(t)}function rm(e,t,n){let r=nm(e),i=nm(t);return!im(r,i)&&Xp(t,fl(e.key),r,i,`selection`,n)}function im(e,t){return e===null?t===null:e.is(t)}function am(e){let t=rm(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=Lh(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=Lh(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return Rh(e,t);case`ancestor`:return e.type===`child`&&Um(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&Um(n.a)===null?1:-1;case`branch`:{let e=Um(n.a)&&n.a.getKey(),t=Um(n.b)&&n.b.getKey();if(e&&t){for(let r of Jm(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(fc(e.anchor,`next`),fc(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function om(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function sm(e,t,n,r,i,a){if(e===null||n===null||!Xc(i,e,n))return null;let o=em(e,t,X(a)?a.anchor:null,i);if(o===null)return null;let s=em(n,r,X(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=wl(e),r=wl(n);if(Bs(t)&&Bs(r))return null}let f=i._slotsUsed&&rm(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?om(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>om(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);tm(e,n,r),tm(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function cm(e){return K(e)&&!e.isInline()}function lm(e,t,n,r,i,a){let o=mf(),s=new Bp(Mp(e,t,i),Mp(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function um(){return new Bp(Mp(`root`,0,`element`),Mp(`root`,0,`element`),0,``)}function dm(){return new Rp(new Set)}function fm(e,t){return mm(null,e,t,null)}var pm=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function mm(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&Cu(c),u=c&&(c.ctrlKey||c.metaKey||pm.has(c.key))&&Tu(l)&&Qc(l)===n,d=!ma&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(X(e)&&!d)return e.clone();{if(t===null)return null;let r=_u(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&X(e)&&!Xc(n,f,p))return e.clone()}let g=sm(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=X(e)?e:null,x=new Bp(_,v,b?b.format:0,b?b.style:``);return b&&hm(x,b.anchor.key),x.dirty=y,x}function hm(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;q(r)?(i=r.getFormat(),a=r.getStyle()):K(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function Z(){return mf()._selection}function gm(){return gf()._editorState._selection}function _m(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function vm(e,t,n,r=1){if(_m(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(K(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);q(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function ym(e,t,n,r,i){let a=r||i;if(q(a)||K(a)){let t=q(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function bm(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function xm(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Sm(e,t,n){let r=Hl(e,t.getKey());if(K(t)){let i=Pu(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Cm(e,t,n,r,i,a){let o=a.getRootNode(),s=rl(o)||lu(o)?Su(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&Jc(s,s))return;let c=_u(r,a),l;if(!X(t))return void(e!==null&&Xc(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Sm(n,f,u.offset),[g,_]=Sm(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=q(f)?Iu(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):X(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=q(p)?Iu(p,g,n):null),x===null||S===null)return;let w=b&&q(p)&&dl(p)&&nl(S)&&S.nodeValue===Rr?Rr.length:_;if(b&&(e===null||C||X(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:Qc(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(xm(r,x,h,S,w),Er&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=xu(a);if(e===null||!a.contains(e)){let e=Su(a.ownerDocument),t=e===null?null:Qc(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===xu(a)){let e=X(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!wu(r))return r||null;let i=hl(r,e),a=i===void 0?null:fl(i);return a===null||K(a)?r:Pu(a,r,e).element}(n,x,h):(l===void 0&&(l=gu(r,a)),l);if(e!==null){let t;if(nl(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=wu(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!nl(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=Wl(n),a=Xl(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=wu(r)?r:Ul(r);for(;o!==null&&n.contains(o);){let t=Kl(a,o,e,i);e-=t,i-=t,o=o===n?null:Ul(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=Zl(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=Ul(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function wm(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
31
|
+
`||n===`\r
|
|
32
|
+
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Tm(e){let t=[];return wm(e,{linebreak:()=>t.push(Bd()),tab:()=>t.push(zc()),text:e=>t.push(uc(e))}),t}function Em(e){let t=[];for(let n of e)Vd(n)||(!K(n)&&!Bs(n)||n.isInline()?t.push(n):K(n)&&t.push(...Em(n.getChildren())));return t}function Dm(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=Z();X(r)&&(n=r),X(n)||U(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!ju(a)&&Um(a)===null;){let e=a;if([a,o]=Om(a,o,t),e.is(a))break}return[a,o]}function Om(e,t,n=!1){let r=e.getParent();if(!r){let e=Fc();return bl().append(e),e.select(),[bl(),0]}if(q(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!K(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new Bp(Mp(e.__key,t,`element`),Mp(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function km(e){return Vd(e)||Ql(e)||q(e)||e.isParentRequired()}function Am(e){let t=Fc(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(km(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(Vd(i)&&(a===void 0||!km(a)))continue}n.append(i)}else t.append(i),n=null}return t}function jm(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=fc(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!Cc(c)){for(let e of c){l=!1;let{origin:t}=e;if(Bs(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of Mh(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(_h(e))e.origin.isInline()||(c=e);else{if(K(e.origin))continue;Bs(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Bs(c.origin)&&c.origin.isKeyboardSelectable()){let e=dm();return e.add(c.origin.getKey()),Sl(e),!0}return c=Sc(c),s&&pc(e.anchor,c),pc(e.focus,c),l||!o}function Mm(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function Nm(e){let t=gf();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=mf(),r=t._movedNodes||=new WeakMap,i=r.get(n);i===void 0&&(i=new Set,r.set(n,i)),i.add(e.__key)}}function Pm(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function Fm(e){Um(e)!==null&&U(380,e.__key,String(Um(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();Nm(e);let r=e.getPreviousSibling(),i=e.getNextSibling();Mm(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function Im(e,t){let n=t&&e.getParent(),r=t&&n&&_m(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),Fm(e),t&&n&&r!==-1&&vm(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function Lm(e,t,n,r){ff();let i=t===`next`;ru(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=Z(),c=r&&X(s)?s:null,l=Im(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||_m(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(Pm(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(vm(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function Rm(e,t,n){ff();let{origin:r,direction:i}=e,a=i===`next`,o=Wm(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(K(s))return a?s.select(0,0):s.select();if(q(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function zm(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var Bm=new Map;function Vm(e){return K(e)||Bs(e)}function Hm(e){return K(e)||Bs(e)}function Um(e){let t=e.getLatest();return Hm(t)?t.__slotHost:null}function Wm(e){let t=Um(e);if(t===null)return null;let n=fl(t);return K(n)||Bs(n)||U(370),n}function Gm(e){let t=Wm(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of Jm(t))if(r===n)return e;return null}function Km(e){let t=e.getLatest();for(;t!==null;){if(Um(t)!==null)return t;t=t.getParent()}return null}function qm(e){if(e===null)return null;let t=X(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Km(t)}function Jm(e){let t=e.getLatest();return Vm(t)&&t.__slots!==null?t.__slots:Bm}function Ym(e){return Array.from(Jm(e).keys())}function Xm(e,t){let n=Jm(e).get(t);return n===void 0?null:fl(n)}var Zm=[`__proto__`,`constructor`,`prototype`],Qm=Symbol(`slotMapOwner`);function $m(e){let t=e.__slots;return t!==null&&t[Qm]===e||(t=new Map(t),t[Qm]=e,e.__slots=t),t}var eh=new WeakMap,th=[];function nh(e){for(let{ownNodeConfig:t}of Sd(e)){let e=t&&t.slots;if(e)return e}return th}function rh(e){let t=``;for(let n of Jm(e).values()){let e=fl(n);e!==null&&(t+=e.getTextContent())}return t}function ih(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function ah(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||U(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!K(n)&&!Bs(n)||n.isInline())&&U(374,n.__key);let i=e.getWritable(),a=$m(i),o=a.get(t);o!==void 0&&oh(o);let s=n.getWritable(),c=Wm(s);if(c!==null){let e=Gm(s);e!==null&&$m(c.getWritable()).delete(e),s.__slotHost=null}return Fm(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=eh.get(e);if(t===void 0){let n=nh(e),r=new Map;for(let t of n)Zm.includes(t)&&U(371,e.name,t),r.has(t)&&U(372,e.name,t),r.set(t,r.size);t=r,eh.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&ih(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>ih(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),gf()._slotsUsed=!0,mf()._slotsUsed=!0,i}function oh(e){let t=fl(e);if(t===null)return;let n=t.getWritable();Hm(n)||U(377,e),n.__slotHost=null,n.remove()}var sh={next:`previous`,previous:`next`},ch=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Fh({hasNext:gh,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return xh(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return xh(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&U(263,Array.from(o).join(` `))}else i.insert(e);i=xh(e,this.direction)}for(let e of o.values())e.remove();return this}},lh=class e extends ch{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Th(e,this.direction)}getParentCaret(e=`root`){return xh(fh(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=dh(this.direction);return xh(this.getNodeAtCaret(),e)||Th(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},uh={root:Us,shadowRoot:Y};function dh(e){return sh[e]}function fh(e,t=`root`){return e===null||uh[t](e)?null:Um(e)===null?e:null}var ph=class e extends ch{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:xh(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return K(this.origin)?Th(this.origin,this.direction):null}getParentCaret(e=`root`){return xh(fh(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=dh(this.direction);return xh(this.getNodeAtCaret(),e)||Th(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof mh)&&this.direction===t.direction&&this.origin.is(t.origin)}},mh=class e extends ch{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Sh(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return xh(fh(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Sh(this.origin,dh(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof ph||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return xh(this.origin,this.direction)}};function hh(e){return e instanceof mh}function gh(e){return e instanceof ph}function _h(e){return e instanceof lh}var vh={next:class extends mh{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends mh{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},yh={next:class extends ph{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ph{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},bh={next:class extends lh{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lh{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function xh(e,t){return e?new yh[t](e):null}function Sh(e,t,n){return e?new vh[t](e,Ch(e,n)):null}function Ch(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&vr(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function wh(e,t){return new kh(e,t)}function Th(e,t){return K(e)?new bh[t](e):null}function Eh(e){return e&&e.getChildCaret()||e}function Dh(e){return e&&Eh(e.getAdjacentCaret())}var Oh=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return hh(e)&&hh(t)&&e.isSameNodeCaret(t)?[wh(e,t.offset-e.offset),null]:[hh(e)?Ah(e,`anchor`):null,hh(t)?Ah(t,`focus`):null]}iterNodeCarets(e=`root`){let t=hh(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=hh(n),i=t=>t.isSameNodeCaret(n)?null:Dh(t)||t.getParentCaret(e);return Fh({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},kh=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Sh(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Ah(e,t){let{direction:n,origin:r}=e;return wh(e,Ch(r,t===`focus`?dh(n):n)-e.offset)}function jh(e,t){return e.direction===t?e:e.getFlipped()}function Mh(e){return Ph(e,jh(Th(bl(),dh(e.direction)),e.direction))}function Nh(e){return Ph(e,e)}function Ph(e,t){return e.direction!==t.direction&&U(265),new Oh(e,t,e.direction)}function Fh(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function Ih(e,t){let n=Hh(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return Rh(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return zh(n)}}function Lh(e){return e.getParent()||Wm(e)}function Rh(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function zh(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function Bh(e,t){return t.is(e)}function Vh(e){return K(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Hh(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=Vh(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Vh(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(Bh(e,r)||U(276),{commonAncestor:r,type:`ancestor`}):i===null?(Bh(t,r)||U(277),{commonAncestor:r,type:`descendant`}):((K(a)||Bh(e,a))&&(K(i)||Bh(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||U(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Uh(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Wh(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Gh(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var Kh={tag:Nd};function qh(){let e=bl();e.isEmpty()&&e.append(Fc())}var Jh={config:{setOptions:Kh,updateOptions:Kh},init:({$initialEditorState:e=qh})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Ad(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[Hs,tc,Rd,Rc,Nc]};function Yh(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Xh(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Zh=Xh(),Qh=new Set([`__proto__`,`constructor`,`prototype`]);function $h(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!Qh.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=$h(n[e],r[e]));return e}return t}function eg(e){return e.id===0}function tg(e){return e.id===2}var ng=new Set,rg=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Uh;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;tg(t)||Yh(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&Yh(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&Yh(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&Yh(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&Yh(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&Yh(311),this._signal}getInitResult(){this.extension.init===void 0&&Yh(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||Yh(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||Yh(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Yh(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Yh(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||Yh(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ng}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||Yh(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},ig=Symbol.for(`@lexical/extension/LexicalBuilder`);function ag(){}function og(e){throw e}function sg(e){return Array.isArray(e)?e:[e]}var cg=Zh,lg=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=cg,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[sg(Jh)];for(let e of t)n.push(sg(e));return new e(n)}static maybeFromEditor(t){let n=t[ig];return n&&(n.PACKAGE_VERSION!==cg&&Yh(292,n.PACKAGE_VERSION,cg),n instanceof e||Yh(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Yh(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(Yd({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[ig]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=ag;function t(){try{e()}finally{e=ag}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Nf(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Yh(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Yh(296);let[t]=sg(e);typeof t.name!=`string`&&Yh(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Yh(298,t.name),!n){n=new rg(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Yh(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Yh(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=sg(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(tg(i))return;let a=n.extension.name;var o;eg(i)||Yh(300,a,r||`[unknown]`),eg(o=i)||Yh(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||Yh(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())eg(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Yh(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Nf(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of Gh(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Yh(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&$h(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=og,e}};function ug(e,t){let n=lg.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function dg(e){let t=Mu().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function fg(e){let t=Us(e)?e:e.getParent();return t&&dg(t)}function pg(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!tl(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!X(e)||i.type!==`element`&&a.type!==`element`?void 0:Dc(gc(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=Vu(t)),t.__text=l)}return t}function mg(e){let t=hg(e);return t!==null&&t.writingMode===`vertical-rl`}function hg(e){let t=e.anchor.getNode();return K(t)?dg(t):fg(t)}function gg(e,t){let n=mg(e)?!t:t;vg(e)&&(n=!n);let r=fc(e.focus,n?`previous`:`next`);if(Cc(r))return!1;if(hh(r)&&!Bc(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(q(e)&&!Bc(e))return!0}for(let e of Mh(r)){if(_h(e))return!e.origin.isInline();if(!K(e.origin)){if(Bs(e.origin))return!0;break}}return!1}function _g(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function vg(e){let t=hg(e);return t!==null&&t.direction===`rtl`}function yg(e,t,n){let r=vg(e),i;i=mg(e)||r?!n:n,_g(e,t,i,`character`)}function bg(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function xg(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Sg;function Cg(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function wg(e){return Sg&&Sg.editor===e?Sg:void 0}function Tg(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(Cg(e,n))]}return t}function Eg(e,t){let n=t;for(let r of e){let[e,i]=Tg(n,r),a=e.key;if(n===t&&Cg(n,e)===i)continue;let o=n===t||n===void 0?Dg(t):n;o[a]=i,n=o}return n}function Dg(e){return Object.create(e||null)}function Og(e,t){return[e,t]}function kg(e,t,n,r=Mu()){let i=Sg,a=wg(r);try{return Sg={...a,editor:r,[e]:t},n()}finally{Sg=i}}function Ag(e,t=()=>{}){return(n,r=Mu())=>i=>{let a=wg(r),o=a&&a[e],s=Eg(n,o||t(r));return s&&s!==o?kg(e,s,i,r):i()}}function jg(e,t,n,r){return Object.assign(Za(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var Mg=`@lexical/html/DOM`,Ng=Symbol.for(`@lexical/html/DOMExportContext`);function Pg(e,t,n){return jg(Ng,e,t,n)}var Fg=Pg(`isExport`,Boolean);function Ig(e){let t=ug(e,Mg);return t?t.output.defaults:void 0}function Lg(e){let t=ug(e,Mg);return t?t.output.runtime:void 0}function Rg(e=Mu()){let t=Lg(e);return t?t.getSessionConfig():Nu(e)}var zg=Ag(Ng,Ig);function Bg(e,t=null,n=Mu()){return zg([Og(Fg,!0)],n)(()=>{let r=bl(),i=Rg(n),a=qm(t),o=e.append.bind(e);for(let e of(K(a)?a:r).getChildren())Hg(n,e,o,t,i);return e})}function Vg(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&xg(338),hf(e),Bg(mu().createElement(`div`),t,e).innerHTML}function Hg(e,t,n,r=null,i=Nu(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&q(t)&&(s=pg(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=mu().createDocumentFragment(),p=d?d():K(s)?s.getChildren():[],m=a&&Vp(r)&&K(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=Hg(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((wu(c)||Eu(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(Vd(t)&&wu(e)&&Au(e)&&n!==null&&n.nodeName===`BR`){let t=mu().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Eu(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function Ug(e,t,n=null){let r=pu(n),i=n?du(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=Ul(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(lu(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function Wg(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Gg(e,t=Z()){return t??Wg(166),X(t)&&t.isCollapsed()||t.getNodes().length===0?``:Vg(e,t)}function Kg(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var qg=`application/x-lexical-drag`;function Jg(e,t){let n={editorKey:t.getKey()};e.setData(qg,JSON.stringify(n))}function Yg(e){let t=e;if(hh(t)){if(t.offset===0)t=_c(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(_h(t))t=_c(xh(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=xh(e,`next`)}}}function Xg(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(qg);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=Ug(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=gl(n.node);if(r===null)return null;if(q(r))return Sh(r,`next`,n.offset);let i=r.getParent();if(K(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=Pu(r,e,t);return n.node===a.element||i?Tc(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&Tc(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=Z();if(o){if(!X(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=wc(gc(t),`next`),i=Yg(e);return Ih(Yg(n),i)<=0&&Ih(i,Yg(r))<=0}(a,s))return e.preventDefault(),!0}let c=Sc(a),l=hh(c)?Ac(c):c;if(l===null)return!1;let u=l.getFlipped();o&&X(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||Wg(438),n(r,mc(Nh(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of fu(t)){let t=$c(n);if(Zc(t)&&t.getKey()===e&&wu(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function Zg(e,t){return Xg(e,t,(e,t)=>Kg(e,t))}function Qg(e,t){t.update(()=>{if(e!==null){let n=bg(e,KeyboardEvent)?null:e.clipboardData,r=Z();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=Gg(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function $g(e){return Nf(e.registerCommand(ri,e=>{let t=Z();return!!X(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(li,e=>{let t=Z();return!!X(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(ui,e=>{let t=Z();return!!X(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(oi,e=>{let t=Z();if(!X(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)Kg(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(ci,()=>{let e=Z();return!!X(e)&&(e.removeText(),!0)},0),e.registerCommand(ii,e=>{let t=Z();return!!X(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(ai,()=>{let e=Z();return!!X(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(_i,e=>{let t=Z();if(!X(t))return!1;let n=e,r=n.shiftKey;return!!gg(t,!0)&&(n.preventDefault(),yg(t,r,!0),!0)},0),e.registerCommand(hi,e=>{let t=Z();if(!X(t))return!1;let n=e,r=n.shiftKey;return!!gg(t,!1)&&(n.preventDefault(),yg(t,r,!1),!0)},0),e.registerCommand(Ci,t=>!!X(Z())&&(!Ar||!Or)&&(t.preventDefault(),e.dispatchCommand(ri,!0)),0),e.registerCommand(Ti,t=>!!X(Z())&&(t.preventDefault(),e.dispatchCommand(ri,!1)),0),e.registerCommand(xi,t=>{if(!X(Z()))return!1;if(t!==null){if((Ar||Mr||Fr)&&Or)return!1;t.preventDefault()}return e.dispatchCommand(ii,!1)},0),e.registerCommand(Ni,()=>{let e=Z();return Fl(X(e)&&Km(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(ji,t=>!(!X(Z())||Yc(t)||(Qg(t,e),0)),0),e.registerCommand(Mi,t=>!(!X(Z())||Yc(t)||(function(e,t){Qg(e,t),t.update(()=>{let e=Z();X(e)&&e.removeText()},{tag:`cut`})}(t,e),0)),0),e.registerCommand(si,t=>!(!X(Z())||Yc(t)||(function(e,t){e.preventDefault(),t.update(()=>{let t=Z(),n=bg(e,ClipboardEvent)?e.clipboardData:null;n!=null&&X(t)&&Kg(n,t)},{tag:`paste`})}(t,e),0)),0),e.registerCommand(Di,t=>Zg(t,e),0),e.registerCommand(Oi,t=>{let n=Z();return!!X(n)&&(n.isCollapsed()||t.dataTransfer===null||Jg(t.dataTransfer,e),!0)},0))}function e_(e){return JSON.stringify([e.exportJSON(),K(e)?e.getChildrenKeys():null])}function t_(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(Id);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(X(a)&&X(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||Us(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&q(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!q(l)||!q(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(Md),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>e_(e))===n.read(()=>e_(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(X(a)&&X(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!q(r)||!q(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function n_(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function r_(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function i_(e,t,n,r=Date.now,i,a=null){let o=t_(e,n,r),s=()=>{i&&i(t)};return s(),Nf(e.registerCommand(fi,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=n_(o,a);t!==null&&(r.push(t),e.dispatchCommand(Ii,!0))}i.length===0&&e.dispatchCommand(Li,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(pi,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=n_(o,a);t!==null&&(i.push(t),e.dispatchCommand(Li,!0))}r.length===0&&e.dispatchCommand(Ii,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Pi,()=>(r_(t,i),!1),0),e.registerCommand(Fi,()=>(r_(t,i),e.dispatchCommand(Ii,!1),e.dispatchCommand(Li,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Ii,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Li,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function a_(){return{current:null,redoStack:[],undoStack:[]}}function o_({editor:e,editable:t,...n}){let r=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{let t=r.current;if(e!==null&&t!==null)return e.setRootElement(t),()=>{e.setRootElement(null)}},[e]),(0,O.useLayoutEffect)(()=>{e!==null&&e.setEditable(t)},[e,t]),(0,z.jsx)(`div`,{ref:r,contentEditable:e!==null&&t,suppressContentEditableWarning:!0,role:`textbox`,"aria-multiline":`true`,"data-composer-input":!0,...n})}var s_=`color: var(--dsw-alias-state-business-primary)`;function c_(){let e=bl().getFirstChild();if(!K(e))return null;let t=e.getFirstChild();return q(t)?t:null}function l_(e,t){return e.registerNodeTransform(tc,e=>{let n=c_();if(n===null||e.getKey()!==n.getKey()){e.getStyle()===s_&&e.setStyle(``);return}let r=e.getTextContent(),i=t(),a=r===i?.trimEnd()?r:i;if(a===null||!r.startsWith(a))e.getStyle()===s_&&e.setStyle(``);else if(r.length>a.length){let[t]=e.splitText(a.length);t!==void 0&&t.getStyle()!==s_&&t.setStyle(s_)}else e.getStyle()!==s_&&e.setStyle(s_)})}function u_(e){e.update(()=>{c_()?.markDirty()})}var d_=(0,O.forwardRef)(function(e,t){let n=(0,O.useRef)(e);n.current=e;let[r]=(0,O.useState)(()=>Yd({namespace:`pi-composer`,onError:e=>{throw e}})),[i,a]=(0,O.useState)(!1);return(0,O.useImperativeHandle)(t,()=>({focus:()=>{r.getRootElement()?.focus({preventScroll:!0}),r.focus()}}),[r]),(0,O.useLayoutEffect)(()=>{let e=()=>{let e=r.getRootElement();return e&&!e.contains(e.ownerDocument.activeElement)&&ql(Pd),!1},t=[r.registerCommand(zi,()=>(r.update(e,{discrete:!0}),!1),4),r.registerCommand(Zr,e,4),r.registerNodeTransform(Hs,e),$g(r),i_(r,a_(),1e3),l_(r,()=>n.current.claimToken),r.registerUpdateListener(({editorState:e,dirtyElements:t,dirtyLeaves:r})=>{if(t.size===0&&r.size===0)return;let i=e.read(()=>bl().getTextContent());i!==n.current.value&&n.current.onChange(i)})];return()=>{for(let e of t)e()}},[r]),(0,O.useLayoutEffect)(()=>{(r.getEditorState().read(()=>bl().getTextContent())!==e.value||r.getEditorState().isEmpty())&&(r.update(()=>{let t=bl(),n=r.getRootElement()?.contains(document.activeElement);n||ql(Pd);let i=Fc();for(let[t,n]of e.value.split(`
|
|
33
|
+
`).entries())t&&i.append(Bd()),n&&i.append(uc(n));t.clear().append(i),n&&i.selectEnd()},{discrete:!0}),e.value||r.dispatchCommand(Fi,void 0))},[r,e.value]),(0,O.useLayoutEffect)(()=>{u_(r)},[r,e.claimToken]),(0,z.jsx)(`div`,{className:wt.scroll,"data-input-scroll":!0,children:(0,z.jsxs)(`div`,{className:wt.grow,children:[(0,z.jsx)(o_,{editor:r,editable:e.editable,className:wt.input,"aria-label":e.ariaLabel,"aria-disabled":!e.editable||void 0,"aria-haspopup":`listbox`,"aria-expanded":e.menuOpen,"aria-activedescendant":e.activeOption,"data-phase":e.claimToken?`claimed`:`plain`,"data-placeholder":e.placeholder,"data-composer-composing":i||void 0,style:e.hint===null?void 0:{"--dsh-composer-hint":JSON.stringify(e.hint)},onKeyDownCapture:t=>{e.onKeyDown(t),t.defaultPrevented&&t.stopPropagation()},onPasteCapture:t=>{e.onPaste(t),t.defaultPrevented&&t.stopPropagation()},onCompositionStart:()=>a(!0),onCompositionEnd:()=>a(!1)}),e.value===``&&(0,z.jsx)(`div`,{"aria-hidden":!0,className:wt.placeholder,"data-composer-placeholder":!0,children:e.placeholder})]})})});function f_(e,t){return typeof e==`string`?e:e?.[t]}function p_(e,t,n,r){let i=new Map;for(let n of[...e,...t.map(e=>({...e,section:`commands`}))])i.has(n.name)||i.set(n.name,{...n,section:n.section??`commands`});for(let e of n){for(let t of e.definition.commands??[])i.set(t.id,{name:t.id,label:f_(t.presentation?.label,r)??t.title,description:f_(t.presentation?.description,r)??t.description,icon:t.presentation?.icon,section:t.presentation?.section??`commands`,input:t.input,pluginId:e.id,action:t.action});for(let t of e.definition.menuItems??[])t.menu===`composer`&&i.set(`${e.id}:${t.id}`,{name:t.title,label:t.title,section:`add`,pluginId:e.id,action:t.action,menuOnly:!0})}return[...i.values()].sort((e,t)=>Number(t.section===`add`)-Number(e.section===`add`))}function m_(e){let t=e.input?.token;return[e.name,...typeof t==`string`?[t]:t?[t.zh,t.en]:[]]}function h_(e,t){let n=/^\/(\S+)(?:\s([\s\S]*))?$/.exec(e.trimStart());if(!n)return;let r=t.find(e=>!e.menuOnly&&e.name===n[1])??t.find(e=>!e.menuOnly&&m_(e).includes(n[1]));return r?{command:r,token:`/${n[1]}`,text:(n[2]??``).trim()}:void 0}function g_(e,t,n){let r=t.toLocaleLowerCase();return e.filter(e=>(!n||!e.menuOnly)&&[...m_(e),e.label??``].some(e=>e.toLocaleLowerCase().includes(r)))}function __(e,t,n,r,i){if(!(!t||t.idle&&(r.trim()||i))){for(let r of e){let e=r.definition.composerAction?.(t,n);if(!(!e||(t.idle?e.kind!==`invoke`:e.kind!==`stop`)))return{...e,pluginId:r.id,sessionId:t.sessionId}}if(!t.idle)return{kind:`stop`,sessionId:t.sessionId,label:n===`zh`?`暂停执行`:`Pause`,title:n===`zh`?`暂停当前执行,保留已有进度`:`Pause execution and keep existing progress`};if(t.paused)return{kind:`resume`,sessionId:t.sessionId,label:n===`zh`?`继续执行`:`Continue`,title:n===`zh`?`基于已有进度继续执行`:`Continue from existing progress`}}}async function v_(e,t,n,r,i,a){if(i()!==e.sessionId)throw Error(`Session changed`);if(e.kind===`stop`)return r();if(e.kind===`resume`){if(!a)throw Error(`Resume is unavailable`);return a()}if(!e.pluginId)throw Error(`Missing plugin for composer action`);let o=await t(e.pluginId,e.action,e.input);if(i()!==e.sessionId)throw Error(`Session changed`);if(!e.sendResultMessage)return;let s=o?.message;if(typeof s!=`string`||!s.trim())throw Error(`Plugin action did not return a message`);await n(s)}var y_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M2.37091 11.2501C1.58745 9.89288 1.32067 8.29835 1.61969 6.76006C1.91872 5.22177 2.76342 3.8433 3.99826 2.87846C5.2331 1.91362 6.77494 1.42737 8.33988 1.50925C9.90482 1.59113 11.3875 2.23562 12.5149 3.32406C13.6425 4.41269 14.3387 5.87206 14.4754 7.4334C14.612 8.99474 14.18 10.5529 13.2587 11.8209C12.3375 13.0888 10.9891 13.9813 9.46194 14.3337C8.18691 14.628 6.85895 14.5294 5.64989 14.0605C5.1712 13.8748 4.76962 13.4932 4.26534 13.3967C3.67413 13.2835 2.95257 13.5598 2.03794 14.3337`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M8 5V11`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M5 8H11`,stroke:`currentColor`})]}),b_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M5 6.75H11`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M5 9H8`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.37067 11.2497C1.5872 9.89252 1.32042 8.29798 1.61945 6.7597C1.91847 5.22141 2.76317 3.84293 3.99801 2.87809C5.23285 1.91325 6.7747 1.427 8.33964 1.50888C9.90458 1.59076 11.3873 2.23526 12.5147 3.32369C13.6422 4.41232 14.3384 5.8717 14.4751 7.43304C14.6118 8.99438 14.1797 10.5525 13.2585 11.8205C12.3372 13.0885 10.9889 13.9809 9.4617 14.3334C8.18666 14.6277 6.8587 14.529 5.64964 14.0601C5.17095 13.8745 4.76937 13.4929 4.26509 13.3963C3.67389 13.2832 2.95232 13.5595 2.0377 14.3334`,stroke:`currentColor`})]}),x_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M7.99986 14.0887C11.3626 14.0887 14.0886 11.3627 14.0886 7.99998C14.0886 4.63727 11.3626 1.91125 7.99986 1.91125C4.63715 1.91125 1.91113 4.63727 1.91113 7.99998C1.91113 11.3627 4.63715 14.0887 7.99986 14.0887Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.34619 8H13.6538`,stroke:`currentColor`,strokeLinecap:`square`}),(0,z.jsx)(`path`,{d:`M7.99976 14.0889C9.23509 14.0889 10.1743 11.3629 10.1743 8.00006C10.1743 4.63739 9.23509 1.91138 7.99976 1.91138`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.99973 14.0889C6.76445 14.0889 5.8252 11.3629 5.8252 8.00006C5.8252 4.63739 6.76445 1.91138 7.99973 1.91138`,stroke:`currentColor`})]}),S_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M4.67398 4.25061L1.36094 7.86484C1.29085 7.9413 1.29085 8.05866 1.36094 8.13513L4.67398 11.7494`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M11.3262 4.25061L14.6392 7.86484C14.7093 7.9413 14.7093 8.05866 14.6392 8.13513L11.3262 11.7494`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M9.56222 3.62573L6.43774 12.3743`,stroke:`currentColor`})]}),C_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M1.50439 3.11059C1.50439 2.55831 1.95211 2.1106 2.50439 2.1106H5.43389C5.67773 2.1106 5.91318 2.19969 6.09593 2.36113L7.71649 3.79265C7.89924 3.95409 8.1347 4.04319 8.3785 4.04319H13.4958C14.0481 4.04319 14.4958 4.4909 14.4958 5.04319V12.8894C14.4958 13.4417 14.0481 13.8894 13.4958 13.8894H2.50439C1.95211 13.8894 1.50439 13.4417 1.50439 12.8894V4.04319V3.11059Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M3.63501 7.66614H12.3647`,stroke:`currentColor`})]}),w_=1.3,T_=e=>(0,z.jsx)(y_,{...e,strokeWidth:1}),E_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M6.58727 11.8586C9.55061 11.8586 11.9529 9.45637 11.9529 6.49304C11.9529 3.5297 9.55061 1.12744 6.58727 1.12744C3.62394 1.12744 1.22168 3.5297 1.22168 6.49304C1.22168 9.45637 3.62394 11.8586 6.58727 11.8586Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M10.2991 10.3933L14.7783 14.8725`,stroke:`currentColor`})]}),D_=e=>(0,z.jsx)(E_,{...e,strokeWidth:1}),O_=e=>(0,z.jsx)(x_,{...e,strokeWidth:1}),k_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M13.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V13.5C1.5 14.0523 1.94772 14.5 2.5 14.5H13.5C14.0523 14.5 14.5 14.0523 14.5 13.5V2.5C14.5 1.94772 14.0523 1.5 13.5 1.5Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M5.5 1.5V14.5`,stroke:`currentColor`})]}),A_=e=>(0,z.jsx)(k_,{...e,strokeWidth:1}),j_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M8 2V14`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M2 8H14`,stroke:`currentColor`})]}),M_=e=>(0,z.jsx)(j_,{...e,strokeWidth:1}),N_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M2.25 8.5L5.49732 11.7473C5.90519 12.1552 6.57263 12.1344 6.95426 11.7018L13.75 4`,stroke:`currentColor`})}),P_=e=>(0,z.jsx)(N_,{...e,strokeWidth:1}),F_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M1.01503 8.0001L5.6964 8.0001C6.41913 8.0001 6.78049 8.0001 7.12115 7.91951C7.4232 7.84804 7.71233 7.73014 7.97821 7.57C8.27809 7.38939 8.5364 7.13669 9.05303 6.63129L11.3281 4.40564`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M1.01221 7.9999L5.6964 7.9999C6.41913 7.9999 6.78049 7.9999 7.12115 8.08049C7.4232 8.15196 7.71233 8.26986 7.97821 8.43C8.27809 8.61061 8.5364 8.86331 9.05303 9.36871L11.3281 11.5944`,stroke:`currentColor`}),(0,z.jsx)(`circle`,{cx:`12.4502`,cy:`3.3079`,r:`1.56962`,stroke:`currentColor`}),(0,z.jsx)(`circle`,{cx:`12.4502`,cy:`12.6921`,r:`1.56962`,stroke:`currentColor`})]}),I_=e=>(0,z.jsx)(F_,{...e,strokeWidth:1}),L_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6`,stroke:`currentColor`})}),R_=e=>(0,z.jsx)(L_,{...e,strokeWidth:1}),z_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M10 4L6.70711 7.29289C6.31658 7.68342 6.31658 8.31658 6.70711 8.70711L10 12`,stroke:`currentColor`})}),B_=e=>(0,z.jsx)(z_,{...e,strokeWidth:1}),V_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M6 12L9.29289 8.70711C9.68342 8.31658 9.68342 7.68342 9.29289 7.29289L6 4`,stroke:`currentColor`})}),H_=e=>(0,z.jsx)(V_,{...e,strokeWidth:1}),U_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M12 10L8.70711 6.70711C8.31658 6.31658 7.68342 6.31658 7.29289 6.70711L4 10`,stroke:`currentColor`})}),W_=e=>(0,z.jsx)(U_,{...e,strokeWidth:1}),G_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M2.5 2.5L13.5 13.5`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M13.5 2.5L2.5 13.5`,stroke:`currentColor`})]}),K_=e=>(0,z.jsx)(G_,{...e,strokeWidth:1}),q_=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M3.5 3.5L12.5 12.5`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M12.5 3.5L3.5 12.5`,stroke:`currentColor`})]}),J_=e=>(0,z.jsx)(q_,{...e,strokeWidth:1}),Y_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`rect`,{x:`1.52075`,y:`4.07373`,width:`10.3932`,height:`10.3932`,rx:`2`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M11.9792 1.53296C13.36 1.53296 14.4792 2.65225 14.4792 4.03296V9.42847C14.4792 10.3756 13.9521 11.1987 13.1755 11.6228V10.3298C13.3652 10.0787 13.4792 9.7674 13.4792 9.42847V4.03296C13.4792 3.20453 12.8077 2.53296 11.9792 2.53296H6.58374C6.27966 2.53301 5.99684 2.6235 5.7605 2.77905H4.42358C4.85652 2.03463 5.66056 1.53304 6.58374 1.53296H11.9792Z`,fill:`currentColor`})]}),X_=e=>(0,z.jsx)(Y_,{...e,strokeWidth:1}),Z_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M14.5001 8C14.5 9.28552 14.1188 10.5422 13.4045 11.611C12.6903 12.6799 11.6752 13.5129 10.4875 14.0049C9.29982 14.4968 7.99295 14.6255 6.73212 14.3747C5.4713 14.124 4.31314 13.505 3.4041 12.596C2.49514 11.687 1.87614 10.5288 1.62537 9.26798C1.37459 8.00716 1.50331 6.70028 1.99525 5.51261C2.48719 4.32494 3.32025 3.30981 4.3891 2.59557C5.45795 1.88134 6.71458 1.50008 8.0001 1.5C9.9001 1.5 11.7001 2.3 13.0001 3.6L14.5001 5.1`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M14.4999 1.5V5.1H10.8999`,stroke:`currentColor`})]}),Q_=e=>(0,z.jsx)(Z_,{...e,strokeWidth:1}),$_=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M8.85596 2.69971H4.19971C3.37141 2.69971 2.69992 3.37146 2.69971 4.19971V11.8003C2.69992 12.6285 3.37141 13.3003 4.19971 13.3003H11.8003C12.6283 13.2999 13.3001 12.6283 13.3003 11.8003V7.89893H14.3003V11.8003C14.3001 13.1806 13.1806 14.2999 11.8003 14.3003H4.19971C2.81913 14.3003 1.69992 13.1808 1.69971 11.8003V4.19971C1.69992 2.81918 2.81913 1.69971 4.19971 1.69971H8.85596V2.69971Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.7849 8.23878L13.888 2.13574`,stroke:`currentColor`})]}),ev=e=>(0,z.jsx)($_,{...e,strokeWidth:1}),tv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M11.7256 2.77441C12.5538 2.77469 13.2256 3.44616 13.2256 4.27441V10.1416H12.2256V4.27441C12.2256 3.99844 12.0015 3.77469 11.7256 3.77441H5.7207V2.77441H11.7256Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.77441 13.2255L12.3756 3.62427`,stroke:`currentColor`})]}),nv=e=>(0,z.jsx)(tv,{...e,strokeWidth:1}),rv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M1.28149 3.88831H14.7187`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M5.41602 3.88833V2.47962C5.41602 2.29282 5.52492 2.11366 5.71876 1.98157C5.9126 1.84948 6.17551 1.77527 6.44964 1.77527H9.55053C9.82466 1.77527 10.0876 1.84948 10.2814 1.98157C10.4753 2.11366 10.5842 2.29282 10.5842 2.47962V3.88833`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.57349 3.88831L3.19366 13.2943C3.21937 13.5502 3.33952 13.7872 3.53065 13.9593C3.72178 14.1313 3.97016 14.2259 4.22729 14.2246H11.7728C12.0299 14.2259 12.2783 14.1313 12.4694 13.9593C12.6605 13.7872 12.7807 13.5502 12.8064 13.2943L13.4266 3.88831`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M6.44946 6.98926V11.1238`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M9.55054 6.98926V11.1238`,stroke:`currentColor`})]}),iv=e=>(0,z.jsx)(rv,{...e,strokeWidth:1}),av=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,z.jsx)(`path`,{d:`M6.87 2.6a1.33 1.33 0 0 1 2.26 0l5.34 9.33A1.33 1.33 0 0 1 13.33 14H2.67a1.33 1.33 0 0 1-1.14-2.07Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M8 6v3m0 2.33h.01`,stroke:`currentColor`})]}),ov=e=>(0,z.jsx)(av,{...e,strokeWidth:1}),sv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M12.5 2.5H3.5C2.94772 2.5 2.5 2.94772 2.5 3.5V12.5C2.5 13.0523 2.94772 13.5 3.5 13.5H12.5C13.0523 13.5 13.5 13.0523 13.5 12.5V3.5C13.5 2.94772 13.0523 2.5 12.5 2.5Z`,fill:`currentColor`})}),cv=e=>(0,z.jsx)(sv,{...e,strokeWidth:1}),lv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M12.75 4.5V9.5C12.75 10.7598 12.2496 11.968 11.3588 12.8588C10.468 13.7496 9.25978 14.25 8 14.25C6.74022 14.25 5.53204 13.7496 4.64124 12.8588C3.75045 11.968 3.25 10.7598 3.25 9.5V5C3.25 4.13805 3.59241 3.3114 4.2019 2.7019C4.8114 2.09241 5.63805 1.75 6.5 1.75C7.36195 1.75 8.1886 2.09241 8.7981 2.7019C9.40759 3.3114 9.75 4.13805 9.75 5V9.5C9.75 9.96413 9.56563 10.4092 9.23744 10.7374C8.90925 11.0656 8.46413 11.25 8 11.25C7.53587 11.25 7.09075 11.0656 6.76256 10.7374C6.43437 10.4092 6.25 9.96413 6.25 9.5V5.5`,stroke:`currentColor`})}),uv=e=>(0,z.jsx)(lv,{...e,strokeWidth:1}),dv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:(0,z.jsx)(`path`,{d:`M12.596 12.596C11.687 13.5049 10.5288 14.1239 9.26798 14.3747C8.00716 14.6255 6.70028 14.4968 5.51261 14.0048C4.32494 13.5129 3.30981 12.6798 2.59557 11.611C1.88134 10.5421 1.50008 9.2855 1.5 7.99998C1.50008 6.71446 1.88134 5.45783 2.59557 4.38898C3.30981 3.32013 4.32494 2.48707 5.51261 1.99513C6.70028 1.50319 8.00716 1.37447 9.26798 1.62524C10.5288 1.87602 11.687 2.49502 12.596 3.40398`,stroke:`currentColor`})}),fv=e=>(0,z.jsx)(dv,{...e,strokeWidth:1}),pv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M6.27612 1.5L4.52612 14.5`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M11.4739 1.5L9.72388 14.5`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M2.39868 5.5H14.0681`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M1.93188 10.5H13.6013`,stroke:`currentColor`})]}),mv=e=>(0,z.jsx)(pv,{...e,strokeWidth:1}),hv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M7.8667 0.349609C8.96906 0.349634 10.0601 0.481272 11.0317 0.735352C11.9973 0.987845 12.8453 1.362 13.4644 1.84766C14.0744 2.32629 14.507 2.95539 14.5161 3.69336H14.5171V8.53516C14.0843 8.32076 13.6108 8.17679 13.1108 8.11816C13.1831 7.96848 13.2162 7.82856 13.2163 7.70312V5.76758C12.6269 6.16618 11.8739 6.47995 11.0317 6.7002C10.0602 6.95423 8.96896 7.08494 7.8667 7.08496C6.76461 7.08493 5.67411 6.95415 4.70264 6.7002C3.85994 6.48006 3.10694 6.1662 2.51709 5.76758V7.70312L2.521 7.78418C2.56374 8.19554 2.93361 8.74414 3.91357 9.23145C4.9281 9.73585 6.35004 10.0371 7.8667 10.0371C8.26373 10.0371 8.6543 10.0141 9.03271 9.97461C8.75596 10.3799 8.54664 10.8349 8.42041 11.3232C8.23666 11.3313 8.0518 11.3369 7.8667 11.3369C6.20108 11.3369 4.57025 11.01 3.33447 10.3955C3.04163 10.2499 2.76658 10.0836 2.51709 9.90039V11.6738C2.51728 12.1379 2.88589 12.7556 3.92236 13.292C4.93457 13.8157 6.35342 14.1289 7.8667 14.1289C8.12318 14.1289 8.37694 14.1161 8.62646 14.0986C8.82021 14.5535 9.08999 14.9682 9.41943 15.3271C8.91285 15.3934 8.39149 15.4287 7.8667 15.4287C6.19761 15.4287 4.56379 15.0869 3.32568 14.4463C2.11244 13.8185 1.21649 12.8562 1.21631 11.6738V3.76367C1.21595 3.74853 1.21438 3.733 1.21436 3.71777C1.21436 2.96917 1.65103 2.33053 2.26807 1.84668C2.88747 1.36112 3.73675 0.987685 4.70264 0.735352C5.67413 0.481376 6.76457 0.349636 7.8667 0.349609ZM7.8667 1.65039C6.86269 1.65042 5.88326 1.77028 5.03076 1.99316C4.17183 2.2176 3.50421 2.52956 3.06982 2.87012C2.65043 3.19909 2.52622 3.48898 2.51709 3.69336V3.74414C2.52719 3.94845 2.65185 4.23772 3.06982 4.56543C3.50425 4.90601 4.17172 5.21795 5.03076 5.44238C5.88326 5.66527 6.8627 5.78513 7.8667 5.78516C8.8707 5.78513 9.85015 5.66525 10.7026 5.44238C11.5611 5.21787 12.2286 4.9049 12.6626 4.56445C13.0982 4.22252 13.2163 3.9231 13.2163 3.71777L13.2104 3.63574C13.1818 3.43623 13.044 3.16941 12.6626 2.87012C12.2286 2.52957 11.5614 2.21773 10.7026 1.99316C9.85009 1.77025 8.8708 1.65041 7.8667 1.65039Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M12.8936 10.0361L13.2061 10.5566C13.2296 10.5959 13.2651 10.6562 13.3027 10.707C13.3469 10.7666 13.4148 10.8431 13.5195 10.9023C13.6244 10.9617 13.725 10.9801 13.7988 10.9873C13.8619 10.9934 13.9318 10.9932 13.9775 10.9932H14.6162L14.8896 11.4502L14.5947 11.9443C14.5698 11.9859 14.5312 12.0483 14.5029 12.1084C14.4781 12.1611 14.4514 12.2312 14.4395 12.3164L14.4326 12.4072L14.4395 12.4971C14.4514 12.5825 14.4781 12.6532 14.5029 12.7061C14.5312 12.7661 14.5689 12.8287 14.5938 12.8701L14.8896 13.3633L14.6162 13.8213H13.9775C13.9318 13.8213 13.8619 13.821 13.7988 13.8271C13.7433 13.8326 13.6728 13.8442 13.5967 13.875L13.5195 13.9121C13.4148 13.9714 13.3469 14.0478 13.3027 14.1074C13.265 14.1583 13.2296 14.2186 13.2061 14.2578L12.8936 14.7783H12.3115L11.999 14.2578C11.9755 14.2186 11.9401 14.1583 11.9023 14.1074C11.8693 14.0628 11.823 14.0083 11.7578 13.959L11.6855 13.9121L11.6074 13.875C11.5316 13.8445 11.4615 13.8325 11.4062 13.8271C11.3432 13.821 11.2733 13.8213 11.2275 13.8213H10.5889L10.3135 13.3633L10.6104 12.8701C10.6352 12.8287 10.6739 12.7661 10.7021 12.7061C10.7352 12.6357 10.7724 12.534 10.7725 12.4072C10.7724 12.2804 10.7352 12.1788 10.7021 12.1084C10.6739 12.0483 10.6353 11.9859 10.6104 11.9443L10.3135 11.4502L10.5889 10.9932H11.2275C11.2733 10.9932 11.3432 10.9934 11.4062 10.9873C11.4801 10.9801 11.5808 10.9616 11.6855 10.9023C11.7903 10.843 11.8582 10.7666 11.9023 10.707C11.94 10.6562 11.9755 10.5959 11.999 10.5566L12.3115 10.0361H12.8936Z`,stroke:`currentColor`,strokeMiterlimit:`10`})]}),gv=e=>(0,z.jsx)(hv,{...e,strokeWidth:1}),_v=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M6.97211 1.94476C7.55785 1.35914 8.50767 1.35919 9.09343 1.94476L13.921 6.77228L13.2138 7.47939L8.38632 2.65187C8.19108 2.45682 7.87443 2.45677 7.67922 2.65187L2.74397 7.58711L2.03687 6.88L6.97211 1.94476Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.97571 14.5732L8.02421 2.34139`,stroke:`currentColor`})]}),vv=e=>(0,z.jsx)(_v,{...e,strokeWidth:1}),yv=e=>(0,z.jsx)(_v,{...e,strokeWidth:w_}),bv=({size:e=14,...t})=>(0,z.jsx)(b_,{size:e,...t}),xv=e=>(0,z.jsx)(bv,{...e,strokeWidth:1}),Sv=({size:e=14,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M12.5757 7.00012C12.5757 3.92085 10.0794 1.42463 7.00012 1.42456C3.9208 1.42456 1.42456 3.9208 1.42456 7.00012C1.42463 10.0794 3.92085 12.5757 7.00012 12.5757C10.0793 12.5756 12.5756 10.0793 12.5757 7.00012ZM13.8002 7.00012C13.8001 10.7559 10.7559 13.8001 7.00012 13.8002C3.2443 13.8002 0.199291 10.7559 0.199219 7.00012C0.199219 3.24426 3.24426 0.199219 7.00012 0.199219C10.7559 0.199291 13.8002 3.2443 13.8002 7.00012Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.6127 3.18921V4.55986H6.38735V3.18921H7.6127Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M7.6127 5.68921V10.8109H6.38735V5.68921H7.6127Z`,fill:`currentColor`})]}),Cv=e=>(0,z.jsx)(Sv,{...e,strokeWidth:1}),wv=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{d:`M7.84457 5.06199C11.6605 4.93876 14.7962 6.14848 14.8484 7.76397C14.8875 8.97461 13.1838 10.0696 10.7215 10.5942`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M5.12742 8.07731C5.00419 4.26138 6.21391 1.12568 7.8294 1.07351C9.04004 1.03441 10.135 2.73808 10.6596 5.20037`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M8.02457 10.6802C4.20865 10.8034 1.07294 9.5937 1.02077 7.97821C0.981678 6.76758 2.68535 5.67262 5.14763 5.14798`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M10.7476 7.89535C10.8708 11.7113 9.66109 14.847 8.0456 14.8991C6.83496 14.9382 5.74 13.2346 5.21536 10.7723`,stroke:`currentColor`})]}),Tv=e=>(0,z.jsx)(wv,{...e,strokeWidth:1}),Ev=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`M2 15H1V1H2V15Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M12.3535 7.64645C12.5487 7.84171 12.5487 8.15829 12.3535 8.35355L9.85352 10.8535L9.14648 10.1465L10.793 8.5H3.5V7.5H10.793L9.14648 5.85352L9.85352 5.14648L12.3535 7.64645Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M15 15H14V1H15V15Z`,fill:`currentColor`})]}),Dv=e=>(0,z.jsx)(Ev,{...e}),Ov=({size:e=16,className:t})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`M10.9999 8C10.9999 6.89543 10.1046 6 9 6H4.5V5H9C10.6568 5 11.9999 6.34315 11.9999 8C11.9999 9.65685 10.6568 11 9 11H6.20703L6.85351 11.6465L6.14648 12.3535L4.64652 10.8536C4.45126 10.6583 4.45126 10.3417 4.64652 10.1464L6.14648 8.64648L6.85351 9.35352L6.20703 10H9C10.1046 10 10.9999 9.10457 10.9999 8Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M2 15H1V1H2V15Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M15 15H14V1H15V15Z`,fill:`currentColor`})]}),kv=e=>(0,z.jsx)(Ov,{...e}),Av=({size:e=16,className:t,strokeWidth:n})=>(0,z.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,strokeWidth:n,children:[(0,z.jsx)(`path`,{opacity:`0.35`,d:`M8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M8 1.5C8.85359 1.5 9.69883 1.66813 10.4874 1.99478C11.2761 2.32144 11.9926 2.80022 12.5962 3.40381C13.1998 4.00739 13.6786 4.72394 14.0052 5.51256C14.3319 6.30117 14.5 7.14641 14.5 8`,stroke:`currentColor`})]}),jv=e=>(0,z.jsx)(Av,{...e,strokeWidth:1}),Mv=12;function Nv(e,t,n){let[r,i]=(0,O.useState)(t);return(0,O.useLayoutEffect)(()=>{let n=e.current;if(n===null)return;let r=()=>{i(Math.min(t,Math.max(0,n.getBoundingClientRect().bottom-Mv)))};return r(),window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0),()=>{window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0)}},[e,t,n]),r}var Pv={menu:`_menu_1lxmu_1`,viewport:`_viewport_1lxmu_44`,item:`_item_1lxmu_51`,active:`_active_1lxmu_70`,sectionTitle:`_sectionTitle_1lxmu_74`,itemIcon:`_itemIcon_1lxmu_88`,itemName:`_itemName_1lxmu_103`,itemAlias:`_itemAlias_1lxmu_113`,itemDescription:`_itemDescription_1lxmu_126`,trailing:`_trailing_1lxmu_140`,drillHintText:`_drillHintText_1lxmu_151`,drillHint:`_drillHint_1lxmu_151`,drill:`_drill_1lxmu_151`,groupTitle:`_groupTitle_1lxmu_194`,skeletonRow:`_skeletonRow_1lxmu_204`,skeletonBar:`_skeletonBar_1lxmu_213`,"dsh-menu-skeleton":`_dsh-menu-skeleton_1lxmu_1`,crumbs:`_crumbs_1lxmu_229`,crumb:`_crumb_1lxmu_229`,crumbCurrent:`_crumbCurrent_1lxmu_264`,crumbSeparator:`_crumbSeparator_1lxmu_270`};function Fv(){return[{name:`file`,label:R(`文件`,`File`),section:`add`,icon:uv,menuOnly:!1},{name:`compact`,label:R(`压缩`,`Compact`),icon:jv,description:R(`压缩当前会话内容`,`Compact the current session`)},{name:`model`,label:R(`模型`,`Model`),icon:gv,description:R(`选择本会话使用的模型`,`Choose the model for this session`)},{name:`new`,label:R(`新会话`,`New session`),icon:T_,description:R(`创建新会话`,`Create a new session`)}]}function Iv({commands:e,active:t,onHover:n,onPick:r,grouped:i=!0}){let a=(0,O.useRef)(null),o=Nv(a,400,e.length);return(0,O.useLayoutEffect)(()=>{a.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t,e.length]),(0,z.jsx)(_,{ref:a,className:Pv.menu,"data-trigger-menu":``,style:{maxHeight:o},children:(0,z.jsxs)(`div`,{className:Pv.viewport,role:`listbox`,"aria-label":R(`指令`,`Commands`),"aria-activedescendant":e[t]?`pi-command-${t}`:void 0,children:[e.map((a,o)=>(0,z.jsxs)(O.Fragment,{children:[i&&(o===0||a.section!==e[o-1]?.section)&&(0,z.jsx)(`div`,{className:Pv.sectionTitle,role:`presentation`,children:a.section===`add`?R(`添加`,`Add`):R(`指令`,`Commands`)}),(0,z.jsxs)(`button`,{id:`pi-command-${o}`,type:`button`,role:`option`,"aria-selected":o===t,className:`${Pv.item} ${o===t?Pv.active:``}`,onMouseDown:e=>{e.preventDefault(),r(a)},onMouseMove:o===t?void 0:()=>n(o),children:[a.icon&&(0,z.jsx)(`span`,{className:Pv.itemIcon,"aria-hidden":!0,children:(0,z.jsx)(a.icon,{size:14})}),(0,z.jsx)(`span`,{className:Pv.itemName,children:a.label??a.name}),a.label&&a.label.toLowerCase()!==a.name.toLowerCase()&&(0,z.jsx)(`span`,{className:Pv.itemAlias,children:a.name}),a.description&&(0,z.jsx)(`span`,{className:Pv.itemDescription,children:a.description})]})]},`${a.pluginId??`pi`}:${a.name}`)),e.length===0&&(0,z.jsx)(`div`,{className:Pv.groupTitle,children:R(`没有匹配的指令`,`No matching commands`)})]})})}var Lv={mask:`_mask_dzmab_3`,"fade-in":`_fade-in_dzmab_1`,wrap:`_wrap_dzmab_27`,illustration:`_illustration_dzmab_37`,title:`_title_dzmab_42`,desc:`_desc_dzmab_47`};function Rv({disabled:e,labels:t}){return(0,Qe.createPortal)((0,z.jsx)(`div`,{className:Lv.mask,role:`status`,children:(0,z.jsxs)(`div`,{className:Lv.wrap,children:[(0,z.jsx)(`div`,{className:Lv.illustration,"aria-hidden":`true`,children:e?(0,z.jsx)(Bv,{}):(0,z.jsx)(zv,{})}),(0,z.jsx)(`div`,{className:Lv.title,children:t.title}),!e&&t.desc!==void 0&&(0,z.jsx)(`div`,{className:Lv.desc,children:t.desc})]})}),document.body)}var zv=()=>(0,z.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsxs)(`g`,{clipPath:`url(#piwDropOverlayClip)`,children:[(0,z.jsx)(`rect`,{y:`17.0742`,width:`44.1832`,height:`43.6431`,rx:`12`,transform:`rotate(-22.7338 0 17.0742)`,fill:`#9CE5ED`}),(0,z.jsx)(`rect`,{x:`73.4043`,y:`8.54297`,width:`43.7267`,height:`50.5284`,rx:`8`,transform:`rotate(17.403 73.4043 8.54297)`,fill:`#679EFE`}),(0,z.jsx)(`path`,{d:`M30.4917 28.1369L40.8865 33.4564L37.2232 34.9524L29.5302 31.0159L26.7919 39.2122L23.1285 40.7082L26.8287 29.6338L16.8967 24.5516L20.5601 23.0556L27.7902 26.7549L30.3639 19.052L34.0273 17.556L30.4917 28.1369Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7966`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`rect`,{x:`31.583`,y:`38.6641`,width:`44.9157`,height:`44.3666`,rx:`12`,transform:`rotate(-0.134233 31.583 38.6641)`,fill:`#3964FE`}),(0,z.jsx)(`path`,{d:`M38.9521 73.0337C39.6129 71.7086 41.7113 66.0937 43.5113 61.1663C44.1607 59.3885 46.7484 59.3923 47.4591 61.1465C48.9728 64.8828 50.7969 68.6922 51.9988 69.1925C54.2946 70.1482 57.9854 59.3573 68.0064 70.1801`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`circle`,{cx:`60.6157`,cy:`52.247`,r:`4.38794`,transform:`rotate(22.5996 60.6157 52.247)`,fill:`white`})]}),(0,z.jsx)(`defs`,{children:(0,z.jsx)(`clipPath`,{id:`piwDropOverlayClip`,children:(0,z.jsx)(`rect`,{width:`115`,height:`84`,fill:`white`})})})]}),Bv=()=>(0,z.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,z.jsx)(`path`,{d:`M29.6829 4.63701L11.0677 12.4368C4.95519 14.998 2.07624 22.0294 4.6374 28.1419L12.2285 46.259C14.7896 52.3715 21.8211 55.2505 27.9336 52.6893L46.5488 44.8895C52.6613 42.3283 55.5403 35.2969 52.9791 29.1844L45.388 11.0673C42.8269 4.9548 35.7954 2.07585 29.6829 4.63701Z`,fill:`#979DA6`}),(0,z.jsx)(`path`,{d:`M30.4915 28.1375L40.8863 33.4569L37.223 34.9529L29.53 31.0165L26.7917 39.2128L23.1283 40.7088L26.8285 29.6344L16.8965 24.5522L20.5599 23.0562L27.79 26.7555L30.3637 19.0526L34.0271 17.5566L30.4915 28.1375Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M107.496 19.2285L81.0381 10.9357C76.8221 9.61423 72.333 11.9607 71.0116 16.1768L60.6844 49.1246C59.363 53.3406 61.7095 57.8297 65.9255 59.1511L92.383 67.4439C96.599 68.7654 101.088 66.4189 102.41 62.2029L112.737 29.255C114.058 25.039 111.712 20.55 107.496 19.2285Z`,fill:`#979DA6`}),(0,z.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7967`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,z.jsx)(`path`,{d:`M66.5798 30.1418L41.481 30.2006C33.5281 30.2193 27.0962 36.6815 27.1148 44.6343L27.172 69.0742C27.1907 77.0271 33.6529 83.459 41.6057 83.4404L66.7045 83.3816C74.6574 83.363 81.0894 76.9008 81.0707 68.9479L81.0135 44.5081C80.9949 36.5552 74.5327 30.1232 66.5798 30.1418Z`,fill:`#F59E0B`}),(0,z.jsx)(`path`,{d:`M54 70.7969C61.732 70.7969 68 64.5289 68 56.7969C68 49.0649 61.732 42.7969 54 42.7969C46.268 42.7969 40 49.0649 40 56.7969C40 64.5289 46.268 70.7969 54 70.7969Z`,stroke:`white`,strokeWidth:`3.5`}),(0,z.jsx)(`path`,{d:`M44 46.7969L64 66.7969`,stroke:`white`,strokeWidth:`3.5`,strokeLinecap:`round`})]}),Vv=`[pi-web workspace tab in view] `,Hv=` — The user wrote this while looking at that workspace tab. Read "this", "here" or "current" as its content, and when a tool can act on that content (for example read and patch the open drawing or file), act on it in place instead of creating something new.`;function Uv(e,t){if(!t)return e;let n=Wv(t);return[e,`${Vv}${JSON.stringify(n)}${Hv}`].filter(Boolean).join(`
|
|
34
|
+
|
|
35
|
+
`)}function Wv(e){return{title:e.title,kind:e.kind,contentId:e.contentId,...e.plugin?{plugin:e.plugin}:{},...e.detail?{detail:e.detail}:{},...e.reference?{reference:e.reference}:{}}}function Gv(e){let t=e.endsWith(Hv)?e.slice(0,-257):e;try{let e=JSON.parse(t);if(typeof e.title!=`string`||typeof e.kind!=`string`||typeof e.contentId!=`string`)return null;for(let t of[`plugin`,`detail`,`reference`])if(e[t]!==void 0&&typeof e[t]!=`string`)return null;return Wv(e)}catch{return null}}function Kv(e){let t=[],n=e;for(;;){let e=/(^|\n\n)附件 ("(?:\\.|[^"\\])*"):([^\n]+)$/u.exec(n);if(!e||!/[\\/]pi-web[\\/]attachments[\\/][a-f0-9]{64}[\\/]/u.test(e[3]))break;let r;try{r=JSON.parse(e[2])}catch{break}t.unshift({name:r,image:/\.(?:png|jpe?g|webp|gif)$/iu.test(r)}),n=n.slice(0,e.index)}let r=n.lastIndexOf(Vv);if(r!==-1&&(r===0||n.slice(r-2,r)===`
|
|
36
|
+
|
|
37
|
+
`)&&!n.slice(r).includes(`
|
|
38
|
+
`)){let e=Gv(n.slice(r+31));if(e)return{text:n.slice(0,Math.max(0,r-2)),attachments:t,context:e}}return{text:n,attachments:t}}var qv=[`tl`,`tc`,`tr`,`bl`,`bc`,`br`],Jv={anchor:`bc`,dx:0,dy:0},Yv=e=>e[0]===`t`;function Xv(e){return e<480?Math.max(0,e-24):Math.round(Math.min(640,Math.max(320,e*.46)))}function Zv(e,t,n){let r=e[1];return{x:r===`l`?12:r===`r`?t.width-n.width-12:(t.width-n.width)/2,y:Yv(e)?12:t.height-n.height-16}}function Qv(e,t,n){let r=(e,t,n,r)=>{let i=t-n-r;return i<12?(t-n)/2:Math.min(i,Math.max(12,e))};return{x:Math.round(r(e.x,t.width,n.width,12)),y:Math.round(r(e.y,t.height,n.height,12))}}function $v(e,t,n){let r=Zv(e.anchor,t,n);return Qv({x:r.x+e.dx,y:r.y+e.dy},t,n)}function ey(e,t,n,r=t.width<480){let i=Qv(e,t,n);if(r)return{anchor:i.y+n.height/2<t.height/2?`tc`:`bc`,dx:0,dy:0};let a=`bc`,o=1/0;for(let e of qv){let r=Zv(e,t,n),s=Math.hypot(r.x-i.x,r.y-i.y);s<o&&(o=s,a=e)}if(o<=48)return{anchor:a,dx:0,dy:0};let s=Zv(a,t,n);return{anchor:a,dx:Math.round(i.x-s.x),dy:Math.round(i.y-s.y)}}function ty(e,t,n,r){let i=$v(e,n,r),a=Qv({x:i.x+t.x,y:i.y+t.y},n,r),o=Zv(e.anchor,n,r);return{anchor:e.anchor,dx:Math.round(a.x-o.x),dy:Math.round(a.y-o.y)}}function ny(e){let t={placement:Jv,collapsed:!1};if(!e)return t;try{let t=JSON.parse(e),n=qv.includes(t.anchor)?t.anchor:null,r=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e):0;return{placement:n?{anchor:n,dx:r(t.dx),dy:r(t.dy)}:Jv,collapsed:t.collapsed===!0}}catch{return t}}function ry(e){return JSON.stringify({...e.placement,collapsed:e.collapsed})}var Q={root:`_root_fcn3p_6`,bar:`_bar_fcn3p_35`,status:`_status_fcn3p_36`,icon:`_icon_fcn3p_37`,"floating-composer-in":`_floating-composer-in_fcn3p_1`,grip:`_grip_fcn3p_69`,form:`_form_fcn3p_101`,line:`_line_fcn3p_119`,editor:`_editor_fcn3p_126`,chip:`_chip_fcn3p_151`,chipIcon:`_chipIcon_fcn3p_176`,chipLabel:`_chipLabel_fcn3p_182`,chipRemove:`_chipRemove_fcn3p_187`,action:`_action_fcn3p_207`,send:`_send_fcn3p_236`,statusLine:`_statusLine_fcn3p_271`,statusLabel:`_statusLabel_fcn3p_279`,statusMeta:`_statusMeta_fcn3p_287`,pulse:`_pulse_fcn3p_294`,"floating-composer-pulse":`_floating-composer-pulse_fcn3p_1`,tail:`_tail_fcn3p_304`,replyHead:`_replyHead_fcn3p_315`,replyTitle:`_replyTitle_fcn3p_323`,replyActions:`_replyActions_fcn3p_329`,replyBody:`_replyBody_fcn3p_343`,replyFoot:`_replyFoot_fcn3p_353`,textButton:`_textButton_fcn3p_359`,summary:`_summary_fcn3p_377`,warn:`_warn_fcn3p_396`,transcript:`_transcript_fcn3p_402`,transcriptHead:`_transcriptHead_fcn3p_408`,transcriptState:`_transcriptState_fcn3p_418`,transcriptBanner:`_transcriptBanner_fcn3p_429`,transcriptBody:`_transcriptBody_fcn3p_435`,"floating-composer-ring":`_floating-composer-ring_fcn3p_1`,badge:`_badge_fcn3p_481`,ghost:`_ghost_fcn3p_497`,"floating-composer-ghost":`_floating-composer-ghost_fcn3p_1`,model:`_model_fcn3p_536`},iy=`pi.floatingComposer.v1`,ay=40,oy=44,sy=120,cy=400;function ly(){try{return ny(localStorage.getItem(iy))}catch{return{placement:Jv,collapsed:!1}}}var uy=()=>/Mac|iPhone|iPad/u.test(navigator.platform);function dy(e){if(e.isComposing||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`)return!1;let t=uy();return(t?!e.metaKey||e.ctrlKey:!e.ctrlKey||e.metaKey)?!1:t||!(e.target instanceof Element&&e.target.closest(`.xterm`))}function fy({host:e,bounds:t,status:n,iconState:r,iconLabel:i,labels:a,focusInput:o,onContentPointerDown:s,children:c}){let[l,u]=(0,O.useState)(ly),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(oy),[h,g]=(0,O.useState)(null),[_,v]=(0,O.useState)(!1),y=(0,O.useRef)(null),b=(0,O.useRef)(null),x=(0,O.useRef)(null),S=(0,O.useRef)(null),C=(0,O.useRef)(null),w=(0,O.useRef)(!1),T=(0,O.useRef)(s);T.current=s;let E=d!==null&&d.height<cy,[D,k]=(0,O.useState)(!1);(0,O.useEffect)(()=>{E||k(!1)},[E]);let A=(0,O.useRef)(E);A.current=E;let j=E?!D:l.collapsed;(0,O.useEffect)(()=>{try{localStorage.setItem(iy,ry(l))}catch{}},[l]),(0,O.useLayoutEffect)(()=>{if(!t){f(null);return}let n=null,r=()=>{n=null;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.querySelector(`[data-dockkit-strip]`)?.getBoundingClientRect(),o=a&&a.bottom>i.top&&a.bottom<i.bottom?a.bottom:i.top,s={left:Math.round(i.left-r.left),top:Math.round(o-r.top),width:Math.round(i.width),height:Math.round(i.bottom-o)};f(e=>e&&e.left===s.left&&e.top===s.top&&e.width===s.width&&e.height===s.height?e:s)},i=()=>{n??=requestAnimationFrame(r)};r();let a=new ResizeObserver(i);return a.observe(t),a.observe(e),window.addEventListener(`resize`,i),t.addEventListener(`transitionend`,i),()=>{a.disconnect(),window.removeEventListener(`resize`,i),t.removeEventListener(`transitionend`,i),n!==null&&cancelAnimationFrame(n)}},[e,t]),(0,O.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>m(Math.round(e.getBoundingClientRect().height)||(j?ay:oy));t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[j,d!==null]);let ee=(d?.width??0)<480,M=j?ay:Xv(d?.width??0),N={width:M,height:j?ay:Math.max(p,oy)},P=ee?j?{anchor:`br`,dx:0,dy:0}:{anchor:Yv(l.placement.anchor)?`tc`:`bc`,dx:0,dy:0}:l.placement,F=Yv(P.anchor),I=d?h??$v(P,d,N):null,te=(0,O.useRef)(N);te.current=N;let L=(0,O.useRef)(d);L.current=d;let R=(0,O.useCallback)(e=>{A.current?k(!e):u(t=>t.collapsed===e?t:{...t,collapsed:e})},[]),ne=(0,O.useCallback)(()=>{let e=x.current;e?.isConnected?e.focus():document.activeElement instanceof HTMLElement&&y.current?.contains(document.activeElement)&&document.activeElement.blur()},[]),re=(0,O.useCallback)(()=>{S.current=y.current?.contains(document.activeElement)?`icon`:null,R(!0)},[R]),ie=(0,O.useCallback)(e=>{S.current=e?`input`:null,R(!1)},[R]);(0,O.useEffect)(()=>{let e=S.current;if(!e)return;S.current=null;let t=requestAnimationFrame(()=>{e===`input`?o():e===`icon`?b.current?.focus():ne()});return()=>cancelAnimationFrame(t)},[j,o,ne]),(0,O.useEffect)(()=>{let e=e=>{dy(e)&&(e.preventDefault(),e.stopPropagation(),j?ie(!0):y.current?.contains(document.activeElement)?(S.current=`return`,R(!0)):o())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[j,ie,o,R]),(0,O.useEffect)(()=>{if(!t)return;let e=null,n=n=>{n.target instanceof Node&&t.contains(n.target)&&!y.current?.contains(n.target)&&(e=n.pointerId,T.current?.())},r=t=>{if(e!==t.pointerId||t.buttons===0)return;let n=y.current?.getBoundingClientRect();n&&t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom&&v(!0)},i=t=>{e===t.pointerId&&(e=null,v(!1))};return document.addEventListener(`pointerdown`,n,!0),document.addEventListener(`pointermove`,r,{capture:!0,passive:!0}),document.addEventListener(`pointerup`,i,!0),document.addEventListener(`pointercancel`,i,!0),()=>{document.removeEventListener(`pointerdown`,n,!0),document.removeEventListener(`pointermove`,r,!0),document.removeEventListener(`pointerup`,i,!0),document.removeEventListener(`pointercancel`,i,!0)}},[t]);let B=!F&&!E&&d&&I&&d.height-(I.y+N.height)<=sy?N.height+16:0,ae=ee?B:0,oe=ee?0:B;(0,O.useEffect)(()=>{if(!t)return;let e=(e,n)=>{n?t.style.setProperty(e,`${n}px`):t.style.removeProperty(e)};return e(`--pi-floating-composer-inset`,ae),e(`--pi-floating-composer-overlap`,oe),()=>{t.style.removeProperty(`--pi-floating-composer-inset`),t.style.removeProperty(`--pi-floating-composer-overlap`)}},[t,ae,oe]),(0,O.useEffect)(()=>{if(t&&!j)return t.setAttribute(`data-floating-composer-open`,``),()=>t.removeAttribute(`data-floating-composer-open`)},[t,j]);let se=(e,t)=>{e.button===0&&I&&!C.current&&(e.currentTarget.setPointerCapture(e.pointerId),C.current={id:e.pointerId,origin:{x:e.clientX,y:e.clientY},start:I,moved:!1,target:t},t===`grip`&&e.preventDefault())},ce=e=>{let t=C.current,n=L.current;if(!t||t.id!==e.pointerId||!n)return;let r=e.clientX-t.origin.x,i=e.clientY-t.origin.y;!t.moved&&Math.hypot(r,i)<4||(t.moved=!0,g(Qv({x:t.start.x+(ee?0:r),y:t.start.y+i},n,te.current)))},le=(e,t)=>{let n=C.current;if(!n||n.id!==e.pointerId)return;C.current=null;let r=L.current;if(n.moved&&r&&!t){let t=ey(Qv({x:n.start.x+(ee?0:e.clientX-n.origin.x),y:n.start.y+e.clientY-n.origin.y},r,te.current),r,te.current);u(e=>({...e,placement:t}))}w.current=n.moved,g(null)},V=()=>u(e=>({...e,placement:Jv})),ue=e=>{let t=L.current;if(!t)return;if(e.key===`Home`){e.preventDefault(),V();return}let n=e.shiftKey?64:16,r={ArrowLeft:{x:-n,y:0},ArrowRight:{x:n,y:0},ArrowUp:{x:0,y:-n},ArrowDown:{x:0,y:n}}[e.key];r&&(e.preventDefault(),ee?r.y&&u(e=>({...e,placement:{anchor:r.y<0?`tc`:`bc`,dx:0,dy:0}})):u(e=>({...e,placement:ty(e.placement,r,t,te.current)})))};if(!d||!I||d.width<=0||d.height<=0)return null;let de=h?ey(h,d,N):null,fe=de&&de.dx===0&&de.dy===0?Zv(de.anchor,d,N):null,pe=h||F?{left:d.left+I.x,top:d.top+I.y,width:M}:{left:d.left+I.x,bottom:`calc(100% - ${d.top+I.y+N.height}px)`,width:M};return(0,Qe.createPortal)((0,z.jsxs)(z.Fragment,{children:[fe&&(0,z.jsx)(`div`,{className:Q.ghost,"aria-hidden":`true`,"data-floating-snap-target":!0,style:{left:d.left+fe.x,top:d.top+fe.y,width:N.width,height:N.height}}),(0,z.jsx)(`section`,{ref:y,className:Q.root,style:pe,"data-floating-composer":j?`collapsed`:`expanded`,"data-edge":F?`top`:`bottom`,"data-dragging":h?``:void 0,"data-passthrough":_||void 0,"data-narrow":ee||void 0,"aria-label":a.region,onFocus:e=>{e.relatedTarget instanceof HTMLElement&&y.current?.contains(e.relatedTarget)||(x.current=e.relatedTarget instanceof HTMLElement?e.relatedTarget:null)},children:j?(0,z.jsxs)(`button`,{ref:b,type:`button`,className:Q.icon,"data-state":r,"aria-label":i,title:i,"aria-expanded":!1,onPointerDown:e=>se(e,`icon`),onPointerMove:ce,onPointerUp:e=>le(e,!1),onPointerCancel:e=>le(e,!0),onClick:()=>{w.current?w.current=!1:ie(!0)},children:[(0,z.jsx)(ge,{size:18}),r!==`idle`&&r!==`offline`&&(0,z.jsx)(`span`,{className:Q.badge,"aria-hidden":`true`})]}):(0,z.jsxs)(z.Fragment,{children:[n&&(0,z.jsx)(`div`,{className:Q.status,"data-floating-status":!0,children:n}),(0,z.jsxs)(`div`,{className:Q.bar,children:[(0,z.jsx)(`button`,{type:`button`,className:Q.grip,"aria-label":a.grip,title:a.snapHint,onPointerDown:e=>se(e,`grip`),onPointerMove:ce,onPointerUp:e=>le(e,!1),onPointerCancel:e=>le(e,!0),onDoubleClick:V,onKeyDown:ue,children:(0,z.jsx)(`svg`,{viewBox:`0 0 8 14`,width:`8`,height:`14`,"aria-hidden":`true`,children:[2,7,12].flatMap(e=>[2,6].map(t=>(0,z.jsx)(`circle`,{cx:t,cy:e,r:`1.1`,fill:`currentColor`},`${t}-${e}`)))})}),c({collapse:re,releaseFocus:ne})]})]})})]}),e)}var py={keys:`_keys_38b9q_1`,key:`_key_38b9q_1`,tooltip:`_tooltip_38b9q_20`,separator:`_separator_38b9q_30`,joined:`_joined_38b9q_32`};function my({keys:e,variant:t=`plain`,className:n}){return(0,z.jsx)(`span`,{className:h(py.keys,t===`tooltip`&&py.tooltip,t===`tooltip`&&e.includes(`+`)&&py.joined,n),children:e.map((e,t)=>(0,z.jsx)(`kbd`,{className:e===`+`?py.separator:py.key,children:e},t))})}var hy={bubble:`_bubble_ugtpz_1`,"tooltip-in":`_tooltip-in_ugtpz_1`,label:`_label_ugtpz_26`},gy={pointer:`pointer`,keyboard:`keyboard`},_y=`data-input-modality`,vy=new Set([`Tab`,`Home`,`End`,`PageUp`,`PageDown`]),yy=!1,by=!1,xy;function Sy(){document.documentElement.setAttribute(_y,by?gy.pointer:gy.keyboard)}function Cy(){return yy}typeof window<`u`&&(window.addEventListener(`pointerdown`,()=>{yy=!0,by=!0,xy=void 0,Sy()},!0),window.addEventListener(`keydown`,e=>{typeof e.key==`string`&&(yy=!1,e.isComposing?xy=void 0:(xy=e.composedPath()[0],(vy.has(e.key)||e.key.startsWith(`Arrow`))&&(by=!1,Sy())))},!0),window.addEventListener(`focusin`,e=>{xy!==void 0&&e.composedPath()[0]!==xy&&(xy=void 0,by&&(by=!1,Sy()))},!0),window.addEventListener(`blur`,()=>{xy=void 0}));var wy=(0,O.createContext)(null);function Ty({label:e,shortcutKeys:t,side:n=`right`,align:r=`center`,delayMs:i=0,gap:a=8,disabled:o=!1,portal:s=!1,maxWidth:c,children:l}){let u=(0,O.useRef)(null),d=l.props.ref,f=(0,O.useCallback)(e=>{u.current=e,typeof d==`function`?d(e):d!=null&&(d.current=e)},[d]),[p,m]=(0,O.useState)(null),h=(0,O.useRef)(null),g=p===null?null:typeof e==`function`?e():e,_=p===null?0:n===`right`?p.top+(p.bottom-p.top)/2:n===`top`?p.top-a:p.bottom+a,v=(0,O.useRef)(null),y=(0,O.useRef)({hover:!1,focus:!1}),b=(0,O.useContext)(wy),[x,S]=(0,O.useState)(!1),C=(0,O.useCallback)(e=>{b?.(e)},[b]),w=p!==null&&!o;(0,O.useEffect)(()=>{let e=h.current;if(p===null||!w||x||e===null)return;let t,i=n,o=()=>{if(t===void 0)return;let{inlineSize:o,blockSize:s}=t,c=n===`right`?0:r===`end`?o:o/2,l=Math.max(12,Math.min(p.x-c,window.innerWidth-12-o)),u=p.bottom+a+s<=window.innerHeight-12,d=p.top-a-s>=12;i===`bottom`&&!u&&d?i=`top`:i===`top`&&!d&&u&&(i=`bottom`),e.style.left=`${l+c}px`,e.style.top=`${i===`right`?(p.top+p.bottom)/2:i===`top`?p.top-a:p.bottom+a}px`,e.dataset.side=i,e.style.visibility=`visible`},s=new ResizeObserver(e=>{t=e[0]?.borderBoxSize[0],o()});return s.observe(e,{box:`border-box`}),window.addEventListener(`resize`,o),()=>{s.disconnect(),window.removeEventListener(`resize`,o)}},[r,a,p,n,x,w]),(0,O.useEffect)(()=>(C(w),()=>{C(!1)}),[C,w]);let T=(0,O.useCallback)(()=>{v.current!==null&&(clearTimeout(v.current),v.current=null)},[]);(0,O.useEffect)(()=>(o&&(T(),y.current={hover:!1,focus:!1},m(null)),T),[T,o]);let E=()=>{if(o)return;let e=u.current;if(e===null)return;let t=e.getBoundingClientRect();m({x:n===`right`?t.right+10:r===`end`?t.right:t.left+t.width/2,top:t.top,bottom:t.bottom}),C(!0)},D=()=>{T(),i<=0?E():v.current=setTimeout(()=>{v.current=null,E()},i)},k=()=>{m(null),C(!1)},A=()=>{T(),!y.current.hover&&!y.current.focus&&k()},j=w&&!x&&(0,z.jsxs)(`span`,{ref:h,className:hy.bubble,"data-side":n,"data-portal":s||void 0,"data-align":r,"data-has-shortcut":t?.length?!0:void 0,style:{left:p.x,top:_,visibility:`hidden`,...c===void 0?{}:{maxWidth:c}},role:`tooltip`,"aria-label":t?.length?[g,t.join(` `)].filter(Boolean).join(` `):void 0,children:[g&&(0,z.jsx)(`span`,{className:hy.label,children:g}),t!==void 0&&t.length>0&&(0,z.jsx)(my,{keys:t,variant:`tooltip`})]});return(0,z.jsxs)(wy.Provider,{value:S,children:[(0,O.cloneElement)(l,{ref:f,onMouseEnter:e=>{l.props.onMouseEnter?.(e),y.current.hover=!0,D()},onMouseLeave:e=>{l.props.onMouseLeave?.(e),y.current.hover=!1,T(),k()},onClick:e=>{l.props.onClick?.(e),y.current.focus=!1,T(),k()},onFocus:e=>{l.props.onFocus?.(e),Cy()||(y.current.focus=!0,T(),E())},onBlur:e=>{l.props.onBlur?.(e),y.current.focus=!1,A()}}),s?j!==!1&&(0,Qe.createPortal)(j,document.body):j]})}var Ey={dock:`_dock_1dh5u_3`,panel:`_panel_1dh5u_11`,header:`_header_1dh5u_40`,lead:`_lead_1dh5u_57`,chevron:`_chevron_1dh5u_57`,count:`_count_1dh5u_58`,list:`_list_1dh5u_59`,row:`_row_1dh5u_60`,content:`_content_1dh5u_61`,actions:`_actions_1dh5u_62`,action:`_action_1dh5u_62`,editor:`_editor_1dh5u_67`,status:`_status_1dh5u_69`,error:`_error_1dh5u_70`,kind:`_kind_1dh5u_79`,preview:`_preview_1dh5u_80`,attachments:`_attachments_1dh5u_81`,file:`_file_1dh5u_83`,paused:`_paused_1dh5u_86`};function Dy({session:e,connected:t,onUpdate:n}){let[r,i]=(0,O.useState)(!0),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(``);dt(`prompt-queue`,l);let d=(0,O.useRef)(!1),f=(0,O.useId)(),p=(0,O.useRef)(null),m=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{if(m.current&&a===null&&s===null){let e=document.activeElement;(!e||e===document.body||p.current?.contains(e))&&p.current?.querySelector(`[data-prompt-id="${CSS.escape(m.current)}"] [data-edit-prompt]`)?.focus(),m.current=null}},[a,s,e?.queuedPrompts]);let h=[...(e?.promptQueue?.steering??[]).map((e,t)=>({id:`steer-${t}`,label:R(`引导`,`Steer`),...Kv(e)})),...(e?.promptQueue?.followUp??[]).map((e,t)=>({id:`native-${t}`,label:R(`排队`,`Queue`),...Kv(e)})),...(e?.queuedPrompts??[]).map(e=>({id:e.id,label:R(`排队`,`Queue`),text:e.text,attachments:e.attachments,item:e}))];if((0,O.useEffect)(()=>{h.length===0&&i(!0),a&&!h.some(e=>e.id===a.id&&e.item?.status===`queued`)&&o(null)},[h.length,a,e?.queuedPrompts]),!h.length&&!e?.hasPendingPrompts)return null;let g=h.length===1||!r||a!==null||s!==null,_=R(`${h.length} 条待处理提示词`,`${h.length} pending prompts`),v=e=>{m.current=e},y=async(e,r)=>{if(d.current||!t)return!1;d.current=!0,c(e.id),u(``);try{return await n(e.id,e.revision,r),!0}catch(e){return u(e instanceof Error?e.message:R(`队列操作失败`,`Queue action failed`)),!1}finally{d.current=!1,c(null)}},x=async()=>{if(!a)return;let e=a;await y(e,{kind:`edit`,text:e.text})&&(o(null),v(e.id))},S=(e,t,n,r,i=!1)=>(0,z.jsx)(Ty,{portal:!0,label:e,side:`top`,delayMs:500,disabled:t,children:(0,z.jsx)(`button`,{className:Ey.action,type:`button`,"aria-label":e,disabled:t,onClick:n,"data-edit-prompt":i||void 0,children:r})});return(0,z.jsx)(`section`,{className:Ey.dock,"aria-label":R(`待处理提示词`,`Pending prompts`),"data-queue-dock":``,children:(0,z.jsxs)(`div`,{className:Ey.panel,children:[h.length>1&&(0,z.jsxs)(`button`,{type:`button`,className:Ey.header,"aria-label":_,"aria-controls":f,"aria-expanded":g,disabled:a!==null||s!==null,onClick:()=>i(e=>!e),children:[(0,z.jsx)(`span`,{className:Ey.lead,"aria-hidden":!0,children:(0,z.jsx)(xv,{})}),(0,z.jsx)(`span`,{className:Ey.count,role:`status`,children:_}),!g&&h.some(e=>e.item?.status===`sending`)&&(0,z.jsx)(`span`,{className:Ey.status,children:R(`发送中…`,`Sending…`)}),(0,z.jsx)(`span`,{className:Ey.chevron,"aria-hidden":!0,children:g?(0,z.jsx)(R_,{}):(0,z.jsx)(W_,{})})]}),h.length===0&&(0,z.jsxs)(`div`,{className:Ey.header,children:[(0,z.jsx)(`span`,{className:Ey.lead,"aria-hidden":!0,children:(0,z.jsx)(xv,{})}),(0,z.jsx)(`span`,{className:Ey.count,role:`status`,children:R(`等待 Pi 接收`,`Waiting for Pi`)})]}),(0,z.jsx)(`ol`,{ref:p,id:f,className:Ey.list,hidden:!g,children:h.map(n=>{let r=n.item,i=!t||s!==null||r?.status===`sending`;return(0,z.jsxs)(`li`,{className:Ey.row,"data-prompt-id":n.id,children:[h.length===1&&(0,z.jsx)(`span`,{className:Ey.lead,"aria-hidden":!0,children:(0,z.jsx)(xv,{})}),(0,z.jsx)(`span`,{className:Ey.kind,children:n.label}),(0,z.jsxs)(`div`,{className:Ey.content,children:[n.attachments.length>0&&(0,z.jsx)(`span`,{className:Ey.attachments,children:n.attachments.map((e,t)=>(0,z.jsxs)(`span`,{className:Ey.file,title:e.name,children:[(0,z.jsx)(b,{path:e.name}),(0,z.jsx)(`span`,{children:e.name})]},t))}),a?.id===n.id?(0,z.jsx)(`textarea`,{className:Ey.editor,autoFocus:!0,rows:2,maxLength:32e3,"aria-label":R(`编辑排队提示词`,`Edit queued prompt`),value:a.text,disabled:s!==null,onChange:e=>o({...a,text:e.target.value}),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`&&(e.preventDefault(),o(null),v(n.id)),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x()))}}):n.text&&(0,z.jsx)(`span`,{className:Ey.preview,title:n.text,children:n.text}),r?.error&&(0,z.jsx)(`span`,{className:Ey.error,role:`alert`,children:r.error})]}),r?.status===`sending`&&(0,z.jsx)(`span`,{className:Ey.status,role:`status`,children:R(`发送中…`,`Sending…`)}),r&&(0,z.jsx)(`div`,{className:Ey.actions,children:a?.id===n.id?(0,z.jsxs)(z.Fragment,{children:[S(R(`保存修改`,`Save changes`),i||!a.text.trim()&&n.attachments.length===0,()=>{x()},(0,z.jsx)(P_,{})),S(R(`取消编辑`,`Cancel edit`),s!==null,()=>{o(null),v(n.id)},(0,z.jsx)(K_,{}))]}):(0,z.jsxs)(z.Fragment,{children:[S(R(`编辑`,`Edit`),i,()=>{o({id:r.id,revision:r.revision,text:r.text}),u(``)},(0,z.jsx)(ev,{}),!0),S(R(`删除`,`Delete`),i,()=>{y(r,{kind:`remove`})},(0,z.jsx)(iv,{})),S(R(`发送(引导)`,`Send (steer)`),i||!!e?.idle||!!e?.interactions?.length,()=>{y(r,{kind:`steer`})},(0,z.jsx)(vv,{}))]})})]},n.id)})}),e?.paused&&(0,z.jsx)(`div`,{className:Ey.paused,role:`status`,children:R(`已暂停,继续后处理`,`Paused; processed on resume`)})]})})}var Oy={controls:`_controls_1d60f_1`,action:`_action_1d60f_2`};function ky({hasDraft:e,canSend:t,canStop:n,pauseLabel:r,pauseTitle:i,pauseIcon:a,onStop:o}){let s=e=>e.preventDefault(),c=(0,z.jsx)(Ty,{label:i??r,side:`top`,delayMs:500,disabled:!n,children:(0,z.jsx)(`button`,{className:e?Oy.action:wt.primary,type:`button`,"aria-label":r,disabled:!n,onMouseDown:s,onClick:o,children:a??(0,z.jsx)(cv,{size:16})})});return(0,z.jsxs)(`div`,{className:Oy.controls,role:`group`,"aria-label":R(`追加提示词`,`Append prompt`),children:[c,e&&(0,z.jsx)(Ty,{label:R(`当前任务完成后排队处理`,`Queue after the current task finishes`),shortcutKeys:[`Enter`],side:`top`,delayMs:500,disabled:!t,children:(0,z.jsx)(`button`,{className:wt.primary,type:`submit`,"aria-label":R(`发送消息`,`Send message`),disabled:!t,onMouseDown:s,children:(0,z.jsx)(yv,{size:16})})})]})}function Ay(e,t,n){let r=(0,O.useRef)(null),i=(0,O.useRef)(null),a=(0,O.useRef)(null),o=(0,O.useRef)(!0),s=(0,O.useRef)(0),[c,l]=(0,O.useState)(!1),u=(0,O.useCallback)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight,s.current=e.scrollTop,l(!1))},[]),d=(0,O.useCallback)(()=>{o.current=!0,u()},[u]),f=(0,O.useCallback)(()=>{let e=r.current;if(!e)return;let t=e.scrollHeight-e.clientHeight-e.scrollTop;e.scrollTop<s.current-1?o.current=!1:t<=24&&(o.current=!0),s.current=e.scrollTop,l(!o.current&&t>1)},[]),p=(0,O.useCallback)(e=>{e.deltaY<0&&(o.current=!1)},[]);return(0,O.useLayoutEffect)(()=>{if(o.current=!0,l(!1),!t)return;u();let e=new ResizeObserver(()=>{let e=r.current;e&&(e.style.setProperty(`--piw-composer-height`,`${a.current?.getBoundingClientRect().height??152}px`),o.current?u():l(e.scrollHeight-e.clientHeight-e.scrollTop>1))});for(let t of[r.current,i.current,a.current])t&&e.observe(t);return()=>e.disconnect()},[e,t,u]),(0,O.useLayoutEffect)(()=>{t&&n&&d()},[t,n,d]),(0,O.useLayoutEffect)(()=>{t&&o.current&&u()}),{scroll:r,content:i,composer:a,onScroll:f,onWheel:p,showLatest:t&&c,returnToLatest:d}}var jy=e=>typeof e==`string`&&e.trim()?e.trim():void 0;function My(e){let t=e.trim(),n=/^(?:(\d{3})\s*)?(\{[\s\S]*\})$/.exec(t),r=t,i=n?.[1]?Number(n[1]):void 0,a,o;if(n)try{let e=JSON.parse(n[2]),s=e.error&&typeof e.error==`object`?e.error:void 0;r=jy(s?.message)??jy(e.error)??jy(e.message)??jy(e.detail)??t,a=jy(s?.type)??jy(s?.code)??(e.type===`error`?void 0:jy(e.type)),o=jy(e.request_id)??jy(s?.request_id),i===void 0&&typeof e.status==`number`&&(i=e.status)}catch{}return{message:r,status:i,type:a,requestId:o,usageLimit:/usage limit has been reached/i.test(t),raw:t}}function Ny(e){switch(e){case`running`:return R(`运行中`,`Running`);case`completed`:return R(`已完成`,`Completed`);case`failed`:return R(`失败`,`Failed`);case`cancelled`:return R(`已取消`,`Cancelled`);case`unknown`:return R(`状态未知`,`Status unknown`)}}var Py=e=>e.subagent?.description||(e.subagent?R(`${e.subagent.agentType} 子任务`,`${e.subagent.agentType} task`):e.name),Fy=(0,O.memo)(function({block:e,result:t,running:n,cwd:r,onInspect:i}){te();let a=e.toolCallId;return(0,z.jsx)(kn,{block:e,result:t,running:n,cwd:r,onInspect:a&&i?()=>i(a):void 0})});function Iy({message:e,results:t,loadImage:n,running:r=!1,onInspect:i,cwd:a}){if(e.role===`tool`&&e.toolCallId&&t.has(e.toolCallId))return null;if(e.role===`notice`&&e.subagentNotice)return(0,z.jsx)(`div`,{className:`pi-subagent-notice`,"data-message-role":`notice`,children:Wn(e.subagentNotice)});if(e.role===`user`&&e.subagentInput)return(0,z.jsxs)(`section`,{className:`pi-subagent-instruction`,"data-message-role":`user`,"data-subagent-input":e.subagentInput,children:[(0,z.jsx)(`header`,{children:e.subagentInput===`dispatch`?R(`主 Agent 派发`,`Parent agent dispatch`):R(`主 Agent 补充指令`,`Parent agent steering`)}),e.blocks.map((e,t)=>e.kind===`text`&&(0,z.jsx)(`div`,{children:e.text},t))]});if(e.role===`user`){let t=Kv(e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
39
|
+
`)),r=e.localFiles?{...t,attachments:e.localFiles.map(e=>({name:e.name,image:/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type)}))}:t,i=e.blocks.map((e,t)=>({block:e,index:t})).filter(({block:e})=>e.kind===`image`),a=r.attachments.filter(e=>e.image),o=e.localFiles?.filter(e=>/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type));return(0,z.jsx)(`div`,{className:Et.userRow,"data-message-role":`user`,children:(0,z.jsxs)(`div`,{className:Et.userStack,children:[(i.length>0||r.attachments.some(e=>!e.image))&&(0,z.jsxs)(`div`,{className:Et.attachmentRow,"data-message-attachments":!0,children:[i.map(({index:t},s)=>(0,z.jsx)(gr,{name:a[s]?.name??o?.[s]?.name??R(`图片`,`Image`),messageId:e.id,index:t,file:o?.[s],tile:i.length>1||r.attachments.length>i.length,loadImage:n},t)),r.attachments.filter(e=>!e.image).map((e,t)=>(0,z.jsxs)(`span`,{className:Et.fileCard,title:e.name,children:[(0,z.jsx)(b,{path:e.name,className:Et.fileIcon}),(0,z.jsxs)(`span`,{className:Et.fileContent,children:[(0,z.jsx)(`span`,{className:Et.fileName,children:e.name}),(0,z.jsxs)(`span`,{className:Et.fileMeta,children:[x(e.name).toUpperCase(),` `,R(`文件`,`file`)]})]})]},`${e.name}-${t}`))]}),r.text&&(0,z.jsx)(`div`,{className:Et.bubble,children:r.text}),r.context&&(0,z.jsxs)(`div`,{className:`pi-message-context`,"data-message-context":!0,title:R(`发送时正在查看的工作区标签页`,`Workspace tab in view when this was sent`),children:[(0,z.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:[(0,z.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,z.jsx)(`path`,{d:`M2 6h12`,stroke:`currentColor`,strokeWidth:`1.3`})]}),(0,z.jsx)(`span`,{children:R(`来自 ${r.context.detail??r.context.title}`,`From ${r.context.detail??r.context.title}`)})]})]})})}return(0,z.jsx)(`div`,{className:`pi-message`,"data-message-role":e.role,children:e.blocks.map((e,n)=>e.kind===`thinking`?(0,z.jsx)(Ft,{text:e.text,running:r},n):e.kind===`toolCall`?(0,z.jsx)(Fy,{block:e,result:e.toolCallId?t.get(e.toolCallId):void 0,running:r,cwd:a,onInspect:i},e.toolCallId||n):e.kind===`image`?(0,z.jsx)(`div`,{className:`pi-image-note`,children:e.text},n):(0,z.jsx)(jt,{text:e.text,streaming:r},n))})}function Ly({error:e,onDismiss:t}){let[n,r]=(0,O.useState)(!1),i=My(e),a=[i.status&&`HTTP ${i.status}`,i.type].filter(Boolean).join(` · `);return(0,z.jsxs)(`div`,{className:`pi-model-error`,role:`alert`,children:[(0,z.jsxs)(`div`,{className:`pi-model-error-title`,children:[(0,z.jsx)(`strong`,{children:R(`模型请求失败`,`Model request failed`)}),a&&(0,z.jsx)(`span`,{className:`pi-model-error-meta`,children:a}),(0,z.jsx)(`button`,{type:`button`,className:`pi-error-dismiss`,"aria-label":R(`关闭错误`,`Dismiss error`),onClick:t,children:`×`})]}),(0,z.jsx)(`p`,{className:`pi-model-error-message`,children:i.usageLimit?R(`模型服务的使用额度已耗尽。请切换模型或等待额度恢复后重试。`,`The model service usage limit has been reached. Switch models or try again after the limit resets.`):i.message}),(0,z.jsxs)(`div`,{className:`pi-model-error-footer`,children:[i.requestId&&(0,z.jsx)(`span`,{className:`pi-model-error-request`,title:R(`请求 ID`,`Request ID`),children:i.requestId}),(0,z.jsx)(`button`,{type:`button`,className:`pi-model-error-copy`,onClick:()=>{navigator.clipboard?.writeText(i.raw).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},children:n?R(`已复制`,`Copied`):R(`复制详情`,`Copy details`)})]})]})}function Ry({turn:e,results:t,model:n,loadImage:r,onInspect:i,renderPluginSlot:a,renderToolView:o,artifactTools:s,viewTools:c,running:l=!1,cwd:u,superseded:d=!1}){let f=[...e.messages].reverse().find(e=>e.role===`assistant`&&e.blocks.some(e=>e.kind===`text`&&e.text.trim())),p=f?.blocks.filter(e=>e.kind===`text`)??[],m=[];for(let t of e.messages)t.role===`assistant`&&t.blocks.forEach((e,n)=>{t===f&&e.kind===`text`||e.kind===`toolCall`&&(c.includes(e.toolName??``)||s.includes(e.toolName??``))||m.push({message:t,block:e,index:n})});let[h,g]=(0,O.useState)(!1),_=m.filter(({block:e})=>e.kind===`toolCall`).length,v=new Set(m.filter(({block:e})=>e.kind!==`toolCall`).map(({message:e})=>e.id)).size,y=p.map(e=>e.text).join(`
|
|
40
|
+
`),b=l||h,[x,S]=(0,O.useState)(new Set),C=e.messages.filter(e=>e.role===`assistant`&&e.error),w=[...e.messages].reverse().find(e=>e.role===`assistant`),T=d||w&&!w.error&&w.id!==C.at(-1)?.id?[]:C.filter(e=>!x.has(e.id));return(0,z.jsxs)(`div`,{className:`pi-turn`,"data-turn":e.index,children:[e.messages.filter(e=>e.role===`user`||e.role===`notice`).map(e=>(0,z.jsx)(Iy,{message:e,results:t,loadImage:r},e.id)),m.length>0&&(0,z.jsxs)(z.Fragment,{children:[p.length>0&&(0,z.jsx)(An,{toolCount:_,messageCount:v,open:b,onToggle:()=>g(e=>!e)}),(b||p.length===0)&&(0,z.jsx)(`div`,{className:`pi-turn-process-content`,children:m.map(({message:e,block:n,index:a})=>(0,z.jsx)(Iy,{message:{...e,blocks:[n]},results:t,loadImage:r,running:e.id===`stream`,cwd:u,onInspect:i},`${e.id}-${a}`))})]}),Ln(e.messages,c).map(({key:e,call:n})=>(0,z.jsx)(`div`,{"data-tool-view":n.toolName,children:o?.(n,n.toolCallId?t.get(n.toolCallId):void 0,l&&!t.has(n.toolCallId??``))},e)),p.length>0&&f&&(0,z.jsx)(Iy,{message:{...f,blocks:p},results:t,loadImage:r,running:f.id===`stream`}),e.messages.filter(e=>e.role===`tool`&&(!e.toolCallId||!t.has(e.toolCallId))).map(e=>(0,z.jsx)(Iy,{message:e,results:t,loadImage:r},e.id)),T.map(e=>(0,z.jsx)(Ly,{error:e.error,onDismiss:()=>S(t=>new Set(t).add(e.id))},`${e.id}-error`)),!l&&T.length===0&&(f||e.usage&&e.usage.totalTokens>0)&&(0,z.jsx)(Nn,{text:y,timestamp:f?.timestamp,usage:e.usage,model:f?.model??n}),a(`turn.tail`,{id:e.id,completed:!l,messageIds:e.messages.map(e=>e.id),toolCallIds:e.messages.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId))})]})}var zy=async()=>{throw Error(`Image is not available in the subtask history`)},By=()=>null,Vy=[];function Hy({row:e,parent:t,cwd:n,messages:r,error:i,retry:a,onBack:o}){let[s,c]=(0,O.useState)(`chat`),[l,u]=(0,O.useState)(null),d=e.subagent,f=Bn(r??[]),p=In(r??[]),m=[...p.at(-1)?.messages??[]].reverse().find(e=>e.role===`assistant`&&e.blocks.some(e=>e.kind===`text`&&e.text.trim()))?.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
41
|
+
|
|
42
|
+
`),h=t?R(`返回主对话`,`Back to parent conversation`):R(`返回对话`,`Back to conversation`);return(0,z.jsxs)(`div`,{className:Ct.root,"data-phase":`active`,"data-subagent-history":``,children:[(0,z.jsxs)(`header`,{className:Ct.header,children:[(0,z.jsxs)(`div`,{className:Ct.titleRow,children:[(0,z.jsxs)(`div`,{className:`pi-subagent-title`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`pi-subagent-back`,title:t&&(Py(t)||void 0),onClick:o,children:[`← `,h]}),(0,z.jsx)(`span`,{className:Ct.crumbCurrent,children:Py(e)})]}),(0,z.jsx)(`span`,{className:`pi-subagent-status`,"data-status":d.status,children:Ny(d.status)})]}),(0,z.jsxs)(`div`,{className:Ct.tabs,role:`tablist`,"aria-label":R(`子任务视图`,`Subtask views`),children:[(0,z.jsx)(`button`,{className:`${Ct.tab} ${s===`chat`?Ct.tabActive:``}`,role:`tab`,"aria-selected":s===`chat`,type:`button`,onClick:()=>c(`chat`),children:R(`执行记录`,`Execution log`)}),(0,z.jsx)(`button`,{className:`${Ct.tab} ${s===`trajectory`?Ct.tabActive:``}`,role:`tab`,"aria-selected":s===`trajectory`,type:`button`,onClick:()=>c(`trajectory`),children:R(`轨迹`,`Trajectory`)})]})]}),(0,z.jsx)(`div`,{className:Ct.body,children:(0,z.jsx)(`div`,{className:Ct.scrollBody,children:(0,z.jsxs)(`div`,{className:Ct.viewArea,children:[i&&(0,z.jsxs)(`div`,{className:`pi-subagent-history-meta`,role:`alert`,children:[R(`无法读取子任务记录。`,`Could not read the subtask history.`),` `,(0,z.jsx)(`button`,{type:`button`,className:`pi-subagent-back`,onClick:a,children:R(`重试`,`Retry`)})]}),!r&&!i&&(0,z.jsx)(`p`,{className:`pi-subagent-history-meta`,role:`status`,children:R(`正在读取子任务记录…`,`Loading subtask history…`)}),r&&(s===`trajectory`?(0,z.jsx)(ir,{messages:r,inspectCallId:l}):(0,z.jsxs)(`div`,{className:`${Tt.column} pi-subagent-history-column`,children:[(0,z.jsxs)(`div`,{className:`pi-subagent-history-meta`,children:[R(`只读子任务`,`Read-only subtask`),` · `,d.agentType,` · `,(0,z.jsx)(`code`,{children:d.agentId})]}),d.status===`completed`&&m&&(0,z.jsxs)(`details`,{className:`pi-subagent-instruction`,open:!0,children:[(0,z.jsx)(`summary`,{children:R(`任务结果`,`Result`)}),(0,z.jsx)(jt,{text:m,streaming:!1})]}),p.map(e=>(0,z.jsx)(Ry,{turn:e,results:f,model:null,loadImage:zy,cwd:n,renderPluginSlot:By,renderToolView:void 0,viewTools:Vy,artifactTools:Vy,superseded:e!==p.at(-1),onInspect:e=>{u(e),c(`trajectory`)}},e.id))]}))]})})})]})}function Uy({hero:e,suspended:t=!1,floating:n=null,floatingStatus:r,renderTranscript:i,latestTurnHasCard:a=!1,interaction:o,session:s,connection:c,onSend:u,onUpload:d,onDiscardAttachment:f,onStop:p,onResume:m,onCompact:h,onNewSession:g,commands:_,models:v,modelsStatus:y,onConfigureModels:x,onSetModel:S,onSetThinkingLevel:C,onUpdateQueuedPrompt:w,renderPluginSlot:T,plugins:E,onPluginAction:D}){let k=te(),A=s?.sessionId??``,[j,ee]=(0,O.useState)({}),M=j[A],N=M?.text??``,P=M?.attachments??[],F=M?.error??``,I=e=>{ee(t=>({...t,[A]:e(t[A]??{text:``,attachments:[],error:``})}))},L=e=>I(t=>({...t,text:e})),ne=e=>I(t=>({...t,attachments:typeof e==`function`?e(t.attachments):e})),re=e=>I(t=>({...t,error:e}));(0,O.useEffect)(()=>{F?st({key:`composer-error`,message:F}):ut(`composer-error`)},[F]);let ie=(0,O.useRef)(j);ie.current=j;let[B,ae]=(0,O.useState)(!1),[oe,se]=(0,O.useState)(null),[ce,le]=(0,O.useState)(0),[V,ue]=(0,O.useState)(0),[de,fe]=(0,O.useState)(!1),pe=(0,O.useRef)(0),me=(0,O.useRef)(null),he=(0,O.useRef)(new Map),ge=(0,O.useRef)(new Set),_e=(0,O.useRef)(null),ve=(0,O.useRef)(null),ye=(0,O.useRef)(s?.sessionId);ye.current=s?.sessionId;let be=(0,O.useRef)(!1),xe=(0,O.useRef)(t);(0,O.useEffect)(()=>{xe.current&&!t&&ve.current?.focus(),xe.current=t},[t]);let Se=c===`connected`&&s!==null,Ce=Se&&y===`ready`&&v.length===0,we=Se&&v.some(e=>`${e.provider}/${e.id}`===s.model),Te=Se&&!s.idle,Ee=Se&&!B&&!t,De=Ee&&!Te,ke=P.length===0&&[`/compact`,`/new`,`/model`].includes(N.trim()),Ae=(0,O.useMemo)(()=>p_(Fv(),_,E,k),[_,E,k]),je=h_(N,Ae),Me=je?.command.pluginId?je.command:void 0,Ne=je?.command.input?`${je.token}${/\s$/.test(N)||je.text?` `:``}`:null,Pe=je?.command.input&&!je.text?f_(je.command.input.hint,k)??null:null,Fe=Ee&&!s?.interactions?.length&&!(Te&&N.trimStart().startsWith(`/`))&&(y===`ready`&&we||!Te&&(ke||!!Me))&&(N.trim().length>0||P.length>0)&&P.every(e=>e.status===`ready`)&&(!Me||P.length===0||Me.input?.attachments===!0),Ie=__(E,s,k,N,P.length),Le=Ie?.icon,Re=De&&(Ie?.kind===`resume`||Ie?.kind===`invoke`)&&(Ie.kind===`invoke`&&!Ie.sendResultMessage||y===`ready`&&we),ze=Te&&!B&&!t,Be=oe===`slash`?N.slice(1).toLowerCase():``,Ve=oe===null?[]:g_(Te?Ae.filter(e=>!e.pluginId&&e.name===`file`):Ae,Be,oe===`slash`),He=n!==null,Ue=N.trim().length>0||P.length>0,[We,Ge]=(0,O.useState)(null),[Ke,qe]=(0,O.useState)(!1),Je=(0,O.useRef)(Ue);(0,O.useEffect)(()=>{Je.current&&!Ue?(Ge(null),qe(!1)):Ue&&!We&&n?.context&&Ge(n.context),Je.current=Ue},[Ue,n?.context,We]),(0,O.useEffect)(()=>{Ge(null),qe(!1)},[A]);let Ye=n===null||Ke?null:Ue&&We?((e,t)=>!!e&&!!t&&e.kind===t.kind&&e.contentId===t.contentId&&e.title===t.title)(We,n.context)?n.context:We:n.context,Xe=Ye?Ye.detail??Ye.title:``,[Ze,Qe]=(0,O.useState)(!1),[$e,et]=(0,O.useState)(null),tt=(0,O.useRef)(Te),nt=(0,O.useRef)(!1);(0,O.useEffect)(()=>{tt.current&&!Te&&He&&(a?(nt.current=!0,et(null),Qe(!0)):!Ze&&r.latestReply&&et({id:r.latestReply.id,compact:!1})),tt.current=Te},[Te,He,Ze,a,r.latestReply]);let rt=(0,O.useRef)(null),it=(0,O.useRef)(!0),at=(0,O.useCallback)(()=>{let e=rt.current;if(!e)return;let t=nt.current?[...e.querySelectorAll(`[data-tool-view]`)].at(-1):void 0;if(t){it.current=!1;let n=e.getBoundingClientRect();e.scrollTop=t.getBoundingClientRect().bottom-n.top+e.scrollTop-n.height+12}else it.current&&(e.scrollTop=e.scrollHeight)},[]);(0,O.useLayoutEffect)(at),(0,O.useEffect)(()=>{let e=rt.current?.firstElementChild;if(!Ze||!e)return;let t=new ResizeObserver(at);t.observe(e);let n=window.setTimeout(()=>{nt.current=!1},8e3);return()=>{t.disconnect(),window.clearTimeout(n)}},[Ze,at]),(0,O.useEffect)(()=>{He||(et(null),Qe(!1))},[He,A]);let ot=e=>{it.current=!0,Qe(e),e&&et(null)},ct=t||!!s?.interactions?.length,lt=(0,O.useRef)(null),dt=(0,O.useRef)(He),ft=(0,O.useRef)(!1);dt.current!==He&&(ft.current=!!_e.current?.contains(document.activeElement),dt.current=He),(0,O.useEffect)(()=>{if(!ft.current)return;ft.current=!1;let e=requestAnimationFrame(()=>ve.current?.focus());return()=>cancelAnimationFrame(e)},[He]);let pt=e=>{n?.onShowConversation(),e&&requestAnimationFrame(e)};(0,O.useEffect)(()=>{se(null)},[s?.sessionId,Te]),(0,O.useEffect)(()=>()=>{for(let e of Object.values(ie.current))for(let t of e.attachments)ge.current.add(t.key),t.receipt&&t.discard(t.receipt.id).catch(()=>{});for(let e of he.current.values())e.abort();he.current.clear()},[]),(0,O.useEffect)(()=>{if(oe===null)return;let e=e=>{e.target instanceof Node&&!_e.current?.contains(e.target)&&se(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[oe]);let mt=async e=>{if(Ee&&(De||!e.pluginId&&e.name===`file`)){if(oe===`slash`&&[`file`,`model`,`compact`,`new`].includes(e.name)&&L(``),se(null),!e.pluginId&&e.name===`file`)me.current?.click();else if(e.pluginId&&e.action&&e.menuOnly){ae(!0);try{await D(e.pluginId,e.action,{args:[]}),re(``)}catch(e){re(e instanceof Error?e.message:String(e))}finally{ae(!1)}}else if(!e.pluginId&&e.name===`model`)ue(e=>e+1);else if(!e.pluginId&&(e.name===`compact`||e.name===`new`)){ae(!0);try{await(e.name===`compact`?h():g())}catch{}finally{ae(!1)}}else L(`/${f_(e.input?.token,k)??e.name} `),ve.current?.focus()}},ht=(0,O.useCallback)((e,t)=>{let n=new AbortController;he.current.set(e,n),d(t,n.signal).then(t=>{ge.current.has(e)?f(t.id).catch(()=>{}):ne(n=>n.map(n=>n.key===e?{...n,status:`ready`,receipt:t,error:void 0}:n))}).catch(t=>{if(ge.current.has(e))return;let n=t instanceof Error?t.message:R(`上传失败`,`Upload failed`);re(n),ne(t=>t.map(t=>t.key===e?{...t,status:`error`,error:n}:t))}).finally(()=>{he.current.get(e)===n&&he.current.delete(e)})},[d,f,A]),gt=(0,O.useRef)(A);(0,O.useEffect)(()=>{let e=gt.current;if(e===A)return;gt.current=A;let t=ie.current[e];for(let e of t?.attachments??[])ge.current.add(e.key),he.current.get(e.key)?.abort();let n=ie.current[A],r=(n?.attachments??[]).map(e=>({key:l(),file:e.file,discard:f,status:`uploading`}));ee(i=>({...i,...t?{[e]:{...t,attachments:t.attachments.map(e=>({...e,receipt:void 0,status:`error`}))}}:{},...n?{[A]:{...n,attachments:r,error:``}}:{}})),r.forEach(e=>ht(e.key,e.file))},[A]);let _t=e=>{ge.current.add(e.key),he.current.get(e.key)?.abort(),e.receipt&&e.discard(e.receipt.id).catch(()=>{}),e.status===`error`&&!P.some(t=>t.key!==e.key&&t.status===`error`)&&re(``),ne(t=>t.filter(t=>t.key!==e.key))},vt=(0,O.useCallback)(e=>{if(!Ee||e.length===0)return;let t=Math.max(0,20-P.length),n=e.slice(0,t).filter(e=>e.size>0&&e.size<=20971520);n.length===e.length?re(``):re(R(`最多添加 20 个文件,单个文件不得超过 20 MB 且不能为空`,`Add up to 20 nonempty files, each no larger than 20 MB`));let r=n.map(e=>({key:l(),file:e,discard:f,status:`uploading`}));ne(e=>[...e,...r]),r.forEach(e=>ht(e.key,e.file))},[P.length,Ee,ht,f]);(0,O.useEffect)(()=>{if(He)return;let e=e=>e.dataTransfer?.types.includes(`Files`)??!1,t=()=>{pe.current=0,fe(!1)},n=t=>{e(t)&&(t.preventDefault(),pe.current++,fe(!0))},r=t=>{e(t)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=Ee?`copy`:`none`))},i=t=>{e(t)&&(pe.current=Math.max(0,pe.current-1),pe.current===0&&fe(!1))},a=n=>{if(!e(n))return;n.preventDefault();let r=[...n.dataTransfer?.files??[]];t(),vt(r)};return document.addEventListener(`dragenter`,n),document.addEventListener(`dragover`,r),document.addEventListener(`dragleave`,i),document.addEventListener(`drop`,a),window.addEventListener(`dragend`,t),()=>{document.removeEventListener(`dragenter`,n),document.removeEventListener(`dragover`,r),document.removeEventListener(`dragleave`,i),document.removeEventListener(`drop`,a),window.removeEventListener(`dragend`,t)}},[Ee,vt,He]);let yt=async(e=Te?`followUp`:void 0)=>{if(!Fe||be.current)return;be.current=!0,ae(!0);let t=N.trim(),n=P;ke||(L(``),ne([]));try{if(ke)t===`/model`?ue(e=>e+1):await(t===`/compact`?h():g()),L(``);else if(Me?.pluginId&&Me.action&&je){re(``);let e=await D(Me.pluginId,Me.action,{args:je.text.split(/\s+/).filter(Boolean),text:je.text,attachments:n.map(e=>e.receipt.id)});typeof e?.message==`string`&&e.message?await u(e.message,n.map(e=>e.receipt.id),n.map(e=>e.file)):n.length&&(ne(n),re(R(`指令未发送附件,文件仍保留在输入框`,`The command did not send the files; they remain in the composer`))),L(``)}else et(null),await u(t,n.map(e=>e.receipt.id),n.map(e=>e.file),e,Ye)}catch{ke||(L(t),ne(n))}finally{be.current=!1,ae(!1)}},bt=async()=>{if(ze&&!be.current){be.current=!0,ae(!0);try{await p()}catch{}finally{be.current=!1,ae(!1)}}},xt=async()=>{if(Re&&Ie&&!be.current){be.current=!0,ae(!0),re(``);try{await v_(Ie,D,e=>u(e,[],[]),p,()=>ye.current,m)}catch(e){Ie.kind!==`resume`&&ye.current===Ie.sessionId&&re(e instanceof Error?e.message:String(e))}finally{be.current=!1,ae(!1)}}},St=oe!==null&&(0,z.jsx)(Iv,{commands:Ve,active:ce,grouped:!Be,onHover:le,onPick:e=>{mt(e)}}),Ct=(0,z.jsx)(`input`,{ref:me,className:`pi-file-input`,type:`file`,multiple:!0,tabIndex:-1,"aria-label":R(`选择要上传的文件`,`Choose files to upload`),onChange:e=>{vt([...e.target.files??[]]),e.target.value=``}}),Tt=P.length>0&&(0,z.jsx)(`div`,{className:`pi-attachment-rail`,role:`group`,"aria-label":R(`待发送附件`,`Pending attachments`),children:P.map(e=>(0,z.jsx)(pr,{file:e.file,status:e.status,error:e.error,onRemove:()=>_t(e),onRetry:()=>{re(``),ne(t=>t.map(t=>t.key===e.key?{...t,status:`uploading`,error:void 0}:t)),ht(e.key,e.file)}},e.key))}),Et=(0,z.jsx)(d_,{ref:ve,value:N,claimToken:Ne,hint:Pe,editable:Se&&!B&&!t,placeholder:Se&&!Ce&&y===`ready`&&we&&He?Ye?R(`询问 Pi 关于「${Xe}」…`,`Ask Pi about ${Xe}…`):R(`询问 Pi…`,`Ask Pi…`):Ce?R(`先连接模型,再开始对话`,`Connect a model to start chatting`):Se&&y===`ready`&&!we?R(`先选择模型,再开始对话`,`Choose a model to start chatting`):Se?s&&E.map(e=>e.definition.composerPlaceholder?.(s,k)).find(Boolean)||R(`给 Pi 发送消息`,`Message Pi`):R(`打开 Pi 中 /web 给出的完整地址`,`Open the full address provided by /web in Pi`),ariaLabel:R(`给当前 Pi 会话发送消息`,`Send a message to the current Pi session`),menuOpen:oe!==null,activeOption:oe!==null&&Ve[ce]?`pi-command-${ce}`:void 0,onChange:e=>{L(e),De&&/^\/[^\s]*$/.test(e)?(se(`slash`),le(0)):oe===`slash`&&se(null)},onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),vt(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(oe!==null){if(e.key===`Escape`){e.preventDefault(),se(null);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),le(t=>(t+(e.key===`ArrowDown`?1:-1)+Ve.length)%Math.max(Ve.length,1));return}if((e.key===`Enter`||e.key===`Tab`)&&Ve[ce]){e.preventDefault(),mt(Ve[ce]);return}}e.key===`Escape`&&He?(e.preventDefault(),lt.current?.releaseFocus()):e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),yt(Te&&(e.ctrlKey||e.metaKey)?`steer`:Te?`followUp`:void 0))}}}),Dt=Te?(0,z.jsx)(ky,{hasDraft:N.trim().length>0||P.length>0,canSend:Fe,canStop:ze,pauseLabel:Ie?.label??R(`暂停执行`,`Pause`),pauseTitle:Ie?.title,pauseIcon:Le?(0,z.jsx)(Le,{size:16}):void 0,onStop:()=>{bt()}}):Ie?.kind===`invoke`||Ie?.kind===`resume`?(0,z.jsx)(`button`,{className:wt.primary,type:`button`,"aria-label":Ie.label,title:Ie.title,disabled:!Re,onClick:()=>{xt()},children:Le?(0,z.jsx)(Le,{size:16}):(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M5 2.5 13 8l-8 5.5z`,fill:`currentColor`})})}):(0,z.jsx)(`button`,{className:wt.primary,type:`submit`,"aria-label":R(`发送消息`,`Send message`),disabled:!Fe,children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M8.3125 0.980183C8.66767 1.0531 8.97902 1.20418 9.2627 1.43233C9.48724 1.61297 9.73029 1.85793 9.97949 2.10714L14.707 6.83468L13.293 8.24874L9 3.95577V15.0417H7V3.95577L2.70703 8.24874L1.29297 6.83468L6.02051 2.10714C6.26971 1.85793 6.51277 1.61297 6.7373 1.43233C6.97662 1.23986 7.28445 1.04402 7.6875 0.980183C7.8973 0.947006 8.1031 0.95516 8.3125 0.980183Z`,fill:`currentColor`})})}),Ot=Ce?(0,z.jsx)(`button`,{className:`pi-model-setup-trigger`,type:`button`,onClick:x,children:R(`配置模型`,`Set up a model`)}):(0,z.jsx)(or,{compact:He,openSignal:V,current:s?.model??null,models:v,disabled:!Se||!s?.idle,onSelect:S,thinkingLevel:s?.thinkingLevel??null,thinkingLevels:s?.thinkingLevels??[],onSelectThinkingLevel:C}),kt=Te&&N.trimStart().startsWith(`/`)&&(0,z.jsx)(`div`,{className:`pi-prompt-hint`,children:R(`运行中不执行斜杠指令,请等待当前回复结束`,`Wait for the current reply before running slash commands`)});if(n){let e=r.latestReply,t=$e&&e?.id===$e.id?e.text:null,a=Se?ct?`input`:Te?`running`:t?`unread`:F?`error`:`idle`:`offline`,s={offline:R(`Pi 未连接`,`Pi is disconnected`),input:R(`Pi 需要你的输入`,`Pi needs your input`),running:R(`Pi 正在处理`,`Pi is working`),unread:R(`Pi 已回复`,`Pi replied`),error:R(`发送遇到问题`,`Something went wrong`),idle:R(`询问 Pi`,`Ask Pi`)}[a]+` · ${/Mac|iPhone|iPad/u.test(navigator.platform)?`⌘J`:`Ctrl+J`}`,c=(0,z.jsxs)(`div`,{className:Q.statusLine,children:[(0,z.jsx)(`span`,{className:Q.pulse,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:Q.statusLabel,role:`status`,"aria-live":`polite`,children:r.label}),(0,z.jsxs)(`span`,{className:Q.statusMeta,"aria-hidden":`true`,children:[It(r.elapsedSeconds),r.queued>0?` · ${R(`排队 ${r.queued}`,`+${r.queued} queued`)}`:``]})]}),l=(0,z.jsxs)(`div`,{className:Q.statusLine,children:[(0,z.jsxs)(`svg`,{className:Q.warn,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,z.jsx)(`path`,{d:`M8 4.5v4.2M8 10.8v.7`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]}),(0,z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:Q.replyTitle,children:R(`Pi 需要你的输入`,`Pi needs your input`)}),(0,z.jsx)(`span`,{className:Q.replyActions,children:(0,z.jsx)(`button`,{type:`button`,className:Q.textButton,onClick:()=>pt(),children:R(`去回答`,`Answer`)})})]}),u=(0,z.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":R(`在完整对话中打开`,`Open the full chat`),title:R(`在完整对话中打开`,`Open the full chat`),onClick:()=>{et(null),pt()},children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M9.5 2.5h4v4M13.5 2.5 8 8M6.5 3.5h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),d=Ze?(0,z.jsxs)(`div`,{className:Q.transcript,"data-floating-transcript":!0,children:[(0,z.jsxs)(`div`,{className:Q.transcriptHead,children:[(0,z.jsx)(`span`,{className:Q.replyTitle,children:R(`对话`,`Conversation`)}),Te&&!ct&&(0,z.jsxs)(`span`,{className:Q.transcriptState,children:[(0,z.jsx)(`span`,{className:Q.pulse,"aria-hidden":`true`}),(0,z.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:r.label})]}),(0,z.jsxs)(`span`,{className:Q.replyActions,children:[u,(0,z.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":R(`收起对话`,`Hide conversation`),title:R(`收起对话`,`Hide conversation`),"aria-expanded":!0,onClick:()=>ot(!1),children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m4 6 4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]}),ct&&(0,z.jsx)(`div`,{className:Q.transcriptBanner,"data-floating-interaction":!0,children:o??l}),(0,z.jsx)(`div`,{ref:rt,className:Q.transcriptBody,"data-floating-transcript-body":!0,onWheel:()=>{nt.current=!1},onPointerDown:()=>{nt.current=!1},onKeyDown:()=>{nt.current=!1},onScroll:e=>{if(nt.current)return;let t=e.currentTarget;it.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},children:i?.()??null})]}):ct?o?(0,z.jsx)(`div`,{"data-floating-interaction":!0,children:o}):l:Te?(0,z.jsxs)(z.Fragment,{children:[c,r.tail&&(0,z.jsx)(`div`,{className:Q.tail,children:r.tail})]}):t!==null&&$e?$e.compact?(0,z.jsxs)(`button`,{type:`button`,className:Q.summary,onClick:()=>et({...$e,compact:!1}),children:[(0,z.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:R(`Pi 已回复`,`Pi replied`)}),(0,z.jsx)(`span`,{children:R(`查看`,`View`)})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:Q.replyHead,children:[(0,z.jsx)(`span`,{className:Q.replyTitle,role:`status`,"aria-live":`polite`,children:R(`Pi 已回复`,`Pi replied`)}),(0,z.jsxs)(`span`,{className:Q.replyActions,children:[(0,z.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":R(`复制回复`,`Copy reply`),title:R(`复制回复`,`Copy reply`),onClick:()=>{navigator.clipboard?.writeText(t).catch(()=>{})},children:(0,z.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,z.jsx)(`rect`,{x:`5`,y:`5`,width:`8.5`,height:`8.5`,rx:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,z.jsx)(`path`,{d:`M3.5 10.5h-.2A1.3 1.3 0 0 1 2 9.2V3.3A1.3 1.3 0 0 1 3.3 2h5.9a1.3 1.3 0 0 1 1.3 1.3v.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`})]})}),u,(0,z.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":R(`关闭回复`,`Dismiss reply`),title:R(`关闭回复`,`Dismiss reply`),onClick:()=>et(null),children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m4 4 8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`})})})]})]}),(0,z.jsx)(`div`,{className:Q.replyBody,children:(0,z.jsx)(jt,{text:t,streaming:!1})}),(0,z.jsx)(`div`,{className:Q.replyFoot,children:(0,z.jsx)(`button`,{type:`button`,className:Q.textButton,onClick:()=>ot(!0),children:R(`展开对话`,`Show conversation`)})})]}):null,f=e=>e.dataTransfer.types.includes(`Files`);return(0,z.jsx)(fy,{host:n.host,bounds:n.panel,status:oe===null?d:null,iconState:a,iconLabel:s,labels:{region:R(`询问 Pi`,`Ask Pi`),grip:R(`移动输入框:方向键移动,Home 复位`,`Move composer: arrow keys move, Home resets`),snapHint:R(`拖动以移动,双击复位`,`Drag to move, double-click to reset`)},focusInput:()=>ve.current?.focus(),onContentPointerDown:()=>et(e=>e&&!e.compact?{...e,compact:!0}:e),children:e=>(lt.current=e,(0,z.jsxs)(`form`,{ref:_e,className:Q.form,"data-composer-card":!0,"data-floating-form":!0,onSubmit:e=>{e.preventDefault(),yt()},onDragOver:e=>{f(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=Ee?`copy`:`none`)},onDrop:e=>{f(e)&&(e.preventDefault(),vt([...e.dataTransfer.files]))},children:[St,Ct,Tt,(0,z.jsxs)(`div`,{className:Q.line,children:[Ye&&(0,z.jsxs)(`span`,{className:Q.chip,"data-pinned":Ue||void 0,"data-floating-context":!0,title:Ue?R(`本条消息会附带「${Ye.title} · ${Xe}」`,`This message is about ${Ye.title} · ${Xe}`):R(`当前标签页:${Ye.title}`,`Tab in view: ${Ye.title}`),children:[Ye.kind===`files`||Ye.kind===`file-preview`?(0,z.jsx)(b,{...Ye.detail?{path:Ye.detail.split(` · `)[0]}:{kind:`folder`},size:14,className:Q.chipIcon}):(0,z.jsxs)(`svg`,{className:Q.chipIcon,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,z.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,z.jsx)(`path`,{d:`M2 6.2h12`,stroke:`currentColor`,strokeWidth:`1.3`})]}),(0,z.jsx)(`span`,{className:Q.chipLabel,children:Xe}),(0,z.jsx)(`button`,{type:`button`,className:Q.chipRemove,"aria-label":R(`不附带标签页上下文`,`Remove tab context`),onClick:()=>{qe(!0),ve.current?.focus()},children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m4 4 8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),(0,z.jsx)(`div`,{className:Q.editor,children:Et}),(0,z.jsx)(`span`,{className:Q.model,"data-floating-model":!0,children:Ot}),(0,z.jsx)(`button`,{className:Q.action,type:`button`,"data-active":Ze||void 0,"aria-expanded":Ze,"aria-label":Ze?R(`收起对话`,`Hide conversation`):R(`展开对话`,`Show conversation`),title:Ze?R(`收起对话`,`Hide conversation`):R(`展开对话`,`Show conversation`),onMouseDown:e=>e.preventDefault(),onClick:()=>ot(!Ze),children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M3 4.6A1.6 1.6 0 0 1 4.6 3h6.8A1.6 1.6 0 0 1 13 4.6v4.8A1.6 1.6 0 0 1 11.4 11H7.2L4.4 13.2V11h0A1.6 1.6 0 0 1 3 9.4z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinejoin:`round`})})}),(0,z.jsx)(`button`,{className:Q.action,type:`button`,"aria-label":R(`添加指令`,`Add command`),title:R(`添加指令`,`Add command`),"aria-haspopup":`listbox`,"aria-expanded":oe!==null,disabled:!Ee,onMouseDown:e=>e.preventDefault(),onClick:()=>{se(oe===null?`button`:null),le(0),ve.current?.focus()},children:(0,z.jsx)(Oe,{size:16})}),(0,z.jsx)(`button`,{className:Q.action,type:`button`,"aria-label":R(`收起输入框`,`Collapse composer`),title:R(`收起输入框`,`Collapse composer`),onMouseDown:e=>e.preventDefault(),onClick:e.collapse,children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m4 6 4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,z.jsx)(`span`,{className:Q.send,children:Dt})]}),kt]}))})}return(0,z.jsxs)(`div`,{hidden:t,className:`${wt.root} ${e?wt.hero:``} ${t?wt.suspended:``}`,children:[de&&(0,z.jsx)(Rv,{disabled:!Ee,labels:{title:Ee?R(`松开以上传文件`,`Drop to upload files`):R(`当前无法上传文件`,`Files cannot be uploaded now`),desc:Ee?R(`最多 20 个文件,每个不超过 20 MB`,`Up to 20 files, 20 MB each`):void 0}}),(0,z.jsx)(Dy,{session:s,onUpdate:w,connected:Se},s?.sessionId),(0,z.jsxs)(`form`,{ref:_e,className:wt.card,"data-composer-card":!0,onSubmit:e=>{e.preventDefault(),yt()},children:[St,Ct,Tt,Et,(0,z.jsxs)(`div`,{className:wt.row,children:[(0,z.jsxs)(`div`,{className:wt.tools,children:[(0,z.jsx)(`button`,{className:wt.add,type:`button`,"aria-label":R(`添加指令`,`Add command`),title:R(`添加指令`,`Add command`),"aria-haspopup":`listbox`,"aria-expanded":oe!==null,disabled:!Ee,onMouseDown:e=>e.preventDefault(),onClick:()=>{se(oe===null?`button`:null),le(0),ve.current?.focus()},children:(0,z.jsx)(Oe,{size:16})}),T(`composer.controls`)]}),(0,z.jsxs)(`div`,{className:wt.trailing,children:[Ot,Dt]})]}),kt]})]})}function Wy(e,t,n,r,i){let a=t?.blocks.at(-1),o=n&&!t?R(`正在发送`,`Sending`):a?.kind===`toolCall`?R(`正在运行 ${a.toolName??`工具`}`,`Running ${a.toolName??`a tool`}`):a?.kind===`thinking`?R(`正在思考`,`Thinking`):a?.kind===`text`&&a.text.trim()?R(`正在回复`,`Writing a reply`):R(`正在处理`,`Working`),s=t?.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
43
|
+
`).trim()??``,c=s.length>240?`…${s.slice(-240)}`:s,l=(e?.promptQueue?.steering.length??0)+(e?.promptQueue?.followUp.length??0)+(e?.queuedPrompts?.length??0),u=null;for(let t of[...e?.messages??[]].reverse()){if(t.role===`user`)break;if(t.role!==`assistant`)continue;let e=t.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
44
|
+
|
|
45
|
+
`).trim();if(e){u={id:t.id,text:e};break}}return{working:r,label:o,elapsedSeconds:i,tail:c,queued:l,latestReply:u}}function Gy({floating:e=null,rightbarControl:t,composerInteraction:n,session:r,streaming:i,connection:a,error:o,onDismissError:s,onSend:c,onLoadImage:u,onUpload:d,onDiscardAttachment:f,onStop:p,onResume:m,onCompact:h,onNewSession:g,commands:_,models:v,modelsStatus:y,onConfigureModels:b,onSetModel:x,onSetThinkingLevel:S,onUpdateQueuedPrompt:C,renderPluginSlot:w,renderToolView:T,renderCallAction:E,plugins:D,onPluginAction:k}){let[A,j]=(0,O.useState)(`chat`),[ee,M]=(0,O.useState)(null),[N,P]=(0,O.useState)(null),F=N&&r?.sessionId===N.sessionId&&r.messages.some(e=>e.role===`user`&&!N.knownIds.has(e.id)&&Kv(e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
46
|
+
`)).text===N.text);(0,O.useEffect)(()=>{N&&(F||r&&r.sessionId!==N.sessionId)&&P(null)},[N,F,r?.sessionId]);let I=N&&!F&&r?.sessionId===N.sessionId?{id:N.id,role:`user`,timestamp:N.timestamp,blocks:[{kind:`text`,text:N.wire},...N.files.filter(e=>/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type)).map(()=>({kind:`image`,text:``}))],localFiles:N.files}:null,te=Bt(r,i,a,I!==null),L=zt(r,i,a,I!==null),ne=Vt(L,r?.sessionId,r?.activityId),re=I!==null,ie=(0,O.useMemo)(()=>Wy(r,i,re,L,ne),[r,i,re,L,ne]),B=(0,O.useMemo)(()=>D.flatMap(e=>e.definition.workbench?.toolViews?.flatMap(e=>e.tools)??[]),[D]),ae=(0,O.useMemo)(()=>D.flatMap(e=>e.definition.artifactTools??[]),[D]),oe=(0,O.useCallback)(e=>{M(e),j(`trajectory`)},[]),se=Un(r?.sessionId,[...r?.messages??[],...I?[I]:[],...i?[i]:[]],B),ce=r===null||se.messages.length===0&&te===null,le=(0,O.useRef)(s);le.current=s,(0,O.useEffect)(()=>{if(!o)return;let e=My(o);st({key:`conversation-error`,message:e.message,detail:e.raw===e.message?void 0:e.raw,detailLabel:R(`诊断信息`,`Diagnostics`)}),le.current()},[o]);let V=(0,O.useRef)(se.retry);V.current=se.retry,(0,O.useEffect)(()=>{se.error?st({key:`transcript-cleanup`,message:se.error,action:{label:R(`重试视图清理`,`Retry view cleanup`),onClick:()=>V.current()}}):ut(`transcript-cleanup`)},[se.error]);let ue=async(e,t,n,i,a)=>{if(!r)return;let o=Uv(e,a);if(i){await c(o,t,i);return}let s=`pending-${l()}`;P({id:s,sessionId:r.sessionId,text:e,wire:o,files:n,knownIds:new Set(r.messages.map(e=>e.id)),timestamp:new Date().toISOString()});try{await c(o,t)}catch(e){throw P(e=>e?.id===s?null:e),e}},de=(0,O.useRef)(null),{scroll:fe,content:pe,composer:me,onScroll:he,onWheel:ge,showLatest:_e,returnToLatest:ve}=Ay(r?.sessionId,!ce&&A===`chat`,I?.id),[ye,be]=(0,O.useState)(0);(0,O.useLayoutEffect)(()=>{let e=de.current;if(!e)return;let t=()=>be(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let Se=r?.cwd.split(/[\\/]/).filter(Boolean).at(-1)||R(`Pi 工作区`,`Pi workspace`),Ce=se.messages,we=Bn(Ce),Te=In(Ce),Ee=()=>{let e=Te.slice(-20);return e.length===0&&!te?(0,z.jsx)(`p`,{className:`pi-floating-transcript-empty`,children:R(`还没有对话。`,`No messages yet.`)}):(0,z.jsxs)(`div`,{className:`pi-floating-transcript`,children:[e.map(e=>(0,z.jsx)(Ry,{turn:e,results:we,model:r?.model??null,loadImage:u,cwd:r?.cwd,renderPluginSlot:w,renderToolView:T,viewTools:B,artifactTools:ae,running:e===Te.at(-1)&&!r?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==Te.at(-1),onInspect:oe},Rn(e,B))),te&&(0,z.jsx)(Rt,{state:te,elapsedSeconds:ne})]})},De=Ln(Te.at(-1)?.messages??[],B).some(({call:e})=>Vn(e.toolCallId?we.get(e.toolCallId):void 0));return(0,z.jsxs)(`div`,{ref:de,className:Ct.root,"data-phase":ce?`hero`:`active`,style:{"--piw-conversation-column-width":`${ye}px`},children:[ce&&(0,z.jsx)(`div`,{className:Ct.heroTools,children:t}),r&&!ce&&(0,z.jsxs)(`header`,{className:Ct.header,children:[(0,z.jsxs)(`div`,{className:Ct.titleRow,children:[(0,z.jsx)(`div`,{className:Ct.titleCluster,children:(0,z.jsx)(`div`,{className:Ct.crumbs,children:(0,z.jsx)(`span`,{className:`${Ct.crumb} ${Ct.crumbCurrent}`,children:r.name||R(`新会话`,`New chat`)})})}),(0,z.jsxs)(`div`,{className:Ct.headerActions,children:[t,(0,z.jsx)(xe,{state:a===`connected`?r.idle?`done`:`ongoing`:`error`}),(0,z.jsx)(`span`,{className:`pi-header-state`,children:a===`connected`?r.idle?R(`已连接`,`Connected`):R(`运行中`,`Running`):R(`已断开`,`Disconnected`)})]})]}),(0,z.jsxs)(`div`,{className:Ct.tabs,role:`tablist`,"aria-label":R(`会话视图`,`Session views`),children:[(0,z.jsx)(`button`,{className:`${Ct.tab} ${A===`chat`?Ct.tabActive:``}`,role:`tab`,"aria-selected":A===`chat`,type:`button`,onClick:()=>j(`chat`),children:R(`对话`,`Chat`)}),(0,z.jsx)(`button`,{className:`${Ct.tab} ${A===`trajectory`?Ct.tabActive:``}`,role:`tab`,"aria-selected":A===`trajectory`,type:`button`,onClick:()=>j(`trajectory`),children:R(`轨迹`,`Trajectory`)})]})]}),(0,z.jsx)(`div`,{className:Ct.body,children:(0,z.jsxs)(`div`,{ref:fe,className:Ct.scrollBody,"data-conversation-scroll":``,onScroll:he,onWheel:ge,children:[!ce&&(0,z.jsx)(`div`,{ref:pe,className:Ct.viewArea,children:A===`chat`?(0,z.jsx)(`div`,{className:Tt.root,children:(0,z.jsx)(`div`,{className:Tt.scroll,children:(0,z.jsx)(`div`,{className:Tt.column,children:(0,z.jsxs)(z.Fragment,{children:[Te.map(e=>(0,z.jsx)(Ry,{turn:e,results:we,model:r?.model??null,loadImage:u,cwd:r?.cwd,renderPluginSlot:w,renderToolView:T,viewTools:B,artifactTools:ae,running:e===Te.at(-1)&&!r?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==Te.at(-1),onInspect:oe},Rn(e,B))),te&&(0,z.jsx)(Rt,{state:te,elapsedSeconds:ne})]})})})}):(0,z.jsx)(ir,{messages:Ce,inspectCallId:ee,renderCallAction:E})}),(0,z.jsx)(`div`,{ref:me,className:Ct.composerSeat,"data-composer-seat":``,children:(0,z.jsxs)(`div`,{className:`${Ct.composerStack} ${ce?Ct.composerHero:``}`,children:[ce&&(0,z.jsx)(St,{t:e=>({"hero.headline":R(`有什么可以帮你?`,`How can I help?`),"hero.preview":`Pi`})[e]??e,renderSlot:(e,t,n)=>n?.fallback??null}),ce&&(0,z.jsx)(`div`,{className:Ct.heroWorkspaceRow,children:(0,z.jsxs)(`span`,{className:xt.workspace,children:[(0,z.jsx)(He,{size:16}),(0,z.jsx)(`span`,{className:xt.workspaceLabel,children:Se})]})}),!e&&n,(0,z.jsx)(Uy,{interaction:e?n:void 0,floating:e,floatingStatus:ie,renderTranscript:Ee,latestTurnHasCard:De,suspended:n!=null,hero:ce,session:r,connection:a,onSend:ue,onUpdateQueuedPrompt:C,onUpload:d,onDiscardAttachment:f,onStop:p,onResume:m,onCompact:h,onNewSession:g,commands:_,models:v,modelsStatus:y,onConfigureModels:b,onSetModel:x,onSetThinkingLevel:S,renderPluginSlot:w,plugins:D,onPluginAction:k})]})}),_e&&(0,z.jsx)(`div`,{className:Tt.toBottomSlot,children:(0,z.jsx)(`button`,{className:Tt.toBottom,type:`button`,"aria-label":R(`回到最新`,`Back to latest`),title:R(`回到最新并继续跟随`,`Back to latest and resume following`),onClick:ve,children:(0,z.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M8 2v12m-5-5 5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})})]})})]})}var Ky={button:`_button_cfgyt_4`,md:`_md_cfgyt_24`,sm:`_sm_cfgyt_30`,primary:`_primary_cfgyt_38`,ghost:`_ghost_cfgyt_47`,outline:`_outline_cfgyt_56`,toolbar:`_toolbar_cfgyt_65`,icon:`_icon_cfgyt_73`};function qy({variant:e=`ghost`,size:t=`md`,icon:n,className:r,children:i,...a}){return(0,z.jsxs)(`button`,{type:`button`,className:h(Ky.button,Ky[e],Ky[t],r),...a,children:[n!=null&&(0,z.jsx)(`span`,{className:Ky.icon,children:n}),i]})}var Jy={root:`_root_w1urq_2`,mask:`_mask_w1urq_14`,dialog:`_dialog_w1urq_22`,content:`_content_w1urq_37`,header:`_header_w1urq_45`,title:`_title_w1urq_53`,close:`_close_w1urq_61`,description:`_description_w1urq_80`,body:`_body_w1urq_89`,footer:`_footer_w1urq_97`};function Yy({open:e,onClose:t,title:n,closeLabel:r,description:i,children:a,footer:o,className:s,contentClassName:c,headless:l=!1}){let u=(0,O.useRef)(null);return ce(u,e,t),e?(0,Qe.createPortal)((0,z.jsx)(y.Provider,{value:u,children:(0,z.jsxs)(`div`,{className:Jy.root,role:`presentation`,children:[(0,z.jsx)(`div`,{className:Jy.mask,"aria-hidden":`true`,onClick:t}),(0,z.jsx)(`div`,{ref:u,tabIndex:-1,className:h(Jy.dialog,s),role:`dialog`,"aria-modal":`true`,"aria-label":n,children:l?a:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:h(Jy.content,c),children:[(0,z.jsxs)(`div`,{className:Jy.header,children:[(0,z.jsx)(`h2`,{className:Jy.title,children:n}),(0,z.jsx)(`button`,{type:`button`,className:Jy.close,"aria-label":r,onClick:t,children:(0,z.jsx)(Me,{size:14})})]}),i!==void 0&&i!==``&&(0,z.jsx)(`p`,{className:Jy.description,children:i}),a!==void 0&&(0,z.jsx)(`div`,{className:Jy.body,children:a})]}),o!==void 0&&(0,z.jsx)(`div`,{className:Jy.footer,children:o})]})})]})}),document.body):null}var Xy={group:`_group_dk59e_4`,workspaceLine:`_workspaceLine_dk59e_5`,workspaceButton:`_workspaceButton_dk59e_7`,workspaceTitle:`_workspaceTitle_dk59e_8`,folder:`_folder_dk59e_9`,folderActive:`_folderActive_dk59e_10`,unavailable:`_unavailable_dk59e_11`,chevron:`_chevron_dk59e_12`,chevronOpen:`_chevronOpen_dk59e_13`,rowActions:`_rowActions_dk59e_16`,rowAction:`_rowAction_dk59e_16`,sessionButton:`_sessionButton_dk59e_23`,sessionLine:`_sessionLine_dk59e_24`,sessionGroup:`_sessionGroup_dk59e_25`,taskGroup:`_taskGroup_dk59e_26`,taskToggle:`_taskToggle_dk59e_27`,orphanGroup:`_orphanGroup_dk59e_28`,taskLine:`_taskLine_dk59e_29`,inlineTaskToggle:`_inlineTaskToggle_dk59e_30`,taskRow:`_taskRow_dk59e_32`,taskChevron:`_taskChevron_dk59e_33`,taskChevronOpen:`_taskChevronOpen_dk59e_33`,taskStatus:`_taskStatus_dk59e_35`,sessionTime:`_sessionTime_dk59e_42`,untitled:`_untitled_dk59e_46`,renameInput:`_renameInput_dk59e_47`,menu:`_menu_dk59e_53`,menuItem:`_menuItem_dk59e_54`,menuItemNeutral:`_menuItemNeutral_dk59e_56`,menuHint:`_menuHint_dk59e_58`};function Zy({title:e,active:t,disabled:n,open:r,onOpenChange:i,onRemove:a}){return(0,z.jsx)($y,{label:R(`${e} 的工作区操作`,`Workspace actions for ${e}`),title:R(`工作区操作`,`Workspace actions`),disabled:n,open:r,onOpenChange:i,items:[{label:R(`从列表移除工作区`,`Remove workspace from list`),icon:(0,z.jsx)(Le,{}),destructive:!0,disabled:t,onSelect:a}],hint:t?R(`请先切换到其他工作区再移除`,`Switch to another workspace before removing`):R(`不删除目录、文件或会话历史`,`Keeps directories, files and session history`)})}function Qy({title:e,disabled:t,open:n,onOpenChange:r,onRename:i,onDelete:a}){return(0,z.jsx)($y,{label:R(`${e} 的会话操作`,`Chat actions for ${e}`),title:R(`会话操作`,`Chat actions`),disabled:t,open:n,onOpenChange:r,items:[{label:R(`重命名`,`Rename`),icon:(0,z.jsx)(Fe,{}),onSelect:i},{label:R(`删除会话`,`Delete chat`),icon:(0,z.jsx)(Le,{}),destructive:!0,onSelect:a}]})}function $y({label:e,title:t,disabled:n,open:r,onOpenChange:i,items:a,hint:o}){let s=(0,O.useRef)(null),c=(0,O.useRef)(null),[l,u]=(0,O.useState)({top:0,left:0}),d=(0,O.useRef)({onOpenChange:i});d.current={onOpenChange:i};let f=(e=!0)=>{i(!1),e&&s.current?.focus()};return(0,O.useLayoutEffect)(()=>{if(!r)return;let e=s.current.getBoundingClientRect(),t=c.current.getBoundingClientRect().height;u({top:Math.max(12,Math.min(e.bottom+4,window.innerHeight-t-12)),left:Math.max(12,Math.min(e.right-220,window.innerWidth-232))}),(c.current?.querySelector(`button:not(:disabled)`)??c.current)?.focus();let n=e=>{!c.current?.contains(e.target)&&!s.current?.contains(e.target)&&d.current.onOpenChange(!1)},i=()=>{d.current.onOpenChange(!1),s.current?.focus()};return document.addEventListener(`pointerdown`,n,!0),window.addEventListener(`resize`,i),window.addEventListener(`scroll`,i,!0),()=>{document.removeEventListener(`pointerdown`,n,!0),window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0)}},[r]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{ref:s,type:`button`,className:Xy.rowAction,disabled:n,"aria-label":e,title:t,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>r?f():i(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),i(!0))},children:(0,z.jsx)(De,{})}),r&&(0,Qe.createPortal)((0,z.jsxs)(_,{ref:c,role:`menu`,tabIndex:-1,"aria-label":e,className:Xy.menu,style:l,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),f();else if(e.key===`Tab`)f();else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=[...c.current?.querySelectorAll(`button:not(:disabled)`)??[]],n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()}},children:[a.map(e=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${Xy.menuItem} ${e.destructive?``:Xy.menuItemNeutral}`,disabled:n||e.disabled,onClick:()=>{f(),e.onSelect()},children:[e.icon,e.label]},e.label)),o&&(0,z.jsx)(`p`,{className:Xy.menuHint,children:o})]}),document.body)]})}function eb(e,t,n){let r=Date.parse(e);if(!Number.isFinite(r))return``;let i=Math.max(0,Math.floor((t-r)/6e4));if(i<1)return n===`zh`?`刚刚`:`now`;let[a,o,s]=[[525600,`年`,`yr`],[43200,`个月`,`mo`],[10080,`周`,`wk`],[1440,`天`,`d`],[60,`小时`,`h`],[1,`分钟`,`min`]].find(([e])=>i>=e);return`${Math.floor(i/a)}${n===`zh`?o:s}`}var tb={dialog:`_dialog_s0tgk_1`,editorScope:`_editorScope_s0tgk_21`,header:`_header_s0tgk_26`,title:`_title_s0tgk_35`,crumbBar:`_crumbBar_s0tgk_51`,crumbEditZone:`_crumbEditZone_s0tgk_65`,pathInput:`_pathInput_s0tgk_67`,millerRow:`_millerRow_s0tgk_78`,crumbTrail:`_crumbTrail_s0tgk_91`,crumbSeat:`_crumbSeat_s0tgk_101`,crumb:`_crumb_s0tgk_51`,crumbChevron:`_crumbChevron_s0tgk_128`,crumbEditGlyph:`_crumbEditGlyph_s0tgk_151`,content:`_content_s0tgk_187`,column:`_column_s0tgk_186`,divider:`_divider_s0tgk_216`,rowSeat:`_rowSeat_s0tgk_222`,row:`_row_s0tgk_222`,rowSelected:`_rowSelected_s0tgk_247`,rowIcon:`_rowIcon_s0tgk_252`,rowIconSelected:`_rowIconSelected_s0tgk_257`,rowName:`_rowName_s0tgk_262`,rowChevron:`_rowChevron_s0tgk_274`,status:`_status_s0tgk_279`,error:`_error_s0tgk_280`,loadingFloat:`_loadingFloat_s0tgk_192`,footerBar:`_footerBar_s0tgk_317`,showHiddenToggle:`_showHiddenToggle_s0tgk_333`,showHiddenToggleActive:`_showHiddenToggleActive_s0tgk_357`,footerGap:`_footerGap_s0tgk_361`,footerAction:`_footerAction_s0tgk_365`,createDialog:`_createDialog_s0tgk_370`,createBody:`_createBody_s0tgk_376`,createTitle:`_createTitle_s0tgk_383`,createIn:`_createIn_s0tgk_391`,createInput:`_createInput_s0tgk_398`,createActions:`_createActions_s0tgk_416`};function nb(e){if(typeof e==`object`&&e&&`rpcError`in e){let t=e.rpcError;if(typeof t==`object`&&t&&`message`in t&&typeof t.message==`string`)return t.message}return e instanceof Error?e.message:String(e)}var rb=300,ib=200,ab=250;function ob(e,t){let n=e.crumbs.findIndex(t=>t.path===e.home);if(n===-1)return e.crumbs;let r=e.crumbs.slice(n+1);return[{name:t,path:e.home,hidden:!1},...r]}function sb(e){return e.home.includes(`\\`)?`\\`:`/`}function cb(e){let t=sb(e);return e.path.endsWith(t)?e.path:`${e.path}${t}`}function lb(e,t){let n=sb(e)===`\\`?Math.max(t.lastIndexOf(`\\`),t.lastIndexOf(`/`)):t.lastIndexOf(`/`);return n===-1?null:t.slice(0,n+1)}function ub(e,t,n){let r=lb(e,t);return r===null?{directory:null,tail:null}:{directory:r,tail:r===cb(e)||n!==null&&n.directory===r&&n.landed===e.path?t.slice(r.length):null}}function db(e,t,n,r){let i=r===null?``:r.toLowerCase(),a=e=>n||!e.hidden||i.startsWith(`.`),o=e=>a(e)&&e.name.toLowerCase().startsWith(i),s=i!==``&&e.some(o);return e.filter(e=>e.path===t?!0:s?o(e):n||!e.hidden)}function fb({entries:e,selectedPath:t,busy:n,onPick:r,showHidden:i,filterPrefix:a,pathEditing:o}){let s=db(e,t,i,a);return(0,z.jsx)(`div`,{className:tb.column,role:`list`,children:s.map(e=>{let i=e.path===t;return(0,z.jsx)(`span`,{role:`listitem`,className:tb.rowSeat,children:(0,z.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,className:h(tb.row,i&&tb.rowSelected),disabled:n,onMouseDown:o?e=>{e.preventDefault()}:void 0,onClick:()=>{r(e)},children:[i?(0,z.jsx)(He,{size:16,className:tb.rowIconSelected}):(0,z.jsx)(Ue,{size:16,className:tb.rowIcon}),(0,z.jsx)(`span`,{className:tb.rowName,children:e.name}),(0,z.jsx)(je,{size:12,className:tb.rowChevron})]})},e.path)})})}function pb({open:e,listDirectory:t,createDirectory:n,onOpen:r,onClose:i,busy:a,t:o}){let[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(!1),[g,_]=(0,O.useState)(!1),[v,y]=(0,O.useState)(0),[b,x]=(0,O.useState)(null),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(!1),[E,D]=(0,O.useState)(null),[k,A]=(0,O.useState)(!1),[j,ee]=(0,O.useState)(null),M=(0,O.useRef)(0),N=(0,O.useRef)(null),P=(0,O.useRef)(0),F=(0,O.useRef)(null),I=(0,O.useRef)(!1);(0,O.useEffect)(()=>()=>{M.current+=1,P.current+=1,N.current?.abort()},[]);let te={onCompositionStart:()=>{I.current=!0},onCompositionEnd:()=>{I.current=!1}},L=(0,O.useCallback)(()=>(N.current?.abort(),N.current=null,++M.current),[]),R=(0,O.useCallback)(()=>{_(!1),y(e=>e+1)},[]),ne=(0,O.useCallback)(e=>{let n=L(),r=new AbortController;return N.current=r,R(),{seq:n,scan:t(e,r.signal)}},[L,R,t]),re=(0,O.useCallback)(e=>{let n=new AbortController;return N.current=n,R(),t(e,n.signal)},[R,t]),ie=(0,O.useRef)(!1),B=(0,O.useRef)({parent:null,child:null});(0,O.useEffect)(()=>{B.current={parent:s,child:d}},[s,d]);let ae=(0,O.useRef)(null),oe=(0,O.useRef)(!1),se=(0,O.useCallback)((e,t)=>{let{seq:n,scan:r}=ne(e);m(!0),t.announce&&x(null);let i=()=>{m(!1),t.closeEditor?C(null):(x(null),oe.current=!0)};r.then(r=>{if(n!==M.current)return;!t.closeEditor&&e!==void 0&&(ae.current={directory:e,landed:r.path});let a=!1,o=()=>{a||n!==M.current||(a=!0,c(r),u(null),f(null),i())};if(ob(r,``).length<2){o();return}let s=r.crumbs.at(-2);s===void 0?o():(re(s.path).then(e=>{if(n!==M.current)return;let t=sb(e),s=e=>t===`\\`?e.toLowerCase():e,l=e.entries.find(e=>s(e.path)===s(r.path));l===void 0?o():(a=!0,c(e),u(l),f(r),i())},()=>{o()}),t.closeEditor&&window.setTimeout(o,ib))},e=>{n===M.current&&(m(!1),t.announce&&x(nb(e)))})},[ne,re]),ce=(0,O.useCallback)(e=>{se(e,{closeEditor:!0,announce:!0})},[se]),le=(0,O.useRef)(!1),V=(0,O.useRef)(!1),ue=(0,O.useRef)(null),de=(0,O.useRef)(null),fe=(0,O.useCallback)(e=>{let{seq:t,scan:n}=ne(e.path);S!==null&&(le.current=!0),C(null),u(e),f(null),m(!0),x(null),n.then(e=>{t===M.current&&(f(e),m(!1))},e=>{t===M.current&&(m(!1),x(nb(e)),u(null),V.current=!0)})},[ne,S]),pe=(0,O.useCallback)(e=>{se(e,{closeEditor:!1,announce:!1})},[se]),me=(0,O.useCallback)(()=>{L(),m(!1),C(null),x(null),d===null&&u(null),s===null&&ce()},[L,d,s,ce]),he=(0,O.useCallback)(e=>{d!==null&&(c(d),fe(e))},[d,fe]);(0,O.useEffect)(()=>{P.current+=1,e?(c(null),u(null),f(null),A(!1),T(!1),ce()):(L(),m(!1),x(null),C(null),D(null),ee(null),le.current=!1,V.current=!1)},[e,ce,L]);let ge=l?.path??s?.path??null,_e=l?.name??(s===null?``:ob(s,o(`browser.home`)).at(-1)?.name??s.path),ve=()=>{if(ge===null||E===null||k)return;let e=E;if(e.trim()===``)return;A(!0),ee(null);let t=P.current;n(ge,e).then(n=>{if(t!==P.current)return;A(!1),D(null);let{seq:r,scan:i}=ne(ge);m(!0),x(null),i.then(t=>{r===M.current&&(c(t),m(!1),fe({name:e,path:n,hidden:!1}))},e=>{r===M.current&&(m(!1),x(nb(e)))})},e=>{t===P.current&&(A(!1),ee(nb(e)))})};(0,O.useEffect)(()=>{if(!p){_(!1);return}let e=window.setTimeout(()=>{_(!0)},rb);return()=>{window.clearTimeout(e)}},[p,v]),(0,O.useEffect)(()=>{if(S===null)return;let e=window.setTimeout(()=>{if(ie.current)return;let e=B.current.child??B.current.parent;if(e===null)return;let{directory:t,tail:n}=ub(e,S,ae.current);t!==null&&n===null&&pe(t)},ab);return()=>{window.clearTimeout(e)}},[S,pe]);let ye=d??s,be=ye===null||S===null?null:ub(ye,S,ae.current).tail,xe=ye===null?[]:ob(ye,o(`browser.home`)),Se=xe.at(-1)?.path;(0,O.useEffect)(()=>{let e=F.current;e!==null&&(e.scrollLeft=e.scrollWidth)},[Se]);let Ce=(0,O.useRef)(null),we=d?.path;if((0,O.useEffect)(()=>{let e=Ce.current;e!==null&&we!==void 0&&(e.scrollLeft=e.scrollWidth)},[we]),(0,O.useEffect)(()=>{if(oe.current&&(oe.current=!1,document.activeElement===document.body&&ue.current?.focus()),S===null){if(le.current){le.current=!1,V.current=!1;let e=Ce.current;if(e===null)return;let t=e.querySelector(`button[aria-current="true"]`);if(t===null)return;t.focus()}else if(V.current){if(V.current=!1,document.activeElement!==document.body)return;let e=de.current;if(e===null)return;e.focus()}}}),!e)return null;let Te=l!==null,Ee=a||E!==null,De=S!==null;return(0,z.jsxs)(Yy,{open:e,onClose:()=>{E===null&&!a&&i()},title:o(`browser.title`),className:h(tb.dialog),headless:!0,children:[(0,z.jsxs)(`div`,{className:tb.editorScope,onKeyDown:e=>{e.key===`Escape`&&S!==null&&(e.stopPropagation(),V.current=document.activeElement===ue.current,me())},onBlur:e=>{if(S===null||!document.hasFocus())return;let t=e.currentTarget.closest(`[role="dialog"]`);t!==null&&(e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(V.current=!1,me()))},children:[(0,z.jsxs)(`div`,{className:tb.header,children:[(0,z.jsx)(`h2`,{className:tb.title,children:o(`browser.title`)}),(0,z.jsx)(`div`,{className:tb.crumbBar,children:S===null?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:tb.crumbTrail,role:`navigation`,ref:F,children:xe.map((e,t)=>(0,z.jsxs)(`span`,{className:tb.crumbSeat,children:[t>0&&(0,z.jsx)(je,{size:12,className:tb.crumbChevron}),(0,z.jsx)(`button`,{type:`button`,className:tb.crumb,disabled:Ee,onClick:()=>{ce(e.path)},children:e.name})]},e.path))}),(0,z.jsx)(`button`,{type:`button`,className:tb.crumbEditZone,"aria-label":o(`browser.editPath`),title:o(`browser.editPath`),disabled:Ee,ref:de,onClick:()=>{if(L(),m(!1),ie.current=!1,s===null){C(``);return}let e=l?.path??s.path,t=sb(s);C(e.endsWith(t)?e:`${e}${t}`)},children:(0,z.jsx)(Fe,{size:14,className:tb.crumbEditGlyph})})]}):(0,z.jsx)(`input`,{className:tb.pathInput,value:S,"aria-label":o(`browser.editPath`),autoFocus:!0,ref:ue,disabled:Ee,onChange:e=>{L(),m(!1),ie.current=!1,C(e.target.value)},...te,onKeyDown:e=>{e.key===`Enter`&&!I.current&&(e.preventDefault(),S.trim()!==``&&(V.current=!0,ie.current=!0,ce(S)))}})})]}),(0,z.jsxs)(`div`,{className:tb.content,children:[(0,z.jsxs)(`div`,{className:tb.millerRow,ref:Ce,children:[s!==null&&(0,z.jsx)(fb,{entries:s.entries,selectedPath:l?.path??null,busy:Ee,onPick:fe,showHidden:w,filterPrefix:d===null?be:null,pathEditing:De}),Te&&(0,z.jsx)(`span`,{className:tb.divider}),Te&&d!==null&&(0,z.jsx)(fb,{entries:d.entries,selectedPath:null,busy:Ee,onPick:he,showHidden:w,filterPrefix:be,pathEditing:De})]}),p&&g&&(0,z.jsx)(`div`,{className:h(tb.status,tb.loadingFloat),role:`status`,children:o(`browser.loading`)}),(s?.truncated===!0||d?.truncated===!0)&&(0,z.jsx)(`div`,{className:tb.status,role:`status`,children:o(`browser.truncated`)}),b!==null&&(0,z.jsx)(`div`,{className:tb.error,role:`alert`,children:b})]}),(0,z.jsxs)(`div`,{className:tb.footerBar,children:[(0,z.jsx)(qy,{variant:`outline`,icon:(0,z.jsx)(Oe,{size:14}),disabled:s===null||p||Ee||De,onClick:()=>{D(``),ee(null)},children:o(`browser.newFolder`)}),(0,z.jsxs)(`button`,{type:`button`,className:h(tb.showHiddenToggle,w&&tb.showHiddenToggleActive),"aria-pressed":w,disabled:Ee,onMouseDown:De?e=>{e.preventDefault()}:void 0,onClick:()=>{T(e=>!e)},children:[o(`browser.showHidden`),w&&(0,z.jsx)(ke,{size:14})]}),(0,z.jsx)(`span`,{className:tb.footerGap}),(0,z.jsx)(qy,{variant:`outline`,className:h(tb.footerAction),disabled:Ee,onClick:i,children:o(`browser.cancel`)}),(0,z.jsx)(qy,{variant:`primary`,className:h(tb.footerAction),disabled:ge===null||p||Ee||De,onClick:()=>{ge!==null&&r(ge)},children:o(`browser.open`)})]})]}),(0,z.jsx)(Yy,{open:E!==null,onClose:()=>{k||D(null)},title:o(`browser.newFolder`),className:h(tb.createDialog),headless:!0,children:(0,z.jsxs)(`div`,{className:tb.createBody,children:[(0,z.jsx)(`h3`,{className:tb.createTitle,children:o(`browser.newFolder`)}),(0,z.jsx)(`p`,{className:tb.createIn,children:o(`browser.createIn`,{name:_e})}),(0,z.jsx)(`input`,{className:tb.createInput,value:E??``,"aria-label":o(`browser.folderName`),placeholder:o(`browser.untitledFolder`),autoFocus:!0,disabled:k,onChange:e=>{D(e.target.value)},...te,onKeyDown:e=>{e.key===`Enter`&&!I.current&&(e.preventDefault(),ve()),e.key===`Escape`&&(e.stopPropagation(),k||D(null))}}),j!==null&&(0,z.jsx)(`div`,{className:tb.error,role:`alert`,children:j}),(0,z.jsxs)(`div`,{className:tb.createActions,children:[(0,z.jsx)(qy,{variant:`outline`,disabled:k,onClick:()=>{D(null)},children:o(`browser.cancel`)}),(0,z.jsx)(qy,{variant:`primary`,disabled:k||E===null||E.trim()===``,onClick:ve,children:o(`browser.create`)})]})]})})]})}var mb={root:`_root_1vp8c_1`,rail:`_rail_1vp8c_13`,iconButton:`_iconButton_1vp8c_17`,searchButton:`_searchButton_1vp8c_33`,clearButton:`_clearButton_1vp8c_34`,sectionHeader:`_sectionHeader_1vp8c_45`,sectionLabel:`_sectionLabel_1vp8c_65`,sectionLabelHidden:`_sectionLabelHidden_1vp8c_82`,searchSlot:`_searchSlot_1vp8c_91`,searchSlotExpanded:`_searchSlotExpanded_1vp8c_105`,headerActions:`_headerActions_1vp8c_110`,headerActionsHidden:`_headerActionsHidden_1vp8c_126`,search:`_search_1vp8c_33`,searchExpanded:`_searchExpanded_1vp8c_160`,searchInput:`_searchInput_1vp8c_199`,listArea:`_listArea_1vp8c_285`,treeBody:`_treeBody_1vp8c_305`,fade:`_fade_1vp8c_315`,wide:`_wide_1vp8c_326`,"wide-in":`_wide-in_1vp8c_1`,list:`_list_1vp8c_285`,flatList:`_flatList_1vp8c_356`,searchTree:`_searchTree_1vp8c_357`,groupSection:`_groupSection_1vp8c_358`,searchStatus:`_searchStatus_1vp8c_362`,searchWarning:`_searchWarning_1vp8c_363`,listTopDropIndicator:`_listTopDropIndicator_1vp8c_383`,workspaceDropBefore:`_workspaceDropBefore_1vp8c_384`,workspaceDropAfter:`_workspaceDropAfter_1vp8c_385`,listTopDropActive:`_listTopDropActive_1vp8c_419`,sessionOverflowButton:`_sessionOverflowButton_1vp8c_431`,empty:`_empty_1vp8c_453`,renameInput:`_renameInput_1vp8c_460`,renameError:`_renameError_1vp8c_479`,deleteAction:`_deleteAction_1vp8c_486`,deleteStatus:`_deleteStatus_1vp8c_490`},hb={projectRow:`_projectRow_mhb10_1`,sessionRow:`_sessionRow_mhb10_2`,selected:`_selected_mhb10_18`,searchResultRow:`_searchResultRow_mhb10_22`,searchResultHeading:`_searchResultHeading_mhb10_46`,searchResultTitle:`_searchResultTitle_mhb10_52`,searchResultMeta:`_searchResultMeta_mhb10_63`,searchResultWorkspace:`_searchResultWorkspace_mhb10_71`,searchResultSnippet:`_searchResultSnippet_mhb10_72`,rowActions:`_rowActions_mhb10_99`,"row-in":`_row-in_mhb10_1`,title:`_title_mhb10_112`,flatSessionRowWithoutStatus:`_flatSessionRowWithoutStatus_mhb10_116`,slot:`_slot_mhb10_124`,visuallyHidden:`_visuallyHidden_mhb10_134`,folderActive:`_folderActive_mhb10_143`,chevron:`_chevron_mhb10_149`,folder:`_folder_mhb10_143`,arrow:`_arrow_mhb10_154`,arrowOpen:`_arrowOpen_mhb10_158`,projectText:`_projectText_mhb10_162`,renameInput:`_renameInput_mhb10_179`,meta:`_meta_mhb10_195`,time:`_time_mhb10_204`,scheduleIndicator:`_scheduleIndicator_mhb10_211`,searchScheduleIndicator:`_searchScheduleIndicator_mhb10_222`,dot:`_dot_mhb10_227`,menuOpen:`_menuOpen_mhb10_242`,dropBefore:`_dropBefore_mhb10_261`,dropAfter:`_dropAfter_mhb10_262`,hoverContent:`_hoverContent_mhb10_302`,hoverTitle:`_hoverTitle_mhb10_308`,hoverPath:`_hoverPath_mhb10_315`,hoverTime:`_hoverTime_mhb10_322`,hoverStatus:`_hoverStatus_mhb10_328`,iconButton:`_iconButton_mhb10_337`},gb=(e,t)=>({"browser.title":R(`选择工作区目录`,`Select workspace directory`),"browser.home":R(`主目录`,`Home`),"browser.newFolder":R(`新建文件夹`,`New folder`),"browser.folderName":R(`文件夹名称`,`Folder name`),"browser.createIn":R(`在"{name}"中新建文件夹`,`Create folder in "{name}"`),"browser.untitledFolder":R(`未命名文件夹`,`Untitled folder`),"browser.create":R(`创建`,`Create`),"browser.cancel":R(`取消`,`Cancel`),"browser.open":R(`打开`,`Open`),"browser.editPath":R(`编辑路径`,`Edit path`),"browser.loading":R(`加载中…`,`Loading…`),"browser.truncated":R(`文件夹过多,仅显示开头部分。`,`Too many folders; only the first few are shown.`),"browser.showHidden":R(`显示隐藏文件`,`Show hidden files`)}[e]??e).replace(/\{(\w+)\}/g,(e,n)=>t?.[n]??``);function _b({wide:e,navigationBusy:t=!1,connected:n=!0,expandSidebar:r,session:i,selectedSubagentId:a,workspaces:o,onAdd:s,directoryPickerKind:c,pickDirectory:l,listDirectory:u,createDirectory:d,onRemove:f,onSelectSession:p,onNewSession:m,onRenameSession:h,onDeleteSession:g}){let _=te(),[v,y]=(0,O.useState)(Date.now),[b,x]=(0,O.useState)(null),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(null),[E,D]=(0,O.useState)(``),[k,A]=(0,O.useState)(null),j=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!w)return;let e=requestAnimationFrame(()=>{j.current?.focus(),j.current?.select()});return()=>cancelAnimationFrame(e)},[w]),(0,O.useEffect)(()=>{if(!e){x(null),C(null);return}y(Date.now());let t=window.setInterval(()=>y(Date.now()),6e4);return()=>window.clearInterval(t)},[e]);let[ee,M]=(0,O.useState)(!1),[N,P]=(0,O.useState)(!1),F=N||t,I=F||!n,L=(0,O.useId)(),ne=(0,O.useRef)(null),[re,ie]=(0,O.useState)(null),[B,ae]=(0,O.useState)(``),[oe,se]=(0,O.useState)(``),[ce,le]=(0,O.useState)(!1),[V,ue]=(0,O.useState)(``);(0,O.useEffect)(()=>{ue(``)},[i?.sessionId]);let[de,fe]=(0,O.useState)(new Set);(0,O.useEffect)(()=>{o.activeId&&fe(e=>e.has(o.activeId)?e:new Set([...e,o.activeId]))},[o.activeId,i?.sessionId]);let pe=(0,O.useRef)(null),me=(0,O.useRef)(null),he=V.trim().toLocaleLowerCase(),[ge,_e]=(0,O.useState)(new Set),ve=(0,O.useMemo)(()=>{let e=new Map(o.sessions.map(e=>[e.id,e])),t=[],n=[],r=new Map;for(let i of o.sessions){if(!i.subagent){t.push(i);continue}let a=i.subagent.parentSessionId,o=new Set([i.id]),s=a;for(;s&&!o.has(s);)o.add(s),s=e.get(s)?.subagent?.parentSessionId??null;if(!a||!e.has(a)||s){n.push(i);continue}let c=r.get(a)??[];c.push(i),r.set(a,c)}return{byId:e,roots:t,orphans:n,children:r}},[o.sessions]),ye=new Set,be=new Set;for(let e=a;e&&!ye.has(e);){ye.add(e);let t=ve.orphans.find(t=>t.id===e);if(t){be.add(`orphan-${t.workspaceId}`);break}e=ve.byId.get(e)?.subagent?.parentSessionId??null,e&&be.add(e)}let we=[...be].join(`
|
|
47
|
+
`);(0,O.useEffect)(()=>{we&&_e(e=>new Set([...e,...we.split(`
|
|
48
|
+
`)]))},[a,we]),(0,O.useEffect)(()=>{ne.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView({block:`nearest`})},[e,i?.sessionId,a,de,ge]);let Te=e=>e.toLocaleLowerCase().includes(he),Ee=e=>Te(e.name)||Te(Py(e))||(ve.children.get(e.id)??[]).some(Ee),De=e=>Te(e.title)||Te(e.path),Oe=()=>{ue(``),le(!1),pe.current?.focus()},ke=o.items.filter(e=>De(e)||[...ve.roots,...ve.orphans].some(t=>t.workspaceId===e.id&&Ee(t))),je=e=>_e(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});dt(`workspace-action`,ee||re||w||k?null:B);let Me=async e=>{if(!I){P(!0),ae(``);try{await e()}catch(e){ae(e instanceof Error?e.message:R(`操作失败`,`Operation failed`))}finally{P(!1)}}},Pe=async e=>{P(!0);try{await s(e,!1),M(!1)}catch(e){M(!1),se(e instanceof Error?e.message:String(e))}finally{P(!1)}},Fe=async()=>{if(c!==null){if(e||r(),ae(``),c===`browse`)M(!0);else{P(!0);try{let e=await l();e!==null&&await Pe(e)}catch(e){se(e instanceof Error?e.message:String(e))}finally{P(!1)}}}},Ie=e=>ge.has(e)||!!he;function Le(e,t,n,r=!1){let i=Ie(e),a=r?t:R(`${t} 的子任务`,`Subtasks for ${t}`),o=i?R(`收起子任务`,`Collapse subtasks`):R(`展开子任务`,`Expand subtasks`),s=n.some(e=>e.subagent?.status===`failed`)?`failed`:n.some(e=>e.subagent?.status===`running`)?`running`:void 0;return(0,z.jsxs)(`button`,{type:`button`,className:r?Xy.taskToggle:Xy.inlineTaskToggle,"aria-label":a,"aria-expanded":i,"aria-controls":`${L}-${e}-tasks`,title:s?`${o} · ${Ny(s)}`:o,"data-status":s,disabled:!!he,onClick:()=>je(e),children:[(0,z.jsx)(`span`,{className:i?Xy.taskChevronOpen:Xy.taskChevron,children:(0,z.jsx)(Ae,{size:14})}),r&&a]})}function Re(e,t,n,r){let i=n?t:t.filter(Ee),s=Ie(e)&&i.length>0;return(0,z.jsx)(`div`,{className:Xy.taskGroup,id:`${L}-${e}-tasks`,role:`group`,"aria-label":r,hidden:!s,children:s&&i.map(e=>{let t=e.subagent,r=Py(e),i=ve.children.get(e.id)??[],s=o.items.find(t=>t.id===e.workspaceId)?.available===!1;return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:Xy.taskLine,children:[i.length>0&&Le(e.id,r,i),(0,z.jsxs)(`button`,{type:`button`,className:`${hb.sessionRow} ${Xy.sessionButton} ${Xy.taskRow}`,"data-has-subtasks":i.length>0||void 0,"aria-label":r,"aria-current":a===e.id?`page`:void 0,disabled:I||s,title:r,onClick:()=>{Me(()=>p(e.workspaceId,e.id,e.path))},children:[(0,z.jsx)(`span`,{className:hb.title,children:r}),(0,z.jsx)(`span`,{className:Xy.taskStatus,"data-status":t.status,children:Ny(t.status)})]})]}),i.length>0&&Re(e.id,i,n||Te(e.name)||Te(r),r)]},e.id)})})}return(0,z.jsxs)(`div`,{ref:ne,"aria-busy":F,className:`${mb.root} ${e?``:mb.rail}`,children:[(0,z.jsxs)(`div`,{className:mb.sectionHeader,children:[e&&(0,z.jsx)(`span`,{className:`${mb.sectionLabel} ${mb.wide} ${ce?mb.sectionLabelHidden:``}`,children:R(`工作区`,`Workspaces`)}),e&&(0,z.jsx)(`div`,{className:`${mb.searchSlot} ${ce?mb.searchSlotExpanded:``}`,children:(0,z.jsxs)(`div`,{className:`${mb.search} ${ce?mb.searchExpanded:``}`,onClick:()=>{le(!0),me.current?.focus()},children:[(0,z.jsx)(`button`,{ref:pe,type:`button`,className:mb.searchButton,"aria-label":R(`搜索工作区和会话`,`Search workspaces and sessions`),"aria-expanded":ce,onClick:()=>{le(!0),me.current?.focus()},children:(0,z.jsx)(Ce,{size:ce?11:14})}),(0,z.jsx)(`input`,{ref:me,className:mb.searchInput,type:`search`,"aria-label":R(`按名称或工作区路径搜索`,`Search by name or workspace path`),placeholder:R(`按名称或工作区路径搜索`,`Search by name or workspace path`),maxLength:120,value:V,tabIndex:ce?0:-1,onChange:e=>ue(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),Oe())}}),ce&&(0,z.jsx)(`button`,{type:`button`,className:mb.clearButton,"aria-label":R(`关闭搜索`,`Close search`),onClick:e=>{e.stopPropagation(),Oe()},children:(0,z.jsx)(Ne,{})})]})}),(0,z.jsx)(`div`,{className:`${mb.headerActions} ${e&&ce?mb.headerActionsHidden:``}`,children:(0,z.jsx)(`button`,{type:`button`,className:mb.iconButton,"aria-label":R(`添加工作区`,`Add workspace`),title:R(`添加工作区`,`Add workspace`),disabled:I||c===null,onClick:()=>{Fe()},children:(0,z.jsx)(Ve,{size:e?16:18})})})]}),e&&(0,z.jsx)(`div`,{className:mb.listArea,children:(0,z.jsx)(`div`,{className:mb.treeBody,children:(0,z.jsxs)(`div`,{className:mb.list,role:`list`,"aria-label":R(`工作区`,`Workspaces`),children:[ke.map(e=>{let t=e.id===o.activeId,n=e.available===!1,r=ve.roots.filter(t=>t.workspaceId===e.id),s=ve.orphans.filter(t=>t.workspaceId===e.id),c=de.has(e.id)||!!he||[...r,...s].some(e=>ye.has(e.id)),l=De(e),u=s.length>0&&(l||s.some(Ee)),d=R(`未关联子任务`,`Unlinked subtasks`);return(0,z.jsxs)(`div`,{className:Xy.group,role:`listitem`,children:[(0,z.jsxs)(`div`,{className:Xy.workspaceLine,"data-menu-open":b===e.id||void 0,children:[(0,z.jsxs)(`button`,{type:`button`,className:`${hb.projectRow} ${Xy.workspaceButton}`,"aria-expanded":c,"aria-controls":`${L}-${e.id}`,title:e.path,disabled:F,onContextMenu:t=>{I||(t.preventDefault(),t.stopPropagation(),C(null),x(e.id))},onClick:()=>fe(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[(0,z.jsxs)(`span`,{className:hb.slot,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{"data-workspace-leading":`folder`,className:`${Xy.folder} ${t?Xy.folderActive:``}`,children:c?(0,z.jsx)(He,{size:16}):(0,z.jsx)(Ue,{size:16})}),(0,z.jsx)(`span`,{"data-workspace-leading":`chevron`,className:`${Xy.chevron} ${c?Xy.chevronOpen:``}`,children:(0,z.jsx)(Ae,{size:14})})]}),(0,z.jsx)(`span`,{className:`${hb.title} ${Xy.workspaceTitle}`,children:e.title}),n&&(0,z.jsx)(`span`,{className:Xy.unavailable,children:R(`不可用`,`Unavailable`)})]}),(0,z.jsxs)(`span`,{className:Xy.rowActions,"data-workspace-actions":!0,children:[(0,z.jsx)(Zy,{title:e.title,active:t,disabled:I,open:b===e.id,onOpenChange:t=>x(t?e.id:null),onRemove:()=>{ae(``),ie({id:e.id,title:e.title})}}),(0,z.jsx)(`button`,{type:`button`,className:Xy.rowAction,title:n?R(`目录不可用,请恢复目录或移除后重新添加`,`Directory unavailable; restore it or remove and add the workspace again`):R(`新建会话`,`New session`),"aria-label":R(`在 ${e.title} 新建会话`,`Create a session in ${e.title}`),disabled:I||n,onClick:()=>{Me(async()=>{await m(e.id),ue(``),fe(t=>new Set([...t,e.id]))})},children:(0,z.jsx)(Se,{size:16})})]})]}),(0,z.jsxs)(`div`,{id:`${L}-${e.id}`,role:`group`,"aria-label":e.title,hidden:!c,children:[c&&r.filter(e=>l||Ee(e)).map(r=>{let o=!a&&t&&i?.sessionId===r.id,s=i?.sessionId===r.id?!i.idle:r.idle===!1,c=ve.children.get(r.id)??[],u=r.name||R(`新会话`,`New chat`),d={workspaceId:e.id,id:r.id,path:r.path,name:r.name,running:s};return(0,z.jsxs)(`div`,{className:Xy.sessionGroup,children:[(0,z.jsxs)(`div`,{className:Xy.sessionLine,"data-menu-open":S===r.id||void 0,children:[c.length>0&&Le(r.id,u,c),(0,z.jsxs)(`button`,{type:`button`,className:`${hb.sessionRow} ${Xy.sessionButton} ${o?hb.selected:``}`,title:u,"aria-label":u,"aria-describedby":`${L}-${r.id}-status`,"aria-current":o?`page`:void 0,disabled:I||n,onContextMenu:e=>{I||n||(e.preventDefault(),e.stopPropagation(),x(null),C(r.id))},onClick:()=>{Me(()=>p(e.id,r.id,r.path))},children:[(0,z.jsx)(`span`,{className:hb.slot,children:s&&c.length===0&&(0,z.jsx)(xe,{state:`ongoing`})}),(0,z.jsx)(`span`,{className:`${hb.title} ${r.name?``:Xy.untitled}`,children:u}),s&&c.length>0&&(0,z.jsx)(xe,{state:`ongoing`}),(0,z.jsx)(`time`,{className:Xy.sessionTime,dateTime:r.modified,title:r.modified,children:eb(r.modified,v,_)}),(0,z.jsx)(`span`,{id:`${L}-${r.id}-status`,className:hb.visuallyHidden,children:s?R(`运行中`,`Running`):R(`空闲`,`Idle`)})]}),(0,z.jsx)(`span`,{className:Xy.rowActions,children:(0,z.jsx)(Qy,{title:u,disabled:I||n,open:S===r.id,onOpenChange:e=>C(e?r.id:null),onRename:()=>{ae(``),D(r.name),T(d)},onDelete:()=>{ae(``),A(d)}})})]}),c.length>0&&Re(r.id,c,l||Te(u),u)]},r.id)}),c&&u&&(0,z.jsxs)(`div`,{className:Xy.orphanGroup,children:[Le(`orphan-${e.id}`,d,s,!0),Re(`orphan-${e.id}`,s,l,d)]}),c&&!he&&r.length===0&&s.length===0&&(0,z.jsx)(`p`,{className:mb.empty,children:R(`还没有会话,创建新会话开始`,`No sessions yet. Create a session to start.`)})]})]},e.id)}),ke.length===0&&(0,z.jsxs)(`p`,{className:mb.empty,role:`status`,children:[he?R(`没有找到匹配的工作区或会话`,`No matching workspaces or sessions`):R(`添加工作区,开始管理对话`,`Add a workspace to start organizing conversations`),he&&(0,z.jsx)(`button`,{type:`button`,className:mb.sessionOverflowButton,onClick:Oe,children:R(`清除搜索`,`Clear search`)})]}),F&&(0,z.jsx)(`p`,{className:mb.searchStatus,role:`status`,children:R(`正在处理…`,`Working…`)})]})})}),(0,z.jsxs)(Yy,{open:re!==null,onClose:()=>{F||ie(null)},title:R(`移除工作区?`,`Remove workspace?`),closeLabel:R(`关闭`,`Close`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,disabled:F,onClick:()=>ie(null),children:R(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,disabled:I,onClick:()=>{re&&Me(async()=>{await f(re.id),ie(null)})},children:R(`从列表移除`,`Remove from list`)})]}),children:[(0,z.jsx)(`p`,{children:re?.title}),(0,z.jsx)(`p`,{children:R(`仅从侧栏移除,不删除目录、文件或会话历史。`,`Only removes it from the sidebar. Directories, files and session history are not deleted.`)}),B&&(0,z.jsx)(`p`,{role:`alert`,children:B})]}),(0,z.jsxs)(Yy,{open:w!==null,onClose:()=>{F||T(null)},title:R(`重命名会话`,`Rename chat`),closeLabel:R(`关闭`,`Close`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,disabled:F,onClick:()=>T(null),children:R(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,type:`submit`,form:`${L}-rename`,disabled:I,children:R(`保存`,`Save`)})]}),children:[(0,z.jsx)(`form`,{id:`${L}-rename`,onSubmit:e=>{e.preventDefault(),w&&Me(async()=>{await h(w.workspaceId,w.id,w.path,E),T(null)})},children:(0,z.jsx)(`input`,{className:Xy.renameInput,"aria-label":R(`会话名称`,`Chat name`),placeholder:R(`留空则使用第一条消息`,`Leave empty to use the first message`),maxLength:120,ref:j,value:E,onChange:e=>D(e.target.value)})}),B&&(0,z.jsx)(`p`,{role:`alert`,children:B})]}),(0,z.jsxs)(Yy,{open:k!==null,onClose:()=>{F||A(null)},title:R(`删除会话?`,`Delete chat?`),closeLabel:R(`关闭`,`Close`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,disabled:F,onClick:()=>A(null),children:R(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,disabled:I||k?.running,onClick:()=>{k&&Me(async()=>{await g(k.workspaceId,k.id,k.path),A(null)})},children:R(`删除`,`Delete`)})]}),children:[(0,z.jsx)(`p`,{children:k?.name||R(`新会话`,`New chat`)}),(0,z.jsx)(`p`,{children:k?.running?R(`Pi 正在运行,请等待当前回复结束后再删除。`,`Pi is still working. Wait for the reply to finish before deleting.`):R(`会话会从列表中移除,文件移到 Pi 数据目录的 pi-web/trash 中,可手动恢复。项目文件不受影响。`,`The chat leaves the list and its file moves to pi-web/trash in the Pi data folder, where you can restore it by hand. Project files are not affected.`)}),B&&(0,z.jsx)(`p`,{role:`alert`,children:B})]}),(0,z.jsx)(pb,{open:ee,busy:F,listDirectory:u,createDirectory:d,onOpen:e=>{Pe(e)},onClose:()=>{F||M(!1)},t:gb}),(0,z.jsx)(Yy,{open:!!oe,onClose:()=>se(``),title:R(`无法添加工作区`,`Could not add workspace`),closeLabel:R(`关闭`,`Close`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,onClick:()=>se(``),children:R(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,onClick:()=>{se(``),Fe()},children:R(`重新选择`,`Choose again`)})]}),children:(0,z.jsx)(`div`,{role:`alert`,children:oe})})]})}function vb(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase(),i=r===`m`?1e6:r===`k`?1e3:1,a=Number(n[1])*i,o=Math.round(a);return Math.abs(a-o)<1e-6?o:a}function yb(e){return e===void 0?``:!Number.isInteger(e)||e<=0?String(e):e%1e6==0?`${e/1e6}M`:e%1e3==0?`${e/1e3}K`:String(e)}function bb({model:e,position:t,onSave:n,onRemove:r,onCancel:i}){let[a,o]=(0,O.useState)(e.id),[s,c]=(0,O.useState)(e.name??``),[l,u]=(0,O.useState)(yb(e.contextWindow)),[d,f]=(0,O.useState)(yb(e.maxTokens)),[p,m]=(0,O.useState)(e.input?.length?e.input:[`text`]),[h,g]=(0,O.useState)(!e.id),[_,v]=(0,O.useState)(!1),[y,b]=(0,O.useState)(!1),[x,S]=(0,O.useState)(``),C=!e.id,w=!C&&(e.source===`custom`||e.overridden),T=async()=>{let e=vb(l),t=vb(d);if(!a.trim()||[e,t].some(e=>e!==void 0&&(!Number.isSafeInteger(e)||e<=0)))S(R(`请填写模型 ID,并使用正整数或 K/M 单位填写容量。`,`Enter a model ID and positive token counts, optionally with K/M suffixes.`));else{b(!0),S(``);try{await n({id:a.trim(),...s.trim()?{name:s.trim()}:{},...e===void 0?{}:{contextWindow:e},...t===void 0?{}:{maxTokens:t},input:p})}catch(e){S(e instanceof Error?e.message:R(`保存失败`,`Could not save`))}finally{b(!1)}}},E=async()=>{b(!0),S(``);try{await r()}catch(e){S(e instanceof Error?e.message:R(`操作失败`,`Action failed`)),v(!1)}finally{b(!1)}},D=e=>{m(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length?n:t})};return(0,z.jsxs)(`div`,{className:`pi-model-entry`,children:[(0,z.jsxs)(`div`,{className:`pi-model-row`,children:[(0,z.jsx)(`input`,{"aria-label":`${R(`模型 ID`,`Model ID`)} ${t}`,placeholder:R(`模型 ID`,`Model ID`),value:a,disabled:y||!C&&e.source===`builtin`,onFocus:()=>g(!0),onChange:e=>o(e.target.value)}),(0,z.jsx)(`input`,{"aria-label":`${R(`显示名称`,`Display name`)} ${t}`,placeholder:R(`显示名称`,`Display name`),value:s,disabled:y,onFocus:()=>g(!0),onChange:e=>c(e.target.value)}),(0,z.jsx)(`button`,{type:`button`,"aria-label":`${R(`模型参数`,`Model settings`)} ${t}`,"aria-expanded":h,onClick:()=>g(!h),children:h?`⌄`:`›`})]}),h&&(0,z.jsxs)(`div`,{className:`pi-model-details`,children:[(0,z.jsxs)(`label`,{children:[R(`上下文窗口`,`Context window`),(0,z.jsx)(`input`,{"aria-label":`${R(`上下文窗口`,`Context window`)} ${t}`,inputMode:`decimal`,placeholder:`128K`,value:l,disabled:y,onChange:e=>u(e.target.value)})]}),(0,z.jsxs)(`label`,{children:[R(`最大输出 token 数`,`Max output tokens`),(0,z.jsx)(`input`,{"aria-label":`${R(`最大输出 token 数`,`Max output tokens`)} ${t}`,inputMode:`decimal`,placeholder:`16K`,value:d,disabled:y,onChange:e=>f(e.target.value)})]}),(0,z.jsxs)(`fieldset`,{className:`pi-model-input-types`,children:[(0,z.jsx)(`legend`,{children:R(`输入类型`,`Input types`)}),(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:p.includes(`text`),disabled:y||p.length===1&&p.includes(`text`),onChange:()=>D(`text`)}),R(`文本`,`Text`)]}),(0,z.jsxs)(`label`,{children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:p.includes(`image`),disabled:y||p.length===1&&p.includes(`image`),onChange:()=>D(`image`)}),R(`图片`,`Image`)]})]}),(0,z.jsxs)(`div`,{className:`pi-model-actions`,children:[(0,z.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>{T()},children:y?R(`保存中…`,`Saving…`):R(`保存模型`,`Save model`)}),C&&i&&(0,z.jsx)(`button`,{type:`button`,disabled:y,onClick:i,children:R(`取消`,`Cancel`)}),w&&(0,z.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>v(!_),children:e.source===`custom`?R(`移除模型`,`Remove model`):R(`恢复默认`,`Restore default`)})]}),_&&(0,z.jsxs)(`div`,{className:`pi-model-confirm`,children:[(0,z.jsx)(`span`,{children:e.source===`custom`?R(`从配置中移除这个模型?`,`Remove this model from configuration?`):R(`撤销这个模型的自定义参数?`,`Discard this model’s custom settings?`)}),(0,z.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>{E()},children:R(`确认`,`Confirm`)}),(0,z.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>v(!1),children:R(`取消`,`Cancel`)})]}),x&&(0,z.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:x})]})]})}function xb({providerId:e,getModels:t,updateModel:n}){let[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(``),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(!1),d=async()=>{o(``);try{i(await t(e))}catch(e){throw o(e instanceof Error?e.message:R(`无法读取模型目录`,`Could not load model catalog`)),e}};(0,O.useEffect)(()=>{d().catch(()=>{})},[e]);let f=async t=>{await n(e,t),u(!1),await d().catch(()=>{})},p=r?.models.filter(e=>`${e.id} ${e.name??``}`.toLocaleLowerCase().includes(s.toLocaleLowerCase()))??[];return(0,z.jsxs)(`section`,{className:`pi-provider-models`,"aria-label":R(`模型目录`,`Model catalog`),children:[(0,z.jsxs)(`div`,{className:`pi-provider-models-head`,children:[(0,z.jsx)(`strong`,{children:R(`模型目录`,`Model catalog`)}),(0,z.jsxs)(`span`,{children:[r?.models.length??0,` `,R(`个模型`,`models`)]})]}),r?.baseUrl&&(0,z.jsxs)(`p`,{className:`pi-provider-models-endpoint`,title:r.baseUrl,children:[R(`API 地址`,`API URL`),`: `,r.baseUrl]}),a&&(0,z.jsxs)(`p`,{className:`pi-settings-error`,role:`alert`,children:[a,` `,r&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{d().catch(()=>{})},children:R(`重试读取`,`Retry`)})]}),r?(0,z.jsxs)(z.Fragment,{children:[r.models.length>5&&(0,z.jsx)(`input`,{className:`pi-model-search`,type:`search`,"aria-label":R(`搜索模型`,`Search models`),placeholder:R(`搜索模型`,`Search models`),value:s,onChange:e=>c(e.target.value)}),(0,z.jsx)(`div`,{className:`pi-model-list`,children:p.map((e,t)=>(0,z.jsx)(bb,{model:e,position:t+1,onSave:t=>f({action:`save`,originalId:e.id,model:t}),onRemove:()=>f({action:`remove`,id:e.id})},`${e.id}:${e.name}:${e.contextWindow}:${e.maxTokens}:${e.overridden}`))}),p.length===0&&!l&&(0,z.jsx)(`p`,{className:`pi-provider-models-empty`,children:R(`没有匹配的模型`,`No matching models`)}),l&&(0,z.jsx)(bb,{model:{id:``,source:`custom`,overridden:!1},position:r.models.length+1,onSave:e=>f({action:`save`,model:e}),onRemove:async()=>u(!1),onCancel:()=>u(!1)},`new`),!l&&(0,z.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>u(!0),children:R(`+ 添加模型`,`+ Add model`)})]}):a?(0,z.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>{d().catch(()=>{})},children:R(`重试读取`,`Retry`)}):(0,z.jsx)(`p`,{role:`status`,children:R(`正在读取模型…`,`Loading models…`)})]})}var Sb={id:``,name:``,baseUrl:``,api:`openai-completions`,modelId:``};function Cb(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:null}catch{return null}}function wb(){let e=null;try{return e=window.open(`about:blank`,`_blank`),e&&(e.opener=null,e.document.title=R(`正在准备授权页面`,`Preparing sign-in`),e.document.body.textContent=R(`正在准备授权页面…`,`Preparing sign-in…`)),e}catch{return e?.close(),null}}function Tb({provider:e,configured:t,busy:n,getProviderModels:r,updateProviderModel:i,onConnect:a}){let[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(``),[f,p]=(0,O.useState)(!0),[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(``);(0,O.useEffect)(()=>{let t=!0;return p(!0),r(e.id).then(e=>{t&&(l(e.baseUrl??``),d(e.baseUrl??``),p(!1))}).catch(e=>{t&&(p(!1),_(e instanceof Error?e.message:R(`无法读取 API 地址`,`Could not load API URL`)))}),()=>{t=!1}},[e.id]);let v=async()=>{let n=o.trim(),r=c.trim();if(n||t){if(r&&!Cb(r))_(R(`请输入有效的 http 或 https 地址。`,`Enter a valid HTTP or HTTPS URL.`));else{h(!0),_(``);try{r!==u&&(await i(e.id,{action:`base_url`,baseUrl:r||null}),d(r)),n&&(s(``),await a(n))}catch(e){_(e instanceof Error?e.message:R(`保存失败`,`Could not save`))}finally{h(!1)}}}};return(0,z.jsxs)(`form`,{className:`pi-provider-key-form`,onSubmit:e=>{e.preventDefault(),v()},children:[(0,z.jsxs)(`label`,{children:[R(`API Key`,`API key`),(0,z.jsx)(`input`,{type:`password`,autoComplete:`off`,maxLength:16384,value:o,onChange:e=>s(e.target.value),placeholder:t?R(`已配置,输入新值可替换`,`Configured; enter a new key to replace`):R(`输入 API Key`,`Enter API key`)})]}),(0,z.jsxs)(`details`,{className:`pi-provider-advanced`,children:[(0,z.jsx)(`summary`,{children:R(`自定义设置`,`Custom settings`)}),(0,z.jsxs)(`label`,{children:[R(`API 地址(可选)`,`API URL (optional)`),(0,z.jsx)(`input`,{type:`url`,maxLength:2048,value:c,onChange:e=>l(e.target.value),placeholder:R(`使用提供方默认地址`,`Use provider default URL`)})]})]}),(0,z.jsx)(`button`,{type:`submit`,disabled:n||m||f||!o.trim()&&(c.trim()===u||!t),children:m?R(`保存中…`,`Saving…`):t?R(`保存`,`Save`):R(`连接`,`Connect`)}),g&&(0,z.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:g})]})}function Eb({setupMode:e=!1,onReturnToConversation:t,getProviders:n,getProviderModels:r,updateProviderModel:i,logoutProvider:a,addCustomProvider:o,startLogin:s,getLogin:c,getActiveLogin:l,respondLogin:u,cancelLogin:d,refreshModels:f}){let[p,m]=(0,O.useState)([]),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(e?`builtin`:null),[y,b]=(0,O.useState)(``),[x,S]=(0,O.useState)(null),[C,w]=(0,O.useState)(null),[T,E]=(0,O.useState)(Sb),[D,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(``),[ee,M]=(0,O.useState)(``),[N,P]=(0,O.useState)(!1),F=(0,O.useRef)(null);(0,O.useEffect)(()=>{e&&v(e=>e??`builtin`)},[e]),(0,O.useEffect)(()=>{let e=!0;return l().then(t=>{e&&t&&k(e=>e??t)}).catch(()=>{}),()=>{e=!1,F.current?.popup?.close()}},[]);let I=async()=>{m(await n()),g(!0)},te=async e=>{let t=F.current,n=e.authorization??(e.event?.type===`auth_url`||e.event?.type===`device_code`?e.event:void 0);if(t?.id===e.id&&n){let e=Cb(n.type===`auth_url`?n.url:n.verificationUri);if(e){try{t.popup&&!t.popup.closed?t.popup.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)}catch{t.popup?.close()}F.current=null}}t?.id===e.id&&(e.status===`done`||e.status===`error`||e.status===`cancelled`)&&(t.popup?.close(),F.current=null),k(e),e.status===`done`&&(v(null),S(null),await Promise.all([I(),f()]))};(0,O.useEffect)(()=>{I().catch(e=>{g(!0),M(e instanceof Error?e.message:R(`无法读取模型提供方`,`Could not load model providers`))})},[]),(0,O.useEffect)(()=>{if(!D||D.status===`done`||D.status===`error`||D.status===`cancelled`)return;let e=!0,t=window.setInterval(()=>{c(D.id).then(async t=>{e&&await te(t)}).catch(t=>{e&&M(t instanceof Error?t.message:R(`登录状态不可用`,`Login status is unavailable`))})},700);return()=>{e=!1,window.clearInterval(t)}},[D?.id,D?.status]);let L=N||D?.status===`running`||D?.status===`waiting`,ne=p.find(e=>e.id===D?.providerId)?.name,re=p.filter(e=>e.configured),ie=p.filter(e=>!e.configured&&e.methods.length>0),B=ie.find(e=>e.id===y)??(e?ie.find(e=>e.id===`openai-codex`)??ie.find(e=>e.methods.includes(`oauth`)):void 0)??ie.find(e=>e.id===`openai`)??ie[0],ae=async(e,t,n)=>{F.current=t===`oauth`?{id:null,popup:wb()}:null,P(!0),M(``),j(``);try{let{id:r}=await s(e,t,n);F.current&&(F.current.id=r),await te(await c(r))}catch(e){F.current?.popup?.close(),F.current=null,M(e instanceof Error?e.message:R(`无法开始登录`,`Could not start sign-in`)),D||l().then(e=>{e&&k(e)}).catch(()=>{})}finally{P(!1)}},oe=async e=>{if(D){P(!0),M(``);try{await u(D.id,e),j(``),await te(await c(D.id))}catch(e){M(e instanceof Error?e.message:R(`提交失败`,`Submission failed`))}finally{P(!1)}}},se=async()=>{P(!0),M(``);try{await o(T);let e=T.id;await I(),b(e),v(`builtin`),E(Sb)}catch(e){M(e instanceof Error?e.message:R(`无法添加自定义提供方`,`Could not add custom provider`))}finally{P(!1)}},ce=async e=>{P(!0),M(``);try{await a(e),await I(),w(null),S(null)}catch(e){M(e instanceof Error?e.message:R(`移除认证失败`,`Could not remove credentials`))}finally{P(!1)}},le=D?.authorization??(D?.event?.type===`auth_url`||D?.event?.type===`device_code`?D.event:void 0),V=D?.status===`waiting`&&D.prompt&&D.prompt.type!==`select`&&(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),A.trim()&&oe(A.trim())},children:[(0,z.jsx)(`label`,{htmlFor:`pi-provider-answer`,children:D.prompt.message}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`input`,{id:`pi-provider-answer`,type:D.prompt.type===`secret`?`password`:`text`,autoComplete:`off`,placeholder:D.prompt.placeholder,value:A,onChange:e=>j(e.target.value)}),(0,z.jsx)(`button`,{type:`submit`,disabled:N||!A.trim(),children:R(`继续`,`Continue`)})]})]});return(0,z.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,z.jsx)(`h2`,{children:e?R(`先连接一个模型`,`Connect a model to begin`):R(`模型`,`Models`)}),(0,z.jsx)(`p`,{className:`pi-settings-intro`,children:e?R(`当前没有可用模型。选择提供方完成认证,再在会话中选择模型;也可以添加自定义提供方。`,`No models are available yet. Sign in to a provider, then choose a model in the conversation. You can also add a custom provider.`):R(`已接入的提供方显示在这里。添加新的提供方后,即可在会话中选择其模型。`,`Connected providers appear here. Add a provider to use its models in a conversation.`)}),ee&&(0,z.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:ee}),D&&(0,z.jsxs)(`section`,{className:`pi-provider-flow`,"aria-label":R(`模型登录`,`Model sign-in`),children:[(0,z.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,z.jsxs)(`strong`,{children:[R(`模型登录`,`Model sign-in`),ne?` · ${ne}`:``]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>{F.current?.id===D.id&&(F.current.popup?.close(),F.current=null),D.status===`running`||D.status===`waiting`?d(D.id).finally(()=>k(null)):k(null)},children:D.status===`running`||D.status===`waiting`?R(`取消`,`Cancel`):R(`关闭`,`Close`)})]}),D.status===`done`&&(0,z.jsxs)(`div`,{role:`status`,children:[(0,z.jsx)(`p`,{children:R(`已连接。现在可以在会话中选择该提供方的模型。`,`Connected. You can now select this provider’s models in a conversation.`)}),(0,z.jsx)(`button`,{type:`button`,onClick:t,children:R(`返回会话选择模型`,`Return to conversation and choose a model`)})]}),D.status===`error`&&(0,z.jsx)(`p`,{role:`alert`,children:D.error}),D.status===`running`&&!le&&(0,z.jsx)(`p`,{role:`status`,children:R(`正在等待提供方响应…`,`Waiting for the provider…`)}),D.event?.type===`info`&&(0,z.jsxs)(`p`,{children:[D.event.message,D.event.links?.map(e=>{let t=Cb(e.url);return t&&(0,z.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e.label??R(`打开链接`,`Open link`)},t)})]}),D.event?.type===`progress`&&le?.type!==`auth_url`&&(0,z.jsx)(`p`,{children:D.event.message}),le?.type===`auth_url`&&(0,z.jsxs)(`p`,{role:`status`,children:[R(`请在授权页面完成登录;若页面未自动打开,请点击右侧链接。完成后这里会自动更新。`,`Complete sign-in on the authorization page. If it did not open, use the link. This page will update automatically.`),` `,Cb(le.url)&&(0,z.jsx)(`a`,{href:Cb(le.url),target:`_blank`,rel:`noopener noreferrer`,children:R(`打开授权页面`,`Open authorization page`)})]}),le?.type===`device_code`&&(0,z.jsxs)(`p`,{children:[R(`在`,`On the`),` `,Cb(le.verificationUri)&&(0,z.jsx)(`a`,{href:Cb(le.verificationUri),target:`_blank`,rel:`noopener noreferrer`,children:R(`验证页面`,`verification page`)}),` `,R(`输入代码`,`enter code`),` `,(0,z.jsx)(`code`,{children:le.userCode})]}),D.status===`waiting`&&D.prompt?.type===`select`&&(0,z.jsxs)(`div`,{className:`pi-provider-options`,children:[(0,z.jsx)(`p`,{children:D.prompt.message}),D.prompt.options.map(e=>(0,z.jsxs)(`button`,{type:`button`,disabled:N,onClick:()=>{oe(e.id)},children:[e.label,e.description&&(0,z.jsx)(`small`,{children:e.description})]},e.id))]}),V&&D.prompt?.type===`manual_code`&&le?.type===`auth_url`?(0,z.jsxs)(`details`,{className:`pi-provider-manual-login`,children:[(0,z.jsx)(`summary`,{children:R(`无法自动完成?手动输入授权码`,`Can't finish automatically? Enter an authorization code`)}),V]}):V]}),(0,z.jsxs)(`section`,{className:`pi-provider-list`,"aria-label":R(`已接入的模型提供方`,`Connected model providers`),children:[re.map(e=>(0,z.jsxs)(`div`,{className:`pi-provider-card`,children:[(0,z.jsxs)(`div`,{className:`pi-provider-card-head`,children:[(0,z.jsxs)(`span`,{className:`pi-provider-name`,children:[e.name,(0,z.jsx)(`span`,{className:`pi-provider-dot`,role:`img`,"aria-label":R(`已配置认证`,`Authentication configured`)}),(0,z.jsx)(`small`,{children:R(`已配置`,`Configured`)})]}),(0,z.jsx)(`button`,{type:`button`,disabled:L,"aria-label":`${R(`编辑`,`Edit`)} ${e.name}`,"aria-expanded":x===e.id,onClick:()=>{v(null),S(x===e.id?null:e.id)},children:R(`编辑`,`Edit`)})]}),x===e.id&&(0,z.jsxs)(`div`,{className:`pi-provider-editor`,children:[e.methods.includes(`api_key`)&&(0,z.jsx)(Tb,{provider:e,configured:!0,busy:!!L,getProviderModels:r,updateProviderModel:i,onConnect:t=>ae(e.id,`api_key`,t)},e.id),e.methods.includes(`oauth`)&&(0,z.jsx)(`div`,{className:`pi-provider-methods`,children:(0,z.jsx)(`button`,{type:`button`,disabled:!!L,onClick:()=>{ae(e.id,`oauth`)},children:R(`网页登录`,`Browser sign-in`)})}),(0,z.jsx)(xb,{providerId:e.id,getModels:r,updateModel:i}),e.storedCredential&&(0,z.jsx)(`div`,{className:`pi-provider-credential-action`,children:(0,z.jsx)(`button`,{type:`button`,disabled:L,onClick:()=>w(e.id),children:R(`移除认证`,`Remove credentials`)})}),!e.storedCredential&&(0,z.jsx)(`p`,{className:`pi-provider-auth-source`,children:R(`当前认证来自环境变量、模型配置或其他运行时来源,请在对应位置移除。`,`Authentication comes from an environment variable, model configuration, or another runtime source. Remove it at its source.`)}),C===e.id&&(0,z.jsxs)(`div`,{className:`pi-model-confirm`,role:`group`,"aria-label":R(`确认移除认证`,`Confirm credential removal`),children:[(0,z.jsx)(`span`,{children:R(`移除本机保存的认证后,该模型可能无法继续使用。`,`Removing stored credentials may make this provider unavailable.`)}),(0,z.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>{ce(e.id)},children:R(`确认移除`,`Remove`)}),(0,z.jsx)(`button`,{type:`button`,disabled:N,onClick:()=>w(null),children:R(`取消`,`Cancel`)})]})]})]},e.id)),h&&re.length===0&&(0,z.jsx)(`p`,{className:`pi-provider-empty`,children:R(`尚未接入提供方`,`No providers connected yet`)}),!h&&(0,z.jsx)(`p`,{role:`status`,children:R(`正在读取模型提供方…`,`Loading model providers…`)})]}),_===`builtin`&&(0,z.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":R(`添加提供方`,`Add provider`),children:[(0,z.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,z.jsx)(`strong`,{children:R(`添加提供方`,`Add provider`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>v(null),children:R(`关闭`,`Close`)})]}),B?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`label`,{htmlFor:`pi-provider-select`,children:R(`提供方`,`Provider`)}),(0,z.jsx)(`select`,{id:`pi-provider-select`,value:B.id,onChange:e=>b(e.target.value),children:ie.map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.name},e.id))}),B.methods.includes(`api_key`)&&(0,z.jsx)(Tb,{provider:B,configured:!1,busy:!!L,getProviderModels:r,updateProviderModel:i,onConnect:e=>ae(B.id,`api_key`,e)},B.id),B.methods.includes(`oauth`)&&(0,z.jsx)(`div`,{className:`pi-provider-methods`,children:(0,z.jsx)(`button`,{type:`button`,disabled:!!L,onClick:()=>{ae(B.id,`oauth`)},children:R(`网页登录`,`Browser sign-in`)})}),(0,z.jsx)(`p`,{children:R(`认证完成后,可在提供方的“编辑”中调整模型目录。`,`After sign-in, open the provider’s Edit panel to adjust its model catalog.`)})]}):(0,z.jsx)(`p`,{children:R(`没有可添加的提供方。`,`No providers can be added.`)})]}),_===`custom`&&(0,z.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":R(`添加自定义提供方`,`Add custom provider`),children:[(0,z.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,z.jsx)(`strong`,{children:R(`添加自定义提供方`,`Add custom provider`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>v(null),children:R(`关闭`,`Close`)})]}),(0,z.jsx)(`p`,{children:R(`适用于兼容 Pi 已支持协议的模型服务。保存后再添加 API Key;密钥不会写入 models.json。`,`For model services compatible with Pi’s supported protocols. Add an API key after saving; it will not be written to models.json.`)}),(0,z.jsxs)(`form`,{className:`pi-provider-custom-form`,onSubmit:e=>{e.preventDefault(),se()},children:[(0,z.jsxs)(`label`,{children:[R(`名称`,`Name`),(0,z.jsx)(`input`,{required:!0,maxLength:100,value:T.name,onChange:e=>E({...T,name:e.target.value}),placeholder:R(`我的模型服务`,`My model service`)})]}),(0,z.jsxs)(`label`,{children:[R(`提供方 ID`,`Provider ID`),(0,z.jsx)(`input`,{required:!0,maxLength:64,value:T.id,onChange:e=>E({...T,id:e.target.value}),placeholder:`my-provider`})]}),(0,z.jsxs)(`label`,{children:[R(`接口地址`,`API URL`),(0,z.jsx)(`input`,{required:!0,type:`url`,maxLength:2048,value:T.baseUrl,onChange:e=>E({...T,baseUrl:e.target.value}),placeholder:`https://api.example.com/v1`})]}),(0,z.jsxs)(`label`,{children:[R(`接口协议`,`API protocol`),(0,z.jsxs)(`select`,{value:T.api,onChange:e=>E({...T,api:e.target.value}),children:[(0,z.jsx)(`option`,{value:`openai-completions`,children:`OpenAI Chat Completions`}),(0,z.jsx)(`option`,{value:`openai-responses`,children:`OpenAI Responses`}),(0,z.jsx)(`option`,{value:`anthropic-messages`,children:`Anthropic Messages`})]})]}),(0,z.jsxs)(`label`,{children:[R(`模型 ID`,`Model ID`),(0,z.jsx)(`input`,{required:!0,maxLength:200,value:T.modelId,onChange:e=>E({...T,modelId:e.target.value}),placeholder:`model-name`})]}),(0,z.jsx)(`button`,{type:`submit`,disabled:N,children:R(`保存并继续`,`Save and continue`)})]})]}),!_&&(0,z.jsxs)(`div`,{className:`pi-provider-add-actions`,children:[(0,z.jsx)(`button`,{type:`button`,disabled:!h||ie.length===0||L,onClick:()=>{S(null),v(`builtin`),b(``)},children:R(`+ 添加提供方`,`+ Add provider`)}),(0,z.jsx)(`button`,{type:`button`,disabled:L,onClick:()=>{S(null),v(`custom`)},children:R(`+ 添加自定义提供方`,`+ Add custom provider`)})]})]})}var Db=`pi-web-theme`,Ob=new Set,kb=window.matchMedia(`(prefers-color-scheme: dark)`),Ab=jb();function jb(){try{let e=localStorage.getItem(Db);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function Mb(){document.body.toggleAttribute(`data-ds-dark-theme`,Ab===`dark`||Ab===`system`&&kb.matches)}function Nb(){Mb(),kb.addEventListener(`change`,Mb),window.addEventListener(`storage`,e=>{e.key===Db&&(Ab=jb(),Mb(),Ob.forEach(e=>e()))})}function Pb(e){Ab=e;try{localStorage.setItem(Db,e)}catch{}Mb(),Ob.forEach(e=>e())}function Fb(){return(0,O.useSyncExternalStore)(e=>(Ob.add(e),()=>{Ob.delete(e)}),()=>Ab)}var Ib={group:`_group_8jvbt_4`,title:`_title_8jvbt_12`,cubeRow:`_cubeRow_8jvbt_19`,themeCube:`_themeCube_8jvbt_29`,selected:`_selected_8jvbt_48`};function Lb(){let e=Fb(),t=te(),n=[{id:`light`,label:t===`zh`?`浅色`:`Light`,Icon:We},{id:`dark`,label:t===`zh`?`深色`:`Dark`,Icon:Ge},{id:`system`,label:t===`zh`?`跟随系统`:`System`,Icon:Ke}];return(0,z.jsxs)(`div`,{className:Ib.group,children:[(0,z.jsx)(`div`,{className:Ib.title,children:t===`zh`?`外观`:`Appearance`}),(0,z.jsx)(`div`,{className:Ib.cubeRow,children:n.map(({id:t,label:n,Icon:r})=>(0,z.jsxs)(`button`,{type:`button`,className:h(Ib.themeCube,e===t&&Ib.selected),"aria-pressed":e===t,onClick:()=>Pb(t),children:[(0,z.jsx)(r,{}),n]},t))})]})}var Rb={selectorWrap:`_selectorWrap_5eqgx_1`,selector:`_selector_5eqgx_1`,value:`_value_5eqgx_23`,option:`_option_5eqgx_24`,chevron:`_chevron_5eqgx_25`,menu:`_menu_5eqgx_27`};function zb({label:e,menuLabel:t,value:n,options:r,disabled:i,onChange:a}){let[o,s]=(0,O.useState)(!1),c=(0,O.useId)(),l=(0,O.useRef)(null),u=(0,O.useRef)(null),d=(0,O.useRef)(null);return(0,O.useEffect)(()=>{i&&s(!1)},[i]),(0,O.useEffect)(()=>{if(!o)return;d.current?.focus();let e=e=>{l.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),s(!1),u.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[o]),(0,z.jsxs)(`div`,{className:Rb.selectorWrap,ref:l,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},children:[(0,z.jsxs)(`button`,{ref:u,type:`button`,className:Rb.selector,"aria-label":e,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?c:void 0,disabled:i,onClick:()=>s(e=>!e),children:[(0,z.jsx)(`span`,{className:Rb.value,children:r.find(e=>e.id===n)?.label}),(0,z.jsx)(`svg`,{className:Rb.chevron,width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m3.5 5.25 3.5 3.5 3.5-3.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),o&&(0,z.jsx)(`div`,{id:c,className:Rb.menu,role:`menu`,"aria-label":t,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Array.from(e.currentTarget.querySelectorAll(`[role="menuitemradio"]`)),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:r.map(e=>(0,z.jsxs)(`button`,{ref:e.id===n?d:void 0,type:`button`,role:`menuitemradio`,"aria-checked":e.id===n,className:Rb.option,onClick:()=>{s(!1),u.current?.focus(),e.id!==n&&a(e.id)},children:[(0,z.jsx)(`span`,{children:e.label}),e.id===n&&(0,z.jsx)(`svg`,{className:Rb.chevron,width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`m3 8 3.2 3.2L13 4.5`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e.id))})]})}var Bb={row:`_row_1rrpk_1`,title:`_title_1rrpk_9`},Vb=[{id:`zh`,label:`中文`},{id:`en`,label:`English`}];function Hb(){let e=te(),t=e===`zh`?`语言`:`Language`;return(0,z.jsxs)(`div`,{className:Bb.row,children:[(0,z.jsx)(`div`,{className:Bb.title,children:t}),(0,z.jsx)(zb,{label:t,menuLabel:e===`zh`?`选择语言`:`Choose language`,value:e,options:Vb,onChange:I})]})}var Ub=class extends Error{status;reason;constructor(e,t,n){super(e),this.name=`HttpError`,this.status=t,this.reason=n}},Wb={请等待当前回复结束后再升级:`Wait for the current reply to finish before updating.`,请等待所有聊天任务结束后再升级:`Wait for all chat tasks to finish before updating.`};function Gb(e,t,n){return e instanceof Ub&&e.status===404?t===`zh`?`后台服务仍在运行旧版。请重启 pi-webapp 后重新打开页面,再检查更新。`:`The background service is still running an older version. Restart pi-webapp, reopen this page, then check again.`:e instanceof Error&&e.message?(t===`en`?Wb[e.message]:void 0)??e.message:n===`check`?t===`zh`?`检查更新失败`:`Could not check for updates`:t===`zh`?`升级失败`:`Update failed`}function Kb({getUpdate:e,getRunningVersion:t,setUpdateChannel:n,cancelUpdate:r,update:i}){let a=te(),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!0),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(null),[_,v]=(0,O.useState)(!1),[y,b]=(0,O.useState)(``),x=(0,O.useRef)(!1),S=(0,O.useRef)(!1),C=(0,O.useRef)(0),w=(0,O.useRef)(!0);(0,O.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]);let T=async()=>{let t=++C.current;l(!0),b(``);try{let n=await e();w.current&&t===C.current&&s(n)}catch(e){w.current&&t===C.current&&(s(null),b(Gb(e,a,`check`)))}finally{w.current&&t===C.current&&l(!1)}};return(0,O.useEffect)(()=>{T();let e=()=>{T()};return window.addEventListener(`pi-update-channel`,e),()=>{window.removeEventListener(`pi-update-channel`,e)}},[]),(0,O.useEffect)(()=>{if(!h)return;let e=!1,n=new AbortController,r,i=setTimeout(()=>{e=!0,n.abort(),clearTimeout(r),g(null),v(!0),b(L(a,`新版未能及时就绪,后台可能已回退到旧版。请刷新页面检查当前版本;若无法连接,请重新打开应用。`,`The new version was not ready in time; the backend may have rolled back. Refresh to check the running version, or reopen the app if disconnected.`)),u(Error(`Updated service did not become ready within 60 seconds`),{stage:`update_restart`,code:`update_restart_timeout`,route:`/api/update/version`,timeoutMs:6e4})},6e4),o=async()=>{try{let r=await t(n.signal);if(e)return;if(r.current===h){clearTimeout(i),location.reload();return}}catch{}e||(r=setTimeout(()=>{o()},1200))};return r=setTimeout(()=>{o()},1200),()=>{e=!0,n.abort(),clearTimeout(r),clearTimeout(i)}},[h]),{status:o,checking:c,installing:d,cancelling:p,targetVersion:h,restartTimedOut:_,error:y,check:T,install:async()=>{if(x.current||c||!o?.available||!o.canRestart||h||_||o.downgrade&&!window.confirm(L(a,`将从 ${o.current} 切换至稳定版 ${o.latest}。部分新功能可能不可用;请先备份重要数据。是否继续?`,`Switch from ${o.current} to stable ${o.latest}? Some new features may be unavailable. Back up important data before continuing.`)))return;x.current=!0,f(!0),b(``);let t=o.channel&&o.latest?{channel:o.channel,version:o.latest,...o.downgrade?{allowDowngrade:!0}:{}}:void 0;try{let e;try{e=await i(t)}catch(n){if(n?.reason!==`update_confirm_required`)throw n;if(!window.confirm(L(a,`${n.message}。\n\n仍然升级?`,`${n.message}.\n\nUpdate anyway?`)))return;e=await i({...t,force:!0})}w.current&&g(e.version)}catch(t){w.current&&b(Gb(t,a,`install`));try{let t=await e();w.current&&s(t)}catch{}}finally{x.current=!1,w.current&&f(!1)}},changeChannel:async e=>{if(!(!n||c||d||h)){++C.current,l(!0),b(``);try{await n(e),window.dispatchEvent(new Event(`pi-update-channel`))}catch(e){w.current&&(l(!1),b(Gb(e,a,`check`)))}}},cancel:async()=>{if(!(!r||S.current||h)){S.current=!0,m(!0),b(``);try{await r(),v(!1),await T()}catch(e){w.current&&b(Gb(e,a,`install`))}finally{S.current=!1,w.current&&m(!1)}}}}}var qb=(0,O.createContext)(null);function Jb({actions:e,children:t}){let n=Kb(e);return(0,z.jsx)(qb.Provider,{value:n,children:t})}function Yb(){return(0,O.useContext)(qb)}function Xb(e){let t=/(?:^| )PiDesktop\/(\d+\.\d+\.\d+(?:-[\w.-]+)?) PiDesktopBuild\/(\d+)(?: |$)/.exec(e);return!t||t[1].length>80||!Number.isSafeInteger(Number(t[2]))?null:{version:t[1],build:Number(t[2]),handoff:Number(t[2])>=14}}var Zb={group:`_group_14gt8_1`,row:`_row_14gt8_8`,details:`_details_14gt8_15`,preference:`_preference_14gt8_17`,title:`_title_14gt8_25`,summary:`_summary_14gt8_31`,note:`_note_14gt8_31`,error:`_error_14gt8_31`,diagnostics:`_diagnostics_14gt8_41`,actions:`_actions_14gt8_51`};function Qb(e){let t=Yb();return t?(0,z.jsx)(ex,{...e,controller:t}):(0,z.jsx)($b,{...e})}function $b(e){let t=Kb(e);return(0,z.jsx)(ex,{...e,controller:t})}function ex(e){let t=te(),n=(e,n)=>L(t,e,n),{status:r,checking:i,installing:a,cancelling:o,targetVersion:s,restartTimedOut:c,error:l,check:u,install:d,changeChannel:f,cancel:p}=e.controller,m=Xb(navigator.userAgent),h=!(!r?.latest||r.available||i),g=r?(0,z.jsxs)(z.Fragment,{children:[n(`当前版本`,`Current version`),` `,r.current,r.available&&r.latest?` → ${r.latest}`:h&&(0,z.jsxs)(z.Fragment,{children:[` · `,(0,z.jsx)(`span`,{role:`status`,children:n(`已是最新版本`,`Up to date`)})]})]}):i?n(`正在读取版本…`,`Reading version…`):n(`暂时无法读取版本`,`Version unavailable`),_=!!(m&&r?.desktopShell&&String(m.build)!==r.desktopShell.build)||!!(r?.launcherHandoff?.required||r?.requiresDesktopUpgrade||r?.launcher&&!r.launcher.releaseChannels),v=!!(m||r?.launcher||r?.desktopShell);return(0,z.jsxs)(`section`,{className:Zb.group,"aria-label":n(`应用更新`,`App updates`),children:[r?.channel&&e.setUpdateChannel&&(0,z.jsxs)(`div`,{className:Zb.preference,children:[(0,z.jsx)(`div`,{className:Zb.title,children:n(`更新偏好`,`Update preference`)}),(0,z.jsx)(zb,{label:n(`更新偏好`,`Update preference`),menuLabel:n(`选择更新偏好`,`Choose update preference`),value:r.channel,disabled:i||a||!!s||c,onChange:e=>{f(e)},options:[{id:`stable`,label:n(`稳定版(推荐)`,`Stable (recommended)`)},{id:`alpha`,label:n(`体验版(包含 alpha)`,`Preview (including alpha)`)}]})]}),r?.channel===`alpha`&&(0,z.jsx)(`p`,{className:Zb.note,children:n(`体验版包含尚在验证的新功能,可能不稳定。`,`Preview releases include features still under testing and may be unstable.`)}),(0,z.jsxs)(`div`,{className:Zb.row,children:[(0,z.jsxs)(`div`,{className:Zb.details,children:[(0,z.jsx)(`div`,{className:Zb.title,children:n(`应用更新`,`App updates`)}),(0,z.jsx)(`p`,{className:Zb.summary,children:g})]}),(0,z.jsxs)(`div`,{className:Zb.actions,children:[r?.available&&r.canRestart&&!s&&!c&&(0,z.jsx)(qy,{variant:`primary`,disabled:a||i,onClick:()=>{d()},children:a?n(`正在安装…`,`Installing…`):r.downgrade?n(`切换到稳定版并重启`,`Switch to stable and restart`):n(`升级并重启`,`Update and restart`)}),(r?.recovery?.canCancel||a)&&e.cancelUpdate&&!s&&(0,z.jsx)(qy,{variant:`outline`,disabled:o,onClick:()=>{p()},children:o?n(`正在取消…`,`Cancelling…`):a?n(`取消下载`,`Cancel download`):n(`取消未完成的升级`,`Cancel unfinished update`)}),(0,z.jsx)(qy,{variant:`outline`,disabled:i||a||!!s,onClick:()=>{u()},children:i?n(`检查中…`,`Checking…`):n(`检查更新`,`Check for updates`)})]})]}),r?.launcherHandoff?.required&&(0,z.jsxs)(`div`,{className:Zb.note,children:[(0,z.jsx)(`p`,{children:n(`安装新版桌面不会自动接管仍在运行的共享后台。需要先安全交接启动器,再使用体验版在线升级。交接会等待聊天空闲、终端关闭和真实图稿保存确认,并保留原本地地址。`,`Installing a desktop update does not take over a running shared backend. Safely hand off the launcher before preview updates. Handoff requires idle chats, closed terminals and real drawing save confirmations, and preserves the local address.`)}),m?.handoff?(0,z.jsx)(`a`,{href:`pi-desktop://launcher-handoff`,target:`_blank`,rel:`noreferrer`,children:n(`安全切换到当前桌面启动器…`,`Safely switch to this desktop launcher…`)}):(0,z.jsxs)(`p`,{children:[n(`安全交接入口从桌面 build 14 开始提供。build 12 已支持体验版,但缺少旧共享后台交接功能;无需重复安装 build 12。`,`The safe handoff action is available from desktop build 14. Build 12 supports preview releases but lacks shared-backend handoff; reinstalling build 12 will not help.`),` `,(0,z.jsx)(`a`,{href:`https://github.com/chengzhiyi/pi-webapp/releases`,target:`_blank`,rel:`noreferrer`,children:n(`下载支持安全交接的桌面版本`,`Get a desktop release with safe handoff`)})]}),!r.launcherHandoff.supported&&(0,z.jsx)(`p`,{children:n(`当前后台还缺少安全交接协议:请先选择稳定版并升级业务包,再从桌面菜单重试交接。`,`This backend lacks the safe handoff protocol: first update its business package on Stable, then retry from the desktop menu.`)})]}),r?.available&&!!r.pluginWarnings?.length&&(0,z.jsxs)(`div`,{className:Zb.note,children:[(0,z.jsx)(`p`,{children:n(`以下插件在新版本中暂时不可用(不影响升级,数据保留):`,`These plugins will be unavailable on the new version (the update is not blocked; their data is kept):`)}),(0,z.jsx)(`ul`,{children:r.pluginWarnings.map(e=>(0,z.jsxs)(`li`,{children:[e.pluginId,`: `,e.message]},e.pluginId))})]}),r?.lastFailure&&!a&&!s&&(0,z.jsxs)(`p`,{className:Zb.note,children:[n(`上次升级到 ${r.lastFailure.version} 未完成,已保留当前版本:`,`The last update to ${r.lastFailure.version} did not complete; the current version was kept: `),r.lastFailure.message]}),r?.reason&&(0,z.jsx)(`p`,{className:Zb.note,children:r.reason}),r?.requiresDesktopUpgrade&&(0,z.jsxs)(`p`,{className:Zb.note,children:[(0,z.jsx)(`a`,{href:`https://github.com/chengzhiyi/pi-webapp/releases`,target:`_blank`,rel:`noreferrer`,children:n(`下载新版桌面应用`,`Download desktop update`)}),n(`。安装支持更新通道的桌面版本后,可在此选择体验版并在线升级。`,`. Install a desktop release with update-channel support, then return here to select preview and update online.`)]}),s&&(0,z.jsx)(`p`,{className:Zb.note,role:`status`,children:n(`正在重启并等待新版连接…`,`Restarting and waiting for the new version…`)}),l&&(0,z.jsx)(`p`,{className:Zb.error,role:`alert`,children:l}),l?.includes(`Missing view flush acknowledgement`)&&(0,z.jsx)(`p`,{className:Zb.note,children:n(`插件视图尚未确认保存。请保存并关闭绘图或编辑器;若视图已失联,请先在插件恢复记录中处理未确认的编辑,再重试升级。`,`A plugin view has not confirmed its save. Save and close drawings or editors; if a view disconnected, review its unconfirmed edits in plugin recovery before retrying.`)}),v&&(0,z.jsxs)(`details`,{className:Zb.diagnostics,open:_,children:[(0,z.jsx)(`summary`,{children:n(`版本详情`,`Version details`)}),m&&(0,z.jsxs)(`p`,{className:Zb.summary,children:[n(`当前桌面窗口`,`Current desktop window`),` `,m.version,` · build `,m.build]}),r?.launcher&&(0,z.jsxs)(`p`,{className:Zb.summary,children:[n(`后台启动器`,`Backend launcher`),` `,r.launcher.version,` · `,n(`体验版持久化`,`Preview persistence`),` `,r.launcher.releaseChannels?n(`支持`,`supported`):n(`不支持`,`unsupported`)]}),r?.desktopShell&&(0,z.jsxs)(`p`,{className:Zb.summary,children:[n(`后台启动时的桌面外壳`,`Desktop shell at backend startup`),` `,r.desktopShell.version,` · build `,r.desktopShell.build]}),r?.desktopShell&&(0,z.jsx)(`p`,{className:Zb.note,children:n(`共享后台可能由旧版桌面启动。当前窗口的桌面版本请查看菜单「pi → 关于 pi」。业务包升级不会替换桌面应用。`,`A shared backend may have been started by an older desktop. For this window’s desktop version, see pi → About pi. Updating the business package does not replace the desktop app.`)})]})]})}var tx=`https://pi.emath.top`,nx=`https://github.com/chengzhiyi/pi-webapp/issues`;function rx(e,t){let n={home:``,quickStart:`getting-started`,troubleshooting:`troubleshooting`}[e];return`${tx}/${String(t).toLowerCase().startsWith(`zh`)?`zh/`:``}${n}`}function ix(e){let t=(t,n)=>L(e,t,n);return[{id:`docs`,label:t(`使用文档`,`Documentation`),href:rx(`home`,e)},{id:`quick-start`,label:t(`快速开始`,`Quick start`),href:rx(`quickStart`,e)},{id:`troubleshooting`,label:t(`故障排查`,`Troubleshooting`),href:rx(`troubleshooting`,e)},{id:`issues`,label:t(`在 GitHub 上反馈问题`,`Report an issue on GitHub`),href:nx}]}var ax={row:`_row_wp8ea_1`,title:`_title_wp8ea_9`,summary:`_summary_wp8ea_15`,links:`_links_wp8ea_22`};function ox(){let e=te(),t=(t,n)=>L(e,t,n);return(0,z.jsxs)(`section`,{className:ax.row,"aria-label":t(`帮助与文档`,`Help & documentation`),children:[(0,z.jsx)(`div`,{className:ax.title,children:t(`帮助与文档`,`Help & documentation`)}),(0,z.jsx)(`p`,{className:ax.summary,children:t(`查看使用指南、快速开始和常见问题的解决方法。`,`Read the guides, get started quickly, and find fixes for common problems.`)}),(0,z.jsx)(`ul`,{className:ax.links,children:ix(e).map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,children:e.label})},e.id))})]})}var sx={triggerRow:`_triggerRow_f00qz_1`,railRow:`_railRow_f00qz_10`,trigger:`_trigger_f00qz_1`,rail:`_rail_f00qz_10`,triggerLabel:`_triggerLabel_f00qz_54`,overlay:`_overlay_f00qz_61`,mask:`_mask_f00qz_70`,panel:`_panel_f00qz_83`,nav:`_nav_f00qz_105`,navTitle:`_navTitle_f00qz_116`,navList:`_navList_f00qz_125`,navCell:`_navCell_f00qz_133`,active:`_active_f00qz_156`,navIcon:`_navIcon_f00qz_160`,navLabel:`_navLabel_f00qz_164`,content:`_content_f00qz_173`,header:`_header_f00qz_181`,actions:`_actions_f00qz_192`,close:`_close_f00qz_202`,options:`_options_f00qz_82`,hiddenLabel:`_hiddenLabel_f00qz_229`};function cx(e){return e===`general`?(0,z.jsx)(Te,{className:sx.navIcon,size:16}):e===`models`?(0,z.jsx)(qe,{className:sx.navIcon,size:16}):e===`packages`?(0,z.jsx)(Ze,{className:sx.navIcon,size:16}):e===`plugins`||e===`extensions`?(0,z.jsx)(Be,{className:sx.navIcon,size:16}):(0,z.jsx)(Ye,{className:sx.navIcon,size:16})}function lx({title:e,sections:t,activeId:n,onSelect:r,onClose:i,children:a}){let o=te(),s=(0,O.useId)(),c=(0,O.useRef)(null);return(0,O.useEffect)(()=>{c.current?.focus();let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&!(e.target instanceof Element&&e.target.closest(`[role="menu"]`))&&i()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),(0,z.jsxs)(`div`,{className:sx.overlay,role:`presentation`,children:[(0,z.jsx)(`div`,{className:sx.mask,"aria-hidden":`true`,onClick:i}),(0,z.jsxs)(`div`,{className:sx.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:[(0,z.jsxs)(`nav`,{className:sx.nav,"aria-label":o===`zh`?`Pi 设置分类`:`Pi settings sections`,children:[(0,z.jsx)(`div`,{className:sx.navTitle,id:s,children:e}),(0,z.jsx)(`div`,{className:sx.navList,children:t.map(e=>(0,z.jsxs)(`button`,{type:`button`,className:`${sx.navCell} ${n===e.id?sx.active:``}`,"aria-current":n===e.id?`true`:void 0,onClick:()=>r(e.id),children:[cx(e.id),(0,z.jsx)(`span`,{className:sx.navLabel,children:e.label})]},e.id))})]}),(0,z.jsxs)(`div`,{className:sx.content,children:[(0,z.jsxs)(`header`,{className:sx.header,children:[(0,z.jsx)(`div`,{className:sx.actions}),(0,z.jsx)(`button`,{ref:c,className:sx.close,type:`button`,onClick:i,"aria-label":o===`zh`?`关闭 Pi 设置`:`Close Pi settings`,children:(0,z.jsx)(Me,{size:14})})]}),(0,z.jsx)(`div`,{className:sx.options,children:a})]})]})]})}function ux(e){return/^(?:npm:|git:|https?:\/\/|ssh:\/\/|git@)/i.test(e.trim())}function dx(e){let t=te(),n=(e,n)=>L(t,e,n),r=[{kind:`packages`,title:n(`包与扩展`,`Packages & extensions`),hint:n(`包可以包含扩展和技能;本地扩展也可以单独加载。`,`Packages can contain extensions and skills; local extensions can also be loaded separately.`),placeholder:n(`npm 包名、Git 地址或本地目录`,`npm package, Git URL, or local directory`)},{kind:`skills`,title:n(`技能`,`Skills`),hint:n(`Pi 已发现和加载的技能。`,`Skills discovered and loaded by Pi.`),placeholder:n(`SKILL.md 文件或目录路径`,`SKILL.md file or directory path`)}],i=[{id:`general`,label:n(`通用设置`,`General`)},{id:`models`,label:n(`模型`,`Models`)},...r.map(({kind:e,title:t})=>({id:e,label:e===`packages`?n(`包与扩展`,`Packages`):t}))],{onBack:a,getConfig:o,updateConfig:s}=e,[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)({packages:``,extensions:``,skills:``}),[f,p]=(0,O.useState)(e.setupMode?`models`:`general`),[m,h]=(0,O.useState)(!1),[g,_]=(0,O.useState)(!0),[v,y]=(0,O.useState)(``);(0,O.useEffect)(()=>{e.setupMode&&p(`models`)},[e.setupMode]),(0,O.useEffect)(()=>{let e=!0;return o().then(t=>{e&&l(t)}).catch(t=>{e&&y(t instanceof Error?t.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}).finally(()=>{e&&_(!1)}),()=>{e=!1}},[]);let b=async()=>{_(!0),y(``);try{l(await o())}catch(e){y(e instanceof Error?e.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}finally{_(!1)}},x=async(e,t,r)=>{h(!0),y(``);try{l(await s(e,`global`,t,r)),t===`add`&&d(t=>({...t,[e]:``}))}catch(e){y(e instanceof Error?e.message:n(`保存失败`,`Save failed`))}finally{h(!1)}},S=r.find(({kind:e})=>e===f),C=S?c?.global[S.kind]??[]:[],w=S?c?.installed?.[S.kind]??[]:[],T=S?u[S.kind].trim():``,E=S?.kind!==`packages`&&ux(T),D=new Set(c?.installed.packages.map(e=>e.source)??[]),k=c?.installed.extensions.filter(e=>!D.has(e.source))??[],A=c?.global.packages.filter(e=>!D.has(e))??[],j=u.extensions.trim(),ee=ux(j),M=e=>{d(t=>({...t,packages:e})),p(`packages`),y(``)};return(0,z.jsxs)(lx,{title:n(`Pi 设置`,`Pi Settings`),sections:i,activeId:f,onSelect:e=>{p(e),y(``)},onClose:a,children:[f===`general`&&(0,z.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,z.jsx)(`h2`,{children:n(`通用设置`,`General`)}),(0,z.jsx)(`p`,{className:`pi-settings-intro`,children:n(`调整网页的显示方式。`,`Choose how the web interface appears.`)}),(0,z.jsxs)(`div`,{className:`pi-settings-general`,children:[(0,z.jsx)(Hb,{}),(0,z.jsx)(Lb,{}),(0,z.jsx)(Qb,{getUpdate:e.getUpdate,getRunningVersion:e.getRunningVersion,setUpdateChannel:e.setUpdateChannel,cancelUpdate:e.cancelUpdate,update:e.update}),(0,z.jsx)(ox,{})]})]}),f===`models`&&(0,z.jsx)(Eb,{setupMode:e.setupMode,onReturnToConversation:a,getProviders:e.getProviders,getProviderModels:e.getProviderModels,updateProviderModel:e.updateProviderModel,logoutProvider:e.logoutProvider,addCustomProvider:e.addCustomProvider,startLogin:e.startProviderLogin,getLogin:e.getProviderLogin,getActiveLogin:e.getActiveProviderLogin,respondLogin:e.respondProviderLogin,cancelLogin:e.cancelProviderLogin,refreshModels:e.refreshModels}),S&&(0,z.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,z.jsx)(`h2`,{children:S.title}),(0,z.jsxs)(`p`,{className:`pi-settings-intro`,children:[S.hint,` `,n(`添加或移除后会重新加载 Pi 资源。`,`Pi resources reload after you add or remove one.`)]}),v&&(0,z.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:v}),c?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`已发现`,`Discovered `)}${S.title}`,children:[(0,z.jsxs)(`h3`,{children:[S.kind===`packages`?n(`已安装的包`,`Installed packages`):n(`已发现的技能`,`Discovered skills`),` `,(0,z.jsx)(`span`,{children:w.length})]}),(0,z.jsx)(`ul`,{children:w.length?w.map(e=>{let t=S.kind===`packages`?c.installed.extensions.filter(t=>t.source===e.source):[];return(0,z.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,z.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,z.jsx)(`strong`,{title:e.name,children:e.name}),(0,z.jsx)(`small`,{title:e.path||e.source,children:e.path||e.source}),t.length>0&&(0,z.jsxs)(`div`,{className:`pi-package-contents`,children:[(0,z.jsx)(`span`,{children:n(`包含扩展`,`Includes extensions`)}),t.map(e=>(0,z.jsx)(`span`,{title:e.path,children:e.name},e.path))]})]}),(0,z.jsxs)(`div`,{className:`pi-resource-actions`,children:[(0,z.jsxs)(`span`,{className:`pi-resource-meta`,children:[e.enabled?n(`已启用`,`Enabled`):n(`已停用`,`Disabled`),` · `,e.scope===`project`?n(`项目`,`Project`):e.scope===`user`?n(`用户`,`User`):n(`临时`,`Temporary`)]}),S.kind===`packages`&&c.global.packages.includes(e.source)&&(0,z.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>{x(`packages`,`remove`,e.source)},children:n(`移除`,`Remove`)})]})]},`${e.path}:${e.source}`)}):(0,z.jsxs)(`li`,{className:`pi-settings-empty`,children:[n(`未发现`,`No `),S.title]})})]}),S.kind===`packages`&&(0,z.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`独立扩展`,`Standalone extensions`),children:[(0,z.jsxs)(`h3`,{children:[n(`独立扩展`,`Standalone extensions`),` `,(0,z.jsx)(`span`,{children:k.length})]}),(0,z.jsx)(`ul`,{children:k.length?k.map(e=>(0,z.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,z.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,z.jsx)(`strong`,{title:e.name,children:e.name}),(0,z.jsx)(`small`,{title:e.path,children:e.path})]}),(0,z.jsxs)(`span`,{className:`pi-resource-meta`,children:[e.enabled?n(`已启用`,`Enabled`):n(`已停用`,`Disabled`),` · `,e.scope===`project`?n(`项目`,`Project`):e.scope===`user`?n(`用户`,`User`):n(`临时`,`Temporary`)]})]},e.path)):(0,z.jsx)(`li`,{className:`pi-settings-empty`,children:n(`未发现独立扩展`,`No standalone extensions found`)})})]}),(0,z.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`手动配置`,`Configure `)}${S.title}`,children:[(0,z.jsx)(`h3`,{children:S.kind===`packages`?n(`添加包`,`Add package`):n(`手动配置技能`,`Configure skills manually`)}),(S.kind===`packages`?A:C).length>0&&(0,z.jsx)(`ul`,{children:(S.kind===`packages`?A:C).map(e=>(0,z.jsxs)(`li`,{className:`pi-config-item`,children:[(0,z.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,z.jsx)(`code`,{title:e,children:e}),S.kind===`packages`&&(0,z.jsx)(`small`,{children:n(`已配置,但未发现安装目录`,`Configured, but installation directory was not found`)}),S.kind!==`packages`&&ux(e)&&(0,z.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源请在“包与扩展”中添加。`,`Not loaded: add package sources under Packages & extensions.`)})]}),(0,z.jsxs)(`div`,{className:`pi-resource-actions`,children:[S.kind!==`packages`&&ux(e)&&(0,z.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>M(e),children:n(`转到包`,`Go to packages`)}),(0,z.jsx)(`button`,{type:`button`,disabled:m,"aria-label":`${n(`移除`,`Remove`)} ${e}`,onClick:()=>{x(S.kind,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),T&&!E&&x(S.kind,`add`,T)},children:[(0,z.jsx)(`input`,{"aria-label":`${n(`添加`,`Add `)}${S.title}`,"aria-invalid":E||void 0,"aria-describedby":E?`pi-config-source-help`:void 0,placeholder:S.placeholder,value:u[S.kind],onChange:e=>d(t=>({...t,[S.kind]:e.target.value}))}),(0,z.jsx)(`button`,{type:`submit`,disabled:m||!T||E,children:n(`添加`,`Add`)})]}),E&&(0,z.jsxs)(`p`,{id:`pi-config-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请在「包」中添加。`,`This is a package source. Add it under Packages.`),(0,z.jsx)(`button`,{type:`button`,onClick:()=>M(T),children:n(`转到包`,`Go to packages`)})]})]}),S.kind===`packages`&&(0,z.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`手动配置扩展路径`,`Configure extension paths manually`),children:[(0,z.jsx)(`h3`,{children:n(`扩展路径`,`Extension paths`)}),c.global.extensions.length>0&&(0,z.jsx)(`ul`,{children:c.global.extensions.map(e=>(0,z.jsxs)(`li`,{className:`pi-config-item`,children:[(0,z.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,z.jsx)(`code`,{title:e,children:e}),ux(e)&&(0,z.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源不能作为扩展路径,请在上方添加包。`,`Not loaded: package sources cannot be extension paths. Add the package above.`)})]}),(0,z.jsxs)(`div`,{className:`pi-resource-actions`,children:[ux(e)&&(0,z.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>M(e),children:n(`填入包`,`Use as package`)}),(0,z.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>{x(`extensions`,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),j&&!ee&&x(`extensions`,`add`,j)},children:[(0,z.jsx)(`input`,{"aria-label":n(`添加扩展路径`,`Add extension path`),"aria-invalid":ee||void 0,"aria-describedby":ee?`pi-extension-source-help`:void 0,placeholder:n(`扩展文件或目录路径`,`Extension file or directory path`),value:u.extensions,onChange:e=>d(t=>({...t,extensions:e.target.value}))}),(0,z.jsx)(`button`,{type:`submit`,disabled:m||!j||ee,children:n(`添加扩展`,`Add extension`)})]}),ee&&(0,z.jsxs)(`p`,{id:`pi-extension-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请使用上方的“添加包”输入框。`,`This is a package source. Use the Add package field above.`),(0,z.jsx)(`button`,{type:`button`,onClick:()=>M(j),children:n(`填入包`,`Use as package`)})]})]})]}):g?(0,z.jsx)(`p`,{role:`status`,children:n(`正在读取设置…`,`Loading settings…`)}):(0,z.jsx)(`button`,{className:`pi-settings-retry`,type:`button`,onClick:()=>{b()},children:n(`重试读取设置`,`Retry loading settings`)})]},S.kind)]})}var fx={diagrams:`@pi-webapp/diagrams`,git:`@pi-webapp/git`,files:`@pi-webapp/files`,terminal:`@pi-webapp/terminal`};function px({size:e=24}){return(0,z.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,z.jsx)(`path`,{d:`m14.5 4.5 5 5M4 20l5.3-1.3L20 8a2.8 2.8 0 0 0-4-4L5.3 14.7 4 20Z`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,z.jsx)(`path`,{d:`m5.5 14.5 4 4M8 15l8-8`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]})}var $={page:`_page_1c6kn_2`,pageHead:`_pageHead_1c6kn_4`,pageHeading:`_pageHeading_1c6kn_5`,pageIntro:`_pageIntro_1c6kn_7`,infoButton:`_infoButton_1c6kn_8`,toolbar:`_toolbar_1c6kn_10`,search:`_search_1c6kn_11`,iconButton:`_iconButton_1c6kn_15`,spin:`_spin_1c6kn_18`,crumb:`_crumb_1c6kn_20`,scope:`_scope_1c6kn_22`,error:`_error_1c6kn_23`,notice:`_notice_1c6kn_23`,group:`_group_1c6kn_26`,groupTitle:`_groupTitle_1c6kn_27`,cards:`_cards_1c6kn_28`,card:`_card_1c6kn_28`,artwork:`_artwork_1c6kn_31`,cardMain:`_cardMain_1c6kn_34`,titleRow:`_titleRow_1c6kn_35`,cardOpen:`_cardOpen_1c6kn_36`,tag:`_tag_1c6kn_42`,cardEnd:`_cardEnd_1c6kn_45`,switch:`_switch_1c6kn_46`,thumb:`_thumb_1c6kn_48`,back:`_back_1c6kn_50`,skeleton:`_skeleton_1c6kn_52`,pulse:`_pulse_1c6kn_1`,skeletonLine:`_skeletonLine_1c6kn_54`,detail:`_detail_1c6kn_56`,detailHead:`_detailHead_1c6kn_57`,detailMain:`_detailMain_1c6kn_59`,detailDesc:`_detailDesc_1c6kn_61`,detailName:`_detailName_1c6kn_62`,detailSection:`_detailSection_1c6kn_64`,danger:`_danger_1c6kn_69`},mx={pluginId:`@chengzhiyi/pi-excalidraw`,name:`Excalidraw`,official:!0,icon:`drawing`,installed:!1,enabled:!1,phase:`not-installed`};async function hx(e,t={},n={}){let r=l(),i=e.split(`?`)[0],a=i===`/api/message`?l():void 0,o=new Headers(t.headers);o.set(`X-Request-ID`,r),a&&o.set(`X-Operation-ID`,a);let s={requestId:r,operationId:a},c=performance.now();f(`request_start`,{...s,route:i,method:t.method??`GET`});try{let n=await fetch(e,{...t,headers:o});return s.requestId=n.headers.get(`X-Request-ID`)||r,s.operationId=n.headers.get(`X-Operation-ID`)||a,f(`request_end`,{...s,route:i,status:n.status,durationMs:Math.round(performance.now()-c)}),{response:n,correlation:s,route:i}}catch(e){let t={...s,route:i,stage:`network`,durationMs:Math.round(performance.now()-c)};throw f(`request_failed`,t),n.expectedNetworkFailure||u(e,t),e}}async function gx(e){let{response:t,correlation:n,route:r}=e,i;try{i=await t.json()}catch(e){throw u(e,{...n,route:r,status:t.status,stage:`response_parse`}),e}if(!t.ok){let e=new Ub(typeof i?.error==`string`?i.error:`Request failed: ${t.status}`,t.status,typeof i?.reason==`string`?i.reason:void 0),a=typeof i?.errorId==`string`&&/^[a-f0-9]{32}$/.test(i.errorId),s=i?.errorCode===`validation_error`||t.status<500&&i?.errorCode!==`unexpected_error`;throw a||i?.errorReported===!0||s||u(p(r)?o(e,`Agent or provider operation failed`):e,{...n,route:r,status:t.status,stage:`http`}),c(e),e}return i}async function _x(e,t,n){let r=d(),{response:i}=await hx(`/api/hosted-plugins${e}`,{method:t===void 0?`GET`:`POST`,credentials:`same-origin`,signal:n,headers:{...r?{Authorization:`Bearer ${r}`}:{},...t===void 0?{}:{"Content-Type":`application/json`}},body:t===void 0?void 0:JSON.stringify(t)}),a=await i.json();if(!i.ok)throw Object.assign(Error(a.error?.message??a.error??`Hosted plugin request failed (${i.status})`),{status:i.status,code:a.error?.code??a.errorCode,reason:a.error?.reason??a.reason});return a}var vx={catalog:e=>_x(``,void 0,e),manage:e=>_x(`/manage`,e),action:e=>_x(`/action`,e),decide:(e,t)=>_x(`/approvals`,{id:e,decision:t}),secret:(e,t,n)=>_x(`/secrets`,{pluginId:e,name:t,value:n}),signIn:e=>_x(`/secrets`,e),pendingViews:e=>_x(`/views`,{operation:`list-pending`,pluginId:e}),view:(e,t)=>_x(`/views`,e,t)},yx={section:`_section_8lsu2_1`,notice:`_notice_8lsu2_4`,error:`_error_8lsu2_5`,devInfo:`_devInfo_8lsu2_6`,devProblems:`_devProblems_8lsu2_7`,actions:`_actions_8lsu2_13`,configuration:`_configuration_8lsu2_18`,rowActions:`_rowActions_8lsu2_19`};function bx({pluginId:e,t}){let[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(0);(0,O.useEffect)(()=>{let t=!0;return vx.pendingViews(e).then(e=>{t&&r(e.views)}).catch(e=>{t&&s(String(e))}),()=>{t=!1}},[e,u]);let f=async e=>{l(!0),s(``);try{await vx.view({pluginId:e.pluginId,sessionId:e.sessionId,generation:e.generation,mountId:e.mountId,viewToken:e.viewToken,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),a(null),d(e=>e+1)}catch(e){s(String(e))}finally{l(!1)}};return!n?.length&&!o?null:(0,z.jsxs)(`div`,{className:yx.error,"data-pending-views":!0,children:[(0,z.jsx)(`p`,{children:t(`宿主仍持有以下视图。若原窗口已关闭,可丢弃该视图后重试;仍打开的窗口请先保存并关闭。丢弃不会保存内容,无法找回的修改可能永久丢失。`,`The host still holds these views. If the original window is closed, discard the view and retry; save and close windows that are still open first. Discarding does not save content; unrecovered edits may be permanently lost.`)}),n?.map(e=>(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`code`,{children:[e.kind,` · `,e.mountId,` · `,t(`会话`,`session`),` `,e.sessionId,e.dirty||e.busy?` · ${t(`有未确认修改`,`unconfirmed edits`)}`:``]}),` `,i===e.viewToken?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(e),children:t(`确认丢弃`,`Confirm discard`)}),` `,(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(null),children:t(`取消`,`Cancel`)})]}):(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(e.viewToken),children:t(`丢弃此视图`,`Discard this view`)})]},e.viewToken)),o&&(0,z.jsx)(`p`,{role:`alert`,children:o})]})}function xx({size:e=24}){return(0,z.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,z.jsx)(`path`,{d:`M5 19C5 11 10 6 18 6`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`}),(0,z.jsx)(`path`,{d:`M18 6h-6`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,z.jsx)(`rect`,{x:`3`,y:`17`,width:`4`,height:`4`,rx:`0.8`,fill:`currentColor`}),(0,z.jsx)(`rect`,{x:`16`,y:`4`,width:`4`,height:`4`,rx:`0.8`,fill:`currentColor`}),(0,z.jsx)(`circle`,{cx:`10.5`,cy:`6`,r:`1.5`,fill:`currentColor`})]})}function Sx({card:e,size:t=24}){let n=e.icon??(e.pluginId===mx.pluginId?mx.icon:void 0);return(0,z.jsx)(n===`drawing`?px:n===`design`?xx:Tv,{size:t})}function Cx(e,t,n){let r=(e,n)=>t===`zh`?e:n;return e===`uninstall`?{title:r(`卸载 ${n}?`,`Uninstall ${n}?`),description:r(`保存成功后将关闭相关视图并卸载插件。工作区文件和插件数据会保留,可重新安装后继续使用;保存失败时不会卸载。`,`After saving successfully, related views close and the plugin is uninstalled. Workspace files and plugin data are retained for reinstallation. A failed save stops uninstallation.`),confirm:r(`卸载`,`Uninstall`)}:e===`disable`?{title:r(`停用 ${n}?`,`Disable ${n}?`),description:r(`保存成功后将关闭相关视图并停用插件。插件仍保持安装,工作区文件和插件数据会保留;保存失败时不会停用。`,`After saving successfully, related views close and the plugin is disabled. It remains installed, with workspace files and plugin data retained. A failed save stops disabling.`),confirm:r(`停用`,`Disable`)}:{title:r(`立即更新 ${n} 并重新打开?`,`Update ${n} and reopen now?`),description:r(`全部视图保存成功后将更新插件并重新打开视图,撤销/重做历史会清空。工作区文件和插件数据会保留;保存失败时不会更新。`,`After all views save successfully, update the plugin and reopen its views. Undo/redo history will be cleared. Workspace files and plugin data are retained. A failed save stops the update.`),confirm:r(`更新并重新打开`,`Update and reopen`)}}function wx({card:e,t,onCatalog:n,disabled:r}){let[i,a]=(0,O.useState)({}),[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(!1),f=(0,O.useRef)(!0);if((0,O.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]),(0,O.useEffect)(()=>{if(!c)return;let e=!1;return(async()=>{for(;!e&&f.current;){if(await new Promise(e=>setTimeout(e,3e3)),e||!f.current)return;try{let e=await vx.signIn({auth:`poll`,deviceId:c.deviceId});if(e.status===`granted`&&e.catalog){n(e.catalog),l(null),s(t(`已授权。`,`Authorized.`));return}if(e.status===`denied`||e.status===`expired`){l(null),s(e.status===`denied`?t(`授权已被拒绝。`,`Authorization was denied.`):t(`授权已过期,请重试。`,`Authorization expired. Try again.`));return}}catch(e){l(null),s(e instanceof Error?e.message:String(e));return}}})(),()=>{e=!0}},[c]),!e.secrets?.length)return null;let p=async(r,i)=>{s(``);try{n(await vx.secret(e.pluginId,r,i)),a(e=>({...e,[r]:``})),s(i===null?t(`已移除。`,`Removed.`):t(`已保存。`,`Saved.`))}catch(e){s(e instanceof Error?e.message:String(e))}},m=async t=>{s(``);try{let n=await vx.signIn({auth:`start`,pluginId:e.pluginId,name:t});d(!1),l({name:t,deviceId:n.deviceId,userCode:n.userCode,verificationUri:n.verificationUri})}catch(e){s(e instanceof Error?e.message:String(e))}},h=async e=>{d(await fn(e))},g=e=>{window.open(e.verificationUri,`_blank`,`noopener,noreferrer`),h(e.userCode)},_=()=>{c&&vx.signIn({auth:`cancel`,deviceId:c.deviceId}).catch(()=>{}),l(null)};return(0,z.jsxs)(`section`,{className:yx.configuration,children:[(0,z.jsx)(`h2`,{children:t(`授权`,`Authorization`)}),(0,z.jsx)(`p`,{className:$.scope,children:t(`令牌只保存在本机,由主程序代为发起请求;插件进程和页面永远读不到它。`,`The token is stored on this machine and used by the host on the plugin's behalf; plugin code and pages can never read it.`)}),e.secrets.map(e=>(0,z.jsxs)(`div`,{className:yx.configuration,children:[(0,z.jsxs)(`div`,{className:yx.actions,children:[(0,z.jsx)(`span`,{role:`status`,children:e.configured?t(`已授权`,`Authorized`):t(`未授权`,`Not authorized`)}),e.signIn===`browser`&&(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:r||!!c,onClick:()=>void m(e.name),children:e.configured?t(`重新授权`,`Re-authorize`):t(`在浏览器中授权 GitHub`,`Authorize with GitHub`)}),e.signIn===`token-page`&&e.createUrl&&(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>window.open(e.createUrl,`_blank`,`noopener,noreferrer`),children:t(`打开 GitHub 创建令牌`,`Open GitHub to create a token`)}),e.configured&&(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void p(e.name,null),children:t(`移除`,`Remove`)})]}),c?.name===e.name&&(0,z.jsxs)(`div`,{className:$.scope,role:`status`,children:[(0,z.jsxs)(`ol`,{style:{margin:0,paddingLeft:20,display:`grid`,gap:10},children:[(0,z.jsxs)(`li`,{children:[t(`复制下面的验证码`,`Copy this code`),(0,z.jsxs)(`div`,{className:yx.actions,style:{marginTop:6},children:[(0,z.jsx)(`code`,{style:{fontSize:28,letterSpacing:4,fontWeight:600,padding:`6px 14px`,border:`1px solid currentColor`,borderRadius:8,userSelect:`all`},children:c.userCode}),(0,z.jsx)(qy,{variant:`outline`,size:`sm`,onClick:()=>void h(c.userCode),children:u?t(`已复制`,`Copied`):t(`复制`,`Copy`)})]})]}),(0,z.jsxs)(`li`,{children:[t(`打开 GitHub 授权页,粘贴验证码并点击 Authorize`,`Open GitHub, paste the code and click Authorize`),(0,z.jsx)(`div`,{className:yx.actions,style:{marginTop:6},children:(0,z.jsx)(qy,{size:`sm`,onClick:()=>g(c),children:t(`复制验证码并打开 GitHub`,`Copy code and open GitHub`)})})]})]}),(0,z.jsxs)(`div`,{className:yx.actions,style:{marginTop:10},children:[(0,z.jsx)(`span`,{children:t(`等待授权中… 完成后这里会自动更新。`,`Waiting for authorization… this updates automatically.`)}),(0,z.jsx)(qy,{variant:`outline`,size:`sm`,onClick:_,children:t(`取消`,`Cancel`)})]})]}),(0,z.jsxs)(`details`,{open:e.signIn===`token-page`&&!e.configured,children:[(0,z.jsx)(`summary`,{children:e.signIn===`token-page`?t(`创建后在此粘贴令牌(建议只授予该插件所需的仓库和权限)`,`Paste the token here after creating it (grant only the repositories and permissions this plugin needs)`):t(`改用手动粘贴令牌`,`Paste a token instead`)}),(0,z.jsxs)(`div`,{className:yx.actions,children:[(0,z.jsx)(`input`,{type:`password`,autoComplete:`off`,"aria-label":e.name,value:i[e.name]??``,onChange:t=>a(n=>({...n,[e.name]:t.target.value}))}),(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:r||!(i[e.name]??``).trim(),onClick:()=>void p(e.name,(i[e.name]??``).trim()),children:t(`保存`,`Save`)})]})]})]},e.name)),o&&(0,z.jsx)(`p`,{role:`status`,className:$.scope,children:o})]})}function Tx(e,t,n){let r={metadata_not_found:n(`官方插件暂未发布,暂不可安装。稍后可重新检查。`,`The official package is not currently published. Check again later.`),tarball_not_found:n(`发行文件暂不可用。请重新检查或稍后重试。`,`The release file is unavailable. Check again or retry later.`),no_compatible_version:n(`暂无适用于此软件版本的插件。稍后可重新检查。`,`No compatible release for this app version. Check again later.`),registry_unreachable:n(`暂时无法访问下载服务。请检查网络后重试。`,`Cannot reach the download service. Check your network and retry.`),download_cancelled:n(`下载已取消。`,`Download cancelled.`),view_barrier:n(`尚未完成所有视图的保存确认,操作已停止。请先处理本页的刷新前视图记录,并检查仍打开的编辑器,然后重试。`,`Save confirmation is still pending for some views, so the operation stopped. Review previous-view records on this page and any open editors, then retry.`),runtime_owned:n(`插件运行时被其他宿主或遗留锁占用,当前无法打开或卸载。请停止所有宿主并校验备份后,按恢复说明处理;重新安装不会清除此锁。`,`Another host or a retained ownership lock blocks this runtime, including opening and uninstalling. Stop all hosts, verify a backup and follow recovery instructions; reinstalling does not clear the lock.`)}[e.code??``]??n(`操作未完成。请查看诊断信息后重试。`,`Operation did not finish. Review diagnostics and retry.`);return(t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`,`registry_unreachable`,`download_cancelled`].includes(e.code??``)?n(`更新未完成,当前插件及数据已保留。`,`Update did not finish; current plugin and data retained. `):``)+r}function Ex({locale:e,generation:t=0,reload:n=0,query:r=``,selectedId:i,visible:a=!0,disabled:o=!1,onSelect:s,onBusyChange:c,onMatchCountChange:l}){let u=(t,n)=>e===`zh`?t:n,[d,f]=(0,O.useState)({plugins:[mx],offline:!0}),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(!0),[_,v]=(0,O.useState)(!1),y=(0,O.useRef)(!1),b=(0,O.useRef)(0),x=(0,O.useRef)(new Set);(0,O.useEffect)(()=>{for(let e of d.plugins)e.installed&&x.current.add(e.pluginId)},[d]);let[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(null),[E,D]=(0,O.useState)(null),[k,A]=(0,O.useState)(``),[j,ee]=(0,O.useState)(0),[M,N]=(0,O.useState)(null),P=M?Cx(M.operation,e,M.card.name):null,F=e=>({message:e instanceof Error?e.message:String(e),code:e?.code});(0,O.useEffect)(()=>{if(y.current)return;let e=++b.current,t=new AbortController;return g(!0),D(null),vx.catalog(t.signal).then(t=>{e===b.current&&(f(t),m(!0),T(null))}).catch(n=>{!t.signal.aborted&&e===b.current&&(T(F(n)),f(e=>({...e,offline:!0})))}).finally(()=>{e===b.current&&g(!1)}),()=>{t.abort()}},[t,n,j]);let I=async(e,t,n=!1)=>{if(y.current||o||h)return;y.current=!0,++b.current,N(null);let r=[`install`,`update`,`check`].includes(t)?crypto.randomUUID():void 0;C(r?{pluginId:e.pluginId,id:r}:null),v(!0),c(!0),D(null),A(``);try{let i=await vx.manage({pluginId:e.pluginId,operation:t,...r?{downloadId:r}:{},...n?{reopenEditors:!0}:{}});f(i),m(!0),T(null),A(i.plugins.some(e=>e.pendingVersion)?u(`更新已准备好,关闭编辑器后生效。`,`Update ready. Close editors to apply.`):u(`操作完成。`,`Done.`)),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch(t){D({id:e.pluginId,problem:F(t)});try{f(await vx.catalog()),m(!0),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch{}}finally{y.current=!1,v(!1),c(!1),C(null)}},te=(e,t)=>{t===`disable`||t===`uninstall`?N({card:e,operation:t}):I(e,t)},L=d.plugins.some(e=>e.pluginId===mx.pluginId)?d.plugins:[...d.plugins,mx],R=L.find(e=>e.pluginId===i),ne=L.filter(e=>`${e.name} ${e.pluginId} ${ie(e)}`.toLowerCase().includes(r.trim().toLowerCase()));(0,O.useEffect)(()=>{l(ne.length)},[ne.length,l]);let re=_||h||o||!p||!!d.offline;function ie(t){return t.contribution?.entry.description[e]??t.description?.[e]??(t.pluginId===mx.pluginId?u(`绘制、编辑手绘图表,并将图稿保存到工作区。`,`Draw and edit hand-drawn diagrams, and save them to your workspace.`):u(`按需下载安装的官方插件。`,`An official plugin available on demand.`))}let B=e=>`${e.name}${e.official?u(`(官方)`,` (Official)`):``}`,ae=new Map((d.dev?.sources??[]).map(e=>[e.pluginId,e])),oe=e=>({"waiting-build":u(`等待构建`,`Waiting for build`),switching:u(`正在切换`,`Switching`),synced:u(`已同步`,`Synced`),pending:u(`待应用`,`Pending`),"not-installed":u(`未安装`,`Not installed`),error:u(`出错`,`Error`)})[e.state],se=e=>{let t=ae.get(e.pluginId);return t&&(0,z.jsxs)(`span`,{className:$.tag,"data-tone":t.state===`error`?`danger`:`info`,title:t.root,"data-hosted-dev-source":t.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,oe(t)]})},ce=[...(d.dev?.notices??[]).filter(e=>e.level!==`info`),...(d.dev?.sources??[]).filter(e=>e.state===`error`).map(e=>({level:`error`,pluginId:e.pluginId,message:`${e.root}${e.message?`: ${e.message}`:``}`}))],le=(d.dev?.sources??[]).filter(e=>e.state!==`error`&&!L.some(t=>t.pluginId===e.pluginId)),V=e=>E?.id===e.pluginId?E.problem:e.error?{code:e.errorCode,message:e.error}:e.updateDiagnostic?.status===`failed`?e.updateDiagnostic:null,ue=e=>p?`${e.installed?u(`已安装`,`Installed`):u(`未安装`,`Not installed`)} · ${e.enabled?u(`已启用`,`Enabled`):u(`未启用`,`Disabled`)}${e.version?` ${e.version}`:``}${e.enabled&&e.phase!==`active`?u(` · 运行时不可用`,` · Runtime unavailable`):``}`:u(`安装状态未知 · 启用状态未知`,`Installation unknown · Enablement unknown`),de=e=>(0,z.jsx)(`button`,{type:`button`,role:`switch`,className:$.switch,"aria-label":u(`启用 ${e.name}`,`Enable ${e.name}`),"aria-checked":p&&e.enabled,disabled:re||!e.installed,title:p?e.installed?void 0:u(`请先下载插件`,`Download the plugin first`):u(`请先读取插件状态`,`Read plugin status first`),onClick:()=>te(e,e.enabled?`disable`:`enable`),children:(0,z.jsx)(`span`,{className:$.thumb})}),fe=e=>{let t=V(e),n=!e.installed&&!!t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`].includes(t.code??``);return(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:re||n,onClick:()=>te(e,e.pendingVersion?`retry`:e.installed?`update`:`install`),children:e.pendingVersion?u(`应用待更新版本`,`Apply pending update`):e.installed?u(`更新`,`Update`):n?u(`暂不可下载`,`Unavailable`):e.hasRetainedData||x.current.has(e.pluginId)?u(`重新安装`,`Reinstall`):u(`下载`,`Download`)})};return(0,O.useEffect)(()=>{if(!E||R)return;let e=L.find(e=>e.pluginId===E.id);st({key:`hosted-operation-${E.id}`,message:`${e?`${B(e)}:`:``}${Tx(E.problem,!!e?.installed,u)}`,detail:[E.problem.code,E.problem.message].filter(Boolean).join(`: `),detailLabel:u(`诊断信息`,`Diagnostics`)})},[E]),(0,z.jsxs)(`section`,{className:yx.section,"data-hosted-management":!0,"aria-busy":_||h,style:a?void 0:{display:`none`},children:[!R&&(0,z.jsx)(`h2`,{className:$.groupTitle,children:u(`官方插件`,`Official plugins`)}),w&&(0,z.jsxs)(`div`,{role:`alert`,className:yx.error,children:[u(`无法读取插件状态,请重试。`,`Cannot read plugin status. Please retry.`),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),w.message]}),(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:_||h||o,onClick:()=>ee(e=>e+1),children:u(`重试`,`Retry`)})]}),!R&&d.dev&&(0,z.jsxs)(z.Fragment,{children:[d.dev.notices.filter(e=>e.level===`info`).map((e,t)=>(0,z.jsxs)(`p`,{className:yx.devInfo,role:`status`,children:[u(`开发模式`,`Dev mode`),e.pluginId?` · ${e.pluginId}`:``,`: `,e.message]},t)),le.map(e=>(0,z.jsxs)(`p`,{className:yx.devInfo,role:`status`,"data-hosted-dev-source":e.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,e.pluginId,` · `,oe(e),` · `,(0,z.jsx)(`code`,{children:e.root})]},e.pluginId)),ce.length>0&&(0,z.jsxs)(`div`,{className:yx.devProblems,"data-hosted-dev":!0,role:`alert`,children:[(0,z.jsx)(`strong`,{children:u(`开发模式:${ce.length} 个配置问题`,`Dev mode: ${ce.length} configuration ${ce.length===1?`issue`:`issues`}`)}),(0,z.jsx)(`ul`,{children:ce.map((e,t)=>(0,z.jsxs)(`li`,{"data-level":e.level,children:[e.pluginId&&(0,z.jsxs)(`span`,{children:[e.pluginId,`: `]}),(0,z.jsx)(`code`,{children:e.message})]},t))}),(0,z.jsx)(`p`,{children:u(`来自 hosted-dev.json 或 PI_WEBAPP_HOSTED_DEV_ROOTS,修改后会自动重新读取。其余插件不受影响。`,`From hosted-dev.json or PI_WEBAPP_HOSTED_DEV_ROOTS; edits are picked up automatically. Other plugins are unaffected.`)})]})]}),k&&(0,z.jsx)(`p`,{className:yx.notice,role:`status`,children:k}),S&&(0,z.jsx)(qy,{variant:`outline`,onClick:()=>{vx.manage({pluginId:S.pluginId,operation:`cancel-download`,downloadId:S.id}).then(()=>A(u(`已请求取消,已完成的安装不会回滚。`,`Cancellation requested; committed installations are not rolled back.`))).catch(e=>D({id:S.pluginId,problem:F(e)}))},children:u(`取消下载(不回滚已提交安装)`,`Cancel download (no rollback after commit)`)}),R?(0,z.jsxs)(`div`,{className:$.detail,"data-hosted-detail":R.pluginId,children:[(0,z.jsxs)(`div`,{className:$.detailHead,children:[(0,z.jsx)(`span`,{className:$.artwork,"aria-hidden":`true`,children:(0,z.jsx)(Sx,{card:R,size:30})}),de(R)]}),(0,z.jsxs)(`div`,{className:$.detailMain,children:[(0,z.jsxs)(`div`,{className:$.titleRow,children:[(0,z.jsx)(`h1`,{children:R.name}),R.official&&(0,z.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:u(`官方`,`Official`)}),R.version&&(0,z.jsxs)(`span`,{className:$.tag,children:[`v`,R.version]}),se(R),V(R)&&(0,z.jsx)(`span`,{className:$.tag,"data-tone":`danger`,children:u(`需要处理`,`Needs attention`)})]}),(0,z.jsx)(`p`,{className:$.detailDesc,children:ie(R)}),(0,z.jsx)(`p`,{className:$.detailName,children:(0,z.jsx)(`code`,{children:R.pluginId})})]}),((e,t)=>{let n=V(e),r=e.updateDiagnostic;return n?(0,z.jsxs)(`div`,{className:yx.error,role:`alert`,children:[Tx(n,e.installed,u),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),(0,z.jsx)(`code`,{children:n.code}),(0,z.jsx)(`p`,{children:n.message}),r&&(0,z.jsxs)(`p`,{children:[r.checkedAt,` · `,r.hostVersion]}),/lock|owned/i.test(n.message)&&(0,z.jsx)(`p`,{children:u(`停止所有程序并备份后,按 docs/hosted-update-recovery.md 恢复。此页面不会清锁。`,`Stop all hosts and back up data before following docs/hosted-update-recovery.md. This page never clears locks.`)})]}),n.code===`view_barrier`&&(0,z.jsx)(bx,{pluginId:e.pluginId,t:u})]}):null})(R,!0),(0,z.jsxs)(`section`,{className:$.detailSection,children:[(0,z.jsx)(`h2`,{children:u(`详细信息`,`Details`)}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(`dt`,{children:u(`来源`,`Source`)}),(0,z.jsx)(`dd`,{children:ae.has(R.pluginId)?(0,z.jsxs)(z.Fragment,{children:[u(`开发目录`,`Dev directory`),` · `,oe(ae.get(R.pluginId)),(0,z.jsx)(`br`,{}),(0,z.jsx)(`code`,{children:ae.get(R.pluginId).root}),ae.get(R.pluginId).message&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`br`,{}),ae.get(R.pluginId).message]})]}):u(`按需下载的官方插件`,`Official on-demand package`)}),(0,z.jsx)(`dt`,{children:u(`状态`,`Status`)}),(0,z.jsx)(`dd`,{children:ue(R)}),R.availableVersion&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:u(`可用版本`,`Available release`)}),(0,z.jsx)(`dd`,{children:R.availableVersion})]}),R.pendingVersion&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:u(`待更新版本`,`Pending release`)}),(0,z.jsx)(`dd`,{children:R.pendingVersion})]})]})]}),(0,z.jsx)(wx,{card:R,t:u,disabled:re,onCatalog:e=>{f(e),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}}),(0,z.jsxs)(`section`,{className:`${yx.configuration} ${$.detailSection}`,children:[(0,z.jsx)(`h2`,{children:u(`配置与更新`,`Configuration & updates`)}),(0,z.jsx)(`p`,{className:$.scope,children:R.icon===`drawing`||R.pluginId===mx.pluginId?u(`无需额外配置。启用后,可从工作区侧栏打开,也可查看对话中的图稿。图稿保存在工作区,停用或卸载不会删除文件和插件数据。`,`No additional configuration is required. Once enabled, open it from the workspace sidebar or view diagrams in conversations. Disabling or uninstalling retains workspace files and plugin data.`):u(`启用后从工作区侧栏打开。停用或卸载不会删除插件数据。`,`Once enabled, open it from the workspace sidebar. Disabling or uninstalling retains plugin data.`)}),(0,z.jsx)(`p`,{className:$.scope,children:u(`兼容的插件可独立更新;软件升级仅在协议不兼容时协调插件版本。`,`Compatible plugins update independently. App upgrades coordinate plugins only when their protocol is incompatible.`)}),(0,z.jsx)(`p`,{className:$.scope,children:u(`停用或卸载前会先保存并关闭相关视图;保存失败时不会继续。`,`Disabling or uninstalling first saves and closes related views; a failed save stops the operation.`)}),R.pendingVersion&&(0,z.jsxs)(`p`,{className:$.scope,role:`status`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),R.pendingVersion]}),!V(R)&&R.updateDiagnostic?.status===`up-to-date`&&!R.pendingVersion&&(0,z.jsx)(`p`,{className:$.scope,children:u(`兼容版本检查已完成。`,`Compatible release check complete.`)}),(0,z.jsxs)(`div`,{className:yx.actions,children:[fe(R),(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:re,onClick:()=>te(R,`check`),children:u(`检查更新`,`Check updates`)}),R.installed&&(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:re,onClick:()=>te(R,`uninstall`),children:u(`卸载`,`Uninstall`)}),R.pendingVersion&&(0,z.jsx)(qy,{variant:`outline`,size:`sm`,disabled:re,onClick:()=>N({card:R,operation:`update`,reopen:!0}),children:u(`立即更新并重新打开`,`Update and reopen now`)})]})]})]}):(0,z.jsx)(`ul`,{className:$.cards,children:ne.map(e=>(0,z.jsxs)(`li`,{className:$.card,"data-hosted-card":e.pluginId,children:[(0,z.jsx)(`span`,{className:$.artwork,"aria-hidden":`true`,children:(0,z.jsx)(Sx,{card:e,size:30})}),(0,z.jsxs)(`div`,{className:$.cardMain,children:[(0,z.jsxs)(`div`,{className:$.titleRow,children:[(0,z.jsx)(`button`,{className:$.cardOpen,type:`button`,onClick:()=>s({id:e.pluginId,name:e.name}),children:B(e)}),(0,z.jsx)(`span`,{className:$.tag,"data-tone":_?`info`:void 0,children:_?u(`正在应用…`,`Applying…`):ue(e)}),se(e),!_&&V(e)&&(0,z.jsx)(`span`,{className:$.tag,"data-tone":`danger`,children:u(`需要处理`,`Needs attention`)}),e.pendingVersion?(0,z.jsxs)(`span`,{className:$.tag,"data-tone":`info`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),e.pendingVersion]}):e.availableVersion&&e.availableVersion!==e.version&&(0,z.jsxs)(`span`,{className:$.tag,"data-tone":`info`,children:[u(`可用版本:`,`Available release: `),e.availableVersion]})]}),(0,z.jsx)(`p`,{children:ie(e)})]}),(0,z.jsxs)(`div`,{className:`${$.cardEnd} ${yx.rowActions}`,children:[fe(e),de(e)]})]},e.pluginId))}),(0,z.jsx)(Yy,{open:M!==null,onClose:()=>N(null),title:P?.title??``,closeLabel:u(`关闭`,`Close`),description:P?.description,footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,onClick:()=>N(null),children:u(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,disabled:re,onClick:()=>{M&&I(M.card,M.operation,M.reopen)},children:P?.confirm})]})})]})}function Dx({size:e}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`m5 7 5 5-5 5`}),(0,z.jsx)(`path`,{d:`M13 17h6`})]})}function Ox({getPluginManagement:e,togglePlugin:t,generation:n=0,recovery:r}){let i=te(),a=(e,t)=>L(i,e,t),o=e=>typeof e==`string`?e:e[i],[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(1),[_,v]=(0,O.useState)(0),[y,x]=(0,O.useState)(``),[S,C]=(0,O.useState)(null),[w,T]=(0,O.useState)(!0),[E,D]=(0,O.useState)(``),[k,A]=(0,O.useState)(null),j=(0,O.useRef)(!1),ee=(0,O.useRef)(!1),M=(0,O.useRef)(n),N=(0,O.useRef)(!0),P=async(t=!0)=>{if(j.current)ee.current=!0;else{j.current=!0,T(!0),t&&(D(``),v(e=>e+1));try{let t=await e();N.current&&c(t)}catch(e){N.current&&D(e instanceof Error?e.message:a(`无法读取插件`,`Could not load plugins`))}finally{j.current=!1,N.current&&T(!1),ee.current&&N.current&&(ee.current=!1,P(!1))}}};(0,O.useEffect)(()=>(N.current=!0,P(),()=>{N.current=!1}),[]),(0,O.useEffect)(()=>{M.current!==n&&(M.current=n,P(!1))},[n]);let F=async e=>{if(s&&!j.current){j.current=!0,C(e.id),D(``),A(null);try{let n=await t({id:e.id,enabled:!e.enabled,expected:s.revision});N.current&&(c(n),st({key:`plugin-settings-saved`,tone:`info`,message:a(`插件配置已保存并生效`,`Plugin settings saved and applied`)}))}catch(e){N.current&&D((e instanceof Error?e.message:a(`保存失败`,`Could not save`))+a(`。请刷新确认状态;操作不会自动重试。`,`. Refresh to verify the state; this operation is not retried automatically.`))}finally{j.current=!1,N.current&&C(null),ee.current&&N.current&&(ee.current=!1,P(!1))}}},I=e=>{e.id===fx.terminal&&e.enabled?A(e):F(e)},R=e=>(0,z.jsx)(`button`,{type:`button`,role:`switch`,className:$.switch,"aria-label":a(`启用 ${o(e.name)}`,`Enable ${o(e.name)}`),"aria-checked":e.enabled,disabled:w||S!==null||p||!e.managed,title:e.managed?void 0:a(`请在包与扩展中管理 Pi 运行时`,`Manage the Pi runtime under Packages & extensions`),onClick:()=>I(e),children:(0,z.jsx)(`span`,{className:$.thumb})}),ne=(e,t=26)=>e.id===fx.git?(0,z.jsx)(I_,{size:t}):e.id===fx.terminal?(0,z.jsx)(Dx,{size:t}):e.id===fx.files?(0,z.jsx)(b,{kind:`folder`,size:t}):e.id===fx.diagrams?(0,z.jsx)(px,{size:t}):(0,z.jsx)(Tv,{size:t}),re=e=>e.id===fx.git?`git`:e.id===fx.terminal?`terminal`:void 0,ie=a(`全局设置 · 影响此服务的所有工作区和聊天;所有聊天空闲后才可修改。`,`Global settings · Applies to every workspace and chat on this service. Changes require all chats to be idle.`),B=s?.items.find(e=>e.id===l),ae=!!(B||d),oe=s?.items.filter(e=>`${o(e.name)} ${o(e.description)} ${e.id}`.toLowerCase().includes(y.trim().toLowerCase()))??[];return(0,z.jsxs)(`section`,{className:$.page,"data-plugin-panel":!0,"aria-busy":w||S!==null,children:[(0,z.jsxs)(`header`,{className:$.pageHead,children:[(0,z.jsx)(`div`,{className:$.pageHeading,children:ae?(0,z.jsx)(`button`,{type:`button`,className:$.crumb,onClick:()=>{u(null),f(null)},children:a(`‹ 插件`,`‹ Plugins`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h1`,{children:a(`插件`,`Plugins`)}),(0,z.jsxs)(`p`,{className:$.pageIntro,children:[a(`管理此服务的可选能力,按需启用。`,`Manage optional capabilities on this service.`),(0,z.jsx)(ve,{label:ie,side:`bottom`,maxWidth:320,children:(0,z.jsx)(`button`,{type:`button`,className:$.infoButton,"aria-label":ie,children:(0,z.jsx)(Cv,{size:14})})})]})]})}),(0,z.jsxs)(`div`,{className:$.toolbar,children:[!ae&&s&&(0,z.jsxs)(`label`,{className:$.search,children:[(0,z.jsx)(D_,{size:14}),(0,z.jsx)(`input`,{type:`search`,value:y,onChange:e=>x(e.target.value),placeholder:a(`搜索插件`,`Search plugins`),"aria-label":a(`搜索插件`,`Search plugins`)})]}),(0,z.jsx)(`button`,{type:`button`,className:$.iconButton,disabled:w||S!==null||p,onClick:()=>void P(),"aria-label":a(`刷新插件`,`Refresh plugins`),children:(0,z.jsx)(Q_,{size:16,className:w?$.spin:void 0})})]})]}),r,E&&(0,z.jsx)(`p`,{className:$.error,role:`alert`,children:E}),w&&!s&&(0,z.jsx)(`section`,{className:$.group,role:`status`,"aria-label":a(`正在读取插件…`,`Loading plugins…`),children:(0,z.jsx)(`ul`,{className:$.cards,children:[0,1,2].map(e=>(0,z.jsxs)(`li`,{className:$.card,children:[(0,z.jsx)(`span`,{className:`${$.artwork} ${$.skeleton}`}),(0,z.jsxs)(`div`,{className:$.cardMain,children:[(0,z.jsx)(`span`,{className:`${$.skeletonLine} ${$.skeleton}`,style:{width:144}}),(0,z.jsx)(`span`,{className:`${$.skeletonLine} ${$.skeleton}`,style:{width:280,maxWidth:`85%`}})]})]},e))})}),!s&&!w&&(0,z.jsx)(`button`,{type:`button`,className:$.back,onClick:()=>void P(),children:a(`重试`,`Retry`)}),B?(0,z.jsxs)(`div`,{className:$.detail,children:[(0,z.jsxs)(`div`,{className:$.detailHead,children:[(0,z.jsx)(`span`,{className:$.artwork,"data-icon":re(B),"aria-hidden":`true`,children:ne(B,30)}),R(B)]}),(0,z.jsxs)(`div`,{className:$.detailMain,children:[(0,z.jsxs)(`div`,{className:$.titleRow,children:[(0,z.jsx)(`h1`,{children:o(B.name)}),B.version&&(0,z.jsxs)(`span`,{className:$.tag,children:[`v`,B.version]}),S===B.id&&(0,z.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:a(`正在应用…`,`Applying…`)})]}),(0,z.jsx)(`p`,{className:$.detailDesc,children:o(B.description)}),(0,z.jsx)(`p`,{className:$.detailName,children:(0,z.jsx)(`code`,{children:B.id})})]}),(0,z.jsxs)(`section`,{className:$.detailSection,children:[(0,z.jsx)(`h2`,{children:a(`详细信息`,`Details`)}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(`dt`,{children:a(`来源`,`Source`)}),(0,z.jsx)(`dd`,{children:B.kind===`builtin`?a(`随应用内置`,`Bundled with the application`):a(`Pi 软件包`,`Pi package`)}),(0,z.jsx)(`dt`,{children:a(`状态`,`Status`)}),(0,z.jsx)(`dd`,{children:B.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)}),B.version&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:a(`契约版本`,`Contract version`)}),(0,z.jsx)(`dd`,{children:B.version})]})]})]}),(0,z.jsxs)(`section`,{className:$.detailSection,children:[(0,z.jsx)(`h2`,{children:a(`说明`,`Notes`)}),(0,z.jsx)(`p`,{className:$.scope,children:B.managed?a(`停用会移除入口、关闭相关标签并阻止该插件的后端请求。不会删除工作区文件或聊天记录。`,`Disabling removes entries, closes related tabs and blocks backend requests. Workspace files and chat history are not deleted.`):a(`此插件的 Pi 运行时由软件包管理。当前协议未提供独立、安全卸载该运行时的能力,因此这里仅展示状态,不提供假开关。`,`The Pi package owns this runtime. Its protocol does not expose independent safe teardown, so this page shows its status without a misleading toggle.`)}),B.id===fx.git&&(0,z.jsx)(`p`,{className:$.scope,children:a(`关闭 Git 面板不禁止 Agent 或其他终端执行系统 git。`,`Disabling the Git panel does not prevent an agent or another terminal from running system git.`)}),(0,z.jsx)(`p`,{className:$.scope,children:ie})]})]}):s&&!d&&(0,z.jsxs)(z.Fragment,{children:[[`builtin`,`external`].map(e=>{let t=oe.filter(t=>t.kind===e);return t.length?(0,z.jsxs)(`section`,{className:$.group,children:[(0,z.jsx)(`h2`,{className:$.groupTitle,children:e===`builtin`?a(`内置插件`,`Built-in plugins`):a(`已安装的 Web 插件`,`Installed Web plugins`)}),(0,z.jsx)(`ul`,{className:$.cards,children:t.map(e=>(0,z.jsxs)(`li`,{className:$.card,"data-plugin-package":e.id,children:[(0,z.jsx)(`span`,{className:$.artwork,"data-icon":re(e),"aria-hidden":`true`,children:ne(e)}),(0,z.jsxs)(`div`,{className:$.cardMain,children:[(0,z.jsxs)(`div`,{className:$.titleRow,children:[(0,z.jsx)(`button`,{className:$.cardOpen,type:`button`,onClick:()=>u(e.id),children:o(e.name)}),S===e.id&&(0,z.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:a(`正在应用…`,`Applying…`)}),!e.managed&&(0,z.jsx)(`span`,{className:$.tag,children:a(`由软件包管理`,`Package-managed`)})]}),(0,z.jsx)(`p`,{children:o(e.description)})]}),(0,z.jsx)(`div`,{className:$.cardEnd,children:R(e)})]},e.id))})]},e):null}),!oe.length&&!h&&(0,z.jsx)(`p`,{className:$.scope,children:a(`没有匹配的插件`,`No matching plugins`)})]}),(0,z.jsx)(Ex,{locale:i,generation:n,reload:_,query:y,selectedId:d?.id??null,visible:!B,disabled:w||S!==null,onSelect:f,onBusyChange:m,onMatchCountChange:g}),(0,z.jsx)(Yy,{open:k!==null,onClose:()=>A(null),title:a(`停用终端?`,`Disable Terminal?`),closeLabel:a(`关闭`,`Close`),description:a(`这会结束此服务所有聊天中的终端进程。未保存的 shell 工作可能丢失。`,`This ends terminal processes in every chat on this service. Unsaved shell work may be lost.`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{className:$.back,type:`button`,onClick:()=>A(null),children:a(`取消`,`Cancel`)}),(0,z.jsx)(`button`,{className:$.danger,type:`button`,onClick:()=>{k&&F(k)},children:a(`停用并结束终端`,`Disable and stop terminals`)})]})})]})}var kx={root:`_root_1ikfi_1`,trigger:`_trigger_1ikfi_2`,glyph:`_glyph_1ikfi_4`,dot:`_dot_1ikfi_5`,srOnly:`_srOnly_1ikfi_6`};function Ax(e){let t=Yb();return t?(0,z.jsx)(Mx,{...e,controller:t}):(0,z.jsx)(jx,{...e})}function jx(e){let t=Kb(e);return(0,z.jsx)(Mx,{...e,controller:t})}function Mx({wide:e,hideError:t,controller:n}){let r=te(),i=(e,t)=>L(r,e,t),{status:a,checking:o,installing:s,targetVersion:c,restartTimedOut:l,error:u,install:d}=n;if(dt(`app-update`,t?null:u&&i(`升级未完成,当前版本和数据已保留。可稍后重试。`,`Update did not finish; the current version and data are retained. You can retry.`),u??void 0,i(`诊断信息`,`Diagnostics`)),!a?.available||!a.canRestart)return null;let f=s?i(`正在升级…`,`Updating…`):c?i(`正在重启…`,`Restarting…`):a.downgrade?i(`切换到稳定版`,`Switch to stable`):i(`下载升级`,`Download updates`),p=a.downgrade?i(`按更新偏好切换到稳定版,需要确认后重启`,`Switch to stable based on your preference; confirmation and restart required`):i(`下载并升级到新版本,服务将短暂重启`,`Download and update to the new version; the service will briefly restart`);return(0,z.jsxs)(`div`,{className:kx.root,children:[(0,z.jsx)(`div`,{className:`pi-settings-trigger-row ${e?``:`pi-settings-trigger-rail`}`,children:(0,z.jsx)(ve,{label:p,children:(0,z.jsxs)(`button`,{className:`pi-settings-sidebar ${kx.trigger}`,"data-wide":e,type:`button`,"aria-label":f,disabled:o||s||!!c||l,onClick:()=>{d()},children:[(0,z.jsxs)(`span`,{className:kx.glyph,children:[(0,z.jsx)(Re,{size:e?16:18}),(0,z.jsx)(`span`,{className:kx.dot})]}),e&&(0,z.jsx)(`span`,{children:f})]})})}),(s||c)&&(0,z.jsx)(`span`,{className:kx.srOnly,role:`status`,children:f})]})}var Nx={trigger:`_trigger_1s641_2`,item:`_item_1s641_3`};function Px({wide:e}){let t=te(),n=((e,n)=>L(t,e,n))(`帮助与文档`,`Help & documentation`),r=(0,O.useRef)(null),i=(0,O.useRef)(null),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)({top:0,left:0}),l=(e=!0)=>{o(!1),e&&r.current?.focus()};return(0,O.useLayoutEffect)(()=>{if(!a)return;let t=r.current.getBoundingClientRect(),{height:n,width:s}=i.current.getBoundingClientRect();c({top:Math.max(12,t.top-n-4),left:Math.max(12,Math.min(e?t.right-s:t.left,window.innerWidth-s-12))}),i.current?.querySelector(`a`)?.focus();let l=e=>{!i.current?.contains(e.target)&&!r.current?.contains(e.target)&&o(!1)},u=()=>{o(!1),r.current?.focus()};return document.addEventListener(`pointerdown`,l,!0),window.addEventListener(`resize`,u),()=>{document.removeEventListener(`pointerdown`,l,!0),window.removeEventListener(`resize`,u)}},[a,e]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ve,{label:n,disabled:a,children:(0,z.jsx)(`button`,{ref:r,type:`button`,className:`pi-settings-sidebar ${Nx.trigger}`,"data-wide":e,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>a?l():o(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),o(!0))},children:(0,z.jsx)(Xe,{size:e?16:18})})}),a&&(0,Qe.createPortal)((0,z.jsx)(_,{ref:i,role:`menu`,tabIndex:-1,"aria-label":n,className:Xy.menu,style:s,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),l();else if(e.key===`Tab`)l();else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=[...i.current?.querySelectorAll(`a`)??[]],n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()}},children:ix(t).map(e=>(0,z.jsx)(`a`,{role:`menuitem`,href:e.href,target:`_blank`,rel:`noreferrer`,className:`${Xy.menuItem} ${Xy.menuItemNeutral} ${Nx.item}`,onClick:()=>l(!1),children:e.label},e.id))}),document.body)]})}var Fx=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ix=e=>typeof e==`string`,Lx=e=>typeof e==`boolean`,Rx=e=>typeof e==`number`&&Number.isFinite(e),zx=e=>t=>t===null||e(t),Bx=e=>t=>Array.isArray(t)&&t.every(e),Vx=(e,t,n)=>e[t]===void 0||n(e[t]),Hx=(e,t)=>t.every(t=>Ix(e[t])),Ux=(e,t)=>t.every(t=>Vx(e,t,Ix));function Wx(e){return Fx(e)&&Hx(e,[`id`,`timestamp`])&&[`user`,`assistant`,`tool`,`notice`].includes(e.role)&&Bx(e=>Fx(e)&&[`text`,`thinking`,`image`,`toolCall`].includes(e.kind)&&Ix(e.text)&&Ux(e,[`toolName`,`toolCallId`]))(e.blocks)&&Ux(e,[`toolName`,`toolCallId`,`model`,`error`])&&Vx(e,`isError`,Lx)&&Vx(e,`subagentInput`,t=>e.role===`user`&&(t===`dispatch`||t===`steering`))&&Vx(e,`subagentNotice`,t=>e.role===`notice`&&Fx(t)&&[`completed`,`failed`,`cancelled`,`unknown`].includes(t.status)&&Vx(t,`description`,Ix))&&Vx(e,`usage`,e=>Fx(e)&&[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`,`cost`].every(t=>Rx(e[t]))&&Vx(e,`reasoning`,Rx))}function Gx(e){return Fx(e)&&e.schemaVersion===1&&Hx(e,[`sessionId`,`cwd`,`name`])&&zx(Ix)(e.model)&&zx(Ix)(e.thinkingLevel)&&Bx(Ix)(e.thinkingLevels)&&Lx(e.idle)&&Vx(e,`paused`,Lx)&&Vx(e,`hasPendingPrompts`,Lx)&&Vx(e,`promptQueue`,e=>Fx(e)&&Bx(Ix)(e.steering)&&Bx(Ix)(e.followUp))&&Vx(e,`queuedPrompts`,Bx(e=>Fx(e)&&Hx(e,[`id`,`text`])&&Number.isSafeInteger(e.revision)&&e.revision>0&&[`queued`,`sending`].includes(e.status)&&Vx(e,`error`,Ix)&&Bx(e=>Fx(e)&&Ix(e.name)&&Lx(e.image))(e.attachments)))&&zx(e=>Fx(e)&&zx(Rx)(e.tokens)&&Rx(e.contextWindow)&&zx(Rx)(e.percent))(e.contextUsage)&&Bx(Wx)(e.messages)&&Bx(e=>Fx(e)&&Hx(e,[`id`,`pluginId`,`kind`,`timestamp`])&&Vx(e,`afterMessageId`,Ix))(e.pluginEntries)&&Vx(e,`interactions`,Bx(e=>Fx(e)&&Hx(e,[`requestId`,`sessionId`,`pluginId`,`kind`])))&&Vx(e,`streaming`,zx(Wx))}function Kx(e){return Fx(e)&&zx(Ix)(e.activeId)&&Bx(e=>Fx(e)&&Hx(e,[`id`,`path`,`title`])&&Vx(e,`available`,Lx))(e.items)&&Bx(e=>Fx(e)&&Hx(e,[`id`,`workspaceId`,`name`,`modified`])&&zx(Ix)(e.path)&&Vx(e,`idle`,Lx)&&Vx(e,`subagent`,e=>Fx(e)&&zx(Ix)(e.parentSessionId)&&Hx(e,[`agentId`,`agentType`])&&Ux(e,[`description`,`dispatchCallId`])&&[`running`,`completed`,`failed`,`cancelled`,`unknown`].includes(e.status)))(e.sessions)}function qx(e){return Fx(e)&&e.type===`error`&&Ix(e.message)&&Ux(e,[`errorCode`,`errorId`,`requestId`,`operationId`])&&Vx(e,`errorReported`,Lx)&&Vx(e,`inTranscript`,Lx)}function Jx(e){if(!Fx(e)||!Ix(e.type))throw Error(`Invalid stream event`);switch(e.type){case`snapshot`:if(Fx(e.session)&&e.session.schemaVersion!==1)throw Error(`Unsupported session schema`);if(Gx(e.session))return{type:`snapshot`,session:e.session};throw Error(`Invalid session snapshot`);case`stream`:if(e.message===null||Wx(e.message))return{type:`stream`,message:e.message};break;case`workspaces`:if(Kx(e.value))return{type:`workspaces`,value:e.value};break;case`shutdown`:if(Vx(e,`reconnect`,Lx))return{type:`shutdown`,...e.reconnect===void 0?{}:{reconnect:e.reconnect}};break;case`plugins_changed`:return{type:`plugins_changed`};case`hosted_plugins_changed`:return{type:`hosted_plugins_changed`};case`plugin_state`:if(Array.isArray(e.disabled)&&e.disabled.every(e=>typeof e==`string`&&e.length<=200))return{type:`plugin_state`,disabled:e.disabled};break;case`error`:if(qx(e))return e;break;default:throw Error(`Unsupported stream event`)}throw Error(`Invalid stream event`)}var Yx=d();async function Xx(e,t,n){return gx(await hx(e,{method:`POST`,headers:{Authorization:`Bearer ${Yx}`,"Content-Type":`application/json`},body:JSON.stringify(t),signal:n}))}async function Zx(e,t){return gx(await hx(e,{headers:{Authorization:`Bearer ${Yx}`},signal:t}))}async function Qx(e,t,n){return Zx(`/api/subagent-history?${new URLSearchParams({workspaceId:e,id:t})}`,n)}function $x(){let e=te(),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(Yx?`connecting`:`missing-token`),[c,l]=(0,O.useState)(``),[d,p]=(0,O.useState)([]),[m,h]=(0,O.useState)(`loading`),[g,_]=(0,O.useState)([]),[v,y]=(0,O.useState)({items:[],activeId:null,sessions:[]}),[b,x]=(0,O.useState)(null),[S,C]=(0,O.useState)([]),[w,T]=(0,O.useState)(0);return(0,O.useEffect)(()=>{if(!Yx)return;let e=new AbortController,t,r=!0,a=!1;return(async()=>{for(;r;){let c,d,p=`stream_connect`;try{o(`connecting`);let t=await hx(`/api/events`,{headers:{Authorization:`Bearer ${Yx}`},cache:`no-store`,signal:e.signal}),{response:m}=t;if(d=t.correlation,m.ok||await gx(t),!m.body)throw Error(m.status===401?R(`访问令牌无效,请在 Pi 中重新输入 /web。`,`Invalid access token. Run /web again in Pi.`):R(`连接 Pi 失败`,`Could not connect to Pi`));o(`connected`),s({connection:`connected`}),f(`stream_connected`,{...d}),l(``),c=m.body.getReader();let h=new TextDecoder,g=``;for(;r;){p=`stream_read`;let{done:e,value:t}=await c.read();if(e)break;p=`stream_event`,g+=h.decode(t,{stream:!0});let m=g.indexOf(`
|
|
49
|
+
`);for(;m!==-1;){let e=g.slice(0,m);if(g=g.slice(m+1),e){let t;try{t=Jx(JSON.parse(e))}catch(e){let t=e instanceof SyntaxError?Error(`Invalid event JSON`):e;throw u(t,{...d,stage:`ndjson_parse`}),t}if(t.type===`shutdown`){if(c.cancel().catch(()=>{}),t.reconnect===!0)throw new DOMException(`Pi web service is restarting`,`AbortError`);r=!1,o(`disconnected`),s({connection:`disconnected`}),f(`bridge_shutdown`),l(R(`Pi 网页服务已关闭,请在 Pi 中重新输入 /web。`,`The Pi web service stopped. Run /web again in Pi.`));return}if(t.type===`snapshot`&&(n(t.session),s({sessionId:t.session.sessionId,idle:t.session.idle,model:t.session.model,thinkingLevel:t.session.thinkingLevel,messageCount:t.session.messages?.length??0}),(t.session.idle||`streaming`in t.session)&&i(t.session.streaming??null)),t.type===`stream`){let e=t.message!==null;e&&l(``),e!==a&&f(e?`stream_start`:`stream_end`),a=e,i(t.message)}t.type===`workspaces`&&y(t.value),t.type===`error`&&(t.inTranscript||l(t.message),!t.errorId&&!t.errorReported&&t.errorCode!==`validation_error`&&u(Error(`Agent response failed`),{stage:`agent`,code:`agent_failed`,requestId:t.requestId,operationId:t.operationId}),f(`agent_error`,{errorId:t.errorId,requestId:t.requestId,operationId:t.operationId})),t.type===`plugins_changed`&&window.location.reload(),t.type===`hosted_plugins_changed`&&T(e=>e+1),t.type===`plugin_state`&&(C(t.disabled),T(e=>e+1))}m=g.indexOf(`
|
|
50
|
+
`)}}throw p=`stream_end`,Error(R(`Pi 网页连接已关闭`,`The Pi web connection has closed`))}catch(e){if(c?.cancel().catch(()=>{}),!r)return;s({connection:`disconnected`});let n={...d,route:`/api/events`,stage:p,connection:`disconnected`};u(e,n),f(`stream_disconnected`,n),o(`disconnected`),h(`loading`),l(e instanceof Error?e.message:R(`连接 Pi 失败`,`Could not connect to Pi`)),await new Promise(e=>{t=setTimeout(e,1500)})}}})(),()=>{r=!1,e.abort(),t&&clearTimeout(t)}},[]),(0,O.useEffect)(()=>{Yx||l(R(`请在 Pi 终端输入 /web,打开显示的完整地址。`,`Enter /web in the Pi terminal and open the full address shown.`))},[e]),(0,O.useEffect)(()=>{if(a!==`connected`)return;let e=!0;return h(`loading`),Zx(`/api/plugin-management`).then(t=>{e&&C(t.items.filter(e=>!e.enabled).map(e=>e.id))}).catch(()=>{}),Zx(`/api/models`).then(t=>{e&&(p(t),h(`ready`))}).catch(t=>{e&&(h(`error`),l(t instanceof Error?t.message:R(`无法获取模型列表`,`Could not load the model list`)))}),Zx(`/api/commands`).then(t=>{e&&_(t)}).catch(()=>{e&&_([])}),()=>{e=!1}},[a,t?.sessionId]),(0,O.useEffect)(()=>{if(a!==`connected`)return;let e=!0;return Zx(`/api/workspaces`).then(t=>{e&&y(t)}).catch(()=>{}),Zx(`/api/directory/capability`).then(t=>{e&&x(t.kind)}).catch(()=>{e&&x(`browse`)}),()=>{e=!1}},[a]),{session:t,streaming:r,connection:a,error:c,models:d,modelsStatus:m,commands:g,workspaces:v,directoryPickerKind:b,async resolvePluginInteraction(e,n,r){if(!t)throw Error(`No active session`);await Xx(`/api/plugin-interaction`,{sessionId:t.sessionId,pluginId:e,requestId:n,value:r})},plugins:()=>Zx(`/api/plugins`),async invokePluginAction(e,n,r){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return(await Xx(`/api/plugin-action`,{sessionId:t.sessionId,pluginId:e,action:n,input:r})).value},async pickDirectory(){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return(await Xx(`/api/directory/pick`,{sessionId:t.sessionId})).path},async listDirectory(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/directory/list`,{sessionId:t.sessionId,...e===void 0?{}:{path:e}},n)},async createDirectory(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return(await Xx(`/api/directory/create`,{sessionId:t.sessionId,path:e,name:n})).path},disabledPlugins:S,pluginGeneration:w,getPluginManagement:()=>Zx(`/api/plugin-management`),async togglePlugin(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/plugin-management`,{sessionId:t.sessionId,...e})},clearError:()=>l(``),async upload(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));let r=await hx(`/api/attachment?sessionId=${encodeURIComponent(t.sessionId)}&name=${encodeURIComponent(e.name)}`,{method:`POST`,headers:{Authorization:`Bearer ${Yx}`,"Content-Type":e.type||`application/octet-stream`},body:e,signal:n});if(r.response.status===404)throw Error(R(`当前 Pi 桥接服务仍是旧版。请在 Pi 中输入 /reload,再输入 /web 并打开新地址,然后重试上传。`,`The Pi bridge is outdated. Run /reload, then /web in Pi, open the new address, and retry the upload.`));return await gx(r)},async discardAttachment(e){t&&a===`connected`&&await Xx(`/api/attachment/remove`,{sessionId:t.sessionId,id:e})},async updateQueuedPrompt(e,n,r){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/prompt-queue`,{sessionId:t.sessionId,id:e,revision:n,action:r})},async send(e,n=[],r){if(t&&a===`connected`){l(``);try{await Xx(`/api/message`,{sessionId:t.sessionId,text:e,attachments:n,delivery:r})}catch(e){throw l(e instanceof Error?e.message:R(`发送失败`,`Send failed`)),e}}},async loadMessageImage(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));let r=await hx(`/api/image?sessionId=${encodeURIComponent(t.sessionId)}&messageId=${encodeURIComponent(e)}&index=${n}`,{headers:{Authorization:`Bearer ${Yx}`}});r.response.ok||await gx(r);try{return await r.response.blob()}catch(e){throw u(e,{...r.correlation,stage:`image_read`}),e}},async stop(){if(t&&a===`connected`)try{await Xx(`/api/abort`,{sessionId:t.sessionId}),l(``)}catch(e){throw l(e instanceof Error?e.message:R(`停止失败`,`Could not stop`)),e}},async resume(){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));l(``);try{await Xx(`/api/resume`,{sessionId:t.sessionId})}catch(e){throw l(e instanceof Error?e.message:R(`继续失败`,`Could not continue`)),e}},async compact(){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));try{await Xx(`/api/compact`,{sessionId:t.sessionId}),l(``)}catch(e){throw l(e instanceof Error?e.message:R(`压缩失败`,`Compaction failed`)),e}},async newSession(){if(t&&a===`connected`)try{await Xx(`/api/new-session`,{sessionId:t.sessionId})}catch(e){throw l(e instanceof Error?e.message:R(`无法创建新会话`,`Could not create a new session`)),e}},async addWorkspace(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/workspace/add`,{sessionId:t.sessionId,path:e,create:n})},async selectWorkspace(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/workspace/select`,{sessionId:t.sessionId,id:e})},async newSessionInWorkspace(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/workspace/new-session`,{sessionId:t.sessionId,id:e})},async removeWorkspace(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/workspace/remove`,{sessionId:t.sessionId,id:e})},async selectSession(e,n,r){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/session/select`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``})},async renameSession(e,n,r,i){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/session/rename`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``,name:i})},async deleteSession(e,n,r){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/session/delete`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``})},async setModel(e,n){if(t&&a===`connected`)try{await Xx(`/api/model`,{sessionId:t.sessionId,provider:e,id:n}),l(``)}catch(e){throw l(e instanceof Error?e.message:R(`切换模型失败`,`Could not change model`)),e}},async setThinkingLevel(e){if(t&&a===`connected`)try{await Xx(`/api/thinking-level`,{sessionId:t.sessionId,level:e}),l(``)}catch(e){throw l(e instanceof Error?e.message:R(`切换推理强度失败`,`Could not change reasoning effort`)),e}},async getConfig(){return Zx(`/api/config`)},async getUpdate(){return Zx(`/api/update`)},async getRunningVersion(e){return gx(await hx(`/api/update/version`,{headers:{Authorization:`Bearer ${Yx}`},signal:e},{expectedNetworkFailure:!0}))},async setUpdateChannel(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/update/channel`,{sessionId:t.sessionId,channel:e})},async cancelUpdate(){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/update/cancel`,{sessionId:t.sessionId})},async update(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/update`,{sessionId:t.sessionId,...e})},async getProviders(){return Zx(`/api/providers`)},async getProviderModels(e){return Zx(`/api/provider/models?providerId=${encodeURIComponent(e)}`)},async updateProviderModel(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/provider/models`,{sessionId:t.sessionId,providerId:e,change:n});try{p(await Zx(`/api/models`)),h(`ready`)}catch{l(R(`模型已保存,但会话模型列表暂时无法刷新。`,`Model saved, but the conversation model list could not refresh.`))}},async logoutProvider(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/provider/logout`,{sessionId:t.sessionId,providerId:e});try{p(await Zx(`/api/models`)),h(`ready`)}catch{l(R(`认证已移除,但会话模型列表暂时无法刷新。`,`Credentials removed, but the conversation model list could not refresh.`))}},async addCustomProvider(e){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/provider/custom`,{sessionId:t.sessionId,provider:e})},async startProviderLogin(e,n,r){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/provider/login`,{sessionId:t.sessionId,providerId:e,method:n,...r===void 0?{}:{initialSecret:r}})},async getProviderLogin(e){return Zx(`/api/provider/login?id=${encodeURIComponent(e)}`)},async getActiveProviderLogin(){return(await Zx(`/api/provider/login/active`)).active},async respondProviderLogin(e,n){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));await Xx(`/api/provider/login/respond`,{sessionId:t.sessionId,id:e,value:n})},async cancelProviderLogin(e){t&&a===`connected`&&await Xx(`/api/provider/login/cancel`,{sessionId:t.sessionId,id:e})},async refreshModels(){p(await Zx(`/api/models`)),h(`ready`)},async updateConfig(e,n,r,i){if(!t||a!==`connected`)throw Error(R(`Pi 会话不可用`,`Pi session is unavailable`));return Xx(`/api/config`,{sessionId:t.sessionId,kind:e,scope:n,action:r,value:i})}}}var eS=(0,O.createContext)({});function tS({children:e,openExternalLink:t,openFile:n,fileImages:r}){let i=(0,O.useMemo)(()=>({openExternalLink:t,openFile:n,fileImages:r}),[t,n,r]);return(0,z.jsx)(eS.Provider,{value:i,children:e})}function nS(){return(0,O.useContext)(eS)}function rS(e,t){throw Error(`${t}: unhandled ${JSON.stringify(e)}`)}function iS(e,t){let n=e.nodes[t];if(n===void 0)throw Error(`layout: unknown node ${t}`);return n}function aS(e,t){let n=iS(e,t);if(n.kind!==`pane`)throw Error(`layout: ${t} is not a pane`);return n}function oS(e,t){let n=iS(e,t);if(n.kind!==`split`)throw Error(`layout: ${t} is not a split`);return n}function sS(e,t){let n=e.tabs[t];if(n===void 0)throw Error(`layout: unknown tab ${t}`);return n}function cS(e){if(e.host!==`float`||e.rect===void 0)throw Error(`layout: ${e.id} is not floating`);return e.rect}function lS(e,t){let n=e.floats.indexOf(t);if(n<0)throw Error(`layout: floating pane ${t} is not in the z order`);return n}function uS(e){let t=e.tabs[0];if(t===void 0||e.tabs.length!==1)throw Error(`layout: ${e.id} does not hold exactly one tab`);return t}function dS(e,t){for(let n of Object.values(e.nodes))if(n.kind===`split`&&n.children.includes(t))return n}function fS(e,t){for(let n of Object.values(e.nodes))if(n.kind===`pane`&&n.tabs.includes(t))return n;throw Error(`layout: tab ${t} has no pane`)}function pS(e){let t=[],n=r=>{let i=iS(e,r);if(i.kind===`pane`)t.push(i.id);else for(let e of i.children)n(e)};return n(e.rootId),t}function mS(e){let t=e.reduce((e,t)=>e+t,0);if(!(t>0))throw Error(`layout: sizes must sum above zero`);return Math.abs(t-1)<1e-12?[...e]:e.map(e=>e/t)}function hS(e){return Object.entries(e)}function gS(e){return Object.keys(e)}function _S(e,t){let n={};for(let[r,i]of hS(e.nodes))r in t||(n[r]=i);for(let[e,r]of hS(t))r!==null&&(n[e]=r);return{...e,nodes:n}}function vS(e,t){let n={};for(let[r,i]of hS(e.tabs))r in t||(n[r]=i);for(let[e,r]of hS(t))r!==null&&(n[e]=r);return{...e,tabs:n}}function yS(e,t,n){let r=Math.max(0,Math.min(t,e.length));return[...e.slice(0,r),n,...e.slice(r)]}function bS(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xS(e,t){let n=bS(e,t);if(n.length!==0)return n[Math.max(0,t-1)]}function SS(e,t,n){return{...e,tabs:t,activeTabId:n}}function CS(e,t,n){let r=dS(e,t);if(r===void 0){if(e.rootId!==t)throw Error(`layout: ${t} is neither rooted nor parented`);return{...e,rootId:n}}let i=r.children.map(e=>e===t?n:e);return _S(e,{[r.id]:{...r,children:i}})}function wS(e,t){let n=iS(e,e.rootId);for(;n.kind===`split`;){let r=t(n);if(r===void 0)throw Error(`layout: split ${n.id} has no children`);n=iS(e,r)}return n.id}function TS(e){return wS(e,e=>e.children[0])}function ES(e){return wS(e,e=>e.axis===`row`?e.children.at(-1):e.children[0])}function DS(e,t){let n={};for(let r of t)n[r]=aS(e,r).activeTabId;return{type:`restoreFocus`,activePaneId:e.activePaneId,floats:e.floats,paneActiveTabs:n}}function OS(e,t){return[...e.filter(e=>e!==t),t]}function kS(e,t){return e.activePaneId===t?{...e,activePaneId:TS(e)}:e}function AS(e){return{kind:`pane`,id:e,host:`dock`,tabs:[],activeTabId:void 0,rect:void 0}}function jS(e,t){if(e.nodes[t]!==void 0)throw Error(`layout: node ${t} already exists`)}function MS(e,t){if(e.tabs[t]!==void 0)throw Error(`layout: tab ${t} already exists`)}function NS(e,t){if(aS(e,t.paneId).host!==`dock`)throw Error(`layout: split requires a docked pane`);jS(e,t.newPaneId);let n=AS(t.newPaneId),r=dS(e,t.paneId);if(r!==void 0&&r.axis===t.axis){let i=r.children.indexOf(t.paneId),a=t.direction===`after`?i+1:i,o=yS(r.children,a,t.newPaneId),s=r.sizes.flatMap((e,t)=>t===i?[e/2,e/2]:[e]);return{state:_S(e,{[t.newPaneId]:n,[r.id]:{...r,children:o,sizes:s}}),inverse:[{type:`merge`,paneId:t.newPaneId},{type:`resize`,splitId:r.id,sizes:r.sizes}]}}jS(e,t.newSplitId);let i=CS(e,t.paneId,t.newSplitId),a=t.direction===`after`?[t.paneId,t.newPaneId]:[t.newPaneId,t.paneId];return{state:_S(i,{[t.newPaneId]:n,[t.newSplitId]:{kind:`split`,id:t.newSplitId,axis:t.axis,children:a,sizes:[.5,.5]}}),inverse:[{type:`merge`,paneId:t.newPaneId}]}}function PS(e,t){let n=aS(e,t.paneId);if(n.tabs.length>0)throw Error(`layout: merge requires an empty pane`);let r=DS(e,[]);if(n.host===`float`){let i=lS(e,t.paneId);return{state:kS(_S({...e,floats:bS(e.floats,i)},{[t.paneId]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`float`,index:i}},r]}}let i=dS(e,t.paneId);if(i===void 0)throw Error(`layout: the docked root pane cannot be merged`);let a=i.children.indexOf(t.paneId);if(i.children.length>2){let o=bS(i.children,a),s=mS(bS(i.sizes,a));return{state:kS(_S(e,{[t.paneId]:null,[i.id]:{...i,children:o,sizes:s}}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`child`,parentId:i.id,index:a,sizes:i.sizes}},r]}}let o=i.children[1-a];if(o===void 0)throw Error(`layout: merge found a split without a sibling`);return{state:kS(_S(CS(e,i.id,o),{[t.paneId]:null,[i.id]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`wrap`,targetId:o,split:i}},r]}}function FS(e,t){let n=aS(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: openTab requires a docked pane`);MS(e,t.tab.id);let r=DS(e,[n.id]);return{state:{..._S(vS(e,{[t.tab.id]:t.tab}),{[n.id]:SS(n,yS(n.tabs,t.index,t.tab.id),t.tab.id)}),activePaneId:n.id},inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function IS(e,t){let n=aS(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: insertTab requires a docked pane`);MS(e,t.tab.id);let r=DS(e,[n.id]),i=yS(n.tabs,t.index,t.tab.id);return{state:_S(vS(e,{[t.tab.id]:t.tab}),{[n.id]:SS(n,i,n.activeTabId??t.tab.id)}),inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function LS(e,t){let n=sS(e,t.tabId),r=fS(e,t.tabId),i=r.tabs.indexOf(t.tabId),a=DS(e,[r.id]);if(r.host===`float`){let i=lS(e,r.id);return{state:kS(vS(_S({...e,floats:bS(e.floats,i)},{[r.id]:null}),{[t.tabId]:null}),r.id),inverse:[{type:`insertPane`,pane:r,tabs:[n],attach:{mode:`float`,index:i}},a]}}let o=r.activeTabId===t.tabId?xS(r.tabs,i):r.activeTabId;return{state:vS(_S(e,{[r.id]:SS(r,bS(r.tabs,i),o)}),{[t.tabId]:null}),inverse:[{type:`insertTab`,paneId:r.id,tab:n,index:i},a]}}function RS(e,t){if(jS(e,t.pane.id),t.pane.tabs.length!==t.tabs.length)throw Error(`layout: insertPane tab records do not match the pane`);if(t.pane.host===`dock`&&t.tabs.length>0)throw Error(`layout: insertPane returns a docked pane empty`);let n={};for(let r of t.tabs)MS(e,r.id),n[r.id]=r;let r=t.tabs[0],i=r===void 0?[{type:`merge`,paneId:t.pane.id}]:[{type:`closeTab`,tabId:r.id},DS(e,[])],a=t.attach;switch(a.mode){case`child`:{let r=oS(e,a.parentId),o=yS(r.children,a.index,t.pane.id);if(a.sizes.length!==o.length)throw Error(`layout: insertPane sizes do not match the split`);return i.push({type:`resize`,splitId:r.id,sizes:r.sizes}),{state:_S(vS(e,n),{[t.pane.id]:t.pane,[r.id]:{...r,children:o,sizes:a.sizes}}),inverse:i}}case`wrap`:if(!a.split.children.includes(t.pane.id))throw Error(`layout: insertPane wrap split does not list the pane`);return{state:_S(vS(CS(e,a.targetId,a.split.id),n),{[t.pane.id]:t.pane,[a.split.id]:a.split}),inverse:i};case`float`:{if(t.pane.host!==`float`)throw Error(`layout: float attachment requires a floating pane`);let r=yS(e.floats,a.index,t.pane.id);return{state:_S(vS({...e,floats:r},n),{[t.pane.id]:t.pane}),inverse:i}}default:return rS(a,`layout: insertPane attachment`)}}function zS(e,t){let n=fS(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: moveTab source must be docked; use unfloat`);let r=aS(e,t.toPaneId);if(r.host!==`dock`)throw Error(`layout: moveTab target must be docked`);if(r.id===n.id)throw Error(`layout: moveTab across one pane; use reorderTab`);let i=n.tabs.indexOf(t.tabId),a=DS(e,[n.id,r.id]),o=n.activeTabId===t.tabId?xS(n.tabs,i):n.activeTabId;return{state:{..._S(e,{[n.id]:SS(n,bS(n.tabs,i),o),[r.id]:SS(r,yS(r.tabs,t.index,t.tabId),t.tabId)}),activePaneId:r.id},inverse:[{type:`moveTab`,tabId:t.tabId,toPaneId:n.id,index:i},a]}}function BS(e,t){let n=fS(e,t.tabId),r=n.tabs.indexOf(t.tabId),i=yS(bS(n.tabs,r),t.index,t.tabId);return{state:_S(e,{[n.id]:{...n,tabs:i}}),inverse:[{type:`reorderTab`,tabId:t.tabId,index:r}]}}function VS(e,t){let n=fS(e,t.tabId),r=DS(e,[n.id]),i=_S(e,{[n.id]:{...n,activeTabId:t.tabId}}),a=n.host===`float`?OS(i.floats,n.id):i.floats;return{state:{...i,activePaneId:n.id,floats:a},inverse:[r]}}function HS(e,t){let n=aS(e,t.paneId),r=DS(e,[]),i=n.host===`float`?OS(e.floats,n.id):e.floats;return{state:{...e,activePaneId:n.id,floats:i},inverse:[r]}}function US(e,t){let n=oS(e,t.splitId);if(t.sizes.length!==n.children.length)throw Error(`layout: resize sizes do not match the split`);if(t.sizes.some(e=>!(e>0)))throw Error(`layout: resize sizes must all be above zero`);return{state:_S(e,{[n.id]:{...n,sizes:mS(t.sizes)}}),inverse:[{type:`resize`,splitId:n.id,sizes:n.sizes}]}}function WS(e,t){sS(e,t.tabId);let n=fS(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: float requires a docked tab`);jS(e,t.newPaneId);let r=n.tabs.indexOf(t.tabId),i=DS(e,[n.id]),a=n.activeTabId===t.tabId?xS(n.tabs,r):n.activeTabId,o=_S(e,{[n.id]:SS(n,bS(n.tabs,r),a),[t.newPaneId]:{kind:`pane`,id:t.newPaneId,host:`float`,tabs:[t.tabId],activeTabId:t.tabId,rect:t.rect}});return{state:{...o,floats:[...o.floats,t.newPaneId],activePaneId:t.newPaneId},inverse:[{type:`unfloat`,paneId:t.newPaneId,toPaneId:n.id,index:r},i]}}function GS(e,t){let n=aS(e,t.paneId),r=cS(n),i=uS(n),a=aS(e,t.toPaneId);if(a.host!==`dock`)throw Error(`layout: unfloat target must be docked`);let o=DS(e,[a.id]);return{state:{..._S({...e,floats:bS(e.floats,lS(e,t.paneId))},{[t.paneId]:null,[a.id]:SS(a,yS(a.tabs,t.index,i),i)}),activePaneId:a.id},inverse:[{type:`float`,tabId:i,newPaneId:t.paneId,rect:r},o]}}function KS(e,t,n){let r=_S(e,{[t.id]:{...t,rect:n}});return{...r,activePaneId:t.id,floats:OS(r.floats,t.id)}}function qS(e,t){let n=aS(e,t.paneId),r=cS(n);return{state:KS(e,n,{...r,x:t.x,y:t.y}),inverse:[{type:`moveFloat`,paneId:t.paneId,x:r.x,y:r.y},DS(e,[])]}}function JS(e,t){let n=aS(e,t.paneId),r=cS(n);if(!(t.rect.width>0)||!(t.rect.height>0))throw Error(`layout: float size must be above zero`);return{state:KS(e,n,t.rect),inverse:[{type:`resizeFloat`,paneId:t.paneId,rect:r},DS(e,[])]}}function YS(e,t){let n=DS(e,gS(t.paneActiveTabs));for(let n of t.floats)if(aS(e,n).host!==`float`)throw Error(`layout: restoreFocus lists docked pane ${n} as floating`);let r=e;for(let[e,n]of hS(t.paneActiveTabs)){let t=aS(r,e);r=_S(r,{[e]:{...t,activeTabId:n}})}return aS(r,t.activePaneId),{state:{...r,activePaneId:t.activePaneId,floats:t.floats},inverse:[n]}}function XS(e,t){switch(t.type){case`split`:return NS(e,t);case`merge`:return PS(e,t);case`openTab`:return FS(e,t);case`insertTab`:return IS(e,t);case`closeTab`:return LS(e,t);case`insertPane`:return RS(e,t);case`moveTab`:return zS(e,t);case`reorderTab`:return BS(e,t);case`focusTab`:return VS(e,t);case`focusPane`:return HS(e,t);case`resize`:return US(e,t);case`float`:return WS(e,t);case`unfloat`:return GS(e,t);case`moveFloat`:return qS(e,t);case`resizeFloat`:return JS(e,t);case`setExpanded`:return{state:{...e,expanded:t.expanded},inverse:[{type:`setExpanded`,expanded:e.expanded}]};case`setMode`:return{state:{...e,mode:t.mode},inverse:[{type:`setMode`,mode:e.mode}]};case`restoreFocus`:return YS(e,t);default:return rS(t,`layout: operation`)}}function ZS(e,t){return t.reduce((e,t)=>XS(e,t).state,e)}var QS={entries:[],cursor:0},$S=new Set([`focusTab`,`focusPane`,`restoreFocus`]);function eC(e){return $S.has(e.type)}function tC(e,t){let n=e.entries[t];return n!==void 0&&n.ops.every(eC)}function nC(e){return e.cursor>0}function rC(e){return e.cursor<e.entries.length}function iC(e){return e.entries.flatMap(e=>e.ops)}function aC(e,t,n){if(n.length===0)return{history:e,state:t};let r=t,i=[];for(let e of n){let t=XS(r,e);r=t.state,i.unshift(...t.inverse)}return{history:{entries:[...e.cursor===e.entries.length?e.entries:e.entries.slice(0,e.cursor),{ops:n,inverse:i}],cursor:e.cursor+1},state:r}}function oC(e,t){if(!nC(e))return;let n=1;if(tC(e,e.cursor-1))for(;tC(e,e.cursor-1-n);)n+=1;let r=t;for(let t of e.entries.slice(e.cursor-n,e.cursor).reverse())for(let e of t.inverse)r=XS(r,e).state;return{history:{entries:e.entries,cursor:e.cursor-n},state:r}}function sC(e,t){if(!rC(e))return;let n=1;if(tC(e,e.cursor))for(;tC(e,e.cursor+n);)n+=1;let r=t;for(let t of e.entries.slice(e.cursor,e.cursor+n))for(let e of t.ops)r=XS(r,e).state;return{history:{entries:e.entries,cursor:e.cursor+n},state:r}}var cC=class{current;recorded=QS;constructor(e){this.current=e}get state(){return this.current}get history(){return this.recorded}get ops(){return iC(this.recorded)}get cursor(){return this.recorded.cursor}get canUndo(){return nC(this.recorded)}get canRedo(){return rC(this.recorded)}dispatch(e){return this.dispatchAll([e])}dispatchAll(e){let t=aC(this.recorded,this.current,e);return this.recorded=t.history,this.current=t.state,this.current}undo(){let e=oC(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}redo(){let e=sC(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}},lC=.12,uC={width:380,height:300},dC={width:220,height:140},fC=.25;function pC(e){return pS(e).length}function mC(e){return pC(e)<4}function hC(e,t,n=fC){let r=`left`,i=e;return 1-e<i&&(r=`right`,i=1-e),t<i&&(r=`top`,i=t),1-t<i&&(r=`bottom`,i=1-t),i<n?r:`center`}function gC(e){switch(e){case`center`:return;case`left`:return{axis:`row`,direction:`before`};case`right`:return{axis:`row`,direction:`after`};case`top`:return{axis:`column`,direction:`before`};case`bottom`:return{axis:`column`,direction:`after`};default:return rS(e,`layout: dock zone`)}}function _C(e,t=lC){if(e.length===0)return[];let n=Math.min(t,1/e.length),r=e.map(e=>e>0?e:0),i=r.reduce((e,t)=>e+t,0),a=i>0?r.map(e=>e/i):r.map(()=>1/e.length),o=new Set;for(;;){let e=a.flatMap((e,t)=>!o.has(t)&&e<n?[t]:[]);if(e.length===0)return a;for(let t of e)o.add(t);let t=1-o.size*n,r=a.reduce((e,t,n)=>o.has(n)?e:e+t,0);a=a.map((e,i)=>o.has(i)?n:e/r*t)}}function vC(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function yC(e,t,n,r=fC){return!(e.width>0)||!(e.height>0)?`center`:hC((t-e.x)/e.width,(n-e.y)/e.height,r)}function bC(e,t){let n=0;for(let r of e){if(t<r.x+r.width/2)break;n+=1}return n}var xC={divider:0,chip:100,body:48};function SC(e,t=xC){let{pane:n,strip:r}=e;if(!(n.width>0)||!(n.height>0)||!(r.width>0))return{row:!0,column:!0};let i=Math.max(0,n.width-r.width),a=Math.max(0,r.width-e.chipsWidth-e.fillWidth-(e.splitControlWidth??0)),o=(n.width-t.divider)/2-i,s=(n.height-t.divider)/2-i;return{row:o>=a+t.chip,column:s>=r.height+t.body}}function CC(e,t,n,r){return Math.abs(n-e)>=4||Math.abs(r-t)>=4}function wC(e,t,n){let r=e[t],i=e[t+1];if(r===void 0||i===void 0)return[...e];let a=[...e];return a[t]=r+n,a[t+1]=i-n,a}function TC(e,t,n){return{...e,x:e.x+t,y:e.y+n}}function EC(e,t,n,r){return{...e,width:Math.max(r.width,e.width+t),height:Math.max(r.height,e.height+n)}}function DC(e,t,n){return{x:Math.max(0,e-OC.x),y:Math.max(0,t-OC.y),...n}}var OC={x:60,y:14},kC=24,AC={x:160,y:120},jC=[];function MC(e,t,n,r){for(let i of aS(e,t).tabs){let t=e.tabs[i];if(t?.contentId===n&&(r===void 0||t.kind===r))return i}}function NC(e,t,n){for(let r of[...pS(e),...e.floats]){let i=MC(e,r,t,n);if(i!==void 0)return i}}function PC(e){let t=aS(e,e.activePaneId);return t.host===`dock`?t.id:TS(e)}function FC(e,t,n,r){return e.host===`float`?{type:`unfloat`,paneId:e.id,toPaneId:n,index:r}:{type:`moveTab`,tabId:t,toPaneId:n,index:r}}function IC(e,t){return e.expanded===t?jC:[{type:`setExpanded`,expanded:t}]}function LC(e,t){return e.mode===t?jC:[{type:`setMode`,mode:t}]}function RC(e,t,n,r){if(!mC(e))return jC;let i=n??PC(e);if(aS(e,i).host!==`dock`)return jC;let a=t(`pane`),o=[{type:`split`,paneId:i,axis:`row`,direction:`after`,newPaneId:a,newSplitId:t(`split`)}],s=r?.(t(`tab`));return s!==void 0&&o.push({type:`openTab`,paneId:a,tab:s,index:0}),o}function zC(e,t,n,r){if(r===void 0)return jC;let i=aS(e,n);return i.host===`dock`?[{type:`openTab`,paneId:n,tab:r(t(`tab`)),index:i.tabs.length}]:jC}function BC(e,t,n){let r=n.revealIfOpened===!1?void 0:NC(e,n.contentId,n.kind);if(r!==void 0)return{ops:[{type:`focusTab`,tabId:r}],tabId:r};let i=n.paneId??PC(e),a={id:t(`tab`),kind:n.kind,contentId:n.contentId,title:n.title};return{ops:[{type:`openTab`,paneId:i,tab:a,index:n.index??aS(e,i).tabs.length}],tabId:a.id}}function VC(e,t,n){let r=sS(e,n),i=fS(e,n),a=i.host===`dock`?i.id:PC(e),o=i.host===`dock`?i.tabs.indexOf(n)+1:aS(e,a).tabs.length,s={...r,id:t(`tab`)};return{ops:[{type:`openTab`,paneId:a,tab:s,index:o}],tabId:s.id}}function HC(e,t,n,r){let i=fS(e,t);if(aS(e,n).host!==`dock`)return jC;if(i.id===n){let e=i.tabs.indexOf(t),n=r>e?r-1:r;return n===e?jC:[{type:`reorderTab`,tabId:t,index:n}]}return[FC(i,t,n,r)]}function UC(e,t,n,r,i,a){let o=fS(e,n),s=aS(e,r);if(s.host!==`dock`)return jC;let c=gC(i);if(c===void 0)return o.id===r?jC:[FC(o,n,r,s.tabs.length)];let l=o.id===r&&o.tabs.length===1;if(l&&a===void 0||!mC(e))return jC;let u=t(`pane`),d=[{type:`split`,paneId:r,axis:c.axis,direction:c.direction,newPaneId:u,newSplitId:t(`split`)}];return l&&a!==void 0&&d.push({type:`openTab`,paneId:r,tab:a(t(`tab`)),index:o.tabs.length}),d.push(FC(o,n,u,0)),d}function WC(e,t,n,r){let i=e.floats.length*kC,a=t(`float`);return{ops:[{type:`float`,tabId:n,newPaneId:a,rect:r??{x:AC.x+i,y:AC.y+i,width:uC.width,height:uC.height}}],paneId:a}}function GC(e,t,n){let r=n??PC(e);return[{type:`unfloat`,paneId:t,toPaneId:r,index:aS(e,r).tabs.length}]}function KC(e,t,n){return[{type:`resize`,splitId:e,sizes:_C(t,n)}]}function qC(e,t,n){let r=[],i=e;for(;;){let e=pS(i).find(e=>e!==i.rootId&&aS(i,e).tabs.length===0);if(e===void 0)break;let t={type:`merge`,paneId:e};r.push(t),i=XS(i,t).state}let a=iS(i,i.rootId);return a.kind===`pane`&&a.tabs.length===0&&n!==void 0&&r.push({type:`openTab`,paneId:a.id,tab:n(t(`tab`)),index:0}),r}function JC(e=0){let t=e;return{next:(e=>(t+=1,`${e}${t}`))}}function YC(e,t,n=`push`){let r=e.next(`pane`),i=t?.(e.next(`tab`));return{nodes:{[r]:{kind:`pane`,id:r,host:`dock`,tabs:i===void 0?[]:[i.id],activeTabId:i?.id,rect:void 0}},tabs:i===void 0?{}:{[i.id]:i},rootId:r,floats:[],activePaneId:r,expanded:!1,mode:n}}var XC=class{minter;sequencer;listeners=new Set;makePaneTab;snapshot;constructor(e={}){this.minter=JC(),this.makePaneTab=e.makePaneTab,this.sequencer=new cC(YC(this.minter,e.makeInitialTab,e.mode)),this.snapshot=this.buildSnapshot()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;get ops(){return this.sequencer.ops}buildSnapshot(){let e=this.sequencer.state;return{state:e,canUndo:this.sequencer.canUndo,canRedo:this.sequencer.canRedo,canSplit:mC(e),opCount:this.sequencer.ops.length,cursor:this.sequencer.cursor}}commit(){this.snapshot=this.buildSnapshot();for(let e of[...this.listeners])e()}get state(){return this.sequencer.state}get mint(){return this.minter.next}run(e,t=!1){if(e.length===0)return!1;if(t){let t=ZS(this.state,e);e=[...e,...qC(t,this.mint,t.floats.length>0?this.makePaneTab:void 0)]}return this.sequencer.dispatchAll(e),this.commit(),!0}setExpanded(e){this.run(IC(this.state,e))}toggleExpanded(){this.setExpanded(!this.state.expanded)}setMode(e){this.run(LC(this.state,e))}splitPane(e){return this.run(RC(this.state,this.mint,e,this.makePaneTab))}addTab(e){return this.run(zC(this.state,this.mint,e,this.makePaneTab))}openContent(e){let t=BC(this.state,this.mint,e);return this.run(t.ops),t.tabId}duplicateTab(e){let t=VC(this.state,this.mint,e);return this.run(t.ops),t.tabId}closeTab(e){this.run([{type:`closeTab`,tabId:e}],!0)}focusTab(e){this.run([{type:`focusTab`,tabId:e}])}focusPane(e){this.run([{type:`focusPane`,paneId:e}])}reorderTab(e,t){this.run([{type:`reorderTab`,tabId:e,index:t}])}placeTab(e,t,n){return this.run(HC(this.state,e,t,n),!0)}dropTab(e,t,n){return this.run(UC(this.state,this.mint,e,t,n),!0)}floatTab(e,t){let n=WC(this.state,this.mint,e,t);return this.run(n.ops,!0),n.paneId}unfloatPane(e,t){this.run(GC(this.state,e,t))}moveFloat(e,t,n){this.run([{type:`moveFloat`,paneId:e,x:t,y:n}])}resizeFloat(e,t){this.run([{type:`resizeFloat`,paneId:e,rect:t}])}resizeSplit(e,t){this.run(KC(e,t))}undo(){return this.sequencer.undo()?(this.commit(),!0):!1}redo(){return this.sequencer.redo()?(this.commit(),!0):!1}activeDockPaneId(){return PC(this.state)}},ZC={x:0,y:0,width:0,height:0},QC={row:!0,column:!0};function $C(e){return e===null?ZC:e.getBoundingClientRect()}function ew(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function tw(e){let t=[];for(let n of e.querySelectorAll(`[data-dockkit-pane]`)){let e=n.dataset.dockkitPane;e!==void 0&&t.push([e,n])}return t}function nw(e){let t=e.querySelector(`[data-dockkit-tab]`);if(t===null)return xC.chip;let n=getComputedStyle(t),r=ew(n.minWidth);return r<=0?xC.chip:n.boxSizing===`border-box`?r:r+ew(n.paddingLeft)+ew(n.paddingRight)+ew(n.borderLeftWidth)+ew(n.borderRightWidth)}function rw(e){let t=e.querySelector(`[data-dockkit-divider]`);if(t===null)return xC.divider;let{width:n,height:r}=t.getBoundingClientRect(),i=Math.min(n,r);return i>0?i:xC.divider}function iw(e){let t=e.querySelector(`[data-dockkit-split-button]`);if(t===null)return 0;let n=t.getBoundingClientRect().width;if(!(n>0))return 0;let r=e.querySelector(`[data-dockkit-strip]`);return n+(r===null?0:ew(getComputedStyle(r).columnGap))}function aw(e,t=!1){let n={divider:rw(e),chip:nw(e),body:xC.body},r=new Map;for(let[i,a]of tw(e))r.set(i,SC({pane:$C(a),strip:$C(a.querySelector(`[data-dockkit-strip]`)),chipsWidth:$C(a.querySelector(`[data-dockkit-strip-tabs]`)).width,fillWidth:$C(a.querySelector(`[data-dockkit-strip-fill]`)).width,splitControlWidth:t?iw(a):0},n));return r}function ow(e,t){return e.get(t)??QC}function sw(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(e===void 0||e.row!==r.row||e.column!==r.column)return!1}return!0}function cw(e,t){typeof e.setPointerCapture==`function`&&e.setPointerCapture(t)}function lw(e,t,n){cw(e,t);let r=new AbortController,{signal:i}=r;e.dataset.dockkitPointer=String(t),i.addEventListener(`abort`,()=>{e.dataset.dockkitPointer===String(t)&&delete e.dataset.dockkitPointer},{once:!0});let a=e=>e.pointerId===t;return window.addEventListener(`pointermove`,e=>{a(e)&&n.move(e)},{signal:i}),window.addEventListener(`pointerup`,e=>{a(e)&&(r.abort(),n.up(e))},{signal:i}),window.addEventListener(`pointercancel`,e=>{a(e)&&(r.abort(),n.cancel())},{signal:i}),()=>{r.abort()}}function uw(e){let t=(0,O.useRef)(void 0);return(0,O.useEffect)(()=>()=>{t.current?.stop()},[]),(n,r,i)=>{t.current?.end();let a=()=>{t.current=void 0,e()},o=lw(n,r,{move:i.move,up:e=>{a(),i.up(e)},cancel:a});t.current={stop:o,end:()=>{o(),a()}}}}var dw={split:`_split_1s7ij_17`,splitRow:`_splitRow_1s7ij_24`,splitColumn:`_splitColumn_1s7ij_28`,splitCell:`_splitCell_1s7ij_32`,divider:`_divider_1s7ij_39`,surface:`_surface_1s7ij_125`,tabLayout:`_tabLayout_1s7ij_134`,tabCell:`_tabCell_1s7ij_142`,emptyTabHost:`_emptyTabHost_1s7ij_143`,floatingCell:`_floatingCell_1s7ij_156`,tabHost:`_tabHost_1s7ij_162`,float:`_float_1s7ij_156`,tabHostHeader:`_tabHostHeader_1s7ij_177`,tabHostBody:`_tabHostBody_1s7ij_181`,tabLayoutDivider:`_tabLayoutDivider_1s7ij_186`,pane:`_pane_1s7ij_209`,tabStrip:`_tabStrip_1s7ij_237`,stripTabs:`_stripTabs_1s7ij_257`,stripFill:`_stripFill_1s7ij_288`,stripChrome:`_stripChrome_1s7ij_296`,paneBody:`_paneBody_1s7ij_318`,slot:`_slot_1s7ij_327`,tabActive:`_tabActive_1s7ij_346`,slotCaret:`_slotCaret_1s7ij_346`,tab:`_tab_1s7ij_134`,tabTitle:`_tabTitle_1s7ij_389`,floatTitle:`_floatTitle_1s7ij_409`,tabClose:`_tabClose_1s7ij_417`,addTab:`_addTab_1s7ij_449`,tabQuiet:`_tabQuiet_1s7ij_488`,tabDragging:`_tabDragging_1s7ij_505`,iconButton:`_iconButton_1s7ij_511`,menu:`_menu_1s7ij_547`,menuItem:`_menuItem_1s7ij_561`,empty:`_empty_1s7ij_143`,dockScrim:`_dockScrim_1s7ij_599`,dockScrimIn:`_dockScrimIn_1s7ij_1`,dockHint:`_dockHint_1s7ij_601`,dockHintCard:`_dockHintCard_1s7ij_606`,dockHintIn:`_dockHintIn_1s7ij_1`,dockHintLabel:`_dockHintLabel_1s7ij_694`,floatHeader:`_floatHeader_1s7ij_765`,dockGlyph:`_dockGlyph_1s7ij_782`,floatBody:`_floatBody_1s7ij_787`,floatResize:`_floatResize_1s7ij_797`},fw=4;function pw(e,t){let n=e.getBoundingClientRect(),r=t.offsetWidth,i=n.left+r+fw>window.innerWidth?Math.max(fw,n.right-r):n.left;return{top:n.bottom+fw,left:i}}function mw({labels:e,anchor:t,onClose:n,onDismiss:r,extras:i}){let a=(0,O.useRef)(null),[o,s]=(0,O.useState)(void 0),c=n!==void 0||O.Children.toArray(i).some(e=>e!==``);return(0,O.useLayoutEffect)(()=>{a.current!==null&&s(pw(t,a.current))},[t,c]),(0,O.useEffect)(()=>{let e=a.current;if(e===null)return;let n=e.ownerDocument,i=v(n),o=a=>{if(i.guards(a)||a.defaultPrevented||a.key!==`Escape`||a.ctrlKey||a.altKey||a.metaKey||a.shiftKey||[...n.querySelectorAll(`[role="dialog"][aria-modal="true"], [role="menu"]`)].at(-1)!==e||(a.preventDefault(),a.repeat))return;let o=e.contains(n.activeElement);r(),o&&g(t)};n.addEventListener(`keydown`,o,!0);let s=t=>{t.target instanceof Node&&e.contains(t.target)||r()};return window.addEventListener(`pointerdown`,s,!0),()=>{i.dispose(),n.removeEventListener(`keydown`,o,!0),window.removeEventListener(`pointerdown`,s,!0)}},[t,r,c]),c?(0,Qe.createPortal)((0,z.jsxs)(_,{className:dw.menu,ref:a,role:`menu`,"data-dockkit-tab-menu":!0,style:o??{visibility:`hidden`,top:0,left:0},onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:[n!==void 0&&(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:dw.menuItem,"data-dockkit-menu-close":!0,onClick:n,children:e.closeTab}),i]}),document.body):null}function hw(e){e.scrollWidth>e.clientWidth+1?e.dataset.dockkitTabClipped=``:delete e.dataset.dockkitTabClipped}function gw({children:e}){let t=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{t.current!==null&&hw(t.current)}),(0,O.useLayoutEffect)(()=>{let e=t.current;if(e===null||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{hw(e)});return n.observe(e),()=>{n.disconnect()}},[]),(0,z.jsx)(`span`,{ref:t,className:dw.tabTitle,"data-dockkit-tab-title":!0,children:e})}var _w=`M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM4.1828 14.0873L5.54303 14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715L4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873Z`;function vw(){return(0,z.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`M13.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V13.5C1.5 14.0523 1.94772 14.5 2.5 14.5H13.5C14.0523 14.5 14.5 14.0523 14.5 13.5V2.5C14.5 1.94772 14.0523 1.5 13.5 1.5Z`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M8 1.5V14.5`,stroke:`currentColor`})]})}var yw={center:`M4.56 3.48H11.44A1.6 1.6 0 0 1 13.04 5.08V10.92A1.6 1.6 0 0 1 11.44 12.52H4.56A1.6 1.6 0 0 1 2.96 10.92V5.08A1.6 1.6 0 0 1 4.56 3.48Z`,left:`M4 0.523H8V15.477H4A4 4 0 0 1 0 11.477V4.523A4 4 0 0 1 4 0.523Z`,right:`M8 0.523H12A4 4 0 0 1 16 4.523V11.477A4 4 0 0 1 12 15.477H8Z`,top:`M0 8V4.523A4 4 0 0 1 4 0.523H12A4 4 0 0 1 16 4.523V8Z`,bottom:`M0 8H16V11.477A4 4 0 0 1 12 15.477H4A4 4 0 0 1 0 11.477Z`};function bw({zone:e}){return(0,z.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:_w,fill:`currentColor`}),(0,z.jsx)(`path`,{d:yw[e],fill:`currentColor`})]})}function xw({zone:e,active:t,labels:n}){return(0,z.jsx)(`div`,{className:dw.dockHint,"data-dockkit-dock-zone":e,"data-dockkit-drop-active":t||void 0,children:(0,z.jsxs)(`div`,{className:dw.dockHintCard,children:[(0,z.jsx)(bw,{zone:e}),(0,z.jsx)(`span`,{className:dw.dockHintLabel,children:n.dropZone[e]})]})})}function Sw(e,t,n){let r=t.length,i=t.indexOf(n);switch(e){case`ArrowLeft`:return t[(i-1+r)%r];case`ArrowRight`:return t[(i+1)%r];case`Home`:return t[0];case`End`:return t.at(-1);default:return}}function Cw(e){return e===`Enter`||e===` `}function ww(e){let t=e.scrollLeft>1,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;if(t&&n)return`start end`;if(t)return`start`;if(n)return`end`}function Tw(e,t){(0,O.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let n=()=>{let e=ww(t);e===void 0?delete t.dataset.dockkitStripScroll:t.dataset.dockkitStripScroll=e};n(),t.addEventListener(`scroll`,n,{passive:!0});let r=typeof ResizeObserver>`u`?void 0:new ResizeObserver(n);return r?.observe(t),()=>{t.removeEventListener(`scroll`,n),r?.disconnect()}},[e,t])}function Ew(e,t,n,r){(0,O.useLayoutEffect)(()=>{let n=e.current,i=r===void 0?void 0:t.get(r);if(n===null||i===void 0)return;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect();o.left<a.left?n.scrollLeft+=o.left-a.left-Dw:o.right>a.right&&(n.scrollLeft+=o.right-a.right+Dw)},[e,t,n,r])}var Dw=24;function Ow(e,t){switch(t){case`budget`:return e.splitPaneDisabled;case`width`:return e.splitPaneNarrow}}function kw({state:e,pane:t,callbacks:n}){let[r,i]=(0,O.useState)(void 0),[a]=(0,O.useState)(()=>new Map),o=(0,O.useRef)(null);Tw(o,t.tabs),Ew(o,a,t.tabs,t.activeTabId);let s=n.splitBlock(t.id),c=n.dropTarget,l=c!==void 0&&c.kind===`strip`&&c.paneId===t.id?c.index:void 0,u=r=>{(e.activePaneId!==t.id||t.activeTabId!==r)&&n.onFocusTab(r)},d=e=>{let t=a.get(e);t!==void 0&&t.focus()};return(0,z.jsxs)(`div`,{className:dw.tabStrip,role:`tablist`,"data-dockkit-strip":t.id,"data-window-drag":e.floats.length===0||void 0,children:[(0,z.jsxs)(`div`,{ref:o,className:dw.stripTabs,role:`presentation`,"data-dockkit-strip-tabs":t.id,children:[t.tabs.map((o,s)=>{let c=sS(e,o),f=o===t.activeTabId,p=n.canCloseTab(o),m=!p&&t.tabs.length===1;return(0,z.jsxs)(O.Fragment,{children:[(s>0||l===s)&&(0,z.jsx)(`div`,{className:h(dw.slot,l===s&&dw.slotCaret),"data-dockkit-caret":l===s?s:void 0}),(0,z.jsxs)(`div`,{role:`tab`,"aria-selected":f,tabIndex:f?0:-1,className:h(dw.tab,f&&dw.tabActive,m&&dw.tabQuiet,n.draggingTabId===o&&dw.tabDragging),"data-dockkit-tab":o,"data-dockkit-tab-quiet":m||void 0,ref:e=>{e===null?a.delete(o):a.set(o,e)},onPointerDown:e=>{e.button!==2&&n.onTabPressed(o,e)},onClick:e=>{e.stopPropagation(),u(o)},onKeyDown:e=>{if(e.target!==e.currentTarget||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let n=Sw(e.key,t.tabs,o);n===void 0?Cw(e.key)&&(e.preventDefault(),u(o)):(e.preventDefault(),d(n))},onContextMenu:e=>{e.preventDefault();let t=e.currentTarget;i(e=>e?.tabId===o?void 0:{tabId:o,anchor:t})},children:[(0,z.jsx)(gw,{children:n.renderTabTitle?.(c)??c.title}),p&&(0,z.jsx)(Ty,{disabled:r!==void 0,label:n.labels.closeTab,shortcutKeys:n.labels.closeTabKeys,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:dw.tabClose,"aria-label":n.labels.closeTab,"aria-keyshortcuts":n.labels.closeTabShortcut,"data-dockkit-tab-close":o,onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n.onCloseTab(o)},children:(0,z.jsx)(J_,{size:14})})}),r?.tabId===o&&(0,z.jsx)(mw,{labels:n.labels,anchor:r.anchor,onClose:p?()=>{i(void 0),n.onCloseTab(o)}:void 0,onDismiss:()=>{i(void 0)},extras:n.renderTabMenuItems?.(c,()=>{i(void 0)})})]})]},o)}),l===t.tabs.length&&(0,z.jsx)(`div`,{className:h(dw.slot,dw.slotCaret),"data-dockkit-caret":l})]}),n.canAddTab(t.id)&&(0,z.jsx)(Ty,{label:n.labels.addTab,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:dw.addTab,"aria-label":n.labels.addTab,"data-dockkit-add-tab":t.id,onClick:e=>{e.stopPropagation(),n.onAddTab(t.id)},children:(0,z.jsx)(M_,{size:14})})}),(0,z.jsx)(`div`,{className:dw.stripFill,"data-dockkit-strip-fill":!0}),!(n.hideSplitWhenBlocked&&s!==void 0)&&(0,z.jsx)(Ty,{label:s===void 0?n.labels.splitPane:Ow(n.labels,s),shortcutKeys:n.labels.splitPaneKeys,side:`bottom`,delayMs:500,children:(0,z.jsx)(`span`,{tabIndex:s===void 0?void 0:0,"aria-label":s===void 0?void 0:Ow(n.labels,s),children:(0,z.jsx)(`button`,{type:`button`,className:dw.iconButton,"aria-label":n.labels.splitPane,"aria-keyshortcuts":n.labels.splitPaneShortcut,disabled:s!==void 0,"data-dockkit-split-button":t.id,"data-dockkit-split-blocked":s,onClick:e=>{e.stopPropagation(),n.onSplitPane(t.id)},children:(0,z.jsx)(vw,{})})})}),t.id===n.chromePaneId&&n.chrome!==void 0&&(0,z.jsx)(`div`,{className:dw.stripChrome,"data-dockkit-strip-chrome":!0,onClick:e=>{e.stopPropagation()},children:n.chrome})]})}function Aw({pane:e,callbacks:t}){let n=t.dropTarget,r=n?.kind===`zone`&&n.paneId===e.id?n.zone:void 0;return r===void 0?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:dw.dockScrim,"data-dockkit-dock-scrim":!0}),t.horizontalDrops&&r!==`center`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(xw,{zone:`left`,active:r===`left`,labels:t.labels}),(0,z.jsx)(xw,{zone:`right`,active:r===`right`,labels:t.labels})]}):(0,z.jsx)(xw,{zone:r,active:!0,labels:t.labels})]})}function jw({state:e,pane:t,callbacks:n}){let r=t.activeTabId===void 0?void 0:sS(e,t.activeTabId);return(0,z.jsxs)(`section`,{className:dw.pane,"data-dockkit-pane":t.id,tabIndex:-1,"data-dockkit-pane-active":e.activePaneId===t.id||void 0,onClick:()=>{e.activePaneId!==t.id&&n.onFocusPane(t.id)},children:[(0,z.jsx)(kw,{state:e,pane:t,callbacks:n}),(0,z.jsxs)(`div`,{className:dw.paneBody,children:[r===void 0?(0,z.jsx)(`p`,{className:dw.empty,children:n.labels.emptyPane}):n.renderTab(r),(0,z.jsx)(Aw,{pane:t,callbacks:n})]})]})}function Mw(e,t,n){let r=t-e.originX,i=n-e.originY;return e.mode===`move`?TC(e.rect,r,i):EC(e.rect,r,i,dC)}function Nw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pw(e,t){return e.activePaneId===t&&e.floats.at(-1)===t}function Fw(e,t){let[n,r]=(0,O.useState)(void 0),i=uw(()=>{r(void 0)}),a=n=>{Pw(e,n)||t.focusPane(n)};return{preview:n,raise:a,drag:(n,o,s)=>{s.stopPropagation();let c={mode:n,originX:s.clientX,originY:s.clientY,rect:cS(aS(e,o))};i(s.currentTarget,s.pointerId,{move:e=>{r({paneId:o,rect:Mw(c,e.clientX,e.clientY)})},up:e=>{let r=Mw(c,e.clientX,e.clientY);Nw(r,c.rect)?a(o):n===`move`?t.moveFloat(o,r.x,r.y):t.resizeFloat(o,r)}})}}}function Iw({paneId:e,tab:t,labels:n,intents:r,renderTabTitle:i,canCloseTab:a,drag:o}){return(0,z.jsxs)(`header`,{className:h(dw.tabStrip,dw.floatHeader),"data-dockkit-float-grip":e,onPointerDown:t=>{o(`move`,e,t)},children:[(0,z.jsx)(`div`,{className:h(dw.tab,dw.floatTitle),"data-dockkit-float-title":!0,children:(0,z.jsx)(gw,{children:i?.(t)??t.title})}),(0,z.jsx)(`div`,{className:dw.stripFill}),(0,z.jsx)(Ty,{label:n.dockFloat,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:dw.iconButton,"aria-label":n.dockFloat,"data-dockkit-float-dock":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{r.unfloatPane(e)},children:(0,z.jsx)(A_,{className:dw.dockGlyph})})}),(a?.(t.id)??!0)&&(0,z.jsx)(Ty,{label:n.closeTab,shortcutKeys:n.closeTabKeys,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:dw.iconButton,"aria-label":n.closeTab,"data-dockkit-float-close":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{r.closeTab(t.id)},children:(0,z.jsx)(K_,{})})})]})}function Lw({state:e,callbacks:t,intents:n,tab:r,pane:i,column:a,floats:o,focusRequest:s,keepMounted:c,active:l=!0}){let u=i.host===`float`,d=u||i.activeTabId===r.id,f=l&&d&&(u||e.expanded),p=c?.(r)??!1,[m,g]=(0,O.useState)(f);f&&!m&&g(!0);let _=(0,O.useRef)(null),v=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let e=_.current;e.inert=!f;let t=document.activeElement;!f&&t instanceof HTMLElement&&e.contains(t)&&t.blur();let n=s.current;f&&n?.tabId===r.id&&(s.current=void 0,(t===null||t===document.body||t===document.documentElement||t===n.origin)&&[...e.querySelector(`[data-dockkit-strip]`)?.querySelectorAll(`[data-dockkit-tab]`)??[]].find(e=>e.dataset.dockkitTab===r.id)?.focus({preventScroll:!0}))},[f,r.id,s]),(0,O.useEffect)(()=>{let n=v.current,r=()=>{f&&(u?o.raise(i.id):e.activePaneId!==i.id&&t.onFocusPane(i.id))};return n.addEventListener(`focus`,r,!0),()=>{n.removeEventListener(`focus`,r,!0)}},[f,u,o,i.id,e.activePaneId,t]);let y=u&&o.preview?.paneId===i.id?o.preview.rect:void 0,b=u?y??cS(i):void 0,x=y===void 0?e.floats.indexOf(i.id)+1:e.floats.length+1;return(0,z.jsx)(`div`,{className:h(dw.tabCell,u&&dw.floatingCell),hidden:!d,"data-dockkit-host":u?`float`:`dock`,"data-dockkit-column":u?void 0:a,style:{gridColumn:u?1:a*2+1,gridRow:1,order:u?x:0},children:(0,z.jsxs)(`section`,{ref:_,tabIndex:-1,className:h(dw.tabHost,u?dw.float:dw.pane),"aria-hidden":!f||void 0,"data-dockkit-content":r.id,"data-dockkit-pane":!u&&d?i.id:void 0,"data-dockkit-pane-active":!u&&e.activePaneId===i.id||void 0,"data-dockkit-float":u?i.id:void 0,"data-dockkit-float-active":u&&e.activePaneId===i.id||void 0,"data-dockkit-column":u?void 0:a,style:b===void 0?void 0:{left:b.x,top:b.y,width:b.width,height:b.height},onPointerDown:()=>{u&&o.raise(i.id)},onClick:()=>{!u&&e.activePaneId!==i.id&&t.onFocusPane(i.id)},children:[(0,z.jsx)(`div`,{className:dw.tabHostHeader,children:d&&(u?(0,z.jsx)(Iw,{paneId:i.id,tab:r,labels:t.labels,intents:n,renderTabTitle:t.renderTabTitle,canCloseTab:t.canCloseTab,drag:o.drag}):(0,z.jsx)(kw,{state:e,pane:i,callbacks:t}))}),(0,z.jsxs)(`div`,{ref:v,className:h(dw.tabHostBody,u?dw.floatBody:dw.paneBody),children:[m&&(p||l&&d)?t.renderTab(r):null,!u&&(0,z.jsx)(Aw,{pane:i,callbacks:t})]}),u&&(0,z.jsx)(`div`,{className:dw.floatResize,"data-dockkit-float-resize":i.id,onPointerDown:e=>{o.drag(`resize`,i.id,e)}})]})})}function Rw(e){let{state:t,callbacks:n,preview:r}=e,i=(0,O.useRef)(void 0),a={...n,onFocusTab:e=>{i.current=fS(t,e).activeTabId===e?void 0:{tabId:e,origin:document.activeElement},n.onFocusTab(e)}},o=iS(t,t.rootId);if(o.kind===`split`&&(o.axis!==`row`||o.children.length!==2))throw Error(`DockLayout requires one pane or two horizontally split panes`);let s=o.kind===`pane`?[o]:o.children.map(e=>aS(t,e)),c=o.kind===`split`?r?.splitId===o.id?r.sizes:o.sizes:[1],l=Fw(t,e.intents),u=c.map(e=>`minmax(0, ${e}fr)`).join(` 0px `);return(0,z.jsxs)(`div`,{className:dw.tabLayout,"data-dockkit-split":o.kind===`split`?o.id:void 0,style:{gridTemplateColumns:u},children:[Object.values(t.tabs).sort((e,t)=>e.id.localeCompare(t.id)).map(n=>{let r=fS(t,n.id);return(0,z.jsx)(Lw,{...e,callbacks:a,tab:n,pane:r,column:s.findIndex(e=>e.id===r.id),floats:l,focusRequest:i},n.id)}),s.filter(e=>e.tabs.length===0).map(e=>(0,z.jsx)(`div`,{className:dw.emptyTabHost,"data-dockkit-empty":!0,style:{gridColumn:s.indexOf(e)*2+1,gridRow:1},children:(0,z.jsx)(jw,{state:t,pane:e,callbacks:n})},e.id)),o.kind===`split`&&(0,z.jsx)(`div`,{className:h(dw.divider,dw.tabLayoutDivider),"data-dockkit-divider":`${o.id}:0`,style:{gridColumn:2,gridRow:1},onPointerDown:e=>{n.onDividerPressed(o.id,0,e)}})]})}var zw={draggingTabId:void 0,dropTarget:void 0,sizes:void 0},Bw=new Map,Vw=()=>!0;function Hw(e,t,n,r,i,a){for(let[o,s]of tw(e)){let e=s.getBoundingClientRect();if(!vC(e,t,n))continue;let c=s.querySelector(`[data-dockkit-strip]`);if(c!==null&&vC(c.getBoundingClientRect(),t,n))return{kind:`strip`,paneId:o,index:bC([...c.querySelectorAll(`[data-dockkit-tab]`)].map(e=>e.getBoundingClientRect()),t)};let l=a===`horizontal`?r&&ow(i,o).row?t<e.x+e.width/2?`left`:`right`:`center`:yC(e,t,n);if(l!==`center`){let e=ow(i,o),t=l===`left`||l===`right`?e.row:e.column;if(!r||!t)return}return{kind:`zone`,paneId:o,zone:l}}}function Uw(e,t,n,r){let i=(e.axis===`row`?t:n)-e.origin,a=e.extent>0?i/e.extent:0;return _C(wC(e.sizes,e.index,a),r)}var Ww=1e-9;function Gw(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&Math.abs(e-r)<Ww})}function Kw({state:e,canSplit:t,canAddTab:n,canCloseTab:r,intents:i,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chrome:l,onRoom:u,draw:d,dropZones:f=`edges`,minPaneFraction:p=lC,hideSplitWhenBlocked:m=!1}){let h=(0,O.useRef)(null),[g,_]=(0,O.useState)(zw),[v,y]=(0,O.useState)(Bw),b=uw(()=>{_(zw)}),x=(0,O.useCallback)(e=>{let t=h.current;t!==null&&e(t)},[]),S=(0,O.useCallback)(()=>{x(e=>{let t=aw(e,m);y(e=>sw(e,t)?e:t)})},[x,m]);(0,O.useLayoutEffect)(()=>{S()}),(0,O.useEffect)(()=>{u?.(v)},[v,u]),(0,O.useEffect)(()=>{let e=h.current;if(e===null||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{S()});return t.observe(e),()=>{t.disconnect()}},[S]);let C={onFocusTab:i.focusTab.bind(i),onFocusPane:i.focusPane.bind(i),onSplitPane:i.splitPane.bind(i),onAddTab:i.addTab.bind(i),onCloseTab:i.closeTab.bind(i),onTabPressed:(e,n)=>{x(r=>{let a=n.clientX,o=n.clientY,s=!1;b(n.currentTarget,n.pointerId,{move:n=>{if(!s){if(!CC(a,o,n.clientX,n.clientY))return;s=!0}_({...zw,draggingTabId:e,dropTarget:Hw(r,n.clientX,n.clientY,t,v,f)})},up:n=>{if(!s)return;let a=Hw(r,n.clientX,n.clientY,t,v,f);if(a===void 0){if(vC(r.getBoundingClientRect(),n.clientX,n.clientY))return;i.floatTab(e,DC(n.clientX,n.clientY,uC))}else a.kind===`strip`?i.placeTab(e,a.paneId,a.index):i.dropTab(e,a.paneId,a.zone)}})})},onDividerPressed:(t,n,r)=>{let a=r.currentTarget.parentElement;if(a===null)return;let o=oS(e,t),s=a.getBoundingClientRect(),c={splitId:t,index:n,axis:o.axis,origin:o.axis===`row`?r.clientX:r.clientY,extent:o.axis===`row`?s.width:s.height,sizes:o.sizes};b(r.currentTarget,r.pointerId,{move:e=>{_({...zw,sizes:{splitId:t,sizes:Uw(c,e.clientX,e.clientY,p)}})},up:e=>{let n=Uw(c,e.clientX,e.clientY,p);Gw(n,c.sizes)||i.resizeSplit(t,n)}})},splitBlock:e=>t?ow(v,e).row?void 0:`width`:`budget`,hideSplitWhenBlocked:m,canAddTab:n??Vw,canCloseTab:r??Vw,dropTarget:g.dropTarget,horizontalDrops:f===`horizontal`,draggingTabId:g.draggingTabId,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chromePaneId:ES(e),chrome:l};return(0,z.jsx)(`div`,{className:dw.surface,ref:h,"data-dockkit-surface":!0,"data-dockkit-drop-zones":f,children:d(C,g.sizes)})}function qw(e){return(0,z.jsx)(Kw,{...e,draw:(t,n)=>(0,z.jsx)(Rw,{...e,callbacks:t,preview:n})})}var Jw={session:`_session_17bxj_24`,panel:`_panel_17bxj_32`,iconButton:`_iconButton_17bxj_129`,collapseGlyph:`_collapseGlyph_17bxj_155`,panelBody:`_panelBody_17bxj_159`,unavailable:`_unavailable_17bxj_165`,tabTitle:`_tabTitle_17bxj_173`,tabBody:`_tabBody_17bxj_177`};function Yw(){return(0,z.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{d:`M2.33203 10.4054V13.1681C2.33229 13.444 2.55605 13.6681 2.83203 13.6681H5.49512V14.6681H2.83203C2.00376 14.6681 1.33229 13.9963 1.33203 13.1681V10.4054H2.33203ZM14.6689 13.1681C14.6687 13.996 13.9968 14.6676 13.1689 14.6681H10.4951V13.6681H13.1689C13.4445 13.6676 13.6687 13.4437 13.6689 13.1681V10.4054H14.6689V13.1681ZM13.1689 1.33118C13.9969 1.33163 14.6688 2.00315 14.6689 2.83118V5.4054H13.6689V2.83118C13.6688 2.55544 13.4446 2.33162 13.1689 2.33118H10.4951V1.33118H13.1689ZM5.49512 2.33118H2.83203C2.55598 2.33118 2.33218 2.55516 2.33203 2.83118V5.4054H1.33203V2.83118C1.33218 2.00288 2.00369 1.33118 2.83203 1.33118H5.49512V2.33118Z`,fill:`currentColor`})})}function Xw(){return(0,z.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,z.jsx)(`path`,{d:`M9 2.5V6C9 6.26522 9.10536 6.51957 9.29289 6.70711C9.48043 6.89464 9.73478 7 10 7H13.5`,stroke:`currentColor`}),(0,z.jsx)(`path`,{d:`M7 13.5V10C7 9.73478 6.89464 9.48043 6.70711 9.29289C6.51957 9.10536 6.26522 9 6 9H2.5`,stroke:`currentColor`})]})}function Zw({sessionId:e,fullscreen:t,focus:n=!1,actions:r,t:i,shortcuts:a,toggleFullscreen:o}){let s=t?`push`:`fullscreen`,c=i(n?`chrome.exitFocus`:t?`chrome.exitFullscreen`:`chrome.toFullscreen`),l=a.find(e=>e.id===`pane.fullscreen.toggle`),u=a.find(e=>e.id===`sidebar.right.toggle`);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ty,{label:c,shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:Jw.iconButton,"aria-label":c,"aria-keyshortcuts":l?.aria,"data-sidebar-right-mode":s,onClick:o,children:t?(0,z.jsx)(Xw,{}):(0,z.jsx)(Yw,{})})}),(0,z.jsx)(Ty,{label:i(`chrome.collapse`),shortcutKeys:u?.keys,side:`bottom`,delayMs:500,children:(0,z.jsx)(`button`,{type:`button`,className:Jw.iconButton,"aria-label":i(`chrome.collapseAria`),"aria-keyshortcuts":u?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{r.toggleExpanded(e)},children:(0,z.jsx)(A_,{className:Jw.collapseGlyph})})})]})}function Qw(e,t,n){return{emptyPane:e(`dock.emptyPane`),splitPane:e(`dock.splitPane`),splitPaneShortcut:t?.aria,splitPaneKeys:t?.keys,splitPaneDisabled:e(`dock.splitPaneDisabled`),splitPaneNarrow:e(`dock.splitPaneNarrow`),closeTab:e(`dock.closeTab`),closeTabShortcut:n?.aria,closeTabKeys:n?.keys,addTab:e(`dock.addTab`),dockFloat:e(`dock.dockFloat`),closeFloat:e(`dock.closeFloat`),dropZone:{center:e(`dock.drop.center`),left:e(`dock.drop.left`),right:e(`dock.drop.right`),top:e(`dock.drop.top`),bottom:e(`dock.drop.bottom`)}}}var $w={"command.close":`关闭当前页面/窗口`,"command.refresh":`刷新当前页面`,"command.noRefresh":`当前页面不支持刷新`,"command.toggle":`展开/收起右侧栏`,"command.fullscreen":`面板全屏/退出全屏`,"command.noSession":`请先选择会话`,"command.noFocus":`请先聚焦右侧面板`,"command.stale":`页面已切换,请重新聚焦`,"command.collapsed":`请先展开右侧栏`,"command.float":`浮动面板不支持此操作`,"command.empty":`请先打开页面`,"command.budget":`已达两格上限`,"command.width":`栏宽不足,拖宽侧边栏后再分栏`,"chrome.expand":`打开侧边栏`,"chrome.expandAria":`打开右侧边栏`,"chrome.collapse":`收起侧边栏`,"chrome.collapseAria":`收起右侧边栏`,"chrome.toFullscreen":`全屏`,"chrome.exitFullscreen":`退出全屏`,"chrome.exitFocus":`退出专注模式`,"dock.emptyPane":`空面板`,"dock.splitPane":`分栏`,"dock.splitPaneDisabled":`已达两格上限`,"dock.splitPaneNarrow":`栏宽不足,拖宽侧边栏后再分栏`,"dock.closeTab":`关闭`,"dock.addTab":`新标签页`,"dock.dockFloat":`收回到侧边栏`,"dock.closeFloat":`关闭`,"dock.drop.center":`移到这里`,"dock.drop.left":`左分栏`,"dock.drop.right":`右分栏`,"dock.drop.top":`上分栏`,"dock.drop.bottom":`下分栏`,"tab.guide.title":`开始`,"tab.unavailable":`这类内容还没有可用的查看方式。`},eT={"command.close":`Close current page or window`,"command.refresh":`Refresh current page`,"command.noRefresh":`This page cannot be refreshed`,"command.toggle":`Toggle right sidebar`,"command.fullscreen":`Toggle panel fullscreen`,"command.noSession":`Select a session first`,"command.noFocus":`Focus a right sidebar pane first`,"command.stale":`The page changed; focus it again`,"command.collapsed":`Expand the right sidebar first`,"command.float":`This action is unavailable in a floating panel`,"command.empty":`Open a page first`,"command.budget":`Two panes is the limit`,"command.width":`Not enough width to split, widen the sidebar`,"chrome.expand":`Open sidebar`,"chrome.expandAria":`Open right sidebar`,"chrome.collapse":`Collapse sidebar`,"chrome.collapseAria":`Collapse right sidebar`,"chrome.toFullscreen":`Fullscreen`,"chrome.exitFullscreen":`Exit fullscreen`,"chrome.exitFocus":`Exit focus mode`,"dock.emptyPane":`Empty pane`,"dock.splitPane":`Split`,"dock.splitPaneDisabled":`Two panes is the limit`,"dock.splitPaneNarrow":`Not enough width to split, widen the sidebar`,"dock.closeTab":`Close`,"dock.addTab":`New tab`,"dock.dockFloat":`Send back to the sidebar`,"dock.closeFloat":`Close`,"dock.drop.center":`Move here`,"dock.drop.left":`Add left split`,"dock.drop.right":`Add right split`,"dock.drop.top":`Add top split`,"dock.drop.bottom":`Add bottom split`,"tab.guide.title":`Start`,"tab.unavailable":`Nothing here can view this kind of content yet.`},tT={button:`_button_1rv3m_2`,md:`_md_1rv3m_23`,sm:`_sm_1rv3m_28`,primary:`_primary_1rv3m_36`,ghost:`_ghost_1rv3m_45`,outline:`_outline_1rv3m_54`,toolbar:`_toolbar_1rv3m_63`,icon:`_icon_1rv3m_71`},nT=(0,O.forwardRef)(function({variant:e=`ghost`,size:t=`md`,icon:n,className:r,children:i,...a},o){return(0,z.jsxs)(`button`,{ref:o,type:`button`,className:h(tT.button,tT[e],tT[t],r),...a,children:[n!=null&&(0,z.jsx)(`span`,{className:tT.icon,children:n}),i]})}),rT={button:`_button_11lrx_2`,icon:`_icon_11lrx_15`};function iT(e){if(typeof e==`string`)return e.length>0;if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.zh==`string`&&t.zh.length>0&&typeof t.en==`string`&&t.en.length>0}function aT(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||!t.id||typeof t.title!=`string`||!t.title||typeof t.action!=`string`||!t.action||t.description!==void 0&&typeof t.description!=`string`||t.args!==void 0&&(!Array.isArray(t.args)||t.args.some(e=>typeof e!=`string`)))return!1;if(t.presentation!==void 0){let e=t.presentation;if(!e||!iT(e.label)||e.description!==void 0&&!iT(e.description)||e.icon!==void 0&&typeof e.icon!=`function`||e.section!==void 0&&![`add`,`commands`].includes(e.section))return!1}if(t.input!==void 0){let e=t.input;if(!e||!iT(e.hint)||e.attachments!==void 0&&typeof e.attachments!=`boolean`||e.token!==void 0&&(!iT(e.token)||(typeof e.token==`string`?[e.token]:[e.token.zh,e.token.en]).some(e=>/[\s/]/.test(e))))return!1}return!0}function oT(e){return e}function sT(e,t){if(!e||typeof e!=`object`)throw Error(`Module must default export a plugin definition`);let n=e;if(n.id!==t||n.apiVersion!==1)throw Error(`Plugin id or apiVersion does not match the catalog`);if(typeof n.activate!=`function`)throw Error(`Plugin must declare synchronous activate(context)`);for(let e of[`slots`,`commands`,`menuItems`,`interactions`,`artifactTools`])if(n[e]!==void 0&&!Array.isArray(n[e]))throw Error(`${e} must be an array`);let r=new Set;for(let e of n.slots??[]){if(!e||![`composer.controls`,`turn.tail`,`rightbar.panel`,`rightbar.title`].includes(e.slot)||typeof e.id!=`string`||typeof e.component!=`function`||r.has(e.id))throw Error(`Invalid or duplicate slot`);r.add(e.id)}for(let e of[...n.commands??[],...n.menuItems??[]]){if(!e||typeof e.id!=`string`||typeof e.action!=`string`||r.has(e.id))throw Error(`Invalid or duplicate command/menu contribution`);r.add(e.id)}if((n.commands??[]).some(e=>!aT(e)))throw Error(`Invalid command`);let i=new Set;for(let e of n.interactions??[]){if(!e||typeof e.kind!=`string`||!e.kind||i.has(e.kind)||typeof e.component!=`function`)throw Error(`Invalid or duplicate interaction`);i.add(e.kind)}if(n.composerPlaceholder!==void 0&&typeof n.composerPlaceholder!=`function`)throw Error(`Invalid composer placeholder`);if(n.composerAction!==void 0&&typeof n.composerAction!=`function`)throw Error(`Invalid composer action`);if(n.artifactTools?.some(e=>typeof e!=`string`))throw Error(`Invalid artifact tools`);if(n.workbench){let{entry:e,panels:t,toolViews:r,beforeSend:i}=n.workbench;if(i!==void 0&&typeof i!=`function`)throw Error(`Invalid workbench pre-send hook`);if(r!==void 0&&(!Array.isArray(r)||r.some(e=>!e||!Array.isArray(e.tools)||!e.tools.length||e.tools.some(e=>typeof e!=`string`||!e)||typeof e.component!=`function`)))throw Error(`Invalid workbench tool view`);if(n.workbench.resolvePanel!==void 0&&typeof n.workbench.resolvePanel!=`function`)throw Error(`Invalid workbench artifact resolver`);if(n.workbench.apiVersion!==1||!Array.isArray(t)||t.some(e=>typeof e.kind!=`string`||typeof e.component!=`function`)||new Set(t.map(e=>e.kind)).size!==t.length)throw Error(`Invalid workbench contribution`);if(e!==void 0&&(!e||typeof e.kind!=`string`||!e.kind||!iT(e.label)||!iT(e.description)||e.panelTitle!==void 0&&!iT(e.panelTitle)||typeof e.icon!=`function`||!t.some(t=>t.kind===e.kind)))throw Error(`Invalid workbench entry`)}return n}function cT(e,t,n){return new Promise((r,i)=>{let a,o=()=>s(Error(`Plugin load aborted`)),s=(e,n)=>{clearTimeout(a),t.removeEventListener(`abort`,o),e?i(e):r(n)};t.addEventListener(`abort`,o,{once:!0}),n!==void 0&&(a=setTimeout(()=>s(Error(`Plugin load timed out`)),n)),e.then(e=>s(null,e),e=>s(e)),t.aborted&&o()})}var lT=class{controller=new AbortController;cleanups=[];disposed=!1;report;constructor(e){this.report=e}context(e){return{sessionId:e,signal:this.controller.signal,onDispose:e=>{if(typeof e!=`function`)throw Error(`onDispose expects a cleanup function`);this.disposed?this.clean(e):this.cleanups.push(e)}}}clean(e){try{e()}catch(e){this.report(e)}}dispose(){if(!this.disposed){this.disposed=!0,this.controller.abort();for(let e of this.cleanups.splice(0).reverse())this.clean(e)}}},uT=(e,t=null)=>({sessionId:t,generation:e,plugins:[],errors:[],ready:!1}),dT=class{environment;run=null;snapshot=uT(0);generation=0;listeners=new Set;constructor(e){this.environment=e}getSnapshot=()=>this.snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e){this.snapshot=e;for(let e of this.listeners)e()}error(e,t,n,r){let i=`plugin=${t} session=${e.sessionId} generation=${e.generation} stage=${n}: ${r instanceof Error?r.message:String(r)}`;(this.environment.report??console.error)(i),this.run===e&&this.update({...this.snapshot,errors:[...this.snapshot.errors,i]})}async start(e,t){this.dispose();let n={sessionId:e,generation:++this.generation,controller:new AbortController,scopes:[]};this.run=n,this.update(uT(n.generation,e));try{let r=await cT(Promise.resolve().then(t),n.controller.signal);if(this.run!==n)return;for(let e of r.errors)this.error(n,`catalog`,`discover`,e);for(let t of r.plugins){if(this.run!==n)break;let r=new lT(e=>this.error(n,t.id,`dispose`,e));n.scopes.push(r);let i=r.context(e),a=`load`;try{let e=await cT(this.environment.loadModule(t.client),n.controller.signal,this.environment.loadTimeoutMs??1e4);if(this.run!==n)break;a=`validate`;let o=sT(e?.default,t.id);if(t.style&&(a=`style`,await cT(this.environment.loadStyle(t.style,i.signal).then(e=>{i.onDispose(e)}),n.controller.signal,this.environment.loadTimeoutMs??1e4)),this.run!==n)break;a=`activate`;let s=new Set(this.snapshot.plugins.flatMap(e=>e.definition.workbench?.panels.map(e=>e.kind)??[]));if(o.workbench?.panels.some(e=>s.has(e.kind)))throw Error(`Workbench panel kind already registered`);let c=o.activate(i);if(c!==void 0)throw Promise.resolve(c).catch(e=>this.error(n,t.id,`activate`,e)),Error(`activate must be synchronous and return void`);if(this.run!==n){r.dispose();break}this.update({...this.snapshot,plugins:[...this.snapshot.plugins,{id:t.id,definition:o,instanceId:`${n.generation}/${t.id}`}]})}catch(e){this.run===n&&this.error(n,t.id,a,e),r.dispose()}}}catch(e){this.run===n&&this.error(n,`catalog`,`discover`,e)}this.run===n&&this.update({...this.snapshot,ready:!0})}dispose(){let e=this.run;if(e){this.run=null,e.controller.abort();for(let t of e.scopes.reverse())t.dispose();this.update(uT(this.generation))}}};function fT(){let e=typeof window>`u`?void 0:window.piWebPreview;if(e&&typeof e.open==`function`&&typeof e.command==`function`&&typeof e.layout==`function`&&typeof e.close==`function`&&typeof e.onState==`function`)return e}var pT=`@pi-webapp/web-preview`,mT=`builtin:${pT}`,hT={"builtin:@pi-webapp/files":()=>a(()=>import(`./plugin-CsVaeNQM.js`),__vite__mapDeps([7,1,8,2,4,3,9,5])),"builtin:@pi-webapp/terminal":()=>a(()=>import(`./plugin-CE1WaS8V.js`),__vite__mapDeps([10,1,5,2,3,11])),"builtin:@pi-webapp/git":()=>a(()=>import(`./plugin-Gwwlx9MU.js`),__vite__mapDeps([12,1,2,8,4,3,9,5,13])),[mT]:()=>a(()=>import(`./plugin-Cyidq4oP.js`),__vite__mapDeps([14,1,5,2,3,15]))};function gT(e){let t=hT[e];if(!t)throw Error(`Unknown builtin plugin module`);return t()}async function _T(){if(!fT())return;let{default:e}=await gT(mT);return{id:e.id,definition:e}}function vT(e,t){return new Promise((n,r)=>{let i=document.createElement(`link`);i.rel=`stylesheet`,i.href=e;let a=()=>{t.removeEventListener(`abort`,o),i.onload=i.onerror=null,i.remove()},o=()=>{a(),r(Error(`Plugin stylesheet aborted`))};t.addEventListener(`abort`,o,{once:!0}),i.onload=()=>{t.removeEventListener(`abort`,o),i.onload=i.onerror=null,n(a)},i.onerror=()=>{a(),r(Error(`Plugin stylesheet failed to load`))},t.aborted?o():document.head.append(i)})}function yT(e,t,n,r=0){let[i]=(0,O.useState)(()=>new dT({loadModule:e=>e.startsWith(`builtin:`)?gT(e):import(e),loadStyle:vT})),a=(0,O.useSyncExternalStore)(i.subscribe,i.getSnapshot),o=(0,O.useRef)(new Map);a.sessionId&&a.ready&&o.current.set(a.sessionId,a.plugins.filter(e=>e.definition.workbench)),(0,O.useEffect)(()=>{if(e&&t)return globalThis.__PI_WEBAPP_REACT__=O,i.start(t,n),()=>i.dispose()},[i,e,t,r]);let s=e&&a.sessionId===t;return{plugins:s?a.plugins:!e&&t?o.current.get(t)??[]:[],errors:s?a.errors:[]}}var bT=class extends O.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`pi-webapp plugin ${this.props.id}:`,e)}render(){return this.state.failed?null:this.props.children}};function xT(e,t){return{...e,invokeAction:(n,r)=>e.invokePluginAction(t,n,r),resolveInteraction:n=>!e.interaction||e.interaction.pluginId!==t?Promise.reject(Error(`No pending interaction`)):e.resolvePluginInteraction(t,e.interaction.requestId,n)}}function ST({plugins:e,props:t}){let n=t.session?.interactions?.find(t=>e.some(e=>e.id===t.pluginId&&e.definition.interactions?.some(e=>e.kind===t.kind))),r=e.find(e=>e.id===n?.pluginId),i=r?.definition.interactions?.find(e=>e.kind===n?.kind)?.component;return!n||!r||!i?null:(0,z.jsx)(bT,{id:r.id,children:(0,z.jsx)(i,{...xT({...t,interaction:n},r.id)})},`${r.instanceId??r.id}/${n.requestId}`)}function CT({plugins:e,props:t,call:n,result:r,running:i}){let a=e.flatMap(e=>(e.definition.workbench?.toolViews??[]).map(t=>({plugin:e,view:t}))).find(({view:e})=>e.tools.includes(n.toolName??``));if(!a)return null;let o=a.view.component;return(0,z.jsx)(bT,{id:a.plugin.id,children:(0,z.jsx)(o,{...xT(t,a.plugin.id),call:n,result:r,running:i})})}function wT({plugins:e,slot:t,props:n}){let r=e.flatMap(e=>(e.definition.slots??[]).filter(e=>e.slot===t).map(t=>({plugin:e,item:t})));return r.sort((e,t)=>(e.item.order??0)-(t.item.order??0)||e.plugin.id.localeCompare(t.plugin.id)||e.item.id.localeCompare(t.item.id)),(0,z.jsx)(z.Fragment,{children:r.map(({plugin:e,item:t})=>{let r=t.component;return(0,z.jsx)(bT,{id:e.id,children:(0,z.jsx)(r,{...xT(n,e.id)})},`${e.instanceId??e.id}/${t.id}`)})})}function TT(e,t=[]){let n=(0,O.useRef)(new Map),r=(0,O.useMemo)(()=>{let t=e??``,r=n.current.get(t);if(!r){let e=e=>({id:e,kind:`guide`,contentId:`guide`,title:`开始`});r={controller:new XC({makeInitialTab:e,makePaneTab:e}),resources:new Map,owners:new Map,contexts:new Map,reporters:new Map};let i=r;i.controller.subscribe(()=>{let e=i.controller.getSnapshot().state.tabs;for(let[t,n]of i.resources)e[t]||(n.dispose?.(),i.resources.delete(t));for(let t of i.owners.keys())e[t]||i.owners.delete(t);for(let t of i.reporters.keys())e[t]||(i.reporters.delete(t),i.contexts.delete(t))}),n.current.set(t,r)}return r},[e]),{controller:i,resources:a,owners:o}=r,[s,c]=(0,O.useState)(0),l=(0,O.useCallback)(e=>{let t=r.reporters.get(e);return t||(t=t=>{let n=r.contexts.get(e);(n?.detail!==t?.detail||n?.reference!==t?.reference)&&(t?r.contexts.set(e,t):r.contexts.delete(e),c(e=>e+1))},r.reporters.set(e,t)),t},[r]);(0,O.useEffect)(()=>{for(let[t,r]of n.current)for(let n of r.resources.values())n.activate?.(t===e)},[e]),(0,O.useEffect)(()=>{for(let e of n.current.values())for(let[n,r]of[...e.owners])t.includes(r)&&e.controller.closeTab(n)},[t]),(0,O.useEffect)(()=>()=>{for(let e of n.current.values())for(let t of e.resources.values())t.dispose?.()},[]);let u=(0,O.useSyncExternalStore)(i.subscribe,i.getSnapshot),d=aS(u.state,u.state.activePaneId).activeTabId,f=d?sS(u.state,d):void 0,p=f?.kind===`plugin`?f.contentId:null,m=()=>{Object.keys(i.getSnapshot().state.tabs).length||i.openContent({kind:`guide`,contentId:`guide`,title:`开始`}),i.setExpanded(!0)},h=(0,O.useCallback)((e,t,n,r,a)=>{let s=i.getSnapshot().state,c=r&&aS(s,r).host===`dock`?r:PC(s),l=aS(s,c),u=l.activeTabId&&s.tabs[l.activeTabId]?.kind===`guide`?l.activeTabId:void 0,d=l.tabs.find(n=>s.tabs[n]?.kind===e&&s.tabs[n]?.contentId===t),f=d??i.openContent({kind:e,contentId:t,title:n,paneId:c,revealIfOpened:e!==`files`});return a&&o.set(f,a),d&&i.focusTab(d),u&&i.closeTab(u),i.setExpanded(!0),requestAnimationFrame(()=>document.querySelector(`[data-dockkit-content="${f}"]`)?.focus()),f},[i,o]);return{controller:i,snapshot:u,panelId:p,resources:a,owners:o,contexts:r.contexts,contextVersion:s,reporterFor:l,expand:m,openContent:h,shown:u.state.expanded&&Object.keys(u.state.tabs).length>0}}function ET({panel:e,width:t,narrow:n,focus:r,onExitFocus:i,plugins:a,props:o,cwd:s}){let{controller:c,snapshot:u,openContent:d}=e,{state:f}=u,[p,m]=(0,O.useState)(),h=!!fT();(0,O.useEffect)(()=>{if(!h)return;let e=!0;return _T().then(t=>{e&&m(t)}).catch(()=>{e&&m(void 0)}),()=>{e=!1}},[h]);let[g,_]=(0,O.useState)(``);dt(`plugin-panel-close`,g);let v=(0,O.useRef)(!1),y=(0,O.useMemo)(()=>new Proxy(c,{get(e,t){if(t===`closeTab`)return t=>{if(v.current)return;v.current=!0;let n=o.session?.sessionId??``;Fn.flush(n).then(async()=>{let r=document.querySelector(`[data-dockkit-content="${CSS.escape(t)}"]`);r&&await Fn.retireWithin(n,r),_(``),e.closeTab(t)}).catch(e=>_(e instanceof Error?e.message:String(e))).finally(()=>{v.current=!1})};let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}}),[c,o.session?.sessionId]),b=n||f.mode===`fullscreen`,x=o.locale===`zh`?$w:eT,C=e=>x[e]??e,w=e=>typeof e==`string`?e:e[o.locale],T=a.filter(e=>e.id!==pT);h&&p&&T.push(p);let E=T.flatMap(e=>{let t=e.definition.workbench?.entry;return t?[{plugin:e,entry:t}]:[]}),D=T.flatMap(e=>(e.definition.workbench?.panels??[]).map(t=>({plugin:e,contribution:t}))),k=()=>{i(),c.setExpanded(!1),requestAnimationFrame(()=>document.querySelector(`[data-sidebar-right-expand]`)?.focus())},A=n?`100vw`:t;return(0,z.jsx)(`div`,{className:Jw.panel,style:{width:A,"--dsh-sidebar-width":typeof A==`number`?`${A}px`:A},"data-sidebar-right-session":o.session?.sessionId,"data-sidebar-right-panel":b?`fullscreen`:r?`focus`:`push`,"data-sidebar-right-open":e.shown||void 0,"aria-hidden":!e.shown||void 0,children:(0,z.jsx)(`div`,{className:Jw.panelBody,children:(0,z.jsx)(qw,{state:f,canSplit:u.canSplit&&pS(f).length<2,dropZones:`horizontal`,minPaneFraction:.2,intents:y,labels:Qw(C),active:!0,keepMounted:()=>!0,renderTab:t=>{let n=fS(f,t.id).id,r=f.expanded&&aS(f,n).activeTabId===t.id;if(t.kind===`guide`)return(0,z.jsx)(`div`,{className:S.guide,children:(0,z.jsxs)(`div`,{className:S.guideGrid,role:`group`,"aria-label":R(`工作区工具`,`Workspace tools`),children:[E.map(({plugin:e,entry:t})=>{let r=t.icon;return(0,z.jsxs)(`button`,{type:`button`,className:S.guideEntry,disabled:!o.session||!s&&e.id!==`@pi-webapp/web-preview`,"aria-label":w(t.label),onClick:()=>d(t.kind,t.multiple?l():`workspace`,w(t.panelTitle??t.label),n,e.id),children:[(0,z.jsx)(`span`,{className:S.guideIcon,"aria-hidden":`true`,children:(0,z.jsx)(r,{size:24})}),(0,z.jsxs)(`span`,{className:S.guideCopy,children:[(0,z.jsx)(`span`,{className:S.guideLabel,children:w(t.label)}),(0,z.jsx)(`span`,{className:S.guideDescription,children:w(t.description)})]})]},e.id)}),!E.length&&(0,z.jsx)(`p`,{className:S.state,children:R(`没有已启用的工作区插件,可在设置中启用。`,`No workspace plugins enabled. Enable one in Settings.`)})]})});let i=D.find(e=>e.contribution.kind===t.kind);if(i&&o.session){let{plugin:a,contribution:s}=i;e.owners.set(t.id,a.id);let c=s.component;return(0,z.jsx)(bT,{id:a.id,children:(0,z.jsx)(c,{sendMessage:o.sendMessage,session:o.session,locale:o.locale,visible:r,contentId:t.contentId,title:t.title,renderMarkdown:o.renderMarkdown,resource:(n,r,i)=>{let a=e.resources.get(t.id);if(!a){let o=n();a={value:o,dispose:()=>r?.(o),activate:e=>i?.(o,e)},e.resources.set(t.id,a)}return a.value},reportContext:e.reporterFor(t.id),open:(e,t,r)=>d(e,t,r,n,a.id)})})}return(0,z.jsx)(wT,{plugins:a,slot:`rightbar.panel`,props:{...o,panelId:t.contentId}})},renderTabTitle:e=>{if(e.kind===`guide`)return C(`tab.guide.title`);let t=D.find(t=>t.contribution.kind===e.kind);return t?(0,z.jsx)(`span`,{className:S.title,children:t.contribution.title?.(e.contentId,e.title)??e.title}):(0,z.jsx)(wT,{plugins:a,slot:`rightbar.title`,props:{...o,panelId:e.contentId}})},chrome:(0,z.jsx)(Zw,{sessionId:o.session?.sessionId??``,fullscreen:b||r,focus:r,shortcuts:[],t:C,actions:{toggleExpanded:k},toggleFullscreen:()=>r?i():n?k():c.setMode(b?`push`:`fullscreen`)})})})})}function DT({panel:e,locale:t}){if(e.shown)return null;let n=t===`zh`?$w:eT;return(0,z.jsx)(Ty,{label:n[`chrome.expand`],side:`bottom`,delayMs:500,children:(0,z.jsx)(nT,{size:`sm`,className:rT.button,"aria-label":n[`chrome.expandAria`],"data-sidebar-right-expand":!0,onClick:e.expand,children:(0,z.jsx)(A_,{className:rT.icon})})})}function OT(e,t){let n=e.filter(e=>e.enabled&&e.generation!==void 0&&e.contribution&&e.documentUrl&&e.controllerUrl).map(e=>{let n=t.find(t=>t.pluginId===e.pluginId);return n&&n.generation===e.generation&&n.name===e.name&&n.icon===e.icon&&n.documentUrl===e.documentUrl&&n.controllerUrl===e.controllerUrl&&JSON.stringify(n.contribution)===JSON.stringify(e.contribution)?n:e});return n.length===t.length&&n.every((e,n)=>e===t[n])?t:n}var kT=`pi:hosted:unconfirmed-views:v1`,AT=`pi:hosted:unconfirmed-view:v1:`,jT=`pi:hosted:retired-view:v1:`,MT=``,NT=()=>{MT=`View recovery journal could not be read. Its original data has been retained.`},PT=()=>{MT=`View recovery journal could not be stored. Keep this page open and download local drafts.`};function FT(e){if(!e||typeof e!=`object`)return!1;let t=e;return[`controller`,`workspace`,`editor`,`tool`].includes(String(t.kind))&&[`sessionId`,`pluginId`,`mountId`,`viewToken`].every(e=>typeof t[e]==`string`&&t[e].length>0&&t[e].length<=214)&&Number.isSafeInteger(t.generation)&&Number(t.generation)>=1&&(t.contentId===void 0||typeof t.contentId==`string`)&&(t.createdAt===void 0||Number.isSafeInteger(t.createdAt))&&(t.orphanedAt===void 0||Number.isSafeInteger(t.orphanedAt))&&[`retained`,`frameStarted`].every(e=>t[e]===void 0||typeof t[e]==`boolean`)&&(t.backups===void 0||Array.isArray(t.backups)&&t.backups.every(e=>e&&typeof e.key==`string`&&typeof e.name==`string`))}function IT(){try{if(typeof sessionStorage>`u`)return[];let e=sessionStorage.getItem(kT);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t)||!t.every(FT))throw Error(`Invalid view recovery journal`);return t}catch{return NT(),[]}}function LT(e){if(typeof localStorage>`u`)return null;let t=localStorage.getItem(jT+e);if(t!==null){if(JSON.parse(t)!==!0)throw Error(`Invalid view retirement receipt`);return`retired`}let n=localStorage.getItem(AT+e);if(!n)return null;let r=JSON.parse(n);if(!FT(r)||r.viewToken!==e)throw Error(`Invalid durable view recovery record`);return r}function RT(e,t){return e.sessionId===t.sessionId&&e.pluginId===t.pluginId&&e.generation===t.generation&&e.mountId===t.mountId}var zT=IT(),BT=new Set(zT.map(e=>e.viewToken));function VT(){let e=new Map(zT.map(e=>[e.viewToken,e]));try{if(typeof localStorage<`u`)for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t),r=n?.startsWith(AT)?AT:n?.startsWith(jT)?jT:void 0;if(!r)continue;let i=n.slice(r.length);try{let t=LT(i);if(t===`retired`)e.delete(i);else if(t){let n=e.get(i);if(n&&!RT(n,t))throw Error(`Conflicting view recovery identity`);e.set(i,{...t,discovered:!BT.has(i)})}}catch{NT()}}}catch{NT()}return[...e.values()]}var HT=VT(),UT=[...HT];function WT(){return UT=UT.filter(e=>{try{return LT(e.viewToken)!==`retired`}catch{return NT(),!0}}),UT.filter(e=>HT.some(t=>t.viewToken===e.viewToken))}var GT=new Map,KT=`pi:hosted:recovery-draft:v1:`,qT=()=>MT;function JT(){if(MT)return!1;try{return typeof sessionStorage<`u`&&sessionStorage.setItem(kT,JSON.stringify(UT.filter(e=>BT.has(e.viewToken)))),!0}catch{return PT(),!1}}function YT(e){if(MT)return!1;try{if(typeof localStorage>`u`)return!0;let t=LT(e.viewToken);if(t===`retired`)return!1;if(t&&!RT(t,e))throw Error(`Conflicting view recovery identity`);let{discovered:n,...r}={...e,...t?.frameStarted?{frameStarted:!0}:{},...t?.retained?{retained:!0}:{},...t?.orphanedAt===void 0?{}:{orphanedAt:t.orphanedAt},backups:[...new Map([...t?.backups??[],...e.backups??[]].map(e=>[e.key,e])).values()]};return localStorage.setItem(AT+e.viewToken,JSON.stringify(r)),!0}catch{return PT(),!1}}function XT(e,t,n){BT.add(t),UT=UT.filter(e=>e.viewToken!==t);let r={...e,viewToken:t,kind:n.kind,contentId:n.contentId,frameStarted:!1,createdAt:Date.now()};UT.push(r),YT(r),JT()}function ZT(e){let t=UT.find(t=>t.viewToken===e);if(!t||t.retained)return!1;let n={...t,frameStarted:!0};return YT(n)?(UT=UT.map(t=>t.viewToken===e?n:t),JT()):!1}function QT(e){UT=UT.filter(t=>t.viewToken!==e),BT.delete(e);try{if(LT(e),typeof localStorage<`u`){localStorage.setItem(jT+e,JSON.stringify(!0));let t=`${KT}${e}:`,n=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(t)&&n.push(r)}for(let e of n)localStorage.removeItem(e),GT.delete(e)}}catch{NT()}JT()}async function $T(e){if(e.discovered&&(e.kind===`controller`||e.frameStarted!==!0))return;let t=(await vx.view({...e,operation:`reconcile`})).recovery;return t?.state===`unconfirmed`&&e.frameStarted===!1&&BT.has(e.viewToken)&&(await vx.view({...e,operation:`cancel-initialization`}),QT(e.viewToken),t={...t,state:`retired`}),(t?.state===`retired`||t?.state===`absent`&&e.kind===`controller`)&&QT(e.viewToken),t}var eE=3e5,tE=6048e5,nE=(e,t)=>e.frameStarted===!0||e.createdAt===void 0||t-e.createdAt>eE;function rE(e,t,n=Date.now()){return t?.state===`retained`||t?.state===`absent`&&nE(e,n)}function iE(e,t){let n=UT.find(t=>t.viewToken===e.viewToken),r=n?.orphanedAt??e.orphanedAt;if(r!==void 0&&t-r>6048e5)return QT(e.viewToken),{state:`retired`};if(r===void 0&&n){let r={...n,orphanedAt:t};YT(r)&&(UT=UT.map(t=>t.viewToken===e.viewToken?r:t),JT())}e.orphanedAt=r??t}var aE=new Set([`invalid_scope`,`unknown_plugin`]),oE=`@chengzhiyi/pi-excalidraw`;function sE(e){if(!Array.isArray(e))return;let t=e.filter(e=>e&&typeof e==`object`&&!e.isDeleted).map(e=>[String(e.id),e.version,e.versionNonce]);return JSON.stringify(t.sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])))}async function cE(e,t){if(e.kind===`controller`)return!0;let n=pE(e);if(!n.length)return!0;if(e.pluginId!==oE||t===void 0)return!1;for(let r of n){let n=/^recovery-(.+)\.excalidraw$/.exec(r.name)?.[1];if(!n)return!1;try{let i=await vx.action({sessionId:e.sessionId,pluginId:e.pluginId,generation:t,action:`get`,input:{id:n}}),a=sE(JSON.parse(r.json).elements);if(!a||a!==sE(i?.scene?.elements))return!1}catch{return!1}}return!0}async function lE(e,t,n=Date.now()){let r=await uE(e,t,n);return rE(e,r,n)?iE(e,n)??r:r}async function uE(e,t,n){let r=nE(e,n),i=async()=>await cE(e,t)?(QT(e.viewToken),!0):!1;if(e.retained)return await i()?{state:`retired`}:{state:`retained`};let a;try{a=(await vx.view({...e,operation:`status`})).recovery}catch(t){let n=t?.code;if(r&&typeof n==`string`&&aE.has(n))return await i()?{state:`retired`}:{state:`absent`};if(t instanceof Error&&t.message===`Unknown view operation`)return $T(e);throw t}if(a?.state===`retired`)return QT(e.viewToken),a;if(a?.state===`absent`)return r&&await i()?{state:`retired`}:r||e.discovered?a:$T(e);if(a?.state===`unconfirmed`&&a.stale){if(e.kind===`controller`)return $T({...e,discovered:!1});if(!a.dirty&&!a.busy&&await cE(e,t))try{return await vx.view({...e,operation:`close`}),QT(e.viewToken),{state:`retired`}}catch{return a}return a}return a?.state===`unconfirmed`&&!e.discovered?$T(e):a}async function dE(e){let t=await vx.view({...e,operation:`recover`,confirmation:`retain-unconfirmed-edits`});if(t.recovery?.state===`retired`){QT(e.viewToken);return}if(!t.recovery||![`retained`,`absent`].includes(t.recovery.state))throw Error(`This view still has an active operation. Its recovery state was preserved.`);UT=UT.map(t=>t.viewToken===e.viewToken?{...t,retained:!0}:t);let n=UT.find(t=>t.viewToken===e.viewToken);n&&YT(n),JT()}async function fE(e){(await vx.view({...e,operation:`reconcile`})).recovery?.state!==`absent`&&await vx.view({...e,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),QT(e.viewToken)}function pE(e){if(e.pluginId!==`@chengzhiyi/pi-excalidraw`)return[];let t=`pi-diagram:${e.sessionId}:`,n=[];try{if(typeof localStorage>`u`)return[];for(let t of e.backups??[]){if(!t.key.startsWith(`${KT}${e.viewToken}:`))continue;let r=GT.get(t.key)??localStorage.getItem(t.key);r&&n.push({name:t.name,json:r})}if(n.length)return n;for(let r=0;r<localStorage.length;r++){let i=localStorage.key(r);if(!i?.startsWith(t)||e.contentId&&i!==t+e.contentId)continue;let a=localStorage.getItem(i);if(!(!a||a.length>16777216))try{let e=JSON.parse(a);if(!e||!Array.isArray(e.elements))continue;let r=i.slice(t.length).replace(/[^\w.-]/g,`_`).slice(0,100);n.push({name:`recovery-${r}.excalidraw`,json:a})}catch{}}}catch{}return n}for(let e of HT){if(e.kind===`controller`)continue;let t=pE(e);t.length&&(e.backups=t.map(t=>{let n=`${KT}${e.viewToken}:${t.name}`;GT.set(n,t.json);try{localStorage.getItem(n)||localStorage.setItem(n,t.json)}catch{MT=`Recovery copy could not be stored. Keep this page open and download local drafts before reloading.`}return{key:n,name:t.name}}))}for(let e of UT)YT(e);JT();function mE(e){let t=e;if(!t||!(t.blob instanceof Blob)||!t.blob.size||t.blob.size>16777216||typeof t.name!=`string`||t.name.length>200||/[/\\\x00-\x1f\x7f]/.test(t.name))throw Error(`Invalid drawing download`);let n={png:`image/png`,jpg:`image/jpeg`,webp:`image/webp`,svg:`image/svg+xml`,excalidraw:`application/json`,json:`application/json`}[t.name.split(`.`).pop()?.toLowerCase()??``];if(!n||t.blob.type!==n)throw Error(`Unsupported drawing download`);return{blob:t.blob,name:t.name}}function hE(e){let{blob:t,name:n}=mE(e),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=n,i.hidden=!0,document.body.append(i);try{i.click()}finally{i.remove(),setTimeout(()=>URL.revokeObjectURL(r),3e4)}}var gE={entry:`_entry_d5j2n_1`,quiet:`_quiet_d5j2n_4`,link:`_link_d5j2n_5`,trigger:`_trigger_d5j2n_8`,dialog:`_dialog_d5j2n_10`,content:`_content_d5j2n_13`,list:`_list_d5j2n_15`,item:`_item_d5j2n_16`,error:`_error_d5j2n_19`,history:`_history_d5j2n_25`,actions:`_actions_d5j2n_29`};function _E({sessionId:e,locale:t,openRecovered:n}){let[r,i]=(0,O.useState)(WT),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(``),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(0),h=(e,n)=>t===`zh`?e:n,[g,_]=(0,O.useState)(new Set),[v,y]=(0,O.useState)(new Set),[b,x]=(0,O.useState)(new Set),S=r.filter(e=>v.has(e.viewToken)&&!g.has(e.viewToken)),C=qT(),w=S.filter(e=>!b.has(e.viewToken)),T=e=>{QT(e),i(t=>t.filter(t=>t.viewToken!==e))};if((0,O.useEffect)(()=>{o(!1),c(null),u(``)},[e]),(0,O.useEffect)(()=>{let e=!0;return(async()=>{let t=new Map;try{t=new Map((await vx.catalog()).plugins.flatMap(e=>e.generation===void 0?[]:[[e.pluginId,e.generation]]))}catch{}let n=e=>y(t=>new Set(t).add(e)),a=(e,t)=>x(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});for(let o of r){if(!e)return;try{let r=await lE(o,t.get(o.pluginId));if(!e)return;r?.state===`retired`||r?.state===`absent`&&o.kind===`controller`?T(o.viewToken):r?.state===`retained`&&i(e=>e.map(e=>e.viewToken===o.viewToken?{...e,retained:!0}:e)),_(e=>{let t=new Set(e);return o.discovered&&r?.state===`unconfirmed`&&r.stale===!1?t.add(o.viewToken):t.delete(o.viewToken),t}),a(o.viewToken,rE(o,r)),n(o.viewToken)}catch(t){if(!e)return;if(t instanceof Error&&t.message===`Unknown view operation`){y(new Set(r.map(e=>e.viewToken)));return}a(o.viewToken,!1),n(o.viewToken),u(String(t))}}})(),()=>{e=!1}},[e,p]),!S.length&&!C)return null;let E=e=>({controller:h(`后台控制器`,`Controller`),workspace:h(`工作区`,`Workspace`),editor:h(`编辑器`,`Editor`),tool:h(`工具预览`,`Tool preview`)})[e]??h(`插件视图`,`Plugin view`),D=s?.operation===`retain`,k=(s?.items.length??0)>1,A=e=>Math.max(1,Math.ceil(((e.orphanedAt??Date.now())+tE-Date.now())/864e5)),j=(0,z.jsxs)(`button`,{type:`button`,className:gE.trigger,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:[h(`插件视图恢复`,`Plugin view recovery`),` · `,S.length]});return(0,z.jsxs)(z.Fragment,{children:[w.length||C?(0,z.jsxs)(`div`,{className:gE.entry,"data-hosted-recovery":!0,children:[(0,z.jsx)(`p`,{children:h(`刷新或关闭窗口后,部分插件视图尚未确认保存,插件更新、卸载等操作会因此被阻塞。请先核对原窗口及备份,再保留或丢弃这些记录。`,`Some plugin views were not confirmed as saved before a window reloaded or closed, which blocks plugin updates, uninstalls and similar operations. Check original windows and backups, then retain or discard these records.`)}),j]}):(0,z.jsxs)(`div`,{className:gE.quiet,"data-hosted-recovery":!0,children:[(0,z.jsx)(`span`,{children:h(`已关闭的插件视图在此浏览器里留下 ${S.length} 份未保存的草稿,不影响任何操作,最迟 7 天后自动清除。`,`Closed plugin views left ${S.length} unsaved ${S.length===1?`draft`:`drafts`} in this browser. They block nothing and clear themselves within 7 days.`)}),(0,z.jsx)(`button`,{type:`button`,className:gE.link,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:h(`查看草稿`,`Review drafts`)})]}),(0,z.jsx)(Yy,{open:a,onClose:()=>o(!1),title:h(`检查之前的插件视图`,`Review previous plugin views`),closeLabel:h(`关闭`,`Close`),className:gE.dialog,footer:(0,z.jsxs)(z.Fragment,{children:[S.length>1&&(0,z.jsxs)(qy,{variant:`outline`,disabled:d,onClick:()=>c({items:S,operation:`discard`}),children:[h(`全部丢弃`,`Discard all`),` · `,S.length]}),(0,z.jsx)(qy,{variant:`outline`,disabled:d,onClick:()=>{u(``),m(e=>e+1)},children:h(`重新检查`,`Check again`)})]}),children:(0,z.jsxs)(`div`,{className:gE.content,children:[(0,z.jsx)(`p`,{children:h(`以下列出所有会话中待确认的旧插件视图。请先检查原窗口、编辑器和本地备份,只处理已失联的视图;仍打开的窗口请先正常保存并关闭。`,`These are previous plugin views awaiting confirmation across all sessions. Check original windows, editors and local backups. Only recover disconnected views; save and close windows that remain open first.`)}),(0,z.jsx)(`p`,{children:h(`保留恢复记录会停止旧视图继续写入,不会覆盖当前图稿。丢弃未确认的记录不会保存或恢复图稿,无法找回的最新修改可能永久丢失。`,`Retaining recovery records stops old views writing without overwriting the current drawing. Discarding unconfirmed records does not save or restore a drawing; unrecoverable recent edits may be permanently lost.`)}),(0,z.jsx)(`div`,{className:gE.list,children:S.map((t,r)=>(0,z.jsxs)(`section`,{className:gE.item,"data-unconfirmed-view":t.mountId,children:[(0,z.jsxs)(`h3`,{children:[E(t.kind),` `,r+1]}),t.retained?(0,z.jsx)(`p`,{children:h(`失联视图的恢复记录已保留。插件可继续操作;旧稿是否完整仍需核对。约 ${A(t)} 天后自动清除。`,`Disconnected view recovery record retained. Plugin operations may continue; the old draft still needs verification. It clears itself in about ${A(t)} day(s).`)}):b.has(t.viewToken)&&(0,z.jsx)(`p`,{children:h(`此视图已不阻塞任何操作,仅保留与已保存图稿不同的本地副本,约 ${A(t)} 天后自动清除。`,`This view no longer blocks anything. It only keeps a local copy that differs from the saved drawing, and clears itself in about ${A(t)} day(s).`)}),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{children:h(`视图信息`,`View details`)}),(0,z.jsxs)(`dl`,{children:[(0,z.jsx)(`dt`,{children:h(`会话`,`Session`)}),(0,z.jsx)(`dd`,{children:t.sessionId}),(0,z.jsx)(`dt`,{children:h(`插件`,`Plugin`)}),(0,z.jsx)(`dd`,{children:t.pluginId}),(0,z.jsx)(`dt`,{children:h(`版本代次`,`Generation`)}),(0,z.jsx)(`dd`,{children:t.generation}),(0,z.jsx)(`dt`,{children:h(`视图标识`,`View ID`)}),(0,z.jsx)(`dd`,{children:t.mountId}),t.contentId&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:h(`内容标识`,`Content ID`)}),(0,z.jsx)(`dd`,{children:t.contentId})]})]})]}),(0,z.jsxs)(`div`,{className:gE.actions,children:[pE(t).map(e=>(0,z.jsxs)(qy,{variant:`outline`,disabled:d,onClick:()=>hE({blob:new Blob([e.json],{type:`application/json`}),name:e.name}),children:[h(`下载本地恢复副本`,`Download local recovery copy`),` · `,e.name]},e.name)),t.contentId&&t.sessionId===e&&n&&(0,z.jsx)(qy,{variant:`outline`,disabled:d,onClick:()=>{o(!1),n(t.contentId)},children:h(`打开图稿并核对备份`,`Open drawing and compare backup`)}),!t.retained&&!b.has(t.viewToken)&&(0,z.jsx)(qy,{variant:`outline`,disabled:d,onClick:()=>c({items:[t],operation:`retain`}),children:h(`保留恢复记录并解除阻塞`,`Retain recovery record and unblock`)}),(0,z.jsx)(qy,{variant:`outline`,disabled:d,onClick:()=>c({items:[t],operation:`discard`}),children:h(`丢弃此视图的未确认修改`,`Discard this view's unconfirmed edits`)})]})]},t.viewToken))}),(l||C)&&(0,z.jsxs)(`div`,{role:`alert`,className:gE.error,children:[h(`未能确认部分视图,请保留恢复记录并重试。`,`Some views could not be verified. Keep their recovery records and retry.`),(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{children:h(`诊断信息`,`Diagnostics`)}),l||C]})]})]})}),(0,z.jsx)(Yy,{open:!!s&&a,onClose:()=>c(null),title:D?h(`保留此视图用于恢复?`,`Retain this view for recovery?`):k?h(`丢弃全部 ${s.items.length} 个视图的未确认修改?`,`Discard unconfirmed edits from all ${s.items.length} views?`):h(`丢弃此视图的未确认修改?`,`Discard this view's unconfirmed edits?`),closeLabel:h(`关闭`,`Close`),description:D?h(`请先确认旧视图已失联并核对备份。此操作保留恢复记录和本地副本,停止旧视图继续写入,不会保存、覆盖或丢弃图稿。`,`First confirm the old view is disconnected and review backups. This preserves recovery records and local copies and stops the old view writing, without saving, overwriting or discarding a drawing.`):k?h(`请先确认原标签页都已关闭,并下载需要保留的草稿。此操作会清除全部记录及其本地副本,不会保存或恢复内容;无法找回的修改可能永久丢失。`,`First confirm the original tabs are closed and download any drafts you want to keep. This clears every record and its local copies without saving or restoring content; unrecovered edits may be permanently lost.`):h(`请先确认原标签页已关闭,并下载可恢复的草稿。此操作不会保存或恢复内容;无法找回的修改可能永久丢失。`,`First confirm the original tab is closed and download any recoverable draft. This does not save or restore content; unrecovered edits may be permanently lost.`),footer:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(qy,{variant:`outline`,disabled:d,onClick:()=>c(null),children:h(`取消`,`Cancel`)}),(0,z.jsx)(qy,{variant:`primary`,disabled:d,onClick:()=>{if(!s||d)return;let{items:e,operation:t}=s;f(!0),u(``),(async()=>{for(let n of e)t===`retain`?(await dE(n),i(WT()),x(e=>new Set(e).add(n.viewToken))):(await fE(n),T(n.viewToken))})().then(()=>c(null)).catch(e=>{u(String(e)),c(null)}).finally(()=>f(!1))},children:D?h(`保留恢复记录`,`Retain record`):k?h(`全部丢弃`,`Discard all`):h(`确认丢弃`,`Discard edits`)})]})})]})}var vE=new class{entries=new Set;releaseLock;timer;running=!1;interval;request;constructor(e=250,t=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{return await _x(`/views`,{operation:`pollMany`,views:e},t.signal)}finally{clearTimeout(n)}}){this.interval=e,this.request=t}add(e){return this.entries.add(e),this.holdLock(),this.schedule(0),()=>{this.entries.delete(e),this.entries.size||(this.timer&&=(clearTimeout(this.timer),void 0),this.releaseLock?.())}}holdLock(){if(this.releaseLock||typeof navigator>`u`||!navigator.locks)return;let e,t=new Promise(t=>{e=t});this.releaseLock=()=>{this.releaseLock=void 0,e()},navigator.locks.request(`pi:hosted:view-poller:${crypto.randomUUID()}`,()=>t).catch(()=>{this.releaseLock=void 0})}wake(){!this.running&&this.entries.size&&(this.timer&&=(clearTimeout(this.timer),void 0),this.schedule(0))}schedule(e){this.running||this.timer||!this.entries.size||(this.timer=setTimeout(()=>{this.timer=void 0,this.tick()},e))}async tick(){this.running=!0;let e=[...this.entries];try{for(let t=0;t<e.length;t+=64){let n=e.slice(t,t+64).filter(e=>this.entries.has(e));if(!n.length)continue;let{replies:r}=await this.request(n.map(e=>e.input()));if(!Array.isArray(r)||r.length!==n.length)throw Error(`Invalid aggregate view reply`);await Promise.all(n.map(async(e,t)=>{if(this.entries.has(e))try{let n=r[t];if(n.failure)throw Object.assign(Error(n.failure.body.error),{status:n.failure.status});if(!n.reply||n.reply.viewToken!==e.input().viewToken)throw Error(`Mismatched view reply`);await e.accept(n.reply)}catch(t){this.entries.delete(e),e.fail(t)}}))}}catch(t){for(let n of e)this.entries.delete(n)&&n.fail(t)}finally{this.running=!1,this.schedule(this.interval)}}};typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{document.hidden||vE.wake()});var yE=class{token=``;get capability(){return{viewToken:this.token,mountId:this.identity.mountId}}stopped=!1;closed=!1;closing;abort=new AbortController;unlisten;after=0;snapshot;frozen=!1;localCloseCheckpoint=!1;frameStarted=!1;connecting(){if(!ZT(this.token)&&this.mount.kind!==`controller`)throw Error(`Cannot protect the editor recovery journal; download local drafts before opening another editor`);this.frameStarted=!0}async flushed(){await this.changed({dirty:!1,busy:!1})}identity;adapter;mount;reconnect;failed;poller;constructor(e,t,n,r,i,a=vE){this.poller=a,this.identity=e,this.adapter=t,this.mount=n,this.reconnect=r,this.failed=i}async start(){this.token=crypto.randomUUID(),XT(this.identity,this.token,this.mount);let e=await vx.view({...this.identity,operation:`register`,kind:this.mount.kind,viewToken:this.token});e.viewToken!==this.token&&(QT(this.token),this.token=e.viewToken,XT(this.identity,this.token,this.mount))}listen(){this.stopped||this.unlisten||(this.unlisten=this.poller.add({input:()=>({...this.identity,viewToken:this.token,operation:`poll`,after:this.after}),accept:e=>this.receive(e),fail:e=>{this.stopped||this.failed(e)}}))}retry(){if(this.closed)throw Error(`Closed view cannot reconnect`);this.unlisten?.(),this.unlisten=void 0,this.stopped=!1,this.abort=new AbortController,this.localCloseCheckpoint?this.adapter.call(`restore`,this.snapshot).then(()=>{this.frozen=!1,this.localCloseCheckpoint=!1,this.listen()}).catch(this.failed):this.listen()}request(e){return vx.view({...this.identity,viewToken:this.token,...e},this.abort.signal)}async changed(e){let t=e;if(typeof t?.dirty!=`boolean`||typeof t.busy!=`boolean`)throw Error(`Invalid frame status`);await this.request({operation:`change`,dirty:t.dirty,busy:t.busy})}async receive(e){for(let t of e.commands){if(this.stopped)return;let e;try{if(t.type===`freeze`&&!this.frozen&&(this.snapshot=await this.adapter.call(`freeze`),this.frozen=!0),t.type===`resume`&&this.frozen&&(await this.adapter.call(`restore`,this.snapshot),this.frozen=!1),t.type===`committed`){await this.request({operation:`ack`,commandId:t.id,ok:!0}),await this.close(),this.reconnect();return}}catch(t){e=t}await this.request({operation:`ack`,commandId:t.id,ok:!e,...e?{error:e instanceof Error?e.message:String(e)}:{}}),this.after=t.id,e&&this.failed(e)}}close(){return this.closed?Promise.resolve():(this.closing||=(this.stopped=!0,this.unlisten?.(),this.abort.abort(),(async()=>{this.token&&(this.mount.kind!==`controller`&&!this.frameStarted?await vx.view({...this.identity,viewToken:this.token,operation:`cancel-initialization`}):(this.mount.kind!==`controller`&&!this.frozen&&(this.snapshot=await this.adapter.call(`freeze`),this.frozen=!0,this.localCloseCheckpoint=!0),this.localCloseCheckpoint&&await vx.view({...this.identity,viewToken:this.token,operation:`change`,dirty:!1,busy:!1}),await vx.view({...this.identity,viewToken:this.token,operation:`close`})),this.closed=!0,QT(this.token))})().catch(e=>{throw this.closing=void 0,e})),this.closing)}},bE={card:`_card_1g0je_1`,header:`_header_1g0je_2`,toggle:`_toggle_1g0je_6`,title:`_title_1g0je_7`,status:`_status_1g0je_8`,chevron:`_chevron_1g0je_9`,parameters:`_parameters_1g0je_12`,preview:`_preview_1g0je_13`,dialog:`_dialog_1g0je_15`,details:`_details_1g0je_18`};function xE({title:e,tool:t,locale:n,children:r}){let[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),c=(0,O.useId)(),l=(e,t)=>n===`zh`?e:t,u=t.result?.blocks.filter(e=>e.kind===`text`).map(e=>e.text??``).join(`
|
|
51
|
+
`);return(0,z.jsxs)(`article`,{className:e?bE.card:void 0,"data-hosted-tool-card":e?``:void 0,children:[e&&(0,z.jsxs)(`header`,{className:bE.header,children:[(0,z.jsxs)(`button`,{type:`button`,className:bE.toggle,"aria-label":l(`展开或收起预览`,`Toggle preview`),"aria-expanded":!i,"aria-controls":c,onClick:()=>a(e=>!e),children:[(0,z.jsx)(`span`,{className:bE.title,children:e}),(0,z.jsx)(`span`,{className:bE.status,children:t.result?.isError?l(`失败`,`Failed`):t.result?l(`已完成`,`Completed`):t.running?l(`运行中`,`Running`):l(`未完成`,`Incomplete`)}),(0,z.jsx)(`span`,{className:bE.chevron,"data-collapsed":i,"aria-hidden":`true`,children:(0,z.jsx)(Ae,{size:16})})]}),(0,z.jsx)(`button`,{type:`button`,className:bE.parameters,"aria-haspopup":`dialog`,onClick:()=>s(!0),children:l(`查看参数`,`View parameters`)})]}),(0,z.jsx)(`div`,{id:c,hidden:!!e&&i,className:bE.preview,children:r}),(0,z.jsx)(Yy,{open:o&&!!e,onClose:()=>s(!1),title:l(`工具参数`,`Tool parameters`),closeLabel:l(`关闭`,`Close`),className:bE.dialog,children:(0,z.jsxs)(`div`,{className:bE.details,"data-tool-parameters":!0,children:[(0,z.jsx)(`h3`,{children:l(`输入参数`,`Input`)}),(0,z.jsx)(`pre`,{tabIndex:0,children:t.call.text}),u!==void 0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h3`,{children:l(`工具结果`,`Result`)}),(0,z.jsx)(`pre`,{tabIndex:0,children:u})]})]})})]})}function SE(e){let t=e;if(typeof t?.title!=`string`||!t.title.trim()||t.title.length>160)throw Error(`Invalid tool presentation`);return{title:t.title}}function CE(e){let t=e?.height;if(typeof t!=`number`||!Number.isFinite(t)||t<0||t>4096)throw Error(`Invalid tool height`);return Math.max(1,Math.ceil(t))}function wE(e){let t=e;if(typeof t?.message!=`string`||t.message.length>4e3||t.level!==`info`&&t.level!==`error`)throw Error(`Invalid notification`);return{message:t.message,level:t.level}}var TE=new Map;function EE(e,t,n,r,i){let a=TE.get(e.pluginId)??new Map;TE.set(e.pluginId,a),a.set(t,i);let o=n===`zh`;st({key:`hosted-view:${e.pluginId}`,message:o?`${e.name} 连接中断`:`${e.name} lost its connection`,detail:r instanceof Error?r.message:String(r),detailLabel:o?`诊断信息`:`Diagnostics`,action:{label:o?`重新连接`:`Reconnect`,onClick:()=>{let e=[...a.values()];a.clear();for(let t of e)t()}}})}function DE(e,t){let n=TE.get(e);n?.delete(t)&&!n.size&&ut(`hosted-view:${e}`)}function OE({card:e,mount:t,update:n,open:r,sendMessage:i,reconnect:a,abort:o}){let s=(0,O.useRef)(null),c=(0,O.useRef)(null),l=(0,O.useRef)(null),u=(0,O.useRef)(Promise.resolve()),d=(0,O.useRef)({open:r,sendMessage:i,reconnect:a,abort:o});d.current={open:r,sendMessage:i,reconnect:a,abort:o};let f=(0,O.useRef)({}).current,p=(0,O.useRef)(!1),[m,h]=(0,O.useState)(0),g=(0,O.useRef)(e=>{}),_=(0,O.useRef)(()=>{});g.current=n=>EE(e,f,t.locale,n,()=>_.current()),_.current=()=>{if(!p.current)h(e=>e+1);else try{l.current?.retry()}catch(e){g.current(e)}},(0,O.useEffect)(()=>()=>DE(e.pluginId,f),[e.pluginId,f]);let[v,y]=(0,O.useState)(),[b,x]=(0,O.useState)(240),[S,C]=(0,O.useState)(kE);(0,O.useEffect)(()=>{let e=new MutationObserver(()=>C(kE()));return e.observe(document.body,{attributes:!0,attributeFilter:[`data-ds-dark-theme`]}),()=>e.disconnect()},[]),(0,O.useEffect)(()=>{if(!s.current||e.generation===void 0)return;let r={pluginId:e.pluginId,generation:e.generation,sessionId:t.sessionId,mountId:crypto.randomUUID()},i=!0;p.current=!1;let a=e=>{i&&g.current(e)},o,m=new Pn(s.current,r,async(n,a)=>{if(!i)throw Error(`Frame mount cancelled`);let s=a;if(n===`toolPresentation`&&t.kind===`tool`)return y(SE(a)),null;if(n===`resize`&&t.kind===`tool`)return x(CE(a)),null;if(n===`notify`){let e=wE(a);return st({tone:e.level,message:e.message}),null}if(n===`action`){if(typeof s?.action!=`string`)throw Error(`Invalid action`);return vx.action({sessionId:r.sessionId,pluginId:r.pluginId,generation:r.generation,...o.capability,action:s.action,input:s.input})}if(n===`downloadDrawing`&&[`editor`,`workspace`].includes(t.kind))return hE(a),null;if(n===`changed`)return o.changed(a);if(n===`abort`&&d.current.abort)return await d.current.abort(),null;if(n===`openPanel`){if(typeof s?.kind!=`string`||!e.contribution?.panels.includes(s.kind)||typeof s.contentId!=`string`)throw Error(`Undeclared panel`);return d.current.open(s.kind,s.contentId,typeof s.title==`string`?s.title:e.name),null}if(n===`sendMessage`&&typeof s?.text==`string`)return await d.current.sendMessage(s.text),null;throw Error(`Unsupported frame host method: ${n}`)});o=new yE(r,m,t,()=>d.current.reconnect(),a),c.current=m,l.current=o;let h=(async()=>{if(await o.start(),!i)throw Error(`Frame mount cancelled`);o.connecting(),await m.connect(t.kind===`controller`?e.controllerUrl:e.documentUrl,{...t,theme:kE(),hostUi:{toolCard:!0,autoResize:!0,notifications:!0}}),o.listen(),p.current=!0,DE(e.pluginId,f)})();u.current=h;let _=Fn.add({identity:r,ready:h,adapter:m,afterFlush:()=>o.flushed(),toolCallId:n?.call?.toolCallId,retire:()=>o.close()});return h.catch(a),()=>{i=!1,_(),c.current=null,l.current=null,h.catch(()=>{}).then(()=>o.close()).catch(e=>console.error(`Hosted view cleanup did not acknowledge edits`,e)).finally(()=>m.dispose())}},[e.pluginId,e.generation,e.documentUrl,e.controllerUrl,t.sessionId,t.kind,t.contentId,m]),(0,O.useEffect)(()=>{u.current.then(()=>{let e=c.current;return e?.call(`update`,{...t,...n??{},theme:S}).catch(t=>{c.current===e&&g.current(t)})},()=>{})},[n,t.locale,S,t.visible,t.title]);let w=(0,z.jsx)(`div`,{"data-hosted-plugin":e.pluginId,style:{height:t.kind===`controller`||t.kind===`tool`?`auto`:`100%`,minHeight:0},children:(0,z.jsx)(`iframe`,{hidden:t.kind===`controller`,ref:s,title:`${e.name} ${t.kind}`,style:{display:t.kind===`controller`?`none`:`block`,width:`100%`,height:t.kind===`tool`?b:`100%`,border:0}})});return t.kind===`tool`?(0,z.jsx)(xE,{title:v?.title,tool:n,locale:t.locale,children:w}):w}var kE=()=>document.body.hasAttribute(`data-ds-dark-theme`)?`dark`:`light`;function AE(e,t,n){let r=e.contribution,i=t=>`hosted:${e.pluginId}:${t}`;return{id:e.pluginId,instanceId:`${e.pluginId}/${e.generation}`,definition:{id:e.pluginId,apiVersion:1,activate(){},artifactTools:r.artifactTools,workbench:{apiVersion:1,entry:{...r.entry,kind:i(r.entry.kind),icon:t=>(0,z.jsx)(Sx,{card:e,...t})},panels:r.panels.map(a=>({kind:i(a),component:o=>(0,z.jsx)(OE,{card:e,reconnect:t,abort:()=>n.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:a===r.entry.kind?`workspace`:`editor`,sessionId:o.session.sessionId,contentId:o.contentId,title:o.title,visible:o.visible,locale:o.locale,theme:kE()},open:(e,t,n)=>o.open(i(e),t,n),sendMessage:o.sendMessage})})),toolViews:r.toolViews.length?[{tools:r.toolViews,component:i=>i.session?(0,z.jsx)(OE,{card:e,reconnect:t,abort:()=>n.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`tool`,sessionId:i.session.sessionId,locale:i.locale,theme:kE()},update:{call:i.call,result:i.result,running:i.running},open:(e,t)=>i.openPanel(`${r.panelAlias.prefix}${t}`),sendMessage:i.sendMessage},Fn.incarnation(i.session.sessionId,i.call.toolCallId)):null}]:[],resolvePanel:e=>e.startsWith(r.panelAlias.prefix)?{kind:i(r.panelAlias.kind),contentId:e.slice(r.panelAlias.prefix.length),title:r.panelAlias.title}:null}}}}function jE(e,t,n,r,i){let a=_E({sessionId:t,locale:i,openRecovered:e=>r.current.openPanel?.(`diagram:${e}`)}),[o,s]=(0,O.useState)([]),[c,l]=(0,O.useState)([]),[u,d]=(0,O.useState)([]),[f,p]=(0,O.useState)(0),[m,h]=(0,O.useState)(``),g=(0,O.useMemo)(()=>()=>p(e=>e+1),[]);(0,O.useEffect)(()=>{if(!e||!t){s([]);return}let n=!0,r=new AbortController;return window.addEventListener(`pi:hosted-catalog-changed`,g),vx.catalog(r.signal).then(e=>{n&&(s(t=>OT(e.plugins,t)),l(e.approvals??[]),e.offline||d(e.plugins.filter(e=>!e.installed||!e.enabled).map(e=>e.pluginId)),h(``))}).catch(()=>{}),()=>{n=!1,r.abort(),window.removeEventListener(`pi:hosted-catalog-changed`,g)}},[e,t,n,f]);let _=(0,O.useRef)(new WeakMap),v=(0,O.useMemo)(()=>o.map(e=>{let t=_.current.get(e);return t||(t=AE(e,g,r),_.current.set(e,t)),t}),[o,g,r]),y=e&&t?o.map(e=>(0,z.jsx)(OE,{card:e,reconnect:g,abort:()=>r.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`controller`,sessionId:t,locale:i,theme:kE()},open:(t,n)=>r.current.openPanel?.(`${e.contribution.panelAlias.prefix}${n}`),sendMessage:async e=>{if(!r.current.sendMessage)throw Error(`Composer unavailable`);await r.current.sendMessage(e)}},`${t}/${e.pluginId}/${e.generation}`)):null,b=(0,O.useCallback)((e,t)=>{vx.decide(e,t).then(e=>l(e.approvals??[])).catch(e=>h(String(e)))},[]);return{plugins:e?v:[],inactivePlugins:u,recovery:a,controllers:y,error:m,approvals:c,decide:b}}var ME={zh:{title:`插件请求执行权限`,body:(e,t)=>`${e} 想让后台会话「${t}」获得写入与命令权限(此前只读)。`,allow:`允许`,deny:`拒绝`},en:{title:`A plugin requests permission to execute`,body:(e,t)=>`${e} wants background session "${t}" to gain write and command access (read-only until now).`,allow:`Allow`,deny:`Deny`}};function NE({approvals:e,locale:t,decide:n}){let r=ME[t];return e.length?(0,z.jsxs)(`section`,{role:`alertdialog`,"aria-label":r.title,style:{position:`fixed`,right:16,bottom:16,zIndex:1e3,maxWidth:420,padding:12,borderRadius:8,background:`var(--pi-surface, #fff)`,color:`var(--pi-text, #111)`,border:`1px solid var(--pi-border, #888)`,boxShadow:`0 4px 16px rgba(0,0,0,.25)`},children:[(0,z.jsx)(`strong`,{children:r.title}),e.map(e=>(0,z.jsxs)(`div`,{style:{marginTop:8},children:[(0,z.jsx)(`p`,{style:{margin:`0 0 6px`},children:r.body(e.pluginId,e.title)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`allow`),children:r.allow}),` `,(0,z.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`deny`),children:r.deny})]},e.id))]}):null}var PE=`@chengzhiyi/pi-excalidraw`,FE=[`excalidraw_create_view`,`diagram_create`,`diagram_patch`];function IE(e){let t=({locale:t})=>(0,z.jsxs)(`section`,{role:`status`,className:gE.history,children:[(0,z.jsx)(`h3`,{children:`Excalidraw`}),(0,z.jsx)(`p`,{children:t===`zh`?`Excalidraw 编辑器当前不可用。请在插件管理中检查安装、启用状态及运行时诊断。未从历史工具参数重建图稿;原检查点、工作区文件和浏览器备份均保留。`:`The Excalidraw editor is currently unavailable. Check installation, enablement and runtime diagnostics in plugin management. Historical tool arguments are not the latest scene. Checkpoints, workspace files and browser backups are preserved.`}),(0,z.jsx)(qy,{variant:`outline`,onClick:e,children:t===`zh`?`打开插件管理`:`Open plugin management`})]});return{id:PE,instanceId:`drawing-recovery`,definition:{id:PE,apiVersion:1,activate(){},artifactTools:FE,workbench:{apiVersion:1,panels:[{kind:`drawing-recovery`,component:t}],toolViews:[{tools:FE,component:t}],resolvePanel:e=>/^diagram:[\w-]{1,80}$/.test(e)?{kind:`drawing-recovery`,contentId:e.slice(8),title:`Excalidraw`}:null}}}}function LE(){let e=te(),t={"session.new.label":R(`新会话`,`New session`),"session.new":R(`新会话`,`New session`),"toggle.open":R(`展开侧栏`,`Expand sidebar`),"toggle.collapse":R(`收起侧栏`,`Collapse sidebar`),"sidebar.label":R(`对话管理`,`Conversation navigation`),"sidebar.close":R(`关闭侧栏`,`Close sidebar`),"panels.label":R(`面板`,`Panels`),"rightbar.drag.focus":R(`继续拖动以专注工作区`,`Keep dragging to focus workspace`),"rightbar.drag.collapse":R(`继续拖动以收起工作区面板`,`Keep dragging to collapse workspace panel`),"brand.localBuild":`pi-webapp`},n=$x(),[r,i]=(0,O.useState)(()=>new URL(location.href).searchParams.get(`subagent`)),a=n.workspaces.sessions.find(e=>e.id===r&&e.subagent),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(0);(0,O.useEffect)(()=>{if(!a||n.connection!==`connected`)return;let e=new AbortController;return l(null),Qx(a.workspaceId,a.id,e.signal).then(t=>{e.signal.aborted||s({id:a.id,messages:t})}).catch(()=>{e.signal.aborted||l(a.id)}),()=>e.abort()},[a?.id,a?.workspaceId,a?.modified,a?.subagent?.status,u,n.connection]);let f=e=>{i(e);let t=new URL(location.href);e?t.searchParams.set(`subagent`,e):t.searchParams.delete(`subagent`),t.href!==location.href&&window.history.replaceState(window.history.state,``,t)},p=(0,O.useRef)(n.session?.sessionId);p.current=n.session?.sessionId;let[m,h]=(0,O.useState)(``);(0,O.useEffect)(()=>h(``),[n.session?.sessionId]);let{plugins:g,errors:_}=yT(n.connection===`connected`,n.session?.sessionId,n.plugins,n.pluginGeneration),v=(0,O.useRef)({}),y=jE(n.connection===`connected`,n.session?.sessionId,n.pluginGeneration,v,e);dt(`hosted-runtime`,y.error),dt(`plugin-load`,_.length?`${R(`插件加载失败`,`Plugin load failed`)}: ${_.length}`:null,_.join(`
|
|
52
|
+
`),R(`诊断信息`,`Diagnostics`));let[b,x]=(0,O.useState)(!1),[S,C]=(0,O.useState)(!1),w=(0,O.useMemo)(()=>IE(()=>C(!0)),[]),T=[...g,...y.plugins.filter(e=>!g.some(t=>t.id===e.id||t.definition.artifactTools?.some(t=>e.definition.artifactTools?.includes(t))))],E=T.some(e=>e.id===`@chengzhiyi/pi-excalidraw`)?T:[...T,w],D=(0,O.useMemo)(()=>[...n.disabledPlugins,...y.inactivePlugins],[n.disabledPlugins,y.inactivePlugins]),k=TT(n.session?.sessionId,D),A=k.panelId,j=n.connection===`connected`&&n.session!==null&&n.modelsStatus===`ready`&&n.models.length===0;(0,O.useEffect)(()=>{j&&x(!0)},[j]);let ee=(0,O.useCallback)(()=>{x(!1),requestAnimationFrame(()=>document.querySelector(`[aria-haspopup="dialog"].pi-settings-sidebar`)?.focus())},[]),[M,N]=(0,O.useState)(()=>({sidebar:280,viewportWidth:window.innerWidth,narrowExpanded:!1,rightbar:null,rightbarShown:!1,rightbarTrack:!1,rightbarFullscreen:!1,rightbarFocus:!1,rightbarInstant:!1})),P=(0,O.useRef)(280),F=(0,O.useRef)(!1),[I,L]=(0,O.useState)(!1),ne=(0,O.useCallback)(()=>N(e=>({...e,narrowExpanded:!1})),[]),re=async(e,t=null)=>{if(!F.current){F.current=!0,L(!0);try{n.session?.sessionId&&await Fn.flush(n.session.sessionId),await e(),f(t),C(!1),ne()}catch(e){throw h(e instanceof Error?e.message:String(e)),e}finally{F.current=!1,L(!1)}}},B=(e,t,r)=>n.workspaces.sessions.find(n=>n.id===t&&n.workspaceId===e)?.subagent?re(async()=>{},t):re(()=>n.selectSession(e,t,r)),ae=n.workspaces.sessions.find(e=>e.id===a?.subagent?.parentSessionId),se=e=>{!e||e.id===n.session?.sessionId?f(null):B(e.workspaceId,e.id,e.path).catch(()=>{})},ce=(0,O.useMemo)(()=>({closeSidebar:ne,setViewportWidth(e){N(t=>t.viewportWidth===e?t:{...t,viewportWidth:e,narrowExpanded:t.viewportWidth<1024==e<1024&&t.narrowExpanded})},setSidebar(e){P.current=Math.min(420,Math.max(264,Math.round(e))),N(e=>({...e,sidebar:P.current}))},setRightbar(e){N(t=>({...t,rightbar:oe(e,300,t.viewportWidth*ie)}))},focusRightbar(){N(e=>({...e,rightbarFocus:!0}))},collapseRightbar(){N(e=>({...e,rightbarFocus:!1})),k.controller.setExpanded(!1)}}),[ne,k.controller]),le=e=>{let t=E.flatMap(t=>{let n=t.definition.workbench?.resolvePanel?.(e);return n?[{...n,pluginId:t.id}]:[]})[0];t?k.openContent(t.kind,t.contentId,t.title,void 0,t.pluginId):k.controller.openContent({kind:`plugin`,contentId:e,title:R(`预览`,`Preview`)}),k.controller.setExpanded(!0),C(!1),N(e=>({...e,narrowExpanded:!1}))},V=()=>k.controller.setExpanded(!1),ue=(0,O.useCallback)(e=>{if(!n.session||n.disabledPlugins.includes(fx.files))return;let t=bt(n.session.cwd,e);k.openContent(`file-preview`,t,t.split(`/`).at(-1),void 0,fx.files),N(e=>({...e,narrowExpanded:!1}))},[n.session?.cwd,n.disabledPlugins,k.openContent]);(0,O.useEffect)(()=>{let e=M.viewportWidth<767||k.snapshot.state.mode===`fullscreen`,t=k.shown&&!S&&!a;N(n=>({...n,rightbarShown:t,rightbarTrack:t,rightbarFullscreen:e,rightbarFocus:n.rightbarFocus&&t&&!e}))},[k.shown,k.snapshot.state.mode,M.viewportWidth,S,!!a]),(0,O.useEffect)(()=>{N(e=>e.rightbarFocus?{...e,rightbarFocus:!1}:e)},[n.session?.sessionId]),(0,O.useEffect)(()=>{Dt()},[]);let[de,fe]=(0,O.useState)(null),[pe,he]=(0,O.useState)(null),_e=M.rightbarShown&&(M.rightbarFocus||M.rightbarFullscreen)&&!S&&!a&&!b&&n.session!==null;(0,O.useLayoutEffect)(()=>{he(_e?document.querySelector(`[data-sidebar-right-session]`):null)},[_e,n.session?.sessionId]);let ve=aS(k.snapshot.state,k.snapshot.state.activePaneId).activeTabId,ye=ve?sS(k.snapshot.state,ve):void 0,be=(0,O.useMemo)(()=>{if(!ye||ye.kind===`guide`||!ye.title)return null;let e=k.owners.get(ye.id),t=k.contexts.get(ye.id);return{title:ye.title,kind:ye.kind,contentId:ye.contentId,...e?{plugin:e}:{},...t}},[ye,k.owners,k.contexts,k.contextVersion]),xe=(0,O.useCallback)(()=>{M.viewportWidth<767?k.controller.setExpanded(!1):(N(e=>({...e,rightbarFocus:!1})),k.controller.getSnapshot().state.mode===`fullscreen`&&k.controller.setMode(`push`))},[M.viewportWidth,k.controller]),Se=_e&&de&&pe?{host:de,panel:pe,context:be,onShowConversation:xe}:null,Ce=kt(),Ee=(0,O.useCallback)((e,t)=>(0,z.jsx)(At,{text:e,pathImages:t,labels:Ce}),[Ce]),De=async(...e)=>{let t=n.session?.sessionId;h(``);try{if(t){await Fn.flush(t);for(let e of E)await e.definition.workbench?.beforeSend?.(t)}if(t!==p.current)throw Error(R(`会话已切换,请在原会话重试`,`Session changed. Retry in the original conversation.`))}catch(e){throw h(e instanceof Error?e.message:String(e)),e}return n.send(...e)},Oe={session:n.session,locale:e,openPanel:le,closePanel:V,panelId:A,invokePluginAction:n.invokePluginAction,resolvePluginInteraction:n.resolvePluginInteraction,sendMessage:e=>De(e,[]),renderMarkdown:Ee};v.current={openPanel:le,sendMessage:Oe.sendMessage,abort:n.stop};let ke=(e,t)=>(0,z.jsx)(wT,{plugins:E,slot:e,props:{...Oe,turn:t}}),Ae=()=>N(e=>e.viewportWidth<1024?{...e,narrowExpanded:!e.narrowExpanded}:{...e,sidebar:e.sidebar===0?P.current:0}),je=e=>e({layoutInfo:M}),Me=e=>e({activePanelId:S?`plugins`:null}),Ne=e=>e([{id:`plugins`,label:R(`插件`,`Plugins`)}]),Pe=(e,t,r)=>e===`sidebar.brand.mark`?(0,z.jsx)(ge,{size:24}):e===`sidebar.brand.name`?(0,z.jsx)(`span`,{children:`pi-webapp`}):e===`sidebar.footer.action`?(0,z.jsx)(Ax,{wide:t.wide,hideError:b,getUpdate:n.getUpdate,getRunningVersion:n.getRunningVersion,setUpdateChannel:n.setUpdateChannel,cancelUpdate:n.cancelUpdate,update:n.update}):e===`sidebar.panellist`?(0,z.jsx)(Tv,{size:t.size}):e===`sidebar.settings`?(0,z.jsxs)(`div`,{className:`pi-settings-trigger-row pi-settings-trigger-split ${t.wide?``:`pi-settings-trigger-rail`}`,children:[!t.wide&&(0,z.jsx)(Px,{wide:!1}),(0,z.jsxs)(`button`,{className:`pi-settings-sidebar`,"data-wide":t.wide,type:`button`,"aria-label":R(`Pi 设置`,`Pi Settings`),"aria-haspopup":`dialog`,"aria-expanded":b,onClick:()=>x(!0),children:[t.wide?(0,z.jsx)(Te,{size:16}):(0,z.jsx)(we,{size:18}),t.wide&&(0,z.jsx)(`span`,{children:R(`Pi 设置`,`Pi Settings`)})]}),t.wide&&(0,z.jsx)(Px,{wide:!0})]}):e===`sidebar.workspaces`?(0,z.jsx)(_b,{wide:t.wide,expandSidebar:t.expandSidebar,session:n.session,selectedSubagentId:a?.id??null,workspaces:n.workspaces,navigationBusy:I,connected:n.connection===`connected`&&n.session!==null,onAdd:(e,t)=>re(()=>n.addWorkspace(e,t)),directoryPickerKind:n.directoryPickerKind,pickDirectory:n.pickDirectory,listDirectory:n.listDirectory,createDirectory:n.createDirectory,onRemove:e=>re(()=>n.removeWorkspace(e)),onSelectSession:B,onNewSession:e=>re(()=>n.newSessionInWorkspace(e)),onRenameSession:(e,t,r,i)=>n.renameSession(e,t,r,i),onDeleteSession:(e,t,r)=>re(()=>n.deleteSession(e,t,r))}):r?.fallback??null;return(0,z.jsxs)(Jb,{actions:n,children:[y.controllers,(0,z.jsx)(mt,{closeLabel:R(`关闭`,`Dismiss`),detailLabel:R(`诊断信息`,`Diagnostics`)}),(0,z.jsx)(NE,{approvals:y.approvals,locale:e,decide:y.decide}),(0,z.jsx)(`div`,{ref:fe,"data-floating-host":``,style:{position:`fixed`,inset:0,zIndex:50,pointerEvents:`none`}}),(0,z.jsx)(me,{useStore:je,usePanelInfo:Me,actions:ce,renderSlot:(r,i)=>r===`sidebar`?(0,z.jsx)(yt,{collapsed:i.collapsed,width:i.width,startSession:()=>{re(n.newSession).catch(()=>{})},sessionBusy:I||n.connection!==`connected`||n.session===null,toggleSidebar:Ae,selectPanel:()=>{C(!0),ne()},usePanels:Ne,usePanelInfo:Me,t:e=>t[e]??e,renderSlot:Pe}):r===`main`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{hidden:S||!!a,style:{height:`100%`},children:(0,z.jsx)(tS,{openFile:ue,children:(0,z.jsx)(Gy,{floating:Se,rightbarControl:(0,z.jsx)(DT,{panel:k,locale:e}),session:n.session,streaming:n.streaming,connection:n.connection,error:m||n.error,onDismissError:()=>{h(``),n.clearError()},onSend:De,onUpdateQueuedPrompt:n.updateQueuedPrompt,onLoadImage:n.loadMessageImage,onUpload:n.upload,onDiscardAttachment:n.discardAttachment,onStop:n.stop,onResume:n.resume,onCompact:n.compact,onNewSession:()=>re(n.newSession),commands:n.commands,models:n.models,modelsStatus:n.modelsStatus,onConfigureModels:()=>x(!0),onSetModel:n.setModel,onSetThinkingLevel:n.setThinkingLevel,composerInteraction:n.session?.interactions?.some(e=>E.some(t=>t.id===e.pluginId&&t.definition.interactions?.some(t=>t.kind===e.kind)))?(0,z.jsx)(ST,{plugins:E,props:Oe}):void 0,renderToolView:(e,t,n)=>(0,z.jsx)(CT,{plugins:E,props:Oe,call:e,result:t,running:n}),renderPluginSlot:ke,renderCallAction:e=>n.workspaces.sessions.filter(t=>t.subagent?.parentSessionId===n.session?.sessionId&&t.subagent?.dispatchCallId===e).map(e=>(0,z.jsxs)(`button`,{type:`button`,disabled:I,className:`pi-subagent-back`,onClick:()=>{B(e.workspaceId,e.id,e.path).catch(()=>{})},children:[R(`查看子任务`,`View subtask`),` · `,Py(e)]},e.id)),plugins:E,onPluginAction:n.invokePluginAction})})}),a&&!S&&(0,z.jsx)(Hy,{row:a,parent:ae,cwd:n.workspaces.items.find(e=>e.id===a.workspaceId)?.path??``,messages:o?.id===a.id?o.messages:null,error:c===a.id,retry:()=>d(e=>e+1),onBack:()=>se(ae)},a.id),S&&(0,z.jsx)(Ox,{recovery:y.recovery,getPluginManagement:n.getPluginManagement,togglePlugin:n.togglePlugin,generation:n.pluginGeneration})]}):r===`rightbar`&&Object.keys(k.snapshot.state.tabs).length>0?(0,z.jsx)(`div`,{hidden:S||!!a,style:{height:`100%`},children:(0,z.jsx)(ET,{panel:k,cwd:n.session?.cwd,width:i.width,narrow:M.viewportWidth<767,focus:M.rightbarFocus,onExitFocus:()=>N(e=>({...e,rightbarFocus:!1})),plugins:E,props:Oe},n.session?.sessionId)}):null,t:e=>t[e]??e}),b&&(0,z.jsx)(dx,{onBack:ee,setupMode:j,getConfig:n.getConfig,updateConfig:n.updateConfig,getUpdate:n.getUpdate,getRunningVersion:n.getRunningVersion,setUpdateChannel:n.setUpdateChannel,cancelUpdate:n.cancelUpdate,update:n.update,getProviders:n.getProviders,getProviderModels:n.getProviderModels,updateProviderModel:n.updateProviderModel,logoutProvider:n.logoutProvider,addCustomProvider:n.addCustomProvider,startProviderLogin:n.startProviderLogin,getProviderLogin:n.getProviderLogin,getActiveProviderLogin:n.getActiveProviderLogin,respondProviderLogin:n.respondProviderLogin,cancelProviderLogin:n.cancelProviderLogin,refreshModels:n.refreshModels})]})}var RE=new WeakMap,zE=900;function BE(){document.addEventListener(`scroll`,e=>{let t=e.target===document?document.documentElement:e.target;t instanceof Element&&(t.setAttribute(`data-scrolling`,``),window.clearTimeout(RE.get(t)),RE.set(t,window.setTimeout(()=>t.removeAttribute(`data-scrolling`),zE)))},{capture:!0,passive:!0})}var VE=e({});Nb(),F(),BE();var HE=document.getElementById(`root`);if(!HE)throw Error(`Missing #root`);(0,k.createRoot)(HE).render((0,z.jsx)(ne,{children:(0,z.jsx)(LE,{})}));export{D_ as A,R as B,O_ as C,M_ as D,A_ as E,x_ as F,cr as I,fn as L,kv as M,S_ as N,Q_ as O,C_ as P,Ue as R,X_ as S,Dv as T,te as V,B_ as _,nT as a,K_ as b,gx as c,Ty as d,wy as f,R_ as g,P_ as h,oT as i,ov as j,nv as k,fx as l,I_ as m,pT as n,nS as o,w_ as p,fT as r,hx as s,VE as t,Ub as u,H_ as v,fv as w,mv as x,W_ as y,He as z};
|
|
53
|
+
//# debugId=778559b6-dc1a-49e7-8cd7-b63baf223622
|