pi-webapp 0.1.52-alpha.2 → 0.1.52-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extension.js +27 -27
- package/dist/hosted-recovery.js +2 -2
- package/dist/hosted-worker.js +2 -2
- package/package.json +2 -2
- package/web/dist/.vite/manifest.json +4 -4
- package/web/dist/assets/{app-tKAlvGnx.js → app-BRLRVji5.js} +7 -7
- package/web/dist/assets/app.css +1 -1
- package/web/dist/assets/app.js +4 -4
- package/web/dist/assets/{plugin-DJaiYPEQ.js → plugin-CiZqbXIv.js} +2 -2
- package/web/dist/assets/{plugin-DObSoug1.js → plugin-Ck_3M7GH.js} +2 -2
- package/web/dist/assets/{plugin-3Ib-WXMi.js → plugin-CpMftYuc.js} +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ruby-CGfRnGY4.js","assets/html-Dkdzkf5m.js","assets/dist-DvRDAAjZ.js","assets/app.js","assets/javascript-qRALF4mN.js","assets/css-COynAVCS.js","assets/xml-Dg-qt816.js","assets/java-C0tX6Zjj.js","assets/sql-BJwLzEN3.js","assets/graphql-BUOosdAq.js","assets/typescript-dAcDzF3q.js","assets/cpp-M92QQ27h.js","assets/c-D2xwndn2.js","assets/shellscript-DugvE863.js","assets/lua-2gStHmQ-.js","assets/yaml-BOAQTz6b.js","assets/php-B4BGKN5F.js","assets/json-Hfsf52vC.js","assets/scss-DOxJ7xu_.js","assets/http-iVoGgZyc.js","assets/rst-DEFIrwXa.js","assets/html-derivative-B-zMOKjI.js","assets/python-_UfA4Rpn.js","assets/cmake-Cf85PuIk.js","assets/latex--YAwAQ5f.js","assets/r-vFiqf_wZ.js","assets/julia-CTkez5_b.js","assets/erlang-9UB0pWNm.js","assets/markdown-BR5vuK2p.js","assets/elixir-DIe8-kxb.js","assets/fsharp-CkcEwvkw.js","assets/perl-C6cfY4X6.js","assets/vue-b-L2NQfY.js","assets/svelte-Cnhqc3fy.js","assets/plugin-
|
|
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]=`f29d5f22-e983-413a-881a-de36830ac37f`,e._sentryDebugIdIdentifier=`sentry-dbid-f29d5f22-e983-413a-881a-de36830ac37f`)}catch{}})();import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,u as h,v as g}from"./dist-DvRDAAjZ.js";import{A as _,C as v,D as y,E as b,M as x,O as S,S as C,T as w,_ as T,a as E,b as D,c as O,d as k,f as ee,g as te,h as ne,i as A,j as re,k as ie,l as j,m as ae,n as oe,o as M,p as se,r as ce,s as le,t as ue,u as de,v as fe,w as pe,y as me}from"./WorkspacePanel.module-7fbly3iv.js";import{a as N,i as he,o as ge,r as _e,s as ve,t as ye}from"./app.js";import{t as be}from"./typescript-dAcDzF3q.js";import{t as xe}from"./shellscript-DugvE863.js";import{t as Se}from"./json-Hfsf52vC.js";var Ce=a((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&&te(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&&te(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,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(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}}}})),we=a(((e,t)=>{t.exports=Ce()})),Te=a((e=>{var t=we(),n=o(),r=x();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(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 c(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 l(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 u(e){if(s(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===r)return u(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(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)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function S(e,t,n){return e===n||e===t&&(y=e,!0)}function C(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=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 T(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 E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),A=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case j:return`Suspense`;case ae:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case re:return e.displayName||`Context`;case A:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case M:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var he=Array.isArray,ge=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function Se(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Ce(e,t){be++,ye[be]=e.current,e.current=t}var Te=xe(null),Ee=xe(null),P=xe(null),De=xe(null);function F(e,t){switch(Ce(P,t),Ce(Ee,e),Ce(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Op(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Se(Te),Ce(Te,e)}function Oe(){Se(Te),Se(Ee),Se(P)}function ke(e){var t=e.memoizedState;t!==null&&(Ch._currentValue=t.memoizedState,Ce(De,e)),t=Te.current;var n=Op(t,e.type);t!==n&&(Ce(Ee,e),Ce(Te,n))}function Ae(e){Ee.current===e&&(Se(Te),Se(Ee)),De.current===e&&(Se(De),Ch._currentValue=ve)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ruby-CGfRnGY4.js","assets/html-Dkdzkf5m.js","assets/dist-DvRDAAjZ.js","assets/app.js","assets/javascript-qRALF4mN.js","assets/css-COynAVCS.js","assets/xml-Dg-qt816.js","assets/java-C0tX6Zjj.js","assets/sql-BJwLzEN3.js","assets/graphql-BUOosdAq.js","assets/typescript-dAcDzF3q.js","assets/cpp-M92QQ27h.js","assets/c-D2xwndn2.js","assets/shellscript-DugvE863.js","assets/lua-2gStHmQ-.js","assets/yaml-BOAQTz6b.js","assets/php-B4BGKN5F.js","assets/json-Hfsf52vC.js","assets/scss-DOxJ7xu_.js","assets/http-iVoGgZyc.js","assets/rst-DEFIrwXa.js","assets/html-derivative-B-zMOKjI.js","assets/python-_UfA4Rpn.js","assets/cmake-Cf85PuIk.js","assets/latex--YAwAQ5f.js","assets/r-vFiqf_wZ.js","assets/julia-CTkez5_b.js","assets/erlang-9UB0pWNm.js","assets/markdown-BR5vuK2p.js","assets/elixir-DIe8-kxb.js","assets/fsharp-CkcEwvkw.js","assets/perl-C6cfY4X6.js","assets/vue-b-L2NQfY.js","assets/svelte-Cnhqc3fy.js","assets/plugin-CiZqbXIv.js","assets/WorkspacePanel.module-7fbly3iv.js","assets/WorkspacePanel.css","assets/plugin-Ck_3M7GH.js","assets/plugin2.css","assets/plugin-CpMftYuc.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]=`0ad314d6-7ae9-49b6-b433-85dbaf0146ab`,e._sentryDebugIdIdentifier=`sentry-dbid-0ad314d6-7ae9-49b6-b433-85dbaf0146ab`)}catch{}})();import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,u as h,v as g}from"./dist-DvRDAAjZ.js";import{A as _,C as v,D as y,E as b,M as x,O as S,S as C,T as w,_ as T,a as E,b as D,c as O,d as k,f as ee,g as te,h as ne,i as A,j as re,k as ie,l as j,m as ae,n as oe,o as M,p as se,r as ce,s as le,t as ue,u as de,v as fe,w as pe,y as me}from"./WorkspacePanel.module-7fbly3iv.js";import{a as N,i as he,o as ge,r as _e,s as ve,t as ye}from"./app.js";import{t as be}from"./typescript-dAcDzF3q.js";import{t as xe}from"./shellscript-DugvE863.js";import{t as Se}from"./json-Hfsf52vC.js";var Ce=a((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&&te(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&&te(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,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(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}}}})),we=a(((e,t)=>{t.exports=Ce()})),Te=a((e=>{var t=we(),n=o(),r=x();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(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 c(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 l(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 u(e){if(s(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===r)return u(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(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)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function S(e,t,n){return e===n||e===t&&(y=e,!0)}function C(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=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 T(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 E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),A=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case j:return`Suspense`;case ae:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case re:return e.displayName||`Context`;case A:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case M:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var he=Array.isArray,ge=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function Se(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Ce(e,t){be++,ye[be]=e.current,e.current=t}var Te=xe(null),Ee=xe(null),P=xe(null),De=xe(null);function F(e,t){switch(Ce(P,t),Ce(Ee,e),Ce(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Op(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Se(Te),Ce(Te,e)}function Oe(){Se(Te),Se(Ee),Se(P)}function ke(e){var t=e.memoizedState;t!==null&&(Ch._currentValue=t.memoizedState,Ce(De,e)),t=Te.current;var n=Op(t,e.type);t!==n&&(Ce(Ee,e),Ce(Te,n))}function Ae(e){Ee.current===e&&(Se(Te),Se(Ee)),De.current===e&&(Se(De),Ch._currentValue=ve)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!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
5
|
`),l=s.split(`
|
|
@@ -7,7 +7,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ruby-CGfRnGY4.j
|
|
|
7
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{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=_e.p;return e===0?(e=window.event,e===void 0?32:zh(e.type)):e}function Ct(e,t){var n=_e.p;try{return _e.p=e,t()}finally{_e.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Om(e);e!==null;){if(n=e[Tt])return n;e=Om(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=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]*$`),Kt={},qt={};function Jt(e){return Re.call(qt,e)?!0:Re.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(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 Qt(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 $t(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 en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(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 rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(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=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(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=``+en(s):e.removeAttribute(`name`)}function ln(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)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(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),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(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=``+en(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 fn(e,t,n){t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=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 gn(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||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(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 yn=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`]]),bn=/^[\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 I(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(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="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));cn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&($d(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return E(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=E({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=E({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(E({},Jn,{dataTransfer:0})),Zn=Bn(E({},Un,{relatedTarget:0})),Qn=Bn(E({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(E({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(E({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(E({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(E({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(E({},Vn,{submitter:0})),lr=Bn(E({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(E({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(E({},Jn,{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})),fr=Bn(E({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=up(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){np(e,0)}function jr(e){if(an(Lt(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(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(!Re.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(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 qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(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=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Zr(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 Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(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}),ti&&Gr(ti,r)||(ti=r,r=up(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`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(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),Ut(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Pd.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Hd;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 Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=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)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[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&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<Ud)throw Ud=0,Wd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(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 Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(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 Ri(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 zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=lh(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Fi(31,n,t,a),e.elementType=se,e.lanes=o,e;case ee:return Bi(n.children,a,o,t);case te:s=8,a|=24;break;case ne:return e=Fi(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case j:return e=Fi(13,n,t,a),e.elementType=j,e.lanes=o,e;case ae:return e=Fi(19,n,t,a),e.elementType=ae,e.lanes=o,e;case ce:case ue:return e=a|32,e=Fi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:s=10;break a;case A:s=9;break a;case ie:s=11;break a;case oe:s=14;break a;case M:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-tt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,ca=!1,la=null,ua=!1,da=Error(i(519));function fa(e){throw va(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),da}function pa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:rp(`cancel`,t),rp(`close`,t);break;case`iframe`:case`object`:case`embed`:rp(`load`,t);break;case`video`:case`audio`:for(n=0;n<ep.length;n++)rp(ep[n],t);break;case`source`:rp(`error`,t);break;case`img`:case`image`:case`link`:rp(`error`,t),rp(`load`,t);break;case`details`:rp(`toggle`,t);break;case`input`:rp(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:rp(`invalid`,t);break;case`textarea`:rp(`invalid`,t),pn(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||gp(t.textContent,n)?(r.popover!=null&&(rp(`beforetoggle`,t),rp(`toggle`,t)),r.onScroll!=null&&rp(`scroll`,t),r.onScrollEnd!=null&&rp(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||fa(e,!0)}function ma(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:oa=oa.return}}function ha(e){if(e!==oa)return!1;if(!ca)return ma(e),ca=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ap(e.type,e.memoizedProps)),n=!n),n&&sa&&fa(e),ma(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Dm(e)}else t===27?(t=sa,zp(e.type)?(e=Em,Em=null,sa=e):sa=t):sa=oa?Tm(e.stateNode.nextSibling):null;return!0}function ga(){sa=oa=null,ca=!1}function _a(){var e=la;return e!==null&&(Ed===null?Ed=e:Ed.push.apply(Ed,e),la=null),e}function va(e){la===null?la=[e]:la.push(e)}var ya=xe(null),ba=null,xa=null;function Sa(e,t,n){Ce(ya,t._currentValue),t._currentValue=n}function Ca(e){e._currentValue=ya.current,Se(ya)}function wa(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 Ta(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),wa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),wa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),wa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ea(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Ch]:e.push(Ch))}a=a.return}return e!==null&&Ta(t,e,n,r),t.flags|=262144,e!==null}function Da(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Oa(e){ba=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ka(e){return ja(ba,e)}function Aa(e,t){return ba===null&&Oa(e),ja(e,t)}function ja(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xa===null){if(e===null)throw Error(i(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return n}var Ma=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()})}},Na=t.unstable_scheduleCallback,Pa=t.unstable_NormalPriority,Fa={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ia(){return{controller:new Ma,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&Na(Pa,function(){e.controller.abort()})}function Ra(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 za=null;function Ba(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Va=null,Ha=0,Ua=0,Wa=null;function Ga(e,t){if(Va===null){var n=Va=[];Ha=0,Ua=Yf(),Wa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ha++,t.then(Ka,Ka),t}function Ka(){if(--Ha===0&&(za=null,Va!==null)){Wa!==null&&(Wa.status=`fulfilled`);var e=Va;Va=null,Ua=0,Wa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qa(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 Ja=ge.S;ge.S=function(e,t){if(kd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Ga(e,t),za!==null)for(var n=Ff;n!==null;)Ra(n,za),n=n.next;if(n=e.types,n!==null){for(var r=Ff;r!==null;)Ra(r,n),r=r.next;if(Ua!==0){r=za,r===null&&(r=za=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ja!==null&&Ja(e,t)};var Ya=xe(null);function Xa(){var e=Ya.current;return e===null?ud.pooledCache:e}function Za(e,t){t===null?Ce(Ya,Ya.current):Ce(Ya,t.pool)}function Qa(){var e=Xa();return e===null?null:{parent:Fa._currentValue,pool:e}}var $a=Error(i(460)),eo=Error(i(474)),to=Error(i(542)),no={then:function(){}};function ro(e){return e=e.status,e===`fulfilled`||e===`rejected`}function io(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,co(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=ud,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,co(e),e}throw oo=t,$a}}function ao(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(oo=e,$a):e}}var oo=null;function so(){if(oo===null)throw Error(i(459));var e=oo;return oo=null,e}function co(e){if(e===$a||e===to)throw Error(i(483))}var lo=null,uo=0;function fo(e){var t=uo;return uo+=1,lo===null&&(lo=[]),io(lo,e,t)}function po(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function mo(e,t){throw t.$$typeof===D?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ho(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===ee?(e=d(e,t,n.props.children,r,n.key),po(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===M&&ao(i)===t.type)?(t=a(t,n.props),po(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),po(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=Ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=zi(t.type,t.key,t.props,null,e.mode,n),po(n,t),n.return=e,n;case k:return t=Ui(t,e.mode,n),t.return=e,t;case M:return t=ao(t),f(e,t,n)}if(he(t)||pe(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,fo(t),n);if(t.$$typeof===re)return f(e,Aa(e,t),n);mo(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 O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case M:return n=ao(n),p(e,t,n,r)}if(he(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,fo(n),r);if(n.$$typeof===re)return p(e,t,Aa(e,n),r);mo(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 O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case M:return r=ao(r),m(e,t,n,r,i)}if(he(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,fo(r),i);if(r.$$typeof===re)return m(e,t,n,Aa(t,r),i);mo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ca&&ta(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ca&&ta(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)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ca&&ta(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ca&&ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ca&&ta(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ca&&ta(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ee&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ee){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),po(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===M&&ao(l)===r.type){n(e,r.sibling),c=a(r,o.props),po(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ee?(c=Bi(o.props.children,e.mode,c,o.key),po(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),po(c,o),c.return=e,e=c)}return s(e);case k:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case M:return o=ao(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,fo(o),c);if(o.$$typeof===re)return _(e,r,Aa(e,o),c);mo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{uo=0;var i=_(e,t,n,r);return lo=null,i}catch(t){if(t===$a||t===to)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var go=ho(!0),_o=ho(!1),vo=!1;function yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bo(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 xo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function So(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ld&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function Co(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,vt(e,n)}}function wo(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 To=!1;function Eo(){if(To){var e=Wa;if(e!==null)throw e}}function Do(e,t,n,r){To=!1;var i=e.updateQueue;vo=!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?(fd&f)===f:(r&f)===f){f!==0&&f===Ua&&(To=!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=E({},d,f);break a;case 2:vo=!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),bd|=o,e.lanes=o,e.memoizedState=d}}function Oo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ko(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Oo(n[e],t)}var Ao=xe(null),jo=xe(0);function Mo(e,t){e=vd,Ce(jo,e),Ce(Ao,t),vd=e|t.baseLanes}function No(){Ce(jo,vd),Ce(Ao,Ao.current)}function Po(){vd=jo.current,Se(Ao),Se(jo)}var Fo=xe(null),Io=null;function Lo(e){var t=e.alternate;Ce(Ho,Ho.current&1),Ce(Fo,e),Io===null&&(t===null||Ao.current!==null||t.memoizedState!==null)&&(Io=e)}function Ro(e){Ce(Ho,Ho.current),Ce(Fo,e),Io===null&&(Io=e)}function zo(e){e.tag===22?(Ce(Ho,Ho.current),Ce(Fo,e),Io===null&&(Io=e)):Bo()}function Bo(){Ce(Ho,Ho.current),Ce(Fo,Fo.current)}function Vo(e){Se(Fo),Io===e&&(Io=null),Se(Ho)}var Ho=xe(0);function Uo(e,t){Ce(Fo,Fo.current),Ce(Ho,t)}function Wo(e){Se(Ho),Se(Fo),Io===e&&(Io=null)}function Go(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Sm(n)||Cm(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 Ko=0,qo=null,Jo=null,Yo=null,Xo=!1,Zo=!1,Qo=!1,$o=0,es=0,ts=null,ns=0;function rs(){throw Error(i(321))}function is(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function as(e,t,n,r,i,a){return Ko=a,qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ge.H=e===null||e.memoizedState===null?Sc:Cc,Qo=!1,a=n(r,i),Qo=!1,Zo&&(a=ss(t,n,r,i)),os(e),a}function os(e){ge.H=xc;var t=Jo!==null&&Jo.next!==null;if(Ko=0,Yo=Jo=qo=null,Xo=!1,es=0,ts=null,t)throw Error(i(300));e===null||Bc||(e=e.dependencies,e!==null&&Da(e)&&(Bc=!0))}function ss(e,t,n,r){qo=e;var a=0;do{if(Zo&&(ts=null),es=0,Zo=!1,25<=a)throw Error(i(301));if(a+=1,Yo=Jo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ge.H=wc,o=t(n,r)}while(Zo);return o}function cs(){var e=ge.H,t=e.useState()[0];return t=typeof t.then==`function`?hs(t):t,e=e.useState()[0],(Jo===null?null:Jo.memoizedState)!==e&&(qo.flags|=1024),t}function ls(){var e=$o!==0;return $o=0,e}function us(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ds(e){if(Xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xo=!1}Ko=0,Yo=Jo=qo=null,Zo=!1,es=$o=0,ts=null}function fs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yo===null?qo.memoizedState=Yo=e:Yo=Yo.next=e,Yo}function ps(){if(Jo===null){var e=qo.alternate;e=e===null?null:e.memoizedState}else e=Jo.next;var t=Yo===null?qo.memoizedState:Yo.next;if(t!==null)Yo=t,Jo=e;else{if(e===null)throw qo.alternate===null?Error(i(467)):Error(i(310));Jo=e,e={memoizedState:Jo.memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},Yo===null?qo.memoizedState=Yo=e:Yo=Yo.next=e}return Yo}function ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hs(e){var t=es;return es+=1,ts===null&&(ts=[]),e=io(ts,e,t),t=qo,(Yo===null?t.memoizedState:Yo.next)===null&&(t=t.alternate,ge.H=t===null||t.memoizedState===null?Sc:Cc),e}function gs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return hs(e);if(e.$$typeof===de)return;if(e.$$typeof===re)return ka(e)}throw Error(i(438,String(e)))}function _s(e){var t=null,n=qo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=qo.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=ms(),qo.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]=le;return t.index++,n}function vs(e,t){return typeof t==`function`?t(e):t}function ys(e){return bs(ps(),Jo,e)}function bs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ko&f)===f:(fd&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===Ua&&(d=!0);else if((Ko&p)===p){u=u.next,p===Ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,qo.lanes|=p,bd|=p;f=u.action,Qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,qo.lanes|=f,bd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Bc=!0,d&&(n=Wa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function xs(e){var t=ps(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(Bc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ss(e,t,n){var r=qo,a=ps(),o=ca;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Jo||a).memoizedState,n);if(s&&(a.memoizedState=n,Bc=!0),a=a.queue,qs(Ts.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Yo!==null&&!!(Yo.memoizedState.tag&1),Hs(e?9:8,{destroy:void 0},ws.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ud===null)throw Error(i(349));o||Ko&127||Cs(r,t,n)}return n}function Cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qo.updateQueue,t===null?(t=ms(),qo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ws(e,t,n,r){t.value=n,t.getSnapshot=r,Es(t)&&Ds(e)}function Ts(e,t,n){return n(function(){Es(t)&&Ds(e)})}function Es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Ds(e){var t=Ai(e,2);t!==null&&Jd(t,e,2)}function Os(e){var t=fs();if(typeof e==`function`){var n=e;if(e=n(),Qo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t}function ks(e,t,n,r){return e.baseState=n,bs(e,Jo,typeof r==`function`?r:vs)}function As(e,t,n,r,a){if(vc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};ge.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,js(t,o)):(o.next=n.next,t.pending=n.next=o)}}function js(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=ge.T,o={};o.types=a===null?null:a.types,ge.T=o;try{var s=n(i,r),c=ge.S;c!==null&&c(o,s),Ms(e,t,s)}catch(n){Ps(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),ge.T=a}}else try{a=n(i,r),Ms(e,t,a)}catch(n){Ps(e,t,n)}}function Ms(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ns(e,t,n)},function(n){return Ps(e,t,n)}):Ns(e,t,n)}function Ns(e,t,n){t.status=`fulfilled`,t.value=n,Fs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,js(e,n)))}function Ps(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Fs(t),t=t.next;while(t!==r)}e.action=null}function Fs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Is(e,t){return t}function Ls(e,t){if(ca){var n=ud.formState;if(n!==null){a:{var r=qo;if(ca){if(sa){b:{for(var i=sa,a=ua;i.nodeType!==8;)if(!a||(i=Tm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=Tm(i.nextSibling),r=i.data===`F!`;break a}}fa(r)}r=!1}r&&(t=n[0])}}return n=fs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:t},n.queue=r,n=hc.bind(null,qo,r),r.dispatch=n,r=Os(!1),a=_c.bind(null,qo,!1,r.queue),r=fs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=As.bind(null,qo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Rs(e){return zs(ps(),Jo,e)}function zs(e,t,n){if(t=bs(e,t,Is)[0],e=ys(vs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=hs(t)}catch(e){throw e===$a?to:e}else r=t;t=ps();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(qo.flags|=2048,Hs(9,{destroy:void 0},Bs.bind(null,i,n),null)),[r,a,e]}function Bs(e,t){e.action=t}function Vs(e){var t=ps(),n=Jo;if(n!==null)return zs(t,n,e);ps(),t=t.memoizedState,n=ps();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Hs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=qo.updateQueue,t===null&&(t=ms(),qo.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 Us(){return ps().memoizedState}function Ws(e,t,n,r){var i=fs();qo.flags|=e,i.memoizedState=Hs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Gs(e,t,n,r){var i=ps();r=r===void 0?null:r;var a=i.memoizedState.inst;Jo!==null&&r!==null&&is(r,Jo.memoizedState.deps)?i.memoizedState=Hs(t,a,n,r):(qo.flags|=e,i.memoizedState=Hs(1|t,a,n,r))}function Ks(e,t){Ws(8390656,8,e,t)}function qs(e,t){Gs(2048,8,e,t)}function Js(e){qo.flags|=4;var t=qo.updateQueue;if(t===null)t=ms(),qo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ys(e){var t=ps().memoizedState;return Js({ref:t,nextImpl:e}),function(){if(ld&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Xs(e,t){return Gs(4,2,e,t)}function Zs(e,t){return Gs(4,4,e,t)}function Qs(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 $s(e,t,n){n=n==null?null:n.concat([e]),Gs(4,4,Qs.bind(null,t,e),n)}function ec(){}function tc(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&is(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nc(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&is(t,r[1]))return r[0];if(r=e(),Qo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function rc(e,t,n){return n===void 0||Ko&1073741824&&!(fd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Kd(),qo.lanes|=e,bd|=e,n)}function ic(e,t,n,r){return Wr(n,t)?n:Ao.current===null?!(Ko&106)||Ko&1073741824&&!(fd&261930)?(Bc=!0,e.memoizedState=n):(e=Kd(),qo.lanes|=e,bd|=e,t):(e=rc(e,n,r),Wr(e,t)||(Bc=!0),e)}function ac(e,t,n,r,i){var a=_e.p;_e.p=a!==0&&8>a?a:8;var o=ge.T,s={};s.types=o===null?null:o.types,ge.T=s,_c(e,!1,t,n);try{var c=i(),l=ge.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?gc(e,t,qa(c,r),Gd(e)):gc(e,t,r,Gd(e))}catch(n){gc(e,t,{then:function(){},status:`rejected`,reason:n},Gd())}finally{_e.p=a,o!==null&&s.types!==null&&(o.types=s.types),ge.T=o}}function oc(){}function sc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=cc(e).queue;ac(e,a,t,ve,n===null?oc:function(){return lc(e),n(r)})}function cc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:ve},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lc(e){var t=cc(e);t.next===null&&(t=e.alternate.memoizedState),gc(e,t.next.queue,{},Gd())}function uc(){return ka(Ch)}function dc(){return ps().memoizedState}function fc(){return ps().memoizedState}function pc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Gd();e=xo(n);var r=So(t,e,n);r!==null&&(Jd(r,t,n),Co(r,t,n)),t={cache:Ia()},e.payload=t;return}t=t.return}}function mc(e,t,n){var r=Gd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vc(e)?yc(t,n):(n=ki(e,t,n,r),n!==null&&(Jd(n,e,r),bc(n,t,r)))}function hc(e,t,n){gc(e,t,n,Gd())}function gc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vc(e))yc(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,Wr(s,o))return Oi(e,t,i,0),ud===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Jd(n,e,r),bc(n,t,r),!0}return!1}function _c(e,t,n,r){if(r={lane:2,revertLane:Yf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},vc(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Jd(t,e,2)}function vc(e){var t=e.alternate;return e===qo||t!==null&&t===qo}function yc(e,t){Zo=Xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var xc={readContext:ka,use:gs,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useLayoutEffect:rs,useInsertionEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useSyncExternalStore:rs,useId:rs,useHostTransitionStatus:rs,useFormState:rs,useActionState:rs,useOptimistic:rs,useMemoCache:rs,useCacheRefresh:rs,useEffectEvent:rs},Sc={readContext:ka,use:gs,useCallback:function(e,t){return fs().memoizedState=[e,t===void 0?null:t],e},useContext:ka,useEffect:Ks,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ws(4194308,4,Qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ws(4194308,4,e,t)},useInsertionEffect:function(e,t){Ws(4,2,e,t)},useMemo:function(e,t){var n=fs();t=t===void 0?null:t;var r=e();if(Qo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=fs();if(n!==void 0){var i=n(t);if(Qo){et(!0);try{n(t)}finally{et(!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=mc.bind(null,qo,e),[r.memoizedState,e]},useRef:function(e){var t=fs();return e={current:e},t.memoizedState=e},useState:function(e){e=Os(e);var t=e.queue,n=hc.bind(null,qo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ec,useDeferredValue:function(e,t){return rc(fs(),e,t)},useTransition:function(){var e=Os(!1);return e=ac.bind(null,qo,e.queue,!0,!1),fs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=qo,a=fs();if(ca){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ud===null)throw Error(i(349));fd&127||Cs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ks(Ts.bind(null,r,o,e),[e]),r.flags|=2048,Hs(9,{destroy:void 0},ws.bind(null,r,o,n,t),null),n},useId:function(){var e=fs(),t=ud.identifierPrefix;if(ca){var n=ea,r=$i;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=$o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ns++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:uc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e){var t=fs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=_c.bind(null,qo,!0,n),n.dispatch=t,[e,t]},useMemoCache:_s,useCacheRefresh:function(){return fs().memoizedState=pc.bind(null,qo)},useEffectEvent:function(e){var t=fs(),n={impl:e};return t.memoizedState=n,function(){if(ld&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Cc={readContext:ka,use:gs,useCallback:tc,useContext:ka,useEffect:qs,useImperativeHandle:$s,useInsertionEffect:Xs,useLayoutEffect:Zs,useMemo:nc,useReducer:ys,useRef:Us,useState:function(){return ys(vs)},useDebugValue:ec,useDeferredValue:function(e,t){return ic(ps(),Jo.memoizedState,e,t)},useTransition:function(){var e=ys(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:Ss,useId:dc,useHostTransitionStatus:uc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){return ks(ps(),Jo,e,t)},useMemoCache:_s,useCacheRefresh:fc,useEffectEvent:Ys},wc={readContext:ka,use:gs,useCallback:tc,useContext:ka,useEffect:qs,useImperativeHandle:$s,useInsertionEffect:Xs,useLayoutEffect:Zs,useMemo:nc,useReducer:xs,useRef:Us,useState:function(){return xs(vs)},useDebugValue:ec,useDeferredValue:function(e,t){var n=ps();return Jo===null?rc(n,e,t):ic(n,Jo.memoizedState,e,t)},useTransition:function(){var e=xs(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:Ss,useId:dc,useHostTransitionStatus:uc,useFormState:Vs,useActionState:Vs,useOptimistic:function(e,t){var n=ps();return Jo===null?(n.baseState=e,[e,n.queue.dispatch]):ks(n,Jo,e,t)},useMemoCache:_s,useCacheRefresh:fc,useEffectEvent:Ys};function Tc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ec={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Gd(),i=xo(r);i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Jd(t,e,r),Co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Gd(),i=xo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Jd(t,e,r),Co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Gd(),r=xo(n);r.tag=2,t!=null&&(r.callback=t),t=So(e,r,n),t!==null&&(Jd(t,e,n),Co(t,e,n))}};function Dc(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?!Gr(n,r)||!Gr(i,a):!0}function Oc(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&&Ec.enqueueReplaceState(t,t.state,null)}function kc(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=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ac(e){Ci(e)}function jc(e){console.error(e)}function Mc(e){Ci(e)}function Nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Pc(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 Fc(e,t,n){return n=xo(n),n.tag=3,n.payload={element:null},n.callback=function(){Nc(e,t)},n}function Ic(e){return e=xo(e),e.tag=3,e}function Lc(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(){Pc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Pc(t,n,r),typeof i!=`function`&&(Md===null?Md=new Set([this]):Md.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ea(t,n,a,!0),n=Fo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Io===null?sf():n.alternate===null&&yd===0&&(yd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===no?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),kf(e,r,a)),!1;case 22:return n.flags|=65536,r===no?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)),kf(e,r,a)),!1}throw Error(i(435,n.tag))}return kf(e,r,a),sf(),!1}if(ca)return t=Fo.current,t===null?(r!==da&&(t=Error(i(423),{cause:r}),va(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=Fc(e.stateNode,r,a),wo(e,a),yd!==4&&(yd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==da&&(e=Error(i(422),{cause:r}),va(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),Td===null?Td=[o]:Td.push(o),yd!==4&&(yd=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Fc(n.stateNode,r,e),wo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Md===null||!Md.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ic(a),Lc(a,e,n,r),wo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var zc=Error(i(461)),Bc=!1;function Vc(e,t,n,r){t.child=e===null?_o(t,null,n,r):go(t,e.child,n,r)}function Hc(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 Oa(t),r=as(e,t,n,o,a,i),s=ls(),e!==null&&!Bc?(us(e,t,i),gl(e,t,i)):(ca&&s&&ra(t),t.flags|=1,Vc(e,t,r,i),t.child)}function Uc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Wc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!_l(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return gl(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Wc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Bc=!1,t.pendingProps=r=a,_l(e,i))e.flags&131072&&(Bc=!0);else return t.lanes=e.lanes,gl(e,t,i)}}return Qc(e,t,n,r,i)}function Gc(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 qc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Za(t,a===null?null:a.cachePool),a===null?No():Mo(t,a),zo(t);else return r=t.lanes=536870912,qc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Za(t,null),No(),Bo()):(Za(t,a.cachePool),Mo(t,a),Bo(),t.memoizedState=null);return Vc(e,t,i,n),t.child}function Kc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qc(e,t,n,r,i){var a=Xa();return a=a===null?null:{parent:Fa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Za(t,null),No(),zo(t),e!==null&&Ea(e,t,r,!0),t.childLanes=i,null}function Jc(e,t){return t=sl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yc(e,t,n){return go(t,e.child,null,n),e=Jc(t,t.pendingProps),e.flags|=2,Vo(t),t.memoizedState=null,e}function Xc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ca){if(r.mode===`hidden`)return e=Jc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Kc(null,e);if(Ro(t),(e=sa)?(e=xm(e,ua),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw fa(t);return t.lanes=536870912,null}return Jc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ro(t),a){if(t.flags&256)t.flags&=-257,t=Yc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Bc||Ea(e,t,n,!1),a=(n&e.childLanes)!==0,Bc||a){if(Ao.current===null){if(r=ud,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Jd(r,e,s),zc;sf()}t=Yc(e,t,n)}else e=o.treeContext,sa=Tm(s.nextSibling),oa=t,ca=!0,la=null,ua=!1,e!==null&&aa(t,e),t=Jc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Qc(e,t,n,r,i){return Oa(t),n=as(e,t,n,r,void 0,i),r=ls(),e!==null&&!Bc?(us(e,t,i),gl(e,t,i)):(ca&&r&&ra(t),t.flags|=1,Vc(e,t,n,i),t.child)}function $c(e,t,n,r,i,a){return Oa(t),t.updateQueue=null,n=ss(t,r,n,i),os(e),r=ls(),e!==null&&!Bc?(us(e,t,a),gl(e,t,a)):(ca&&r&&ra(t),t.flags|=1,Vc(e,t,n,a),t.child)}function el(e,t,n,r,i){if(Oa(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=ka(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ec,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},yo(t),o=n.contextType,a.context=typeof o==`object`&&o?ka(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Tc(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&&Ec.enqueueReplaceState(a,a.state,null),Do(t,r,a,i),Eo(),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=kc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=ka(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)&&Oc(t,a,r,o),vo=!1;var f=t.memoizedState;a.state=f,Do(t,r,a,i),Eo(),l=t.memoizedState,s||f!==l||vo?(typeof d==`function`&&(Tc(t,n,d,r),l=t.memoizedState),(c=vo||Dc(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,bo(e,t),o=t.memoizedProps,u=kc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=ka(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)&&Oc(t,a,r,c),vo=!1,f=t.memoizedState,a.state=f,Do(t,r,a,i),Eo();var p=t.memoizedState;o!==d||f!==p||vo||e!==null&&e.dependencies!==null&&Da(e.dependencies)?(typeof s==`function`&&(Tc(t,n,s,r),p=t.memoizedState),(u=vo||Dc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Da(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,Zc(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=go(t,e.child,null,i),t.child=go(t,null,n,i)):Vc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=gl(e,t,i),e}function tl(e,t,n,r){return ga(),t.flags|=256,Vc(e,t,n,r),t.child}var nl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rl(e){return{baseLanes:e,cachePool:Qa()}}function il(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Cd),e}function al(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ho.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ca){if(i?Lo(t):Bo(),(e=sa)?(e=xm(e,ua),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw fa(t);return t.lanes=Cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Bo(),i=t.mode,a=sl({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=rl(n),r.childLanes=il(e,o,n),t.memoizedState=nl,Kc(null,r)):(Lo(t),ol(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ll(e,t,a,o,r,c,s,n)}return i?(Bo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Kc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=rl(n):(a=i.cachePool,a===null?a=Qa():(s=Fa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=il(e,o,n),t.memoizedState=nl,Kc(e.child,r)):(Lo(t),n=e.child,e=n.sibling,n=Li(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 ol(e,t){return t=sl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function sl(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function cl(e,t,n){return go(t,e.child,null,n),e=ol(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ll(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Lo(t),t.flags&=-257,cl(e,t,c)):t.memoizedState===null?(Bo(),o=a.fallback,s=t.mode,a=sl({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,go(t,e.child,null,c),a=t.child,a.memoizedState=rl(c),a.childLanes=il(e,r,c),t.memoizedState=nl,Kc(null,a)):(Bo(),t.child=e.child,t.flags|=128,null);if(Lo(t),Cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,va({value:a,source:null,stack:null})),cl(e,t,c)}if(Bc||Ea(e,t,c,!1),r=(c&e.childLanes)!==0,Bc||r){if(Ao.current!==null)return cl(e,t,c);if(r=ud,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Jd(r,e,a),zc;return Sm(o)||sf(),cl(e,t,c)}return Sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=Tm(o.nextSibling),oa=t,ca=!0,la=null,ua=!1,e!==null&&aa(t,e),t=ol(t,a.children),t.flags|=134221824,t)}function ul(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wa(e.return,t,n)}function dl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Go(n)===null&&(t=e),e=e.sibling}return t}function fl(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 pl(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 ml(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ho.current;if(t.flags&128)return Uo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Uo(t,o),i===`backwards`&&e!==null?(pl(e),Vc(e,t,r,n),pl(e)):Vc(e,t,r,n),r=ca?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ul(e,n,t);else if(e.tag===19)ul(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=dl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,pl(t)),fl(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&&Go(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}fl(t,!0,n,null,a,r);break;case`together`:fl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=dl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),fl(t,!1,i,n,a,r)}return t.child}function hl(e,t,n){var r=t.pendingProps;return Sa(t,t.type,r.value),Vc(e,t,r.children,n),t.child}function gl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _l(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Da(e)))}function vl(e,t,n){switch(t.tag){case 3:F(t,t.stateNode.containerInfo),Sa(t,Fa,e.memoizedState.cache),ga();break;case 27:case 5:ke(t);break;case 4:F(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Lo(t),t.flags|=128,null;r=Ea(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?al(e,t,n):(Lo(t),e=gl(e,t,n),e===null?null:e.sibling)}Lo(t);break;case 19:if(t.flags&128)return ml(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ml(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Uo(t,Ho.current),r)break;return null;case 22:return t.lanes=0,Gc(e,t,n,t.pendingProps);case 24:Sa(t,Fa,e.memoizedState.cache)}return gl(e,t,n)}function yl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Bc=!0;else{if(!_l(e,n)&&!(t.flags&128))return Bc=!1,vl(e,t,n);Bc=!!(e.flags&131072)}}else Bc=!1,ca&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ao(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=kc(e,r),t.tag=1,t=el(null,t,e,r,n)):(t.tag=0,t=Qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Hc(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=Uc(null,t,e,r,n);break a}if(a===re){t.tag=10,t.type=e,t=hl(null,t,n);break a}}throw t=N(e)||e,Error(i(306,t,``))}}return t;case 0:return Qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=kc(r,t.pendingProps),el(e,t,r,a,n);case 3:a:{if(F(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,bo(e,t),Do(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Sa(t,Fa,r),r!==o.cache&&Ta(t,[Fa],n,!0),Eo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=tl(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),va(a),t=tl(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(sa=Tm(e.firstChild),oa=t,ca=!0,la=null,ua=!0,n=_o(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ga(),r===a){t=gl(e,t,n);break a}Vc(e,t,r,n)}t=t.child}return t;case 26:return Zc(e,t),e===null?(n=Ym(t.type,null,t.pendingProps,null))?t.memoizedState=n:ca||(t.stateNode=kp(t.type,t.pendingProps,P.current,t)):t.memoizedState=Ym(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&ca&&(r=t.stateNode=jm(t.type,t.pendingProps,P.current),oa=t,ua=!0,a=sa,zp(t.type)?(Em=a,sa=Tm(r.firstChild)):sa=a),Vc(e,t,t.pendingProps.children,n),Zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ca&&((a=r=sa)&&(r=ym(r,t.type,t.pendingProps,ua),r===null?a=!1:(t.stateNode=r,oa=t,sa=Tm(r.firstChild),ua=!1,a=!0)),a||fa(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ap(a,o)?r=null:s!==null&&Ap(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=as(e,t,cs,null,null,n),Ch._currentValue=a),Zc(e,t),Vc(e,t,r,n),t.child;case 6:return e===null&&ca&&((e=n=sa)&&(n=bm(n,t.pendingProps,ua),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||fa(t)),null;case 13:return al(e,t,n);case 4:return F(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Vc(e,t,r,n),t.child;case 11:return Hc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Zc(e,t),Vc(e,t,r,n),t.child;case 8:return Vc(e,t,t.pendingProps.children,n),t.child;case 12:return Vc(e,t,t.pendingProps.children,n),t.child;case 10:return hl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Oa(t),a=ka(a),r=r(a),t.flags|=1,Vc(e,t,r,n),t.child;case 14:return Uc(e,t,t.type,t.pendingProps,n);case 15:return Wc(e,t,t.type,t.pendingProps,n);case 19:return ml(e,t,n);case 31:return Xc(e,t,n);case 22:return Gc(e,t,n,t.pendingProps);case 24:return Oa(t),r=ka(Fa),e===null?(a=Xa(),a===null&&(a=ud,o=Ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},yo(t),Sa(t,Fa,a)):((e.lanes&n)!==0&&(bo(e,t),Do(t,null,null,n),Eo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Sa(t,Fa,r),r!==a.cache&&Ta(t,[Fa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Sa(t,Fa,r))),Vc(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:ca&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Zc(e,t),Vc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function bl(e){e.flags|=4}function xl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?uh(t,r):uh(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(rf())e.flags|=8192;else throw oo=no,eo}}else e.flags&=-16777217}function Sl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!dh(t)){if(rf())e.flags|=8192;else throw oo=no,eo}}function Cl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,wd|=t)}function wl(e,t){if(!ca)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 Tl(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 El(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tl(t),null;case 1:return Tl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ca(Fa),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ha(t)?bl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_a())),Tl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(bl(t),o===null?(Tl(t),xl(t,a,null,r,n)):(Tl(t),Sl(t,o))):o?o===e.memoizedState?(Tl(t),t.flags&=-16777217):(bl(t),Tl(t),Sl(t,o)):(e=e.memoizedProps,e!==r&&bl(t),Tl(t),xl(t,a,e,r,n)),null;case 27:if(Ae(t),n=P.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&bl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Tl(t),t.subtreeFlags&=-33554433,null}e=Te.current,ha(t)?pa(t,e):(e=jm(a,r,n),t.stateNode=e,bl(t))}return Tl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&bl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Tl(t),t.subtreeFlags&=-33554433,null}if(o=Te.current,ha(t))pa(t,o);else{var s=Ep(P.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Tt]=t,o[Et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(yp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&bl(t)}}return Tl(t),t.subtreeFlags&=-33554433,xl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&bl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=P.current,ha(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||gp(e.nodeValue,n)),e||fa(t,!0)}else e=Ep(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return Tl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ha(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Tt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tl(t),e=!1}else n=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vo(t),t):(Vo(t),null);if(t.flags&128)throw Error(i(558))}return Tl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ha(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Tt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tl(t),a=!1}else a=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Vo(t),t):(Vo(t),null)}return Vo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Cl(t,t.updateQueue),Tl(t),null);case 4:return Oe(),e===null&&op(t.stateNode.containerInfo),t.flags|=67108864,Tl(t),null;case 10:return Ca(t.type),Tl(t),null;case 19:if(Wo(t),r=t.memoizedState,r===null)return Tl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)wl(r,!1);else{if(yd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Go(e),o!==null){for(t.flags|=128,wl(r,!1),e=o.updateQueue,t.updateQueue=e,Cl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Uo(t,Ho.current&1|2),ca&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>Ad&&(t.flags|=128,a=!0,wl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Cl(t,e),wl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ca)return Tl(t),null}else 2*Ue()-r.renderingStartTime>Ad&&n!==536870912&&(t.flags|=128,a=!0,wl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}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=Ue(),e.sibling=null,o=Ho.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ca?Uo(t,o):(n=o,Ce(Fo,t),Ce(Ho,n),Io===null&&(Io=t)),ca&&ta(t,r.treeForkCount),e}return Tl(t),null;case 22:case 23:return Vo(t),Po(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Tl(t),t.subtreeFlags&6&&(t.flags|=8192)):Tl(t),n=t.updateQueue,n!==null&&Cl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Se(Ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ca(Fa),Tl(t),null;case 25:return null;case 30:return t.flags|=33554432,Tl(t),null}throw Error(i(156,t.tag))}function Dl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(Fa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Vo(t),t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wo(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 Oe(),null;case 10:return Ca(t.type),null;case 22:case 23:return Vo(t),Po(),e!==null&&Se(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ca(Fa),null;case 25:return null;default:return null}}function Ol(e,t){switch(ia(t),t.tag){case 3:Ca(Fa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Vo(t);break;case 13:Vo(t);break;case 19:Wo(t);break;case 10:Ca(t.type);break;case 22:case 23:Vo(t),Po(),e!==null&&Se(Ya);break;case 24:Ca(Fa)}}function kl(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){Of(t,t.return,e)}}function Al(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){Of(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Of(t,t.return,e)}}function jl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ko(t,n)}catch(t){Of(e,e.return,t)}}}function Ml(e,t,n){n.props=kc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Of(e,t,n)}}function Nl(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=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Xp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Zp(e);p(e.child,!1,mm,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){Of(e,t,n)}}function Pl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Of(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){Of(e,t,n)}else n.current=null}}function Fl(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++)gm(e.stateNode,t[n])}function Il(e){for(var t=e.return;t!==null&&(zl(t)&&gm(e.stateNode,t.stateNode),!Rl(t));)t=t.return}function Ll(e){for(var t=e.return;t!==null&&(zl(t)&&_m(e.stateNode,t.stateNode),!Rl(t));)t=t.return}function Rl(e){return e.tag===5||e.tag===3||e.tag===27}function zl(e){return e&&e.tag===7&&e.stateNode!==null}function Bl(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){Of(e,e.return,t)}}function Vl(e,t,n){try{var r=e.stateNode;xp(r,e.type,n,t),r[Et]=t}catch(t){Of(e,e.return,t)}}function Hl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zp(e.type)||e.tag===4}function Ul(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Hl(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&&zp(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 Wl(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=xn)),Fl(e,r),Yt=!0;else if(i!==4&&(i===27&&(Fl(e,r),r=null,zp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Wl(e,t,n,r),e=e.sibling;e!==null;)Wl(e,t,n,r),e=e.sibling}function Gl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Fl(e,r),Yt=!0;else if(i!==4&&(i===27&&(Fl(e,r),r=null,zp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Gl(e,t,n,r),e=e.sibling;e!==null;)Gl(e,t,n,r),e=e.sibling}function Kl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);yp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){Of(e,e.return,t)}}var ql=!1,Jl=null;function Yl(e){(e.tag===30||e.subtreeFlags&33554432)&&(ql=!0)}var Xl=null;function Zl(){var e=Xl;return Xl=null,e}var Ql=0;function $l(e,t,n,r,i){return Ql=0,eu(e.child,t,n,r,i)}function eu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Wp(o);r.push(s),s.view&&(a=!0)}else a||Wp(o).view&&(a=!0);ql=!0,Hp(o,Ql===0?t:t+`_`+Ql,n),Ql++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||eu(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function tu(e,t){for(;e!==null;)e.tag===5?L(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||tu(e.child,t),e=e.sibling}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(nu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Si(t.default,t.share),t!==`none`&&($l(e,n,t,null,!1)||tu(e.child,!1))}e=e.sibling}}function ru(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?nu(e):$l(e,i,a,null,!1)?(nu(e),n.paired||t||qd(e,r.onEnter)):tu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e,t),e=e.sibling;else nu(e)}function iu(e){if(Jl!==null&&Jl.size!==0){var t=Jl;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=Si(n.default,n.share);if(a!==`none`&&($l(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,qd(e,n.onShare)):tu(e.child,!1)),t.delete(r),t.size===0)break}}}iu(e)}e=e.sibling}}}function au(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=Jl===null?void 0:Jl.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&($l(e,n,i,null,!1)?r===void 0?qd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Jl.delete(n),qd(e,t.onShare)):tu(e.child,!1)),Jl!==null&&iu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e),e=e.sibling;else Jl!==null&&iu(e)}function ou(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&$l(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ou(e);e=e.sibling}}function su(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,tu(e.child,!1))}su(e)}e=e.sibling}}function cu(e){if(e.tag===30)e.stateNode.paired=null,tu(e.child,!1),su(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)cu(e),e=e.sibling;else su(e)}function lu(e){for(e=e.child;e!==null;)e.tag===30?tu(e.child,!1):e.subtreeFlags&33554432&&lu(e),e=e.sibling}function uu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ql<a.length){var l=a[Ql],u=Wp(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&&Hp(c,Ql===0?n:n+`_`+Ql,i),s&&e.flags&4||(Xl===null&&(Xl=[]),Xl.push(c,Ql===0?r:r+`_`+Ql,t.memoizedProps)),Ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:uu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function du(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Gp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ql=0,i=uu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||qd(e,n.onUpdate))}else e.subtreeFlags&33554432&&du(e,t);e=e.sibling}}var fu=!1,pu=!1,mu=!1,hu=!1,gu=typeof WeakSet==`function`?WeakSet:Set,_u=null,vu=!1,yu=!1,bu=!1,xu=!1;function Su(e,t,n){if(e=e.containerInfo,wp=Mh,e=Xr(e),Zr(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(Tp={focusedElem:e,selectionRange:r},Mh=!1,n=(n&335544064)===n,_u=t,t=n?9270:1024;_u!==null;){if(e=_u,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&au(r[a]);if(e.alternate===null&&e.flags&2)n&&Yl(e),Cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&au(r),Cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Yl(e),Cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,_u=r):(n&&ou(e),Cu(n))}}Jl=null}function Cu(e){for(;_u!==null;){var t=_u,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=kc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Of(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)vm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:vm(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=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&$l(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,_u=r;break}_u=t.return}}function wu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Wu(e,n),r&4&&kl(5,n);break;case 1:if(Wu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Of(n,n.return,e)}else{var i=kc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Of(n,n.return,e)}}}r&64&&jl(n),r&512&&Nl(n,n.return);break;case 3:if(Wu(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{ko(e,t)}catch(e){Of(n,n.return,e)}}break;case 27:t===null&&r&4&&Kl(n);case 26:case 5:Wu(e,n),t===null&&r&4&&Bl(n),r&512&&Nl(n,n.return);break;case 12:Wu(e,n);break;case 31:Wu(e,n),r&4&&Nu(e,n);break;case 13:Wu(e,n),r&4&&Pu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Mf.bind(null,n),wm(e,n))));break;case 22:if(r=n.memoizedState!==null||fu,!r){var a=t!==null&&t.memoizedState!==null||pu;t=fu,i=pu,fu=r,(pu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ku(e,n,r)):Wu(e,n),fu=t,pu=i}break;case 30:Wu(e,n),r&512&&Nl(n,n.return);break;case 7:r&512&&Nl(n,n.return);default:Wu(e,n)}}function Tu(e,t){for(e=e.child;e!==null;)Eu(e,t),e=e.sibling}function Eu(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){Of(e,e.return,t)}Du(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){Of(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Vp(s,!0):Vp(e.stateNode,!1)}catch(t){Of(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Tu(e,t);break;default:Tu(e,t)}}function Du(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Eu(n,r);break a;case 22:n.memoizedState===null&&Du(n,r);break a;default:Du(n,r)}}e=e.sibling}}function Ou(e){var t=e.alternate;t!==null&&(e.alternate=null,Ou(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(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 ku=null,Au=!1;function ju(e,t,n){for(n=n.child;n!==null;)Mu(e,t,n),n=n.sibling}function Mu(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:pu||Pl(n,t),ju(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!pu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:pu||Pl(n,t),Ll(n);var r=ku,i=Au;zp(n.type)&&(ku=n.stateNode,Au=!1),ju(e,t,n),Mm(n.stateNode,n.type,n.memoizedProps),ku=r,Au=i;break;case 5:pu||Pl(n,t),Ll(n);case 6:if(n.tag===6&&Ll(n),r=ku,i=Au,ku=null,ju(e,t,n),ku=r,Au=i,ku!==null){if(Au)try{(ku.nodeType===9?ku.body:ku.nodeName===`HTML`?ku.ownerDocument.body:ku).removeChild(n.stateNode),Yt=!0}catch(e){Of(n,t,e)}else try{ku.removeChild(n.stateNode),Yt=!0}catch(e){Of(n,t,e)}}break;case 18:ku!==null&&(Au?(e=ku,Bp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ig(e)):Bp(ku,n.stateNode));break;case 4:r=ku,i=Au,ku=n.stateNode.containerInfo,Au=!0,ju(e,t,n),ku=r,Au=i;break;case 0:case 11:case 14:case 15:Al(2,n,t),pu||Al(4,n,t),ju(e,t,n);break;case 1:pu||(Pl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Ml(n,t,r)),ju(e,t,n);break;case 21:ju(e,t,n);break;case 22:pu=(r=pu)||n.memoizedState!==null,ju(e,t,n),pu=r;break;case 30:Pl(n,t),ju(e,t,n);break;case 7:pu||Pl(n,t),ju(e,t,n);break;default:ju(e,t,n)}}function Nu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ig(e)}catch(e){Of(t,t.return,e)}}}function Pu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ig(e)}catch(e){Of(t,t.return,e)}}function Fu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gu),t;default:throw Error(i(435,e.tag))}}function Iu(e,t){var n=Fu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Nf.bind(null,e,t);t.then(r,r)}})}function Lu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(zp(l.type)){ku=l.stateNode,Au=!1;break a}break;case 5:ku=l.stateNode,Au=!1;break a;case 3:case 4:ku=l.stateNode.containerInfo,Au=!0;break a}l=l.return}if(ku===null)throw Error(i(160));Mu(s,c,o),ku=null,Au=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zu(t,e,n),t=t.sibling}var Ru=null;function zu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Lu(t,e,n),Bu(e),a&4&&(Al(3,e,e.return),kl(3,e),Al(5,e,e.return));break;case 1:Lu(t,e,n),Bu(e),a&512&&(pu||r===null||Pl(r,r.return)),a&64&&fu&&(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(o=Ru,Lu(t,e,n),Bu(e),a&512&&(pu||r===null||Pl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(fu)e.stateNode=kp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),yp(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=sh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[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)){o.splice(s,1);break b}}r=a.createElement(t),yp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=sh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[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)){o.splice(s,1);break b}}r=a.createElement(t),yp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else fu||ch(o,e.type,e.stateNode)}else e.stateNode=nh(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Vl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||pu||t.parentNode.removeChild(t)):a.count--,n===null?fu||ch(o,e.type,e.stateNode):nh(o,n,e.memoizedProps))}break;case 27:Lu(t,e,n),Bu(e),a&512&&(pu||r===null||Pl(r,r.return)),r!==null&&a&4&&Vl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=mu,mu=!1,Lu(t,e,n),mu=o,Bu(e),a&512&&(pu||r===null||Pl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){Of(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Vl(e,t,r===null?t:r.memoizedProps)),a&1024&&(hu=!0);break;case 6:if(Lu(t,e,n),Bu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){Of(e,e.return,t)}}break;case 3:if(Yt=!1,oh=null,o=Ru,Ru=Im(t.containerInfo),Lu(t,e,n),Ru=o,Bu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ig(t.containerInfo)}catch(t){Of(e,e.return,t)}hu&&(hu=!1,Vu(e)),Yt=!1;break;case 4:a=mu,mu=fu,r=Xt(),o=Ru,Ru=Im(e.stateNode.containerInfo),Lu(t,e,n),Bu(e),Ru=o,Yt&&yu&&(bu=!0),Yt=r,mu=a;break;case 12:Lu(t,e,n),Bu(e);break;case 31:Lu(t,e,n),Bu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Iu(e,t)));break;case 13:Lu(t,e,n),Bu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Od=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Iu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=fu,l=pu,u=mu;fu=c||o,mu=u||o,pu=l||s,Lu(t,e,n),pu=l,mu=u,fu=c,Bu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||fu||pu||(t=s||pu,n=fu,r=pu,fu=o||fu,pu=t,Gu(e,2),fu=n,pu=r),!o&&mu||Tu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Iu(e,n))));break;case 19:Lu(t,e,n),Bu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Iu(e,t)));break;case 30:a&512&&(pu||r===null||Pl(r,r.return)),a=Xt(),o=yu,s=(n&335544064)===n,c=e.memoizedProps,yu=s&&Si(c.default,c.update)!==`none`,Lu(t,e,n),Bu(e),s&&r!==null&&Yt&&(e.flags|=4),yu=o,Yt=a;break;case 21:break;case 7:a&512&&(pu||r===null||Pl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Lu(t,e,n),Bu(e)}}function Bu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Hl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(zl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Rl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Gl(e,Ul(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Gl(e,Ul(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Wl(e,Ul(e),u,s);break;default:throw Error(i(161))}}catch(t){Of(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Mh=!0,t.reset(),Mh=!1),e=e.sibling}}function Hu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Uu(t,e),t=t.sibling;else du(t,!1)}function Uu(e,t){var n=e.alternate;if(n===null)ru(e,!1);else switch(e.tag){case 3:if(xu=vu=!1,Zl(),Hu(t,e),!vu&&!bu){if(e=Xl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];L(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`})),xu=!0}Xl=null;break;case 5:Hu(t,e);break;case 4:r=vu,vu=!1,Hu(t,e),vu&&(bu=!0),vu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Hu(t,e):ru(e,!1));break;case 30:r=vu,i=Zl(),vu=!1,Hu(t,e),vu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ql=0,t=uu(e,n,t,o,s,a,!0),Ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(qd(e,e.memoizedProps.onUpdate),Xl=i):i!==null&&(i.push.apply(i,Xl),Xl=i),vu=e.flags&32?!0:r;break;default:Hu(t,e)}}function Wu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wu(e,t.alternate,t),t=t.sibling}function Gu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Al(4,n,n.return),Gu(n,r);break;case 1:Pl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Ml(n,n.return,i),Gu(n,r);break;case 27:r&2&&Mm(n.stateNode,n.type,n.memoizedProps);case 5:Pl(n,n.return),n.tag!==5&&n.tag!==27||Ll(n),Gu(n,r);break;case 6:Ll(n);break;case 26:Pl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||pu||i.parentNode.removeChild(i),Gu(n,r);break;case 22:n.memoizedState===null&&Gu(n,r);break;case 30:Pl(n,n.return),Gu(n,r);break;case 7:Pl(n,n.return);default:Gu(n,r)}e=e.sibling}}function Ku(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:Ku(i,a,n),kl(4,a);break;case 1:if(Ku(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Of(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++)Oo(l[i],c)}catch(e){Of(r,r.return,e)}}s&&o&64&&jl(a),Nl(a,a.return);break;case 27:n&2&&Kl(a);case 5:a.tag!==5&&a.tag!==27||Il(a),Ku(i,a,n),s&&r===null&&o&4&&Bl(a),Nl(a,a.return);break;case 6:Il(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||fu||ch(Im(c.ownerDocument),a.type,c),Ku(i,a,n),s&&r===null&&o&4&&Bl(a),Nl(a,a.return);break;case 12:Ku(i,a,n);break;case 31:Ku(i,a,n),s&&o&4&&Nu(i,a);break;case 13:Ku(i,a,n),s&&o&4&&Pu(i,a);break;case 22:a.memoizedState===null&&Ku(i,a,n),Nl(a,a.return);break;case 30:Ku(i,a,n),Nl(a,a.return);break;case 7:Nl(a,a.return);default:Ku(i,a,n)}t=t.sibling}}function qu(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&&La(n))}function Ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e))}function Yu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Xu(e,t,n,r),t=t.sibling;else i&&lu(t)}function Xu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&cu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Yu(e,t,n,r),a&2048&&kl(9,t);break;case 1:Yu(e,t,n,r);break;case 3:Yu(e,t,n,r),i&&xu&&(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&&La(a)));break;case 12:if(a&2048){Yu(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){Of(t,t.return,e)}}else Yu(e,t,n,r);break;case 31:Yu(e,t,n,r);break;case 13:Yu(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&&cu(t),o._visibility&2?Yu(e,t,n,r):(o._visibility|=2,Zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&cu(s),o._visibility&2?Yu(e,t,n,r):Qu(e,t)),a&2048&&qu(s,t);break;case 24:Yu(e,t,n,r),a&2048&&Ju(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(tu(a.child,!0),tu(t.child,!0))),Yu(e,t,n,r);break;default:Yu(e,t,n,r)}}function Zu(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:Zu(a,o,s,c,i),kl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Zu(a,o,s,c,i)):u._visibility&2?Zu(a,o,s,c,i):Qu(a,o),i&&l&2048&&qu(o.alternate,o);break;case 24:Zu(a,o,s,c,i),i&&l&2048&&Ju(o.alternate,o);break;default:Zu(a,o,s,c,i)}t=t.sibling}}function Qu(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:Qu(n,r),i&2048&&qu(r.alternate,r);break;case 24:Qu(n,r),i&2048&&Ju(r.alternate,r);break;default:Qu(n,r)}t=t.sibling}}var $u=8192;function ed(e,t,n){if(e.subtreeFlags&$u)for(e=e.child;e!==null;)td(e,t,n),e=e.sibling}function td(e,t,n){switch(e.tag){case 26:ed(e,t,n),e.flags&$u&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ph(n,e)):mh(n,Ru,e.memoizedState,e.memoizedProps));break;case 5:ed(e,t,n),e.flags&$u&&(e=e.stateNode,(t&335544128)===t&&ph(n,e));break;case 3:case 4:var r=Ru;Ru=Im(e.stateNode.containerInfo),ed(e,t,n),Ru=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=$u,$u=16777216,ed(e,t,n),$u=r):ed(e,t,n));break;case 30:if((e.flags&$u)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Jl===null&&(Jl=new Map),Jl.set(r,i)}ed(e,t,n);break;default:ed(e,t,n)}}function nd(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 rd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];_u=r,od(r,e)}nd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)id(e),e=e.sibling}function id(e){switch(e.tag){case 0:case 11:case 15:rd(e),e.flags&2048&&Al(9,e,e.return);break;case 3:rd(e);break;case 12:rd(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ad(e)):rd(e);break;default:rd(e)}}function ad(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];_u=r,od(r,e)}nd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Al(8,t,t.return),ad(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ad(t));break;default:ad(t)}e=e.sibling}}function od(e,t){for(;_u!==null;){var n=_u;switch(n.tag){case 0:case 11:case 15:Al(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:La(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,_u=r;else a:for(n=e;_u!==null;){r=_u;var i=r.sibling,a=r.return;if(Ou(r),r===n){_u=null;break a}if(i!==null){i.return=a,_u=i;break a}_u=a}}}var sd={getCacheForType:function(e){var t=ka(Fa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ka(Fa).controller.signal}},cd=typeof WeakMap==`function`?WeakMap:Map,ld=0,ud=null,dd=null,fd=0,pd=0,md=null,hd=!1,gd=!1,_d=!1,vd=0,yd=0,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=null,Ed=null,Dd=!1,Od=0,kd=0,Ad=1/0,jd=null,Md=null,Nd=0,Pd=null,Fd=null,Id=0,Ld=0,Rd=null,zd=null,Bd=null,Vd=null,Hd=null,Ud=0,Wd=null;function Gd(){return ld&2&&fd!==0?fd&-fd:ge.T===null?St():Yf()}function Kd(){if(Cd===0){if(!(fd&536870912)||ca){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),Cd=e}else Cd=536870912}return e=Fo.current,e!==null&&(e.flags|=32),Cd}function qd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Xp(bi(e.memoizedProps,n))),Vd===null&&(Vd=[]),Vd.push(t.bind(null,r))}}function Jd(e,t,n){(e===ud&&(pd===2||pd===9)||e.cancelPendingCommit!==null)&&(tf(e,0),Qd(e,fd,Cd,!1)),ht(e,n),ld&2&&e===ud||(e===ud&&(!(ld&2)&&(xd|=n),yd===4&&Qd(e,fd,Cd,!1)),Vf(e))}function Yd(e,t,n){if(ld&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?uf(e,t):cf(e,t,!0),o=r;do{if(a===0){gd&&!r&&Qd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Zd(n))a=cf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Td;var l=c.current.memoizedState.isDehydrated;if(l&&(tf(c,s).flags|=256),s=cf(c,s,!1),s!==2&&s!==6){if(_d&&!l){c.errorRecoveryDisabledLanes|=o,xd|=o,a=4;break a}o=Ed,Ed=a,o!==null&&(Ed===null?Ed=o:Ed.push.apply(Ed,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){tf(e,0),Qd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Qd(r,t,Cd,!hd);break a;case 2:Ed=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Od+300-Ue(),10<a)){if(Qd(r,t,Cd,!hd),lt(r,0,!0)!==0)break a;Id=t,r.timeoutHandle=Np(Xd.bind(null,r,n,Ed,jd,Dd,t,Cd,xd,wd,hd,o,`Throttled`,-0,0),a);break a}Xd(r,n,Ed,jd,Dd,t,Cd,xd,wd,hd,o,null,-0,0)}break}}while(1);Vf(e)}function Xd(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:xn},Jl=null,td(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=vh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Od-Ue():(a&4194048)===a?kd-Ue():0,m=gh(d,m),m!==null)?(Id=a,e.cancelPendingCommit=m(_f.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Qd(e,a,o,!l)):_f(e,t,a,n,r,i,o,s,c,l,u,d)}function Zd(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(!Wr(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 Qd(e,t,n,r){t=dt(e,t),t&=~Sd,t&=~xd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function $d(){return ld&6?!0:(Hf(0,!1),!1)}function ef(){if(dd!==null){if(pd===0)var e=dd.return;else e=dd,xa=ba=null,ds(e),lo=null,uo=0,e=dd;for(;e!==null;)Ol(e.alternate,e),e=e.return;dd=null}}function tf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Pp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Id=0,ef(),ud=e,dd=n=Li(e.current,null),fd=t,pd=0,md=null,hd=!1,gd=ut(e,t),_d=!1,wd=Cd=Sd=xd=bd=yd=0,Ed=Td=null,Dd=!1,vd=dt(e,t),Di(),n}function nf(e,t){qo=null,ge.H=xc,t===$a||t===to?(t=so(),pd=3):t===eo?(t=so(),pd=4):pd=t===zc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,md=t,dd===null&&(yd=1,Nc(e,Gi(t,e.current)))}function rf(){var e=Fo.current;return e===null?!0:(fd&4194048)===fd?Io===null:(fd&62914560)===fd||fd&536870912?e===Io:!1}function af(){var e=ge.H;return ge.H=xc,e===null?xc:e}function of(){var e=ge.A;return ge.A=sd,e}function sf(){yd=4,hd||(fd&4194048)!==fd&&Fo.current!==null||(gd=!0),!(bd&134217727)&&!(xd&134217727)||ud===null||Qd(ud,fd,Cd,!1)}function cf(e,t,n){var r=ld;ld|=2;var i=af(),a=of();(ud!==e||fd!==t)&&(jd=null,tf(e,t)),t=!1;var o=yd;a:do try{if(pd!==0&&dd!==null){var s=dd,c=md;switch(pd){case 8:ef(),o=6;break a;case 3:case 2:case 9:case 6:Fo.current===null&&(t=!0);var l=pd;if(pd=0,md=null,mf(e,s,c,l),n&&gd){o=0;break a}break;default:l=pd,pd=0,md=null,mf(e,s,c,l)}}lf(),o=yd;break}catch(t){nf(e,t)}while(1);return t&&e.shellSuspendCounter++,xa=ba=null,ld=r,ge.H=i,ge.A=a,dd===null&&(ud=null,fd=0,Di()),o}function lf(){for(;dd!==null;)ff(dd)}function uf(e,t){var n=ld;ld|=2;var r=af(),a=of();ud!==e||fd!==t?(jd=null,Ad=Ue()+500,tf(e,t)):gd=ut(e,t);a:do try{if(pd!==0&&dd!==null){t=dd;var o=md;b:switch(pd){case 1:pd=0,md=null,mf(e,t,o,1);break;case 2:case 9:if(ro(o)){pd=0,md=null,pf(t);break}t=function(){pd!==2&&pd!==9||ud!==e||(pd=7),Vf(e)},o.then(t,t);break a;case 3:pd=7;break a;case 4:pd=5;break a;case 7:ro(o)?(pd=0,md=null,pf(t)):(pd=0,md=null,mf(e,t,o,7));break;case 5:var s=null;switch(dd.tag){case 26:s=dd.memoizedState;case 5:case 27:var c=dd;if(s?dh(s):c.stateNode.complete){pd=0,md=null;var l=c.sibling;if(l!==null)dd=l;else{var u=c.return;u===null?dd=null:(dd=u,hf(u))}break b}}pd=0,md=null,mf(e,t,o,5);break;case 6:pd=0,md=null,mf(e,t,o,6);break;case 8:ef(),yd=6;break a;default:throw Error(i(462))}}df();break}catch(t){nf(e,t)}while(1);return xa=ba=null,ge.H=r,ge.A=a,ld=n,dd===null?(ud=null,fd=0,Di(),yd):0}function df(){for(;dd!==null&&!Ve();)ff(dd)}function ff(e){var t=yl(e.alternate,e,vd);e.memoizedProps=e.pendingProps,t===null?hf(e):dd=t}function pf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$c(n,t,t.pendingProps,t.type,void 0,fd);break;case 11:t=$c(n,t,t.pendingProps,t.type.render,t.ref,fd);break;case 5:ds(t);var r=t;r===oa&&(ca?(ma(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(ma(r),ca=!0));default:Ol(n,t),t=dd=Ri(t,vd),t=yl(n,t,vd)}e.memoizedProps=e.pendingProps,t===null?hf(e):dd=t}function mf(e,t,n,r){xa=ba=null,ds(t),lo=null,uo=0;var i=t.return;try{if(Rc(e,i,t,n,fd)){yd=1,Nc(e,Gi(n,e.current)),dd=null;return}}catch(t){if(i!==null)throw dd=i,t;yd=1,Nc(e,Gi(n,e.current)),dd=null;return}t.flags&32768?(ca||r===1?e=!0:gd||fd&536870912?e=!1:(hd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Fo.current,r!==null&&r.tag===13&&(r.flags|=16384))),gf(t,e)):hf(t)}function hf(e){var t=e;do{if(t.flags&32768){gf(t,hd);return}e=t.return;var n=El(t.alternate,t,vd);if(n!==null){dd=n;return}if(t=t.sibling,t!==null){dd=t;return}dd=t=e}while(t!==null);yd===0&&(yd=5)}function gf(e,t){do{var n=Dl(e.alternate,e);if(n!==null){n.flags&=32767,dd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){dd=e;return}dd=e=n}while(e!==null);yd=6,dd=null}function _f(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Tf();while(Nd!==0);if(ld&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ud&&(dd=ud=null,fd=0),Fd=t,Pd=e,Id=n,Rd=a,zd=r,vf(e,t,n,s,c,l,f)}}function vf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ld=s,s|=Ei,gt(e,n,s,r,i,a),Vd=null,(n&335544064)===n?(Hd=Ba(e),r=10262):(Hd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Pf(qe,function(){return Ef(),null})):(e.callbackNode=null,e.callbackPriority=0),ql=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=ge.T,ge.T=null,i=_e.p,_e.p=2,a=ld,ld|=4;try{Su(e,t,n)}finally{ld=a,_e.p=i,ge.T=r}}Nd=1,ql?Bd=Jp(o,e.containerInfo,Hd,xf,Sf,bf,Cf,Ef,yf,null,null):(xf(),Sf(),Cf())}function yf(e){if(Nd!==0){var t=Pd.onRecoverableError;t(e,{componentStack:null})}}function bf(){Nd===3&&(Nd=0,Uu(Fd,Pd),Nd=4)}function xf(){if(Nd===1){Nd=0;var e=Pd,t=Fd,n=Id,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=ge.T,ge.T=null;var i=_e.p;_e.p=2;var a=ld;ld|=4;try{yu=bu=!1,zu(t,e,n),n=Tp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(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 _=Jr(s,h),v=Jr(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}}Mh=!!wp,Tp=wp=null}finally{ld=a,_e.p=i,ge.T=r}}e.current=t,Nd=2}}function Sf(){if(Nd===2){Nd=0;var e=Pd,t=Fd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=ge.T,ge.T=null;var r=_e.p;_e.p=2;var i=ld;ld|=4;try{wu(e,t.alternate,t)}finally{ld=i,_e.p=r,ge.T=n}}Nd=3}}function Cf(){if(Nd===4||Nd===3){Nd=0;var e=Bd;Bd=null,He();var t=Pd,n=Fd,r=Id,i=zd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Nd=5:(Nd=0,Fd=Pd=null,wf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Md=null),xt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=ge.T,a=_e.p,_e.p=2,ge.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{ge.T=n,_e.p=a}}if(i=Vd,o=Hd,Hd=null,i!==null&&(Vd=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);Id&3&&Tf(),Vf(t),a=t.pendingLanes,r&261930&&a&42?t===Wd?Ud++:(Ud=0,Wd=t):(Ud=0,Wd=null),Hf(0,!1)}}function wf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,La(t)))}function Tf(){return Bd!==null&&(Bd.skipTransition(),Bd=null),xf(),Sf(),Cf(),Ef()}function Ef(){if(Nd!==5)return!1;var e=Pd,t=Ld;Ld=0;var n=xt(Id),r=ge.T,a=_e.p;try{_e.p=32>n?32:n,ge.T=null,n=Rd,Rd=null;var o=Pd,s=Id;if(Nd=0,Fd=Pd=null,Id=0,ld&6)throw Error(i(331));var c=ld;if(ld|=4,id(o.current),Xu(o,o.current,s,n),ld=c,Hf(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{_e.p=a,ge.T=r,wf(e,t)}}function Df(e,t,n){t=Gi(n,t),t=Fc(e.stateNode,t,2),e=So(e,t,2),e!==null&&(ht(e,2),Vf(e))}function Of(e,t,n){if(e.tag===3)Df(e,e,n);else for(;t!==null;){if(t.tag===3){Df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Md===null||!Md.has(r))){e=Gi(n,e),n=Ic(2),r=So(t,n,2),r!==null&&(Lc(n,r,t,e),ht(r,2),Vf(r));break}}t=t.return}}function kf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cd;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)||(_d=!0,i.add(n),e=Af.bind(null,e,t,n),t.then(e,e))}function Af(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ud===e&&(fd&n)===n&&(yd===4||yd===3&&(fd&62914560)===fd&&300>Ue()-Od?ld&2?Sd|=n:tf(e,0):Sd|=n,wd===fd&&(wd=0)),Vf(e)}function jf(e,t){t===0&&(t=pt()),e=Ai(e,t),e!==null&&(ht(e,t),Vf(e))}function Mf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jf(e,n)}function Nf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),jf(e,n)}function Pf(e,t){return ze(e,t)}var Ff=null,If=null,Lf=!1,Rf=!1,zf=!1,Bf=0;function Vf(e){e!==If&&e.next===null&&(If===null?Ff=If=e:If=If.next=e),Rf=!0,Lf||(Lf=!0,Jf())}function Hf(e,t){if(!zf&&Rf){zf=!0;do for(var n=!1,r=Ff;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,qf(r,a))}else a=fd,a=lt(r,r===ud?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,qf(r,a))}r=r.next}while(n);zf=!1}}function Uf(){Wf()}function Wf(){Rf=Lf=!1;var e=0;Bf!==0&&Mp()&&(e=Bf);for(var t=Ue(),n=null,r=Ff;r!==null;){var i=r.next,a=Gf(r,t);a===0?(r.next=null,n===null?Ff=i:n.next=i,i===null&&(If=n)):(n=r,(e!==0||a&3)&&(Rf=!0)),r=i}Nd!==0&&Nd!==5||Hf(e,!1),Bf!==0&&(Bf=0)}function Gf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ud,n=fd,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(pd===2||pd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),xt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=Kf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function Kf(e,t){if(Nd!==0&&Nd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Tf()&&e.callbackNode!==n)return null;var r=fd;return r=lt(e,e===ud?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Yd(e,r,t),Gf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?Kf.bind(null,e):null)}function qf(e,t){if(Tf())return null;Yd(e,t,!0)}function Jf(){Lp(function(){ld&6?ze(Ge,Uf):Wf()})}function Yf(){if(Bf===0){var e=Ua;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Bf=e}return Bf}function Xf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:I(e)}function Zf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Xf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Xf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Bf!==0){var e=new FormData(i,o);sc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),sc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Qf=0;Qf<_i.length;Qf++){var $f=_i[Qf];vi($f.toLowerCase(),`on`+($f[0].toUpperCase()+$f.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ep=`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(` `),tp=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(ep));function np(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){Ci(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){Ci(e)}i.currentTarget=null,a=c}}}}function rp(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(sp(t,e,2,!1),n.add(r))}function ip(e,t,n){var r=0;t&&(r|=4),sp(n,e,r,t)}var ap=`_reactListening`+Math.random().toString(36).slice(2);function op(e){if(!e[ap]){e[ap]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(tp.has(t)||ip(t,!1,e),ip(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ap]||(t[ap]=!0,ip(`selectionchange`,!1,t))}}function sp(e,t,n,r){switch(zh(t)){case 2:var i=Nh;break;case 8:i=Ph;break;default:i=Fh}n=i.bind(null,t,n,e),i=void 0,!jn||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 cp(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 c=r.stateNode.containerInfo;if(c===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(;c!==null;){if(o=Ft(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),o=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=kn(m,p),g!=null&&d.push(lp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?T(c,l,dp):null,c!==null&&fp(o,u,c,d,!1),l!==null&&f!==null&&fp(o,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(o,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(o,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=up(r,b),0<v.length&&(b=new er(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=up(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Zf(o,e,r,n,i)}np(o,t)})}function lp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function up(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=kn(e,n),i!=null&&r.unshift(lp(e,i,a)),i=kn(e,t),i!=null&&r.push(lp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function dp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fp(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=kn(n,a),l!=null&&o.unshift(lp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(lp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var pp=/\r\n?/g,mp=/\u0000|\uFFFD/g;function hp(e){return(typeof e==`string`?e:``+e).replace(pp,`
|
|
10
|
-
`).replace(mp,``)}function gp(e,t){return t=hp(t),hp(e)===t}function _p(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(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=I(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 o==`function`&&(n===`formAction`?(t!==`input`&&_p(e,t,`name`,a.name,a,null),_p(e,t,`formEncType`,a.formEncType,a,null),_p(e,t,`formMethod`,a.formMethod,a,null),_p(e,t,`formTarget`,a.formTarget,a,null)):(_p(e,t,`encType`,a.encType,a,null),_p(e,t,`method`,a.method,a,null),_p(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=I(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&rp(`scroll`,e);return;case`onScrollEnd`:r!=null&&rp(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__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=I(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`:rp(`beforetoggle`,e),rp(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(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=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function vp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&rp(`scroll`,e);return;case`onScrollEnd`:r!=null&&rp(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function yp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:rp(`error`,e),rp(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,o,s,n,null)}}a&&_p(e,t,`srcSet`,n.srcSet,n,null),r&&_p(e,t,`src`,n.src,n,null);return;case`input`:rp(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:_p(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in rp(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:_p(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in rp(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:_p(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:_p(e,t,l,r,n,null)}return;case`dialog`:rp(`beforetoggle`,e),rp(`toggle`,e),rp(`cancel`,e),rp(`close`,e);break;case`iframe`:case`object`:rp(`load`,e);break;case`video`:case`audio`:for(r=0;r<ep.length;r++)rp(ep[r],e);break;case`image`:rp(`error`,e),rp(`load`,e);break;case`details`:rp(`toggle`,e);break;case`embed`:case`source`:case`link`:rp(`error`,e),rp(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&vp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&_p(e,t,c,r,n,null))}var bp={};function xp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||_p(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&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&_p(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||_p(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&_p(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:_p(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&_p(e,t,s,a,r,o)}fn(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:_p(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&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:_p(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)&&_p(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:_p(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&vp(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||vp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&_p(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||_p(e,t,f,p,r,m)}function Sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Cp(){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&&Sp(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&&Sp(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 wp=null,Tp=null;function Ep(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Op(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 kp(e,t,n,r){return n=Ep(n).createElement(e),n[Tt]=r,n[Et]=t,yp(n,e,t),zt(n),n}function Ap(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 jp=null;function Mp(){var e=window.event;return e&&e.type===`popstate`?e!==jp&&(jp=e,!0):(jp=null,!1)}var Np=typeof setTimeout==`function`?setTimeout:void 0,Pp=typeof clearTimeout==`function`?clearTimeout:void 0,Fp=typeof Promise==`function`?Promise:void 0,Ip=typeof requestAnimationFrame==`function`?requestAnimationFrame:Np,Lp=typeof queueMicrotask==`function`?queueMicrotask:Fp===void 0?Np:function(e){return Fp.resolve(null).then(e).catch(Rp)};function Rp(e){setTimeout(function(){throw e})}function zp(e){return e===`head`}function Bp(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),ig(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Nm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Nm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Nm(e.ownerDocument.body)}n=i}while(n);ig(t)}function Vp(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 Hp(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 L(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 Up(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 Wp(e){return Up(e.getBoundingClientRect(),getComputedStyle(e),e)}function Gp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Up(t,n,e)}function Kp(e){return e.documentElement.clientHeight}function qp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Jp(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`&&(Kp(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+=fh(f),u>hh){s.length=o;break}f=new Promise(qp.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 Yp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Yp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Yp.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},Yp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Xp(e){return{name:e,group:new Yp(`group`,e),imagePair:new Yp(`image-pair`,e),old:new Yp(`old`,e),new:new Yp(`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(nm(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=em(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Qp,e,s,r)}this._eventListeners=a}};function Qp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=nm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=em(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,$p,e,n,i),r.splice(t,1),a!==null&&a()}};function $p(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function em(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function tm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function nm(e,t,n,r){if(e.length===0)return-1;r=tm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&tm(a.optionsOrUseCapture)===r)return i}return-1}Zp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,em(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,em(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Zp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,rm,e,void 0,void 0)};function rm(e,t){return e.tag!==6&&(e=v(e),km(e,t))}Zp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,im,t,void 0,void 0);for(var n=t.length-1;0<=n&&!rm(t[n],e);n--);};function im(e,t){return t.push(e),!1}Zp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Ep(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,am,e,void 0,void 0))};function am(e,t){return e.tag!==6&&(e=v(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),p(this._fragmentFiber.child,!1,om,e,void 0,void 0)};function om(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,sm,e,void 0,void 0);for(var n=t=0;n<cm.length;n++){var r=cm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):cm[t++]=r}cm.length=t}};function sm(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var cm=[],lm=!1;function um(e,t,n){cm.push({fragmentInstance:e,observer:t,instance:n}),lm||(lm=!0,Am(function(){lm=!1;var e=cm;cm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Zp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,dm,e,void 0,void 0),e};function dm(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=v(e),t.push.apply(t,e.getClientRects());return!1}Zp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Zp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,im,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||fm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fm(e,t,n,r,i){var a=Ft(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=m(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=T(n,a,w),t===null?t=!1:(p(t,!0,S,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=T(r,a,w),t===null?t=!1:(p(t,!0,C,a,r),a=y,b=y=null,t=a!==null)),t):!1}function pm(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(i(566));var t=[];p(this._fragmentFiber.child,!1,im,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),pm(e,n);return}if(r=v(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 a=t[r];a.tag===6?(a=v(a),pm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function mm(e,t){return e=v(e),hm(e,t),!1}function hm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function gm(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,em(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<cm.length;i++){var a=cm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(cm[r++]=a)}cm.length=r,n.observe(e)}),hm(e,t))}function _m(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,em(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?um(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function vm(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`:vm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ym(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[Mt])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=Tm(e.nextSibling),e===null)break}return null}function bm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Tm(e.nextSibling),e===null))return null;return e}function xm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Tm(e.nextSibling),e===null))return null;return e}function Sm(e){return e.data===`$?`||e.data===`$~`}function Cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function wm(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 Tm(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 Em=null;function Dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Tm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Om(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 km(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 Am(e){Ip(function(){Ip(function(t){return e(t)})})}function jm(e,t,n){switch(t=Ep(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Mm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&_p(e,t,r,null,bp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Nm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Pm=new Map,Fm=new Set;function Im(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 Lm=_e.d;_e.d={f:Rm,r:zm,D:Hm,C:Um,L:Wm,m:Gm,X:qm,S:Km,M:Jm};function Rm(){var e=Lm.f(),t=$d();return e||t}function zm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?lc(t):Lm.r(e)}var Bm=typeof document>`u`?null:document;function Vm(e,t,n){var r=Bm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Fm.has(i)||(Fm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),yp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Hm(e){Lm.D(e),Vm(`dns-prefetch`,e,null)}function Um(e,t){Lm.C(e,t),Vm(`preconnect`,e,t)}function Wm(e,t,n){Lm.L(e,t,n);var r=Bm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Xm(e);break;case`script`:a=eh(e)}if(!(Pm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Pm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Zm(a))||t===`script`&&r.querySelector(th(a))))){var o=r.createElement(`link`);yp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Gm(e,t){Lm.m(e,t);var n=Bm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=eh(e)}if(!Pm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),Pm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(th(a)))return}r=n.createElement(`link`),yp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Km(e,t,n){Lm.S(e,t,n);var r=Bm;if(r&&e){var i=Rt(r).hoistableStyles,a=Xm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Zm(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Pm.get(a))&&ih(e,n);var c=o=r.createElement(`link`);zt(c),yp(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,rh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function qm(e,t){Lm.X(e,t);var n=Bm;if(n&&e){var r=Rt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=E({src:e,async:!0},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),zt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jm(e,t){Lm.M(e,t);var n=Bm;if(n&&e){var r=Rt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),zt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ym(e,t,n,r){var a=(a=P.current)?Im(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Xm(n.href),t=Rt(a).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=Xm(n.href);var o=Rt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Pm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pm.set(e,o)),$m(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=eh(n),t=Rt(a).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(i(444,e))}}function Xm(e){return`href="`+sn(e)+`"`}function Zm(e){return`link[rel="stylesheet"][`+e+`]`}function Qm(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function $m(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),yp(t,`link`,n),zt(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 eh(e){return`[src="`+sn(e)+`"]`}function th(e){return`script[async]`+e}function nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),yp(r,`style`,a),rh(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Xm(n.href);var o=e.querySelector(Zm(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Qm(n),(a=Pm.get(a))&&ih(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),yp(o,`link`,r),t.state.loading|=4,rh(o,n.precedence,e),t.instance=o;case`script`:return o=eh(n.src),(a=e.querySelector(th(o)))?(t.instance=a,zt(a),a):(r=n,(a=Pm.get(o))&&(r=E({},n),ah(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),yp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,rh(r,n.precedence,e));return t.instance}function rh(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 ih(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function ah(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var oh=null;function sh(e,t,n){if(oh===null){var r=new Map,i=oh=new Map;i.set(n,r)}else i=oh,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[Mt]||a[Tt]||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 ch(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function lh(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 uh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function dh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function fh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ph(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=fh(t),e.suspenseyImages.push(t)),e=yh.bind(e),t.decode().then(e,e))}function mh(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=Xm(r.href),a=t.querySelector(Zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=vh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Qm(r),(i=Pm.get(i))&&ih(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),yp(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=vh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var hh=0;function gh(e,t){return e.stylesheets&&e.count===0&&xh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&hh===0&&(hh=62500*Cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>hh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _h(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)xh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function vh(){this.count--,_h(this)}function yh(){this.imgCount--,_h(this)}var bh=null;function xh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bh=new Map,t.forEach(Sh,e),bh=null,vh.call(e))}function Sh(e,t){if(!(t.state.loading&4)){var n=bh.get(e);if(n)var r=n.get(null);else{n=new Map,bh.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=vh.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 Ch={$$typeof:re,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function wh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 Th(e,t,n,r,i,a,o,s,c,l,u,d){return e=new wh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},yo(a),e}function Eh(e){return e?(e=Ni,e):Ni}function Dh(e,t,n,r,i,a){i=Eh(i),r.context===null?r.context=i:r.pendingContext=i,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=So(e,r,t),n!==null&&(Jd(n,e,t),Co(n,e,t))}function Oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kh(e,t){Oh(e,t),(e=e.alternate)&&Oh(e,t)}function Ah(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Jd(t,e,67108864),kh(e,67108864)}}function jh(e){if(e.tag===13||e.tag===31){var t=Gd();t=bt(t);var n=Ai(e,t);n!==null&&Jd(n,e,t),kh(e,t)}}var Mh=!0;function Nh(e,t,n,r){var i=ge.T;ge.T=null;var a=_e.p;try{_e.p=2,Fh(e,t,n,r)}finally{_e.p=a,ge.T=i}}function Ph(e,t,n,r){var i=ge.T;ge.T=null;var a=_e.p;try{_e.p=8,Fh(e,t,n,r)}finally{_e.p=a,ge.T=i}}function Fh(e,t,n,r){if(Mh){var i=Ih(r);if(i===null)cp(e,t,r,Lh,n),Jh(e,r);else if(Xh(i,e,t,n,r))r.stopPropagation();else if(Jh(e,r),t&4&&-1<qh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Vf(a),!(ld&6)&&(Ad=Ue()+500,Hf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Jd(s,a,2),$d(),kh(a,2)}if(a=Ih(r),a===null&&cp(e,t,r,Lh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cp(e,t,r,null,n)}}function Ih(e){return e=Cn(e),Rh(e)}var Lh=null;function Rh(e){if(Lh=null,e=Ft(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 Lh=e,null}function zh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Bh=!1,Vh=null,Hh=null,Uh=null,Wh=new Map,Gh=new Map,Kh=[],qh=`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 Jh(e,t){switch(e){case`focusin`:case`focusout`:Vh=null;break;case`dragenter`:case`dragleave`:Hh=null;break;case`mouseover`:case`mouseout`:Uh=null;break;case`pointerover`:case`pointerout`:Wh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Gh.delete(t.pointerId)}}function Yh(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=It(t),t!==null&&Ah(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Xh(e,t,n,r,i){switch(t){case`focusin`:return Vh=Yh(Vh,e,t,n,r,i),!0;case`dragenter`:return Hh=Yh(Hh,e,t,n,r,i),!0;case`mouseover`:return Uh=Yh(Uh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Wh.set(a,Yh(Wh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Gh.set(a,Yh(Gh.get(a)||null,e,t,n,r,i)),!0}return!1}function Zh(e){var t=Ft(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){jh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){jh(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 Qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ih(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&Ah(t),e.blockedOn=n,!1;t.shift()}return!0}function $h(e,t,n){Qh(e)&&n.delete(t)}function eg(){Bh=!1,Vh!==null&&Qh(Vh)&&(Vh=null),Hh!==null&&Qh(Hh)&&(Hh=null),Uh!==null&&Qh(Uh)&&(Uh=null),Wh.forEach($h),Gh.forEach($h)}function tg(e,n){e.blockedOn===n&&(e.blockedOn=null,Bh||(Bh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eg)))}var ng=null;function rg(e){ng!==e&&(ng=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ng===e&&(ng=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(Rh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,sc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ig(e){function t(t){return tg(t,e)}Vh!==null&&tg(Vh,e),Hh!==null&&tg(Hh,e),Uh!==null&&tg(Uh,e),Wh.forEach(t),Gh.forEach(t);for(var n=0;n<Kh.length;n++){var r=Kh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Kh.length&&(n=Kh[0],n.blockedOn===null);)Zh(n),n.blockedOn===null&&Kh.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[Et]||null;if(typeof a==`function`)o||rg(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Rh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),rg(n)}}}function ag(){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 og(e){this._internalRoot=e}sg.prototype.render=og.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Dh(n,Gd(),e,t,null,null)},sg.prototype.unmount=og.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dh(e.current,2,null,e,null,null),$d(),t[Dt]=null}};function sg(e){this._internalRoot=e}sg.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kh.length&&t!==0&&t<Kh[n].priority;n++);Kh.splice(n,0,e),n===0&&Zh(e)}};var cg=n.version;if(cg!==`19.3.1`)throw Error(i(527,cg,`19.3.1`));_e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var lg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:ge,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ug=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ug.isDisabled&&ug.supportsFiber)try{Qe=ug.inject(lg),$e=ug}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ac,s=jc,c=Mc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Th(e,1,!1,null,null,n,r,null,o,s,c,ag),e[Dt]=t.current,op(e),new og(t)}})),Ee=a(((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=Te()})),P=g(o(),1),De=Ee(),F=c(),Oe=class extends P.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){_e(e,{stage:`react`,componentStack:t.componentStack??``})}render(){return this.state.failed?(0,F.jsxs)(`main`,{role:`alert`,children:[(0,F.jsx)(`p`,{children:r(`页面遇到错误,请刷新后重试。`,`The page encountered an error. Refresh to try again.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>location.reload(),children:r(`刷新页面`,`Refresh page`)})]}):this.props.children}},ke=1024,Ae=.7;function je(e,t){return e>=t+72?`focus`:e<=228?`collapse`:null}function Me(e,t){return e>t?t+Math.min(24,(e-t)/3):e<300?300-Math.min(24,(300-e)/3):null}function Ne(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function Pe(e,t,n){let r=t===0?56:Ne(t,264,420),i=e-r-400,a=n===0||i<300?0:Math.min(i,Ne(n,300,e*Ae));return{sidebar:r,center:Math.max(0,e-r-a),rightbar:a}}var Fe=(0,P.createContext)(null),Ie=new Map;function Le(e,t){return Ie.set(e,t),()=>{Ie.delete(e)}}function Re(e,t){if(!t)return!1;if(e.contains(t))return!0;for(let[n,r]of Ie)if(r.current===e&&n.isConnected&&n.contains(t))return!0;return!1}function ze(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.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||!Re(n,document.activeElement))?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s&&Re(n,document.activeElement)||(e.preventDefault(),o.focus())},s=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);t[t.length-1]===n&&!Re(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 Be({productTitle:e}){return(0,P.useEffect)(()=>(document.title=e,()=>{document.title=e}),[e]),null}var Ve={frame:`_frame_bac9o_1`,sidebarCol:`_sidebarCol_bac9o_24`,centerCol:`_centerCol_bac9o_33`,drawerMask:`_drawerMask_bac9o_49`,handle:`_handle_bac9o_64`,snapHint:`_snapHint_bac9o_84`,rightbarCol:`_rightbarCol_bac9o_121`,overlayLayer:`_overlayLayer_bac9o_129`};function He(e){return(0,F.jsx)(`div`,{className:Ve.centerCol,children:e.children})}function Ue({usePanelInfo:e,renderSlot:t}){return t(`main`,{},{entryKey:e(e=>e.activePanelId)??`conversation`})}function We(e){return(0,F.jsx)(`div`,{className:Ve.rightbarCol,"data-rightbar-col":!0,children:e.children})}function Ge(e){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(0),i=(0,P.useRef)(0),a=(0,P.useRef)(null),o=(0,P.useRef)(null),s=(0,P.useRef)({onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd});s.current={onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd};let c=(0,P.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,P.useEffect)(()=>c,[c]);let l=(0,P.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,P.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,P.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,s.current.onDrag(e.clientX-r.current),c(!1))},[c]),f=(0,P.useCallback)(e=>{o.current?.id===e.pointerId&&c()},[c]);return(0,F.jsx)(`div`,{className:Ve.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 Ke({useStore:e,usePanelInfo:t,actions:n,renderSlot:r,t:i}){let a=e(e=>e.layoutInfo),o=(0,P.useRef)(null),s=a.viewportWidth;(0,P.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<ke,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=Pe(s,!a.rightbarShown&&c?0:d,f),m=c&&!u,h=(0,P.useRef)(null);ze(h,m,n.closeSidebar),(0,P.useEffect)(()=>{if(!m)return;let e=o.current?.querySelectorAll(`.${Ve.centerCol}, .${Ve.rightbarCol}`)??[];for(let t of e)t.setAttribute(`inert`,``);return()=>{for(let t of e)t.removeAttribute(`inert`)}},[m]);let g=Pe(s,c?0:d,a.rightbarTrack?f:0),[_,v]=(0,P.useState)(null),[y,b]=(0,P.useState)(null),x=s-g.sidebar,S=l?s-56:a.rightbarFocus?x:_??p.rightbar,C=l&&a.rightbarTrack?S:a.rightbarFocus&&a.rightbarTrack?x:_!==null&&a.rightbarTrack?_:g.rightbar,w=m?Math.min(d,Math.max(0,s-48)):g.sidebar,T=(0,P.useRef)(g);T.current=g;let E=(0,P.useRef)(p.rightbar);E.current=p.rightbar;let D=(0,P.useRef)(0),O=(0,P.useRef)(0),[k,ee]=(0,P.useState)(!1),te=(0,P.useCallback)(()=>{ee(!1)},[]),ne=(0,P.useCallback)(()=>{D.current=T.current.sidebar,ee(!0)},[]),A=(0,P.useCallback)(e=>{n.setSidebar(D.current+e)},[n]),re=Math.min(s*Ae,s-g.sidebar-400),ie=(0,P.useRef)(re),j=(0,P.useRef)(!1),ae=(0,P.useCallback)(()=>{O.current=E.current,ie.current=re,j.current=!1,v(null),b(null),ee(!0)},[re]),oe=(0,P.useCallback)(e=>{if(j.current)return;let t=O.current-e,r=je(t,ie.current);r?(j.current=!0,v(null),b(null),ee(!1),r===`focus`?n.focusRightbar():n.collapseRightbar()):(n.setRightbar(t),v(Me(t,ie.current)),b(t>ie.current?`focus`:t<300?`collapse`:null))},[n]),M=(0,P.useCallback)(()=>{v(null),b(null),ee(!1)},[]),se=i(`brand.localBuild`),ce=(0,P.useMemo)(()=>r(`sidebar`,{collapsed:u,width:w}),[r,u,w]),le=(0,P.useMemo)(()=>(0,F.jsx)(Ue,{usePanelInfo:t,renderSlot:r}),[t,r]),ue=(0,P.useMemo)(()=>r(`shell.overlay`,{}),[r]);return(0,F.jsxs)(`div`,{ref:o,className:Ve.frame,style:{gridTemplateColumns:`${g.sidebar}px minmax(0, 1fr) ${C}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":k||void 0,"data-rightbar-elastic":y??void 0,children:[(0,F.jsx)(Be,{productTitle:se}),m&&(0,F.jsx)(`button`,{type:`button`,className:Ve.drawerMask,tabIndex:-1,"aria-label":i(`sidebar.close`),onClick:n.closeSidebar}),(0,F.jsx)(`div`,{ref:h,className:Ve.sidebarCol,style:m?{width:w}: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,F.jsx)(Fe.Provider,{value:m?h:null,children:ce})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(He,{children:le}),(0,F.jsx)(We,{children:r(`rightbar`,{width:S,viewportWidth:s,canShow:p.rightbar>0})})]}),(0,F.jsx)(`div`,{className:Ve.overlayLayer,"data-shell-overlay":!0,children:ue}),!u&&!c&&(0,F.jsx)(Ge,{side:`sidebar`,left:g.sidebar,onStart:ne,onDrag:A,onEnd:te}),a.rightbarShown&&!a.rightbarFullscreen&&!a.rightbarFocus&&p.rightbar>0&&(0,F.jsx)(Ge,{side:`rightbar`,left:s-S,onStart:ae,onDrag:oe,onEnd:M}),y&&(0,F.jsx)(`div`,{className:Ve.snapHint,role:`status`,style:{left:s-S},children:i(y===`focus`?`rightbar.drag.focus`:`rightbar.drag.collapse`)})]})}var qe=`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 Je({size:e=24,className:t}){return(0,F.jsx)(`span`,{className:t,"aria-hidden":`true`,style:{display:`inline-block`,flexShrink:0,width:e,height:e,backgroundColor:`currentColor`,maskImage:`url("${qe}")`,WebkitMaskImage:`url("${qe}")`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}})}var Ye={bubble:`_bubble_1nw3t_1`,"tooltip-in":`_tooltip-in_1nw3t_1`};function Xe({label:e,side:t=`right`,delayMs:n=0,disabled:r=!1,maxWidth:i,children:a}){let o=(0,P.useRef)(null),s=a.props.ref,c=(0,P.useCallback)(e=>{o.current=e,typeof s==`function`?s(e):s!=null&&(s.current=e)},[s]),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(t),p=(0,P.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,P.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,P.useRef)(null),_=(0,P.useRef)({hover:!1,focus:!1}),v=(0,P.useCallback)(()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);(0,P.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,F.jsxs)(F.Fragment,{children:[(0,P.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,F.jsx)(`span`,{ref:p,className:Ye.bubble,"data-side":d,style:{left:l.x,top:h,...i===void 0?{}:{maxWidth:i}},role:`tooltip`,children:m})]})}var Ze={dot:`_dot_1cjbl_3`,matrix:`_matrix_1cjbl_4`,cell:`_cell_1cjbl_62`,"piw-state-dot-chase":`_piw-state-dot-chase_1cjbl_1`},Qe=[[0,0],[4,0],[8,0],[8,4],[8,8],[4,8],[0,8],[0,4]];function $e({state:e,size:t=10,className:r}){return e===`ongoing`?(0,F.jsx)(`svg`,{className:n(Ze.matrix,r),"data-state":`ongoing`,width:t,height:t,viewBox:`0 0 10 10`,shapeRendering:`crispEdges`,"aria-hidden":`true`,children:Qe.map(([e,t],n)=>(0,F.jsx)(`rect`,{className:Ze.cell,x:e,y:t,width:`2`,height:`2`,style:{animationDelay:`${(n-Qe.length)*125}ms`}},`${e}-${t}`))}):(0,F.jsx)(`span`,{className:n(Ze.dot,r),"data-state":e,style:{width:t,height:t},"aria-hidden":`true`})}var et=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),tt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z`,fill:`currentColor`})]}),nt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_2580_121189)`,children:[(0,F.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,F.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,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_2580_121189`,children:(0,F.jsx)(`rect`,{width:14,height:14,fill:`currentColor`})})})]}),rt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_1450_63327)`,children:[(0,F.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,F.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,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_1450_63327`,children:(0,F.jsx)(`rect`,{width:16,height:16,fill:`currentColor`})})})]}),it=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),at=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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,F.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`})]}),ot=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{d:`M8.64453 1.5V7.34961H14.5V8.65039H8.64453V14.5H7.34473V8.65039H1.5V7.34961H7.34473V1.5H8.64453Z`,fill:`currentColor`})}),st=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ct=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),lt=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ut=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`path`,{d:`M14.1168 13.197L13.197 14.1167L1.8833 2.80303L2.80309 1.88324L14.1168 13.197Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M13.197 1.88326L14.1168 2.80305L2.80309 14.1168L1.8833 13.197L13.197 1.88326Z`,fill:`currentColor`})]}),dt=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ft=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),pt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),mt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),ht=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),gt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{d:`M2.871 13.1286C0.0387669 10.2962 0.0387669 5.70383 2.871 2.87141C5.70341 0.0390029 10.2957 0.0391154 13.1282 2.87141L12.1387 3.86094C9.85292 1.57538 6.1469 1.57596 3.86123 3.86163C1.57573 6.14732 1.57573 9.85269 3.86123 12.1384C6.1469 14.424 9.85292 14.4246 12.1387 12.1391L13.1282 13.1286C10.2957 15.9609 5.70341 15.961 2.871 13.1286Z`,fill:`currentColor`})}),_t=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),vt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),yt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.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`})}),bt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,F.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,F.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`})]}),xt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,F.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,F.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`})]}),St=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.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`})}),Ct=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M8.65039 0.5V2.5H7.34961V0.5H8.65039Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M8.65039 13.5V15.5H7.34961V13.5H8.65039Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M3.15808 2.24035L4.57229 3.65456L3.6525 4.57435L2.23829 3.16014L3.15808 2.24035Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M12.3505 11.4327L13.7647 12.8469L12.8449 13.7667L11.4307 12.3525L12.3505 11.4327Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M2.24537 12.8469L3.65958 11.4327L4.57937 12.3525L3.16516 13.7667L2.24537 12.8469Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M11.4377 3.65455L12.852 2.24033L13.7718 3.16012L12.3575 4.57434L11.4377 3.65455Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M0.5 7.35461H2.5V8.6554H0.5L0.5 7.35461Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M13.5 7.35461H15.5V8.6554H13.5V7.35461Z`,fill:`currentColor`})]}),wt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),Tt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`path`,{d:`M12.1665 13.5811V14.7803H3.66651V13.5811H12.1665Z`,fill:`currentColor`}),(0,F.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`})]}),Et=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),Dt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`ellipse`,{cx:`8`,cy:`3.6`,rx:`5.75`,ry:`2.4`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,F.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,F.jsx)(`path`,{d:`M2.25 7.95A5.75 2.4 0 0 0 13.75 7.95`,stroke:`currentColor`,strokeWidth:`1.25`})]}),Ot=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),kt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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,F.jsx)(`path`,{d:`M7.39455 9.44026V10.8109H6.16921V9.44026H7.39455Z`,fill:`currentColor`})]}),At=({size:e=20,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M12.7962 12.5661V11.0832H7.20548V12.5661L12.7962 12.5661Z`,fill:`currentColor`})]}),jt=x(),Mt={viewport:`_viewport_1h2wd_1`,toast:`_toast_1h2wd_13`,"toast-in":`_toast-in_1h2wd_1`,body:`_body_1h2wd_29`,message:`_message_1h2wd_30`,detail:`_detail_1h2wd_31`,close:`_close_1h2wd_34`},Nt=4e3,Pt=[],Ft=new Set,It=new Map,Lt=0;function Rt(e){Pt=e;for(let e of Ft)e()}function zt(e){let t=e.key??`toast-${++Lt}`,n={key:t,tone:e.tone??`error`,message:e.message,detail:e.detail,detailLabel:e.detailLabel};return Rt([...Pt.filter(e=>e.key!==t),n].slice(-4)),clearTimeout(It.get(t)),It.delete(t),n.tone===`info`&&It.set(t,setTimeout(()=>Bt(t),Nt)),t}function Bt(e){clearTimeout(It.get(e)),It.delete(e),Pt.some(t=>t.key===e)&&Rt(Pt.filter(t=>t.key!==e))}function Vt(e,t,n,r){(0,P.useEffect)(()=>{t&&zt({key:e,message:t,detail:n&&n!==t?n:void 0,detailLabel:r})},[e,t,n,r])}var Ht=e=>(Ft.add(e),()=>{Ft.delete(e)}),Ut=()=>Pt;function Wt({closeLabel:e=`Dismiss`,detailLabel:t=`Details`}){let n=(0,P.useSyncExternalStore)(Ht,Ut,Ut);return typeof document>`u`?null:(0,jt.createPortal)((0,F.jsx)(`div`,{className:Mt.viewport,"data-toast-viewport":!0,children:n.map(n=>(0,F.jsxs)(`div`,{className:Mt.toast,"data-tone":n.tone,role:n.tone===`error`?`alert`:`status`,children:[(0,F.jsxs)(`div`,{className:Mt.body,children:[(0,F.jsx)(`p`,{className:Mt.message,children:n.message}),n.detail&&(0,F.jsxs)(`details`,{className:Mt.detail,children:[(0,F.jsx)(`summary`,{children:n.detailLabel??t}),(0,F.jsx)(`pre`,{children:n.detail})]})]}),(0,F.jsx)(`button`,{type:`button`,className:Mt.close,"aria-label":e,onClick:()=>Bt(n.key),children:`×`})]},n.key))}),document.body)}var Gt={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`},Kt=150,qt=2e3;function Jt({id:e,label:t,wide:r,usePanelInfo:i,selectPanel:a,renderSlot:o}){let s=i(t=>t.activePanelId===e);return(0,F.jsx)(Xe,{label:t,delayMs:500,disabled:r,children:(0,F.jsxs)(`button`,{type:`button`,className:n(Gt.panelRow,s&&Gt.panelActive),"aria-label":t,"aria-current":s?`page`:void 0,onClick:()=>{a(e)},children:[(0,F.jsx)(`span`,{className:Gt.panelGlyph,"aria-hidden":`true`,children:o(`sidebar.panellist`,{size:r?16:18,active:s},{only:e})}),r&&(0,F.jsx)(`span`,{className:n(Gt.panelTitle,Gt.wide),children:t})]})})}function Yt({collapsed:e,width:t,startSession:r,sessionBusy:i=!1,toggleSidebar:a,selectPanel:o,usePanels:s,usePanelInfo:c,t:l,renderSlot:u}){let d=s(e=>e),[f,p]=(0,P.useState)(e);(0,P.useEffect)(()=>{if(!e){p(!1);return}let t=window.setTimeout(()=>{p(!0)},Kt);return()=>{window.clearTimeout(t)}},[e]);let m=!e||!f,h=(0,P.useRef)(t);e||(h.current=t);let g=(0,P.useRef)(!e);e||(g.current=!0);let _=(0,P.useRef)(null),[v,y]=(0,P.useState)(!1),b=(0,P.useRef)(void 0),x=()=>{b.current===void 0&&(b.current=window.setTimeout(()=>{b.current=void 0,y(!1)},qt))},S=()=>{window.clearTimeout(b.current),b.current=void 0};return(0,P.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,F.jsxs)(`div`,{ref:_,className:n(Gt.root,!m&&Gt.collapsed,!m&&g.current&&Gt.railIn,e&&m&&Gt.fading,!v&&Gt.quietBars),style:m?{width:e?h.current:t}:void 0,onPointerEnter:()=>{S(),y(!0)},onPointerLeave:()=>{x()},children:[(0,F.jsxs)(`div`,{className:Gt.logoRow,children:[m&&(0,F.jsx)(`button`,{type:`button`,className:n(Gt.brand,Gt.wide),"aria-label":l(`session.new.label`),disabled:i,onClick:()=>{r()},children:(0,F.jsxs)(`span`,{className:Gt.brandIdentity,"aria-hidden":`true`,children:[(0,F.jsx)(`span`,{className:Gt.brandMark,children:u(`sidebar.brand.mark`,{size:24},{fallback:(0,F.jsx)(Je,{size:24})})}),(0,F.jsx)(`span`,{className:Gt.brandName,children:u(`sidebar.brand.name`,{},{fallback:(0,F.jsx)(`span`,{className:Gt.fallbackBrandName,children:l(`brand.localBuild`)})})})]})}),(0,F.jsx)(Xe,{label:l(e?`toggle.open`:`toggle.collapse`),delayMs:500,children:(0,F.jsxs)(`button`,{type:`button`,className:n(Gt.iconButton,Gt.toggle),"aria-label":l(e?`toggle.open`:`toggle.collapse`),"aria-expanded":!e,"data-sidebar-toggle":!0,onClick:()=>{a()},children:[!m&&(0,F.jsx)(`span`,{className:Gt.railMark,"aria-hidden":`true`,children:u(`sidebar.brand.mark`,{size:24},{fallback:(0,F.jsx)(Je,{size:24})})}),(0,F.jsx)(it,{className:Gt.panelIcon,size:m?16:18})]})})]}),(0,F.jsx)(Xe,{label:l(`session.new.label`),delayMs:500,disabled:m,children:(0,F.jsxs)(`button`,{type:`button`,className:Gt.newSession,"aria-label":l(`session.new.label`),disabled:i,onClick:()=>{r()},children:[(0,F.jsx)(et,{size:m?14:18}),m&&(0,F.jsx)(`span`,{className:n(Gt.newSessionLabel,Gt.wide),children:l(`session.new`)})]})}),d.length>0&&(0,F.jsx)(`nav`,{className:Gt.panelList,"aria-label":l(`panels.label`),children:d.map(({id:e,label:t})=>(0,F.jsx)(Jt,{id:e,label:t,wide:m,usePanelInfo:c,selectPanel:o,renderSlot:u},e))}),(0,F.jsx)(`div`,{className:Gt.regionArea,children:u(`sidebar.workspaces`,{wide:m,expandSidebar:()=>{e&&a()}})}),(0,F.jsxs)(`div`,{className:Gt.footArea,children:[(0,F.jsx)(`div`,{className:Gt.footerActions,children:u(`sidebar.footer.action`,{wide:m})}),(0,F.jsx)(`div`,{className:Gt.settingsArea,children:u(`sidebar.settings`,{wide:m})})]})]})}function Xt(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 Zt={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 Qt({t:e,renderSlot:t,children:n}){return(0,F.jsxs)(`div`,{className:Zt.root,children:[(0,F.jsxs)(`div`,{className:Zt.stack,children:[(0,F.jsxs)(`div`,{className:Zt.headline,children:[(0,F.jsx)(`span`,{className:Zt.logoFrame,children:t(`conversation.hero.brand.mark`,{size:34,className:Zt.logo},{fallback:(0,F.jsx)(Je,{size:34,className:Zt.logo})})}),(0,F.jsxs)(`span`,{className:Zt.titleGroup,children:[(0,F.jsx)(`span`,{children:e(`hero.headline`)}),(0,F.jsx)(`span`,{className:Zt.previewBadge,children:e(`hero.preview`)})]})]}),(0,F.jsx)(`div`,{className:Zt.body})]}),n]})}var $t={root:`_root_gyk4n_1`,heroTools:`_heroTools_gyk4n_44`,header:`_header_gyk4n_51`,headerHidden:`_headerHidden_gyk4n_61`,titleRow:`_titleRow_gyk4n_65`,titleCluster:`_titleCluster_gyk4n_72`,crumbs:`_crumbs_gyk4n_80`,crumbSeg:`_crumbSeg_gyk4n_89`,crumbSep:`_crumbSep_gyk4n_96`,crumb:`_crumb_gyk4n_80`,crumbSubagent:`_crumbSubagent_gyk4n_118`,crumbCurrent:`_crumbCurrent_gyk4n_127`,headerActions:`_headerActions_gyk4n_133`,headerUtilities:`_headerUtilities_gyk4n_140`,headerCorner:`_headerCorner_gyk4n_156`,tabs:`_tabs_gyk4n_170`,tab:`_tab_gyk4n_40`,tabActive:`_tabActive_gyk4n_208`,viewArea:`_viewArea_gyk4n_216`,widthHandle:`_widthHandle_gyk4n_235`,composerStack:`_composerStack_gyk4n_303`,composerSeat:`_composerSeat_gyk4n_314`,body:`_body_gyk4n_224`,scrollBody:`_scrollBody_gyk4n_350`,composerHero:`_composerHero_gyk4n_451`,heroWorkspaceRow:`_heroWorkspaceRow_gyk4n_464`},en={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`},tn={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`},nn={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`};function rn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var an=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,on=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sn={};function cn(e,t){return((t||sn).jsx?on:an).test(e)}var ln=/[ \t\n\f\r]/g;function un(e){return typeof e==`object`?e.type===`text`&&dn(e.value):dn(e)}function dn(e){return e.replace(ln,``)===``}var fn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};fn.prototype.normal={},fn.prototype.property={},fn.prototype.space=void 0;function pn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new fn(n,r,t)}function mn(e){return e.toLowerCase()}var hn=class{constructor(e,t){this.attribute=t,this.property=e}};hn.prototype.attribute=``,hn.prototype.booleanish=!1,hn.prototype.boolean=!1,hn.prototype.commaOrSpaceSeparated=!1,hn.prototype.commaSeparated=!1,hn.prototype.defined=!1,hn.prototype.mustUseProperty=!1,hn.prototype.number=!1,hn.prototype.overloadedBoolean=!1,hn.prototype.property=``,hn.prototype.spaceSeparated=!1,hn.prototype.space=void 0;var gn=e({boolean:()=>vn,booleanish:()=>yn,commaOrSpaceSeparated:()=>Cn,commaSeparated:()=>Sn,number:()=>I,overloadedBoolean:()=>bn,spaceSeparated:()=>xn}),_n=0,vn=wn(),yn=wn(),bn=wn(),I=wn(),xn=wn(),Sn=wn(),Cn=wn();function wn(){return 2**++_n}var Tn=Object.keys(gn),En=class extends hn{constructor(e,t,n,r){let i=-1;if(super(e,t),Dn(this,`space`,r),typeof n==`number`)for(;++i<Tn.length;){let e=Tn[i];Dn(this,Tn[i],(n&gn[e])===gn[e])}}};En.prototype.defined=!0;function Dn(e,t,n){n&&(e[t]=n)}function On(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new En(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[mn(r)]=r,n[mn(a.attribute)]=r}return new fn(t,n,e.space)}var kn=On({properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:xn,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:I,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:xn,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:yn,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function An(e,t){return t in e?e[t]:t}function jn(e,t){return An(e,t.toLowerCase())}var Mn=On({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Sn,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:vn,allowPaymentRequest:vn,allowUserMedia:vn,alpha:vn,alt:null,as:null,async:vn,autoCapitalize:null,autoComplete:xn,autoFocus:vn,autoPlay:vn,blocking:xn,capture:null,charSet:null,checked:vn,cite:null,className:xn,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:yn,controls:vn,controlsList:xn,coords:I|Sn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vn,defer:vn,dir:null,dirName:null,disabled:vn,download:bn,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vn,formTarget:null,headers:xn,height:I,hidden:bn,high:I,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:vn,inputMode:null,integrity:null,is:null,isMap:vn,itemId:null,itemProp:xn,itemRef:xn,itemScope:vn,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vn,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:vn,muted:vn,name:null,nonce:null,noModule:vn,noValidate:vn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vn,optimum:I,pattern:null,ping:xn,placeholder:null,playsInline:vn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vn,referrerPolicy:null,rel:xn,required:vn,reversed:vn,rows:I,rowSpan:I,sandbox:xn,scope:null,scoped:vn,seamless:vn,selected:vn,shadowRootClonable:vn,shadowRootCustomElementRegistry:vn,shadowRootDelegatesFocus:vn,shadowRootMode:null,shadowRootSerializable:vn,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:vn,useMap:null,value:yn,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vn,declare:vn,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:vn,noHref:vn,noShade:vn,noWrap:vn,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:vn,disablePictureInPicture:vn,disableRemotePlayback:vn,exportParts:Sn,part:xn,prefix:null,property:null,results:I,security:null,unselectable:null},space:`html`,transform:jn}),Nn=On({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Cn,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:vn,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Sn,g2:Sn,glyphName:Sn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:An}),Pn=On({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Fn=On({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:jn}),In=On({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ln={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Rn=/[A-Z]/g,zn=/-[a-z]/g,Bn=/^data[-\w.:]+$/i;function Vn(e,t){let n=mn(t),r=t,i=hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Bn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(zn,Un);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!zn.test(e)){let n=e.replace(Rn,Hn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=En}return new i(r,t)}function Hn(e){return`-`+e.toLowerCase()}function Un(e){return e.charAt(1).toUpperCase()}var Wn=pn([kn,Mn,Pn,Fn,In],`html`),Gn=pn([kn,Nn,Pn,Fn,In],`svg`);function Kn(e){return e.join(` `).trim()}var qn=a(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
10
|
+
`).replace(mp,``)}function gp(e,t){return t=hp(t),hp(e)===t}function _p(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(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=I(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 o==`function`&&(n===`formAction`?(t!==`input`&&_p(e,t,`name`,a.name,a,null),_p(e,t,`formEncType`,a.formEncType,a,null),_p(e,t,`formMethod`,a.formMethod,a,null),_p(e,t,`formTarget`,a.formTarget,a,null)):(_p(e,t,`encType`,a.encType,a,null),_p(e,t,`method`,a.method,a,null),_p(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=I(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&rp(`scroll`,e);return;case`onScrollEnd`:r!=null&&rp(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__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=I(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`:rp(`beforetoggle`,e),rp(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(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=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function vp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&rp(`scroll`,e);return;case`onScrollEnd`:r!=null&&rp(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function yp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:rp(`error`,e),rp(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,o,s,n,null)}}a&&_p(e,t,`srcSet`,n.srcSet,n,null),r&&_p(e,t,`src`,n.src,n,null);return;case`input`:rp(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:_p(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in rp(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:_p(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in rp(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:_p(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:_p(e,t,l,r,n,null)}return;case`dialog`:rp(`beforetoggle`,e),rp(`toggle`,e),rp(`cancel`,e),rp(`close`,e);break;case`iframe`:case`object`:rp(`load`,e);break;case`video`:case`audio`:for(r=0;r<ep.length;r++)rp(ep[r],e);break;case`image`:rp(`error`,e),rp(`load`,e);break;case`details`:rp(`toggle`,e);break;case`embed`:case`source`:case`link`:rp(`error`,e),rp(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&vp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&_p(e,t,c,r,n,null))}var bp={};function xp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||_p(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&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&_p(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||_p(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&_p(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:_p(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&_p(e,t,s,a,r,o)}fn(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:_p(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&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:_p(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)&&_p(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:_p(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&vp(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||vp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&_p(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||_p(e,t,f,p,r,m)}function Sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Cp(){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&&Sp(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&&Sp(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 wp=null,Tp=null;function Ep(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Op(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 kp(e,t,n,r){return n=Ep(n).createElement(e),n[Tt]=r,n[Et]=t,yp(n,e,t),zt(n),n}function Ap(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 jp=null;function Mp(){var e=window.event;return e&&e.type===`popstate`?e!==jp&&(jp=e,!0):(jp=null,!1)}var Np=typeof setTimeout==`function`?setTimeout:void 0,Pp=typeof clearTimeout==`function`?clearTimeout:void 0,Fp=typeof Promise==`function`?Promise:void 0,Ip=typeof requestAnimationFrame==`function`?requestAnimationFrame:Np,Lp=typeof queueMicrotask==`function`?queueMicrotask:Fp===void 0?Np:function(e){return Fp.resolve(null).then(e).catch(Rp)};function Rp(e){setTimeout(function(){throw e})}function zp(e){return e===`head`}function Bp(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),ig(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Nm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Nm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Nm(e.ownerDocument.body)}n=i}while(n);ig(t)}function Vp(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 Hp(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 L(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 Up(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 Wp(e){return Up(e.getBoundingClientRect(),getComputedStyle(e),e)}function Gp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Up(t,n,e)}function Kp(e){return e.documentElement.clientHeight}function qp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Jp(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`&&(Kp(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+=fh(f),u>hh){s.length=o;break}f=new Promise(qp.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 Yp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Yp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Yp.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},Yp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Xp(e){return{name:e,group:new Yp(`group`,e),imagePair:new Yp(`image-pair`,e),old:new Yp(`old`,e),new:new Yp(`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(nm(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=em(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Qp,e,s,r)}this._eventListeners=a}};function Qp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=nm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=em(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,$p,e,n,i),r.splice(t,1),a!==null&&a()}};function $p(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function em(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function tm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function nm(e,t,n,r){if(e.length===0)return-1;r=tm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&tm(a.optionsOrUseCapture)===r)return i}return-1}Zp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,em(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,em(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Zp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,rm,e,void 0,void 0)};function rm(e,t){return e.tag!==6&&(e=v(e),km(e,t))}Zp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,im,t,void 0,void 0);for(var n=t.length-1;0<=n&&!rm(t[n],e);n--);};function im(e,t){return t.push(e),!1}Zp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Ep(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,am,e,void 0,void 0))};function am(e,t){return e.tag!==6&&(e=v(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),p(this._fragmentFiber.child,!1,om,e,void 0,void 0)};function om(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,sm,e,void 0,void 0);for(var n=t=0;n<cm.length;n++){var r=cm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):cm[t++]=r}cm.length=t}};function sm(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var cm=[],lm=!1;function um(e,t,n){cm.push({fragmentInstance:e,observer:t,instance:n}),lm||(lm=!0,Am(function(){lm=!1;var e=cm;cm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Zp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,dm,e,void 0,void 0),e};function dm(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=v(e),t.push.apply(t,e.getClientRects());return!1}Zp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Zp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,im,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||fm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fm(e,t,n,r,i){var a=Ft(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=m(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=T(n,a,w),t===null?t=!1:(p(t,!0,S,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=T(r,a,w),t===null?t=!1:(p(t,!0,C,a,r),a=y,b=y=null,t=a!==null)),t):!1}function pm(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(i(566));var t=[];p(this._fragmentFiber.child,!1,im,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),pm(e,n);return}if(r=v(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 a=t[r];a.tag===6?(a=v(a),pm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function mm(e,t){return e=v(e),hm(e,t),!1}function hm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function gm(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,em(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<cm.length;i++){var a=cm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(cm[r++]=a)}cm.length=r,n.observe(e)}),hm(e,t))}function _m(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,em(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?um(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function vm(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`:vm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ym(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[Mt])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=Tm(e.nextSibling),e===null)break}return null}function bm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Tm(e.nextSibling),e===null))return null;return e}function xm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Tm(e.nextSibling),e===null))return null;return e}function Sm(e){return e.data===`$?`||e.data===`$~`}function Cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function wm(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 Tm(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 Em=null;function Dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Tm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Om(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 km(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 Am(e){Ip(function(){Ip(function(t){return e(t)})})}function jm(e,t,n){switch(t=Ep(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Mm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&_p(e,t,r,null,bp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Nm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Pm=new Map,Fm=new Set;function Im(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 Lm=_e.d;_e.d={f:Rm,r:zm,D:Hm,C:Um,L:Wm,m:Gm,X:qm,S:Km,M:Jm};function Rm(){var e=Lm.f(),t=$d();return e||t}function zm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?lc(t):Lm.r(e)}var Bm=typeof document>`u`?null:document;function Vm(e,t,n){var r=Bm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Fm.has(i)||(Fm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),yp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Hm(e){Lm.D(e),Vm(`dns-prefetch`,e,null)}function Um(e,t){Lm.C(e,t),Vm(`preconnect`,e,t)}function Wm(e,t,n){Lm.L(e,t,n);var r=Bm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Xm(e);break;case`script`:a=eh(e)}if(!(Pm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Pm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Zm(a))||t===`script`&&r.querySelector(th(a))))){var o=r.createElement(`link`);yp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Gm(e,t){Lm.m(e,t);var n=Bm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=eh(e)}if(!Pm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),Pm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(th(a)))return}r=n.createElement(`link`),yp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Km(e,t,n){Lm.S(e,t,n);var r=Bm;if(r&&e){var i=Rt(r).hoistableStyles,a=Xm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Zm(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Pm.get(a))&&ih(e,n);var c=o=r.createElement(`link`);zt(c),yp(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,rh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function qm(e,t){Lm.X(e,t);var n=Bm;if(n&&e){var r=Rt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=E({src:e,async:!0},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),zt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jm(e,t){Lm.M(e,t);var n=Bm;if(n&&e){var r=Rt(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(th(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=Pm.get(i))&&ah(e,t),a=n.createElement(`script`),zt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ym(e,t,n,r){var a=(a=P.current)?Im(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Xm(n.href),t=Rt(a).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=Xm(n.href);var o=Rt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Pm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pm.set(e,o)),$m(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=eh(n),t=Rt(a).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(i(444,e))}}function Xm(e){return`href="`+sn(e)+`"`}function Zm(e){return`link[rel="stylesheet"][`+e+`]`}function Qm(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function $m(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),yp(t,`link`,n),zt(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 eh(e){return`[src="`+sn(e)+`"]`}function th(e){return`script[async]`+e}function nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),yp(r,`style`,a),rh(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Xm(n.href);var o=e.querySelector(Zm(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Qm(n),(a=Pm.get(a))&&ih(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),yp(o,`link`,r),t.state.loading|=4,rh(o,n.precedence,e),t.instance=o;case`script`:return o=eh(n.src),(a=e.querySelector(th(o)))?(t.instance=a,zt(a),a):(r=n,(a=Pm.get(o))&&(r=E({},n),ah(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),yp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,rh(r,n.precedence,e));return t.instance}function rh(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 ih(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function ah(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var oh=null;function sh(e,t,n){if(oh===null){var r=new Map,i=oh=new Map;i.set(n,r)}else i=oh,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[Mt]||a[Tt]||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 ch(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function lh(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 uh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function dh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function fh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ph(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=fh(t),e.suspenseyImages.push(t)),e=yh.bind(e),t.decode().then(e,e))}function mh(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=Xm(r.href),a=t.querySelector(Zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=vh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Qm(r),(i=Pm.get(i))&&ih(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),yp(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=vh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var hh=0;function gh(e,t){return e.stylesheets&&e.count===0&&xh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&hh===0&&(hh=62500*Cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>hh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _h(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)xh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function vh(){this.count--,_h(this)}function yh(){this.imgCount--,_h(this)}var bh=null;function xh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bh=new Map,t.forEach(Sh,e),bh=null,vh.call(e))}function Sh(e,t){if(!(t.state.loading&4)){var n=bh.get(e);if(n)var r=n.get(null);else{n=new Map,bh.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=vh.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 Ch={$$typeof:re,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function wh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 Th(e,t,n,r,i,a,o,s,c,l,u,d){return e=new wh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},yo(a),e}function Eh(e){return e?(e=Ni,e):Ni}function Dh(e,t,n,r,i,a){i=Eh(i),r.context===null?r.context=i:r.pendingContext=i,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=So(e,r,t),n!==null&&(Jd(n,e,t),Co(n,e,t))}function Oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kh(e,t){Oh(e,t),(e=e.alternate)&&Oh(e,t)}function Ah(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Jd(t,e,67108864),kh(e,67108864)}}function jh(e){if(e.tag===13||e.tag===31){var t=Gd();t=bt(t);var n=Ai(e,t);n!==null&&Jd(n,e,t),kh(e,t)}}var Mh=!0;function Nh(e,t,n,r){var i=ge.T;ge.T=null;var a=_e.p;try{_e.p=2,Fh(e,t,n,r)}finally{_e.p=a,ge.T=i}}function Ph(e,t,n,r){var i=ge.T;ge.T=null;var a=_e.p;try{_e.p=8,Fh(e,t,n,r)}finally{_e.p=a,ge.T=i}}function Fh(e,t,n,r){if(Mh){var i=Ih(r);if(i===null)cp(e,t,r,Lh,n),Jh(e,r);else if(Xh(i,e,t,n,r))r.stopPropagation();else if(Jh(e,r),t&4&&-1<qh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Vf(a),!(ld&6)&&(Ad=Ue()+500,Hf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Jd(s,a,2),$d(),kh(a,2)}if(a=Ih(r),a===null&&cp(e,t,r,Lh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cp(e,t,r,null,n)}}function Ih(e){return e=Cn(e),Rh(e)}var Lh=null;function Rh(e){if(Lh=null,e=Ft(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 Lh=e,null}function zh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Bh=!1,Vh=null,Hh=null,Uh=null,Wh=new Map,Gh=new Map,Kh=[],qh=`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 Jh(e,t){switch(e){case`focusin`:case`focusout`:Vh=null;break;case`dragenter`:case`dragleave`:Hh=null;break;case`mouseover`:case`mouseout`:Uh=null;break;case`pointerover`:case`pointerout`:Wh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Gh.delete(t.pointerId)}}function Yh(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=It(t),t!==null&&Ah(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Xh(e,t,n,r,i){switch(t){case`focusin`:return Vh=Yh(Vh,e,t,n,r,i),!0;case`dragenter`:return Hh=Yh(Hh,e,t,n,r,i),!0;case`mouseover`:return Uh=Yh(Uh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Wh.set(a,Yh(Wh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Gh.set(a,Yh(Gh.get(a)||null,e,t,n,r,i)),!0}return!1}function Zh(e){var t=Ft(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){jh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){jh(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 Qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ih(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&Ah(t),e.blockedOn=n,!1;t.shift()}return!0}function $h(e,t,n){Qh(e)&&n.delete(t)}function eg(){Bh=!1,Vh!==null&&Qh(Vh)&&(Vh=null),Hh!==null&&Qh(Hh)&&(Hh=null),Uh!==null&&Qh(Uh)&&(Uh=null),Wh.forEach($h),Gh.forEach($h)}function tg(e,n){e.blockedOn===n&&(e.blockedOn=null,Bh||(Bh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eg)))}var ng=null;function rg(e){ng!==e&&(ng=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ng===e&&(ng=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(Rh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,sc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ig(e){function t(t){return tg(t,e)}Vh!==null&&tg(Vh,e),Hh!==null&&tg(Hh,e),Uh!==null&&tg(Uh,e),Wh.forEach(t),Gh.forEach(t);for(var n=0;n<Kh.length;n++){var r=Kh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Kh.length&&(n=Kh[0],n.blockedOn===null);)Zh(n),n.blockedOn===null&&Kh.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[Et]||null;if(typeof a==`function`)o||rg(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Rh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),rg(n)}}}function ag(){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 og(e){this._internalRoot=e}sg.prototype.render=og.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Dh(n,Gd(),e,t,null,null)},sg.prototype.unmount=og.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dh(e.current,2,null,e,null,null),$d(),t[Dt]=null}};function sg(e){this._internalRoot=e}sg.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kh.length&&t!==0&&t<Kh[n].priority;n++);Kh.splice(n,0,e),n===0&&Zh(e)}};var cg=n.version;if(cg!==`19.3.1`)throw Error(i(527,cg,`19.3.1`));_e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var lg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:ge,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ug=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ug.isDisabled&&ug.supportsFiber)try{Qe=ug.inject(lg),$e=ug}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ac,s=jc,c=Mc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Th(e,1,!1,null,null,n,r,null,o,s,c,ag),e[Dt]=t.current,op(e),new og(t)}})),Ee=a(((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=Te()})),P=g(o(),1),De=Ee(),F=c(),Oe=class extends P.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){_e(e,{stage:`react`,componentStack:t.componentStack??``})}render(){return this.state.failed?(0,F.jsxs)(`main`,{role:`alert`,children:[(0,F.jsx)(`p`,{children:r(`页面遇到错误,请刷新后重试。`,`The page encountered an error. Refresh to try again.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>location.reload(),children:r(`刷新页面`,`Refresh page`)})]}):this.props.children}},ke=1024,Ae=.7;function je(e,t){return e>=t+72?`focus`:e<=228?`collapse`:null}function Me(e,t){return e>t?t+Math.min(24,(e-t)/3):e<300?300-Math.min(24,(300-e)/3):null}function Ne(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function Pe(e,t,n){let r=t===0?56:Ne(t,264,420),i=e-r-400,a=n===0||i<300?0:Math.min(i,Ne(n,300,e*Ae));return{sidebar:r,center:Math.max(0,e-r-a),rightbar:a}}var Fe=(0,P.createContext)(null),Ie=new Map;function Le(e,t){return Ie.set(e,t),()=>{Ie.delete(e)}}function Re(e,t){if(!t)return!1;if(e.contains(t))return!0;for(let[n,r]of Ie)if(r.current===e&&n.isConnected&&n.contains(t))return!0;return!1}function ze(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.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||!Re(n,document.activeElement))?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s&&Re(n,document.activeElement)||(e.preventDefault(),o.focus())},s=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);t[t.length-1]===n&&!Re(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 Be({productTitle:e}){return(0,P.useEffect)(()=>(document.title=e,()=>{document.title=e}),[e]),null}var Ve={frame:`_frame_bac9o_1`,sidebarCol:`_sidebarCol_bac9o_24`,centerCol:`_centerCol_bac9o_33`,drawerMask:`_drawerMask_bac9o_49`,handle:`_handle_bac9o_64`,snapHint:`_snapHint_bac9o_84`,rightbarCol:`_rightbarCol_bac9o_121`,overlayLayer:`_overlayLayer_bac9o_129`};function He(e){return(0,F.jsx)(`div`,{className:Ve.centerCol,children:e.children})}function Ue({usePanelInfo:e,renderSlot:t}){return t(`main`,{},{entryKey:e(e=>e.activePanelId)??`conversation`})}function We(e){return(0,F.jsx)(`div`,{className:Ve.rightbarCol,"data-rightbar-col":!0,children:e.children})}function Ge(e){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(0),i=(0,P.useRef)(0),a=(0,P.useRef)(null),o=(0,P.useRef)(null),s=(0,P.useRef)({onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd});s.current={onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd};let c=(0,P.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,P.useEffect)(()=>c,[c]);let l=(0,P.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,P.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,P.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,s.current.onDrag(e.clientX-r.current),c(!1))},[c]),f=(0,P.useCallback)(e=>{o.current?.id===e.pointerId&&c()},[c]);return(0,F.jsx)(`div`,{className:Ve.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 Ke({useStore:e,usePanelInfo:t,actions:n,renderSlot:r,t:i}){let a=e(e=>e.layoutInfo),o=(0,P.useRef)(null),s=a.viewportWidth;(0,P.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<ke,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=Pe(s,!a.rightbarShown&&c?0:d,f),m=c&&!u,h=(0,P.useRef)(null);ze(h,m,n.closeSidebar),(0,P.useEffect)(()=>{if(!m)return;let e=o.current?.querySelectorAll(`.${Ve.centerCol}, .${Ve.rightbarCol}`)??[];for(let t of e)t.setAttribute(`inert`,``);return()=>{for(let t of e)t.removeAttribute(`inert`)}},[m]);let g=Pe(s,c?0:d,a.rightbarTrack?f:0),[_,v]=(0,P.useState)(null),[y,b]=(0,P.useState)(null),x=s-g.sidebar,S=l?s-56:a.rightbarFocus?x:_??p.rightbar,C=l&&a.rightbarTrack?S:a.rightbarFocus&&a.rightbarTrack?x:_!==null&&a.rightbarTrack?_:g.rightbar,w=m?Math.min(d,Math.max(0,s-48)):g.sidebar,T=(0,P.useRef)(g);T.current=g;let E=(0,P.useRef)(p.rightbar);E.current=p.rightbar;let D=(0,P.useRef)(0),O=(0,P.useRef)(0),[k,ee]=(0,P.useState)(!1),te=(0,P.useCallback)(()=>{ee(!1)},[]),ne=(0,P.useCallback)(()=>{D.current=T.current.sidebar,ee(!0)},[]),A=(0,P.useCallback)(e=>{n.setSidebar(D.current+e)},[n]),re=Math.min(s*Ae,s-g.sidebar-400),ie=(0,P.useRef)(re),j=(0,P.useRef)(!1),ae=(0,P.useCallback)(()=>{O.current=E.current,ie.current=re,j.current=!1,v(null),b(null),ee(!0)},[re]),oe=(0,P.useCallback)(e=>{if(j.current)return;let t=O.current-e,r=je(t,ie.current);r?(j.current=!0,v(null),b(null),ee(!1),r===`focus`?n.focusRightbar():n.collapseRightbar()):(n.setRightbar(t),v(Me(t,ie.current)),b(t>ie.current?`focus`:t<300?`collapse`:null))},[n]),M=(0,P.useCallback)(()=>{v(null),b(null),ee(!1)},[]),se=i(`brand.localBuild`),ce=(0,P.useMemo)(()=>r(`sidebar`,{collapsed:u,width:w}),[r,u,w]),le=(0,P.useMemo)(()=>(0,F.jsx)(Ue,{usePanelInfo:t,renderSlot:r}),[t,r]),ue=(0,P.useMemo)(()=>r(`shell.overlay`,{}),[r]);return(0,F.jsxs)(`div`,{ref:o,className:Ve.frame,style:{gridTemplateColumns:`${g.sidebar}px minmax(0, 1fr) ${C}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":k||void 0,"data-rightbar-elastic":y??void 0,children:[(0,F.jsx)(Be,{productTitle:se}),m&&(0,F.jsx)(`button`,{type:`button`,className:Ve.drawerMask,tabIndex:-1,"aria-label":i(`sidebar.close`),onClick:n.closeSidebar}),(0,F.jsx)(`div`,{ref:h,className:Ve.sidebarCol,style:m?{width:w}: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,F.jsx)(Fe.Provider,{value:m?h:null,children:ce})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(He,{children:le}),(0,F.jsx)(We,{children:r(`rightbar`,{width:S,viewportWidth:s,canShow:p.rightbar>0})})]}),(0,F.jsx)(`div`,{className:Ve.overlayLayer,"data-shell-overlay":!0,children:ue}),!u&&!c&&(0,F.jsx)(Ge,{side:`sidebar`,left:g.sidebar,onStart:ne,onDrag:A,onEnd:te}),a.rightbarShown&&!a.rightbarFullscreen&&!a.rightbarFocus&&p.rightbar>0&&(0,F.jsx)(Ge,{side:`rightbar`,left:s-S,onStart:ae,onDrag:oe,onEnd:M}),y&&(0,F.jsx)(`div`,{className:Ve.snapHint,role:`status`,style:{left:s-S},children:i(y===`focus`?`rightbar.drag.focus`:`rightbar.drag.collapse`)})]})}var qe=`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 Je({size:e=24,className:t}){return(0,F.jsx)(`span`,{className:t,"aria-hidden":`true`,style:{display:`inline-block`,flexShrink:0,width:e,height:e,backgroundColor:`currentColor`,maskImage:`url("${qe}")`,WebkitMaskImage:`url("${qe}")`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}})}var Ye={bubble:`_bubble_1nw3t_1`,"tooltip-in":`_tooltip-in_1nw3t_1`};function Xe({label:e,side:t=`right`,delayMs:n=0,disabled:r=!1,maxWidth:i,children:a}){let o=(0,P.useRef)(null),s=a.props.ref,c=(0,P.useCallback)(e=>{o.current=e,typeof s==`function`?s(e):s!=null&&(s.current=e)},[s]),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(t),p=(0,P.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,P.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,P.useRef)(null),_=(0,P.useRef)({hover:!1,focus:!1}),v=(0,P.useCallback)(()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);(0,P.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,F.jsxs)(F.Fragment,{children:[(0,P.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,F.jsx)(`span`,{ref:p,className:Ye.bubble,"data-side":d,style:{left:l.x,top:h,...i===void 0?{}:{maxWidth:i}},role:`tooltip`,children:m})]})}var Ze={dot:`_dot_1cjbl_3`,matrix:`_matrix_1cjbl_4`,cell:`_cell_1cjbl_62`,"piw-state-dot-chase":`_piw-state-dot-chase_1cjbl_1`},Qe=[[0,0],[4,0],[8,0],[8,4],[8,8],[4,8],[0,8],[0,4]];function $e({state:e,size:t=10,className:r}){return e===`ongoing`?(0,F.jsx)(`svg`,{className:n(Ze.matrix,r),"data-state":`ongoing`,width:t,height:t,viewBox:`0 0 10 10`,shapeRendering:`crispEdges`,"aria-hidden":`true`,children:Qe.map(([e,t],n)=>(0,F.jsx)(`rect`,{className:Ze.cell,x:e,y:t,width:`2`,height:`2`,style:{animationDelay:`${(n-Qe.length)*125}ms`}},`${e}-${t}`))}):(0,F.jsx)(`span`,{className:n(Ze.dot,r),"data-state":e,style:{width:t,height:t},"aria-hidden":`true`})}var et=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),tt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z`,fill:`currentColor`})]}),nt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_2580_121189)`,children:[(0,F.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,F.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,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_2580_121189`,children:(0,F.jsx)(`rect`,{width:14,height:14,fill:`currentColor`})})})]}),rt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_1450_63327)`,children:[(0,F.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,F.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,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_1450_63327`,children:(0,F.jsx)(`rect`,{width:16,height:16,fill:`currentColor`})})})]}),it=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),at=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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,F.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`})]}),ot=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{d:`M8.64453 1.5V7.34961H14.5V8.65039H8.64453V14.5H7.34473V8.65039H1.5V7.34961H7.34473V1.5H8.64453Z`,fill:`currentColor`})}),st=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ct=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),lt=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ut=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`path`,{d:`M14.1168 13.197L13.197 14.1167L1.8833 2.80303L2.80309 1.88324L14.1168 13.197Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M13.197 1.88326L14.1168 2.80305L2.80309 14.1168L1.8833 13.197L13.197 1.88326Z`,fill:`currentColor`})]}),dt=({size:e=14,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),ft=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),pt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),mt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),ht=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),gt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{d:`M2.871 13.1286C0.0387669 10.2962 0.0387669 5.70383 2.871 2.87141C5.70341 0.0390029 10.2957 0.0391154 13.1282 2.87141L12.1387 3.86094C9.85292 1.57538 6.1469 1.57596 3.86123 3.86163C1.57573 6.14732 1.57573 9.85269 3.86123 12.1384C6.1469 14.424 9.85292 14.4246 12.1387 12.1391L13.1282 13.1286C10.2957 15.9609 5.70341 15.961 2.871 13.1286Z`,fill:`currentColor`})}),_t=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),vt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),yt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.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`})}),bt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,F.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,F.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`})]}),xt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,F.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,F.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`})]}),St=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.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`})}),Ct=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M8.65039 0.5V2.5H7.34961V0.5H8.65039Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M8.65039 13.5V15.5H7.34961V13.5H8.65039Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M3.15808 2.24035L4.57229 3.65456L3.6525 4.57435L2.23829 3.16014L3.15808 2.24035Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M12.3505 11.4327L13.7647 12.8469L12.8449 13.7667L11.4307 12.3525L12.3505 11.4327Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M2.24537 12.8469L3.65958 11.4327L4.57937 12.3525L3.16516 13.7667L2.24537 12.8469Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M11.4377 3.65455L12.852 2.24033L13.7718 3.16012L12.3575 4.57434L11.4377 3.65455Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M0.5 7.35461H2.5V8.6554H0.5L0.5 7.35461Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M13.5 7.35461H15.5V8.6554H13.5V7.35461Z`,fill:`currentColor`})]}),wt=({size:e=16,className:t})=>(0,F.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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`})}),Tt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`path`,{d:`M12.1665 13.5811V14.7803H3.66651V13.5811H12.1665Z`,fill:`currentColor`}),(0,F.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`})]}),Et=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),Dt=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`ellipse`,{cx:`8`,cy:`3.6`,rx:`5.75`,ry:`2.4`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,F.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,F.jsx)(`path`,{d:`M2.25 7.95A5.75 2.4 0 0 0 13.75 7.95`,stroke:`currentColor`,strokeWidth:`1.25`})]}),Ot=({size:e=16,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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`})]}),kt=({size:e=14,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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,F.jsx)(`path`,{d:`M7.39455 9.44026V10.8109H6.16921V9.44026H7.39455Z`,fill:`currentColor`})]}),At=({size:e=20,className:t})=>(0,F.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.jsx)(`path`,{d:`M12.7962 12.5661V11.0832H7.20548V12.5661L12.7962 12.5661Z`,fill:`currentColor`})]}),jt=x(),Mt={viewport:`_viewport_1h2wd_1`,toast:`_toast_1h2wd_13`,"toast-in":`_toast-in_1h2wd_1`,body:`_body_1h2wd_29`,message:`_message_1h2wd_30`,detail:`_detail_1h2wd_31`,close:`_close_1h2wd_34`},Nt=4e3,Pt=[],Ft=new Set,It=new Map,Lt=0;function Rt(e){Pt=e;for(let e of Ft)e()}function zt(e){let t=e.key??`toast-${++Lt}`,n={key:t,tone:e.tone??`error`,message:e.message,detail:e.detail,detailLabel:e.detailLabel};return Rt([...Pt.filter(e=>e.key!==t),n].slice(-4)),clearTimeout(It.get(t)),It.delete(t),n.tone===`info`&&It.set(t,setTimeout(()=>Bt(t),Nt)),t}function Bt(e){clearTimeout(It.get(e)),It.delete(e),Pt.some(t=>t.key===e)&&Rt(Pt.filter(t=>t.key!==e))}function Vt(e,t,n,r){(0,P.useEffect)(()=>{t&&zt({key:e,message:t,detail:n&&n!==t?n:void 0,detailLabel:r})},[e,t,n,r])}var Ht=e=>(Ft.add(e),()=>{Ft.delete(e)}),Ut=()=>Pt;function Wt({closeLabel:e=`Dismiss`,detailLabel:t=`Details`}){let n=(0,P.useSyncExternalStore)(Ht,Ut,Ut);return typeof document>`u`?null:(0,jt.createPortal)((0,F.jsx)(`div`,{className:Mt.viewport,"data-toast-viewport":!0,children:n.map(n=>(0,F.jsxs)(`div`,{className:Mt.toast,"data-tone":n.tone,role:n.tone===`error`?`alert`:`status`,children:[(0,F.jsxs)(`div`,{className:Mt.body,children:[(0,F.jsx)(`p`,{className:Mt.message,children:n.message}),n.detail&&(0,F.jsxs)(`details`,{className:Mt.detail,children:[(0,F.jsx)(`summary`,{children:n.detailLabel??t}),(0,F.jsx)(`pre`,{children:n.detail})]})]}),(0,F.jsx)(`button`,{type:`button`,className:Mt.close,"aria-label":e,onClick:()=>Bt(n.key),children:`×`})]},n.key))}),document.body)}var Gt={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`},Kt=150,qt=2e3;function Jt({id:e,label:t,wide:r,usePanelInfo:i,selectPanel:a,renderSlot:o}){let s=i(t=>t.activePanelId===e);return(0,F.jsx)(Xe,{label:t,delayMs:500,disabled:r,children:(0,F.jsxs)(`button`,{type:`button`,className:n(Gt.panelRow,s&&Gt.panelActive),"aria-label":t,"aria-current":s?`page`:void 0,onClick:()=>{a(e)},children:[(0,F.jsx)(`span`,{className:Gt.panelGlyph,"aria-hidden":`true`,children:o(`sidebar.panellist`,{size:r?16:18,active:s},{only:e})}),r&&(0,F.jsx)(`span`,{className:n(Gt.panelTitle,Gt.wide),children:t})]})})}function Yt({collapsed:e,width:t,startSession:r,sessionBusy:i=!1,toggleSidebar:a,selectPanel:o,usePanels:s,usePanelInfo:c,t:l,renderSlot:u}){let d=s(e=>e),[f,p]=(0,P.useState)(e);(0,P.useEffect)(()=>{if(!e){p(!1);return}let t=window.setTimeout(()=>{p(!0)},Kt);return()=>{window.clearTimeout(t)}},[e]);let m=!e||!f,h=(0,P.useRef)(t);e||(h.current=t);let g=(0,P.useRef)(!e);e||(g.current=!0);let _=(0,P.useRef)(null),[v,y]=(0,P.useState)(!1),b=(0,P.useRef)(void 0),x=()=>{b.current===void 0&&(b.current=window.setTimeout(()=>{b.current=void 0,y(!1)},qt))},S=()=>{window.clearTimeout(b.current),b.current=void 0};return(0,P.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,F.jsxs)(`div`,{ref:_,className:n(Gt.root,!m&&Gt.collapsed,!m&&g.current&&Gt.railIn,e&&m&&Gt.fading,!v&&Gt.quietBars),style:m?{width:e?h.current:t}:void 0,onPointerEnter:()=>{S(),y(!0)},onPointerLeave:()=>{x()},children:[(0,F.jsxs)(`div`,{className:Gt.logoRow,children:[m&&(0,F.jsx)(`button`,{type:`button`,className:n(Gt.brand,Gt.wide),"aria-label":l(`session.new.label`),disabled:i,onClick:()=>{r()},children:(0,F.jsxs)(`span`,{className:Gt.brandIdentity,"aria-hidden":`true`,children:[(0,F.jsx)(`span`,{className:Gt.brandMark,children:u(`sidebar.brand.mark`,{size:24},{fallback:(0,F.jsx)(Je,{size:24})})}),(0,F.jsx)(`span`,{className:Gt.brandName,children:u(`sidebar.brand.name`,{},{fallback:(0,F.jsx)(`span`,{className:Gt.fallbackBrandName,children:l(`brand.localBuild`)})})})]})}),(0,F.jsx)(Xe,{label:l(e?`toggle.open`:`toggle.collapse`),delayMs:500,children:(0,F.jsxs)(`button`,{type:`button`,className:n(Gt.iconButton,Gt.toggle),"aria-label":l(e?`toggle.open`:`toggle.collapse`),"aria-expanded":!e,"data-sidebar-toggle":!0,onClick:()=>{a()},children:[!m&&(0,F.jsx)(`span`,{className:Gt.railMark,"aria-hidden":`true`,children:u(`sidebar.brand.mark`,{size:24},{fallback:(0,F.jsx)(Je,{size:24})})}),(0,F.jsx)(it,{className:Gt.panelIcon,size:m?16:18})]})})]}),(0,F.jsx)(Xe,{label:l(`session.new.label`),delayMs:500,disabled:m,children:(0,F.jsxs)(`button`,{type:`button`,className:Gt.newSession,"aria-label":l(`session.new.label`),disabled:i,onClick:()=>{r()},children:[(0,F.jsx)(et,{size:m?14:18}),m&&(0,F.jsx)(`span`,{className:n(Gt.newSessionLabel,Gt.wide),children:l(`session.new`)})]})}),d.length>0&&(0,F.jsx)(`nav`,{className:Gt.panelList,"aria-label":l(`panels.label`),children:d.map(({id:e,label:t})=>(0,F.jsx)(Jt,{id:e,label:t,wide:m,usePanelInfo:c,selectPanel:o,renderSlot:u},e))}),(0,F.jsx)(`div`,{className:Gt.regionArea,children:u(`sidebar.workspaces`,{wide:m,expandSidebar:()=>{e&&a()}})}),(0,F.jsxs)(`div`,{className:Gt.footArea,children:[(0,F.jsx)(`div`,{className:Gt.footerActions,children:u(`sidebar.footer.action`,{wide:m})}),(0,F.jsx)(`div`,{className:Gt.settingsArea,children:u(`sidebar.settings`,{wide:m})})]})]})}function Xt(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 Zt={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 Qt({t:e,renderSlot:t,children:n}){return(0,F.jsxs)(`div`,{className:Zt.root,children:[(0,F.jsxs)(`div`,{className:Zt.stack,children:[(0,F.jsxs)(`div`,{className:Zt.headline,children:[(0,F.jsx)(`span`,{className:Zt.logoFrame,children:t(`conversation.hero.brand.mark`,{size:34,className:Zt.logo},{fallback:(0,F.jsx)(Je,{size:34,className:Zt.logo})})}),(0,F.jsxs)(`span`,{className:Zt.titleGroup,children:[(0,F.jsx)(`span`,{children:e(`hero.headline`)}),(0,F.jsx)(`span`,{className:Zt.previewBadge,children:e(`hero.preview`)})]})]}),(0,F.jsx)(`div`,{className:Zt.body})]}),n]})}var $t={root:`_root_1258r_1`,heroTools:`_heroTools_1258r_44`,header:`_header_1258r_51`,headerHidden:`_headerHidden_1258r_61`,titleRow:`_titleRow_1258r_65`,titleCluster:`_titleCluster_1258r_72`,crumbs:`_crumbs_1258r_80`,crumbSeg:`_crumbSeg_1258r_89`,crumbSep:`_crumbSep_1258r_96`,crumb:`_crumb_1258r_80`,crumbSubagent:`_crumbSubagent_1258r_118`,crumbCurrent:`_crumbCurrent_1258r_127`,headerActions:`_headerActions_1258r_133`,headerUtilities:`_headerUtilities_1258r_140`,headerCorner:`_headerCorner_1258r_156`,tabs:`_tabs_1258r_170`,tab:`_tab_1258r_40`,tabActive:`_tabActive_1258r_208`,viewArea:`_viewArea_1258r_216`,widthHandle:`_widthHandle_1258r_235`,composerStack:`_composerStack_1258r_303`,composerSeat:`_composerSeat_1258r_314`,body:`_body_1258r_224`,scrollBody:`_scrollBody_1258r_350`,composerHero:`_composerHero_1258r_451`,heroWorkspaceRow:`_heroWorkspaceRow_1258r_464`},en={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`},tn={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`},nn={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`};function rn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var an=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,on=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sn={};function cn(e,t){return((t||sn).jsx?on:an).test(e)}var ln=/[ \t\n\f\r]/g;function un(e){return typeof e==`object`?e.type===`text`&&dn(e.value):dn(e)}function dn(e){return e.replace(ln,``)===``}var fn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};fn.prototype.normal={},fn.prototype.property={},fn.prototype.space=void 0;function pn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new fn(n,r,t)}function mn(e){return e.toLowerCase()}var hn=class{constructor(e,t){this.attribute=t,this.property=e}};hn.prototype.attribute=``,hn.prototype.booleanish=!1,hn.prototype.boolean=!1,hn.prototype.commaOrSpaceSeparated=!1,hn.prototype.commaSeparated=!1,hn.prototype.defined=!1,hn.prototype.mustUseProperty=!1,hn.prototype.number=!1,hn.prototype.overloadedBoolean=!1,hn.prototype.property=``,hn.prototype.spaceSeparated=!1,hn.prototype.space=void 0;var gn=e({boolean:()=>vn,booleanish:()=>yn,commaOrSpaceSeparated:()=>Cn,commaSeparated:()=>Sn,number:()=>I,overloadedBoolean:()=>bn,spaceSeparated:()=>xn}),_n=0,vn=wn(),yn=wn(),bn=wn(),I=wn(),xn=wn(),Sn=wn(),Cn=wn();function wn(){return 2**++_n}var Tn=Object.keys(gn),En=class extends hn{constructor(e,t,n,r){let i=-1;if(super(e,t),Dn(this,`space`,r),typeof n==`number`)for(;++i<Tn.length;){let e=Tn[i];Dn(this,Tn[i],(n&gn[e])===gn[e])}}};En.prototype.defined=!0;function Dn(e,t,n){n&&(e[t]=n)}function On(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new En(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[mn(r)]=r,n[mn(a.attribute)]=r}return new fn(t,n,e.space)}var kn=On({properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:xn,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:I,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:xn,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:yn,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function An(e,t){return t in e?e[t]:t}function jn(e,t){return An(e,t.toLowerCase())}var Mn=On({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Sn,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:vn,allowPaymentRequest:vn,allowUserMedia:vn,alpha:vn,alt:null,as:null,async:vn,autoCapitalize:null,autoComplete:xn,autoFocus:vn,autoPlay:vn,blocking:xn,capture:null,charSet:null,checked:vn,cite:null,className:xn,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:yn,controls:vn,controlsList:xn,coords:I|Sn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vn,defer:vn,dir:null,dirName:null,disabled:vn,download:bn,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vn,formTarget:null,headers:xn,height:I,hidden:bn,high:I,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:vn,inputMode:null,integrity:null,is:null,isMap:vn,itemId:null,itemProp:xn,itemRef:xn,itemScope:vn,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vn,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:vn,muted:vn,name:null,nonce:null,noModule:vn,noValidate:vn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vn,optimum:I,pattern:null,ping:xn,placeholder:null,playsInline:vn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vn,referrerPolicy:null,rel:xn,required:vn,reversed:vn,rows:I,rowSpan:I,sandbox:xn,scope:null,scoped:vn,seamless:vn,selected:vn,shadowRootClonable:vn,shadowRootCustomElementRegistry:vn,shadowRootDelegatesFocus:vn,shadowRootMode:null,shadowRootSerializable:vn,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:vn,useMap:null,value:yn,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vn,declare:vn,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:vn,noHref:vn,noShade:vn,noWrap:vn,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:vn,disablePictureInPicture:vn,disableRemotePlayback:vn,exportParts:Sn,part:xn,prefix:null,property:null,results:I,security:null,unselectable:null},space:`html`,transform:jn}),Nn=On({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Cn,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:vn,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Sn,g2:Sn,glyphName:Sn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:An}),Pn=On({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Fn=On({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:jn}),In=On({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ln={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Rn=/[A-Z]/g,zn=/-[a-z]/g,Bn=/^data[-\w.:]+$/i;function Vn(e,t){let n=mn(t),r=t,i=hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Bn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(zn,Un);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!zn.test(e)){let n=e.replace(Rn,Hn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=En}return new i(r,t)}function Hn(e){return`-`+e.toLowerCase()}function Un(e){return e.charAt(1).toUpperCase()}var Wn=pn([kn,Mn,Pn,Fn,In],`html`),Gn=pn([kn,Nn,Pn,Fn,In],`svg`);function Kn(e){return e.join(` `).trim()}var qn=a(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
11
11
|
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Jn=a(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(qn());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Yn=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Xn=a(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Jn()),i=Yn();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Zn=$n(`end`),Qn=$n(`start`);function $n(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function er(e){let t=Qn(e),n=Zn(e);if(t&&n)return{start:t,end:n}}function tr(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?rr(e.position):`start`in e||`end`in e?rr(e):`line`in e||`column`in e?nr(e):``}function nr(e){return ir(e&&e.line)+`:`+ir(e&&e.column)}function rr(e){return nr(e&&e.start)+`-`+nr(e&&e.end)}function ir(e){return e&&typeof e==`number`?e:1}var ar=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=tr(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ar.prototype.file=``,ar.prototype.name=``,ar.prototype.reason=``,ar.prototype.message=``,ar.prototype.stack=``,ar.prototype.column=void 0,ar.prototype.line=void 0,ar.prototype.ancestors=void 0,ar.prototype.cause=void 0,ar.prototype.fatal=void 0,ar.prototype.place=void 0,ar.prototype.ruleId=void 0,ar.prototype.source=void 0;var or=g(Xn(),1),sr={}.hasOwnProperty,cr=new Map,lr=/[A-Z]/g,ur=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),dr=new Set([`td`,`th`]),fr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function pr(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=wr(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Cr(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Gn:Wn,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=mr(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function mr(e,t,n){if(t.type===`element`)return hr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return gr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return vr(e,t,n);if(t.type===`mdxjsEsm`)return _r(e,t);if(t.type===`root`)return yr(e,t,n);if(t.type===`text`)return br(e,t)}function hr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Gn,e.schema=i),e.ancestors.push(t);let a=Ar(e,t.tagName,!1),o=Tr(e,t),s=Dr(e,t);return ur.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!un(e)})),xr(e,o,a,t),Sr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gr(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}jr(e,t.position)}function _r(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jr(e,t.position)}function vr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Gn,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ar(e,t.name,!0),o=Er(e,t),s=Dr(e,t);return xr(e,o,a,t),Sr(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function yr(e,t,n){let r={};return Sr(r,Dr(e,t)),e.create(t,e.Fragment,r,n)}function br(e,t){return t.value}function xr(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Sr(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Cr(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function wr(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Qn(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Tr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&sr.call(t.properties,i)){let a=Or(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&dr.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Er(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else jr(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else jr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Dr(e,t){let n=[],r=-1,i=e.passKeys?new Map:cr;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=mr(e,a,o);s!==void 0&&n.push(s)}return n}function Or(e,t,n){let r=Vn(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?rn(n):Kn(n)),r.property===`style`){let t=typeof n==`object`?n:kr(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Mr(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ln[r.property]||r.property:r.attribute,n]}}function kr(e,t){try{return(0,or.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=fr+`#cannot-parse-style-attribute`,r}}function Ar(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=cn(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=cn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return sr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);jr(e)}function jr(e,t){let n=new ar("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=fr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Mr(e){let t={},n;for(n in e)sr.call(e,n)&&(t[Nr(n)]=e[n]);return t}function Nr(e){let t=e.replace(lr,Pr);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Pr(e){return`-`+e.toLowerCase()}var Fr={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Ir={};function Lr(e,t){let n=t||Ir;return Rr(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Rr(e,t,n){if(Br(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return zr(e.children,t,n)}return Array.isArray(e)?zr(e,t,n):``}function zr(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Rr(e[i],t,n);return r.join(``)}function Br(e){return!!(e&&typeof e==`object`)}var Vr=document.createElement(`i`);function Hr(e){let t=`&`+e+`;`;Vr.innerHTML=t;let n=Vr.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Ur(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Wr(e,t){return e.length>0?(Ur(e,e.length,0,t),e):t}var Gr={}.hasOwnProperty;function Kr(e){let t={},n=-1;for(;++n<e.length;)qr(t,e[n]);return t}function qr(e,t){let n;for(n in t){let r=(Gr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Gr.call(r,a)||(r[a]=[]);let e=i[a];Jr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Jr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ur(e,0,0,r)}function Yr(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Xr(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Zr=li(/[A-Za-z]/),Qr=li(/[\dA-Za-z]/),$r=li(/[#-'*+\--9=?A-Z^-~]/);function ei(e){return e!==null&&(e<32||e===127)}var ti=li(/\d/),ni=li(/[\dA-Fa-f]/),ri=li(/[!-/:-@[-`{-~]/);function ii(e){return e!==null&&e<-2}function ai(e){return e!==null&&(e<0||e===32)}function oi(e){return e===-2||e===-1||e===32}var si=li(/\p{P}|\p{S}/u),ci=li(/\s/);function li(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ui(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Qr(e.charCodeAt(n+1))&&Qr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function di(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return oi(r)?(e.enter(n),s(r)):t(r)}function s(r){return oi(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function fi(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&oi(t)?(e.enter(r),c(t)):l(t)}function c(t){return oi(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var pi={tokenize:mi};function mi(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),di(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return ii(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var hi={tokenize:_i},gi={tokenize:vi};function _i(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Ur(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gi,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(gi,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return ii(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Ur(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vi(e,t,n){return di(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function yi(e){if(e===null||ai(e)||ci(e))return 1;if(si(e))return 2}function bi(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var xi={name:`attention`,resolveAll:Si,tokenize:Ci};function Si(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};wi(o,-a),wi(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Wr(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Wr(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Wr(r,bi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Wr(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Wr(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Ur(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Ci(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yi(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=yi(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function wi(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ti={name:`autolink`,tokenize:Ei};function Ei(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Zr(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Qr(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Qr(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ei(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):$r(t)?(e.consume(t),l):n(t)}function u(e){return Qr(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Qr(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Di={partial:!0,tokenize:Oi};function Oi(e,t,n){return r;function r(t){return oi(t)?di(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||ii(e)?t(e):n(e)}}var ki={continuation:{tokenize:ji},exit:Mi,name:`blockQuote`,tokenize:Ai};function Ai(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return oi(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ji(e,t,n){let r=this;return i;function i(t){return oi(t)?di(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ki,t,n)(r)}}function Mi(e){e.exit(`blockQuote`)}var Ni={name:`characterEscape`,tokenize:Pi};function Pi(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ri(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Fi={name:`characterReference`,tokenize:Ii};function Ii(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Qr,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=ni,u):(e.enter(`characterReferenceValue`),a=7,o=ti,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Qr&&!Hr(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Li={partial:!0,tokenize:Ri};function Ri(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var zi={concrete:!0,name:`codeFenced`,tokenize:Bi};function Bi(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),oi(t)?di(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||ii(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Li,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||ii(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):oi(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),di(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||ii(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||ii(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&oi(t)?di(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||ii(t)?e.check(Li,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||ii(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),oi(t)?di(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),oi(t)?di(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||ii(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Vi={name:`codeIndented`,tokenize:Ui},Hi={partial:!0,tokenize:Wi};function Ui(e,t,n){return r;function r(t){return e.enter(`codeIndented`),fi(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):ii(t)?e.attempt(Hi,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||ii(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Wi(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ii(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):fi(e,t,a,`linePrefix`,4,4)(o)}function a(e){return ii(e)?i(e):n(e)}}var Gi={name:`codeText`,previous:qi,resolve:Ki,tokenize:Ji};function Ki(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qi(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ji(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):ii(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||ii(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Yi=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Xi(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Xi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Xi(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Xi(this.left,t.reverse())}}}};function Xi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Zi(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Yi(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Qi(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ur(e,0,1/0,u.slice(0)),!l}function Qi(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var $i={resolve:ta,tokenize:na},ea={partial:!0,tokenize:ra};function ta(e){return Zi(e),e}function na(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):ii(t)?e.check(ea,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ra(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),di(e,a,`linePrefix`)}function a(i){if(i===null||ii(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ia(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ei(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||ii(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||ai(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ei(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function aa(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):ii(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||ii(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!oi(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function oa(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):ii(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),di(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||ii(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function sa(e,t){let n;return r;function r(i){return ii(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):oi(i)?di(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ca={name:`definition`,tokenize:ua},la={partial:!0,tokenize:da};function ua(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return aa.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return ai(t)?sa(e,l)(t):l(t)}function l(t){return ia(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(la,d,d)(t)}function d(t){return oi(t)?di(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||ii(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function da(e,t,n){return r;function r(t){return ai(t)?sa(e,i)(t):n(t)}function i(t){return oa(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return oi(t)?di(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||ii(e)?t(e):n(e)}}var fa={name:`hardBreakEscape`,tokenize:pa};function pa(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return ii(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var ma={name:`headingAtx`,resolve:ha,tokenize:ga};function ha(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Ur(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function ga(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||ai(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||ii(n)?(e.exit(`atxHeading`),t(n)):oi(n)?di(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||ai(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var _a=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),va=[`pre`,`script`,`style`,`textarea`],ya={concrete:!0,name:`htmlFlow`,resolveTo:xa,tokenize:Sa},ba={partial:!0,tokenize:Ca};function xa(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Sa(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):Zr(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Zr(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Zr(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||ai(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&va.includes(l)?(i=1,r.interrupt?t(s):O(s)):_a.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Qr(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return oi(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Zr(t)?(e.consume(t),b):oi(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Qr(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):oi(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):oi(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||ii(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||ai(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||oi(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||ii(t)?O(t):oi(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):ii(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ba,oe,k)(t)):t===null||ii(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Li,ee,oe)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||ii(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),j):O(t)}function A(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return va.includes(n)?(e.consume(t),ae):O(t)}return Zr(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||ii(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function Ca(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Di,t,n)}}var wa={name:`htmlText`,tokenize:Ta};function Ta(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Zr(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Zr(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):ii(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):ii(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):ii(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):ii(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return Zr(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Qr(t)?(e.consume(t),S):C(t)}function C(t){return ii(t)?(o=C,A(t)):oi(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||Qr(t)?(e.consume(t),w):t===47||t===62||ai(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||Zr(t)?(e.consume(t),E):ii(t)?(o=T,A(t)):oi(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||Qr(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):ii(t)?(o=D,A(t)):oi(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):ii(t)?(o=O,A(t)):oi(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):ii(t)?(o=k,A(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||ai(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||ai(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return oi(t)?di(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var Ea={name:`labelEnd`,resolveAll:Aa,resolveTo:ja,tokenize:Ma},Da={tokenize:Na},Oa={tokenize:Pa},ka={tokenize:Fa};function Aa(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Ur(e,0,e.length,n),e}function ja(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Wr(o,e.slice(i+1,i+r+3)),o=Wr(o,[[`enter`,l,t]]),o=Wr(o,bi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Wr(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Wr(o,e.slice(a+1)),o=Wr(o,[[`exit`,s,t]]),Ur(e,i,e.length,o),e}function Ma(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Xr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Da,u,o?u:d)(t):t===91?e.attempt(Oa,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ka,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Na(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return ai(t)?sa(e,a)(t):a(t)}function a(t){return t===41?u(t):ia(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return ai(t)?sa(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?oa(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return ai(t)?sa(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Pa(e,t,n){let r=this;return i;function i(t){return aa.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Fa(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ia={name:`labelStartImage`,resolveAll:Ea.resolveAll,tokenize:La};function La(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ra={name:`labelStartLink`,resolveAll:Ea.resolveAll,tokenize:za};function za(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ba={name:`lineEnding`,tokenize:Va};function Va(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),di(e,t,`linePrefix`)}}var Ha={name:`thematicBreak`,tokenize:Ua};function Ua(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||ii(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),oi(t)?di(e,s,`whitespace`)(t):s(t))}}var Wa={continuation:{tokenize:Ja},exit:Xa,name:`list`,tokenize:qa},Ga={partial:!0,tokenize:Za},Ka={partial:!0,tokenize:Ya};function qa(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ti(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ha,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ti(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Di,r.interrupt?n:u,e.attempt(Ga,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return oi(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ja(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Di,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,di(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!oi(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ka,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,di(e,e.attempt(Wa,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ya(e,t,n){let r=this;return di(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Xa(e){e.exit(this.containerState.type)}function Za(e,t,n){let r=this;return di(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!oi(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Qa=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){$a(this,e,t,n,!1)}addBefore(e,t,n){$a(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function $a(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var eo={name:`setextUnderline`,resolveTo:to,tokenize:no};function to(e,t){let n=new Qa,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function no(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),oi(t)?di(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||ii(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ro={tokenize:io};function io(e){let t=this,n=e.attempt(Di,r,e.attempt(this.parser.constructs.flowInitial,i,di(e,e.attempt(this.parser.constructs.flow,i,e.attempt($i,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ao={resolveAll:lo()},oo=co(`string`),so=co(`text`);function co(e){return{resolveAll:lo(e===`text`?uo:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function lo(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function uo(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var fo=e({attentionMarkers:()=>bo,contentInitial:()=>mo,disable:()=>xo,document:()=>po,flow:()=>go,flowInitial:()=>ho,insideSpan:()=>yo,string:()=>_o,text:()=>vo}),po={42:Wa,43:Wa,45:Wa,48:Wa,49:Wa,50:Wa,51:Wa,52:Wa,53:Wa,54:Wa,55:Wa,56:Wa,57:Wa,62:ki},mo={91:ca},ho={[-2]:Vi,[-1]:Vi,32:Vi},go={35:ma,42:Ha,45:[eo,Ha],60:ya,61:eo,95:Ha,96:zi,126:zi},_o={38:Fi,92:Ni},vo={[-5]:Ba,[-4]:Ba,[-3]:Ba,33:Ia,38:Fi,42:xi,60:[Ti,wa],91:Ra,92:[fa,Ni],93:Ea,95:xi,96:Gi},yo={null:[xi,ao]},bo={null:[42,95]},xo={null:[]};function So(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Wr(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=bi(a,l.events,l),l.events):[]}function f(e,t){return wo(p(e),t)}function p(e){return Co(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){ii(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Ur(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Co(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function wo(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
12
12
|
`;break;case-3:o=`\r
|
|
13
13
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function To(e){let t={constructs:Kr([fo,...(e||{}).extensions||[]]),content:n(pi),defined:[],document:n(hi),flow:n(ro),lazy:{},string:n(oo),text:n(so)};return t;function n(e){return n;function n(n){return So(t,e,n)}}}function Eo(e){for(;!Zi(e););return e}var Do=/[\0\t\n\r]/g;function Oo(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Do.lastIndex=u,c=Do.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ko=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ao(e){return e.replace(ko,jo)}function jo(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Yr(n.slice(t?2:1),t?16:10)}return Hr(n)||e}var Mo={}.hasOwnProperty;function No(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Po(n)(Eo(To(n).document().write(Oo()(e,t,!0))))}function Po(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(Se),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ve),blockQuote:o(me),characterEscape:E,characterReference:E,codeFenced:o(N),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(N,s),codeText:o(he,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(_e),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(be,s),htmlFlowData:E,htmlText:o(be,s),htmlTextData:E,image:o(xe),label:s,link:o(Se),listItem:o(we),listItemValue:p,listOrdered:o(Ce,f),listUnordered:o(Ce),paragraph:o(Te),reference:se,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ve),strong:o(Ee),thematicBreak:o(De)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(ne),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(te),htmlTextData:D,image:l(re),label:j,labelText:ie,lineEnding:O,link:l(A),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:ae,resourceTitleString:oe,resource:M,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Io(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Mo.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Ro).call(o,void 0,e[0])}for(r.position={start:Fo(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Fo(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Fo(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+tr({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ro).call(this,e,r[0])),n.position.end=Fo(e.end)}function d(){return Lr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=P(),n.position={start:Fo(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Fo(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Fo(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ao(t),n.identifier=Xr(t).toLowerCase()}function j(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function M(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Yr(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Hr(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=Fo(e.end)}function fe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[],position:void 0}}function N(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function he(){return{type:`inlineCode`,value:``,position:void 0}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function _e(){return{type:`emphasis`,children:[],position:void 0}}function ve(){return{type:`heading`,depth:0,children:[],position:void 0}}function ye(){return{type:`break`,position:void 0}}function be(){return{type:`html`,value:``,position:void 0}}function xe(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function Se(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Te(){return{type:`paragraph`,children:[],position:void 0}}function Ee(){return{type:`strong`,children:[],position:void 0}}function P(){return{type:`text`,value:``,position:void 0}}function De(){return{type:`thematicBreak`,position:void 0}}}function Fo(e){return{line:e.line,column:e.column,offset:e.offset}}function Io(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Io(e,r):Lo(e,r)}}function Lo(e,t){let n;for(n in t)if(Mo.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ro(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+tr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+`) is still open`)}function zo(e){let t=this;t.parser=n;function n(n){return No(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Bo(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Vo(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -37,7 +37,7 @@ Error generating stack: `+e.message+`
|
|
|
37
37
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
38
38
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return zl(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ru.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Ju(){return{exit:{taskListCheckValueChecked:Xu,taskListCheckValueUnchecked:Xu,paragraph:Zu}}}function Yu(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Qu}}}function Xu(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Zu(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Qu(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ru.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function $u(){return[rl(),Dl(),Ml(),zu(),Ju()]}function ed(e){return{extensions:[il(),Ol(e),Nl(),qu(e),Yu()]}}var td={tokenize:hd,partial:!0},nd={tokenize:gd,partial:!0},rd={tokenize:_d,partial:!0},id={tokenize:vd,partial:!0},ad={tokenize:yd,partial:!0},od={name:`wwwAutolink`,tokenize:pd,previous:bd},sd={name:`protocolAutolink`,tokenize:md,previous:xd},cd={name:`emailAutolink`,tokenize:fd,previous:Sd},ld={};function ud(){return{text:ld}}for(var dd=48;dd<123;)ld[dd]=cd,dd++,dd===58?dd=65:dd===91&&(dd=97);ld[43]=cd,ld[45]=cd,ld[46]=cd,ld[95]=cd,ld[72]=[cd,sd],ld[104]=[cd,sd],ld[87]=[cd,od],ld[119]=[cd,od];function fd(e,t,n){let r=this,i,a;return o;function o(t){return!Cd(t)||!Sd.call(r,r.previous)||wd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Cd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ad,u,l)(t):t===45||t===95||Qr(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Zr(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function pd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!bd.call(r,r.previous)||wd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(td,e.attempt(nd,e.attempt(rd,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function md(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&xd.call(r,r.previous)&&!wd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Zr(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ei(t)||ai(t)||ci(t)||si(t)?n(t):e.attempt(nd,e.attempt(rd,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function hd(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function gd(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(id,c,s)(t):t===null||ai(t)||ci(t)||t!==45&&si(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function _d(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(id,t,a)(o):o===null||ai(o)||ci(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function vd(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ai(o)||ci(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||ai(e)||ci(e)?t(e):r(e)}function a(e){return Zr(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Zr(t)?(e.consume(t),o):n(t)}}function yd(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Qr(e)?n(e):t(e)}}function bd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ai(e)}function xd(e){return!Zr(e)}function Sd(e){return!(e===47||Cd(e))}function Cd(e){return e===43||e===45||e===46||e===95||Qr(e)}function wd(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Td={tokenize:Nd,partial:!0};function Ed(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ad,continuation:{tokenize:jd},exit:Md}},text:{91:{name:`gfmFootnoteCall`,tokenize:kd},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Dd,resolveTo:Od}}}}function Dd(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Xr(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Od(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function kd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||ai(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Xr(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return ai(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ad(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||ai(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Xr(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return ai(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),di(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function jd(e,t,n){return e.check(Di,t,e.attempt(Td,t,n))}function Md(e){e.exit(`gfmFootnoteDefinition`)}function Nd(e,t,n){let r=this;return di(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Pd(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Ur(o,o.length,0,bi(s,e.slice(r+1,n),t)),Ur(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ur(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=yi(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=yi(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Fd=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){Id(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Id(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function Ld(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Rd(){return{flow:{null:{name:`table`,tokenize:zd,resolveAll:Bd}}}}function zd(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):ii(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):oi(t)?di(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||ai(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,oi(t)?di(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return oi(t)?di(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||ii(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return oi(t)?di(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||ii(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||ii(n)?(e.exit(`tableRow`),t(n)):oi(n)?di(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||ai(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Bd(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Fd;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Hd(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Vd(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Vd(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Vd(f,t,o,i,n,d)):(o[0]=o[1],d=Vd(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Hd(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Ld(t.events,n))}return e}function Vd(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ud(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ud(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ud(t.events,n[2]),a=Ud(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ud(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Hd(e,t,n,r,i){let a=[],o=Ud(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ud(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Wd={name:`tasklistCheck`,tokenize:Kd};function Gd(){return{text:{91:Wd}}}function Kd(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return ai(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return ii(r)?t(r):oi(r)?e.check({tokenize:qd},t,n)(r):n(r)}}function qd(e,t,n){return di(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Jd(e){return Kr([ud(),Ed(),Pd(e),Rd(),Gd()])}var Yd={};function Xd(e){let t=this,n=e||Yd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Jd(n)),a.push($u()),o.push(ed(n))}var Zd=(0,P.createContext)({});function Qd({children:e,openExternalLink:t,openFile:n,fileImages:r}){let i=(0,P.useMemo)(()=>({openExternalLink:t,openFile:n,fileImages:r}),[t,n,r]);return(0,F.jsx)(Zd.Provider,{value:i,children:e})}function $d(){return(0,P.useContext)(Zd)}function ef(e){let t=e.indexOf(`#`),n=t<0?e:e.slice(0,t);if(n.includes(`?`))return;let r;try{r=decodeURIComponent(n)}catch{return}if(r.length===0||/[\u0000-\u001f\u007f]/.test(r)||/^[\\/]{2}/.test(r)||/^[a-z][a-z\d+.-]*:/i.test(r)&&!/^[a-z]:[\\/]/i.test(r))return;if(t<0)return{path:r};let i=e.slice(t+1),a=/^L([1-9]\d*)(?:-L([1-9]\d*))?$/.exec(i);if(a===null)return;let o=Number(a[1]),s=a[2]===void 0?o:Number(a[2]);if(!(!Number.isSafeInteger(o)||!Number.isSafeInteger(s)||s<o))return{path:r,line:o}}async function tf(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})}}function nf({children:e}){let t=(0,P.useRef)(null),[n,i]=(0,P.useState)(!1);return(0,F.jsxs)(`div`,{className:`pi-code-block`,children:[(0,F.jsx)(`div`,{className:`pi-code-toolbar`,children:(0,F.jsx)(`button`,{type:`button`,onClick:async()=>{let e=await tf(t.current?.textContent??``);i(e),e&&window.setTimeout(()=>i(!1),1800)},children:n?r(`已复制`,`Copied`):r(`复制代码`,`Copy code`)})}),(0,F.jsx)(`pre`,{ref:t,children:e})]})}function rf({text:e}){let{openFile:t}=$d();return(0,F.jsx)(`div`,{className:`pi-markdown`,children:(0,F.jsx)(Wc,{remarkPlugins:[Xd],components:{pre:({children:e})=>(0,F.jsx)(nf,{children:e}),a:({href:e,children:n})=>{let r=e?ef(e):void 0,i=r!==void 0&&t!==void 0;return(0,F.jsx)(`a`,{href:e,target:i||e?.startsWith(`#`)?void 0:`_blank`,rel:`noopener noreferrer`,onClick:i?e=>{e.preventDefault(),t(r.path,r.line===void 0?void 0:{line:r.line})}:void 0,children:n})}},children:e})})}var af={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 of({icon:e,title:t,open:n,onToggle:r,collapsedContent:i,children:a,rowClassName:o,leadingClassName:s,titleClassName:c,chevronClassName:l}){return(0,F.jsxs)(`div`,{className:af.root,"data-open":n||void 0,children:[(0,F.jsxs)(`div`,{className:`${af.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,F.jsx)(`span`,{className:`${af.leading} ${s??``}`,children:n?(0,F.jsx)(ct,{className:l}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:af.iconIdle,children:e}),(0,F.jsx)(ct,{className:`${af.chevronHover} ${l??``}`})]})}),(0,F.jsx)(`span`,{className:`${af.title} ${c??``}`,children:t}),!n&&i]}),n&&a]})}var sf={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 cf({text:e,running:t}){let[n,i]=(0,P.useState)(!1),a=e.trimEnd(),o=(t?a.slice(a.lastIndexOf(`
|
|
39
39
|
`)+1):e.split(`
|
|
40
|
-
`,1)[0]).replaceAll(`**`,``);return(0,F.jsx)(`div`,{className:sf.root,"data-variant":`think`,"data-state":t?`running`:`ok`,"data-expanded":n||void 0,children:(0,F.jsx)(of,{icon:(0,F.jsx)(mt,{size:14}),title:r(`思考`,`Thinking`),open:n,onToggle:()=>i(e=>!e),rowClassName:sf.row,leadingClassName:sf.leading,titleClassName:sf.title,chevronClassName:sf.chevron,collapsedContent:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:sf.separator,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:sf.summary,"data-follow-end":t||void 0,children:(0,F.jsx)(`span`,{className:sf.summaryText,children:o})})]}),children:(0,F.jsx)(`div`,{className:sf.thinkBody,children:e})})})}function lf(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 uf={root:`_root_1tps1_1`,icon:`_icon_1tps1_12`,"agent-activity-spin":`_agent-activity-spin_1tps1_1`,copy:`_copy_1tps1_19`};function df({state:e,elapsedSeconds:t}){return(0,F.jsxs)(`div`,{className:uf.root,"data-agent-activity":e,children:[(0,F.jsx)(`span`,{className:uf.icon,"aria-hidden":`true`,children:(0,F.jsx)(gt,{})}),(0,F.jsxs)(`span`,{className:`${tn.turnStatus} ${uf.copy}`,children:[(0,F.jsx)(`span`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:e===`sending`?r(`正在发送`,`Sending`):r(`正在处理`,`Working`)}),(0,F.jsx)(`span`,{"data-agent-elapsed":t,"aria-hidden":`true`,children:` · ${lf(t)}`})]})]})}function ff(e,t,n,r){return!!e&&n===`connected`&&!e.interactions?.length&&!t?.error&&(r||!e.idle)}function pf(e,t,n,r){return!ff(e,t,n,r)||t?.blocks.some(e=>e.kind===`toolCall`||e.text.trim())?null:r?`sending`:`working`}function mf(e,t){let[n,r]=(0,P.useState)(null);return(0,P.useEffect)(()=>{if(!e){r(null);return}let n=performance.now();r({sessionId:t,seconds:0});let i=window.setInterval(()=>{r({sessionId:t,seconds:Math.max(0,Math.floor((performance.now()-n)/1e3))})},1e3);return()=>window.clearInterval(i)},[e,t]),e&&n&&n.sessionId===t?n.seconds:0}var hf=g(a(((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),gf={"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)`},_f={bold:{fontWeight:700},dim:{opacity:.7},italic:{fontStyle:`italic`},underline:{textDecoration:`underline`},strikethrough:{textDecoration:`line-through`},hidden:{visibility:`hidden`}},vf=/\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/g,yf=/\u001b(?!\[)[\u0020-\u002f]*[\u0030-\u007e]?/g,bf=/[\u0000-\u0007\u000b-\u001a\u001c-\u001f\u007f]/g,xf=/\r|\u0008|\u001b\[[\u0030-\u003f]*[\u0020-\u002f]*K/,Sf=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*m/g,Cf=8,wf=/^[\p{Mn}\p{Me}\p{Cf}\u200b-\u200f\u2060]$/u,Tf=RegExp(`\\p{Script=Han}|\\p{Script=Hiragana}|\\p{Script=Katakana}|\\p{Script=Hangul}|\\p{Emoji_Presentation}|[\\uff01-\\uff60\\u3000-\\u303e]`,`u`);function Ef(e){let t=e.codePointAt(0);return t===void 0||t<4352?!1:Tf.test(e)}var Df={fg:``,bg:``,attrs:[]},Of={22:[`1`,`2`],23:[`3`],24:[`4`],25:[`5`,`6`],27:[`7`],28:[`8`],29:[`9`]};function kf(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=Df;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=Of[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 Af(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 jf(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 Mf(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&&Ef(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+Cf-i%Cf;for(;i<e;i++)r[i]??={sgr:a,char:` `}}else if(wf.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++,Ef(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=kf(a,n))}c(e.slice(o));let l=``,u=t;for(let e=0;e<r.length;e++){let t=r[e]??{sgr:Df,char:` `};jf(t.sgr,u)||(jf(u,Df)||(l+=`\x1B[0m`),l+=Af(t.sgr),u=t.sgr);let n=e>0&&Ef(r[e-1]?.char??``);l+=t.spacer===!0&&!n?` `:t.char}return jf(u,a)||(jf(u,Df)||(l+=`\x1B[0m`),l+=Af(a)),{text:l,sgr:a}}function Nf(e){let t=[],n=Df;for(let r of e.split(`
|
|
40
|
+
`,1)[0]).replaceAll(`**`,``);return(0,F.jsx)(`div`,{className:sf.root,"data-variant":`think`,"data-state":t?`running`:`ok`,"data-expanded":n||void 0,children:(0,F.jsx)(of,{icon:(0,F.jsx)(mt,{size:14}),title:r(`思考`,`Thinking`),open:n,onToggle:()=>i(e=>!e),rowClassName:sf.row,leadingClassName:sf.leading,titleClassName:sf.title,chevronClassName:sf.chevron,collapsedContent:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:sf.separator,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:sf.summary,"data-follow-end":t||void 0,children:(0,F.jsx)(`span`,{className:sf.summaryText,children:o})})]}),children:(0,F.jsx)(`div`,{className:sf.thinkBody,children:e})})})}function lf(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 uf={root:`_root_1tps1_1`,icon:`_icon_1tps1_12`,"agent-activity-spin":`_agent-activity-spin_1tps1_1`,copy:`_copy_1tps1_19`};function df({state:e,elapsedSeconds:t}){return(0,F.jsxs)(`div`,{className:uf.root,"data-agent-activity":e,children:[(0,F.jsx)(`span`,{className:uf.icon,"aria-hidden":`true`,children:(0,F.jsx)(gt,{})}),(0,F.jsxs)(`span`,{className:`${tn.turnStatus} ${uf.copy}`,children:[(0,F.jsx)(`span`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:e===`sending`?r(`正在发送`,`Sending`):r(`正在处理`,`Working`)}),(0,F.jsx)(`span`,{"data-agent-elapsed":t,"aria-hidden":`true`,children:` · ${lf(t)}`})]})]})}function ff(e,t,n,r){return!!e&&n===`connected`&&!e.interactions?.length&&!t?.error&&(r||!e.idle)}function pf(e,t,n,r){return!ff(e,t,n,r)||t?.blocks.some(e=>e.kind===`toolCall`||e.text.trim())?null:r?`sending`:`working`}function mf(e,t,n=0){let r=(0,P.useRef)(new Map),[i,a]=(0,P.useState)(null);return(0,P.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 hf=g(a(((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),gf={"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)`},_f={bold:{fontWeight:700},dim:{opacity:.7},italic:{fontStyle:`italic`},underline:{textDecoration:`underline`},strikethrough:{textDecoration:`line-through`},hidden:{visibility:`hidden`}},vf=/\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/g,yf=/\u001b(?!\[)[\u0020-\u002f]*[\u0030-\u007e]?/g,bf=/[\u0000-\u0007\u000b-\u001a\u001c-\u001f\u007f]/g,xf=/\r|\u0008|\u001b\[[\u0030-\u003f]*[\u0020-\u002f]*K/,Sf=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*m/g,Cf=8,wf=/^[\p{Mn}\p{Me}\p{Cf}\u200b-\u200f\u2060]$/u,Tf=RegExp(`\\p{Script=Han}|\\p{Script=Hiragana}|\\p{Script=Katakana}|\\p{Script=Hangul}|\\p{Emoji_Presentation}|[\\uff01-\\uff60\\u3000-\\u303e]`,`u`);function Ef(e){let t=e.codePointAt(0);return t===void 0||t<4352?!1:Tf.test(e)}var Df={fg:``,bg:``,attrs:[]},Of={22:[`1`,`2`],23:[`3`],24:[`4`],25:[`5`,`6`],27:[`7`],28:[`8`],29:[`9`]};function kf(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=Df;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=Of[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 Af(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 jf(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 Mf(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&&Ef(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+Cf-i%Cf;for(;i<e;i++)r[i]??={sgr:a,char:` `}}else if(wf.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++,Ef(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=kf(a,n))}c(e.slice(o));let l=``,u=t;for(let e=0;e<r.length;e++){let t=r[e]??{sgr:Df,char:` `};jf(t.sgr,u)||(jf(u,Df)||(l+=`\x1B[0m`),l+=Af(t.sgr),u=t.sgr);let n=e>0&&Ef(r[e-1]?.char??``);l+=t.spacer===!0&&!n?` `:t.char}return jf(u,a)||(jf(u,Df)||(l+=`\x1B[0m`),l+=Af(a)),{text:l,sgr:a}}function Nf(e){let t=[],n=Df;for(let r of e.split(`
|
|
41
41
|
`)){let e=r.replace(/\r+$/,``);if(xf.test(e)){let r=Mf(e,n);t.push(r.text),n=r.sgr}else{t.push(e);for(let t of e.matchAll(Sf))n=kf(n,String(t[1]))}}return t.join(`
|
|
42
42
|
`)}function Pf(e){return Nf(e.replace(vf,``).replace(yf,``)).replace(bf,``)}function Ff(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?gf[e.fg.replace(/\s+/g,``)]??r:r}for(let n of e.decorations)Object.assign(t,_f[n]);return Object.keys(t).length===0?void 0:t}function If(e){let t=[],n=[t];for(let r of hf.default.ansiToJson(Pf(e),{json:!0,remove_empty:!0})){let e=Ff(r);for(let[i,a]of r.content.split(`
|
|
43
43
|
`).entries())i>0&&(t=[],n.push(t)),a!==``&&t.push({text:a,style:e})}return n}function Lf(e,t,n){let r=e-t,i=Math.ceil(t/2);return{hidden:r,capped:r>0&&!n,headLines:i,tailLines:t-i}}var Rf=1e3;function zf(e){let[t,n]=(0,P.useState)(!1);return{copied:t,onCopy:(0,P.useCallback)(()=>{t||tf(e).then(e=>{e&&(n(!0),window.setTimeout(()=>{n(!1)},Rf))})},[t,e])}}var Bf={pill:`_pill_e3ygd_1`,interactive:`_interactive_e3ygd_15`,active:`_active_e3ygd_23`};function Vf({active:e=!1,className:t,children:r,onClick:i,...a}){return i?(0,F.jsx)(`button`,{type:`button`,className:n(Bf.pill,Bf.interactive,e&&Bf.active,t),onClick:i,...a,children:r}):(0,F.jsx)(`span`,{className:n(Bf.pill,e&&Bf.active,t),children:r})}var Hf={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 Uf(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 Wf(e,t,n){if(t!==void 0)return n.signal(t);if(e!==void 0&&e!==0)return n.exitCode(e)}function Gf(e,t,n,r){return e?{state:`ongoing`,label:r.running}:Wf(t,n,r)===void 0?{state:`done`,label:r.done}:{state:`error`,label:r.failed}}function Kf(e){return e.map((e,t)=>e.style===void 0?e.text:(0,F.jsx)(`span`,{style:e.style,children:e.text},t))}function qf({command:e,cwd:t,home:r,output:i,exitCode:a,signal:o,running:s=!1,maxLines:c=16,className:l,labels:u}){let d=u,f=i??``,p=(0,P.useMemo)(()=>{let e=If(f),t=e[e.length-1];return e.length>1&&t!==void 0&&t.every(e=>e.text===``)?e.slice(0,-1):e},[f]),[m,h]=(0,P.useState)(!1),{copied:g,onCopy:_}=zf(f),v=(0,P.useCallback)(()=>{h(e=>!e)},[]),y=Wf(a,o,d),b=Gf(s,a,o,d),x=(0,P.useMemo)(()=>(e.endsWith(`
|
|
@@ -58,7 +58,7 @@ Error generating stack: `+e.message+`
|
|
|
58
58
|
`).entries())t&&i.append(mS()),n&&i.append(Iv(n));t.clear().append(i),n&&i.selectEnd()},{discrete:!0}),e.value||r.dispatchCommand(sh,void 0))},[r,e.value]),(0,P.useLayoutEffect)(()=>{RD(r)},[r,e.claimToken]),(0,F.jsx)(`div`,{className:en.scroll,"data-input-scroll":!0,children:(0,F.jsxs)(`div`,{className:en.grow,children:[(0,F.jsx)(PD,{editor:r,editable:e.editable,className:en.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,F.jsx)(`div`,{"aria-hidden":!0,className:en.placeholder,"data-composer-placeholder":!0,children:e.placeholder})]})})});function BD(e,t){return typeof e==`string`?e:e?.[t]}function VD(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:BD(t.presentation?.label,r)??t.title,description:BD(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 HD(e){let t=e.input?.token;return[e.name,...typeof t==`string`?[t]:t?[t.zh,t.en]:[]]}function UD(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&&HD(e).includes(n[1]));return r?{command:r,token:`/${n[1]}`,text:(n[2]??``).trim()}:void 0}function WD(e,t,n){let r=t.toLocaleLowerCase();return e.filter(e=>(!n||!e.menuOnly)&&[...HD(e),e.label??``].some(e=>e.toLocaleLowerCase().includes(r)))}function GD(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 KD(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 qD=12;function JD(e,t,n){let[r,i]=(0,P.useState)(t);return(0,P.useLayoutEffect)(()=>{let n=e.current;if(n===null)return;let r=()=>{i(Math.min(t,Math.max(0,n.getBoundingClientRect().bottom-qD)))};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 YD={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 XD(){return[{name:`file`,label:r(`文件`,`File`),section:`add`,icon:T,menuOnly:!1},{name:`compact`,label:r(`压缩`,`Compact`),icon:j,description:r(`压缩当前会话内容`,`Compact the current session`)},{name:`model`,label:r(`模型`,`Model`),icon:k,description:r(`选择本会话使用的模型`,`Choose the model for this session`)},{name:`new`,label:r(`新会话`,`New session`),icon:ae,description:r(`创建新会话`,`Create a new session`)}]}function ZD({commands:e,active:t,onHover:n,onPick:i,grouped:a=!0}){let o=(0,P.useRef)(null),s=JD(o,400,e.length);return(0,P.useLayoutEffect)(()=>{o.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t,e.length]),(0,F.jsx)(kp,{ref:o,className:YD.menu,"data-trigger-menu":``,style:{maxHeight:s},children:(0,F.jsxs)(`div`,{className:YD.viewport,role:`listbox`,"aria-label":r(`指令`,`Commands`),"aria-activedescendant":e[t]?`pi-command-${t}`:void 0,children:[e.map((o,s)=>(0,F.jsxs)(P.Fragment,{children:[a&&(s===0||o.section!==e[s-1]?.section)&&(0,F.jsx)(`div`,{className:YD.sectionTitle,role:`presentation`,children:o.section===`add`?r(`添加`,`Add`):r(`指令`,`Commands`)}),(0,F.jsxs)(`button`,{id:`pi-command-${s}`,type:`button`,role:`option`,"aria-selected":s===t,className:`${YD.item} ${s===t?YD.active:``}`,onMouseDown:e=>{e.preventDefault(),i(o)},onMouseMove:s===t?void 0:()=>n(s),children:[o.icon&&(0,F.jsx)(`span`,{className:YD.itemIcon,"aria-hidden":!0,children:(0,F.jsx)(o.icon,{size:14})}),(0,F.jsx)(`span`,{className:YD.itemName,children:o.label??o.name}),o.label&&o.label.toLowerCase()!==o.name.toLowerCase()&&(0,F.jsx)(`span`,{className:YD.itemAlias,children:o.name}),o.description&&(0,F.jsx)(`span`,{className:YD.itemDescription,children:o.description})]})]},`${o.pluginId??`pi`}:${o.name}`)),e.length===0&&(0,F.jsx)(`div`,{className:YD.groupTitle,children:r(`没有匹配的指令`,`No matching commands`)})]})})}var QD={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 $D({disabled:e,labels:t}){return(0,jt.createPortal)((0,F.jsx)(`div`,{className:QD.mask,role:`status`,children:(0,F.jsxs)(`div`,{className:QD.wrap,children:[(0,F.jsx)(`div`,{className:QD.illustration,"aria-hidden":`true`,children:e?(0,F.jsx)(tO,{}):(0,F.jsx)(eO,{})}),(0,F.jsx)(`div`,{className:QD.title,children:t.title}),!e&&t.desc!==void 0&&(0,F.jsx)(`div`,{className:QD.desc,children:t.desc})]})}),document.body)}var eO=()=>(0,F.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsxs)(`g`,{clipPath:`url(#piwDropOverlayClip)`,children:[(0,F.jsx)(`rect`,{y:`17.0742`,width:`44.1832`,height:`43.6431`,rx:`12`,transform:`rotate(-22.7338 0 17.0742)`,fill:`#9CE5ED`}),(0,F.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,F.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,F.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7966`,stroke:`white`,strokeWidth:`3`}),(0,F.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,F.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,F.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,F.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,F.jsx)(`circle`,{cx:`60.6157`,cy:`52.247`,r:`4.38794`,transform:`rotate(22.5996 60.6157 52.247)`,fill:`white`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`piwDropOverlayClip`,children:(0,F.jsx)(`rect`,{width:`115`,height:`84`,fill:`white`})})})]}),tO=()=>(0,F.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.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,F.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,F.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,F.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7967`,stroke:`white`,strokeWidth:`3`}),(0,F.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,F.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,F.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,F.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,F.jsx)(`path`,{d:`M44 46.7969L64 66.7969`,stroke:`white`,strokeWidth:`3.5`,strokeLinecap:`round`})]});function nO(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)}return{text:n,attachments:t}}var rO={keys:`_keys_38b9q_1`,key:`_key_38b9q_1`,tooltip:`_tooltip_38b9q_20`,separator:`_separator_38b9q_30`,joined:`_joined_38b9q_32`};function iO({keys:e,variant:t=`plain`,className:r}){return(0,F.jsx)(`span`,{className:n(rO.keys,t===`tooltip`&&rO.tooltip,t===`tooltip`&&e.includes(`+`)&&rO.joined,r),children:e.map((e,t)=>(0,F.jsx)(`kbd`,{className:e===`+`?rO.separator:rO.key,children:e},t))})}var aO={bubble:`_bubble_ugtpz_1`,"tooltip-in":`_tooltip-in_ugtpz_1`,label:`_label_ugtpz_26`},oO={pointer:`pointer`,keyboard:`keyboard`},sO=`data-input-modality`,cO=new Set([`Tab`,`Home`,`End`,`PageUp`,`PageDown`]),lO=!1,uO=!1,dO;function fO(){document.documentElement.setAttribute(sO,uO?oO.pointer:oO.keyboard)}function pO(){return lO}typeof window<`u`&&(window.addEventListener(`pointerdown`,()=>{lO=!0,uO=!0,dO=void 0,fO()},!0),window.addEventListener(`keydown`,e=>{typeof e.key==`string`&&(lO=!1,e.isComposing?dO=void 0:(dO=e.composedPath()[0],(cO.has(e.key)||e.key.startsWith(`Arrow`))&&(uO=!1,fO())))},!0),window.addEventListener(`focusin`,e=>{dO!==void 0&&e.composedPath()[0]!==dO&&(dO=void 0,uO&&(uO=!1,fO()))},!0),window.addEventListener(`blur`,()=>{dO=void 0}));var mO=(0,P.createContext)(null);function hO({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,P.useRef)(null),d=l.props.ref,f=(0,P.useCallback)(e=>{u.current=e,typeof d==`function`?d(e):d!=null&&(d.current=e)},[d]),[p,m]=(0,P.useState)(null),h=(0,P.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,P.useRef)(null),y=(0,P.useRef)({hover:!1,focus:!1}),b=(0,P.useContext)(mO),[x,S]=(0,P.useState)(!1),C=(0,P.useCallback)(e=>{b?.(e)},[b]),w=p!==null&&!o;(0,P.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,P.useEffect)(()=>(C(w),()=>{C(!1)}),[C,w]);let T=(0,P.useCallback)(()=>{v.current!==null&&(clearTimeout(v.current),v.current=null)},[]);(0,P.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)},O=()=>{m(null),C(!1)},k=()=>{T(),!y.current.hover&&!y.current.focus&&O()},ee=w&&!x&&(0,F.jsxs)(`span`,{ref:h,className:aO.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,F.jsx)(`span`,{className:aO.label,children:g}),t!==void 0&&t.length>0&&(0,F.jsx)(iO,{keys:t,variant:`tooltip`})]});return(0,F.jsxs)(mO.Provider,{value:S,children:[(0,P.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(),O()},onClick:e=>{l.props.onClick?.(e),y.current.focus=!1,T(),O()},onFocus:e=>{l.props.onFocus?.(e),pO()||(y.current.focus=!0,T(),E())},onBlur:e=>{l.props.onBlur?.(e),y.current.focus=!1,k()}}),s?ee!==!1&&(0,jt.createPortal)(ee,document.body):ee]})}var gO={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 _O({session:e,connected:t,onUpdate:n}){let[i,a]=(0,P.useState)(!0),[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(``),f=(0,P.useRef)(!1),p=(0,P.useId)(),m=(0,P.useRef)(null),h=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{if(h.current&&o===null&&c===null){let e=document.activeElement;(!e||e===document.body||m.current?.contains(e))&&m.current?.querySelector(`[data-prompt-id="${CSS.escape(h.current)}"] [data-edit-prompt]`)?.focus(),h.current=null}},[o,c,e?.queuedPrompts]);let g=[...(e?.promptQueue?.steering??[]).map((e,t)=>({id:`steer-${t}`,label:r(`引导`,`Steer`),...nO(e)})),...(e?.promptQueue?.followUp??[]).map((e,t)=>({id:`native-${t}`,label:r(`排队`,`Queue`),...nO(e)})),...(e?.queuedPrompts??[]).map(e=>({id:e.id,label:r(`排队`,`Queue`),text:e.text,attachments:e.attachments,item:e}))];if((0,P.useEffect)(()=>{g.length===0&&a(!0),o&&!g.some(e=>e.id===o.id&&e.item?.status===`queued`)&&s(null)},[g.length,o,e?.queuedPrompts]),!g.length&&!e?.hasPendingPrompts)return null;let y=g.length===1||!i||o!==null||c!==null,b=r(`${g.length} 条待处理提示词`,`${g.length} pending prompts`),x=e=>{h.current=e},S=async(e,i)=>{if(f.current||!t)return!1;f.current=!0,l(e.id),d(``);try{return await n(e.id,e.revision,i),!0}catch(e){return d(e instanceof Error?e.message:r(`队列操作失败`,`Queue action failed`)),!1}finally{f.current=!1,l(null)}},C=async()=>{if(!o)return;let e=o;await S(e,{kind:`edit`,text:e.text})&&(s(null),x(e.id))},T=(e,t,n,r,i=!1)=>(0,F.jsx)(hO,{portal:!0,label:e,side:`top`,delayMs:500,disabled:t,children:(0,F.jsx)(`button`,{className:gO.action,type:`button`,"aria-label":e,disabled:t,onClick:n,"data-edit-prompt":i||void 0,children:r})});return(0,F.jsx)(`section`,{className:gO.dock,"aria-label":r(`待处理提示词`,`Pending prompts`),"data-queue-dock":``,children:(0,F.jsxs)(`div`,{className:gO.panel,children:[g.length>1&&(0,F.jsxs)(`button`,{type:`button`,className:gO.header,"aria-label":b,"aria-controls":p,"aria-expanded":y,disabled:o!==null||c!==null,onClick:()=>a(e=>!e),children:[(0,F.jsx)(`span`,{className:gO.lead,"aria-hidden":!0,children:(0,F.jsx)(D,{})}),(0,F.jsx)(`span`,{className:gO.count,role:`status`,children:b}),!y&&g.some(e=>e.item?.status===`sending`)&&(0,F.jsx)(`span`,{className:gO.status,children:r(`发送中…`,`Sending…`)}),(0,F.jsx)(`span`,{className:gO.chevron,"aria-hidden":!0,children:y?(0,F.jsx)(E,{}):(0,F.jsx)(M,{})})]}),g.length===0&&(0,F.jsxs)(`div`,{className:gO.header,children:[(0,F.jsx)(`span`,{className:gO.lead,"aria-hidden":!0,children:(0,F.jsx)(D,{})}),(0,F.jsx)(`span`,{className:gO.count,role:`status`,children:r(`等待 Pi 接收`,`Waiting for Pi`)})]}),(0,F.jsx)(`ol`,{ref:m,id:p,className:gO.list,hidden:!y,children:g.map(n=>{let i=n.item,a=!t||c!==null||i?.status===`sending`;return(0,F.jsxs)(`li`,{className:gO.row,"data-prompt-id":n.id,children:[g.length===1&&(0,F.jsx)(`span`,{className:gO.lead,"aria-hidden":!0,children:(0,F.jsx)(D,{})}),(0,F.jsx)(`span`,{className:gO.kind,children:n.label}),(0,F.jsxs)(`div`,{className:gO.content,children:[n.attachments.length>0&&(0,F.jsx)(`span`,{className:gO.attachments,children:n.attachments.map((e,t)=>(0,F.jsxs)(`span`,{className:gO.file,title:e.name,children:[(0,F.jsx)(_,{path:e.name}),(0,F.jsx)(`span`,{children:e.name})]},t))}),o?.id===n.id?(0,F.jsx)(`textarea`,{className:gO.editor,autoFocus:!0,rows:2,maxLength:32e3,"aria-label":r(`编辑排队提示词`,`Edit queued prompt`),value:o.text,disabled:c!==null,onChange:e=>s({...o,text:e.target.value}),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`&&(e.preventDefault(),s(null),x(n.id)),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C()))}}):n.text&&(0,F.jsx)(`span`,{className:gO.preview,title:n.text,children:n.text}),i?.error&&(0,F.jsx)(`span`,{className:gO.error,role:`alert`,children:i.error})]}),i?.status===`sending`&&(0,F.jsx)(`span`,{className:gO.status,role:`status`,children:r(`发送中…`,`Sending…`)}),i&&(0,F.jsx)(`div`,{className:gO.actions,children:o?.id===n.id?(0,F.jsxs)(F.Fragment,{children:[T(r(`保存修改`,`Save changes`),a||!o.text.trim()&&n.attachments.length===0,()=>{C()},(0,F.jsx)(A,{})),T(r(`取消编辑`,`Cancel edit`),c!==null,()=>{s(null),x(n.id)},(0,F.jsx)(O,{}))]}):(0,F.jsxs)(F.Fragment,{children:[T(r(`编辑`,`Edit`),a,()=>{s({id:i.id,revision:i.revision,text:i.text}),d(``)},(0,F.jsx)(ee,{}),!0),T(r(`删除`,`Delete`),a,()=>{S(i,{kind:`remove`})},(0,F.jsx)(w,{})),T(r(`发送(引导)`,`Send (steer)`),a||!!e?.idle||!!e?.interactions?.length,()=>{S(i,{kind:`steer`})},(0,F.jsx)(v,{}))]})})]},n.id)})}),u&&(0,F.jsx)(`div`,{className:gO.error,role:`alert`,children:u}),e?.paused&&(0,F.jsx)(`div`,{className:gO.paused,role:`status`,children:r(`已暂停,继续后处理`,`Paused; processed on resume`)})]})})}var vO={controls:`_controls_1d60f_1`,action:`_action_1d60f_2`};function yO({hasDraft:e,canSend:t,canStop:n,pauseLabel:i,pauseTitle:a,pauseIcon:o,onStop:s}){let c=e=>e.preventDefault(),l=(0,F.jsx)(hO,{label:a??i,side:`top`,delayMs:500,disabled:!n,children:(0,F.jsx)(`button`,{className:e?vO.action:en.primary,type:`button`,"aria-label":i,disabled:!n,onMouseDown:c,onClick:s,children:o??(0,F.jsx)(pe,{size:16})})});return(0,F.jsxs)(`div`,{className:vO.controls,role:`group`,"aria-label":r(`追加提示词`,`Append prompt`),children:[l,e&&(0,F.jsx)(hO,{label:r(`当前任务完成后排队处理`,`Queue after the current task finishes`),shortcutKeys:[`Enter`],side:`top`,delayMs:500,disabled:!t,children:(0,F.jsx)(`button`,{className:en.primary,type:`submit`,"aria-label":r(`发送消息`,`Send message`),disabled:!t,onMouseDown:c,children:(0,F.jsx)(C,{size:16})})})]})}function bO(e,t,n){let r=(0,P.useRef)(null),i=(0,P.useRef)(null),a=(0,P.useRef)(null),o=(0,P.useRef)(!0),s=(0,P.useRef)(0),[c,l]=(0,P.useState)(!1),u=(0,P.useCallback)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight,s.current=e.scrollTop,l(!1))},[]),d=(0,P.useCallback)(()=>{o.current=!0,u()},[u]),f=(0,P.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,P.useCallback)(e=>{e.deltaY<0&&(o.current=!1)},[]);return(0,P.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,P.useLayoutEffect)(()=>{t&&n&&d()},[t,n,d]),(0,P.useLayoutEffect)(()=>{t&&o.current&&u()}),{scroll:r,content:i,composer:a,onScroll:f,onWheel:p,showLatest:t&&c,returnToLatest:d}}function xO({message:e,results:t,loadImage:n,running:i=!1,onInspect:a,cwd:o}){if(e.role===`tool`&&e.toolCallId&&t.has(e.toolCallId))return null;if(e.role===`user`){let t=e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
59
59
|
`),i=e.localFiles?{text: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)}))}:nO(t),a=e.blocks.map((e,t)=>({block:e,index:t})).filter(({block:e})=>e.kind===`image`),o=i.attachments.filter(e=>e.image),s=e.localFiles?.filter(e=>/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type));return(0,F.jsx)(`div`,{className:nn.userRow,"data-message-role":`user`,children:(0,F.jsxs)(`div`,{className:nn.userStack,children:[(a.length>0||i.attachments.some(e=>!e.image))&&(0,F.jsxs)(`div`,{className:nn.attachmentRow,"data-message-attachments":!0,children:[a.map(({index:t},c)=>(0,F.jsx)(Vp,{name:o[c]?.name??s?.[c]?.name??r(`图片`,`Image`),messageId:e.id,index:t,file:s?.[c],tile:a.length>1||i.attachments.length>a.length,loadImage:n},t)),i.attachments.filter(e=>!e.image).map((e,t)=>(0,F.jsxs)(`span`,{className:nn.fileCard,title:e.name,children:[(0,F.jsx)(_,{path:e.name,className:nn.fileIcon}),(0,F.jsxs)(`span`,{className:nn.fileContent,children:[(0,F.jsx)(`span`,{className:nn.fileName,children:e.name}),(0,F.jsxs)(`span`,{className:nn.fileMeta,children:[re(e.name).toUpperCase(),` `,r(`文件`,`file`)]})]})]},`${e.name}-${t}`))]}),i.text&&(0,F.jsx)(`div`,{className:nn.bubble,children:i.text})]})})}return(0,F.jsx)(`div`,{className:`pi-message`,"data-message-role":e.role,children:e.blocks.map((e,n)=>e.kind===`thinking`?(0,F.jsx)(cf,{text:e.text,running:i},n):e.kind===`toolCall`?(0,F.jsx)(ep,{block:e,result:e.toolCallId?t.get(e.toolCallId):void 0,running:i,cwd:o,onInspect:e.toolCallId&&a?()=>a(e.toolCallId):void 0},e.toolCallId||n):e.kind===`image`?(0,F.jsx)(`div`,{className:`pi-image-note`,children:e.text},n):(0,F.jsx)(rf,{text:e.text},n))})}function SO({turn:e,results:t,model:n,loadImage:i,onInspect:a,renderPluginSlot:o,renderToolView:s,artifactTools:c,viewTools:l,running:u=!1,cwd:d,superseded:f=!1}){let p=[...e.messages].reverse().find(e=>e.role===`assistant`&&e.blocks.some(e=>e.kind===`text`&&e.text.trim())),m=p?.blocks.filter(e=>e.kind===`text`)??[],h=[];for(let t of e.messages)t.role===`assistant`&&t.blocks.forEach((e,n)=>{t===p&&e.kind===`text`||e.kind===`toolCall`&&(l.includes(e.toolName??``)||c.includes(e.toolName??``))||h.push({message:t,block:e,index:n})});let[g,_]=(0,P.useState)(!1),v=h.filter(({block:e})=>e.kind===`toolCall`).length,y=new Set(h.filter(({block:e})=>e.kind!==`toolCall`).map(({message:e})=>e.id)).size,b=m.map(e=>e.text).join(`
|
|
60
60
|
`),x=u||g,[S,C]=(0,P.useState)(new Set),w=e.messages.filter(e=>e.role===`assistant`&&e.error),T=[...e.messages].reverse().find(e=>e.role===`assistant`),E=f||T&&!T.error&&T.id!==w.at(-1)?.id?[]:w.filter(e=>!S.has(e.id));return(0,F.jsxs)(`div`,{className:`pi-turn`,"data-turn":e.index,children:[e.messages.filter(e=>e.role===`user`||e.role===`notice`).map(e=>(0,F.jsx)(xO,{message:e,results:t,loadImage:i},e.id)),h.length>0&&(0,F.jsxs)(F.Fragment,{children:[m.length>0&&(0,F.jsx)(tp,{toolCount:v,messageCount:y,open:x,onToggle:()=>_(e=>!e)}),(x||m.length===0)&&(0,F.jsx)(`div`,{className:`pi-turn-process-content`,children:h.map(({message:e,block:n,index:r})=>(0,F.jsx)(xO,{message:{...e,blocks:[n]},results:t,loadImage:i,running:e.id===`stream`,cwd:d,onInspect:a},`${e.id}-${r}`))})]}),up(e.messages,l).map(({key:e,call:n})=>(0,F.jsx)(`div`,{"data-tool-view":n.toolName,children:s?.(n,n.toolCallId?t.get(n.toolCallId):void 0,u&&!t.has(n.toolCallId??``))},e)),m.length>0&&p&&(0,F.jsx)(xO,{message:{...p,blocks:m},results:t,loadImage:i,running:p.id===`stream`}),e.messages.filter(e=>e.role===`tool`&&(!e.toolCallId||!t.has(e.toolCallId))).map(e=>(0,F.jsx)(xO,{message:e,results:t,loadImage:i},e.id)),E.map(e=>(0,F.jsxs)(`div`,{className:`pi-model-error`,role:`alert`,children:[(0,F.jsxs)(`div`,{className:`pi-model-error-title`,children:[(0,F.jsx)(`strong`,{children:r(`模型请求失败`,`Model request failed`)}),(0,F.jsx)(`button`,{type:`button`,className:`pi-error-dismiss`,"aria-label":r(`关闭错误`,`Dismiss error`),onClick:()=>C(t=>new Set(t).add(e.id)),children:`×`})]}),(0,F.jsx)(`span`,{children:/usage limit has been reached/i.test(e.error??``)?r(`模型服务的使用额度已耗尽。请切换模型或等待额度恢复后重试。`,`The model service usage limit has been reached. Switch models or try again after the limit resets.`):e.error})]},`${e.id}-error`)),!u&&E.length===0&&(p||e.usage&&e.usage.totalTokens>0)&&(0,F.jsx)(ip,{text:b,timestamp:p?.timestamp,usage:e.usage,model:p?.model??n}),o(`turn.tail`,{id:e.id,completed:!u,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))})]})}function CO({hero:e,suspended:t=!1,session:n,connection:i,onSend:a,onUpload:o,onDiscardAttachment:s,onStop:c,onResume:u,onCompact:d,onNewSession:f,commands:p,models:m,modelsStatus:h,onConfigureModels:g,onSetModel:_,onSetThinkingLevel:v,onUpdateQueuedPrompt:y,renderPluginSlot:b,plugins:x,onPluginAction:S}){let C=l(),w=n?.sessionId??``,[T,E]=(0,P.useState)({}),D=T[w],O=D?.text??``,k=D?.attachments??[],ee=D?.error??``,te=e=>{E(t=>({...t,[w]:e(t[w]??{text:``,attachments:[],error:``})}))},ne=e=>te(t=>({...t,text:e})),A=e=>te(t=>({...t,attachments:typeof e==`function`?e(t.attachments):e})),re=e=>te(t=>({...t,error:e})),ie=(0,P.useRef)(T);ie.current=T;let[j,ae]=(0,P.useState)(!1),[oe,M]=(0,P.useState)(null),[se,ce]=(0,P.useState)(0),[le,ue]=(0,P.useState)(0),[de,fe]=(0,P.useState)(!1),pe=(0,P.useRef)(0),me=(0,P.useRef)(null),N=(0,P.useRef)(new Map),he=(0,P.useRef)(new Set),_e=(0,P.useRef)(null),ve=(0,P.useRef)(null),ye=(0,P.useRef)(n?.sessionId);ye.current=n?.sessionId;let be=(0,P.useRef)(!1),xe=(0,P.useRef)(t);(0,P.useEffect)(()=>{xe.current&&!t&&ve.current?.focus(),xe.current=t},[t]);let Se=i===`connected`&&n!==null,Ce=Se&&h===`ready`&&m.length===0,we=Se&&m.some(e=>`${e.provider}/${e.id}`===n.model),Te=Se&&!n.idle,Ee=Se&&!j&&!t,De=Ee&&!Te,Oe=k.length===0&&[`/compact`,`/new`,`/model`].includes(O.trim()),ke=(0,P.useMemo)(()=>VD(XD(),p,x,C),[p,x,C]),Ae=UD(O,ke),je=Ae?.command.pluginId?Ae.command:void 0,Me=Ae?.command.input?`${Ae.token}${/\s$/.test(O)||Ae.text?` `:``}`:null,Ne=Ae?.command.input&&!Ae.text?BD(Ae.command.input.hint,C)??null:null,Pe=Ee&&!n?.interactions?.length&&!(Te&&O.trimStart().startsWith(`/`))&&(h===`ready`&&we||!Te&&(Oe||!!je))&&(O.trim().length>0||k.length>0)&&k.every(e=>e.status===`ready`)&&(!je||k.length===0||je.input?.attachments===!0),Fe=GD(x,n,C,O,k.length),Ie=Fe?.icon,Le=De&&(Fe?.kind===`resume`||Fe?.kind===`invoke`)&&(Fe.kind===`invoke`&&!Fe.sendResultMessage||h===`ready`&&we),Re=Te&&!j&&!t,ze=oe===`slash`?O.slice(1).toLowerCase():``,Be=oe===null?[]:WD(Te?ke.filter(e=>!e.pluginId&&e.name===`file`):ke,ze,oe===`slash`);(0,P.useEffect)(()=>{M(null)},[n?.sessionId,Te]),(0,P.useEffect)(()=>()=>{for(let e of Object.values(ie.current))for(let t of e.attachments)he.current.add(t.key),t.receipt&&t.discard(t.receipt.id).catch(()=>{});for(let e of N.current.values())e.abort();N.current.clear()},[]),(0,P.useEffect)(()=>{if(oe===null)return;let e=e=>{e.target instanceof Node&&!_e.current?.contains(e.target)&&M(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[oe]);let Ve=async e=>{if(Ee&&(De||!e.pluginId&&e.name===`file`)){if(oe===`slash`&&[`file`,`model`,`compact`,`new`].includes(e.name)&&ne(``),M(null),!e.pluginId&&e.name===`file`)me.current?.click();else if(e.pluginId&&e.action&&e.menuOnly){ae(!0);try{await S(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`?d():f())}catch{}finally{ae(!1)}}else ne(`/${BD(e.input?.token,C)??e.name} `),ve.current?.focus()}},He=(0,P.useCallback)((e,t)=>{let n=new AbortController;N.current.set(e,n),o(t,n.signal).then(t=>{he.current.has(e)?s(t.id).catch(()=>{}):A(n=>n.map(n=>n.key===e?{...n,status:`ready`,receipt:t,error:void 0}:n))}).catch(t=>{if(he.current.has(e))return;let n=t instanceof Error?t.message:r(`上传失败`,`Upload failed`);re(n),A(t=>t.map(t=>t.key===e?{...t,status:`error`,error:n}:t))}).finally(()=>{N.current.get(e)===n&&N.current.delete(e)})},[o,s,w]),Ue=(0,P.useRef)(w);(0,P.useEffect)(()=>{let e=Ue.current;if(e===w)return;Ue.current=w;let t=ie.current[e];for(let e of t?.attachments??[])he.current.add(e.key),N.current.get(e.key)?.abort();let n=ie.current[w],r=(n?.attachments??[]).map(e=>({key:ge(),file:e.file,discard:s,status:`uploading`}));E(i=>({...i,...t?{[e]:{...t,attachments:t.attachments.map(e=>({...e,receipt:void 0,status:`error`}))}}:{},...n?{[w]:{...n,attachments:r,error:``}}:{}})),r.forEach(e=>He(e.key,e.file))},[w]);let We=e=>{he.current.add(e.key),N.current.get(e.key)?.abort(),e.receipt&&e.discard(e.receipt.id).catch(()=>{}),e.status===`error`&&!k.some(t=>t.key!==e.key&&t.status===`error`)&&re(``),A(t=>t.filter(t=>t.key!==e.key))},Ge=(0,P.useCallback)(e=>{if(!Ee||e.length===0)return;let t=Math.max(0,20-k.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 i=n.map(e=>({key:ge(),file:e,discard:s,status:`uploading`}));A(e=>[...e,...i]),i.forEach(e=>He(e.key,e.file))},[k.length,Ee,He,s]);(0,P.useEffect)(()=>{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(),Ge(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,Ge]);let Ke=async(e=Te?`followUp`:void 0)=>{if(!Pe||be.current)return;be.current=!0,ae(!0);let t=O.trim(),n=k;Oe||(ne(``),A([]));try{if(Oe)t===`/model`?ue(e=>e+1):await(t===`/compact`?d():f()),ne(``);else if(je?.pluginId&&je.action&&Ae){re(``);let e=await S(je.pluginId,je.action,{args:Ae.text.split(/\s+/).filter(Boolean),text:Ae.text,attachments:n.map(e=>e.receipt.id)});typeof e?.message==`string`&&e.message?await a(e.message,n.map(e=>e.receipt.id),n.map(e=>e.file)):n.length&&(A(n),re(r(`指令未发送附件,文件仍保留在输入框`,`The command did not send the files; they remain in the composer`))),ne(``)}else await a(t,n.map(e=>e.receipt.id),n.map(e=>e.file),e)}catch{Oe||(ne(t),A(n))}finally{be.current=!1,ae(!1)}},qe=async()=>{if(Re&&!be.current){be.current=!0,ae(!0);try{await c()}catch{}finally{be.current=!1,ae(!1)}}},Je=async()=>{if(Le&&Fe&&!be.current){be.current=!0,ae(!0),re(``);try{await KD(Fe,S,e=>a(e,[],[]),c,()=>ye.current,u)}catch(e){Fe.kind!==`resume`&&ye.current===Fe.sessionId&&re(e instanceof Error?e.message:String(e))}finally{be.current=!1,ae(!1)}}};return(0,F.jsxs)(`div`,{hidden:t,className:`${en.root} ${e?en.hero:``} ${t?en.suspended:``}`,children:[de&&(0,F.jsx)($D,{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,F.jsx)(_O,{session:n,onUpdate:y,connected:Se},n?.sessionId),(0,F.jsxs)(`form`,{ref:_e,className:en.card,"data-composer-card":!0,onSubmit:e=>{e.preventDefault(),Ke()},children:[oe!==null&&(0,F.jsx)(ZD,{commands:Be,active:se,grouped:!ze,onHover:ce,onPick:e=>{Ve(e)}}),(0,F.jsx)(`input`,{ref:me,className:`pi-file-input`,type:`file`,multiple:!0,tabIndex:-1,"aria-label":r(`选择要上传的文件`,`Choose files to upload`),onChange:e=>{Ge([...e.target.files??[]]),e.target.value=``}}),k.length>0&&(0,F.jsx)(`div`,{className:`pi-attachment-rail`,role:`group`,"aria-label":r(`待发送附件`,`Pending attachments`),children:k.map(e=>(0,F.jsx)(Rp,{file:e.file,status:e.status,error:e.error,onRemove:()=>We(e),onRetry:()=>{re(``),A(t=>t.map(t=>t.key===e.key?{...t,status:`uploading`,error:void 0}:t)),He(e.key,e.file)}},e.key))}),(0,F.jsx)(zD,{ref:ve,value:O,claimToken:Me,hint:Ne,editable:Se&&!j&&!t,placeholder:Ce?r(`先连接模型,再开始对话`,`Connect a model to start chatting`):Se&&h===`ready`&&!we?r(`先选择模型,再开始对话`,`Choose a model to start chatting`):Se?n&&x.map(e=>e.definition.composerPlaceholder?.(n,C)).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&&Be[se]?`pi-command-${se}`:void 0,onChange:e=>{ne(e),De&&/^\/[^\s]*$/.test(e)?(M(`slash`),ce(0)):oe===`slash`&&M(null)},onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),Ge(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(oe!==null){if(e.key===`Escape`){e.preventDefault(),M(null);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),ce(t=>(t+(e.key===`ArrowDown`?1:-1)+Be.length)%Math.max(Be.length,1));return}if((e.key===`Enter`||e.key===`Tab`)&&Be[se]){e.preventDefault(),Ve(Be[se]);return}}e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),Ke(Te&&(e.ctrlKey||e.metaKey)?`steer`:Te?`followUp`:void 0))}}}),(0,F.jsxs)(`div`,{className:en.row,children:[(0,F.jsxs)(`div`,{className:en.tools,children:[(0,F.jsx)(`button`,{className:en.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:()=>{M(oe===null?`button`:null),ce(0),ve.current?.focus()},children:(0,F.jsx)(ot,{size:16})}),b(`composer.controls`)]}),(0,F.jsxs)(`div`,{className:en.trailing,children:[Ce?(0,F.jsx)(`button`,{className:`pi-model-setup-trigger`,type:`button`,onClick:g,children:r(`配置模型`,`Set up a model`)}):(0,F.jsx)(jp,{openSignal:le,current:n?.model??null,models:m,disabled:!Se||!n?.idle,onSelect:_,thinkingLevel:n?.thinkingLevel??null,thinkingLevels:n?.thinkingLevels??[],onSelectThinkingLevel:v}),Te?(0,F.jsx)(yO,{hasDraft:O.trim().length>0||k.length>0,canSend:Pe,canStop:Re,pauseLabel:Fe?.label??r(`暂停执行`,`Pause`),pauseTitle:Fe?.title,pauseIcon:Ie?(0,F.jsx)(Ie,{size:16}):void 0,onStop:()=>{qe()}}):Fe?.kind===`invoke`||Fe?.kind===`resume`?(0,F.jsx)(`button`,{className:en.primary,type:`button`,"aria-label":Fe.label,title:Fe.title,disabled:!Le,onClick:()=>{Je()},children:Ie?(0,F.jsx)(Ie,{size:16}):(0,F.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M5 2.5 13 8l-8 5.5z`,fill:`currentColor`})})}):(0,F.jsx)(`button`,{className:en.primary,type:`submit`,"aria-label":r(`发送消息`,`Send message`),disabled:!Pe,children:(0,F.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,F.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`})})})]})]}),Te&&O.trimStart().startsWith(`/`)&&(0,F.jsx)(`div`,{className:`pi-prompt-hint`,children:r(`运行中不执行斜杠指令,请等待当前回复结束`,`Wait for the current reply before running slash commands`)})]}),ee&&(0,F.jsx)(`div`,{className:`pi-error`,role:`alert`,children:ee})]})}function wO({rightbarControl:e,composerInteraction:t,session:n,streaming:i,connection:a,error:o,onDismissError:s,onSend:c,onLoadImage:l,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,onUpdateQueuedPrompt:S,renderPluginSlot:C,renderToolView:w,plugins:T,onPluginAction:E}){let[D,O]=(0,P.useState)(`chat`),[k,ee]=(0,P.useState)(null),[te,ne]=(0,P.useState)(null),A=te&&n?.sessionId===te.sessionId&&n.messages.some(e=>e.role===`user`&&!te.knownIds.has(e.id)&&nO(e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
|
|
61
|
-
`)).text===te.text);(0,P.useEffect)(()=>{te&&(A||n&&n.sessionId!==te.sessionId)&&ne(null)},[te,A,n?.sessionId]);let re=te&&!A&&n?.sessionId===te.sessionId?{id:te.id,role:`user`,timestamp:te.timestamp,blocks:[{kind:`text`,text:te.text},...te.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:te.files}:null,ie=pf(n,i,a,re!==null),j=mf(ff(n,i,a,re!==null),n?.sessionId),ae=T.flatMap(e=>e.definition.workbench?.toolViews?.flatMap(e=>e.tools)??[]),oe=cp(n?.sessionId,[...n?.messages??[],...re?[re]:[],...i?[i]:[]],ae),M=n===null||oe.messages.length===0&&ie===null,se=async(e,t,r,i)=>{if(!n)return;if(i){await c(e,t,i);return}let a=`pending-${ge()}`;ne({id:a,sessionId:n.sessionId,text:e,files:r,knownIds:new Set(n.messages.map(e=>e.id)),timestamp:new Date().toISOString()});try{await c(e,t)}catch(e){throw ne(e=>e?.id===a?null:e),e}},ce=(0,P.useRef)(null),{scroll:le,content:ue,composer:de,onScroll:fe,onWheel:pe,showLatest:me,returnToLatest:N}=bO(n?.sessionId,!M&&D===`chat`,re?.id),[he,_e]=(0,P.useState)(0);(0,P.useLayoutEffect)(()=>{let e=ce.current;if(!e)return;let t=()=>_e(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let ve=n?.cwd.split(/[\\/]/).filter(Boolean).at(-1)||r(`Pi 工作区`,`Pi workspace`),ye=oe.messages,be=fp(ye),xe=lp(ye);return(0,F.jsxs)(`div`,{ref:ce,className:$t.root,"data-phase":M?`hero`:`active`,style:{"--piw-conversation-column-width":`${he}px`},children:[M&&(0,F.jsx)(`div`,{className:$t.heroTools,children:e}),n&&!M&&(0,F.jsxs)(`header`,{className:$t.header,children:[(0,F.jsxs)(`div`,{className:$t.titleRow,children:[(0,F.jsx)(`div`,{className:$t.titleCluster,children:(0,F.jsx)(`div`,{className:$t.crumbs,children:(0,F.jsx)(`span`,{className:`${$t.crumb} ${$t.crumbCurrent}`,children:n.name||r(`新会话`,`New chat`)})})}),(0,F.jsxs)(`div`,{className:$t.headerActions,children:[e,(0,F.jsx)($e,{state:a===`connected`?n.idle?`done`:`ongoing`:`error`}),(0,F.jsx)(`span`,{className:`pi-header-state`,children:a===`connected`?n.idle?r(`已连接`,`Connected`):r(`运行中`,`Running`):r(`已断开`,`Disconnected`)})]})]}),(0,F.jsxs)(`div`,{className:$t.tabs,role:`tablist`,"aria-label":r(`会话视图`,`Session views`),children:[(0,F.jsx)(`button`,{className:`${$t.tab} ${D===`chat`?$t.tabActive:``}`,role:`tab`,"aria-selected":D===`chat`,type:`button`,onClick:()=>O(`chat`),children:r(`对话`,`Chat`)}),(0,F.jsx)(`button`,{className:`${$t.tab} ${D===`trajectory`?$t.tabActive:``}`,role:`tab`,"aria-selected":D===`trajectory`,type:`button`,onClick:()=>O(`trajectory`),children:r(`轨迹`,`Trajectory`)})]})]}),(0,F.jsx)(`div`,{className:$t.body,children:(0,F.jsxs)(`div`,{ref:le,className:$t.scrollBody,"data-conversation-scroll":``,onScroll:fe,onWheel:pe,children:[!M&&(0,F.jsx)(`div`,{ref:ue,className:$t.viewArea,children:D===`chat`?(0,F.jsx)(`div`,{className:tn.root,children:(0,F.jsx)(`div`,{className:tn.scroll,children:(0,F.jsx)(`div`,{className:tn.column,children:(0,F.jsxs)(F.Fragment,{children:[xe.map(e=>(0,F.jsx)(SO,{turn:e,results:be,model:n?.model??null,loadImage:l,cwd:n?.cwd,renderPluginSlot:C,renderToolView:w,viewTools:ae,artifactTools:T.flatMap(e=>e.definition.artifactTools??[]),running:e===xe.at(-1)&&!n?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==xe.at(-1),onInspect:e=>{ee(e),O(`trajectory`)}},dp(e,ae))),ie&&(0,F.jsx)(df,{state:ie,elapsedSeconds:j})]})})})}):(0,F.jsx)(Dp,{messages:ye,inspectCallId:k})}),(0,F.jsx)(`div`,{ref:de,className:$t.composerSeat,"data-composer-seat":``,children:(0,F.jsxs)(`div`,{className:`${$t.composerStack} ${M?$t.composerHero:``}`,children:[M&&(0,F.jsx)(Qt,{t:e=>({"hero.headline":r(`有什么可以帮你?`,`How can I help?`),"hero.preview":`Pi`})[e]??e,renderSlot:(e,t,n)=>n?.fallback??null}),M&&(0,F.jsx)(`div`,{className:$t.heroWorkspaceRow,children:(0,F.jsxs)(`span`,{className:Zt.workspace,children:[(0,F.jsx)(xt,{size:16}),(0,F.jsx)(`span`,{className:Zt.workspaceLabel,children:ve})]})}),t,(0,F.jsx)(CO,{suspended:t!=null,hero:M,session:n,connection:a,onSend:se,onUpdateQueuedPrompt:S,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,renderPluginSlot:C,plugins:T,onPluginAction:E}),oe.error&&(0,F.jsxs)(`div`,{className:`pi-error`,role:`alert`,children:[oe.error,(0,F.jsx)(`button`,{onClick:oe.retry,children:`Retry view cleanup`})]}),o&&(0,F.jsxs)(`div`,{className:`pi-error pi-error-dismissible`,role:`alert`,children:[(0,F.jsx)(`span`,{children:o}),(0,F.jsx)(`button`,{type:`button`,className:`pi-error-dismiss`,"aria-label":r(`关闭错误`,`Dismiss error`),onClick:s,children:`×`})]})]})}),me&&(0,F.jsx)(`div`,{className:tn.toBottomSlot,children:(0,F.jsx)(`button`,{className:tn.toBottom,type:`button`,"aria-label":r(`回到最新`,`Back to latest`),title:r(`回到最新并继续跟随`,`Back to latest and resume following`),onClick:N,children:(0,F.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M8 2v12m-5-5 5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})})]})})]})}var TO={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 EO({variant:e=`ghost`,size:t=`md`,icon:r,className:i,children:a,...o}){return(0,F.jsxs)(`button`,{type:`button`,className:n(TO.button,TO[e],TO[t],i),...o,children:[r!=null&&(0,F.jsx)(`span`,{className:TO.icon,children:r}),a]})}var DO={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 OO({open:e,onClose:t,title:r,closeLabel:i,description:a,children:o,footer:s,className:c,contentClassName:l,headless:u=!1}){let d=(0,P.useRef)(null);return ze(d,e,t),e?(0,jt.createPortal)((0,F.jsx)(Fe.Provider,{value:d,children:(0,F.jsxs)(`div`,{className:DO.root,role:`presentation`,children:[(0,F.jsx)(`div`,{className:DO.mask,"aria-hidden":`true`,onClick:t}),(0,F.jsx)(`div`,{ref:d,tabIndex:-1,className:n(DO.dialog,c),role:`dialog`,"aria-modal":`true`,"aria-label":r,children:u?o:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:n(DO.content,l),children:[(0,F.jsxs)(`div`,{className:DO.header,children:[(0,F.jsx)(`h2`,{className:DO.title,children:r}),(0,F.jsx)(`button`,{type:`button`,className:DO.close,"aria-label":i,onClick:t,children:(0,F.jsx)(ut,{size:14})})]}),a!==void 0&&a!==``&&(0,F.jsx)(`p`,{className:DO.description,children:a}),o!==void 0&&(0,F.jsx)(`div`,{className:DO.body,children:o})]}),s!==void 0&&(0,F.jsx)(`div`,{className:DO.footer,children:s})]})})]})}),document.body):null}var kO={group:`_group_7dgiw_4`,workspaceLine:`_workspaceLine_7dgiw_5`,workspaceButton:`_workspaceButton_7dgiw_7`,workspaceTitle:`_workspaceTitle_7dgiw_8`,folder:`_folder_7dgiw_9`,folderActive:`_folderActive_7dgiw_10`,unavailable:`_unavailable_7dgiw_11`,chevron:`_chevron_7dgiw_12`,chevronOpen:`_chevronOpen_7dgiw_13`,rowActions:`_rowActions_7dgiw_16`,rowAction:`_rowAction_7dgiw_16`,sessionButton:`_sessionButton_7dgiw_23`,sessionLine:`_sessionLine_7dgiw_24`,sessionTime:`_sessionTime_7dgiw_27`,untitled:`_untitled_7dgiw_31`,renameInput:`_renameInput_7dgiw_32`,error:`_error_7dgiw_38`,menu:`_menu_7dgiw_39`,menuItem:`_menuItem_7dgiw_40`,menuItemNeutral:`_menuItemNeutral_7dgiw_42`,menuHint:`_menuHint_7dgiw_44`};function AO({title:e,active:t,disabled:n,open:i,onOpenChange:a,onRemove:o}){return(0,F.jsx)(MO,{label:r(`${e} 的工作区操作`,`Workspace actions for ${e}`),title:r(`工作区操作`,`Workspace actions`),disabled:n,open:i,onOpenChange:a,items:[{label:r(`从列表移除工作区`,`Remove workspace from list`),icon:(0,F.jsx)(ht,{}),destructive:!0,disabled:t,onSelect:o}],hint:t?r(`请先切换到其他工作区再移除`,`Switch to another workspace before removing`):r(`不删除目录、文件或会话历史`,`Keeps directories, files and session history`)})}function jO({title:e,disabled:t,open:n,onOpenChange:i,onRename:a,onDelete:o}){return(0,F.jsx)(MO,{label:r(`${e} 的会话操作`,`Chat actions for ${e}`),title:r(`会话操作`,`Chat actions`),disabled:t,open:n,onOpenChange:i,items:[{label:r(`重命名`,`Rename`),icon:(0,F.jsx)(pt,{}),onSelect:a},{label:r(`删除会话`,`Delete chat`),icon:(0,F.jsx)(ht,{}),destructive:!0,onSelect:o}]})}function MO({label:e,title:t,disabled:n,open:r,onOpenChange:i,items:a,hint:o}){let s=(0,P.useRef)(null),c=(0,P.useRef)(null),[l,u]=(0,P.useState)({top:0,left:0}),d=(0,P.useRef)({onOpenChange:i});d.current={onOpenChange:i};let f=(e=!0)=>{i(!1),e&&s.current?.focus()};return(0,P.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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{ref:s,type:`button`,className:kO.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,F.jsx)(at,{})}),r&&(0,jt.createPortal)((0,F.jsxs)(kp,{ref:c,role:`menu`,tabIndex:-1,"aria-label":e,className:kO.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,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${kO.menuItem} ${e.destructive?``:kO.menuItemNeutral}`,disabled:n||e.disabled,onClick:()=>{f(),e.onSelect()},children:[e.icon,e.label]},e.label)),o&&(0,F.jsx)(`p`,{className:kO.menuHint,children:o})]}),document.body)]})}function NO(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 PO={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 FO(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 IO=300,LO=200,RO=250;function zO(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 BO(e){return e.home.includes(`\\`)?`\\`:`/`}function VO(e){let t=BO(e);return e.path.endsWith(t)?e.path:`${e.path}${t}`}function HO(e,t){let n=BO(e)===`\\`?Math.max(t.lastIndexOf(`\\`),t.lastIndexOf(`/`)):t.lastIndexOf(`/`);return n===-1?null:t.slice(0,n+1)}function UO(e,t,n){let r=HO(e,t);return r===null?{directory:null,tail:null}:{directory:r,tail:r===VO(e)||n!==null&&n.directory===r&&n.landed===e.path?t.slice(r.length):null}}function WO(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 GO({entries:e,selectedPath:t,busy:r,onPick:i,showHidden:a,filterPrefix:o,pathEditing:s}){let c=WO(e,t,a,o);return(0,F.jsx)(`div`,{className:PO.column,role:`list`,children:c.map(e=>{let a=e.path===t;return(0,F.jsx)(`span`,{role:`listitem`,className:PO.rowSeat,children:(0,F.jsxs)(`button`,{type:`button`,"aria-current":a||void 0,className:n(PO.row,a&&PO.rowSelected),disabled:r,onMouseDown:s?e=>{e.preventDefault()}:void 0,onClick:()=>{i(e)},children:[a?(0,F.jsx)(xt,{size:16,className:PO.rowIconSelected}):(0,F.jsx)(St,{size:16,className:PO.rowIcon}),(0,F.jsx)(`span`,{className:PO.rowName,children:e.name}),(0,F.jsx)(lt,{size:12,className:PO.rowChevron})]})},e.path)})})}function KO({open:e,listDirectory:t,createDirectory:r,onOpen:i,onClose:a,busy:o,t:s}){let[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(null),[f,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(0),[b,x]=(0,P.useState)(null),[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(!1),[E,D]=(0,P.useState)(null),[O,k]=(0,P.useState)(!1),[ee,te]=(0,P.useState)(null),ne=(0,P.useRef)(0),A=(0,P.useRef)(null),re=(0,P.useRef)(0),ie=(0,P.useRef)(null),j=(0,P.useRef)(!1);(0,P.useEffect)(()=>()=>{ne.current+=1,re.current+=1,A.current?.abort()},[]);let ae={onCompositionStart:()=>{j.current=!0},onCompositionEnd:()=>{j.current=!1}},oe=(0,P.useCallback)(()=>(A.current?.abort(),A.current=null,++ne.current),[]),M=(0,P.useCallback)(()=>{_(!1),y(e=>e+1)},[]),se=(0,P.useCallback)(e=>{let n=oe(),r=new AbortController;return A.current=r,M(),{seq:n,scan:t(e,r.signal)}},[oe,M,t]),ce=(0,P.useCallback)(e=>{let n=new AbortController;return A.current=n,M(),t(e,n.signal)},[M,t]),le=(0,P.useRef)(!1),ue=(0,P.useRef)({parent:null,child:null});(0,P.useEffect)(()=>{ue.current={parent:c,child:f}},[c,f]);let de=(0,P.useRef)(null),fe=(0,P.useRef)(!1),pe=(0,P.useCallback)((e,t)=>{let{seq:n,scan:r}=se(e);h(!0),t.announce&&x(null);let i=()=>{h(!1),t.closeEditor?C(null):(x(null),fe.current=!0)};r.then(r=>{if(n!==ne.current)return;!t.closeEditor&&e!==void 0&&(de.current={directory:e,landed:r.path});let a=!1,o=()=>{a||n!==ne.current||(a=!0,l(r),d(null),p(null),i())};if(zO(r,``).length<2){o();return}let s=r.crumbs.at(-2);s===void 0?o():(ce(s.path).then(e=>{if(n!==ne.current)return;let t=BO(e),s=e=>t===`\\`?e.toLowerCase():e,c=e.entries.find(e=>s(e.path)===s(r.path));c===void 0?o():(a=!0,l(e),d(c),p(r),i())},()=>{o()}),t.closeEditor&&window.setTimeout(o,LO))},e=>{n===ne.current&&(h(!1),t.announce&&x(FO(e)))})},[se,ce]),me=(0,P.useCallback)(e=>{pe(e,{closeEditor:!0,announce:!0})},[pe]),N=(0,P.useRef)(!1),he=(0,P.useRef)(!1),ge=(0,P.useRef)(null),_e=(0,P.useRef)(null),ve=(0,P.useCallback)(e=>{let{seq:t,scan:n}=se(e.path);S!==null&&(N.current=!0),C(null),d(e),p(null),h(!0),x(null),n.then(e=>{t===ne.current&&(p(e),h(!1))},e=>{t===ne.current&&(h(!1),x(FO(e)),d(null),he.current=!0)})},[se,S]),ye=(0,P.useCallback)(e=>{pe(e,{closeEditor:!1,announce:!1})},[pe]),be=(0,P.useCallback)(()=>{oe(),h(!1),C(null),x(null),f===null&&d(null),c===null&&me()},[oe,f,c,me]),xe=(0,P.useCallback)(e=>{f!==null&&(l(f),ve(e))},[f,ve]);(0,P.useEffect)(()=>{re.current+=1,e?(l(null),d(null),p(null),k(!1),T(!1),me()):(oe(),h(!1),x(null),C(null),D(null),te(null),N.current=!1,he.current=!1)},[e,me,oe]);let Se=u?.path??c?.path??null,Ce=u?.name??(c===null?``:zO(c,s(`browser.home`)).at(-1)?.name??c.path),we=()=>{if(Se===null||E===null||O)return;let e=E;if(e.trim()===``)return;k(!0),te(null);let t=re.current;r(Se,e).then(n=>{if(t!==re.current)return;k(!1),D(null);let{seq:r,scan:i}=se(Se);h(!0),x(null),i.then(t=>{r===ne.current&&(l(t),h(!1),ve({name:e,path:n,hidden:!1}))},e=>{r===ne.current&&(h(!1),x(FO(e)))})},e=>{t===re.current&&(k(!1),te(FO(e)))})};(0,P.useEffect)(()=>{if(!m){_(!1);return}let e=window.setTimeout(()=>{_(!0)},IO);return()=>{window.clearTimeout(e)}},[m,v]),(0,P.useEffect)(()=>{if(S===null)return;let e=window.setTimeout(()=>{if(le.current)return;let e=ue.current.child??ue.current.parent;if(e===null)return;let{directory:t,tail:n}=UO(e,S,de.current);t!==null&&n===null&&ye(t)},RO);return()=>{window.clearTimeout(e)}},[S,ye]);let Te=f??c,Ee=Te===null||S===null?null:UO(Te,S,de.current).tail,De=Te===null?[]:zO(Te,s(`browser.home`)),Oe=De.at(-1)?.path;(0,P.useEffect)(()=>{let e=ie.current;e!==null&&(e.scrollLeft=e.scrollWidth)},[Oe]);let ke=(0,P.useRef)(null),Ae=f?.path;if((0,P.useEffect)(()=>{let e=ke.current;e!==null&&Ae!==void 0&&(e.scrollLeft=e.scrollWidth)},[Ae]),(0,P.useEffect)(()=>{if(fe.current&&(fe.current=!1,document.activeElement===document.body&&ge.current?.focus()),S===null){if(N.current){N.current=!1,he.current=!1;let e=ke.current;if(e===null)return;let t=e.querySelector(`button[aria-current="true"]`);if(t===null)return;t.focus()}else if(he.current){if(he.current=!1,document.activeElement!==document.body)return;let e=_e.current;if(e===null)return;e.focus()}}}),!e)return null;let je=u!==null,Me=o||E!==null,Ne=S!==null;return(0,F.jsxs)(OO,{open:e,onClose:()=>{E===null&&!o&&a()},title:s(`browser.title`),className:n(PO.dialog),headless:!0,children:[(0,F.jsxs)(`div`,{className:PO.editorScope,onKeyDown:e=>{e.key===`Escape`&&S!==null&&(e.stopPropagation(),he.current=document.activeElement===ge.current,be())},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)||(he.current=!1,be()))},children:[(0,F.jsxs)(`div`,{className:PO.header,children:[(0,F.jsx)(`h2`,{className:PO.title,children:s(`browser.title`)}),(0,F.jsx)(`div`,{className:PO.crumbBar,children:S===null?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:PO.crumbTrail,role:`navigation`,ref:ie,children:De.map((e,t)=>(0,F.jsxs)(`span`,{className:PO.crumbSeat,children:[t>0&&(0,F.jsx)(lt,{size:12,className:PO.crumbChevron}),(0,F.jsx)(`button`,{type:`button`,className:PO.crumb,disabled:Me,onClick:()=>{me(e.path)},children:e.name})]},e.path))}),(0,F.jsx)(`button`,{type:`button`,className:PO.crumbEditZone,"aria-label":s(`browser.editPath`),title:s(`browser.editPath`),disabled:Me,ref:_e,onClick:()=>{if(oe(),h(!1),le.current=!1,c===null){C(``);return}let e=u?.path??c.path,t=BO(c);C(e.endsWith(t)?e:`${e}${t}`)},children:(0,F.jsx)(pt,{size:14,className:PO.crumbEditGlyph})})]}):(0,F.jsx)(`input`,{className:PO.pathInput,value:S,"aria-label":s(`browser.editPath`),autoFocus:!0,ref:ge,disabled:Me,onChange:e=>{oe(),h(!1),le.current=!1,C(e.target.value)},...ae,onKeyDown:e=>{e.key===`Enter`&&!j.current&&(e.preventDefault(),S.trim()!==``&&(he.current=!0,le.current=!0,me(S)))}})})]}),(0,F.jsxs)(`div`,{className:PO.content,children:[(0,F.jsxs)(`div`,{className:PO.millerRow,ref:ke,children:[c!==null&&(0,F.jsx)(GO,{entries:c.entries,selectedPath:u?.path??null,busy:Me,onPick:ve,showHidden:w,filterPrefix:f===null?Ee:null,pathEditing:Ne}),je&&(0,F.jsx)(`span`,{className:PO.divider}),je&&f!==null&&(0,F.jsx)(GO,{entries:f.entries,selectedPath:null,busy:Me,onPick:xe,showHidden:w,filterPrefix:Ee,pathEditing:Ne})]}),m&&g&&(0,F.jsx)(`div`,{className:n(PO.status,PO.loadingFloat),role:`status`,children:s(`browser.loading`)}),(c?.truncated===!0||f?.truncated===!0)&&(0,F.jsx)(`div`,{className:PO.status,role:`status`,children:s(`browser.truncated`)}),b!==null&&(0,F.jsx)(`div`,{className:PO.error,role:`alert`,children:b})]}),(0,F.jsxs)(`div`,{className:PO.footerBar,children:[(0,F.jsx)(EO,{variant:`outline`,icon:(0,F.jsx)(ot,{size:14}),disabled:c===null||m||Me||Ne,onClick:()=>{D(``),te(null)},children:s(`browser.newFolder`)}),(0,F.jsxs)(`button`,{type:`button`,className:n(PO.showHiddenToggle,w&&PO.showHiddenToggleActive),"aria-pressed":w,disabled:Me,onMouseDown:Ne?e=>{e.preventDefault()}:void 0,onClick:()=>{T(e=>!e)},children:[s(`browser.showHidden`),w&&(0,F.jsx)(st,{size:14})]}),(0,F.jsx)(`span`,{className:PO.footerGap}),(0,F.jsx)(EO,{variant:`outline`,className:n(PO.footerAction),disabled:Me,onClick:a,children:s(`browser.cancel`)}),(0,F.jsx)(EO,{variant:`primary`,className:n(PO.footerAction),disabled:Se===null||m||Me||Ne,onClick:()=>{Se!==null&&i(Se)},children:s(`browser.open`)})]})]}),(0,F.jsx)(OO,{open:E!==null,onClose:()=>{O||D(null)},title:s(`browser.newFolder`),className:n(PO.createDialog),headless:!0,children:(0,F.jsxs)(`div`,{className:PO.createBody,children:[(0,F.jsx)(`h3`,{className:PO.createTitle,children:s(`browser.newFolder`)}),(0,F.jsx)(`p`,{className:PO.createIn,children:s(`browser.createIn`,{name:Ce})}),(0,F.jsx)(`input`,{className:PO.createInput,value:E??``,"aria-label":s(`browser.folderName`),placeholder:s(`browser.untitledFolder`),autoFocus:!0,disabled:O,onChange:e=>{D(e.target.value)},...ae,onKeyDown:e=>{e.key===`Enter`&&!j.current&&(e.preventDefault(),we()),e.key===`Escape`&&(e.stopPropagation(),O||D(null))}}),ee!==null&&(0,F.jsx)(`div`,{className:PO.error,role:`alert`,children:ee}),(0,F.jsxs)(`div`,{className:PO.createActions,children:[(0,F.jsx)(EO,{variant:`outline`,disabled:O,onClick:()=>{D(null)},children:s(`browser.cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:O||E===null||E.trim()===``,onClick:we,children:s(`browser.create`)})]})]})})]})}var qO={root:`_root_nvze1_1`,rail:`_rail_nvze1_13`,iconButton:`_iconButton_nvze1_17`,searchButton:`_searchButton_nvze1_33`,clearButton:`_clearButton_nvze1_34`,sectionHeader:`_sectionHeader_nvze1_45`,sectionLabel:`_sectionLabel_nvze1_65`,sectionLabelHidden:`_sectionLabelHidden_nvze1_82`,searchSlot:`_searchSlot_nvze1_91`,searchSlotExpanded:`_searchSlotExpanded_nvze1_105`,headerActions:`_headerActions_nvze1_110`,headerActionsHidden:`_headerActionsHidden_nvze1_126`,search:`_search_nvze1_33`,searchExpanded:`_searchExpanded_nvze1_160`,searchInput:`_searchInput_nvze1_199`,listArea:`_listArea_nvze1_285`,treeBody:`_treeBody_nvze1_305`,fade:`_fade_nvze1_315`,wide:`_wide_nvze1_326`,"wide-in":`_wide-in_nvze1_1`,list:`_list_nvze1_285`,flatList:`_flatList_nvze1_356`,searchTree:`_searchTree_nvze1_357`,groupSection:`_groupSection_nvze1_358`,searchStatus:`_searchStatus_nvze1_362`,searchWarning:`_searchWarning_nvze1_363`,listTopDropIndicator:`_listTopDropIndicator_nvze1_383`,workspaceDropBefore:`_workspaceDropBefore_nvze1_384`,workspaceDropAfter:`_workspaceDropAfter_nvze1_385`,listTopDropActive:`_listTopDropActive_nvze1_419`,sessionOverflowButton:`_sessionOverflowButton_nvze1_431`,empty:`_empty_nvze1_453`,renameInput:`_renameInput_nvze1_460`,renameError:`_renameError_nvze1_479`,deleteAction:`_deleteAction_nvze1_486`,deleteStatus:`_deleteStatus_nvze1_490`},JO={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`},YO=(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 XO({wide:e,navigationBusy:t=!1,connected:n=!0,expandSidebar:i,session:a,workspaces:o,onAdd:s,directoryPickerKind:c,pickDirectory:u,listDirectory:d,createDirectory:f,onRemove:p,onSelectSession:m,onNewSession:h,onRenameSession:g,onDeleteSession:_}){let v=l(),[y,b]=(0,P.useState)(Date.now),[x,S]=(0,P.useState)(null),[C,w]=(0,P.useState)(null),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(``),[k,ee]=(0,P.useState)(null),te=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(!T)return;let e=requestAnimationFrame(()=>{te.current?.focus(),te.current?.select()});return()=>cancelAnimationFrame(e)},[T]),(0,P.useEffect)(()=>{if(!e){S(null),w(null);return}b(Date.now());let t=window.setInterval(()=>b(Date.now()),6e4);return()=>window.clearInterval(t)},[e]);let[ne,A]=(0,P.useState)(!1),[re,ie]=(0,P.useState)(!1),j=re||t,ae=j||!n,oe=(0,P.useId)(),M=(0,P.useRef)(null),[se,ce]=(0,P.useState)(null),[le,ue]=(0,P.useState)(``),[de,fe]=(0,P.useState)(``),[pe,me]=(0,P.useState)(!1),[N,he]=(0,P.useState)(``);(0,P.useEffect)(()=>{he(``)},[a?.sessionId]);let[ge,_e]=(0,P.useState)(new Set);(0,P.useEffect)(()=>{o.activeId&&_e(e=>e.has(o.activeId)?e:new Set([...e,o.activeId]))},[o.activeId,a?.sessionId]),(0,P.useEffect)(()=>{M.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView({block:`nearest`})},[e,a?.sessionId,ge]);let ve=(0,P.useRef)(null),ye=(0,P.useRef)(null),be=N.trim().toLocaleLowerCase(),xe=()=>{he(``),me(!1),ve.current?.focus()},Se=o.items.filter(e=>!be||e.title.toLocaleLowerCase().includes(be)||e.path.toLocaleLowerCase().includes(be)||o.sessions.some(t=>t.workspaceId===e.id&&t.name.toLocaleLowerCase().includes(be))),Ce=async e=>{if(!ae){ie(!0),ue(``);try{await e()}catch(e){ue(e instanceof Error?e.message:r(`操作失败`,`Operation failed`))}finally{ie(!1)}}},we=async e=>{ie(!0);try{await s(e,!1),A(!1)}catch(e){A(!1),fe(e instanceof Error?e.message:String(e))}finally{ie(!1)}},Te=async()=>{if(c!==null){if(e||i(),ue(``),c===`browse`)A(!0);else{ie(!0);try{let e=await u();e!==null&&await we(e)}catch(e){fe(e instanceof Error?e.message:String(e))}finally{ie(!1)}}}};return(0,F.jsxs)(`div`,{ref:M,"aria-busy":j,className:`${qO.root} ${e?``:qO.rail}`,children:[(0,F.jsxs)(`div`,{className:qO.sectionHeader,children:[e&&(0,F.jsx)(`span`,{className:`${qO.sectionLabel} ${qO.wide} ${pe?qO.sectionLabelHidden:``}`,children:r(`工作区`,`Workspaces`)}),e&&(0,F.jsx)(`div`,{className:`${qO.searchSlot} ${pe?qO.searchSlotExpanded:``}`,children:(0,F.jsxs)(`div`,{className:`${qO.search} ${pe?qO.searchExpanded:``}`,onClick:()=>{me(!0),ye.current?.focus()},children:[(0,F.jsx)(`button`,{ref:ve,type:`button`,className:qO.searchButton,"aria-label":r(`搜索工作区和会话`,`Search workspaces and sessions`),"aria-expanded":pe,onClick:()=>{me(!0),ye.current?.focus()},children:(0,F.jsx)(tt,{size:pe?11:14})}),(0,F.jsx)(`input`,{ref:ye,className:qO.searchInput,type:`search`,"aria-label":r(`按名称或工作区路径搜索`,`Search by name or workspace path`),placeholder:r(`按名称或工作区路径搜索`,`Search by name or workspace path`),maxLength:120,value:N,tabIndex:pe?0:-1,onChange:e=>he(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),xe())}}),pe&&(0,F.jsx)(`button`,{type:`button`,className:qO.clearButton,"aria-label":r(`关闭搜索`,`Close search`),onClick:e=>{e.stopPropagation(),xe()},children:(0,F.jsx)(dt,{})})]})}),(0,F.jsx)(`div`,{className:`${qO.headerActions} ${e&&pe?qO.headerActionsHidden:``}`,children:(0,F.jsx)(`button`,{type:`button`,className:qO.iconButton,"aria-label":r(`添加工作区`,`Add workspace`),title:r(`添加工作区`,`Add workspace`),disabled:ae||c===null,onClick:()=>{Te()},children:(0,F.jsx)(bt,{size:e?16:18})})})]}),e&&(0,F.jsx)(`div`,{className:qO.listArea,children:(0,F.jsx)(`div`,{className:qO.treeBody,children:(0,F.jsxs)(`div`,{className:qO.list,role:`list`,"aria-label":r(`工作区`,`Workspaces`),children:[Se.map(e=>{let t=e.id===o.activeId,n=e.available===!1,i=ge.has(e.id)||!!be;return(0,F.jsxs)(`div`,{className:kO.group,role:`listitem`,children:[(0,F.jsxs)(`div`,{className:kO.workspaceLine,"data-menu-open":x===e.id||void 0,children:[(0,F.jsxs)(`button`,{type:`button`,className:`${JO.projectRow} ${kO.workspaceButton}`,"aria-expanded":i,"aria-controls":`${oe}-${e.id}`,title:e.path,disabled:j,onContextMenu:t=>{ae||(t.preventDefault(),t.stopPropagation(),w(null),S(e.id))},onClick:()=>_e(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[(0,F.jsxs)(`span`,{className:JO.slot,"aria-hidden":`true`,children:[(0,F.jsx)(`span`,{"data-workspace-leading":`folder`,className:`${kO.folder} ${t?kO.folderActive:``}`,children:i?(0,F.jsx)(xt,{size:16}):(0,F.jsx)(St,{size:16})}),(0,F.jsx)(`span`,{"data-workspace-leading":`chevron`,className:`${kO.chevron} ${i?kO.chevronOpen:``}`,children:(0,F.jsx)(ct,{size:14})})]}),(0,F.jsx)(`span`,{className:`${JO.title} ${kO.workspaceTitle}`,children:e.title}),n&&(0,F.jsx)(`span`,{className:kO.unavailable,children:r(`不可用`,`Unavailable`)})]}),(0,F.jsxs)(`span`,{className:kO.rowActions,"data-workspace-actions":!0,children:[(0,F.jsx)(AO,{title:e.title,active:t,disabled:ae,open:x===e.id,onOpenChange:t=>S(t?e.id:null),onRemove:()=>{ue(``),ce({id:e.id,title:e.title})}}),(0,F.jsx)(`button`,{type:`button`,className:kO.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:ae||n,onClick:()=>{Ce(async()=>{await h(e.id),he(``),_e(t=>new Set([...t,e.id]))})},children:(0,F.jsx)(et,{size:16})})]})]}),(0,F.jsxs)(`div`,{id:`${oe}-${e.id}`,role:`group`,"aria-label":e.title,hidden:!i,children:[i&&o.sessions.filter(t=>t.workspaceId===e.id&&(!be||e.title.toLocaleLowerCase().includes(be)||e.path.toLocaleLowerCase().includes(be)||t.name.toLocaleLowerCase().includes(be))).map(i=>{let o=t&&a?.sessionId===i.id,s=a?.sessionId===i.id?!a.idle:i.idle===!1,c=i.name||r(`新会话`,`New chat`),l={workspaceId:e.id,id:i.id,path:i.path,name:i.name,running:s};return(0,F.jsxs)(`div`,{className:kO.sessionLine,"data-menu-open":C===i.id||void 0,children:[(0,F.jsxs)(`button`,{type:`button`,className:`${JO.sessionRow} ${kO.sessionButton} ${o?JO.selected:``}`,title:c,"aria-label":c,"aria-describedby":`${oe}-${i.id}-status`,"aria-current":o?`page`:void 0,disabled:ae||n,onContextMenu:e=>{ae||n||(e.preventDefault(),e.stopPropagation(),S(null),w(i.id))},onClick:()=>{Ce(()=>m(e.id,i.id,i.path))},children:[(0,F.jsx)(`span`,{className:JO.slot,children:s&&(0,F.jsx)($e,{state:`ongoing`})}),(0,F.jsx)(`span`,{className:`${JO.title} ${i.name?``:kO.untitled}`,children:c}),(0,F.jsx)(`time`,{className:kO.sessionTime,dateTime:i.modified,title:i.modified,children:NO(i.modified,y,v)}),(0,F.jsx)(`span`,{id:`${oe}-${i.id}-status`,className:JO.visuallyHidden,children:s?r(`运行中`,`Running`):r(`空闲`,`Idle`)})]}),(0,F.jsx)(`span`,{className:kO.rowActions,children:(0,F.jsx)(jO,{title:c,disabled:ae||n,open:C===i.id,onOpenChange:e=>w(e?i.id:null),onRename:()=>{ue(``),O(i.name),E(l)},onDelete:()=>{ue(``),ee(l)}})})]},i.id)}),i&&!be&&!o.sessions.some(t=>t.workspaceId===e.id)&&(0,F.jsx)(`p`,{className:qO.empty,children:r(`还没有会话,创建新会话开始`,`No sessions yet. Create a session to start.`)})]})]},e.id)}),Se.length===0&&(0,F.jsxs)(`p`,{className:qO.empty,role:`status`,children:[be?r(`没有找到匹配的工作区或会话`,`No matching workspaces or sessions`):r(`添加工作区,开始管理对话`,`Add a workspace to start organizing conversations`),be&&(0,F.jsx)(`button`,{type:`button`,className:qO.sessionOverflowButton,onClick:xe,children:r(`清除搜索`,`Clear search`)})]}),j&&(0,F.jsx)(`p`,{className:qO.searchStatus,role:`status`,children:r(`正在处理…`,`Working…`)}),le&&!ne&&(0,F.jsx)(`p`,{className:kO.error,role:`alert`,children:le})]})})}),(0,F.jsxs)(OO,{open:se!==null,onClose:()=>{j||ce(null)},title:r(`移除工作区?`,`Remove workspace?`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>ce(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ae,onClick:()=>{se&&Ce(async()=>{await p(se.id),ce(null)})},children:r(`从列表移除`,`Remove from list`)})]}),children:[(0,F.jsx)(`p`,{children:se?.title}),(0,F.jsx)(`p`,{children:r(`仅从侧栏移除,不删除目录、文件或会话历史。`,`Only removes it from the sidebar. Directories, files and session history are not deleted.`)}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsxs)(OO,{open:T!==null,onClose:()=>{j||E(null)},title:r(`重命名会话`,`Rename chat`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>E(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,type:`submit`,form:`${oe}-rename`,disabled:ae,children:r(`保存`,`Save`)})]}),children:[(0,F.jsx)(`form`,{id:`${oe}-rename`,onSubmit:e=>{e.preventDefault(),T&&Ce(async()=>{await g(T.workspaceId,T.id,T.path,D),E(null)})},children:(0,F.jsx)(`input`,{className:kO.renameInput,"aria-label":r(`会话名称`,`Chat name`),placeholder:r(`留空则使用第一条消息`,`Leave empty to use the first message`),maxLength:120,ref:te,value:D,onChange:e=>O(e.target.value)})}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsxs)(OO,{open:k!==null,onClose:()=>{j||ee(null)},title:r(`删除会话?`,`Delete chat?`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>ee(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ae||k?.running,onClick:()=>{k&&Ce(async()=>{await _(k.workspaceId,k.id,k.path),ee(null)})},children:r(`删除`,`Delete`)})]}),children:[(0,F.jsx)(`p`,{children:k?.name||r(`新会话`,`New chat`)}),(0,F.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.`)}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsx)(KO,{open:ne,busy:j,listDirectory:d,createDirectory:f,onOpen:e=>{we(e)},onClose:()=>{j||A(!1)},t:YO}),(0,F.jsx)(OO,{open:!!de,onClose:()=>fe(``),title:r(`无法添加工作区`,`Could not add workspace`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,onClick:()=>fe(``),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,onClick:()=>{fe(``),Te()},children:r(`重新选择`,`Choose again`)})]}),children:(0,F.jsx)(`div`,{role:`alert`,children:de})})]})}function ZO(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 QO(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 $O({model:e,position:t,onSave:n,onRemove:i,onCancel:a}){let[o,s]=(0,P.useState)(e.id),[c,l]=(0,P.useState)(e.name??``),[u,d]=(0,P.useState)(QO(e.contextWindow)),[f,p]=(0,P.useState)(QO(e.maxTokens)),[m,h]=(0,P.useState)(e.input?.length?e.input:[`text`]),[g,_]=(0,P.useState)(!e.id),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(!1),[S,C]=(0,P.useState)(``),w=!e.id,T=!w&&(e.source===`custom`||e.overridden),E=async()=>{let e=ZO(u),t=ZO(f);if(!o.trim()||[e,t].some(e=>e!==void 0&&(!Number.isSafeInteger(e)||e<=0)))C(r(`请填写模型 ID,并使用正整数或 K/M 单位填写容量。`,`Enter a model ID and positive token counts, optionally with K/M suffixes.`));else{x(!0),C(``);try{await n({id:o.trim(),...c.trim()?{name:c.trim()}:{},...e===void 0?{}:{contextWindow:e},...t===void 0?{}:{maxTokens:t},input:m})}catch(e){C(e instanceof Error?e.message:r(`保存失败`,`Could not save`))}finally{x(!1)}}},D=async()=>{x(!0),C(``);try{await i()}catch(e){C(e instanceof Error?e.message:r(`操作失败`,`Action failed`)),y(!1)}finally{x(!1)}},O=e=>{h(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length?n:t})};return(0,F.jsxs)(`div`,{className:`pi-model-entry`,children:[(0,F.jsxs)(`div`,{className:`pi-model-row`,children:[(0,F.jsx)(`input`,{"aria-label":`${r(`模型 ID`,`Model ID`)} ${t}`,placeholder:r(`模型 ID`,`Model ID`),value:o,disabled:b||!w&&e.source===`builtin`,onFocus:()=>_(!0),onChange:e=>s(e.target.value)}),(0,F.jsx)(`input`,{"aria-label":`${r(`显示名称`,`Display name`)} ${t}`,placeholder:r(`显示名称`,`Display name`),value:c,disabled:b,onFocus:()=>_(!0),onChange:e=>l(e.target.value)}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`${r(`模型参数`,`Model settings`)} ${t}`,"aria-expanded":g,onClick:()=>_(!g),children:g?`⌄`:`›`})]}),g&&(0,F.jsxs)(`div`,{className:`pi-model-details`,children:[(0,F.jsxs)(`label`,{children:[r(`上下文窗口`,`Context window`),(0,F.jsx)(`input`,{"aria-label":`${r(`上下文窗口`,`Context window`)} ${t}`,inputMode:`decimal`,placeholder:`128K`,value:u,disabled:b,onChange:e=>d(e.target.value)})]}),(0,F.jsxs)(`label`,{children:[r(`最大输出 token 数`,`Max output tokens`),(0,F.jsx)(`input`,{"aria-label":`${r(`最大输出 token 数`,`Max output tokens`)} ${t}`,inputMode:`decimal`,placeholder:`16K`,value:f,disabled:b,onChange:e=>p(e.target.value)})]}),(0,F.jsxs)(`fieldset`,{className:`pi-model-input-types`,children:[(0,F.jsx)(`legend`,{children:r(`输入类型`,`Input types`)}),(0,F.jsxs)(`label`,{children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:m.includes(`text`),disabled:b||m.length===1&&m.includes(`text`),onChange:()=>O(`text`)}),r(`文本`,`Text`)]}),(0,F.jsxs)(`label`,{children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:m.includes(`image`),disabled:b||m.length===1&&m.includes(`image`),onChange:()=>O(`image`)}),r(`图片`,`Image`)]})]}),(0,F.jsxs)(`div`,{className:`pi-model-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>{E()},children:b?r(`保存中…`,`Saving…`):r(`保存模型`,`Save model`)}),w&&a&&(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:a,children:r(`取消`,`Cancel`)}),T&&(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>y(!v),children:e.source===`custom`?r(`移除模型`,`Remove model`):r(`恢复默认`,`Restore default`)})]}),v&&(0,F.jsxs)(`div`,{className:`pi-model-confirm`,children:[(0,F.jsx)(`span`,{children:e.source===`custom`?r(`从配置中移除这个模型?`,`Remove this model from configuration?`):r(`撤销这个模型的自定义参数?`,`Discard this model’s custom settings?`)}),(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>{D()},children:r(`确认`,`Confirm`)}),(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>y(!1),children:r(`取消`,`Cancel`)})]}),S&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:S})]})]})}function ek({providerId:e,getModels:t,updateModel:n}){let[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(!1),f=async()=>{s(``);try{a(await t(e))}catch(e){throw s(e instanceof Error?e.message:r(`无法读取模型目录`,`Could not load model catalog`)),e}};(0,P.useEffect)(()=>{f().catch(()=>{})},[e]);let p=async t=>{await n(e,t),d(!1),await f().catch(()=>{})},m=i?.models.filter(e=>`${e.id} ${e.name??``}`.toLocaleLowerCase().includes(c.toLocaleLowerCase()))??[];return(0,F.jsxs)(`section`,{className:`pi-provider-models`,"aria-label":r(`模型目录`,`Model catalog`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-models-head`,children:[(0,F.jsx)(`strong`,{children:r(`模型目录`,`Model catalog`)}),(0,F.jsxs)(`span`,{children:[i?.models.length??0,` `,r(`个模型`,`models`)]})]}),i?.baseUrl&&(0,F.jsxs)(`p`,{className:`pi-provider-models-endpoint`,title:i.baseUrl,children:[r(`API 地址`,`API URL`),`: `,i.baseUrl]}),o&&(0,F.jsxs)(`p`,{className:`pi-settings-error`,role:`alert`,children:[o,` `,i&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{f().catch(()=>{})},children:r(`重试读取`,`Retry`)})]}),i?(0,F.jsxs)(F.Fragment,{children:[i.models.length>5&&(0,F.jsx)(`input`,{className:`pi-model-search`,type:`search`,"aria-label":r(`搜索模型`,`Search models`),placeholder:r(`搜索模型`,`Search models`),value:c,onChange:e=>l(e.target.value)}),(0,F.jsx)(`div`,{className:`pi-model-list`,children:m.map((e,t)=>(0,F.jsx)($O,{model:e,position:t+1,onSave:t=>p({action:`save`,originalId:e.id,model:t}),onRemove:()=>p({action:`remove`,id:e.id})},`${e.id}:${e.name}:${e.contextWindow}:${e.maxTokens}:${e.overridden}`))}),m.length===0&&!u&&(0,F.jsx)(`p`,{className:`pi-provider-models-empty`,children:r(`没有匹配的模型`,`No matching models`)}),u&&(0,F.jsx)($O,{model:{id:``,source:`custom`,overridden:!1},position:i.models.length+1,onSave:e=>p({action:`save`,model:e}),onRemove:async()=>d(!1),onCancel:()=>d(!1)},`new`),!u&&(0,F.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>d(!0),children:r(`+ 添加模型`,`+ Add model`)})]}):o?(0,F.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>{f().catch(()=>{})},children:r(`重试读取`,`Retry`)}):(0,F.jsx)(`p`,{role:`status`,children:r(`正在读取模型…`,`Loading models…`)})]})}var tk={id:``,name:``,baseUrl:``,api:`openai-completions`,modelId:``};function nk(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:null}catch{return null}}function rk(){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 ik({provider:e,configured:t,busy:n,getProviderModels:i,updateProviderModel:a,onConnect:o}){let[s,c]=(0,P.useState)(``),[l,u]=(0,P.useState)(``),[d,f]=(0,P.useState)(``),[p,m]=(0,P.useState)(!0),[h,g]=(0,P.useState)(!1),[_,v]=(0,P.useState)(``);(0,P.useEffect)(()=>{let t=!0;return m(!0),i(e.id).then(e=>{t&&(u(e.baseUrl??``),f(e.baseUrl??``),m(!1))}).catch(e=>{t&&(m(!1),v(e instanceof Error?e.message:r(`无法读取 API 地址`,`Could not load API URL`)))}),()=>{t=!1}},[e.id]);let y=async()=>{let n=s.trim(),i=l.trim();if(n||t){if(i&&!nk(i))v(r(`请输入有效的 http 或 https 地址。`,`Enter a valid HTTP or HTTPS URL.`));else{g(!0),v(``);try{i!==d&&(await a(e.id,{action:`base_url`,baseUrl:i||null}),f(i)),n&&(c(``),await o(n))}catch(e){v(e instanceof Error?e.message:r(`保存失败`,`Could not save`))}finally{g(!1)}}}};return(0,F.jsxs)(`form`,{className:`pi-provider-key-form`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,F.jsxs)(`label`,{children:[r(`API Key`,`API key`),(0,F.jsx)(`input`,{type:`password`,autoComplete:`off`,maxLength:16384,value:s,onChange:e=>c(e.target.value),placeholder:t?r(`已配置,输入新值可替换`,`Configured; enter a new key to replace`):r(`输入 API Key`,`Enter API key`)})]}),(0,F.jsxs)(`details`,{className:`pi-provider-advanced`,children:[(0,F.jsx)(`summary`,{children:r(`自定义设置`,`Custom settings`)}),(0,F.jsxs)(`label`,{children:[r(`API 地址(可选)`,`API URL (optional)`),(0,F.jsx)(`input`,{type:`url`,maxLength:2048,value:l,onChange:e=>u(e.target.value),placeholder:r(`使用提供方默认地址`,`Use provider default URL`)})]})]}),(0,F.jsx)(`button`,{type:`submit`,disabled:n||h||p||!s.trim()&&(l.trim()===d||!t),children:h?r(`保存中…`,`Saving…`):t?r(`保存`,`Save`):r(`连接`,`Connect`)}),_&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:_})]})}function ak({setupMode:e=!1,onReturnToConversation:t,getProviders:n,getProviderModels:i,updateProviderModel:a,logoutProvider:o,addCustomProvider:s,startLogin:c,getLogin:l,getActiveLogin:u,respondLogin:d,cancelLogin:f,refreshModels:p}){let[m,h]=(0,P.useState)([]),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(e?`builtin`:null),[b,x]=(0,P.useState)(``),[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(tk),[O,k]=(0,P.useState)(null),[ee,te]=(0,P.useState)(``),[ne,A]=(0,P.useState)(``),[re,ie]=(0,P.useState)(!1),j=(0,P.useRef)(null);(0,P.useEffect)(()=>{e&&y(e=>e??`builtin`)},[e]),(0,P.useEffect)(()=>{let e=!0;return u().then(t=>{e&&t&&k(e=>e??t)}).catch(()=>{}),()=>{e=!1,j.current?.popup?.close()}},[]);let ae=async()=>{h(await n()),_(!0)},oe=async e=>{let t=j.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=nk(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()}j.current=null}}t?.id===e.id&&(e.status===`done`||e.status===`error`||e.status===`cancelled`)&&(t.popup?.close(),j.current=null),k(e),e.status===`done`&&(y(null),C(null),await Promise.all([ae(),p()]))};(0,P.useEffect)(()=>{ae().catch(e=>{_(!0),A(e instanceof Error?e.message:r(`无法读取模型提供方`,`Could not load model providers`))})},[]),(0,P.useEffect)(()=>{if(!O||O.status===`done`||O.status===`error`||O.status===`cancelled`)return;let e=!0,t=window.setInterval(()=>{l(O.id).then(async t=>{e&&await oe(t)}).catch(t=>{e&&A(t instanceof Error?t.message:r(`登录状态不可用`,`Login status is unavailable`))})},700);return()=>{e=!1,window.clearInterval(t)}},[O?.id,O?.status]);let M=re||O?.status===`running`||O?.status===`waiting`,se=m.find(e=>e.id===O?.providerId)?.name,ce=m.filter(e=>e.configured),le=m.filter(e=>!e.configured&&e.methods.length>0),ue=le.find(e=>e.id===b)??(e?le.find(e=>e.id===`openai-codex`)??le.find(e=>e.methods.includes(`oauth`)):void 0)??le.find(e=>e.id===`openai`)??le[0],de=async(e,t,n)=>{j.current=t===`oauth`?{id:null,popup:rk()}:null,ie(!0),A(``),te(``);try{let{id:r}=await c(e,t,n);j.current&&(j.current.id=r),await oe(await l(r))}catch(e){j.current?.popup?.close(),j.current=null,A(e instanceof Error?e.message:r(`无法开始登录`,`Could not start sign-in`)),O||u().then(e=>{e&&k(e)}).catch(()=>{})}finally{ie(!1)}},fe=async e=>{if(O){ie(!0),A(``);try{await d(O.id,e),te(``),await oe(await l(O.id))}catch(e){A(e instanceof Error?e.message:r(`提交失败`,`Submission failed`))}finally{ie(!1)}}},pe=async()=>{ie(!0),A(``);try{await s(E);let e=E.id;await ae(),x(e),y(`builtin`),D(tk)}catch(e){A(e instanceof Error?e.message:r(`无法添加自定义提供方`,`Could not add custom provider`))}finally{ie(!1)}},me=async e=>{ie(!0),A(``);try{await o(e),await ae(),T(null),C(null)}catch(e){A(e instanceof Error?e.message:r(`移除认证失败`,`Could not remove credentials`))}finally{ie(!1)}},N=O?.authorization??(O?.event?.type===`auth_url`||O?.event?.type===`device_code`?O.event:void 0),he=O?.status===`waiting`&&O.prompt&&O.prompt.type!==`select`&&(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ee.trim()&&fe(ee.trim())},children:[(0,F.jsx)(`label`,{htmlFor:`pi-provider-answer`,children:O.prompt.message}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`input`,{id:`pi-provider-answer`,type:O.prompt.type===`secret`?`password`:`text`,autoComplete:`off`,placeholder:O.prompt.placeholder,value:ee,onChange:e=>te(e.target.value)}),(0,F.jsx)(`button`,{type:`submit`,disabled:re||!ee.trim(),children:r(`继续`,`Continue`)})]})]});return(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:e?r(`先连接一个模型`,`Connect a model to begin`):r(`模型`,`Models`)}),(0,F.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.`)}),ne&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:ne}),O&&(0,F.jsxs)(`section`,{className:`pi-provider-flow`,"aria-label":r(`模型登录`,`Model sign-in`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsxs)(`strong`,{children:[r(`模型登录`,`Model sign-in`),se?` · ${se}`:``]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{j.current?.id===O.id&&(j.current.popup?.close(),j.current=null),O.status===`running`||O.status===`waiting`?f(O.id).finally(()=>k(null)):k(null)},children:O.status===`running`||O.status===`waiting`?r(`取消`,`Cancel`):r(`关闭`,`Close`)})]}),O.status===`done`&&(0,F.jsxs)(`div`,{role:`status`,children:[(0,F.jsx)(`p`,{children:r(`已连接。现在可以在会话中选择该提供方的模型。`,`Connected. You can now select this provider’s models in a conversation.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:t,children:r(`返回会话选择模型`,`Return to conversation and choose a model`)})]}),O.status===`error`&&(0,F.jsx)(`p`,{role:`alert`,children:O.error}),O.status===`running`&&!N&&(0,F.jsx)(`p`,{role:`status`,children:r(`正在等待提供方响应…`,`Waiting for the provider…`)}),O.event?.type===`info`&&(0,F.jsxs)(`p`,{children:[O.event.message,O.event.links?.map(e=>{let t=nk(e.url);return t&&(0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e.label??r(`打开链接`,`Open link`)},t)})]}),O.event?.type===`progress`&&N?.type!==`auth_url`&&(0,F.jsx)(`p`,{children:O.event.message}),N?.type===`auth_url`&&(0,F.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.`),` `,nk(N.url)&&(0,F.jsx)(`a`,{href:nk(N.url),target:`_blank`,rel:`noopener noreferrer`,children:r(`打开授权页面`,`Open authorization page`)})]}),N?.type===`device_code`&&(0,F.jsxs)(`p`,{children:[r(`在`,`On the`),` `,nk(N.verificationUri)&&(0,F.jsx)(`a`,{href:nk(N.verificationUri),target:`_blank`,rel:`noopener noreferrer`,children:r(`验证页面`,`verification page`)}),` `,r(`输入代码`,`enter code`),` `,(0,F.jsx)(`code`,{children:N.userCode})]}),O.status===`waiting`&&O.prompt?.type===`select`&&(0,F.jsxs)(`div`,{className:`pi-provider-options`,children:[(0,F.jsx)(`p`,{children:O.prompt.message}),O.prompt.options.map(e=>(0,F.jsxs)(`button`,{type:`button`,disabled:re,onClick:()=>{fe(e.id)},children:[e.label,e.description&&(0,F.jsx)(`small`,{children:e.description})]},e.id))]}),he&&O.prompt?.type===`manual_code`&&N?.type===`auth_url`?(0,F.jsxs)(`details`,{className:`pi-provider-manual-login`,children:[(0,F.jsx)(`summary`,{children:r(`无法自动完成?手动输入授权码`,`Can't finish automatically? Enter an authorization code`)}),he]}):he]}),(0,F.jsxs)(`section`,{className:`pi-provider-list`,"aria-label":r(`已接入的模型提供方`,`Connected model providers`),children:[ce.map(e=>(0,F.jsxs)(`div`,{className:`pi-provider-card`,children:[(0,F.jsxs)(`div`,{className:`pi-provider-card-head`,children:[(0,F.jsxs)(`span`,{className:`pi-provider-name`,children:[e.name,(0,F.jsx)(`span`,{className:`pi-provider-dot`,role:`img`,"aria-label":r(`已配置认证`,`Authentication configured`)}),(0,F.jsx)(`small`,{children:r(`已配置`,`Configured`)})]}),(0,F.jsx)(`button`,{type:`button`,disabled:M,"aria-label":`${r(`编辑`,`Edit`)} ${e.name}`,"aria-expanded":S===e.id,onClick:()=>{y(null),C(S===e.id?null:e.id)},children:r(`编辑`,`Edit`)})]}),S===e.id&&(0,F.jsxs)(`div`,{className:`pi-provider-editor`,children:[e.methods.includes(`api_key`)&&(0,F.jsx)(ik,{provider:e,configured:!0,busy:!!M,getProviderModels:i,updateProviderModel:a,onConnect:t=>de(e.id,`api_key`,t)},e.id),e.methods.includes(`oauth`)&&(0,F.jsx)(`div`,{className:`pi-provider-methods`,children:(0,F.jsx)(`button`,{type:`button`,disabled:!!M,onClick:()=>{de(e.id,`oauth`)},children:r(`网页登录`,`Browser sign-in`)})}),(0,F.jsx)(ek,{providerId:e.id,getModels:i,updateModel:a}),e.storedCredential&&(0,F.jsx)(`div`,{className:`pi-provider-credential-action`,children:(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>T(e.id),children:r(`移除认证`,`Remove credentials`)})}),!e.storedCredential&&(0,F.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.`)}),w===e.id&&(0,F.jsxs)(`div`,{className:`pi-model-confirm`,role:`group`,"aria-label":r(`确认移除认证`,`Confirm credential removal`),children:[(0,F.jsx)(`span`,{children:r(`移除本机保存的认证后,该模型可能无法继续使用。`,`Removing stored credentials may make this provider unavailable.`)}),(0,F.jsx)(`button`,{type:`button`,disabled:re,onClick:()=>{me(e.id)},children:r(`确认移除`,`Remove`)}),(0,F.jsx)(`button`,{type:`button`,disabled:re,onClick:()=>T(null),children:r(`取消`,`Cancel`)})]})]})]},e.id)),g&&ce.length===0&&(0,F.jsx)(`p`,{className:`pi-provider-empty`,children:r(`尚未接入提供方`,`No providers connected yet`)}),!g&&(0,F.jsx)(`p`,{role:`status`,children:r(`正在读取模型提供方…`,`Loading model providers…`)})]}),v===`builtin`&&(0,F.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":r(`添加提供方`,`Add provider`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsx)(`strong`,{children:r(`添加提供方`,`Add provider`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>y(null),children:r(`关闭`,`Close`)})]}),ue?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`label`,{htmlFor:`pi-provider-select`,children:r(`提供方`,`Provider`)}),(0,F.jsx)(`select`,{id:`pi-provider-select`,value:ue.id,onChange:e=>x(e.target.value),children:le.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.name},e.id))}),ue.methods.includes(`api_key`)&&(0,F.jsx)(ik,{provider:ue,configured:!1,busy:!!M,getProviderModels:i,updateProviderModel:a,onConnect:e=>de(ue.id,`api_key`,e)},ue.id),ue.methods.includes(`oauth`)&&(0,F.jsx)(`div`,{className:`pi-provider-methods`,children:(0,F.jsx)(`button`,{type:`button`,disabled:!!M,onClick:()=>{de(ue.id,`oauth`)},children:r(`网页登录`,`Browser sign-in`)})}),(0,F.jsx)(`p`,{children:r(`认证完成后,可在提供方的“编辑”中调整模型目录。`,`After sign-in, open the provider’s Edit panel to adjust its model catalog.`)})]}):(0,F.jsx)(`p`,{children:r(`没有可添加的提供方。`,`No providers can be added.`)})]}),v===`custom`&&(0,F.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":r(`添加自定义提供方`,`Add custom provider`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsx)(`strong`,{children:r(`添加自定义提供方`,`Add custom provider`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>y(null),children:r(`关闭`,`Close`)})]}),(0,F.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,F.jsxs)(`form`,{className:`pi-provider-custom-form`,onSubmit:e=>{e.preventDefault(),pe()},children:[(0,F.jsxs)(`label`,{children:[r(`名称`,`Name`),(0,F.jsx)(`input`,{required:!0,maxLength:100,value:E.name,onChange:e=>D({...E,name:e.target.value}),placeholder:r(`我的模型服务`,`My model service`)})]}),(0,F.jsxs)(`label`,{children:[r(`提供方 ID`,`Provider ID`),(0,F.jsx)(`input`,{required:!0,maxLength:64,value:E.id,onChange:e=>D({...E,id:e.target.value}),placeholder:`my-provider`})]}),(0,F.jsxs)(`label`,{children:[r(`接口地址`,`API URL`),(0,F.jsx)(`input`,{required:!0,type:`url`,maxLength:2048,value:E.baseUrl,onChange:e=>D({...E,baseUrl:e.target.value}),placeholder:`https://api.example.com/v1`})]}),(0,F.jsxs)(`label`,{children:[r(`接口协议`,`API protocol`),(0,F.jsxs)(`select`,{value:E.api,onChange:e=>D({...E,api:e.target.value}),children:[(0,F.jsx)(`option`,{value:`openai-completions`,children:`OpenAI Chat Completions`}),(0,F.jsx)(`option`,{value:`openai-responses`,children:`OpenAI Responses`}),(0,F.jsx)(`option`,{value:`anthropic-messages`,children:`Anthropic Messages`})]})]}),(0,F.jsxs)(`label`,{children:[r(`模型 ID`,`Model ID`),(0,F.jsx)(`input`,{required:!0,maxLength:200,value:E.modelId,onChange:e=>D({...E,modelId:e.target.value}),placeholder:`model-name`})]}),(0,F.jsx)(`button`,{type:`submit`,disabled:re,children:r(`保存并继续`,`Save and continue`)})]})]}),!v&&(0,F.jsxs)(`div`,{className:`pi-provider-add-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:!g||le.length===0||M,onClick:()=>{C(null),y(`builtin`),x(``)},children:r(`+ 添加提供方`,`+ Add provider`)}),(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>{C(null),y(`custom`)},children:r(`+ 添加自定义提供方`,`+ Add custom provider`)})]})]})}var ok=`pi-web-theme`,sk=new Set,ck=window.matchMedia(`(prefers-color-scheme: dark)`),lk=uk();function uk(){try{let e=localStorage.getItem(ok);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function dk(){document.body.toggleAttribute(`data-ds-dark-theme`,lk===`dark`||lk===`system`&&ck.matches)}function fk(){dk(),ck.addEventListener(`change`,dk),window.addEventListener(`storage`,e=>{e.key===ok&&(lk=uk(),dk(),sk.forEach(e=>e()))})}function pk(e){lk=e;try{localStorage.setItem(ok,e)}catch{}dk(),sk.forEach(e=>e())}function mk(){return(0,P.useSyncExternalStore)(e=>(sk.add(e),()=>{sk.delete(e)}),()=>lk)}var hk={group:`_group_8jvbt_4`,title:`_title_8jvbt_12`,cubeRow:`_cubeRow_8jvbt_19`,themeCube:`_themeCube_8jvbt_29`,selected:`_selected_8jvbt_48`};function gk(){let e=mk(),t=l(),r=[{id:`light`,label:t===`zh`?`浅色`:`Light`,Icon:Ct},{id:`dark`,label:t===`zh`?`深色`:`Dark`,Icon:wt},{id:`system`,label:t===`zh`?`跟随系统`:`System`,Icon:Tt}];return(0,F.jsxs)(`div`,{className:hk.group,children:[(0,F.jsx)(`div`,{className:hk.title,children:t===`zh`?`外观`:`Appearance`}),(0,F.jsx)(`div`,{className:hk.cubeRow,children:r.map(({id:t,label:r,Icon:i})=>(0,F.jsxs)(`button`,{type:`button`,className:n(hk.themeCube,e===t&&hk.selected),"aria-pressed":e===t,onClick:()=>pk(t),children:[(0,F.jsx)(i,{}),r]},t))})]})}var _k={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 vk({label:e,menuLabel:t,value:n,options:r,disabled:i,onChange:a}){let[o,s]=(0,P.useState)(!1),c=(0,P.useId)(),l=(0,P.useRef)(null),u=(0,P.useRef)(null),d=(0,P.useRef)(null);return(0,P.useEffect)(()=>{i&&s(!1)},[i]),(0,P.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,F.jsxs)(`div`,{className:_k.selectorWrap,ref:l,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},children:[(0,F.jsxs)(`button`,{ref:u,type:`button`,className:_k.selector,"aria-label":e,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?c:void 0,disabled:i,onClick:()=>s(e=>!e),children:[(0,F.jsx)(`span`,{className:_k.value,children:r.find(e=>e.id===n)?.label}),(0,F.jsx)(`svg`,{className:_k.chevron,width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,F.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,F.jsx)(`div`,{id:c,className:_k.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,F.jsxs)(`button`,{ref:e.id===n?d:void 0,type:`button`,role:`menuitemradio`,"aria-checked":e.id===n,className:_k.option,onClick:()=>{s(!1),u.current?.focus(),e.id!==n&&a(e.id)},children:[(0,F.jsx)(`span`,{children:e.label}),e.id===n&&(0,F.jsx)(`svg`,{className:_k.chevron,width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m3 8 3.2 3.2L13 4.5`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e.id))})]})}var yk={row:`_row_1rrpk_1`,title:`_title_1rrpk_9`},bk=[{id:`zh`,label:`中文`},{id:`en`,label:`English`}];function xk(){let e=l(),t=e===`zh`?`语言`:`Language`;return(0,F.jsxs)(`div`,{className:yk.row,children:[(0,F.jsx)(`div`,{className:yk.title,children:t}),(0,F.jsx)(vk,{label:t,menuLabel:e===`zh`?`选择语言`:`Choose language`,value:e,options:bk,onChange:i})]})}function Sk(e,t,n){return e instanceof m&&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?e.message:n===`check`?t===`zh`?`检查更新失败`:`Could not check for updates`:t===`zh`?`升级失败`:`Update failed`}function Ck({getUpdate:e,getRunningVersion:t,setUpdateChannel:n,cancelUpdate:r,update:i}){let a=l(),[o,s]=(0,P.useState)(null),[c,u]=(0,P.useState)(!0),[d,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(``),S=(0,P.useRef)(!1),C=(0,P.useRef)(!1),w=(0,P.useRef)(0),T=(0,P.useRef)(!0);(0,P.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]);let E=async()=>{let t=++w.current;u(!0),x(``);try{let n=await e();T.current&&t===w.current&&s(n)}catch(e){T.current&&t===w.current&&(s(null),x(Sk(e,a,`check`)))}finally{T.current&&t===w.current&&u(!1)}};return(0,P.useEffect)(()=>{E();let e=()=>{E()};return window.addEventListener(`pi-update-channel`,e),()=>{window.removeEventListener(`pi-update-channel`,e)}},[]),(0,P.useEffect)(()=>{if(!g)return;let e=!1,n=new AbortController,r,i=setTimeout(()=>{e=!0,n.abort(),clearTimeout(r),_(null),y(!0),x(f(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.`)),_e(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===g){clearTimeout(i),location.reload();return}}catch{}e||(r=setTimeout(()=>{o()},1200))};return r=setTimeout(()=>{o()},1200),()=>{e=!0,n.abort(),clearTimeout(r),clearTimeout(i)}},[g]),{status:o,checking:c,installing:d,cancelling:m,targetVersion:g,restartTimedOut:v,error:b,check:E,install:async()=>{if(S.current||c||!o?.available||!o.canRestart||g||v||o.downgrade&&!window.confirm(f(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;S.current=!0,p(!0),x(``);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(f(a,`${n.message}。\n\n仍然升级?`,`${n.message}.\n\nUpdate anyway?`)))return;e=await i({...t,force:!0})}T.current&&_(e.version)}catch(t){T.current&&x(Sk(t,a,`install`));try{let t=await e();T.current&&s(t)}catch{}}finally{S.current=!1,T.current&&p(!1)}},changeChannel:async e=>{if(!(!n||c||d||g)){++w.current,u(!0),x(``);try{await n(e),window.dispatchEvent(new Event(`pi-update-channel`))}catch(e){T.current&&(u(!1),x(Sk(e,a,`check`)))}}},cancel:async()=>{if(!(!r||C.current||g)){C.current=!0,h(!0),x(``);try{await r(),y(!1),await E()}catch(e){T.current&&x(Sk(e,a,`install`))}finally{C.current=!1,T.current&&h(!1)}}}}}var wk=(0,P.createContext)(null);function Tk({actions:e,children:t}){let n=Ck(e);return(0,F.jsx)(wk.Provider,{value:n,children:t})}function Ek(){return(0,P.useContext)(wk)}function Dk(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 Ok={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 kk(e){let t=Ek();return t?(0,F.jsx)(jk,{...e,controller:t}):(0,F.jsx)(Ak,{...e})}function Ak(e){let t=Ck(e);return(0,F.jsx)(jk,{...e,controller:t})}function jk(e){let t=l(),n=(e,n)=>f(t,e,n),{status:r,checking:i,installing:a,cancelling:o,targetVersion:s,restartTimedOut:c,error:u,check:d,install:p,changeChannel:m,cancel:h}=e.controller,g=Dk(navigator.userAgent),_=!(!r?.latest||r.available||i),v=r?(0,F.jsxs)(F.Fragment,{children:[n(`当前版本`,`Current version`),` `,r.current,r.available&&r.latest?` → ${r.latest}`:_&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(`span`,{role:`status`,children:n(`已是最新版本`,`Up to date`)})]})]}):i?n(`正在读取版本…`,`Reading version…`):n(`暂时无法读取版本`,`Version unavailable`),y=!!(g&&r?.desktopShell&&String(g.build)!==r.desktopShell.build)||!!(r?.launcherHandoff?.required||r?.requiresDesktopUpgrade||r?.launcher&&!r.launcher.releaseChannels),b=!!(g||r?.launcher||r?.desktopShell);return(0,F.jsxs)(`section`,{className:Ok.group,"aria-label":n(`应用更新`,`App updates`),children:[r?.channel&&e.setUpdateChannel&&(0,F.jsxs)(`div`,{className:Ok.preference,children:[(0,F.jsx)(`div`,{className:Ok.title,children:n(`更新偏好`,`Update preference`)}),(0,F.jsx)(vk,{label:n(`更新偏好`,`Update preference`),menuLabel:n(`选择更新偏好`,`Choose update preference`),value:r.channel,disabled:i||a||!!s||c,onChange:e=>{m(e)},options:[{id:`stable`,label:n(`稳定版(推荐)`,`Stable (recommended)`)},{id:`alpha`,label:n(`体验版(包含 alpha)`,`Preview (including alpha)`)}]})]}),r?.channel===`alpha`&&(0,F.jsx)(`p`,{className:Ok.note,children:n(`体验版包含尚在验证的新功能,可能不稳定。`,`Preview releases include features still under testing and may be unstable.`)}),(0,F.jsxs)(`div`,{className:Ok.row,children:[(0,F.jsxs)(`div`,{className:Ok.details,children:[(0,F.jsx)(`div`,{className:Ok.title,children:n(`应用更新`,`App updates`)}),(0,F.jsx)(`p`,{className:Ok.summary,children:v})]}),(0,F.jsxs)(`div`,{className:Ok.actions,children:[r?.available&&r.canRestart&&!s&&!c&&(0,F.jsx)(EO,{variant:`primary`,disabled:a||i,onClick:()=>{p()},children:a?n(`正在安装…`,`Installing…`):r.downgrade?n(`切换到稳定版并重启`,`Switch to stable and restart`):n(`升级并重启`,`Update and restart`)}),(r?.recovery?.canCancel||a)&&e.cancelUpdate&&!s&&(0,F.jsx)(EO,{variant:`outline`,disabled:o,onClick:()=>{h()},children:o?n(`正在取消…`,`Cancelling…`):a?n(`取消下载`,`Cancel download`):n(`取消未完成的升级`,`Cancel unfinished update`)}),(0,F.jsx)(EO,{variant:`outline`,disabled:i||a||!!s,onClick:()=>{d()},children:i?n(`检查中…`,`Checking…`):n(`检查更新`,`Check for updates`)})]})]}),r?.launcherHandoff?.required&&(0,F.jsxs)(`div`,{className:Ok.note,children:[(0,F.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.`)}),g?.handoff?(0,F.jsx)(`a`,{href:`pi-desktop://launcher-handoff`,target:`_blank`,rel:`noreferrer`,children:n(`安全切换到当前桌面启动器…`,`Safely switch to this desktop launcher…`)}):(0,F.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,F.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,F.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,F.jsxs)(`div`,{className:Ok.note,children:[(0,F.jsx)(`p`,{children:n(`以下插件在新版本中暂时不可用(不影响升级,数据保留):`,`These plugins will be unavailable on the new version (the update is not blocked; their data is kept):`)}),(0,F.jsx)(`ul`,{children:r.pluginWarnings.map(e=>(0,F.jsxs)(`li`,{children:[e.pluginId,`: `,e.message]},e.pluginId))})]}),r?.lastFailure&&!a&&!s&&(0,F.jsxs)(`p`,{className:Ok.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,F.jsx)(`p`,{className:Ok.note,children:r.reason}),r?.requiresDesktopUpgrade&&(0,F.jsxs)(`p`,{className:Ok.note,children:[(0,F.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,F.jsx)(`p`,{className:Ok.note,role:`status`,children:n(`正在重启并等待新版连接…`,`Restarting and waiting for the new version…`)}),u&&(0,F.jsx)(`p`,{className:Ok.error,role:`alert`,children:u}),u?.includes(`Missing view flush acknowledgement`)&&(0,F.jsx)(`p`,{className:Ok.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.`)}),b&&(0,F.jsxs)(`details`,{className:Ok.diagnostics,open:y,children:[(0,F.jsx)(`summary`,{children:n(`版本详情`,`Version details`)}),g&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`当前桌面窗口`,`Current desktop window`),` `,g.version,` · build `,g.build]}),r?.launcher&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`后台启动器`,`Backend launcher`),` `,r.launcher.version,` · `,n(`体验版持久化`,`Preview persistence`),` `,r.launcher.releaseChannels?n(`支持`,`supported`):n(`不支持`,`unsupported`)]}),r?.desktopShell&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`后台启动时的桌面外壳`,`Desktop shell at backend startup`),` `,r.desktopShell.version,` · build `,r.desktopShell.build]}),r?.desktopShell&&(0,F.jsx)(`p`,{className:Ok.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 Mk=`https://pi.emath.top`,Nk=`https://github.com/chengzhiyi/pi-webapp/issues`;function Pk(e,t){let n={home:``,quickStart:`getting-started`,troubleshooting:`troubleshooting`}[e];return`${Mk}/${String(t).toLowerCase().startsWith(`zh`)?`zh/`:``}${n}`}function Fk(e){let t=(t,n)=>f(e,t,n);return[{id:`docs`,label:t(`使用文档`,`Documentation`),href:Pk(`home`,e)},{id:`quick-start`,label:t(`快速开始`,`Quick start`),href:Pk(`quickStart`,e)},{id:`troubleshooting`,label:t(`故障排查`,`Troubleshooting`),href:Pk(`troubleshooting`,e)},{id:`issues`,label:t(`在 GitHub 上反馈问题`,`Report an issue on GitHub`),href:Nk}]}var Ik={row:`_row_wp8ea_1`,title:`_title_wp8ea_9`,summary:`_summary_wp8ea_15`,links:`_links_wp8ea_22`};function Lk(){let e=l(),t=(t,n)=>f(e,t,n);return(0,F.jsxs)(`section`,{className:Ik.row,"aria-label":t(`帮助与文档`,`Help & documentation`),children:[(0,F.jsx)(`div`,{className:Ik.title,children:t(`帮助与文档`,`Help & documentation`)}),(0,F.jsx)(`p`,{className:Ik.summary,children:t(`查看使用指南、快速开始和常见问题的解决方法。`,`Read the guides, get started quickly, and find fixes for common problems.`)}),(0,F.jsx)(`ul`,{className:Ik.links,children:Fk(e).map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,children:e.label})},e.id))})]})}var Rk={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 zk(e){return e===`general`?(0,F.jsx)(rt,{className:Rk.navIcon,size:16}):e===`models`?(0,F.jsx)(Et,{className:Rk.navIcon,size:16}):e===`packages`?(0,F.jsx)(At,{className:Rk.navIcon,size:16}):e===`plugins`||e===`extensions`?(0,F.jsx)(yt,{className:Rk.navIcon,size:16}):(0,F.jsx)(Ot,{className:Rk.navIcon,size:16})}function Bk({title:e,sections:t,activeId:n,onSelect:r,onClose:i,children:a}){let o=l(),s=(0,P.useId)(),c=(0,P.useRef)(null);return(0,P.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,F.jsxs)(`div`,{className:Rk.overlay,role:`presentation`,children:[(0,F.jsx)(`div`,{className:Rk.mask,"aria-hidden":`true`,onClick:i}),(0,F.jsxs)(`div`,{className:Rk.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:[(0,F.jsxs)(`nav`,{className:Rk.nav,"aria-label":o===`zh`?`Pi 设置分类`:`Pi settings sections`,children:[(0,F.jsx)(`div`,{className:Rk.navTitle,id:s,children:e}),(0,F.jsx)(`div`,{className:Rk.navList,children:t.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`${Rk.navCell} ${n===e.id?Rk.active:``}`,"aria-current":n===e.id?`true`:void 0,onClick:()=>r(e.id),children:[zk(e.id),(0,F.jsx)(`span`,{className:Rk.navLabel,children:e.label})]},e.id))})]}),(0,F.jsxs)(`div`,{className:Rk.content,children:[(0,F.jsxs)(`header`,{className:Rk.header,children:[(0,F.jsx)(`div`,{className:Rk.actions}),(0,F.jsx)(`button`,{ref:c,className:Rk.close,type:`button`,onClick:i,"aria-label":o===`zh`?`关闭 Pi 设置`:`Close Pi settings`,children:(0,F.jsx)(ut,{size:14})})]}),(0,F.jsx)(`div`,{className:Rk.options,children:a})]})]})]})}function Vk(e){return/^(?:npm:|git:|https?:\/\/|ssh:\/\/|git@)/i.test(e.trim())}function Hk(e){let t=l(),n=(e,n)=>f(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,u]=(0,P.useState)(null),[d,p]=(0,P.useState)({packages:``,extensions:``,skills:``}),[m,h]=(0,P.useState)(e.setupMode?`models`:`general`),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(!0),[b,x]=(0,P.useState)(``);(0,P.useEffect)(()=>{e.setupMode&&h(`models`)},[e.setupMode]),(0,P.useEffect)(()=>{let e=!0;return o().then(t=>{e&&u(t)}).catch(t=>{e&&x(t instanceof Error?t.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}).finally(()=>{e&&y(!1)}),()=>{e=!1}},[]);let S=async()=>{y(!0),x(``);try{u(await o())}catch(e){x(e instanceof Error?e.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}finally{y(!1)}},C=async(e,t,r)=>{_(!0),x(``);try{u(await s(e,`global`,t,r)),t===`add`&&p(t=>({...t,[e]:``}))}catch(e){x(e instanceof Error?e.message:n(`保存失败`,`Save failed`))}finally{_(!1)}},w=r.find(({kind:e})=>e===m),T=w?c?.global[w.kind]??[]:[],E=w?c?.installed?.[w.kind]??[]:[],D=w?d[w.kind].trim():``,O=w?.kind!==`packages`&&Vk(D),k=new Set(c?.installed.packages.map(e=>e.source)??[]),ee=c?.installed.extensions.filter(e=>!k.has(e.source))??[],te=c?.global.packages.filter(e=>!k.has(e))??[],ne=d.extensions.trim(),A=Vk(ne),re=e=>{p(t=>({...t,packages:e})),h(`packages`),x(``)};return(0,F.jsxs)(Bk,{title:n(`Pi 设置`,`Pi Settings`),sections:i,activeId:m,onSelect:e=>{h(e),x(``)},onClose:a,children:[m===`general`&&(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:n(`通用设置`,`General`)}),(0,F.jsx)(`p`,{className:`pi-settings-intro`,children:n(`调整网页的显示方式。`,`Choose how the web interface appears.`)}),(0,F.jsxs)(`div`,{className:`pi-settings-general`,children:[(0,F.jsx)(xk,{}),(0,F.jsx)(gk,{}),(0,F.jsx)(kk,{getUpdate:e.getUpdate,getRunningVersion:e.getRunningVersion,setUpdateChannel:e.setUpdateChannel,cancelUpdate:e.cancelUpdate,update:e.update}),(0,F.jsx)(Lk,{})]})]}),m===`models`&&(0,F.jsx)(ak,{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}),w&&(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:w.title}),(0,F.jsxs)(`p`,{className:`pi-settings-intro`,children:[w.hint,` `,n(`添加或移除后会重新加载 Pi 资源。`,`Pi resources reload after you add or remove one.`)]}),b&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:b}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`已发现`,`Discovered `)}${w.title}`,children:[(0,F.jsxs)(`h3`,{children:[w.kind===`packages`?n(`已安装的包`,`Installed packages`):n(`已发现的技能`,`Discovered skills`),` `,(0,F.jsx)(`span`,{children:E.length})]}),(0,F.jsx)(`ul`,{children:E.length?E.map(e=>{let t=w.kind===`packages`?c.installed.extensions.filter(t=>t.source===e.source):[];return(0,F.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`strong`,{title:e.name,children:e.name}),(0,F.jsx)(`small`,{title:e.path||e.source,children:e.path||e.source}),t.length>0&&(0,F.jsxs)(`div`,{className:`pi-package-contents`,children:[(0,F.jsx)(`span`,{children:n(`包含扩展`,`Includes extensions`)}),t.map(e=>(0,F.jsx)(`span`,{title:e.path,children:e.name},e.path))]})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[(0,F.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`)]}),w.kind===`packages`&&c.global.packages.includes(e.source)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>{C(`packages`,`remove`,e.source)},children:n(`移除`,`Remove`)})]})]},`${e.path}:${e.source}`)}):(0,F.jsxs)(`li`,{className:`pi-settings-empty`,children:[n(`未发现`,`No `),w.title]})})]}),w.kind===`packages`&&(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`独立扩展`,`Standalone extensions`),children:[(0,F.jsxs)(`h3`,{children:[n(`独立扩展`,`Standalone extensions`),` `,(0,F.jsx)(`span`,{children:ee.length})]}),(0,F.jsx)(`ul`,{children:ee.length?ee.map(e=>(0,F.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`strong`,{title:e.name,children:e.name}),(0,F.jsx)(`small`,{title:e.path,children:e.path})]}),(0,F.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,F.jsx)(`li`,{className:`pi-settings-empty`,children:n(`未发现独立扩展`,`No standalone extensions found`)})})]}),(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`手动配置`,`Configure `)}${w.title}`,children:[(0,F.jsx)(`h3`,{children:w.kind===`packages`?n(`添加包`,`Add package`):n(`手动配置技能`,`Configure skills manually`)}),(w.kind===`packages`?te:T).length>0&&(0,F.jsx)(`ul`,{children:(w.kind===`packages`?te:T).map(e=>(0,F.jsxs)(`li`,{className:`pi-config-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`code`,{title:e,children:e}),w.kind===`packages`&&(0,F.jsx)(`small`,{children:n(`已配置,但未发现安装目录`,`Configured, but installation directory was not found`)}),w.kind!==`packages`&&Vk(e)&&(0,F.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源请在“包与扩展”中添加。`,`Not loaded: add package sources under Packages & extensions.`)})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[w.kind!==`packages`&&Vk(e)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>re(e),children:n(`转到包`,`Go to packages`)}),(0,F.jsx)(`button`,{type:`button`,disabled:g,"aria-label":`${n(`移除`,`Remove`)} ${e}`,onClick:()=>{C(w.kind,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),D&&!O&&C(w.kind,`add`,D)},children:[(0,F.jsx)(`input`,{"aria-label":`${n(`添加`,`Add `)}${w.title}`,"aria-invalid":O||void 0,"aria-describedby":O?`pi-config-source-help`:void 0,placeholder:w.placeholder,value:d[w.kind],onChange:e=>p(t=>({...t,[w.kind]:e.target.value}))}),(0,F.jsx)(`button`,{type:`submit`,disabled:g||!D||O,children:n(`添加`,`Add`)})]}),O&&(0,F.jsxs)(`p`,{id:`pi-config-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请在「包」中添加。`,`This is a package source. Add it under Packages.`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>re(D),children:n(`转到包`,`Go to packages`)})]})]}),w.kind===`packages`&&(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`手动配置扩展路径`,`Configure extension paths manually`),children:[(0,F.jsx)(`h3`,{children:n(`扩展路径`,`Extension paths`)}),c.global.extensions.length>0&&(0,F.jsx)(`ul`,{children:c.global.extensions.map(e=>(0,F.jsxs)(`li`,{className:`pi-config-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`code`,{title:e,children:e}),Vk(e)&&(0,F.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源不能作为扩展路径,请在上方添加包。`,`Not loaded: package sources cannot be extension paths. Add the package above.`)})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[Vk(e)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>re(e),children:n(`填入包`,`Use as package`)}),(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>{C(`extensions`,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ne&&!A&&C(`extensions`,`add`,ne)},children:[(0,F.jsx)(`input`,{"aria-label":n(`添加扩展路径`,`Add extension path`),"aria-invalid":A||void 0,"aria-describedby":A?`pi-extension-source-help`:void 0,placeholder:n(`扩展文件或目录路径`,`Extension file or directory path`),value:d.extensions,onChange:e=>p(t=>({...t,extensions:e.target.value}))}),(0,F.jsx)(`button`,{type:`submit`,disabled:g||!ne||A,children:n(`添加扩展`,`Add extension`)})]}),A&&(0,F.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,F.jsx)(`button`,{type:`button`,onClick:()=>re(ne),children:n(`填入包`,`Use as package`)})]})]})]}):v?(0,F.jsx)(`p`,{role:`status`,children:n(`正在读取设置…`,`Loading settings…`)}):(0,F.jsx)(`button`,{className:`pi-settings-retry`,type:`button`,onClick:()=>{S()},children:n(`重试读取设置`,`Retry loading settings`)})]},w.kind)]})}function Uk({size:e=24}){return(0,F.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,F.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,F.jsx)(`path`,{d:`m5.5 14.5 4 4M8 15l8-8`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]})}var Wk={page:`_page_1bt34_2`,pageHead:`_pageHead_1bt34_4`,breadcrumb:`_breadcrumb_1bt34_7`,refresh:`_refresh_1bt34_8`,back:`_back_1bt34_8`,danger:`_danger_1bt34_8`,scope:`_scope_1bt34_12`,error:`_error_1bt34_13`,notice:`_notice_1bt34_13`,search:`_search_1bt34_16`,group:`_group_1bt34_17`,cards:`_cards_1bt34_20`,card:`_card_1bt34_20`,artwork:`_artwork_1bt34_23`,cardMain:`_cardMain_1bt34_24`,cardOpen:`_cardOpen_1bt34_25`,dot:`_dot_1bt34_31`,cardEnd:`_cardEnd_1bt34_33`,switch:`_switch_1bt34_34`,thumb:`_thumb_1bt34_36`,detail:`_detail_1bt34_40`,detailHead:`_detailHead_1bt34_41`},Gk={pluginId:`@chengzhiyi/pi-excalidraw`,name:`Excalidraw`,official:!0,icon:`drawing`,installed:!1,enabled:!1,phase:`not-installed`};async function Kk(e,t,n){let r=ve(),{response:i}=await s(`/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 qk={catalog:e=>Kk(``,void 0,e),manage:e=>Kk(`/manage`,e),action:e=>Kk(`/action`,e),decide:(e,t)=>Kk(`/approvals`,{id:e,decision:t}),secret:(e,t,n)=>Kk(`/secrets`,{pluginId:e,name:t,value:n}),signIn:e=>Kk(`/secrets`,e),pendingViews:e=>Kk(`/views`,{operation:`list-pending`,pluginId:e}),view:(e,t)=>Kk(`/views`,e,t)},Jk={section:`_section_1qkpy_1`,attention:`_attention_1qkpy_5`,notice:`_notice_1qkpy_6`,error:`_error_1qkpy_7`,actions:`_actions_1qkpy_8`,configuration:`_configuration_1qkpy_13`,rowActions:`_rowActions_1qkpy_14`};function Yk({pluginId:e,t}){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(0);(0,P.useEffect)(()=>{let t=!0;return qk.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 qk.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,F.jsxs)(`div`,{className:Jk.error,"data-pending-views":!0,children:[(0,F.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,F.jsxs)(`div`,{children:[(0,F.jsxs)(`code`,{children:[e.kind,` · `,e.mountId,` · `,t(`会话`,`session`),` `,e.sessionId,e.dirty||e.busy?` · ${t(`有未确认修改`,`unconfirmed edits`)}`:``]}),` `,i===e.viewToken?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(e),children:t(`确认丢弃`,`Confirm discard`)}),` `,(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(null),children:t(`取消`,`Cancel`)})]}):(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(e.viewToken),children:t(`丢弃此视图`,`Discard this view`)})]},e.viewToken)),o&&(0,F.jsx)(`p`,{role:`alert`,children:o})]})}function Xk({size:e=24}){return(0,F.jsx)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,style:{display:`block`,flexShrink:0},children:(0,F.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z`})})}function Zk({card:e,size:t=24}){let n=e.icon??(e.pluginId===Gk.pluginId?Gk.icon:void 0);return(0,F.jsx)(n===`drawing`?Uk:n===`github`?Xk:fe,{size:t})}function Qk(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 $k({card:e,t,onCatalog:n,disabled:r}){let[i,a]=(0,P.useState)({}),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(!1),f=(0,P.useRef)(!0);if((0,P.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]),(0,P.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 qk.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 qk.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 qk.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 tf(e))},g=e=>{window.open(e.verificationUri,`_blank`,`noopener,noreferrer`),h(e.userCode)},_=()=>{c&&qk.signIn({auth:`cancel`,deviceId:c.deviceId}).catch(()=>{}),l(null)};return(0,F.jsxs)(`section`,{className:Jk.configuration,children:[(0,F.jsx)(`h2`,{children:t(`GitHub 授权`,`GitHub authorization`)}),(0,F.jsx)(`p`,{className:Wk.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,F.jsxs)(`div`,{className:Jk.configuration,children:[(0,F.jsxs)(`div`,{className:Jk.actions,children:[(0,F.jsx)(`span`,{role:`status`,children:e.configured?t(`已授权`,`Authorized`):t(`未授权`,`Not authorized`)}),e.signIn===`browser`&&(0,F.jsx)(EO,{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,F.jsx)(EO,{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,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void p(e.name,null),children:t(`移除`,`Remove`)})]}),c?.name===e.name&&(0,F.jsxs)(`div`,{className:Wk.scope,role:`status`,children:[(0,F.jsxs)(`ol`,{style:{margin:0,paddingLeft:20,display:`grid`,gap:10},children:[(0,F.jsxs)(`li`,{children:[t(`复制下面的验证码`,`Copy this code`),(0,F.jsxs)(`div`,{className:Jk.actions,style:{marginTop:6},children:[(0,F.jsx)(`code`,{style:{fontSize:28,letterSpacing:4,fontWeight:600,padding:`6px 14px`,border:`1px solid currentColor`,borderRadius:8,userSelect:`all`},children:c.userCode}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,onClick:()=>void h(c.userCode),children:u?t(`已复制`,`Copied`):t(`复制`,`Copy`)})]})]}),(0,F.jsxs)(`li`,{children:[t(`打开 GitHub 授权页,粘贴验证码并点击 Authorize`,`Open GitHub, paste the code and click Authorize`),(0,F.jsx)(`div`,{className:Jk.actions,style:{marginTop:6},children:(0,F.jsx)(EO,{size:`sm`,onClick:()=>g(c),children:t(`复制验证码并打开 GitHub`,`Copy code and open GitHub`)})})]})]}),(0,F.jsxs)(`div`,{className:Jk.actions,style:{marginTop:10},children:[(0,F.jsx)(`span`,{children:t(`等待授权中… 完成后这里会自动更新。`,`Waiting for authorization… this updates automatically.`)}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,onClick:_,children:t(`取消`,`Cancel`)})]})]}),(0,F.jsxs)(`details`,{open:e.signIn===`token-page`&&!e.configured,children:[(0,F.jsx)(`summary`,{children:e.signIn===`token-page`?t(`创建后在此粘贴令牌(仅限目标仓库的 fine-grained token,Issues、Pull requests、Contents 读写)`,`Paste the token here after creating it (fine-grained, limited to the target repository, Issues / Pull requests / Contents read-write)`):t(`改用手动粘贴令牌`,`Paste a token instead`)}),(0,F.jsxs)(`div`,{className:Jk.actions,children:[(0,F.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,F.jsx)(EO,{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,F.jsx)(`p`,{role:`status`,className:Wk.scope,children:o})]})}function eA(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 tA({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,P.useState)({plugins:[Gk],offline:!0}),[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!0),[_,v]=(0,P.useState)(!1),y=(0,P.useRef)(!1),b=(0,P.useRef)(0),x=(0,P.useRef)(new Set);(0,P.useEffect)(()=>{for(let e of d.plugins)e.installed&&x.current.add(e.pluginId)},[d]);let[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(null),[O,k]=(0,P.useState)(``),[ee,te]=(0,P.useState)(0),[ne,A]=(0,P.useState)(null),re=ne?Qk(ne.operation,e,ne.card.name):null,ie=e=>({message:e instanceof Error?e.message:String(e),code:e?.code});(0,P.useEffect)(()=>{if(y.current)return;let e=++b.current,t=new AbortController;return g(!0),D(null),qk.catalog(t.signal).then(t=>{e===b.current&&(f(t),m(!0),T(null))}).catch(n=>{!t.signal.aborted&&e===b.current&&(T(ie(n)),f(e=>({...e,offline:!0})))}).finally(()=>{e===b.current&&g(!1)}),()=>{t.abort()}},[t,n,ee]);let j=async(e,t,n=!1)=>{if(y.current||o||h)return;y.current=!0,++b.current,A(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),k(``);try{let i=await qk.manage({pluginId:e.pluginId,operation:t,...r?{downloadId:r}:{},...n?{reopenEditors:!0}:{}});f(i),m(!0),T(null),k(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:ie(t)});try{f(await qk.catalog()),m(!0),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch{}}finally{y.current=!1,v(!1),c(!1),C(null)}},ae=(e,t)=>{t===`disable`||t===`uninstall`?A({card:e,operation:t}):j(e,t)},oe=d.plugins.some(e=>e.pluginId===Gk.pluginId)?d.plugins:[...d.plugins,Gk],M=oe.find(e=>e.pluginId===i),se=oe.filter(e=>`${e.name} ${e.pluginId} ${le(e)}`.toLowerCase().includes(r.trim().toLowerCase()));(0,P.useEffect)(()=>{l(se.length)},[se.length,l]);let ce=_||h||o||!p||!!d.offline;function le(t){return t.contribution?.entry.description[e]??t.description?.[e]??(t.pluginId===Gk.pluginId?u(`绘制、编辑手绘图表,并将图稿保存到工作区。`,`Draw and edit hand-drawn diagrams, and save them to your workspace.`):u(`按需下载安装的官方插件。`,`An official plugin available on demand.`))}let ue=e=>`${e.name}${e.official?u(`(官方)`,` (Official)`):``}`,de=e=>E?.id===e.pluginId?E.problem:e.error?{code:e.errorCode,message:e.error}:e.updateDiagnostic?.status===`failed`?e.updateDiagnostic:null,fe=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`),pe=e=>(0,F.jsx)(`button`,{type:`button`,role:`switch`,className:Wk.switch,"aria-label":u(`启用 ${e.name}`,`Enable ${e.name}`),"aria-checked":p&&e.enabled,disabled:ce||!e.installed,title:p?e.installed?void 0:u(`请先下载插件`,`Download the plugin first`):u(`请先读取插件状态`,`Read plugin status first`),onClick:()=>ae(e,e.enabled?`disable`:`enable`),children:(0,F.jsx)(`span`,{className:Wk.thumb})}),me=e=>{let t=de(e),n=!e.installed&&!!t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`].includes(t.code??``);return(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce||n,onClick:()=>ae(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,P.useEffect)(()=>{if(!E||M)return;let e=oe.find(e=>e.pluginId===E.id);zt({key:`hosted-operation-${E.id}`,message:`${e?`${ue(e)}:`:``}${eA(E.problem,!!e?.installed,u)}`,detail:[E.problem.code,E.problem.message].filter(Boolean).join(`: `),detailLabel:u(`诊断信息`,`Diagnostics`)})},[E]),(0,F.jsxs)(`section`,{className:Jk.section,"data-hosted-management":!0,"aria-busy":_||h,style:a?void 0:{display:`none`},children:[!M&&(0,F.jsxs)(`h2`,{children:[u(`官方插件`,`Official plugins`),` `,(0,F.jsx)(`span`,{children:se.length})]}),w&&(0,F.jsxs)(`div`,{role:`alert`,className:Jk.error,children:[u(`无法读取插件状态,请重试。`,`Cannot read plugin status. Please retry.`),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),w.message]}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:_||h||o,onClick:()=>te(e=>e+1),children:u(`重试`,`Retry`)})]}),d.dev&&(0,F.jsxs)(`div`,{"data-hosted-dev":!0,children:[d.dev.notices.map((e,t)=>(0,F.jsxs)(`div`,{className:e.level===`info`?Jk.notice:Jk.error,role:e.level===`error`?`alert`:`status`,children:[(0,F.jsxs)(`strong`,{children:[u(`开发模式`,`Dev mode`),e.pluginId?` · ${e.pluginId}`:``]}),`: `,e.message]},t)),d.dev.sources.map(e=>(0,F.jsxs)(`p`,{className:Jk.notice,role:`status`,"data-hosted-dev-source":e.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,(0,F.jsx)(`code`,{children:e.root}),` · `,e.state,e.version?` ${e.version}`:``,e.message?` — ${e.message}`:``]},e.pluginId))]}),O&&(0,F.jsx)(`p`,{className:Jk.notice,role:`status`,children:O}),S&&(0,F.jsx)(EO,{variant:`outline`,onClick:()=>{qk.manage({pluginId:S.pluginId,operation:`cancel-download`,downloadId:S.id}).then(()=>k(u(`已请求取消,已完成的安装不会回滚。`,`Cancellation requested; committed installations are not rolled back.`))).catch(e=>D({id:S.pluginId,problem:ie(e)}))},children:u(`取消下载(不回滚已提交安装)`,`Cancel download (no rollback after commit)`)}),M?(0,F.jsxs)(`div`,{className:Wk.detail,"data-hosted-detail":M.pluginId,children:[(0,F.jsxs)(`div`,{className:Wk.detailHead,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:(0,F.jsx)(Zk,{card:M,size:30})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{children:ue(M)}),(0,F.jsx)(`p`,{children:le(M)})]}),pe(M)]}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:u(`插件标识`,`Plugin ID`)}),(0,F.jsx)(`dd`,{children:(0,F.jsx)(`code`,{children:M.pluginId})}),(0,F.jsx)(`dt`,{children:u(`来源`,`Source`)}),(0,F.jsx)(`dd`,{children:u(`按需下载的官方插件`,`Official on-demand package`)}),(0,F.jsx)(`dt`,{children:u(`状态`,`Status`)}),(0,F.jsx)(`dd`,{children:fe(M)}),M.availableVersion&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:u(`可用版本`,`Available release`)}),(0,F.jsx)(`dd`,{children:M.availableVersion})]}),M.pendingVersion&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:u(`待更新版本`,`Pending release`)}),(0,F.jsx)(`dd`,{children:M.pendingVersion})]})]}),((e,t)=>{let n=de(e),r=e.updateDiagnostic;return n?(0,F.jsxs)(`div`,{className:Jk.error,role:`alert`,children:[eA(n,e.installed,u),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),(0,F.jsx)(`code`,{children:n.code}),(0,F.jsx)(`p`,{children:n.message}),r&&(0,F.jsxs)(`p`,{children:[r.checkedAt,` · `,r.hostVersion]}),/lock|owned/i.test(n.message)&&(0,F.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,F.jsx)(Yk,{pluginId:e.pluginId,t:u})]}):null})(M,!0),(0,F.jsx)($k,{card:M,t:u,disabled:ce,onCatalog:e=>{f(e),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}}),(0,F.jsxs)(`section`,{className:Jk.configuration,children:[(0,F.jsx)(`h2`,{children:u(`配置与更新`,`Configuration & updates`)}),(0,F.jsx)(`p`,{className:Wk.scope,children:M.icon===`drawing`||M.pluginId===Gk.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,F.jsx)(`p`,{className:Wk.scope,children:u(`兼容的插件可独立更新;软件升级仅在协议不兼容时协调插件版本。`,`Compatible plugins update independently. App upgrades coordinate plugins only when their protocol is incompatible.`)}),(0,F.jsx)(`p`,{className:Wk.scope,children:u(`停用或卸载前会先保存并关闭相关视图;保存失败时不会继续。`,`Disabling or uninstalling first saves and closes related views; a failed save stops the operation.`)}),M.pendingVersion&&(0,F.jsxs)(`p`,{className:Wk.scope,role:`status`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),M.pendingVersion]}),!de(M)&&M.updateDiagnostic?.status===`up-to-date`&&!M.pendingVersion&&(0,F.jsx)(`p`,{className:Wk.scope,children:u(`兼容版本检查已完成。`,`Compatible release check complete.`)}),(0,F.jsxs)(`div`,{className:Jk.actions,children:[me(M),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>ae(M,`check`),children:u(`检查更新`,`Check updates`)}),M.installed&&(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>ae(M,`uninstall`),children:u(`卸载`,`Uninstall`)}),M.pendingVersion&&(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>A({card:M,operation:`update`,reopen:!0}),children:u(`立即更新并重新打开`,`Update and reopen now`)})]})]})]}):(0,F.jsx)(`ul`,{className:Wk.cards,children:se.map(e=>(0,F.jsxs)(`li`,{className:Wk.card,"data-hosted-card":e.pluginId,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:(0,F.jsx)(Zk,{card:e,size:30})}),(0,F.jsxs)(`div`,{className:Wk.cardMain,children:[(0,F.jsx)(`button`,{className:Wk.cardOpen,type:`button`,onClick:()=>s({id:e.pluginId,name:e.name}),children:ue(e)}),(0,F.jsx)(`p`,{children:le(e)}),(0,F.jsxs)(`small`,{children:[(0,F.jsx)(`span`,{className:Wk.dot,"data-enabled":p&&e.enabled}),_?u(`正在应用…`,`Applying…`):fe(e),!_&&de(e)&&(0,F.jsx)(`span`,{className:Jk.attention,children:u(` · 需要处理`,` · Needs attention`)})]}),e.pendingVersion?(0,F.jsxs)(`small`,{children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),e.pendingVersion]}):e.availableVersion&&e.availableVersion!==e.version&&(0,F.jsxs)(`small`,{children:[u(`可用版本:`,`Available release: `),e.availableVersion]})]}),(0,F.jsxs)(`div`,{className:`${Wk.cardEnd} ${Jk.rowActions}`,children:[me(e),pe(e),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]})]},e.pluginId))}),(0,F.jsx)(OO,{open:ne!==null,onClose:()=>A(null),title:re?.title??``,closeLabel:u(`关闭`,`Close`),description:re?.description,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,onClick:()=>A(null),children:u(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ce,onClick:()=>{ne&&j(ne.card,ne.operation,ne.reopen)},children:re?.confirm})]})})]})}function nA({getPluginManagement:e,togglePlugin:t,generation:n=0,recovery:r}){let i=l(),a=(e,t)=>f(i,e,t),o=e=>typeof e==`string`?e:e[i],[s,c]=(0,P.useState)(null),[u,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(null),[g,v]=(0,P.useState)(!1),[y,b]=(0,P.useState)(1),[x,S]=(0,P.useState)(0),[C,w]=(0,P.useState)(``),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(!0),[k,ee]=(0,P.useState)(``),[te,ne]=(0,P.useState)(``),[A,re]=(0,P.useState)(null),ie=(0,P.useRef)(!1),j=(0,P.useRef)(!1),ae=(0,P.useRef)(n),oe=(0,P.useRef)(!0),M=async(t=!0)=>{if(ie.current)j.current=!0;else{ie.current=!0,O(!0),t&&(ee(``),S(e=>e+1));try{let t=await e();oe.current&&c(t)}catch(e){oe.current&&ee(e instanceof Error?e.message:a(`无法读取插件`,`Could not load plugins`))}finally{ie.current=!1,oe.current&&O(!1),j.current&&oe.current&&(j.current=!1,M(!1))}}};(0,P.useEffect)(()=>(oe.current=!0,M(),()=>{oe.current=!1}),[]),(0,P.useEffect)(()=>{ae.current!==n&&(ae.current=n,M(!1))},[n]);let se=async e=>{if(s&&!ie.current){ie.current=!0,E(e.id),ee(``),ne(``),re(null);try{let n=await t({id:e.id,enabled:!e.enabled,expected:s.revision});oe.current&&(c(n),ne(a(`插件配置已保存并生效`,`Plugin settings saved and applied`)))}catch(e){oe.current&&ee((e instanceof Error?e.message:a(`保存失败`,`Could not save`))+a(`。请刷新确认状态;操作不会自动重试。`,`. Refresh to verify the state; this operation is not retried automatically.`))}finally{ie.current=!1,oe.current&&E(null),j.current&&oe.current&&(j.current=!1,M(!1))}}},le=e=>{e.id===d.terminal&&e.enabled?re(e):se(e)},ue=e=>(0,F.jsx)(`button`,{type:`button`,role:`switch`,className:Wk.switch,"aria-label":a(`启用 ${o(e.name)}`,`Enable ${o(e.name)}`),"aria-checked":e.enabled,disabled:D||T!==null||g||!e.managed,title:e.managed?void 0:a(`请在包与扩展中管理 Pi 运行时`,`Manage the Pi runtime under Packages & extensions`),onClick:()=>le(e),children:(0,F.jsx)(`span`,{className:Wk.thumb})}),de=e=>e.id===d.git?(0,F.jsx)(ce,{size:30}):e.id===d.terminal?(0,F.jsx)(`span`,{children:`›_`}):e.id===d.files?(0,F.jsx)(_,{kind:`folder`,size:30}):e.id===d.diagrams?(0,F.jsx)(Uk,{size:30}):(0,F.jsx)(`span`,{children:`◇`}),fe=s?.items.find(e=>e.id===u),pe=s?.items.filter(e=>`${o(e.name)} ${o(e.description)} ${e.id}`.toLowerCase().includes(C.trim().toLowerCase()))??[];return(0,F.jsxs)(`section`,{className:Wk.page,"data-plugin-panel":!0,"aria-busy":D||T!==null,children:[(0,F.jsxs)(`header`,{className:Wk.pageHead,children:[(0,F.jsxs)(`div`,{children:[(fe||m)&&(0,F.jsx)(`div`,{className:Wk.breadcrumb,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>{p(null),h(null)},children:a(`‹ 插件`,`‹ Plugins`)})}),(0,F.jsx)(`h1`,{children:fe?o(fe.name):m?.name??a(`插件`,`Plugins`)}),(0,F.jsx)(`p`,{children:a(`管理此服务的可选能力,按需启用。`,`Manage optional capabilities on this service.`)})]}),(0,F.jsx)(`button`,{type:`button`,className:Wk.refresh,disabled:D||T!==null||g,onClick:()=>void M(),"aria-label":a(`刷新插件`,`Refresh plugins`),children:D?`…`:`↻`})]}),(0,F.jsx)(`p`,{className:Wk.scope,children:a(`全局设置 · 影响此服务的所有工作区和聊天;所有聊天空闲后才可修改。`,`Global settings · Applies to every workspace and chat on this service. Changes require all chats to be idle.`)}),r,k&&(0,F.jsx)(`p`,{className:Wk.error,role:`alert`,children:k}),te&&(0,F.jsx)(`p`,{className:Wk.notice,role:`status`,children:te}),D&&!s&&(0,F.jsx)(`p`,{role:`status`,children:a(`正在读取插件…`,`Loading plugins…`)}),!s&&!D&&(0,F.jsx)(`button`,{type:`button`,className:Wk.back,onClick:()=>void M(),children:a(`重试`,`Retry`)}),fe?(0,F.jsxs)(`div`,{className:Wk.detail,children:[(0,F.jsxs)(`div`,{className:Wk.detailHead,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:de(fe)}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{children:o(fe.name)}),(0,F.jsx)(`p`,{children:o(fe.description)})]}),ue(fe)]}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:a(`插件标识`,`Plugin ID`)}),(0,F.jsx)(`dd`,{children:(0,F.jsx)(`code`,{children:fe.id})}),(0,F.jsx)(`dt`,{children:a(`来源`,`Source`)}),(0,F.jsx)(`dd`,{children:fe.kind===`builtin`?a(`随应用内置`,`Bundled with the application`):a(`Pi 软件包`,`Pi package`)}),(0,F.jsx)(`dt`,{children:a(`状态`,`Status`)}),(0,F.jsx)(`dd`,{children:fe.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)}),fe.version&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:a(`契约版本`,`Contract version`)}),(0,F.jsx)(`dd`,{children:fe.version})]})]}),(0,F.jsx)(`p`,{className:Wk.scope,children:fe.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.`)}),fe.id===d.git&&(0,F.jsx)(`p`,{className:Wk.scope,children:a(`关闭 Git 面板不禁止 Agent 或其他终端执行系统 git。`,`Disabling the Git panel does not prevent an agent or another terminal from running system git.`)})]}):s&&!m&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`input`,{type:`search`,className:Wk.search,value:C,onChange:e=>w(e.target.value),placeholder:a(`搜索插件`,`Search plugins`),"aria-label":a(`搜索插件`,`Search plugins`)}),[`builtin`,`external`].map(e=>{let t=pe.filter(t=>t.kind===e);return t.length?(0,F.jsxs)(`section`,{className:Wk.group,children:[(0,F.jsxs)(`h2`,{children:[e===`builtin`?a(`内置能力`,`Built-in capabilities`):a(`已安装的 Web 插件`,`Installed Web plugins`),` `,(0,F.jsx)(`span`,{children:t.length})]}),(0,F.jsx)(`ul`,{className:Wk.cards,children:t.map(e=>(0,F.jsxs)(`li`,{className:Wk.card,"data-plugin-package":e.id,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:de(e)}),(0,F.jsxs)(`div`,{className:Wk.cardMain,children:[(0,F.jsx)(`button`,{className:Wk.cardOpen,type:`button`,onClick:()=>p(e.id),children:o(e.name)}),(0,F.jsx)(`p`,{children:o(e.description)}),(0,F.jsxs)(`small`,{children:[(0,F.jsx)(`span`,{className:Wk.dot,"data-enabled":e.enabled}),T===e.id?a(`正在应用…`,`Applying…`):e.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)]})]}),(0,F.jsxs)(`div`,{className:Wk.cardEnd,children:[ue(e),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]})]},e.id))})]},e):null}),!pe.length&&!y&&(0,F.jsx)(`p`,{className:Wk.scope,children:a(`没有匹配的插件`,`No matching plugins`)})]}),(0,F.jsx)(tA,{locale:i,generation:n,reload:x,query:C,selectedId:m?.id??null,visible:!fe,disabled:D||T!==null,onSelect:h,onBusyChange:v,onMatchCountChange:b}),(0,F.jsx)(OO,{open:A!==null,onClose:()=>re(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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:Wk.back,type:`button`,onClick:()=>re(null),children:a(`取消`,`Cancel`)}),(0,F.jsx)(`button`,{className:Wk.danger,type:`button`,onClick:()=>{A&&se(A)},children:a(`停用并结束终端`,`Disable and stop terminals`)})]})})]})}var rA={root:`_root_1ikfi_1`,trigger:`_trigger_1ikfi_2`,glyph:`_glyph_1ikfi_4`,dot:`_dot_1ikfi_5`,srOnly:`_srOnly_1ikfi_6`};function iA(e){let t=Ek();return t?(0,F.jsx)(oA,{...e,controller:t}):(0,F.jsx)(aA,{...e})}function aA(e){let t=Ck(e);return(0,F.jsx)(oA,{...e,controller:t})}function oA({wide:e,hideError:t,controller:n}){let r=l(),i=(e,t)=>f(r,e,t),{status:a,checking:o,installing:s,targetVersion:c,restartTimedOut:u,error:d,install:p}=n;if(Vt(`app-update`,t?null:d&&i(`升级未完成,当前版本和数据已保留。可稍后重试。`,`Update did not finish; the current version and data are retained. You can retry.`),d??void 0,i(`诊断信息`,`Diagnostics`)),!a?.available||!a.canRestart)return null;let m=s?i(`正在升级…`,`Updating…`):c?i(`正在重启…`,`Restarting…`):a.downgrade?i(`切换到稳定版`,`Switch to stable`):i(`下载升级`,`Download updates`),h=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,F.jsxs)(`div`,{className:rA.root,children:[(0,F.jsx)(`div`,{className:`pi-settings-trigger-row ${e?``:`pi-settings-trigger-rail`}`,children:(0,F.jsx)(Xe,{label:h,children:(0,F.jsxs)(`button`,{className:`pi-settings-sidebar ${rA.trigger}`,"data-wide":e,type:`button`,"aria-label":m,disabled:o||s||!!c||u,onClick:()=>{p()},children:[(0,F.jsxs)(`span`,{className:rA.glyph,children:[(0,F.jsx)(_t,{size:e?16:18}),(0,F.jsx)(`span`,{className:rA.dot})]}),e&&(0,F.jsx)(`span`,{children:m})]})})}),(s||c)&&(0,F.jsx)(`span`,{className:rA.srOnly,role:`status`,children:m})]})}var sA={trigger:`_trigger_1s641_2`,item:`_item_1s641_3`};function cA({wide:e}){let t=l(),n=((e,n)=>f(t,e,n))(`帮助与文档`,`Help & documentation`),r=(0,P.useRef)(null),i=(0,P.useRef)(null),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)({top:0,left:0}),u=(e=!0)=>{o(!1),e&&r.current?.focus()};return(0,P.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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Xe,{label:n,disabled:a,children:(0,F.jsx)(`button`,{ref:r,type:`button`,className:`pi-settings-sidebar ${sA.trigger}`,"data-wide":e,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>a?u():o(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),o(!0))},children:(0,F.jsx)(kt,{size:e?16:18})})}),a&&(0,jt.createPortal)((0,F.jsx)(kp,{ref:i,role:`menu`,tabIndex:-1,"aria-label":n,className:kO.menu,style:s,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),u();else if(e.key===`Tab`)u();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:Fk(t).map(e=>(0,F.jsx)(`a`,{role:`menuitem`,href:e.href,target:`_blank`,rel:`noreferrer`,className:`${kO.menuItem} ${kO.menuItemNeutral} ${sA.item}`,onClick:()=>u(!1),children:e.label},e.id))}),document.body)]})}var lA=e=>typeof e==`object`&&!!e&&!Array.isArray(e),uA=e=>typeof e==`string`,dA=e=>typeof e==`boolean`,fA=e=>typeof e==`number`&&Number.isFinite(e),pA=e=>t=>t===null||e(t),mA=e=>t=>Array.isArray(t)&&t.every(e),hA=(e,t,n)=>e[t]===void 0||n(e[t]),gA=(e,t)=>t.every(t=>uA(e[t])),_A=(e,t)=>t.every(t=>hA(e,t,uA));function vA(e){return lA(e)&&gA(e,[`id`,`timestamp`])&&[`user`,`assistant`,`tool`,`notice`].includes(e.role)&&mA(e=>lA(e)&&[`text`,`thinking`,`image`,`toolCall`].includes(e.kind)&&uA(e.text)&&_A(e,[`toolName`,`toolCallId`]))(e.blocks)&&_A(e,[`toolName`,`toolCallId`,`model`,`error`])&&hA(e,`isError`,dA)&&hA(e,`usage`,e=>lA(e)&&[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`,`cost`].every(t=>fA(e[t]))&&hA(e,`reasoning`,fA))}function yA(e){return lA(e)&&e.schemaVersion===1&&gA(e,[`sessionId`,`cwd`,`name`])&&pA(uA)(e.model)&&pA(uA)(e.thinkingLevel)&&mA(uA)(e.thinkingLevels)&&dA(e.idle)&&hA(e,`paused`,dA)&&hA(e,`hasPendingPrompts`,dA)&&hA(e,`promptQueue`,e=>lA(e)&&mA(uA)(e.steering)&&mA(uA)(e.followUp))&&hA(e,`queuedPrompts`,mA(e=>lA(e)&&gA(e,[`id`,`text`])&&Number.isSafeInteger(e.revision)&&e.revision>0&&[`queued`,`sending`].includes(e.status)&&hA(e,`error`,uA)&&mA(e=>lA(e)&&uA(e.name)&&dA(e.image))(e.attachments)))&&pA(e=>lA(e)&&pA(fA)(e.tokens)&&fA(e.contextWindow)&&pA(fA)(e.percent))(e.contextUsage)&&mA(vA)(e.messages)&&mA(e=>lA(e)&&gA(e,[`id`,`pluginId`,`kind`,`timestamp`])&&hA(e,`afterMessageId`,uA))(e.pluginEntries)&&hA(e,`interactions`,mA(e=>lA(e)&&gA(e,[`requestId`,`sessionId`,`pluginId`,`kind`])))&&hA(e,`streaming`,pA(vA))}function bA(e){return lA(e)&&pA(uA)(e.activeId)&&mA(e=>lA(e)&&gA(e,[`id`,`path`,`title`])&&hA(e,`available`,dA))(e.items)&&mA(e=>lA(e)&&gA(e,[`id`,`workspaceId`,`name`,`modified`])&&pA(uA)(e.path)&&hA(e,`idle`,dA))(e.sessions)}function xA(e){return lA(e)&&e.type===`error`&&uA(e.message)&&_A(e,[`errorCode`,`errorId`,`requestId`,`operationId`])&&hA(e,`errorReported`,dA)}function SA(e){if(!lA(e)||!uA(e.type))throw Error(`Invalid stream event`);switch(e.type){case`snapshot`:if(lA(e.session)&&e.session.schemaVersion!==1)throw Error(`Unsupported session schema`);if(yA(e.session))return{type:`snapshot`,session:e.session};throw Error(`Invalid session snapshot`);case`stream`:if(e.message===null||vA(e.message))return{type:`stream`,message:e.message};break;case`workspaces`:if(bA(e.value))return{type:`workspaces`,value:e.value};break;case`shutdown`:if(hA(e,`reconnect`,dA))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(xA(e))return e;break;default:throw Error(`Unsupported stream event`)}throw Error(`Invalid stream event`)}var CA=ve();async function wA(e,n,r){return t(await s(e,{method:`POST`,headers:{Authorization:`Bearer ${CA}`,"Content-Type":`application/json`},body:JSON.stringify(n),signal:r}))}async function TA(e){return t(await s(e,{headers:{Authorization:`Bearer ${CA}`}}))}function EA(){let e=l(),[n,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(null),[c,u]=(0,P.useState)(CA?`connecting`:`missing-token`),[d,f]=(0,P.useState)(``),[p,m]=(0,P.useState)([]),[h,g]=(0,P.useState)(`loading`),[_,v]=(0,P.useState)([]),[y,b]=(0,P.useState)({items:[],activeId:null,sessions:[]}),[x,S]=(0,P.useState)(null),[C,w]=(0,P.useState)([]),[T,E]=(0,P.useState)(0);return(0,P.useEffect)(()=>{if(!CA)return;let e=new AbortController,n,a=!0,c=!1;return(async()=>{for(;a;){let l,d,p=`stream_connect`;try{u(`connecting`);let n=await s(`/api/events`,{headers:{Authorization:`Bearer ${CA}`},cache:`no-store`,signal:e.signal}),{response:m}=n;if(d=n.correlation,m.ok||await t(n),!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`));u(`connected`),he({connection:`connected`}),ye(`stream_connected`,{...d}),f(``),l=m.body.getReader();let h=new TextDecoder,g=``;for(;a;){p=`stream_read`;let{done:e,value:t}=await l.read();if(e)break;p=`stream_event`,g+=h.decode(t,{stream:!0});let n=g.indexOf(`
|
|
61
|
+
`)).text===te.text);(0,P.useEffect)(()=>{te&&(A||n&&n.sessionId!==te.sessionId)&&ne(null)},[te,A,n?.sessionId]);let re=te&&!A&&n?.sessionId===te.sessionId?{id:te.id,role:`user`,timestamp:te.timestamp,blocks:[{kind:`text`,text:te.text},...te.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:te.files}:null,ie=pf(n,i,a,re!==null),j=mf(ff(n,i,a,re!==null),n?.sessionId,n?.activityId),ae=T.flatMap(e=>e.definition.workbench?.toolViews?.flatMap(e=>e.tools)??[]),oe=cp(n?.sessionId,[...n?.messages??[],...re?[re]:[],...i?[i]:[]],ae),M=n===null||oe.messages.length===0&&ie===null,se=async(e,t,r,i)=>{if(!n)return;if(i){await c(e,t,i);return}let a=`pending-${ge()}`;ne({id:a,sessionId:n.sessionId,text:e,files:r,knownIds:new Set(n.messages.map(e=>e.id)),timestamp:new Date().toISOString()});try{await c(e,t)}catch(e){throw ne(e=>e?.id===a?null:e),e}},ce=(0,P.useRef)(null),{scroll:le,content:ue,composer:de,onScroll:fe,onWheel:pe,showLatest:me,returnToLatest:N}=bO(n?.sessionId,!M&&D===`chat`,re?.id),[he,_e]=(0,P.useState)(0);(0,P.useLayoutEffect)(()=>{let e=ce.current;if(!e)return;let t=()=>_e(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let ve=n?.cwd.split(/[\\/]/).filter(Boolean).at(-1)||r(`Pi 工作区`,`Pi workspace`),ye=oe.messages,be=fp(ye),xe=lp(ye);return(0,F.jsxs)(`div`,{ref:ce,className:$t.root,"data-phase":M?`hero`:`active`,style:{"--piw-conversation-column-width":`${he}px`},children:[M&&(0,F.jsx)(`div`,{className:$t.heroTools,children:e}),n&&!M&&(0,F.jsxs)(`header`,{className:$t.header,children:[(0,F.jsxs)(`div`,{className:$t.titleRow,children:[(0,F.jsx)(`div`,{className:$t.titleCluster,children:(0,F.jsx)(`div`,{className:$t.crumbs,children:(0,F.jsx)(`span`,{className:`${$t.crumb} ${$t.crumbCurrent}`,children:n.name||r(`新会话`,`New chat`)})})}),(0,F.jsxs)(`div`,{className:$t.headerActions,children:[e,(0,F.jsx)($e,{state:a===`connected`?n.idle?`done`:`ongoing`:`error`}),(0,F.jsx)(`span`,{className:`pi-header-state`,children:a===`connected`?n.idle?r(`已连接`,`Connected`):r(`运行中`,`Running`):r(`已断开`,`Disconnected`)})]})]}),(0,F.jsxs)(`div`,{className:$t.tabs,role:`tablist`,"aria-label":r(`会话视图`,`Session views`),children:[(0,F.jsx)(`button`,{className:`${$t.tab} ${D===`chat`?$t.tabActive:``}`,role:`tab`,"aria-selected":D===`chat`,type:`button`,onClick:()=>O(`chat`),children:r(`对话`,`Chat`)}),(0,F.jsx)(`button`,{className:`${$t.tab} ${D===`trajectory`?$t.tabActive:``}`,role:`tab`,"aria-selected":D===`trajectory`,type:`button`,onClick:()=>O(`trajectory`),children:r(`轨迹`,`Trajectory`)})]})]}),(0,F.jsx)(`div`,{className:$t.body,children:(0,F.jsxs)(`div`,{ref:le,className:$t.scrollBody,"data-conversation-scroll":``,onScroll:fe,onWheel:pe,children:[!M&&(0,F.jsx)(`div`,{ref:ue,className:$t.viewArea,children:D===`chat`?(0,F.jsx)(`div`,{className:tn.root,children:(0,F.jsx)(`div`,{className:tn.scroll,children:(0,F.jsx)(`div`,{className:tn.column,children:(0,F.jsxs)(F.Fragment,{children:[xe.map(e=>(0,F.jsx)(SO,{turn:e,results:be,model:n?.model??null,loadImage:l,cwd:n?.cwd,renderPluginSlot:C,renderToolView:w,viewTools:ae,artifactTools:T.flatMap(e=>e.definition.artifactTools??[]),running:e===xe.at(-1)&&!n?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==xe.at(-1),onInspect:e=>{ee(e),O(`trajectory`)}},dp(e,ae))),ie&&(0,F.jsx)(df,{state:ie,elapsedSeconds:j})]})})})}):(0,F.jsx)(Dp,{messages:ye,inspectCallId:k})}),(0,F.jsx)(`div`,{ref:de,className:$t.composerSeat,"data-composer-seat":``,children:(0,F.jsxs)(`div`,{className:`${$t.composerStack} ${M?$t.composerHero:``}`,children:[M&&(0,F.jsx)(Qt,{t:e=>({"hero.headline":r(`有什么可以帮你?`,`How can I help?`),"hero.preview":`Pi`})[e]??e,renderSlot:(e,t,n)=>n?.fallback??null}),M&&(0,F.jsx)(`div`,{className:$t.heroWorkspaceRow,children:(0,F.jsxs)(`span`,{className:Zt.workspace,children:[(0,F.jsx)(xt,{size:16}),(0,F.jsx)(`span`,{className:Zt.workspaceLabel,children:ve})]})}),t,(0,F.jsx)(CO,{suspended:t!=null,hero:M,session:n,connection:a,onSend:se,onUpdateQueuedPrompt:S,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,renderPluginSlot:C,plugins:T,onPluginAction:E}),oe.error&&(0,F.jsxs)(`div`,{className:`pi-error`,role:`alert`,children:[oe.error,(0,F.jsx)(`button`,{onClick:oe.retry,children:`Retry view cleanup`})]}),o&&(0,F.jsxs)(`div`,{className:`pi-error pi-error-dismissible`,role:`alert`,children:[(0,F.jsx)(`span`,{children:o}),(0,F.jsx)(`button`,{type:`button`,className:`pi-error-dismiss`,"aria-label":r(`关闭错误`,`Dismiss error`),onClick:s,children:`×`})]})]})}),me&&(0,F.jsx)(`div`,{className:tn.toBottomSlot,children:(0,F.jsx)(`button`,{className:tn.toBottom,type:`button`,"aria-label":r(`回到最新`,`Back to latest`),title:r(`回到最新并继续跟随`,`Back to latest and resume following`),onClick:N,children:(0,F.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M8 2v12m-5-5 5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})})]})})]})}var TO={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 EO({variant:e=`ghost`,size:t=`md`,icon:r,className:i,children:a,...o}){return(0,F.jsxs)(`button`,{type:`button`,className:n(TO.button,TO[e],TO[t],i),...o,children:[r!=null&&(0,F.jsx)(`span`,{className:TO.icon,children:r}),a]})}var DO={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 OO({open:e,onClose:t,title:r,closeLabel:i,description:a,children:o,footer:s,className:c,contentClassName:l,headless:u=!1}){let d=(0,P.useRef)(null);return ze(d,e,t),e?(0,jt.createPortal)((0,F.jsx)(Fe.Provider,{value:d,children:(0,F.jsxs)(`div`,{className:DO.root,role:`presentation`,children:[(0,F.jsx)(`div`,{className:DO.mask,"aria-hidden":`true`,onClick:t}),(0,F.jsx)(`div`,{ref:d,tabIndex:-1,className:n(DO.dialog,c),role:`dialog`,"aria-modal":`true`,"aria-label":r,children:u?o:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:n(DO.content,l),children:[(0,F.jsxs)(`div`,{className:DO.header,children:[(0,F.jsx)(`h2`,{className:DO.title,children:r}),(0,F.jsx)(`button`,{type:`button`,className:DO.close,"aria-label":i,onClick:t,children:(0,F.jsx)(ut,{size:14})})]}),a!==void 0&&a!==``&&(0,F.jsx)(`p`,{className:DO.description,children:a}),o!==void 0&&(0,F.jsx)(`div`,{className:DO.body,children:o})]}),s!==void 0&&(0,F.jsx)(`div`,{className:DO.footer,children:s})]})})]})}),document.body):null}var kO={group:`_group_7dgiw_4`,workspaceLine:`_workspaceLine_7dgiw_5`,workspaceButton:`_workspaceButton_7dgiw_7`,workspaceTitle:`_workspaceTitle_7dgiw_8`,folder:`_folder_7dgiw_9`,folderActive:`_folderActive_7dgiw_10`,unavailable:`_unavailable_7dgiw_11`,chevron:`_chevron_7dgiw_12`,chevronOpen:`_chevronOpen_7dgiw_13`,rowActions:`_rowActions_7dgiw_16`,rowAction:`_rowAction_7dgiw_16`,sessionButton:`_sessionButton_7dgiw_23`,sessionLine:`_sessionLine_7dgiw_24`,sessionTime:`_sessionTime_7dgiw_27`,untitled:`_untitled_7dgiw_31`,renameInput:`_renameInput_7dgiw_32`,error:`_error_7dgiw_38`,menu:`_menu_7dgiw_39`,menuItem:`_menuItem_7dgiw_40`,menuItemNeutral:`_menuItemNeutral_7dgiw_42`,menuHint:`_menuHint_7dgiw_44`};function AO({title:e,active:t,disabled:n,open:i,onOpenChange:a,onRemove:o}){return(0,F.jsx)(MO,{label:r(`${e} 的工作区操作`,`Workspace actions for ${e}`),title:r(`工作区操作`,`Workspace actions`),disabled:n,open:i,onOpenChange:a,items:[{label:r(`从列表移除工作区`,`Remove workspace from list`),icon:(0,F.jsx)(ht,{}),destructive:!0,disabled:t,onSelect:o}],hint:t?r(`请先切换到其他工作区再移除`,`Switch to another workspace before removing`):r(`不删除目录、文件或会话历史`,`Keeps directories, files and session history`)})}function jO({title:e,disabled:t,open:n,onOpenChange:i,onRename:a,onDelete:o}){return(0,F.jsx)(MO,{label:r(`${e} 的会话操作`,`Chat actions for ${e}`),title:r(`会话操作`,`Chat actions`),disabled:t,open:n,onOpenChange:i,items:[{label:r(`重命名`,`Rename`),icon:(0,F.jsx)(pt,{}),onSelect:a},{label:r(`删除会话`,`Delete chat`),icon:(0,F.jsx)(ht,{}),destructive:!0,onSelect:o}]})}function MO({label:e,title:t,disabled:n,open:r,onOpenChange:i,items:a,hint:o}){let s=(0,P.useRef)(null),c=(0,P.useRef)(null),[l,u]=(0,P.useState)({top:0,left:0}),d=(0,P.useRef)({onOpenChange:i});d.current={onOpenChange:i};let f=(e=!0)=>{i(!1),e&&s.current?.focus()};return(0,P.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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{ref:s,type:`button`,className:kO.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,F.jsx)(at,{})}),r&&(0,jt.createPortal)((0,F.jsxs)(kp,{ref:c,role:`menu`,tabIndex:-1,"aria-label":e,className:kO.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,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${kO.menuItem} ${e.destructive?``:kO.menuItemNeutral}`,disabled:n||e.disabled,onClick:()=>{f(),e.onSelect()},children:[e.icon,e.label]},e.label)),o&&(0,F.jsx)(`p`,{className:kO.menuHint,children:o})]}),document.body)]})}function NO(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 PO={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 FO(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 IO=300,LO=200,RO=250;function zO(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 BO(e){return e.home.includes(`\\`)?`\\`:`/`}function VO(e){let t=BO(e);return e.path.endsWith(t)?e.path:`${e.path}${t}`}function HO(e,t){let n=BO(e)===`\\`?Math.max(t.lastIndexOf(`\\`),t.lastIndexOf(`/`)):t.lastIndexOf(`/`);return n===-1?null:t.slice(0,n+1)}function UO(e,t,n){let r=HO(e,t);return r===null?{directory:null,tail:null}:{directory:r,tail:r===VO(e)||n!==null&&n.directory===r&&n.landed===e.path?t.slice(r.length):null}}function WO(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 GO({entries:e,selectedPath:t,busy:r,onPick:i,showHidden:a,filterPrefix:o,pathEditing:s}){let c=WO(e,t,a,o);return(0,F.jsx)(`div`,{className:PO.column,role:`list`,children:c.map(e=>{let a=e.path===t;return(0,F.jsx)(`span`,{role:`listitem`,className:PO.rowSeat,children:(0,F.jsxs)(`button`,{type:`button`,"aria-current":a||void 0,className:n(PO.row,a&&PO.rowSelected),disabled:r,onMouseDown:s?e=>{e.preventDefault()}:void 0,onClick:()=>{i(e)},children:[a?(0,F.jsx)(xt,{size:16,className:PO.rowIconSelected}):(0,F.jsx)(St,{size:16,className:PO.rowIcon}),(0,F.jsx)(`span`,{className:PO.rowName,children:e.name}),(0,F.jsx)(lt,{size:12,className:PO.rowChevron})]})},e.path)})})}function KO({open:e,listDirectory:t,createDirectory:r,onOpen:i,onClose:a,busy:o,t:s}){let[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(null),[f,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(0),[b,x]=(0,P.useState)(null),[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(!1),[E,D]=(0,P.useState)(null),[O,k]=(0,P.useState)(!1),[ee,te]=(0,P.useState)(null),ne=(0,P.useRef)(0),A=(0,P.useRef)(null),re=(0,P.useRef)(0),ie=(0,P.useRef)(null),j=(0,P.useRef)(!1);(0,P.useEffect)(()=>()=>{ne.current+=1,re.current+=1,A.current?.abort()},[]);let ae={onCompositionStart:()=>{j.current=!0},onCompositionEnd:()=>{j.current=!1}},oe=(0,P.useCallback)(()=>(A.current?.abort(),A.current=null,++ne.current),[]),M=(0,P.useCallback)(()=>{_(!1),y(e=>e+1)},[]),se=(0,P.useCallback)(e=>{let n=oe(),r=new AbortController;return A.current=r,M(),{seq:n,scan:t(e,r.signal)}},[oe,M,t]),ce=(0,P.useCallback)(e=>{let n=new AbortController;return A.current=n,M(),t(e,n.signal)},[M,t]),le=(0,P.useRef)(!1),ue=(0,P.useRef)({parent:null,child:null});(0,P.useEffect)(()=>{ue.current={parent:c,child:f}},[c,f]);let de=(0,P.useRef)(null),fe=(0,P.useRef)(!1),pe=(0,P.useCallback)((e,t)=>{let{seq:n,scan:r}=se(e);h(!0),t.announce&&x(null);let i=()=>{h(!1),t.closeEditor?C(null):(x(null),fe.current=!0)};r.then(r=>{if(n!==ne.current)return;!t.closeEditor&&e!==void 0&&(de.current={directory:e,landed:r.path});let a=!1,o=()=>{a||n!==ne.current||(a=!0,l(r),d(null),p(null),i())};if(zO(r,``).length<2){o();return}let s=r.crumbs.at(-2);s===void 0?o():(ce(s.path).then(e=>{if(n!==ne.current)return;let t=BO(e),s=e=>t===`\\`?e.toLowerCase():e,c=e.entries.find(e=>s(e.path)===s(r.path));c===void 0?o():(a=!0,l(e),d(c),p(r),i())},()=>{o()}),t.closeEditor&&window.setTimeout(o,LO))},e=>{n===ne.current&&(h(!1),t.announce&&x(FO(e)))})},[se,ce]),me=(0,P.useCallback)(e=>{pe(e,{closeEditor:!0,announce:!0})},[pe]),N=(0,P.useRef)(!1),he=(0,P.useRef)(!1),ge=(0,P.useRef)(null),_e=(0,P.useRef)(null),ve=(0,P.useCallback)(e=>{let{seq:t,scan:n}=se(e.path);S!==null&&(N.current=!0),C(null),d(e),p(null),h(!0),x(null),n.then(e=>{t===ne.current&&(p(e),h(!1))},e=>{t===ne.current&&(h(!1),x(FO(e)),d(null),he.current=!0)})},[se,S]),ye=(0,P.useCallback)(e=>{pe(e,{closeEditor:!1,announce:!1})},[pe]),be=(0,P.useCallback)(()=>{oe(),h(!1),C(null),x(null),f===null&&d(null),c===null&&me()},[oe,f,c,me]),xe=(0,P.useCallback)(e=>{f!==null&&(l(f),ve(e))},[f,ve]);(0,P.useEffect)(()=>{re.current+=1,e?(l(null),d(null),p(null),k(!1),T(!1),me()):(oe(),h(!1),x(null),C(null),D(null),te(null),N.current=!1,he.current=!1)},[e,me,oe]);let Se=u?.path??c?.path??null,Ce=u?.name??(c===null?``:zO(c,s(`browser.home`)).at(-1)?.name??c.path),we=()=>{if(Se===null||E===null||O)return;let e=E;if(e.trim()===``)return;k(!0),te(null);let t=re.current;r(Se,e).then(n=>{if(t!==re.current)return;k(!1),D(null);let{seq:r,scan:i}=se(Se);h(!0),x(null),i.then(t=>{r===ne.current&&(l(t),h(!1),ve({name:e,path:n,hidden:!1}))},e=>{r===ne.current&&(h(!1),x(FO(e)))})},e=>{t===re.current&&(k(!1),te(FO(e)))})};(0,P.useEffect)(()=>{if(!m){_(!1);return}let e=window.setTimeout(()=>{_(!0)},IO);return()=>{window.clearTimeout(e)}},[m,v]),(0,P.useEffect)(()=>{if(S===null)return;let e=window.setTimeout(()=>{if(le.current)return;let e=ue.current.child??ue.current.parent;if(e===null)return;let{directory:t,tail:n}=UO(e,S,de.current);t!==null&&n===null&&ye(t)},RO);return()=>{window.clearTimeout(e)}},[S,ye]);let Te=f??c,Ee=Te===null||S===null?null:UO(Te,S,de.current).tail,De=Te===null?[]:zO(Te,s(`browser.home`)),Oe=De.at(-1)?.path;(0,P.useEffect)(()=>{let e=ie.current;e!==null&&(e.scrollLeft=e.scrollWidth)},[Oe]);let ke=(0,P.useRef)(null),Ae=f?.path;if((0,P.useEffect)(()=>{let e=ke.current;e!==null&&Ae!==void 0&&(e.scrollLeft=e.scrollWidth)},[Ae]),(0,P.useEffect)(()=>{if(fe.current&&(fe.current=!1,document.activeElement===document.body&&ge.current?.focus()),S===null){if(N.current){N.current=!1,he.current=!1;let e=ke.current;if(e===null)return;let t=e.querySelector(`button[aria-current="true"]`);if(t===null)return;t.focus()}else if(he.current){if(he.current=!1,document.activeElement!==document.body)return;let e=_e.current;if(e===null)return;e.focus()}}}),!e)return null;let je=u!==null,Me=o||E!==null,Ne=S!==null;return(0,F.jsxs)(OO,{open:e,onClose:()=>{E===null&&!o&&a()},title:s(`browser.title`),className:n(PO.dialog),headless:!0,children:[(0,F.jsxs)(`div`,{className:PO.editorScope,onKeyDown:e=>{e.key===`Escape`&&S!==null&&(e.stopPropagation(),he.current=document.activeElement===ge.current,be())},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)||(he.current=!1,be()))},children:[(0,F.jsxs)(`div`,{className:PO.header,children:[(0,F.jsx)(`h2`,{className:PO.title,children:s(`browser.title`)}),(0,F.jsx)(`div`,{className:PO.crumbBar,children:S===null?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:PO.crumbTrail,role:`navigation`,ref:ie,children:De.map((e,t)=>(0,F.jsxs)(`span`,{className:PO.crumbSeat,children:[t>0&&(0,F.jsx)(lt,{size:12,className:PO.crumbChevron}),(0,F.jsx)(`button`,{type:`button`,className:PO.crumb,disabled:Me,onClick:()=>{me(e.path)},children:e.name})]},e.path))}),(0,F.jsx)(`button`,{type:`button`,className:PO.crumbEditZone,"aria-label":s(`browser.editPath`),title:s(`browser.editPath`),disabled:Me,ref:_e,onClick:()=>{if(oe(),h(!1),le.current=!1,c===null){C(``);return}let e=u?.path??c.path,t=BO(c);C(e.endsWith(t)?e:`${e}${t}`)},children:(0,F.jsx)(pt,{size:14,className:PO.crumbEditGlyph})})]}):(0,F.jsx)(`input`,{className:PO.pathInput,value:S,"aria-label":s(`browser.editPath`),autoFocus:!0,ref:ge,disabled:Me,onChange:e=>{oe(),h(!1),le.current=!1,C(e.target.value)},...ae,onKeyDown:e=>{e.key===`Enter`&&!j.current&&(e.preventDefault(),S.trim()!==``&&(he.current=!0,le.current=!0,me(S)))}})})]}),(0,F.jsxs)(`div`,{className:PO.content,children:[(0,F.jsxs)(`div`,{className:PO.millerRow,ref:ke,children:[c!==null&&(0,F.jsx)(GO,{entries:c.entries,selectedPath:u?.path??null,busy:Me,onPick:ve,showHidden:w,filterPrefix:f===null?Ee:null,pathEditing:Ne}),je&&(0,F.jsx)(`span`,{className:PO.divider}),je&&f!==null&&(0,F.jsx)(GO,{entries:f.entries,selectedPath:null,busy:Me,onPick:xe,showHidden:w,filterPrefix:Ee,pathEditing:Ne})]}),m&&g&&(0,F.jsx)(`div`,{className:n(PO.status,PO.loadingFloat),role:`status`,children:s(`browser.loading`)}),(c?.truncated===!0||f?.truncated===!0)&&(0,F.jsx)(`div`,{className:PO.status,role:`status`,children:s(`browser.truncated`)}),b!==null&&(0,F.jsx)(`div`,{className:PO.error,role:`alert`,children:b})]}),(0,F.jsxs)(`div`,{className:PO.footerBar,children:[(0,F.jsx)(EO,{variant:`outline`,icon:(0,F.jsx)(ot,{size:14}),disabled:c===null||m||Me||Ne,onClick:()=>{D(``),te(null)},children:s(`browser.newFolder`)}),(0,F.jsxs)(`button`,{type:`button`,className:n(PO.showHiddenToggle,w&&PO.showHiddenToggleActive),"aria-pressed":w,disabled:Me,onMouseDown:Ne?e=>{e.preventDefault()}:void 0,onClick:()=>{T(e=>!e)},children:[s(`browser.showHidden`),w&&(0,F.jsx)(st,{size:14})]}),(0,F.jsx)(`span`,{className:PO.footerGap}),(0,F.jsx)(EO,{variant:`outline`,className:n(PO.footerAction),disabled:Me,onClick:a,children:s(`browser.cancel`)}),(0,F.jsx)(EO,{variant:`primary`,className:n(PO.footerAction),disabled:Se===null||m||Me||Ne,onClick:()=>{Se!==null&&i(Se)},children:s(`browser.open`)})]})]}),(0,F.jsx)(OO,{open:E!==null,onClose:()=>{O||D(null)},title:s(`browser.newFolder`),className:n(PO.createDialog),headless:!0,children:(0,F.jsxs)(`div`,{className:PO.createBody,children:[(0,F.jsx)(`h3`,{className:PO.createTitle,children:s(`browser.newFolder`)}),(0,F.jsx)(`p`,{className:PO.createIn,children:s(`browser.createIn`,{name:Ce})}),(0,F.jsx)(`input`,{className:PO.createInput,value:E??``,"aria-label":s(`browser.folderName`),placeholder:s(`browser.untitledFolder`),autoFocus:!0,disabled:O,onChange:e=>{D(e.target.value)},...ae,onKeyDown:e=>{e.key===`Enter`&&!j.current&&(e.preventDefault(),we()),e.key===`Escape`&&(e.stopPropagation(),O||D(null))}}),ee!==null&&(0,F.jsx)(`div`,{className:PO.error,role:`alert`,children:ee}),(0,F.jsxs)(`div`,{className:PO.createActions,children:[(0,F.jsx)(EO,{variant:`outline`,disabled:O,onClick:()=>{D(null)},children:s(`browser.cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:O||E===null||E.trim()===``,onClick:we,children:s(`browser.create`)})]})]})})]})}var qO={root:`_root_nvze1_1`,rail:`_rail_nvze1_13`,iconButton:`_iconButton_nvze1_17`,searchButton:`_searchButton_nvze1_33`,clearButton:`_clearButton_nvze1_34`,sectionHeader:`_sectionHeader_nvze1_45`,sectionLabel:`_sectionLabel_nvze1_65`,sectionLabelHidden:`_sectionLabelHidden_nvze1_82`,searchSlot:`_searchSlot_nvze1_91`,searchSlotExpanded:`_searchSlotExpanded_nvze1_105`,headerActions:`_headerActions_nvze1_110`,headerActionsHidden:`_headerActionsHidden_nvze1_126`,search:`_search_nvze1_33`,searchExpanded:`_searchExpanded_nvze1_160`,searchInput:`_searchInput_nvze1_199`,listArea:`_listArea_nvze1_285`,treeBody:`_treeBody_nvze1_305`,fade:`_fade_nvze1_315`,wide:`_wide_nvze1_326`,"wide-in":`_wide-in_nvze1_1`,list:`_list_nvze1_285`,flatList:`_flatList_nvze1_356`,searchTree:`_searchTree_nvze1_357`,groupSection:`_groupSection_nvze1_358`,searchStatus:`_searchStatus_nvze1_362`,searchWarning:`_searchWarning_nvze1_363`,listTopDropIndicator:`_listTopDropIndicator_nvze1_383`,workspaceDropBefore:`_workspaceDropBefore_nvze1_384`,workspaceDropAfter:`_workspaceDropAfter_nvze1_385`,listTopDropActive:`_listTopDropActive_nvze1_419`,sessionOverflowButton:`_sessionOverflowButton_nvze1_431`,empty:`_empty_nvze1_453`,renameInput:`_renameInput_nvze1_460`,renameError:`_renameError_nvze1_479`,deleteAction:`_deleteAction_nvze1_486`,deleteStatus:`_deleteStatus_nvze1_490`},JO={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`},YO=(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 XO({wide:e,navigationBusy:t=!1,connected:n=!0,expandSidebar:i,session:a,workspaces:o,onAdd:s,directoryPickerKind:c,pickDirectory:u,listDirectory:d,createDirectory:f,onRemove:p,onSelectSession:m,onNewSession:h,onRenameSession:g,onDeleteSession:_}){let v=l(),[y,b]=(0,P.useState)(Date.now),[x,S]=(0,P.useState)(null),[C,w]=(0,P.useState)(null),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(``),[k,ee]=(0,P.useState)(null),te=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(!T)return;let e=requestAnimationFrame(()=>{te.current?.focus(),te.current?.select()});return()=>cancelAnimationFrame(e)},[T]),(0,P.useEffect)(()=>{if(!e){S(null),w(null);return}b(Date.now());let t=window.setInterval(()=>b(Date.now()),6e4);return()=>window.clearInterval(t)},[e]);let[ne,A]=(0,P.useState)(!1),[re,ie]=(0,P.useState)(!1),j=re||t,ae=j||!n,oe=(0,P.useId)(),M=(0,P.useRef)(null),[se,ce]=(0,P.useState)(null),[le,ue]=(0,P.useState)(``),[de,fe]=(0,P.useState)(``),[pe,me]=(0,P.useState)(!1),[N,he]=(0,P.useState)(``);(0,P.useEffect)(()=>{he(``)},[a?.sessionId]);let[ge,_e]=(0,P.useState)(new Set);(0,P.useEffect)(()=>{o.activeId&&_e(e=>e.has(o.activeId)?e:new Set([...e,o.activeId]))},[o.activeId,a?.sessionId]),(0,P.useEffect)(()=>{M.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView({block:`nearest`})},[e,a?.sessionId,ge]);let ve=(0,P.useRef)(null),ye=(0,P.useRef)(null),be=N.trim().toLocaleLowerCase(),xe=()=>{he(``),me(!1),ve.current?.focus()},Se=o.items.filter(e=>!be||e.title.toLocaleLowerCase().includes(be)||e.path.toLocaleLowerCase().includes(be)||o.sessions.some(t=>t.workspaceId===e.id&&t.name.toLocaleLowerCase().includes(be))),Ce=async e=>{if(!ae){ie(!0),ue(``);try{await e()}catch(e){ue(e instanceof Error?e.message:r(`操作失败`,`Operation failed`))}finally{ie(!1)}}},we=async e=>{ie(!0);try{await s(e,!1),A(!1)}catch(e){A(!1),fe(e instanceof Error?e.message:String(e))}finally{ie(!1)}},Te=async()=>{if(c!==null){if(e||i(),ue(``),c===`browse`)A(!0);else{ie(!0);try{let e=await u();e!==null&&await we(e)}catch(e){fe(e instanceof Error?e.message:String(e))}finally{ie(!1)}}}};return(0,F.jsxs)(`div`,{ref:M,"aria-busy":j,className:`${qO.root} ${e?``:qO.rail}`,children:[(0,F.jsxs)(`div`,{className:qO.sectionHeader,children:[e&&(0,F.jsx)(`span`,{className:`${qO.sectionLabel} ${qO.wide} ${pe?qO.sectionLabelHidden:``}`,children:r(`工作区`,`Workspaces`)}),e&&(0,F.jsx)(`div`,{className:`${qO.searchSlot} ${pe?qO.searchSlotExpanded:``}`,children:(0,F.jsxs)(`div`,{className:`${qO.search} ${pe?qO.searchExpanded:``}`,onClick:()=>{me(!0),ye.current?.focus()},children:[(0,F.jsx)(`button`,{ref:ve,type:`button`,className:qO.searchButton,"aria-label":r(`搜索工作区和会话`,`Search workspaces and sessions`),"aria-expanded":pe,onClick:()=>{me(!0),ye.current?.focus()},children:(0,F.jsx)(tt,{size:pe?11:14})}),(0,F.jsx)(`input`,{ref:ye,className:qO.searchInput,type:`search`,"aria-label":r(`按名称或工作区路径搜索`,`Search by name or workspace path`),placeholder:r(`按名称或工作区路径搜索`,`Search by name or workspace path`),maxLength:120,value:N,tabIndex:pe?0:-1,onChange:e=>he(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),xe())}}),pe&&(0,F.jsx)(`button`,{type:`button`,className:qO.clearButton,"aria-label":r(`关闭搜索`,`Close search`),onClick:e=>{e.stopPropagation(),xe()},children:(0,F.jsx)(dt,{})})]})}),(0,F.jsx)(`div`,{className:`${qO.headerActions} ${e&&pe?qO.headerActionsHidden:``}`,children:(0,F.jsx)(`button`,{type:`button`,className:qO.iconButton,"aria-label":r(`添加工作区`,`Add workspace`),title:r(`添加工作区`,`Add workspace`),disabled:ae||c===null,onClick:()=>{Te()},children:(0,F.jsx)(bt,{size:e?16:18})})})]}),e&&(0,F.jsx)(`div`,{className:qO.listArea,children:(0,F.jsx)(`div`,{className:qO.treeBody,children:(0,F.jsxs)(`div`,{className:qO.list,role:`list`,"aria-label":r(`工作区`,`Workspaces`),children:[Se.map(e=>{let t=e.id===o.activeId,n=e.available===!1,i=ge.has(e.id)||!!be;return(0,F.jsxs)(`div`,{className:kO.group,role:`listitem`,children:[(0,F.jsxs)(`div`,{className:kO.workspaceLine,"data-menu-open":x===e.id||void 0,children:[(0,F.jsxs)(`button`,{type:`button`,className:`${JO.projectRow} ${kO.workspaceButton}`,"aria-expanded":i,"aria-controls":`${oe}-${e.id}`,title:e.path,disabled:j,onContextMenu:t=>{ae||(t.preventDefault(),t.stopPropagation(),w(null),S(e.id))},onClick:()=>_e(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[(0,F.jsxs)(`span`,{className:JO.slot,"aria-hidden":`true`,children:[(0,F.jsx)(`span`,{"data-workspace-leading":`folder`,className:`${kO.folder} ${t?kO.folderActive:``}`,children:i?(0,F.jsx)(xt,{size:16}):(0,F.jsx)(St,{size:16})}),(0,F.jsx)(`span`,{"data-workspace-leading":`chevron`,className:`${kO.chevron} ${i?kO.chevronOpen:``}`,children:(0,F.jsx)(ct,{size:14})})]}),(0,F.jsx)(`span`,{className:`${JO.title} ${kO.workspaceTitle}`,children:e.title}),n&&(0,F.jsx)(`span`,{className:kO.unavailable,children:r(`不可用`,`Unavailable`)})]}),(0,F.jsxs)(`span`,{className:kO.rowActions,"data-workspace-actions":!0,children:[(0,F.jsx)(AO,{title:e.title,active:t,disabled:ae,open:x===e.id,onOpenChange:t=>S(t?e.id:null),onRemove:()=>{ue(``),ce({id:e.id,title:e.title})}}),(0,F.jsx)(`button`,{type:`button`,className:kO.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:ae||n,onClick:()=>{Ce(async()=>{await h(e.id),he(``),_e(t=>new Set([...t,e.id]))})},children:(0,F.jsx)(et,{size:16})})]})]}),(0,F.jsxs)(`div`,{id:`${oe}-${e.id}`,role:`group`,"aria-label":e.title,hidden:!i,children:[i&&o.sessions.filter(t=>t.workspaceId===e.id&&(!be||e.title.toLocaleLowerCase().includes(be)||e.path.toLocaleLowerCase().includes(be)||t.name.toLocaleLowerCase().includes(be))).map(i=>{let o=t&&a?.sessionId===i.id,s=a?.sessionId===i.id?!a.idle:i.idle===!1,c=i.name||r(`新会话`,`New chat`),l={workspaceId:e.id,id:i.id,path:i.path,name:i.name,running:s};return(0,F.jsxs)(`div`,{className:kO.sessionLine,"data-menu-open":C===i.id||void 0,children:[(0,F.jsxs)(`button`,{type:`button`,className:`${JO.sessionRow} ${kO.sessionButton} ${o?JO.selected:``}`,title:c,"aria-label":c,"aria-describedby":`${oe}-${i.id}-status`,"aria-current":o?`page`:void 0,disabled:ae||n,onContextMenu:e=>{ae||n||(e.preventDefault(),e.stopPropagation(),S(null),w(i.id))},onClick:()=>{Ce(()=>m(e.id,i.id,i.path))},children:[(0,F.jsx)(`span`,{className:JO.slot,children:s&&(0,F.jsx)($e,{state:`ongoing`})}),(0,F.jsx)(`span`,{className:`${JO.title} ${i.name?``:kO.untitled}`,children:c}),(0,F.jsx)(`time`,{className:kO.sessionTime,dateTime:i.modified,title:i.modified,children:NO(i.modified,y,v)}),(0,F.jsx)(`span`,{id:`${oe}-${i.id}-status`,className:JO.visuallyHidden,children:s?r(`运行中`,`Running`):r(`空闲`,`Idle`)})]}),(0,F.jsx)(`span`,{className:kO.rowActions,children:(0,F.jsx)(jO,{title:c,disabled:ae||n,open:C===i.id,onOpenChange:e=>w(e?i.id:null),onRename:()=>{ue(``),O(i.name),E(l)},onDelete:()=>{ue(``),ee(l)}})})]},i.id)}),i&&!be&&!o.sessions.some(t=>t.workspaceId===e.id)&&(0,F.jsx)(`p`,{className:qO.empty,children:r(`还没有会话,创建新会话开始`,`No sessions yet. Create a session to start.`)})]})]},e.id)}),Se.length===0&&(0,F.jsxs)(`p`,{className:qO.empty,role:`status`,children:[be?r(`没有找到匹配的工作区或会话`,`No matching workspaces or sessions`):r(`添加工作区,开始管理对话`,`Add a workspace to start organizing conversations`),be&&(0,F.jsx)(`button`,{type:`button`,className:qO.sessionOverflowButton,onClick:xe,children:r(`清除搜索`,`Clear search`)})]}),j&&(0,F.jsx)(`p`,{className:qO.searchStatus,role:`status`,children:r(`正在处理…`,`Working…`)}),le&&!ne&&(0,F.jsx)(`p`,{className:kO.error,role:`alert`,children:le})]})})}),(0,F.jsxs)(OO,{open:se!==null,onClose:()=>{j||ce(null)},title:r(`移除工作区?`,`Remove workspace?`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>ce(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ae,onClick:()=>{se&&Ce(async()=>{await p(se.id),ce(null)})},children:r(`从列表移除`,`Remove from list`)})]}),children:[(0,F.jsx)(`p`,{children:se?.title}),(0,F.jsx)(`p`,{children:r(`仅从侧栏移除,不删除目录、文件或会话历史。`,`Only removes it from the sidebar. Directories, files and session history are not deleted.`)}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsxs)(OO,{open:T!==null,onClose:()=>{j||E(null)},title:r(`重命名会话`,`Rename chat`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>E(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,type:`submit`,form:`${oe}-rename`,disabled:ae,children:r(`保存`,`Save`)})]}),children:[(0,F.jsx)(`form`,{id:`${oe}-rename`,onSubmit:e=>{e.preventDefault(),T&&Ce(async()=>{await g(T.workspaceId,T.id,T.path,D),E(null)})},children:(0,F.jsx)(`input`,{className:kO.renameInput,"aria-label":r(`会话名称`,`Chat name`),placeholder:r(`留空则使用第一条消息`,`Leave empty to use the first message`),maxLength:120,ref:te,value:D,onChange:e=>O(e.target.value)})}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsxs)(OO,{open:k!==null,onClose:()=>{j||ee(null)},title:r(`删除会话?`,`Delete chat?`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:j,onClick:()=>ee(null),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ae||k?.running,onClick:()=>{k&&Ce(async()=>{await _(k.workspaceId,k.id,k.path),ee(null)})},children:r(`删除`,`Delete`)})]}),children:[(0,F.jsx)(`p`,{children:k?.name||r(`新会话`,`New chat`)}),(0,F.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.`)}),le&&(0,F.jsx)(`p`,{role:`alert`,children:le})]}),(0,F.jsx)(KO,{open:ne,busy:j,listDirectory:d,createDirectory:f,onOpen:e=>{we(e)},onClose:()=>{j||A(!1)},t:YO}),(0,F.jsx)(OO,{open:!!de,onClose:()=>fe(``),title:r(`无法添加工作区`,`Could not add workspace`),closeLabel:r(`关闭`,`Close`),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,onClick:()=>fe(``),children:r(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,onClick:()=>{fe(``),Te()},children:r(`重新选择`,`Choose again`)})]}),children:(0,F.jsx)(`div`,{role:`alert`,children:de})})]})}function ZO(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 QO(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 $O({model:e,position:t,onSave:n,onRemove:i,onCancel:a}){let[o,s]=(0,P.useState)(e.id),[c,l]=(0,P.useState)(e.name??``),[u,d]=(0,P.useState)(QO(e.contextWindow)),[f,p]=(0,P.useState)(QO(e.maxTokens)),[m,h]=(0,P.useState)(e.input?.length?e.input:[`text`]),[g,_]=(0,P.useState)(!e.id),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(!1),[S,C]=(0,P.useState)(``),w=!e.id,T=!w&&(e.source===`custom`||e.overridden),E=async()=>{let e=ZO(u),t=ZO(f);if(!o.trim()||[e,t].some(e=>e!==void 0&&(!Number.isSafeInteger(e)||e<=0)))C(r(`请填写模型 ID,并使用正整数或 K/M 单位填写容量。`,`Enter a model ID and positive token counts, optionally with K/M suffixes.`));else{x(!0),C(``);try{await n({id:o.trim(),...c.trim()?{name:c.trim()}:{},...e===void 0?{}:{contextWindow:e},...t===void 0?{}:{maxTokens:t},input:m})}catch(e){C(e instanceof Error?e.message:r(`保存失败`,`Could not save`))}finally{x(!1)}}},D=async()=>{x(!0),C(``);try{await i()}catch(e){C(e instanceof Error?e.message:r(`操作失败`,`Action failed`)),y(!1)}finally{x(!1)}},O=e=>{h(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length?n:t})};return(0,F.jsxs)(`div`,{className:`pi-model-entry`,children:[(0,F.jsxs)(`div`,{className:`pi-model-row`,children:[(0,F.jsx)(`input`,{"aria-label":`${r(`模型 ID`,`Model ID`)} ${t}`,placeholder:r(`模型 ID`,`Model ID`),value:o,disabled:b||!w&&e.source===`builtin`,onFocus:()=>_(!0),onChange:e=>s(e.target.value)}),(0,F.jsx)(`input`,{"aria-label":`${r(`显示名称`,`Display name`)} ${t}`,placeholder:r(`显示名称`,`Display name`),value:c,disabled:b,onFocus:()=>_(!0),onChange:e=>l(e.target.value)}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`${r(`模型参数`,`Model settings`)} ${t}`,"aria-expanded":g,onClick:()=>_(!g),children:g?`⌄`:`›`})]}),g&&(0,F.jsxs)(`div`,{className:`pi-model-details`,children:[(0,F.jsxs)(`label`,{children:[r(`上下文窗口`,`Context window`),(0,F.jsx)(`input`,{"aria-label":`${r(`上下文窗口`,`Context window`)} ${t}`,inputMode:`decimal`,placeholder:`128K`,value:u,disabled:b,onChange:e=>d(e.target.value)})]}),(0,F.jsxs)(`label`,{children:[r(`最大输出 token 数`,`Max output tokens`),(0,F.jsx)(`input`,{"aria-label":`${r(`最大输出 token 数`,`Max output tokens`)} ${t}`,inputMode:`decimal`,placeholder:`16K`,value:f,disabled:b,onChange:e=>p(e.target.value)})]}),(0,F.jsxs)(`fieldset`,{className:`pi-model-input-types`,children:[(0,F.jsx)(`legend`,{children:r(`输入类型`,`Input types`)}),(0,F.jsxs)(`label`,{children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:m.includes(`text`),disabled:b||m.length===1&&m.includes(`text`),onChange:()=>O(`text`)}),r(`文本`,`Text`)]}),(0,F.jsxs)(`label`,{children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:m.includes(`image`),disabled:b||m.length===1&&m.includes(`image`),onChange:()=>O(`image`)}),r(`图片`,`Image`)]})]}),(0,F.jsxs)(`div`,{className:`pi-model-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>{E()},children:b?r(`保存中…`,`Saving…`):r(`保存模型`,`Save model`)}),w&&a&&(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:a,children:r(`取消`,`Cancel`)}),T&&(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>y(!v),children:e.source===`custom`?r(`移除模型`,`Remove model`):r(`恢复默认`,`Restore default`)})]}),v&&(0,F.jsxs)(`div`,{className:`pi-model-confirm`,children:[(0,F.jsx)(`span`,{children:e.source===`custom`?r(`从配置中移除这个模型?`,`Remove this model from configuration?`):r(`撤销这个模型的自定义参数?`,`Discard this model’s custom settings?`)}),(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>{D()},children:r(`确认`,`Confirm`)}),(0,F.jsx)(`button`,{type:`button`,disabled:b,onClick:()=>y(!1),children:r(`取消`,`Cancel`)})]}),S&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:S})]})]})}function ek({providerId:e,getModels:t,updateModel:n}){let[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(!1),f=async()=>{s(``);try{a(await t(e))}catch(e){throw s(e instanceof Error?e.message:r(`无法读取模型目录`,`Could not load model catalog`)),e}};(0,P.useEffect)(()=>{f().catch(()=>{})},[e]);let p=async t=>{await n(e,t),d(!1),await f().catch(()=>{})},m=i?.models.filter(e=>`${e.id} ${e.name??``}`.toLocaleLowerCase().includes(c.toLocaleLowerCase()))??[];return(0,F.jsxs)(`section`,{className:`pi-provider-models`,"aria-label":r(`模型目录`,`Model catalog`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-models-head`,children:[(0,F.jsx)(`strong`,{children:r(`模型目录`,`Model catalog`)}),(0,F.jsxs)(`span`,{children:[i?.models.length??0,` `,r(`个模型`,`models`)]})]}),i?.baseUrl&&(0,F.jsxs)(`p`,{className:`pi-provider-models-endpoint`,title:i.baseUrl,children:[r(`API 地址`,`API URL`),`: `,i.baseUrl]}),o&&(0,F.jsxs)(`p`,{className:`pi-settings-error`,role:`alert`,children:[o,` `,i&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{f().catch(()=>{})},children:r(`重试读取`,`Retry`)})]}),i?(0,F.jsxs)(F.Fragment,{children:[i.models.length>5&&(0,F.jsx)(`input`,{className:`pi-model-search`,type:`search`,"aria-label":r(`搜索模型`,`Search models`),placeholder:r(`搜索模型`,`Search models`),value:c,onChange:e=>l(e.target.value)}),(0,F.jsx)(`div`,{className:`pi-model-list`,children:m.map((e,t)=>(0,F.jsx)($O,{model:e,position:t+1,onSave:t=>p({action:`save`,originalId:e.id,model:t}),onRemove:()=>p({action:`remove`,id:e.id})},`${e.id}:${e.name}:${e.contextWindow}:${e.maxTokens}:${e.overridden}`))}),m.length===0&&!u&&(0,F.jsx)(`p`,{className:`pi-provider-models-empty`,children:r(`没有匹配的模型`,`No matching models`)}),u&&(0,F.jsx)($O,{model:{id:``,source:`custom`,overridden:!1},position:i.models.length+1,onSave:e=>p({action:`save`,model:e}),onRemove:async()=>d(!1),onCancel:()=>d(!1)},`new`),!u&&(0,F.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>d(!0),children:r(`+ 添加模型`,`+ Add model`)})]}):o?(0,F.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>{f().catch(()=>{})},children:r(`重试读取`,`Retry`)}):(0,F.jsx)(`p`,{role:`status`,children:r(`正在读取模型…`,`Loading models…`)})]})}var tk={id:``,name:``,baseUrl:``,api:`openai-completions`,modelId:``};function nk(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:null}catch{return null}}function rk(){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 ik({provider:e,configured:t,busy:n,getProviderModels:i,updateProviderModel:a,onConnect:o}){let[s,c]=(0,P.useState)(``),[l,u]=(0,P.useState)(``),[d,f]=(0,P.useState)(``),[p,m]=(0,P.useState)(!0),[h,g]=(0,P.useState)(!1),[_,v]=(0,P.useState)(``);(0,P.useEffect)(()=>{let t=!0;return m(!0),i(e.id).then(e=>{t&&(u(e.baseUrl??``),f(e.baseUrl??``),m(!1))}).catch(e=>{t&&(m(!1),v(e instanceof Error?e.message:r(`无法读取 API 地址`,`Could not load API URL`)))}),()=>{t=!1}},[e.id]);let y=async()=>{let n=s.trim(),i=l.trim();if(n||t){if(i&&!nk(i))v(r(`请输入有效的 http 或 https 地址。`,`Enter a valid HTTP or HTTPS URL.`));else{g(!0),v(``);try{i!==d&&(await a(e.id,{action:`base_url`,baseUrl:i||null}),f(i)),n&&(c(``),await o(n))}catch(e){v(e instanceof Error?e.message:r(`保存失败`,`Could not save`))}finally{g(!1)}}}};return(0,F.jsxs)(`form`,{className:`pi-provider-key-form`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,F.jsxs)(`label`,{children:[r(`API Key`,`API key`),(0,F.jsx)(`input`,{type:`password`,autoComplete:`off`,maxLength:16384,value:s,onChange:e=>c(e.target.value),placeholder:t?r(`已配置,输入新值可替换`,`Configured; enter a new key to replace`):r(`输入 API Key`,`Enter API key`)})]}),(0,F.jsxs)(`details`,{className:`pi-provider-advanced`,children:[(0,F.jsx)(`summary`,{children:r(`自定义设置`,`Custom settings`)}),(0,F.jsxs)(`label`,{children:[r(`API 地址(可选)`,`API URL (optional)`),(0,F.jsx)(`input`,{type:`url`,maxLength:2048,value:l,onChange:e=>u(e.target.value),placeholder:r(`使用提供方默认地址`,`Use provider default URL`)})]})]}),(0,F.jsx)(`button`,{type:`submit`,disabled:n||h||p||!s.trim()&&(l.trim()===d||!t),children:h?r(`保存中…`,`Saving…`):t?r(`保存`,`Save`):r(`连接`,`Connect`)}),_&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:_})]})}function ak({setupMode:e=!1,onReturnToConversation:t,getProviders:n,getProviderModels:i,updateProviderModel:a,logoutProvider:o,addCustomProvider:s,startLogin:c,getLogin:l,getActiveLogin:u,respondLogin:d,cancelLogin:f,refreshModels:p}){let[m,h]=(0,P.useState)([]),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(e?`builtin`:null),[b,x]=(0,P.useState)(``),[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(tk),[O,k]=(0,P.useState)(null),[ee,te]=(0,P.useState)(``),[ne,A]=(0,P.useState)(``),[re,ie]=(0,P.useState)(!1),j=(0,P.useRef)(null);(0,P.useEffect)(()=>{e&&y(e=>e??`builtin`)},[e]),(0,P.useEffect)(()=>{let e=!0;return u().then(t=>{e&&t&&k(e=>e??t)}).catch(()=>{}),()=>{e=!1,j.current?.popup?.close()}},[]);let ae=async()=>{h(await n()),_(!0)},oe=async e=>{let t=j.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=nk(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()}j.current=null}}t?.id===e.id&&(e.status===`done`||e.status===`error`||e.status===`cancelled`)&&(t.popup?.close(),j.current=null),k(e),e.status===`done`&&(y(null),C(null),await Promise.all([ae(),p()]))};(0,P.useEffect)(()=>{ae().catch(e=>{_(!0),A(e instanceof Error?e.message:r(`无法读取模型提供方`,`Could not load model providers`))})},[]),(0,P.useEffect)(()=>{if(!O||O.status===`done`||O.status===`error`||O.status===`cancelled`)return;let e=!0,t=window.setInterval(()=>{l(O.id).then(async t=>{e&&await oe(t)}).catch(t=>{e&&A(t instanceof Error?t.message:r(`登录状态不可用`,`Login status is unavailable`))})},700);return()=>{e=!1,window.clearInterval(t)}},[O?.id,O?.status]);let M=re||O?.status===`running`||O?.status===`waiting`,se=m.find(e=>e.id===O?.providerId)?.name,ce=m.filter(e=>e.configured),le=m.filter(e=>!e.configured&&e.methods.length>0),ue=le.find(e=>e.id===b)??(e?le.find(e=>e.id===`openai-codex`)??le.find(e=>e.methods.includes(`oauth`)):void 0)??le.find(e=>e.id===`openai`)??le[0],de=async(e,t,n)=>{j.current=t===`oauth`?{id:null,popup:rk()}:null,ie(!0),A(``),te(``);try{let{id:r}=await c(e,t,n);j.current&&(j.current.id=r),await oe(await l(r))}catch(e){j.current?.popup?.close(),j.current=null,A(e instanceof Error?e.message:r(`无法开始登录`,`Could not start sign-in`)),O||u().then(e=>{e&&k(e)}).catch(()=>{})}finally{ie(!1)}},fe=async e=>{if(O){ie(!0),A(``);try{await d(O.id,e),te(``),await oe(await l(O.id))}catch(e){A(e instanceof Error?e.message:r(`提交失败`,`Submission failed`))}finally{ie(!1)}}},pe=async()=>{ie(!0),A(``);try{await s(E);let e=E.id;await ae(),x(e),y(`builtin`),D(tk)}catch(e){A(e instanceof Error?e.message:r(`无法添加自定义提供方`,`Could not add custom provider`))}finally{ie(!1)}},me=async e=>{ie(!0),A(``);try{await o(e),await ae(),T(null),C(null)}catch(e){A(e instanceof Error?e.message:r(`移除认证失败`,`Could not remove credentials`))}finally{ie(!1)}},N=O?.authorization??(O?.event?.type===`auth_url`||O?.event?.type===`device_code`?O.event:void 0),he=O?.status===`waiting`&&O.prompt&&O.prompt.type!==`select`&&(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ee.trim()&&fe(ee.trim())},children:[(0,F.jsx)(`label`,{htmlFor:`pi-provider-answer`,children:O.prompt.message}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`input`,{id:`pi-provider-answer`,type:O.prompt.type===`secret`?`password`:`text`,autoComplete:`off`,placeholder:O.prompt.placeholder,value:ee,onChange:e=>te(e.target.value)}),(0,F.jsx)(`button`,{type:`submit`,disabled:re||!ee.trim(),children:r(`继续`,`Continue`)})]})]});return(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:e?r(`先连接一个模型`,`Connect a model to begin`):r(`模型`,`Models`)}),(0,F.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.`)}),ne&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:ne}),O&&(0,F.jsxs)(`section`,{className:`pi-provider-flow`,"aria-label":r(`模型登录`,`Model sign-in`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsxs)(`strong`,{children:[r(`模型登录`,`Model sign-in`),se?` · ${se}`:``]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{j.current?.id===O.id&&(j.current.popup?.close(),j.current=null),O.status===`running`||O.status===`waiting`?f(O.id).finally(()=>k(null)):k(null)},children:O.status===`running`||O.status===`waiting`?r(`取消`,`Cancel`):r(`关闭`,`Close`)})]}),O.status===`done`&&(0,F.jsxs)(`div`,{role:`status`,children:[(0,F.jsx)(`p`,{children:r(`已连接。现在可以在会话中选择该提供方的模型。`,`Connected. You can now select this provider’s models in a conversation.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:t,children:r(`返回会话选择模型`,`Return to conversation and choose a model`)})]}),O.status===`error`&&(0,F.jsx)(`p`,{role:`alert`,children:O.error}),O.status===`running`&&!N&&(0,F.jsx)(`p`,{role:`status`,children:r(`正在等待提供方响应…`,`Waiting for the provider…`)}),O.event?.type===`info`&&(0,F.jsxs)(`p`,{children:[O.event.message,O.event.links?.map(e=>{let t=nk(e.url);return t&&(0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e.label??r(`打开链接`,`Open link`)},t)})]}),O.event?.type===`progress`&&N?.type!==`auth_url`&&(0,F.jsx)(`p`,{children:O.event.message}),N?.type===`auth_url`&&(0,F.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.`),` `,nk(N.url)&&(0,F.jsx)(`a`,{href:nk(N.url),target:`_blank`,rel:`noopener noreferrer`,children:r(`打开授权页面`,`Open authorization page`)})]}),N?.type===`device_code`&&(0,F.jsxs)(`p`,{children:[r(`在`,`On the`),` `,nk(N.verificationUri)&&(0,F.jsx)(`a`,{href:nk(N.verificationUri),target:`_blank`,rel:`noopener noreferrer`,children:r(`验证页面`,`verification page`)}),` `,r(`输入代码`,`enter code`),` `,(0,F.jsx)(`code`,{children:N.userCode})]}),O.status===`waiting`&&O.prompt?.type===`select`&&(0,F.jsxs)(`div`,{className:`pi-provider-options`,children:[(0,F.jsx)(`p`,{children:O.prompt.message}),O.prompt.options.map(e=>(0,F.jsxs)(`button`,{type:`button`,disabled:re,onClick:()=>{fe(e.id)},children:[e.label,e.description&&(0,F.jsx)(`small`,{children:e.description})]},e.id))]}),he&&O.prompt?.type===`manual_code`&&N?.type===`auth_url`?(0,F.jsxs)(`details`,{className:`pi-provider-manual-login`,children:[(0,F.jsx)(`summary`,{children:r(`无法自动完成?手动输入授权码`,`Can't finish automatically? Enter an authorization code`)}),he]}):he]}),(0,F.jsxs)(`section`,{className:`pi-provider-list`,"aria-label":r(`已接入的模型提供方`,`Connected model providers`),children:[ce.map(e=>(0,F.jsxs)(`div`,{className:`pi-provider-card`,children:[(0,F.jsxs)(`div`,{className:`pi-provider-card-head`,children:[(0,F.jsxs)(`span`,{className:`pi-provider-name`,children:[e.name,(0,F.jsx)(`span`,{className:`pi-provider-dot`,role:`img`,"aria-label":r(`已配置认证`,`Authentication configured`)}),(0,F.jsx)(`small`,{children:r(`已配置`,`Configured`)})]}),(0,F.jsx)(`button`,{type:`button`,disabled:M,"aria-label":`${r(`编辑`,`Edit`)} ${e.name}`,"aria-expanded":S===e.id,onClick:()=>{y(null),C(S===e.id?null:e.id)},children:r(`编辑`,`Edit`)})]}),S===e.id&&(0,F.jsxs)(`div`,{className:`pi-provider-editor`,children:[e.methods.includes(`api_key`)&&(0,F.jsx)(ik,{provider:e,configured:!0,busy:!!M,getProviderModels:i,updateProviderModel:a,onConnect:t=>de(e.id,`api_key`,t)},e.id),e.methods.includes(`oauth`)&&(0,F.jsx)(`div`,{className:`pi-provider-methods`,children:(0,F.jsx)(`button`,{type:`button`,disabled:!!M,onClick:()=>{de(e.id,`oauth`)},children:r(`网页登录`,`Browser sign-in`)})}),(0,F.jsx)(ek,{providerId:e.id,getModels:i,updateModel:a}),e.storedCredential&&(0,F.jsx)(`div`,{className:`pi-provider-credential-action`,children:(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>T(e.id),children:r(`移除认证`,`Remove credentials`)})}),!e.storedCredential&&(0,F.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.`)}),w===e.id&&(0,F.jsxs)(`div`,{className:`pi-model-confirm`,role:`group`,"aria-label":r(`确认移除认证`,`Confirm credential removal`),children:[(0,F.jsx)(`span`,{children:r(`移除本机保存的认证后,该模型可能无法继续使用。`,`Removing stored credentials may make this provider unavailable.`)}),(0,F.jsx)(`button`,{type:`button`,disabled:re,onClick:()=>{me(e.id)},children:r(`确认移除`,`Remove`)}),(0,F.jsx)(`button`,{type:`button`,disabled:re,onClick:()=>T(null),children:r(`取消`,`Cancel`)})]})]})]},e.id)),g&&ce.length===0&&(0,F.jsx)(`p`,{className:`pi-provider-empty`,children:r(`尚未接入提供方`,`No providers connected yet`)}),!g&&(0,F.jsx)(`p`,{role:`status`,children:r(`正在读取模型提供方…`,`Loading model providers…`)})]}),v===`builtin`&&(0,F.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":r(`添加提供方`,`Add provider`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsx)(`strong`,{children:r(`添加提供方`,`Add provider`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>y(null),children:r(`关闭`,`Close`)})]}),ue?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`label`,{htmlFor:`pi-provider-select`,children:r(`提供方`,`Provider`)}),(0,F.jsx)(`select`,{id:`pi-provider-select`,value:ue.id,onChange:e=>x(e.target.value),children:le.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.name},e.id))}),ue.methods.includes(`api_key`)&&(0,F.jsx)(ik,{provider:ue,configured:!1,busy:!!M,getProviderModels:i,updateProviderModel:a,onConnect:e=>de(ue.id,`api_key`,e)},ue.id),ue.methods.includes(`oauth`)&&(0,F.jsx)(`div`,{className:`pi-provider-methods`,children:(0,F.jsx)(`button`,{type:`button`,disabled:!!M,onClick:()=>{de(ue.id,`oauth`)},children:r(`网页登录`,`Browser sign-in`)})}),(0,F.jsx)(`p`,{children:r(`认证完成后,可在提供方的“编辑”中调整模型目录。`,`After sign-in, open the provider’s Edit panel to adjust its model catalog.`)})]}):(0,F.jsx)(`p`,{children:r(`没有可添加的提供方。`,`No providers can be added.`)})]}),v===`custom`&&(0,F.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":r(`添加自定义提供方`,`Add custom provider`),children:[(0,F.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,F.jsx)(`strong`,{children:r(`添加自定义提供方`,`Add custom provider`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>y(null),children:r(`关闭`,`Close`)})]}),(0,F.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,F.jsxs)(`form`,{className:`pi-provider-custom-form`,onSubmit:e=>{e.preventDefault(),pe()},children:[(0,F.jsxs)(`label`,{children:[r(`名称`,`Name`),(0,F.jsx)(`input`,{required:!0,maxLength:100,value:E.name,onChange:e=>D({...E,name:e.target.value}),placeholder:r(`我的模型服务`,`My model service`)})]}),(0,F.jsxs)(`label`,{children:[r(`提供方 ID`,`Provider ID`),(0,F.jsx)(`input`,{required:!0,maxLength:64,value:E.id,onChange:e=>D({...E,id:e.target.value}),placeholder:`my-provider`})]}),(0,F.jsxs)(`label`,{children:[r(`接口地址`,`API URL`),(0,F.jsx)(`input`,{required:!0,type:`url`,maxLength:2048,value:E.baseUrl,onChange:e=>D({...E,baseUrl:e.target.value}),placeholder:`https://api.example.com/v1`})]}),(0,F.jsxs)(`label`,{children:[r(`接口协议`,`API protocol`),(0,F.jsxs)(`select`,{value:E.api,onChange:e=>D({...E,api:e.target.value}),children:[(0,F.jsx)(`option`,{value:`openai-completions`,children:`OpenAI Chat Completions`}),(0,F.jsx)(`option`,{value:`openai-responses`,children:`OpenAI Responses`}),(0,F.jsx)(`option`,{value:`anthropic-messages`,children:`Anthropic Messages`})]})]}),(0,F.jsxs)(`label`,{children:[r(`模型 ID`,`Model ID`),(0,F.jsx)(`input`,{required:!0,maxLength:200,value:E.modelId,onChange:e=>D({...E,modelId:e.target.value}),placeholder:`model-name`})]}),(0,F.jsx)(`button`,{type:`submit`,disabled:re,children:r(`保存并继续`,`Save and continue`)})]})]}),!v&&(0,F.jsxs)(`div`,{className:`pi-provider-add-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:!g||le.length===0||M,onClick:()=>{C(null),y(`builtin`),x(``)},children:r(`+ 添加提供方`,`+ Add provider`)}),(0,F.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>{C(null),y(`custom`)},children:r(`+ 添加自定义提供方`,`+ Add custom provider`)})]})]})}var ok=`pi-web-theme`,sk=new Set,ck=window.matchMedia(`(prefers-color-scheme: dark)`),lk=uk();function uk(){try{let e=localStorage.getItem(ok);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function dk(){document.body.toggleAttribute(`data-ds-dark-theme`,lk===`dark`||lk===`system`&&ck.matches)}function fk(){dk(),ck.addEventListener(`change`,dk),window.addEventListener(`storage`,e=>{e.key===ok&&(lk=uk(),dk(),sk.forEach(e=>e()))})}function pk(e){lk=e;try{localStorage.setItem(ok,e)}catch{}dk(),sk.forEach(e=>e())}function mk(){return(0,P.useSyncExternalStore)(e=>(sk.add(e),()=>{sk.delete(e)}),()=>lk)}var hk={group:`_group_8jvbt_4`,title:`_title_8jvbt_12`,cubeRow:`_cubeRow_8jvbt_19`,themeCube:`_themeCube_8jvbt_29`,selected:`_selected_8jvbt_48`};function gk(){let e=mk(),t=l(),r=[{id:`light`,label:t===`zh`?`浅色`:`Light`,Icon:Ct},{id:`dark`,label:t===`zh`?`深色`:`Dark`,Icon:wt},{id:`system`,label:t===`zh`?`跟随系统`:`System`,Icon:Tt}];return(0,F.jsxs)(`div`,{className:hk.group,children:[(0,F.jsx)(`div`,{className:hk.title,children:t===`zh`?`外观`:`Appearance`}),(0,F.jsx)(`div`,{className:hk.cubeRow,children:r.map(({id:t,label:r,Icon:i})=>(0,F.jsxs)(`button`,{type:`button`,className:n(hk.themeCube,e===t&&hk.selected),"aria-pressed":e===t,onClick:()=>pk(t),children:[(0,F.jsx)(i,{}),r]},t))})]})}var _k={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 vk({label:e,menuLabel:t,value:n,options:r,disabled:i,onChange:a}){let[o,s]=(0,P.useState)(!1),c=(0,P.useId)(),l=(0,P.useRef)(null),u=(0,P.useRef)(null),d=(0,P.useRef)(null);return(0,P.useEffect)(()=>{i&&s(!1)},[i]),(0,P.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,F.jsxs)(`div`,{className:_k.selectorWrap,ref:l,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},children:[(0,F.jsxs)(`button`,{ref:u,type:`button`,className:_k.selector,"aria-label":e,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?c:void 0,disabled:i,onClick:()=>s(e=>!e),children:[(0,F.jsx)(`span`,{className:_k.value,children:r.find(e=>e.id===n)?.label}),(0,F.jsx)(`svg`,{className:_k.chevron,width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,F.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,F.jsx)(`div`,{id:c,className:_k.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,F.jsxs)(`button`,{ref:e.id===n?d:void 0,type:`button`,role:`menuitemradio`,"aria-checked":e.id===n,className:_k.option,onClick:()=>{s(!1),u.current?.focus(),e.id!==n&&a(e.id)},children:[(0,F.jsx)(`span`,{children:e.label}),e.id===n&&(0,F.jsx)(`svg`,{className:_k.chevron,width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m3 8 3.2 3.2L13 4.5`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e.id))})]})}var yk={row:`_row_1rrpk_1`,title:`_title_1rrpk_9`},bk=[{id:`zh`,label:`中文`},{id:`en`,label:`English`}];function xk(){let e=l(),t=e===`zh`?`语言`:`Language`;return(0,F.jsxs)(`div`,{className:yk.row,children:[(0,F.jsx)(`div`,{className:yk.title,children:t}),(0,F.jsx)(vk,{label:t,menuLabel:e===`zh`?`选择语言`:`Choose language`,value:e,options:bk,onChange:i})]})}function Sk(e,t,n){return e instanceof m&&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?e.message:n===`check`?t===`zh`?`检查更新失败`:`Could not check for updates`:t===`zh`?`升级失败`:`Update failed`}function Ck({getUpdate:e,getRunningVersion:t,setUpdateChannel:n,cancelUpdate:r,update:i}){let a=l(),[o,s]=(0,P.useState)(null),[c,u]=(0,P.useState)(!0),[d,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(``),S=(0,P.useRef)(!1),C=(0,P.useRef)(!1),w=(0,P.useRef)(0),T=(0,P.useRef)(!0);(0,P.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]);let E=async()=>{let t=++w.current;u(!0),x(``);try{let n=await e();T.current&&t===w.current&&s(n)}catch(e){T.current&&t===w.current&&(s(null),x(Sk(e,a,`check`)))}finally{T.current&&t===w.current&&u(!1)}};return(0,P.useEffect)(()=>{E();let e=()=>{E()};return window.addEventListener(`pi-update-channel`,e),()=>{window.removeEventListener(`pi-update-channel`,e)}},[]),(0,P.useEffect)(()=>{if(!g)return;let e=!1,n=new AbortController,r,i=setTimeout(()=>{e=!0,n.abort(),clearTimeout(r),_(null),y(!0),x(f(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.`)),_e(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===g){clearTimeout(i),location.reload();return}}catch{}e||(r=setTimeout(()=>{o()},1200))};return r=setTimeout(()=>{o()},1200),()=>{e=!0,n.abort(),clearTimeout(r),clearTimeout(i)}},[g]),{status:o,checking:c,installing:d,cancelling:m,targetVersion:g,restartTimedOut:v,error:b,check:E,install:async()=>{if(S.current||c||!o?.available||!o.canRestart||g||v||o.downgrade&&!window.confirm(f(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;S.current=!0,p(!0),x(``);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(f(a,`${n.message}。\n\n仍然升级?`,`${n.message}.\n\nUpdate anyway?`)))return;e=await i({...t,force:!0})}T.current&&_(e.version)}catch(t){T.current&&x(Sk(t,a,`install`));try{let t=await e();T.current&&s(t)}catch{}}finally{S.current=!1,T.current&&p(!1)}},changeChannel:async e=>{if(!(!n||c||d||g)){++w.current,u(!0),x(``);try{await n(e),window.dispatchEvent(new Event(`pi-update-channel`))}catch(e){T.current&&(u(!1),x(Sk(e,a,`check`)))}}},cancel:async()=>{if(!(!r||C.current||g)){C.current=!0,h(!0),x(``);try{await r(),y(!1),await E()}catch(e){T.current&&x(Sk(e,a,`install`))}finally{C.current=!1,T.current&&h(!1)}}}}}var wk=(0,P.createContext)(null);function Tk({actions:e,children:t}){let n=Ck(e);return(0,F.jsx)(wk.Provider,{value:n,children:t})}function Ek(){return(0,P.useContext)(wk)}function Dk(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 Ok={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 kk(e){let t=Ek();return t?(0,F.jsx)(jk,{...e,controller:t}):(0,F.jsx)(Ak,{...e})}function Ak(e){let t=Ck(e);return(0,F.jsx)(jk,{...e,controller:t})}function jk(e){let t=l(),n=(e,n)=>f(t,e,n),{status:r,checking:i,installing:a,cancelling:o,targetVersion:s,restartTimedOut:c,error:u,check:d,install:p,changeChannel:m,cancel:h}=e.controller,g=Dk(navigator.userAgent),_=!(!r?.latest||r.available||i),v=r?(0,F.jsxs)(F.Fragment,{children:[n(`当前版本`,`Current version`),` `,r.current,r.available&&r.latest?` → ${r.latest}`:_&&(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(`span`,{role:`status`,children:n(`已是最新版本`,`Up to date`)})]})]}):i?n(`正在读取版本…`,`Reading version…`):n(`暂时无法读取版本`,`Version unavailable`),y=!!(g&&r?.desktopShell&&String(g.build)!==r.desktopShell.build)||!!(r?.launcherHandoff?.required||r?.requiresDesktopUpgrade||r?.launcher&&!r.launcher.releaseChannels),b=!!(g||r?.launcher||r?.desktopShell);return(0,F.jsxs)(`section`,{className:Ok.group,"aria-label":n(`应用更新`,`App updates`),children:[r?.channel&&e.setUpdateChannel&&(0,F.jsxs)(`div`,{className:Ok.preference,children:[(0,F.jsx)(`div`,{className:Ok.title,children:n(`更新偏好`,`Update preference`)}),(0,F.jsx)(vk,{label:n(`更新偏好`,`Update preference`),menuLabel:n(`选择更新偏好`,`Choose update preference`),value:r.channel,disabled:i||a||!!s||c,onChange:e=>{m(e)},options:[{id:`stable`,label:n(`稳定版(推荐)`,`Stable (recommended)`)},{id:`alpha`,label:n(`体验版(包含 alpha)`,`Preview (including alpha)`)}]})]}),r?.channel===`alpha`&&(0,F.jsx)(`p`,{className:Ok.note,children:n(`体验版包含尚在验证的新功能,可能不稳定。`,`Preview releases include features still under testing and may be unstable.`)}),(0,F.jsxs)(`div`,{className:Ok.row,children:[(0,F.jsxs)(`div`,{className:Ok.details,children:[(0,F.jsx)(`div`,{className:Ok.title,children:n(`应用更新`,`App updates`)}),(0,F.jsx)(`p`,{className:Ok.summary,children:v})]}),(0,F.jsxs)(`div`,{className:Ok.actions,children:[r?.available&&r.canRestart&&!s&&!c&&(0,F.jsx)(EO,{variant:`primary`,disabled:a||i,onClick:()=>{p()},children:a?n(`正在安装…`,`Installing…`):r.downgrade?n(`切换到稳定版并重启`,`Switch to stable and restart`):n(`升级并重启`,`Update and restart`)}),(r?.recovery?.canCancel||a)&&e.cancelUpdate&&!s&&(0,F.jsx)(EO,{variant:`outline`,disabled:o,onClick:()=>{h()},children:o?n(`正在取消…`,`Cancelling…`):a?n(`取消下载`,`Cancel download`):n(`取消未完成的升级`,`Cancel unfinished update`)}),(0,F.jsx)(EO,{variant:`outline`,disabled:i||a||!!s,onClick:()=>{d()},children:i?n(`检查中…`,`Checking…`):n(`检查更新`,`Check for updates`)})]})]}),r?.launcherHandoff?.required&&(0,F.jsxs)(`div`,{className:Ok.note,children:[(0,F.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.`)}),g?.handoff?(0,F.jsx)(`a`,{href:`pi-desktop://launcher-handoff`,target:`_blank`,rel:`noreferrer`,children:n(`安全切换到当前桌面启动器…`,`Safely switch to this desktop launcher…`)}):(0,F.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,F.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,F.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,F.jsxs)(`div`,{className:Ok.note,children:[(0,F.jsx)(`p`,{children:n(`以下插件在新版本中暂时不可用(不影响升级,数据保留):`,`These plugins will be unavailable on the new version (the update is not blocked; their data is kept):`)}),(0,F.jsx)(`ul`,{children:r.pluginWarnings.map(e=>(0,F.jsxs)(`li`,{children:[e.pluginId,`: `,e.message]},e.pluginId))})]}),r?.lastFailure&&!a&&!s&&(0,F.jsxs)(`p`,{className:Ok.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,F.jsx)(`p`,{className:Ok.note,children:r.reason}),r?.requiresDesktopUpgrade&&(0,F.jsxs)(`p`,{className:Ok.note,children:[(0,F.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,F.jsx)(`p`,{className:Ok.note,role:`status`,children:n(`正在重启并等待新版连接…`,`Restarting and waiting for the new version…`)}),u&&(0,F.jsx)(`p`,{className:Ok.error,role:`alert`,children:u}),u?.includes(`Missing view flush acknowledgement`)&&(0,F.jsx)(`p`,{className:Ok.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.`)}),b&&(0,F.jsxs)(`details`,{className:Ok.diagnostics,open:y,children:[(0,F.jsx)(`summary`,{children:n(`版本详情`,`Version details`)}),g&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`当前桌面窗口`,`Current desktop window`),` `,g.version,` · build `,g.build]}),r?.launcher&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`后台启动器`,`Backend launcher`),` `,r.launcher.version,` · `,n(`体验版持久化`,`Preview persistence`),` `,r.launcher.releaseChannels?n(`支持`,`supported`):n(`不支持`,`unsupported`)]}),r?.desktopShell&&(0,F.jsxs)(`p`,{className:Ok.summary,children:[n(`后台启动时的桌面外壳`,`Desktop shell at backend startup`),` `,r.desktopShell.version,` · build `,r.desktopShell.build]}),r?.desktopShell&&(0,F.jsx)(`p`,{className:Ok.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 Mk=`https://pi.emath.top`,Nk=`https://github.com/chengzhiyi/pi-webapp/issues`;function Pk(e,t){let n={home:``,quickStart:`getting-started`,troubleshooting:`troubleshooting`}[e];return`${Mk}/${String(t).toLowerCase().startsWith(`zh`)?`zh/`:``}${n}`}function Fk(e){let t=(t,n)=>f(e,t,n);return[{id:`docs`,label:t(`使用文档`,`Documentation`),href:Pk(`home`,e)},{id:`quick-start`,label:t(`快速开始`,`Quick start`),href:Pk(`quickStart`,e)},{id:`troubleshooting`,label:t(`故障排查`,`Troubleshooting`),href:Pk(`troubleshooting`,e)},{id:`issues`,label:t(`在 GitHub 上反馈问题`,`Report an issue on GitHub`),href:Nk}]}var Ik={row:`_row_wp8ea_1`,title:`_title_wp8ea_9`,summary:`_summary_wp8ea_15`,links:`_links_wp8ea_22`};function Lk(){let e=l(),t=(t,n)=>f(e,t,n);return(0,F.jsxs)(`section`,{className:Ik.row,"aria-label":t(`帮助与文档`,`Help & documentation`),children:[(0,F.jsx)(`div`,{className:Ik.title,children:t(`帮助与文档`,`Help & documentation`)}),(0,F.jsx)(`p`,{className:Ik.summary,children:t(`查看使用指南、快速开始和常见问题的解决方法。`,`Read the guides, get started quickly, and find fixes for common problems.`)}),(0,F.jsx)(`ul`,{className:Ik.links,children:Fk(e).map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,children:e.label})},e.id))})]})}var Rk={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 zk(e){return e===`general`?(0,F.jsx)(rt,{className:Rk.navIcon,size:16}):e===`models`?(0,F.jsx)(Et,{className:Rk.navIcon,size:16}):e===`packages`?(0,F.jsx)(At,{className:Rk.navIcon,size:16}):e===`plugins`||e===`extensions`?(0,F.jsx)(yt,{className:Rk.navIcon,size:16}):(0,F.jsx)(Ot,{className:Rk.navIcon,size:16})}function Bk({title:e,sections:t,activeId:n,onSelect:r,onClose:i,children:a}){let o=l(),s=(0,P.useId)(),c=(0,P.useRef)(null);return(0,P.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,F.jsxs)(`div`,{className:Rk.overlay,role:`presentation`,children:[(0,F.jsx)(`div`,{className:Rk.mask,"aria-hidden":`true`,onClick:i}),(0,F.jsxs)(`div`,{className:Rk.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:[(0,F.jsxs)(`nav`,{className:Rk.nav,"aria-label":o===`zh`?`Pi 设置分类`:`Pi settings sections`,children:[(0,F.jsx)(`div`,{className:Rk.navTitle,id:s,children:e}),(0,F.jsx)(`div`,{className:Rk.navList,children:t.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`${Rk.navCell} ${n===e.id?Rk.active:``}`,"aria-current":n===e.id?`true`:void 0,onClick:()=>r(e.id),children:[zk(e.id),(0,F.jsx)(`span`,{className:Rk.navLabel,children:e.label})]},e.id))})]}),(0,F.jsxs)(`div`,{className:Rk.content,children:[(0,F.jsxs)(`header`,{className:Rk.header,children:[(0,F.jsx)(`div`,{className:Rk.actions}),(0,F.jsx)(`button`,{ref:c,className:Rk.close,type:`button`,onClick:i,"aria-label":o===`zh`?`关闭 Pi 设置`:`Close Pi settings`,children:(0,F.jsx)(ut,{size:14})})]}),(0,F.jsx)(`div`,{className:Rk.options,children:a})]})]})]})}function Vk(e){return/^(?:npm:|git:|https?:\/\/|ssh:\/\/|git@)/i.test(e.trim())}function Hk(e){let t=l(),n=(e,n)=>f(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,u]=(0,P.useState)(null),[d,p]=(0,P.useState)({packages:``,extensions:``,skills:``}),[m,h]=(0,P.useState)(e.setupMode?`models`:`general`),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(!0),[b,x]=(0,P.useState)(``);(0,P.useEffect)(()=>{e.setupMode&&h(`models`)},[e.setupMode]),(0,P.useEffect)(()=>{let e=!0;return o().then(t=>{e&&u(t)}).catch(t=>{e&&x(t instanceof Error?t.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}).finally(()=>{e&&y(!1)}),()=>{e=!1}},[]);let S=async()=>{y(!0),x(``);try{u(await o())}catch(e){x(e instanceof Error?e.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}finally{y(!1)}},C=async(e,t,r)=>{_(!0),x(``);try{u(await s(e,`global`,t,r)),t===`add`&&p(t=>({...t,[e]:``}))}catch(e){x(e instanceof Error?e.message:n(`保存失败`,`Save failed`))}finally{_(!1)}},w=r.find(({kind:e})=>e===m),T=w?c?.global[w.kind]??[]:[],E=w?c?.installed?.[w.kind]??[]:[],D=w?d[w.kind].trim():``,O=w?.kind!==`packages`&&Vk(D),k=new Set(c?.installed.packages.map(e=>e.source)??[]),ee=c?.installed.extensions.filter(e=>!k.has(e.source))??[],te=c?.global.packages.filter(e=>!k.has(e))??[],ne=d.extensions.trim(),A=Vk(ne),re=e=>{p(t=>({...t,packages:e})),h(`packages`),x(``)};return(0,F.jsxs)(Bk,{title:n(`Pi 设置`,`Pi Settings`),sections:i,activeId:m,onSelect:e=>{h(e),x(``)},onClose:a,children:[m===`general`&&(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:n(`通用设置`,`General`)}),(0,F.jsx)(`p`,{className:`pi-settings-intro`,children:n(`调整网页的显示方式。`,`Choose how the web interface appears.`)}),(0,F.jsxs)(`div`,{className:`pi-settings-general`,children:[(0,F.jsx)(xk,{}),(0,F.jsx)(gk,{}),(0,F.jsx)(kk,{getUpdate:e.getUpdate,getRunningVersion:e.getRunningVersion,setUpdateChannel:e.setUpdateChannel,cancelUpdate:e.cancelUpdate,update:e.update}),(0,F.jsx)(Lk,{})]})]}),m===`models`&&(0,F.jsx)(ak,{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}),w&&(0,F.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,F.jsx)(`h2`,{children:w.title}),(0,F.jsxs)(`p`,{className:`pi-settings-intro`,children:[w.hint,` `,n(`添加或移除后会重新加载 Pi 资源。`,`Pi resources reload after you add or remove one.`)]}),b&&(0,F.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:b}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`已发现`,`Discovered `)}${w.title}`,children:[(0,F.jsxs)(`h3`,{children:[w.kind===`packages`?n(`已安装的包`,`Installed packages`):n(`已发现的技能`,`Discovered skills`),` `,(0,F.jsx)(`span`,{children:E.length})]}),(0,F.jsx)(`ul`,{children:E.length?E.map(e=>{let t=w.kind===`packages`?c.installed.extensions.filter(t=>t.source===e.source):[];return(0,F.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`strong`,{title:e.name,children:e.name}),(0,F.jsx)(`small`,{title:e.path||e.source,children:e.path||e.source}),t.length>0&&(0,F.jsxs)(`div`,{className:`pi-package-contents`,children:[(0,F.jsx)(`span`,{children:n(`包含扩展`,`Includes extensions`)}),t.map(e=>(0,F.jsx)(`span`,{title:e.path,children:e.name},e.path))]})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[(0,F.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`)]}),w.kind===`packages`&&c.global.packages.includes(e.source)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>{C(`packages`,`remove`,e.source)},children:n(`移除`,`Remove`)})]})]},`${e.path}:${e.source}`)}):(0,F.jsxs)(`li`,{className:`pi-settings-empty`,children:[n(`未发现`,`No `),w.title]})})]}),w.kind===`packages`&&(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`独立扩展`,`Standalone extensions`),children:[(0,F.jsxs)(`h3`,{children:[n(`独立扩展`,`Standalone extensions`),` `,(0,F.jsx)(`span`,{children:ee.length})]}),(0,F.jsx)(`ul`,{children:ee.length?ee.map(e=>(0,F.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`strong`,{title:e.name,children:e.name}),(0,F.jsx)(`small`,{title:e.path,children:e.path})]}),(0,F.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,F.jsx)(`li`,{className:`pi-settings-empty`,children:n(`未发现独立扩展`,`No standalone extensions found`)})})]}),(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`手动配置`,`Configure `)}${w.title}`,children:[(0,F.jsx)(`h3`,{children:w.kind===`packages`?n(`添加包`,`Add package`):n(`手动配置技能`,`Configure skills manually`)}),(w.kind===`packages`?te:T).length>0&&(0,F.jsx)(`ul`,{children:(w.kind===`packages`?te:T).map(e=>(0,F.jsxs)(`li`,{className:`pi-config-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`code`,{title:e,children:e}),w.kind===`packages`&&(0,F.jsx)(`small`,{children:n(`已配置,但未发现安装目录`,`Configured, but installation directory was not found`)}),w.kind!==`packages`&&Vk(e)&&(0,F.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源请在“包与扩展”中添加。`,`Not loaded: add package sources under Packages & extensions.`)})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[w.kind!==`packages`&&Vk(e)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>re(e),children:n(`转到包`,`Go to packages`)}),(0,F.jsx)(`button`,{type:`button`,disabled:g,"aria-label":`${n(`移除`,`Remove`)} ${e}`,onClick:()=>{C(w.kind,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),D&&!O&&C(w.kind,`add`,D)},children:[(0,F.jsx)(`input`,{"aria-label":`${n(`添加`,`Add `)}${w.title}`,"aria-invalid":O||void 0,"aria-describedby":O?`pi-config-source-help`:void 0,placeholder:w.placeholder,value:d[w.kind],onChange:e=>p(t=>({...t,[w.kind]:e.target.value}))}),(0,F.jsx)(`button`,{type:`submit`,disabled:g||!D||O,children:n(`添加`,`Add`)})]}),O&&(0,F.jsxs)(`p`,{id:`pi-config-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请在「包」中添加。`,`This is a package source. Add it under Packages.`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>re(D),children:n(`转到包`,`Go to packages`)})]})]}),w.kind===`packages`&&(0,F.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`手动配置扩展路径`,`Configure extension paths manually`),children:[(0,F.jsx)(`h3`,{children:n(`扩展路径`,`Extension paths`)}),c.global.extensions.length>0&&(0,F.jsx)(`ul`,{children:c.global.extensions.map(e=>(0,F.jsxs)(`li`,{className:`pi-config-item`,children:[(0,F.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,F.jsx)(`code`,{title:e,children:e}),Vk(e)&&(0,F.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源不能作为扩展路径,请在上方添加包。`,`Not loaded: package sources cannot be extension paths. Add the package above.`)})]}),(0,F.jsxs)(`div`,{className:`pi-resource-actions`,children:[Vk(e)&&(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>re(e),children:n(`填入包`,`Use as package`)}),(0,F.jsx)(`button`,{type:`button`,disabled:g,onClick:()=>{C(`extensions`,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ne&&!A&&C(`extensions`,`add`,ne)},children:[(0,F.jsx)(`input`,{"aria-label":n(`添加扩展路径`,`Add extension path`),"aria-invalid":A||void 0,"aria-describedby":A?`pi-extension-source-help`:void 0,placeholder:n(`扩展文件或目录路径`,`Extension file or directory path`),value:d.extensions,onChange:e=>p(t=>({...t,extensions:e.target.value}))}),(0,F.jsx)(`button`,{type:`submit`,disabled:g||!ne||A,children:n(`添加扩展`,`Add extension`)})]}),A&&(0,F.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,F.jsx)(`button`,{type:`button`,onClick:()=>re(ne),children:n(`填入包`,`Use as package`)})]})]})]}):v?(0,F.jsx)(`p`,{role:`status`,children:n(`正在读取设置…`,`Loading settings…`)}):(0,F.jsx)(`button`,{className:`pi-settings-retry`,type:`button`,onClick:()=>{S()},children:n(`重试读取设置`,`Retry loading settings`)})]},w.kind)]})}function Uk({size:e=24}){return(0,F.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,F.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,F.jsx)(`path`,{d:`m5.5 14.5 4 4M8 15l8-8`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]})}var Wk={page:`_page_1bt34_2`,pageHead:`_pageHead_1bt34_4`,breadcrumb:`_breadcrumb_1bt34_7`,refresh:`_refresh_1bt34_8`,back:`_back_1bt34_8`,danger:`_danger_1bt34_8`,scope:`_scope_1bt34_12`,error:`_error_1bt34_13`,notice:`_notice_1bt34_13`,search:`_search_1bt34_16`,group:`_group_1bt34_17`,cards:`_cards_1bt34_20`,card:`_card_1bt34_20`,artwork:`_artwork_1bt34_23`,cardMain:`_cardMain_1bt34_24`,cardOpen:`_cardOpen_1bt34_25`,dot:`_dot_1bt34_31`,cardEnd:`_cardEnd_1bt34_33`,switch:`_switch_1bt34_34`,thumb:`_thumb_1bt34_36`,detail:`_detail_1bt34_40`,detailHead:`_detailHead_1bt34_41`},Gk={pluginId:`@chengzhiyi/pi-excalidraw`,name:`Excalidraw`,official:!0,icon:`drawing`,installed:!1,enabled:!1,phase:`not-installed`};async function Kk(e,t,n){let r=ve(),{response:i}=await s(`/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 qk={catalog:e=>Kk(``,void 0,e),manage:e=>Kk(`/manage`,e),action:e=>Kk(`/action`,e),decide:(e,t)=>Kk(`/approvals`,{id:e,decision:t}),secret:(e,t,n)=>Kk(`/secrets`,{pluginId:e,name:t,value:n}),signIn:e=>Kk(`/secrets`,e),pendingViews:e=>Kk(`/views`,{operation:`list-pending`,pluginId:e}),view:(e,t)=>Kk(`/views`,e,t)},Jk={section:`_section_1qkpy_1`,attention:`_attention_1qkpy_5`,notice:`_notice_1qkpy_6`,error:`_error_1qkpy_7`,actions:`_actions_1qkpy_8`,configuration:`_configuration_1qkpy_13`,rowActions:`_rowActions_1qkpy_14`};function Yk({pluginId:e,t}){let[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(0);(0,P.useEffect)(()=>{let t=!0;return qk.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 qk.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,F.jsxs)(`div`,{className:Jk.error,"data-pending-views":!0,children:[(0,F.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,F.jsxs)(`div`,{children:[(0,F.jsxs)(`code`,{children:[e.kind,` · `,e.mountId,` · `,t(`会话`,`session`),` `,e.sessionId,e.dirty||e.busy?` · ${t(`有未确认修改`,`unconfirmed edits`)}`:``]}),` `,i===e.viewToken?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(e),children:t(`确认丢弃`,`Confirm discard`)}),` `,(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(null),children:t(`取消`,`Cancel`)})]}):(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(e.viewToken),children:t(`丢弃此视图`,`Discard this view`)})]},e.viewToken)),o&&(0,F.jsx)(`p`,{role:`alert`,children:o})]})}function Xk({size:e=24}){return(0,F.jsx)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,style:{display:`block`,flexShrink:0},children:(0,F.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z`})})}function Zk({card:e,size:t=24}){let n=e.icon??(e.pluginId===Gk.pluginId?Gk.icon:void 0);return(0,F.jsx)(n===`drawing`?Uk:n===`github`?Xk:fe,{size:t})}function Qk(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 $k({card:e,t,onCatalog:n,disabled:r}){let[i,a]=(0,P.useState)({}),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(!1),f=(0,P.useRef)(!0);if((0,P.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]),(0,P.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 qk.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 qk.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 qk.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 tf(e))},g=e=>{window.open(e.verificationUri,`_blank`,`noopener,noreferrer`),h(e.userCode)},_=()=>{c&&qk.signIn({auth:`cancel`,deviceId:c.deviceId}).catch(()=>{}),l(null)};return(0,F.jsxs)(`section`,{className:Jk.configuration,children:[(0,F.jsx)(`h2`,{children:t(`GitHub 授权`,`GitHub authorization`)}),(0,F.jsx)(`p`,{className:Wk.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,F.jsxs)(`div`,{className:Jk.configuration,children:[(0,F.jsxs)(`div`,{className:Jk.actions,children:[(0,F.jsx)(`span`,{role:`status`,children:e.configured?t(`已授权`,`Authorized`):t(`未授权`,`Not authorized`)}),e.signIn===`browser`&&(0,F.jsx)(EO,{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,F.jsx)(EO,{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,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void p(e.name,null),children:t(`移除`,`Remove`)})]}),c?.name===e.name&&(0,F.jsxs)(`div`,{className:Wk.scope,role:`status`,children:[(0,F.jsxs)(`ol`,{style:{margin:0,paddingLeft:20,display:`grid`,gap:10},children:[(0,F.jsxs)(`li`,{children:[t(`复制下面的验证码`,`Copy this code`),(0,F.jsxs)(`div`,{className:Jk.actions,style:{marginTop:6},children:[(0,F.jsx)(`code`,{style:{fontSize:28,letterSpacing:4,fontWeight:600,padding:`6px 14px`,border:`1px solid currentColor`,borderRadius:8,userSelect:`all`},children:c.userCode}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,onClick:()=>void h(c.userCode),children:u?t(`已复制`,`Copied`):t(`复制`,`Copy`)})]})]}),(0,F.jsxs)(`li`,{children:[t(`打开 GitHub 授权页,粘贴验证码并点击 Authorize`,`Open GitHub, paste the code and click Authorize`),(0,F.jsx)(`div`,{className:Jk.actions,style:{marginTop:6},children:(0,F.jsx)(EO,{size:`sm`,onClick:()=>g(c),children:t(`复制验证码并打开 GitHub`,`Copy code and open GitHub`)})})]})]}),(0,F.jsxs)(`div`,{className:Jk.actions,style:{marginTop:10},children:[(0,F.jsx)(`span`,{children:t(`等待授权中… 完成后这里会自动更新。`,`Waiting for authorization… this updates automatically.`)}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,onClick:_,children:t(`取消`,`Cancel`)})]})]}),(0,F.jsxs)(`details`,{open:e.signIn===`token-page`&&!e.configured,children:[(0,F.jsx)(`summary`,{children:e.signIn===`token-page`?t(`创建后在此粘贴令牌(仅限目标仓库的 fine-grained token,Issues、Pull requests、Contents 读写)`,`Paste the token here after creating it (fine-grained, limited to the target repository, Issues / Pull requests / Contents read-write)`):t(`改用手动粘贴令牌`,`Paste a token instead`)}),(0,F.jsxs)(`div`,{className:Jk.actions,children:[(0,F.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,F.jsx)(EO,{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,F.jsx)(`p`,{role:`status`,className:Wk.scope,children:o})]})}function eA(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 tA({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,P.useState)({plugins:[Gk],offline:!0}),[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!0),[_,v]=(0,P.useState)(!1),y=(0,P.useRef)(!1),b=(0,P.useRef)(0),x=(0,P.useRef)(new Set);(0,P.useEffect)(()=>{for(let e of d.plugins)e.installed&&x.current.add(e.pluginId)},[d]);let[S,C]=(0,P.useState)(null),[w,T]=(0,P.useState)(null),[E,D]=(0,P.useState)(null),[O,k]=(0,P.useState)(``),[ee,te]=(0,P.useState)(0),[ne,A]=(0,P.useState)(null),re=ne?Qk(ne.operation,e,ne.card.name):null,ie=e=>({message:e instanceof Error?e.message:String(e),code:e?.code});(0,P.useEffect)(()=>{if(y.current)return;let e=++b.current,t=new AbortController;return g(!0),D(null),qk.catalog(t.signal).then(t=>{e===b.current&&(f(t),m(!0),T(null))}).catch(n=>{!t.signal.aborted&&e===b.current&&(T(ie(n)),f(e=>({...e,offline:!0})))}).finally(()=>{e===b.current&&g(!1)}),()=>{t.abort()}},[t,n,ee]);let j=async(e,t,n=!1)=>{if(y.current||o||h)return;y.current=!0,++b.current,A(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),k(``);try{let i=await qk.manage({pluginId:e.pluginId,operation:t,...r?{downloadId:r}:{},...n?{reopenEditors:!0}:{}});f(i),m(!0),T(null),k(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:ie(t)});try{f(await qk.catalog()),m(!0),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch{}}finally{y.current=!1,v(!1),c(!1),C(null)}},ae=(e,t)=>{t===`disable`||t===`uninstall`?A({card:e,operation:t}):j(e,t)},oe=d.plugins.some(e=>e.pluginId===Gk.pluginId)?d.plugins:[...d.plugins,Gk],M=oe.find(e=>e.pluginId===i),se=oe.filter(e=>`${e.name} ${e.pluginId} ${le(e)}`.toLowerCase().includes(r.trim().toLowerCase()));(0,P.useEffect)(()=>{l(se.length)},[se.length,l]);let ce=_||h||o||!p||!!d.offline;function le(t){return t.contribution?.entry.description[e]??t.description?.[e]??(t.pluginId===Gk.pluginId?u(`绘制、编辑手绘图表,并将图稿保存到工作区。`,`Draw and edit hand-drawn diagrams, and save them to your workspace.`):u(`按需下载安装的官方插件。`,`An official plugin available on demand.`))}let ue=e=>`${e.name}${e.official?u(`(官方)`,` (Official)`):``}`,de=e=>E?.id===e.pluginId?E.problem:e.error?{code:e.errorCode,message:e.error}:e.updateDiagnostic?.status===`failed`?e.updateDiagnostic:null,fe=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`),pe=e=>(0,F.jsx)(`button`,{type:`button`,role:`switch`,className:Wk.switch,"aria-label":u(`启用 ${e.name}`,`Enable ${e.name}`),"aria-checked":p&&e.enabled,disabled:ce||!e.installed,title:p?e.installed?void 0:u(`请先下载插件`,`Download the plugin first`):u(`请先读取插件状态`,`Read plugin status first`),onClick:()=>ae(e,e.enabled?`disable`:`enable`),children:(0,F.jsx)(`span`,{className:Wk.thumb})}),me=e=>{let t=de(e),n=!e.installed&&!!t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`].includes(t.code??``);return(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce||n,onClick:()=>ae(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,P.useEffect)(()=>{if(!E||M)return;let e=oe.find(e=>e.pluginId===E.id);zt({key:`hosted-operation-${E.id}`,message:`${e?`${ue(e)}:`:``}${eA(E.problem,!!e?.installed,u)}`,detail:[E.problem.code,E.problem.message].filter(Boolean).join(`: `),detailLabel:u(`诊断信息`,`Diagnostics`)})},[E]),(0,F.jsxs)(`section`,{className:Jk.section,"data-hosted-management":!0,"aria-busy":_||h,style:a?void 0:{display:`none`},children:[!M&&(0,F.jsxs)(`h2`,{children:[u(`官方插件`,`Official plugins`),` `,(0,F.jsx)(`span`,{children:se.length})]}),w&&(0,F.jsxs)(`div`,{role:`alert`,className:Jk.error,children:[u(`无法读取插件状态,请重试。`,`Cannot read plugin status. Please retry.`),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),w.message]}),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:_||h||o,onClick:()=>te(e=>e+1),children:u(`重试`,`Retry`)})]}),d.dev&&(0,F.jsxs)(`div`,{"data-hosted-dev":!0,children:[d.dev.notices.map((e,t)=>(0,F.jsxs)(`div`,{className:e.level===`info`?Jk.notice:Jk.error,role:e.level===`error`?`alert`:`status`,children:[(0,F.jsxs)(`strong`,{children:[u(`开发模式`,`Dev mode`),e.pluginId?` · ${e.pluginId}`:``]}),`: `,e.message]},t)),d.dev.sources.map(e=>(0,F.jsxs)(`p`,{className:Jk.notice,role:`status`,"data-hosted-dev-source":e.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,(0,F.jsx)(`code`,{children:e.root}),` · `,e.state,e.version?` ${e.version}`:``,e.message?` — ${e.message}`:``]},e.pluginId))]}),O&&(0,F.jsx)(`p`,{className:Jk.notice,role:`status`,children:O}),S&&(0,F.jsx)(EO,{variant:`outline`,onClick:()=>{qk.manage({pluginId:S.pluginId,operation:`cancel-download`,downloadId:S.id}).then(()=>k(u(`已请求取消,已完成的安装不会回滚。`,`Cancellation requested; committed installations are not rolled back.`))).catch(e=>D({id:S.pluginId,problem:ie(e)}))},children:u(`取消下载(不回滚已提交安装)`,`Cancel download (no rollback after commit)`)}),M?(0,F.jsxs)(`div`,{className:Wk.detail,"data-hosted-detail":M.pluginId,children:[(0,F.jsxs)(`div`,{className:Wk.detailHead,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:(0,F.jsx)(Zk,{card:M,size:30})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{children:ue(M)}),(0,F.jsx)(`p`,{children:le(M)})]}),pe(M)]}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:u(`插件标识`,`Plugin ID`)}),(0,F.jsx)(`dd`,{children:(0,F.jsx)(`code`,{children:M.pluginId})}),(0,F.jsx)(`dt`,{children:u(`来源`,`Source`)}),(0,F.jsx)(`dd`,{children:u(`按需下载的官方插件`,`Official on-demand package`)}),(0,F.jsx)(`dt`,{children:u(`状态`,`Status`)}),(0,F.jsx)(`dd`,{children:fe(M)}),M.availableVersion&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:u(`可用版本`,`Available release`)}),(0,F.jsx)(`dd`,{children:M.availableVersion})]}),M.pendingVersion&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:u(`待更新版本`,`Pending release`)}),(0,F.jsx)(`dd`,{children:M.pendingVersion})]})]}),((e,t)=>{let n=de(e),r=e.updateDiagnostic;return n?(0,F.jsxs)(`div`,{className:Jk.error,role:`alert`,children:[eA(n,e.installed,u),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),(0,F.jsx)(`code`,{children:n.code}),(0,F.jsx)(`p`,{children:n.message}),r&&(0,F.jsxs)(`p`,{children:[r.checkedAt,` · `,r.hostVersion]}),/lock|owned/i.test(n.message)&&(0,F.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,F.jsx)(Yk,{pluginId:e.pluginId,t:u})]}):null})(M,!0),(0,F.jsx)($k,{card:M,t:u,disabled:ce,onCatalog:e=>{f(e),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}}),(0,F.jsxs)(`section`,{className:Jk.configuration,children:[(0,F.jsx)(`h2`,{children:u(`配置与更新`,`Configuration & updates`)}),(0,F.jsx)(`p`,{className:Wk.scope,children:M.icon===`drawing`||M.pluginId===Gk.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,F.jsx)(`p`,{className:Wk.scope,children:u(`兼容的插件可独立更新;软件升级仅在协议不兼容时协调插件版本。`,`Compatible plugins update independently. App upgrades coordinate plugins only when their protocol is incompatible.`)}),(0,F.jsx)(`p`,{className:Wk.scope,children:u(`停用或卸载前会先保存并关闭相关视图;保存失败时不会继续。`,`Disabling or uninstalling first saves and closes related views; a failed save stops the operation.`)}),M.pendingVersion&&(0,F.jsxs)(`p`,{className:Wk.scope,role:`status`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),M.pendingVersion]}),!de(M)&&M.updateDiagnostic?.status===`up-to-date`&&!M.pendingVersion&&(0,F.jsx)(`p`,{className:Wk.scope,children:u(`兼容版本检查已完成。`,`Compatible release check complete.`)}),(0,F.jsxs)(`div`,{className:Jk.actions,children:[me(M),(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>ae(M,`check`),children:u(`检查更新`,`Check updates`)}),M.installed&&(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>ae(M,`uninstall`),children:u(`卸载`,`Uninstall`)}),M.pendingVersion&&(0,F.jsx)(EO,{variant:`outline`,size:`sm`,disabled:ce,onClick:()=>A({card:M,operation:`update`,reopen:!0}),children:u(`立即更新并重新打开`,`Update and reopen now`)})]})]})]}):(0,F.jsx)(`ul`,{className:Wk.cards,children:se.map(e=>(0,F.jsxs)(`li`,{className:Wk.card,"data-hosted-card":e.pluginId,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:(0,F.jsx)(Zk,{card:e,size:30})}),(0,F.jsxs)(`div`,{className:Wk.cardMain,children:[(0,F.jsx)(`button`,{className:Wk.cardOpen,type:`button`,onClick:()=>s({id:e.pluginId,name:e.name}),children:ue(e)}),(0,F.jsx)(`p`,{children:le(e)}),(0,F.jsxs)(`small`,{children:[(0,F.jsx)(`span`,{className:Wk.dot,"data-enabled":p&&e.enabled}),_?u(`正在应用…`,`Applying…`):fe(e),!_&&de(e)&&(0,F.jsx)(`span`,{className:Jk.attention,children:u(` · 需要处理`,` · Needs attention`)})]}),e.pendingVersion?(0,F.jsxs)(`small`,{children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),e.pendingVersion]}):e.availableVersion&&e.availableVersion!==e.version&&(0,F.jsxs)(`small`,{children:[u(`可用版本:`,`Available release: `),e.availableVersion]})]}),(0,F.jsxs)(`div`,{className:`${Wk.cardEnd} ${Jk.rowActions}`,children:[me(e),pe(e),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]})]},e.pluginId))}),(0,F.jsx)(OO,{open:ne!==null,onClose:()=>A(null),title:re?.title??``,closeLabel:u(`关闭`,`Close`),description:re?.description,footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,onClick:()=>A(null),children:u(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:ce,onClick:()=>{ne&&j(ne.card,ne.operation,ne.reopen)},children:re?.confirm})]})})]})}function nA({getPluginManagement:e,togglePlugin:t,generation:n=0,recovery:r}){let i=l(),a=(e,t)=>f(i,e,t),o=e=>typeof e==`string`?e:e[i],[s,c]=(0,P.useState)(null),[u,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(null),[g,v]=(0,P.useState)(!1),[y,b]=(0,P.useState)(1),[x,S]=(0,P.useState)(0),[C,w]=(0,P.useState)(``),[T,E]=(0,P.useState)(null),[D,O]=(0,P.useState)(!0),[k,ee]=(0,P.useState)(``),[te,ne]=(0,P.useState)(``),[A,re]=(0,P.useState)(null),ie=(0,P.useRef)(!1),j=(0,P.useRef)(!1),ae=(0,P.useRef)(n),oe=(0,P.useRef)(!0),M=async(t=!0)=>{if(ie.current)j.current=!0;else{ie.current=!0,O(!0),t&&(ee(``),S(e=>e+1));try{let t=await e();oe.current&&c(t)}catch(e){oe.current&&ee(e instanceof Error?e.message:a(`无法读取插件`,`Could not load plugins`))}finally{ie.current=!1,oe.current&&O(!1),j.current&&oe.current&&(j.current=!1,M(!1))}}};(0,P.useEffect)(()=>(oe.current=!0,M(),()=>{oe.current=!1}),[]),(0,P.useEffect)(()=>{ae.current!==n&&(ae.current=n,M(!1))},[n]);let se=async e=>{if(s&&!ie.current){ie.current=!0,E(e.id),ee(``),ne(``),re(null);try{let n=await t({id:e.id,enabled:!e.enabled,expected:s.revision});oe.current&&(c(n),ne(a(`插件配置已保存并生效`,`Plugin settings saved and applied`)))}catch(e){oe.current&&ee((e instanceof Error?e.message:a(`保存失败`,`Could not save`))+a(`。请刷新确认状态;操作不会自动重试。`,`. Refresh to verify the state; this operation is not retried automatically.`))}finally{ie.current=!1,oe.current&&E(null),j.current&&oe.current&&(j.current=!1,M(!1))}}},le=e=>{e.id===d.terminal&&e.enabled?re(e):se(e)},ue=e=>(0,F.jsx)(`button`,{type:`button`,role:`switch`,className:Wk.switch,"aria-label":a(`启用 ${o(e.name)}`,`Enable ${o(e.name)}`),"aria-checked":e.enabled,disabled:D||T!==null||g||!e.managed,title:e.managed?void 0:a(`请在包与扩展中管理 Pi 运行时`,`Manage the Pi runtime under Packages & extensions`),onClick:()=>le(e),children:(0,F.jsx)(`span`,{className:Wk.thumb})}),de=e=>e.id===d.git?(0,F.jsx)(ce,{size:30}):e.id===d.terminal?(0,F.jsx)(`span`,{children:`›_`}):e.id===d.files?(0,F.jsx)(_,{kind:`folder`,size:30}):e.id===d.diagrams?(0,F.jsx)(Uk,{size:30}):(0,F.jsx)(`span`,{children:`◇`}),fe=s?.items.find(e=>e.id===u),pe=s?.items.filter(e=>`${o(e.name)} ${o(e.description)} ${e.id}`.toLowerCase().includes(C.trim().toLowerCase()))??[];return(0,F.jsxs)(`section`,{className:Wk.page,"data-plugin-panel":!0,"aria-busy":D||T!==null,children:[(0,F.jsxs)(`header`,{className:Wk.pageHead,children:[(0,F.jsxs)(`div`,{children:[(fe||m)&&(0,F.jsx)(`div`,{className:Wk.breadcrumb,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>{p(null),h(null)},children:a(`‹ 插件`,`‹ Plugins`)})}),(0,F.jsx)(`h1`,{children:fe?o(fe.name):m?.name??a(`插件`,`Plugins`)}),(0,F.jsx)(`p`,{children:a(`管理此服务的可选能力,按需启用。`,`Manage optional capabilities on this service.`)})]}),(0,F.jsx)(`button`,{type:`button`,className:Wk.refresh,disabled:D||T!==null||g,onClick:()=>void M(),"aria-label":a(`刷新插件`,`Refresh plugins`),children:D?`…`:`↻`})]}),(0,F.jsx)(`p`,{className:Wk.scope,children:a(`全局设置 · 影响此服务的所有工作区和聊天;所有聊天空闲后才可修改。`,`Global settings · Applies to every workspace and chat on this service. Changes require all chats to be idle.`)}),r,k&&(0,F.jsx)(`p`,{className:Wk.error,role:`alert`,children:k}),te&&(0,F.jsx)(`p`,{className:Wk.notice,role:`status`,children:te}),D&&!s&&(0,F.jsx)(`p`,{role:`status`,children:a(`正在读取插件…`,`Loading plugins…`)}),!s&&!D&&(0,F.jsx)(`button`,{type:`button`,className:Wk.back,onClick:()=>void M(),children:a(`重试`,`Retry`)}),fe?(0,F.jsxs)(`div`,{className:Wk.detail,children:[(0,F.jsxs)(`div`,{className:Wk.detailHead,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:de(fe)}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{children:o(fe.name)}),(0,F.jsx)(`p`,{children:o(fe.description)})]}),ue(fe)]}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:a(`插件标识`,`Plugin ID`)}),(0,F.jsx)(`dd`,{children:(0,F.jsx)(`code`,{children:fe.id})}),(0,F.jsx)(`dt`,{children:a(`来源`,`Source`)}),(0,F.jsx)(`dd`,{children:fe.kind===`builtin`?a(`随应用内置`,`Bundled with the application`):a(`Pi 软件包`,`Pi package`)}),(0,F.jsx)(`dt`,{children:a(`状态`,`Status`)}),(0,F.jsx)(`dd`,{children:fe.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)}),fe.version&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:a(`契约版本`,`Contract version`)}),(0,F.jsx)(`dd`,{children:fe.version})]})]}),(0,F.jsx)(`p`,{className:Wk.scope,children:fe.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.`)}),fe.id===d.git&&(0,F.jsx)(`p`,{className:Wk.scope,children:a(`关闭 Git 面板不禁止 Agent 或其他终端执行系统 git。`,`Disabling the Git panel does not prevent an agent or another terminal from running system git.`)})]}):s&&!m&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`input`,{type:`search`,className:Wk.search,value:C,onChange:e=>w(e.target.value),placeholder:a(`搜索插件`,`Search plugins`),"aria-label":a(`搜索插件`,`Search plugins`)}),[`builtin`,`external`].map(e=>{let t=pe.filter(t=>t.kind===e);return t.length?(0,F.jsxs)(`section`,{className:Wk.group,children:[(0,F.jsxs)(`h2`,{children:[e===`builtin`?a(`内置能力`,`Built-in capabilities`):a(`已安装的 Web 插件`,`Installed Web plugins`),` `,(0,F.jsx)(`span`,{children:t.length})]}),(0,F.jsx)(`ul`,{className:Wk.cards,children:t.map(e=>(0,F.jsxs)(`li`,{className:Wk.card,"data-plugin-package":e.id,children:[(0,F.jsx)(`span`,{className:Wk.artwork,"aria-hidden":`true`,children:de(e)}),(0,F.jsxs)(`div`,{className:Wk.cardMain,children:[(0,F.jsx)(`button`,{className:Wk.cardOpen,type:`button`,onClick:()=>p(e.id),children:o(e.name)}),(0,F.jsx)(`p`,{children:o(e.description)}),(0,F.jsxs)(`small`,{children:[(0,F.jsx)(`span`,{className:Wk.dot,"data-enabled":e.enabled}),T===e.id?a(`正在应用…`,`Applying…`):e.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)]})]}),(0,F.jsxs)(`div`,{className:Wk.cardEnd,children:[ue(e),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]})]},e.id))})]},e):null}),!pe.length&&!y&&(0,F.jsx)(`p`,{className:Wk.scope,children:a(`没有匹配的插件`,`No matching plugins`)})]}),(0,F.jsx)(tA,{locale:i,generation:n,reload:x,query:C,selectedId:m?.id??null,visible:!fe,disabled:D||T!==null,onSelect:h,onBusyChange:v,onMatchCountChange:b}),(0,F.jsx)(OO,{open:A!==null,onClose:()=>re(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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:Wk.back,type:`button`,onClick:()=>re(null),children:a(`取消`,`Cancel`)}),(0,F.jsx)(`button`,{className:Wk.danger,type:`button`,onClick:()=>{A&&se(A)},children:a(`停用并结束终端`,`Disable and stop terminals`)})]})})]})}var rA={root:`_root_1ikfi_1`,trigger:`_trigger_1ikfi_2`,glyph:`_glyph_1ikfi_4`,dot:`_dot_1ikfi_5`,srOnly:`_srOnly_1ikfi_6`};function iA(e){let t=Ek();return t?(0,F.jsx)(oA,{...e,controller:t}):(0,F.jsx)(aA,{...e})}function aA(e){let t=Ck(e);return(0,F.jsx)(oA,{...e,controller:t})}function oA({wide:e,hideError:t,controller:n}){let r=l(),i=(e,t)=>f(r,e,t),{status:a,checking:o,installing:s,targetVersion:c,restartTimedOut:u,error:d,install:p}=n;if(Vt(`app-update`,t?null:d&&i(`升级未完成,当前版本和数据已保留。可稍后重试。`,`Update did not finish; the current version and data are retained. You can retry.`),d??void 0,i(`诊断信息`,`Diagnostics`)),!a?.available||!a.canRestart)return null;let m=s?i(`正在升级…`,`Updating…`):c?i(`正在重启…`,`Restarting…`):a.downgrade?i(`切换到稳定版`,`Switch to stable`):i(`下载升级`,`Download updates`),h=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,F.jsxs)(`div`,{className:rA.root,children:[(0,F.jsx)(`div`,{className:`pi-settings-trigger-row ${e?``:`pi-settings-trigger-rail`}`,children:(0,F.jsx)(Xe,{label:h,children:(0,F.jsxs)(`button`,{className:`pi-settings-sidebar ${rA.trigger}`,"data-wide":e,type:`button`,"aria-label":m,disabled:o||s||!!c||u,onClick:()=>{p()},children:[(0,F.jsxs)(`span`,{className:rA.glyph,children:[(0,F.jsx)(_t,{size:e?16:18}),(0,F.jsx)(`span`,{className:rA.dot})]}),e&&(0,F.jsx)(`span`,{children:m})]})})}),(s||c)&&(0,F.jsx)(`span`,{className:rA.srOnly,role:`status`,children:m})]})}var sA={trigger:`_trigger_1s641_2`,item:`_item_1s641_3`};function cA({wide:e}){let t=l(),n=((e,n)=>f(t,e,n))(`帮助与文档`,`Help & documentation`),r=(0,P.useRef)(null),i=(0,P.useRef)(null),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)({top:0,left:0}),u=(e=!0)=>{o(!1),e&&r.current?.focus()};return(0,P.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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Xe,{label:n,disabled:a,children:(0,F.jsx)(`button`,{ref:r,type:`button`,className:`pi-settings-sidebar ${sA.trigger}`,"data-wide":e,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>a?u():o(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),o(!0))},children:(0,F.jsx)(kt,{size:e?16:18})})}),a&&(0,jt.createPortal)((0,F.jsx)(kp,{ref:i,role:`menu`,tabIndex:-1,"aria-label":n,className:kO.menu,style:s,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),u();else if(e.key===`Tab`)u();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:Fk(t).map(e=>(0,F.jsx)(`a`,{role:`menuitem`,href:e.href,target:`_blank`,rel:`noreferrer`,className:`${kO.menuItem} ${kO.menuItemNeutral} ${sA.item}`,onClick:()=>u(!1),children:e.label},e.id))}),document.body)]})}var lA=e=>typeof e==`object`&&!!e&&!Array.isArray(e),uA=e=>typeof e==`string`,dA=e=>typeof e==`boolean`,fA=e=>typeof e==`number`&&Number.isFinite(e),pA=e=>t=>t===null||e(t),mA=e=>t=>Array.isArray(t)&&t.every(e),hA=(e,t,n)=>e[t]===void 0||n(e[t]),gA=(e,t)=>t.every(t=>uA(e[t])),_A=(e,t)=>t.every(t=>hA(e,t,uA));function vA(e){return lA(e)&&gA(e,[`id`,`timestamp`])&&[`user`,`assistant`,`tool`,`notice`].includes(e.role)&&mA(e=>lA(e)&&[`text`,`thinking`,`image`,`toolCall`].includes(e.kind)&&uA(e.text)&&_A(e,[`toolName`,`toolCallId`]))(e.blocks)&&_A(e,[`toolName`,`toolCallId`,`model`,`error`])&&hA(e,`isError`,dA)&&hA(e,`usage`,e=>lA(e)&&[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`,`cost`].every(t=>fA(e[t]))&&hA(e,`reasoning`,fA))}function yA(e){return lA(e)&&e.schemaVersion===1&&gA(e,[`sessionId`,`cwd`,`name`])&&pA(uA)(e.model)&&pA(uA)(e.thinkingLevel)&&mA(uA)(e.thinkingLevels)&&dA(e.idle)&&hA(e,`paused`,dA)&&hA(e,`hasPendingPrompts`,dA)&&hA(e,`promptQueue`,e=>lA(e)&&mA(uA)(e.steering)&&mA(uA)(e.followUp))&&hA(e,`queuedPrompts`,mA(e=>lA(e)&&gA(e,[`id`,`text`])&&Number.isSafeInteger(e.revision)&&e.revision>0&&[`queued`,`sending`].includes(e.status)&&hA(e,`error`,uA)&&mA(e=>lA(e)&&uA(e.name)&&dA(e.image))(e.attachments)))&&pA(e=>lA(e)&&pA(fA)(e.tokens)&&fA(e.contextWindow)&&pA(fA)(e.percent))(e.contextUsage)&&mA(vA)(e.messages)&&mA(e=>lA(e)&&gA(e,[`id`,`pluginId`,`kind`,`timestamp`])&&hA(e,`afterMessageId`,uA))(e.pluginEntries)&&hA(e,`interactions`,mA(e=>lA(e)&&gA(e,[`requestId`,`sessionId`,`pluginId`,`kind`])))&&hA(e,`streaming`,pA(vA))}function bA(e){return lA(e)&&pA(uA)(e.activeId)&&mA(e=>lA(e)&&gA(e,[`id`,`path`,`title`])&&hA(e,`available`,dA))(e.items)&&mA(e=>lA(e)&&gA(e,[`id`,`workspaceId`,`name`,`modified`])&&pA(uA)(e.path)&&hA(e,`idle`,dA))(e.sessions)}function xA(e){return lA(e)&&e.type===`error`&&uA(e.message)&&_A(e,[`errorCode`,`errorId`,`requestId`,`operationId`])&&hA(e,`errorReported`,dA)}function SA(e){if(!lA(e)||!uA(e.type))throw Error(`Invalid stream event`);switch(e.type){case`snapshot`:if(lA(e.session)&&e.session.schemaVersion!==1)throw Error(`Unsupported session schema`);if(yA(e.session))return{type:`snapshot`,session:e.session};throw Error(`Invalid session snapshot`);case`stream`:if(e.message===null||vA(e.message))return{type:`stream`,message:e.message};break;case`workspaces`:if(bA(e.value))return{type:`workspaces`,value:e.value};break;case`shutdown`:if(hA(e,`reconnect`,dA))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(xA(e))return e;break;default:throw Error(`Unsupported stream event`)}throw Error(`Invalid stream event`)}var CA=ve();async function wA(e,n,r){return t(await s(e,{method:`POST`,headers:{Authorization:`Bearer ${CA}`,"Content-Type":`application/json`},body:JSON.stringify(n),signal:r}))}async function TA(e){return t(await s(e,{headers:{Authorization:`Bearer ${CA}`}}))}function EA(){let e=l(),[n,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(null),[c,u]=(0,P.useState)(CA?`connecting`:`missing-token`),[d,f]=(0,P.useState)(``),[p,m]=(0,P.useState)([]),[h,g]=(0,P.useState)(`loading`),[_,v]=(0,P.useState)([]),[y,b]=(0,P.useState)({items:[],activeId:null,sessions:[]}),[x,S]=(0,P.useState)(null),[C,w]=(0,P.useState)([]),[T,E]=(0,P.useState)(0);return(0,P.useEffect)(()=>{if(!CA)return;let e=new AbortController,n,a=!0,c=!1;return(async()=>{for(;a;){let l,d,p=`stream_connect`;try{u(`connecting`);let n=await s(`/api/events`,{headers:{Authorization:`Bearer ${CA}`},cache:`no-store`,signal:e.signal}),{response:m}=n;if(d=n.correlation,m.ok||await t(n),!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`));u(`connected`),he({connection:`connected`}),ye(`stream_connected`,{...d}),f(``),l=m.body.getReader();let h=new TextDecoder,g=``;for(;a;){p=`stream_read`;let{done:e,value:t}=await l.read();if(e)break;p=`stream_event`,g+=h.decode(t,{stream:!0});let n=g.indexOf(`
|
|
62
62
|
`);for(;n!==-1;){let e=g.slice(0,n);if(g=g.slice(n+1),e){let t;try{t=SA(JSON.parse(e))}catch(e){let t=e instanceof SyntaxError?Error(`Invalid event JSON`):e;throw _e(t,{...d,stage:`ndjson_parse`}),t}if(t.type===`shutdown`){if(l.cancel().catch(()=>{}),t.reconnect===!0)throw new DOMException(`Pi web service is restarting`,`AbortError`);a=!1,u(`disconnected`),he({connection:`disconnected`}),ye(`bridge_shutdown`),f(r(`Pi 网页服务已关闭,请在 Pi 中重新输入 /web。`,`The Pi web service stopped. Run /web again in Pi.`));return}if(t.type===`snapshot`&&(i(t.session),he({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)&&o(t.session.streaming??null)),t.type===`stream`){let e=t.message!==null;e&&f(``),e!==c&&ye(e?`stream_start`:`stream_end`),c=e,o(t.message)}t.type===`workspaces`&&b(t.value),t.type===`error`&&(f(t.message),!t.errorId&&!t.errorReported&&t.errorCode!==`validation_error`&&_e(Error(`Agent response failed`),{stage:`agent`,code:`agent_failed`,requestId:t.requestId,operationId:t.operationId}),ye(`agent_error`,{errorId:t.errorId,requestId:t.requestId,operationId:t.operationId})),t.type===`plugins_changed`&&window.location.reload(),t.type===`hosted_plugins_changed`&&E(e=>e+1),t.type===`plugin_state`&&(w(t.disabled),E(e=>e+1))}n=g.indexOf(`
|
|
63
63
|
`)}}throw p=`stream_end`,Error(r(`Pi 网页连接已关闭`,`The Pi web connection has closed`))}catch(e){if(l?.cancel().catch(()=>{}),!a)return;he({connection:`disconnected`});let t={...d,route:`/api/events`,stage:p,connection:`disconnected`};_e(e,t),ye(`stream_disconnected`,t),u(`disconnected`),g(`loading`),f(e instanceof Error?e.message:r(`连接 Pi 失败`,`Could not connect to Pi`)),await new Promise(e=>{n=setTimeout(e,1500)})}}})(),()=>{a=!1,e.abort(),n&&clearTimeout(n)}},[]),(0,P.useEffect)(()=>{CA||f(r(`请在 Pi 终端输入 /web,打开显示的完整地址。`,`Enter /web in the Pi terminal and open the full address shown.`))},[e]),(0,P.useEffect)(()=>{if(c!==`connected`)return;let e=!0;return g(`loading`),TA(`/api/plugin-management`).then(t=>{e&&w(t.items.filter(e=>!e.enabled).map(e=>e.id))}).catch(()=>{}),TA(`/api/models`).then(t=>{e&&(m(t),g(`ready`))}).catch(t=>{e&&(g(`error`),f(t instanceof Error?t.message:r(`无法获取模型列表`,`Could not load the model list`)))}),TA(`/api/commands`).then(t=>{e&&v(t)}).catch(()=>{e&&v([])}),()=>{e=!1}},[c,n?.sessionId]),(0,P.useEffect)(()=>{if(c!==`connected`)return;let e=!0;return TA(`/api/workspaces`).then(t=>{e&&b(t)}).catch(()=>{}),TA(`/api/directory/capability`).then(t=>{e&&S(t.kind)}).catch(()=>{e&&S(`browse`)}),()=>{e=!1}},[c]),{session:n,streaming:a,connection:c,error:d,models:p,modelsStatus:h,commands:_,workspaces:y,directoryPickerKind:x,async resolvePluginInteraction(e,t,r){if(!n)throw Error(`No active session`);await wA(`/api/plugin-interaction`,{sessionId:n.sessionId,pluginId:e,requestId:t,value:r})},plugins:()=>TA(`/api/plugins`),async invokePluginAction(e,t,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return(await wA(`/api/plugin-action`,{sessionId:n.sessionId,pluginId:e,action:t,input:i})).value},async pickDirectory(){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return(await wA(`/api/directory/pick`,{sessionId:n.sessionId})).path},async listDirectory(e,t){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/directory/list`,{sessionId:n.sessionId,...e===void 0?{}:{path:e}},t)},async createDirectory(e,t){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return(await wA(`/api/directory/create`,{sessionId:n.sessionId,path:e,name:t})).path},disabledPlugins:C,pluginGeneration:T,getPluginManagement:()=>TA(`/api/plugin-management`),async togglePlugin(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/plugin-management`,{sessionId:n.sessionId,...e})},clearError:()=>f(``),async upload(e,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));let a=`/api/attachment?sessionId=${encodeURIComponent(n.sessionId)}&name=${encodeURIComponent(e.name)}`,o=await s(a,{method:`POST`,headers:{Authorization:`Bearer ${CA}`,"Content-Type":e.type||`application/octet-stream`},body:e,signal:i});if(o.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 t(o)},async discardAttachment(e){n&&c===`connected`&&await wA(`/api/attachment/remove`,{sessionId:n.sessionId,id:e})},async updateQueuedPrompt(e,t,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/prompt-queue`,{sessionId:n.sessionId,id:e,revision:t,action:i})},async send(e,t=[],i){if(n&&c===`connected`){f(``);try{await wA(`/api/message`,{sessionId:n.sessionId,text:e,attachments:t,delivery:i})}catch(e){throw f(e instanceof Error?e.message:r(`发送失败`,`Send failed`)),e}}},async loadMessageImage(e,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));let a=`/api/image?sessionId=${encodeURIComponent(n.sessionId)}&messageId=${encodeURIComponent(e)}&index=${i}`,o=await s(a,{headers:{Authorization:`Bearer ${CA}`}});o.response.ok||await t(o);try{return await o.response.blob()}catch(e){throw _e(e,{...o.correlation,stage:`image_read`}),e}},async stop(){if(n&&c===`connected`)try{await wA(`/api/abort`,{sessionId:n.sessionId}),f(``)}catch(e){throw f(e instanceof Error?e.message:r(`停止失败`,`Could not stop`)),e}},async resume(){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));f(``);try{await wA(`/api/resume`,{sessionId:n.sessionId})}catch(e){throw f(e instanceof Error?e.message:r(`继续失败`,`Could not continue`)),e}},async compact(){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));try{await wA(`/api/compact`,{sessionId:n.sessionId}),f(``)}catch(e){throw f(e instanceof Error?e.message:r(`压缩失败`,`Compaction failed`)),e}},async newSession(){if(n&&c===`connected`)try{await wA(`/api/new-session`,{sessionId:n.sessionId})}catch(e){throw f(e instanceof Error?e.message:r(`无法创建新会话`,`Could not create a new session`)),e}},async addWorkspace(e,t){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/workspace/add`,{sessionId:n.sessionId,path:e,create:t})},async selectWorkspace(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/workspace/select`,{sessionId:n.sessionId,id:e})},async newSessionInWorkspace(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/workspace/new-session`,{sessionId:n.sessionId,id:e})},async removeWorkspace(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/workspace/remove`,{sessionId:n.sessionId,id:e})},async selectSession(e,t,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/session/select`,{sessionId:n.sessionId,workspaceId:e,id:t,path:i??``})},async renameSession(e,t,i,a){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/session/rename`,{sessionId:n.sessionId,workspaceId:e,id:t,path:i??``,name:a})},async deleteSession(e,t,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/session/delete`,{sessionId:n.sessionId,workspaceId:e,id:t,path:i??``})},async setModel(e,t){if(n&&c===`connected`)try{await wA(`/api/model`,{sessionId:n.sessionId,provider:e,id:t}),f(``)}catch(e){throw f(e instanceof Error?e.message:r(`切换模型失败`,`Could not change model`)),e}},async setThinkingLevel(e){if(n&&c===`connected`)try{await wA(`/api/thinking-level`,{sessionId:n.sessionId,level:e}),f(``)}catch(e){throw f(e instanceof Error?e.message:r(`切换推理强度失败`,`Could not change reasoning effort`)),e}},async getConfig(){return TA(`/api/config`)},async getUpdate(){return TA(`/api/update`)},async getRunningVersion(e){return t(await s(`/api/update/version`,{headers:{Authorization:`Bearer ${CA}`},signal:e},{expectedNetworkFailure:!0}))},async setUpdateChannel(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/update/channel`,{sessionId:n.sessionId,channel:e})},async cancelUpdate(){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/update/cancel`,{sessionId:n.sessionId})},async update(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/update`,{sessionId:n.sessionId,...e})},async getProviders(){return TA(`/api/providers`)},async getProviderModels(e){return TA(`/api/provider/models?providerId=${encodeURIComponent(e)}`)},async updateProviderModel(e,t){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/provider/models`,{sessionId:n.sessionId,providerId:e,change:t});try{m(await TA(`/api/models`)),g(`ready`)}catch{f(r(`模型已保存,但会话模型列表暂时无法刷新。`,`Model saved, but the conversation model list could not refresh.`))}},async logoutProvider(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/provider/logout`,{sessionId:n.sessionId,providerId:e});try{m(await TA(`/api/models`)),g(`ready`)}catch{f(r(`认证已移除,但会话模型列表暂时无法刷新。`,`Credentials removed, but the conversation model list could not refresh.`))}},async addCustomProvider(e){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/provider/custom`,{sessionId:n.sessionId,provider:e})},async startProviderLogin(e,t,i){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/provider/login`,{sessionId:n.sessionId,providerId:e,method:t,...i===void 0?{}:{initialSecret:i}})},async getProviderLogin(e){return TA(`/api/provider/login?id=${encodeURIComponent(e)}`)},async getActiveProviderLogin(){return(await TA(`/api/provider/login/active`)).active},async respondProviderLogin(e,t){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));await wA(`/api/provider/login/respond`,{sessionId:n.sessionId,id:e,value:t})},async cancelProviderLogin(e){n&&c===`connected`&&await wA(`/api/provider/login/cancel`,{sessionId:n.sessionId,id:e})},async refreshModels(){m(await TA(`/api/models`)),g(`ready`)},async updateConfig(e,t,i,a){if(!n||c!==`connected`)throw Error(r(`Pi 会话不可用`,`Pi session is unavailable`));return wA(`/api/config`,{sessionId:n.sessionId,kind:e,scope:t,action:i,value:a})}}}var DA=2;function OA(e,t,n){let r=e.position?.start.offset;return r===void 0?-(n+1):t+r}function kA(e,t){for(let n=t;n<e.length;n+=1){let t=e[n];if(t===`
|
|
64
64
|
`)return n+1;if(t===`\r`)return e[n+1]===`
|
|
@@ -497,7 +497,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
497
497
|
`,c]}var fJ=class{labels;parser=new PA(Cj);generation=-1;frozenCount=0;frozenElements=[];frozenTargets=Lq();frozenFootnoteOrder=[];frozenFootnoteCounts=new Map;lastText=null;lastRendered=[];constructor(e){this.labels=e}render(e){if(e===this.lastText)return this.lastRendered;let{frozen:t,tail:n,generation:r}=this.parser.update(e);r!==this.generation&&(this.generation=r,this.frozenCount=0,this.frozenElements=[],this.frozenTargets=Lq(),this.frozenFootnoteOrder=[],this.frozenFootnoteCounts=new Map);let i=t.slice(this.frozenCount);Rq(i.map(e=>e.node),this.frozenTargets);let a={definitions:new Map(this.frozenTargets.definitions),footnotes:new Map(this.frozenTargets.footnotes)};if(Rq(n.map(e=>e.node),a),i.length>0){let e={streaming:!0,labels:this.labels,fileMentions:void 0,pathImages:void 0,targets:a,footnoteOrder:this.frozenFootnoteOrder,footnoteCounts:this.frozenFootnoteCounts},n=[...this.frozenElements];for(let t of zq(i,e))n.length>0&&n.push(`
|
|
498
498
|
`),n.push(t);this.frozenElements=n,this.frozenCount=t.length}let o={streaming:!0,labels:this.labels,fileMentions:void 0,pathImages:void 0,targets:a,footnoteOrder:[...this.frozenFootnoteOrder],footnoteCounts:new Map(this.frozenFootnoteCounts)},s=[...this.frozenElements];for(let e of zq(n,o))s.length>0&&s.push(`
|
|
499
499
|
`),s.push(e);let c=uJ(o);return c!==null&&s.push(`
|
|
500
|
-
`,c),this.lastText=e,this.lastRendered=s,this.lastRendered}},pJ=(0,P.memo)(function({text:e,streaming:t=!1,labels:r,fileMentions:i,pathImages:a,variant:o=`body`}){let s=(0,P.useRef)(null),c=(0,P.useRef)(r),l=(0,P.useMemo)(()=>t?((s.current===null||c.current!==r)&&(s.current=new fJ(r),c.current=r),s.current.render(e)):(s.current=null,dJ(e,r,i,a)),[e,t,r,i,a]);return(0,F.jsx)(`div`,{className:n(Mq.markdown,o===`compact`&&Mq.compact),"data-markdown-variant":o===`compact`?o:void 0,children:l})});function mJ(e,t){throw Error(`${t}: unhandled ${JSON.stringify(e)}`)}function hJ(e,t){let n=e.nodes[t];if(n===void 0)throw Error(`layout: unknown node ${t}`);return n}function gJ(e,t){let n=hJ(e,t);if(n.kind!==`pane`)throw Error(`layout: ${t} is not a pane`);return n}function _J(e,t){let n=hJ(e,t);if(n.kind!==`split`)throw Error(`layout: ${t} is not a split`);return n}function vJ(e,t){let n=e.tabs[t];if(n===void 0)throw Error(`layout: unknown tab ${t}`);return n}function yJ(e){if(e.host!==`float`||e.rect===void 0)throw Error(`layout: ${e.id} is not floating`);return e.rect}function bJ(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 xJ(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 SJ(e,t){for(let n of Object.values(e.nodes))if(n.kind===`split`&&n.children.includes(t))return n}function CJ(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 wJ(e){let t=[],n=r=>{let i=hJ(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 TJ(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 EJ(e){return Object.entries(e)}function DJ(e){return Object.keys(e)}function OJ(e,t){let n={};for(let[r,i]of EJ(e.nodes))r in t||(n[r]=i);for(let[e,r]of EJ(t))r!==null&&(n[e]=r);return{...e,nodes:n}}function kJ(e,t){let n={};for(let[r,i]of EJ(e.tabs))r in t||(n[r]=i);for(let[e,r]of EJ(t))r!==null&&(n[e]=r);return{...e,tabs:n}}function AJ(e,t,n){let r=Math.max(0,Math.min(t,e.length));return[...e.slice(0,r),n,...e.slice(r)]}function jJ(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function MJ(e,t){let n=jJ(e,t);if(n.length!==0)return n[Math.max(0,t-1)]}function NJ(e,t,n){return{...e,tabs:t,activeTabId:n}}function PJ(e,t,n){let r=SJ(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 OJ(e,{[r.id]:{...r,children:i}})}function FJ(e,t){let n=hJ(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=hJ(e,r)}return n.id}function IJ(e){return FJ(e,e=>e.children[0])}function LJ(e){return FJ(e,e=>e.axis===`row`?e.children.at(-1):e.children[0])}function RJ(e,t){let n={};for(let r of t)n[r]=gJ(e,r).activeTabId;return{type:`restoreFocus`,activePaneId:e.activePaneId,floats:e.floats,paneActiveTabs:n}}function zJ(e,t){return[...e.filter(e=>e!==t),t]}function BJ(e,t){return e.activePaneId===t?{...e,activePaneId:IJ(e)}:e}function VJ(e){return{kind:`pane`,id:e,host:`dock`,tabs:[],activeTabId:void 0,rect:void 0}}function HJ(e,t){if(e.nodes[t]!==void 0)throw Error(`layout: node ${t} already exists`)}function UJ(e,t){if(e.tabs[t]!==void 0)throw Error(`layout: tab ${t} already exists`)}function WJ(e,t){if(gJ(e,t.paneId).host!==`dock`)throw Error(`layout: split requires a docked pane`);HJ(e,t.newPaneId);let n=VJ(t.newPaneId),r=SJ(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=AJ(r.children,a,t.newPaneId),s=r.sizes.flatMap((e,t)=>t===i?[e/2,e/2]:[e]);return{state:OJ(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}]}}HJ(e,t.newSplitId);let i=PJ(e,t.paneId,t.newSplitId),a=t.direction===`after`?[t.paneId,t.newPaneId]:[t.newPaneId,t.paneId];return{state:OJ(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 GJ(e,t){let n=gJ(e,t.paneId);if(n.tabs.length>0)throw Error(`layout: merge requires an empty pane`);let r=RJ(e,[]);if(n.host===`float`){let i=bJ(e,t.paneId);return{state:BJ(OJ({...e,floats:jJ(e.floats,i)},{[t.paneId]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`float`,index:i}},r]}}let i=SJ(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=jJ(i.children,a),s=TJ(jJ(i.sizes,a));return{state:BJ(OJ(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:BJ(OJ(PJ(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 KJ(e,t){let n=gJ(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: openTab requires a docked pane`);UJ(e,t.tab.id);let r=RJ(e,[n.id]);return{state:{...OJ(kJ(e,{[t.tab.id]:t.tab}),{[n.id]:NJ(n,AJ(n.tabs,t.index,t.tab.id),t.tab.id)}),activePaneId:n.id},inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function qJ(e,t){let n=gJ(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: insertTab requires a docked pane`);UJ(e,t.tab.id);let r=RJ(e,[n.id]),i=AJ(n.tabs,t.index,t.tab.id);return{state:OJ(kJ(e,{[t.tab.id]:t.tab}),{[n.id]:NJ(n,i,n.activeTabId??t.tab.id)}),inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function JJ(e,t){let n=vJ(e,t.tabId),r=CJ(e,t.tabId),i=r.tabs.indexOf(t.tabId),a=RJ(e,[r.id]);if(r.host===`float`){let i=bJ(e,r.id);return{state:BJ(kJ(OJ({...e,floats:jJ(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?MJ(r.tabs,i):r.activeTabId;return{state:kJ(OJ(e,{[r.id]:NJ(r,jJ(r.tabs,i),o)}),{[t.tabId]:null}),inverse:[{type:`insertTab`,paneId:r.id,tab:n,index:i},a]}}function YJ(e,t){if(HJ(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)UJ(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},RJ(e,[])],a=t.attach;switch(a.mode){case`child`:{let r=_J(e,a.parentId),o=AJ(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:OJ(kJ(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:OJ(kJ(PJ(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=AJ(e.floats,a.index,t.pane.id);return{state:OJ(kJ({...e,floats:r},n),{[t.pane.id]:t.pane}),inverse:i}}default:return mJ(a,`layout: insertPane attachment`)}}function XJ(e,t){let n=CJ(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: moveTab source must be docked; use unfloat`);let r=gJ(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=RJ(e,[n.id,r.id]),o=n.activeTabId===t.tabId?MJ(n.tabs,i):n.activeTabId;return{state:{...OJ(e,{[n.id]:NJ(n,jJ(n.tabs,i),o),[r.id]:NJ(r,AJ(r.tabs,t.index,t.tabId),t.tabId)}),activePaneId:r.id},inverse:[{type:`moveTab`,tabId:t.tabId,toPaneId:n.id,index:i},a]}}function ZJ(e,t){let n=CJ(e,t.tabId),r=n.tabs.indexOf(t.tabId),i=AJ(jJ(n.tabs,r),t.index,t.tabId);return{state:OJ(e,{[n.id]:{...n,tabs:i}}),inverse:[{type:`reorderTab`,tabId:t.tabId,index:r}]}}function QJ(e,t){let n=CJ(e,t.tabId),r=RJ(e,[n.id]),i=OJ(e,{[n.id]:{...n,activeTabId:t.tabId}}),a=n.host===`float`?zJ(i.floats,n.id):i.floats;return{state:{...i,activePaneId:n.id,floats:a},inverse:[r]}}function $J(e,t){let n=gJ(e,t.paneId),r=RJ(e,[]),i=n.host===`float`?zJ(e.floats,n.id):e.floats;return{state:{...e,activePaneId:n.id,floats:i},inverse:[r]}}function eY(e,t){let n=_J(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:OJ(e,{[n.id]:{...n,sizes:TJ(t.sizes)}}),inverse:[{type:`resize`,splitId:n.id,sizes:n.sizes}]}}function tY(e,t){vJ(e,t.tabId);let n=CJ(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: float requires a docked tab`);HJ(e,t.newPaneId);let r=n.tabs.indexOf(t.tabId),i=RJ(e,[n.id]),a=n.activeTabId===t.tabId?MJ(n.tabs,r):n.activeTabId,o=OJ(e,{[n.id]:NJ(n,jJ(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 nY(e,t){let n=gJ(e,t.paneId),r=yJ(n),i=xJ(n),a=gJ(e,t.toPaneId);if(a.host!==`dock`)throw Error(`layout: unfloat target must be docked`);let o=RJ(e,[a.id]);return{state:{...OJ({...e,floats:jJ(e.floats,bJ(e,t.paneId))},{[t.paneId]:null,[a.id]:NJ(a,AJ(a.tabs,t.index,i),i)}),activePaneId:a.id},inverse:[{type:`float`,tabId:i,newPaneId:t.paneId,rect:r},o]}}function rY(e,t,n){let r=OJ(e,{[t.id]:{...t,rect:n}});return{...r,activePaneId:t.id,floats:zJ(r.floats,t.id)}}function iY(e,t){let n=gJ(e,t.paneId),r=yJ(n);return{state:rY(e,n,{...r,x:t.x,y:t.y}),inverse:[{type:`moveFloat`,paneId:t.paneId,x:r.x,y:r.y},RJ(e,[])]}}function aY(e,t){let n=gJ(e,t.paneId),r=yJ(n);if(!(t.rect.width>0)||!(t.rect.height>0))throw Error(`layout: float size must be above zero`);return{state:rY(e,n,t.rect),inverse:[{type:`resizeFloat`,paneId:t.paneId,rect:r},RJ(e,[])]}}function oY(e,t){let n=RJ(e,DJ(t.paneActiveTabs));for(let n of t.floats)if(gJ(e,n).host!==`float`)throw Error(`layout: restoreFocus lists docked pane ${n} as floating`);let r=e;for(let[e,n]of EJ(t.paneActiveTabs)){let t=gJ(r,e);r=OJ(r,{[e]:{...t,activeTabId:n}})}return gJ(r,t.activePaneId),{state:{...r,activePaneId:t.activePaneId,floats:t.floats},inverse:[n]}}function sY(e,t){switch(t.type){case`split`:return WJ(e,t);case`merge`:return GJ(e,t);case`openTab`:return KJ(e,t);case`insertTab`:return qJ(e,t);case`closeTab`:return JJ(e,t);case`insertPane`:return YJ(e,t);case`moveTab`:return XJ(e,t);case`reorderTab`:return ZJ(e,t);case`focusTab`:return QJ(e,t);case`focusPane`:return $J(e,t);case`resize`:return eY(e,t);case`float`:return tY(e,t);case`unfloat`:return nY(e,t);case`moveFloat`:return iY(e,t);case`resizeFloat`:return aY(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 oY(e,t);default:return mJ(t,`layout: operation`)}}function cY(e,t){return t.reduce((e,t)=>sY(e,t).state,e)}var lY={entries:[],cursor:0},uY=new Set([`focusTab`,`focusPane`,`restoreFocus`]);function dY(e){return uY.has(e.type)}function fY(e,t){let n=e.entries[t];return n!==void 0&&n.ops.every(dY)}function pY(e){return e.cursor>0}function mY(e){return e.cursor<e.entries.length}function hY(e){return e.entries.flatMap(e=>e.ops)}function gY(e,t,n){if(n.length===0)return{history:e,state:t};let r=t,i=[];for(let e of n){let t=sY(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 _Y(e,t){if(!pY(e))return;let n=1;if(fY(e,e.cursor-1))for(;fY(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=sY(r,e).state;return{history:{entries:e.entries,cursor:e.cursor-n},state:r}}function vY(e,t){if(!mY(e))return;let n=1;if(fY(e,e.cursor))for(;fY(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=sY(r,e).state;return{history:{entries:e.entries,cursor:e.cursor+n},state:r}}var yY=class{current;recorded=lY;constructor(e){this.current=e}get state(){return this.current}get history(){return this.recorded}get ops(){return hY(this.recorded)}get cursor(){return this.recorded.cursor}get canUndo(){return pY(this.recorded)}get canRedo(){return mY(this.recorded)}dispatch(e){return this.dispatchAll([e])}dispatchAll(e){let t=gY(this.recorded,this.current,e);return this.recorded=t.history,this.current=t.state,this.current}undo(){let e=_Y(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}redo(){let e=vY(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}},bY=.12,xY={width:380,height:300},SY={width:220,height:140},CY=.25;function wY(e){return wJ(e).length}function TY(e){return wY(e)<4}function EY(e,t,n=CY){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 DY(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 mJ(e,`layout: dock zone`)}}function OY(e,t=bY){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 kY(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function AY(e,t,n,r=CY){return!(e.width>0)||!(e.height>0)?`center`:EY((t-e.x)/e.width,(n-e.y)/e.height,r)}function jY(e,t){let n=0;for(let r of e){if(t<r.x+r.width/2)break;n+=1}return n}var MY={divider:0,chip:100,body:48};function NY(e,t=MY){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 PY(e,t,n,r){return Math.abs(n-e)>=4||Math.abs(r-t)>=4}function FY(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 IY(e,t,n){return{...e,x:e.x+t,y:e.y+n}}function LY(e,t,n,r){return{...e,width:Math.max(r.width,e.width+t),height:Math.max(r.height,e.height+n)}}function RY(e,t,n){return{x:Math.max(0,e-zY.x),y:Math.max(0,t-zY.y),...n}}var zY={x:60,y:14},BY=24,VY={x:160,y:120},HY=[];function UY(e,t,n,r){for(let i of gJ(e,t).tabs){let t=e.tabs[i];if(t?.contentId===n&&(r===void 0||t.kind===r))return i}}function WY(e,t,n){for(let r of[...wJ(e),...e.floats]){let i=UY(e,r,t,n);if(i!==void 0)return i}}function GY(e){let t=gJ(e,e.activePaneId);return t.host===`dock`?t.id:IJ(e)}function KY(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 qY(e,t){return e.expanded===t?HY:[{type:`setExpanded`,expanded:t}]}function JY(e,t){return e.mode===t?HY:[{type:`setMode`,mode:t}]}function YY(e,t,n,r){if(!TY(e))return HY;let i=n??GY(e);if(gJ(e,i).host!==`dock`)return HY;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 XY(e,t,n,r){if(r===void 0)return HY;let i=gJ(e,n);return i.host===`dock`?[{type:`openTab`,paneId:n,tab:r(t(`tab`)),index:i.tabs.length}]:HY}function ZY(e,t,n){let r=n.revealIfOpened===!1?void 0:WY(e,n.contentId,n.kind);if(r!==void 0)return{ops:[{type:`focusTab`,tabId:r}],tabId:r};let i=n.paneId??GY(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??gJ(e,i).tabs.length}],tabId:a.id}}function QY(e,t,n){let r=vJ(e,n),i=CJ(e,n),a=i.host===`dock`?i.id:GY(e),o=i.host===`dock`?i.tabs.indexOf(n)+1:gJ(e,a).tabs.length,s={...r,id:t(`tab`)};return{ops:[{type:`openTab`,paneId:a,tab:s,index:o}],tabId:s.id}}function $Y(e,t,n,r){let i=CJ(e,t);if(gJ(e,n).host!==`dock`)return HY;if(i.id===n){let e=i.tabs.indexOf(t),n=r>e?r-1:r;return n===e?HY:[{type:`reorderTab`,tabId:t,index:n}]}return[KY(i,t,n,r)]}function eX(e,t,n,r,i,a){let o=CJ(e,n),s=gJ(e,r);if(s.host!==`dock`)return HY;let c=DY(i);if(c===void 0)return o.id===r?HY:[KY(o,n,r,s.tabs.length)];let l=o.id===r&&o.tabs.length===1;if(l&&a===void 0||!TY(e))return HY;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(KY(o,n,u,0)),d}function tX(e,t,n,r){let i=e.floats.length*BY,a=t(`float`);return{ops:[{type:`float`,tabId:n,newPaneId:a,rect:r??{x:VY.x+i,y:VY.y+i,width:xY.width,height:xY.height}}],paneId:a}}function nX(e,t,n){let r=n??GY(e);return[{type:`unfloat`,paneId:t,toPaneId:r,index:gJ(e,r).tabs.length}]}function rX(e,t,n){return[{type:`resize`,splitId:e,sizes:OY(t,n)}]}function iX(e,t,n){let r=[],i=e;for(;;){let e=wJ(i).find(e=>e!==i.rootId&&gJ(i,e).tabs.length===0);if(e===void 0)break;let t={type:`merge`,paneId:e};r.push(t),i=sY(i,t).state}let a=hJ(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 aX(e=0){let t=e;return{next:(e=>(t+=1,`${e}${t}`))}}function oX(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 sX=class{minter;sequencer;listeners=new Set;makePaneTab;snapshot;constructor(e={}){this.minter=aX(),this.makePaneTab=e.makePaneTab,this.sequencer=new yY(oX(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:TY(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=cY(this.state,e);e=[...e,...iX(t,this.mint,t.floats.length>0?this.makePaneTab:void 0)]}return this.sequencer.dispatchAll(e),this.commit(),!0}setExpanded(e){this.run(qY(this.state,e))}toggleExpanded(){this.setExpanded(!this.state.expanded)}setMode(e){this.run(JY(this.state,e))}splitPane(e){return this.run(YY(this.state,this.mint,e,this.makePaneTab))}addTab(e){return this.run(XY(this.state,this.mint,e,this.makePaneTab))}openContent(e){let t=ZY(this.state,this.mint,e);return this.run(t.ops),t.tabId}duplicateTab(e){let t=QY(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($Y(this.state,e,t,n),!0)}dropTab(e,t,n){return this.run(eX(this.state,this.mint,e,t,n),!0)}floatTab(e,t){let n=tX(this.state,this.mint,e,t);return this.run(n.ops,!0),n.paneId}unfloatPane(e,t){this.run(nX(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(rX(e,t))}undo(){return this.sequencer.undo()?(this.commit(),!0):!1}redo(){return this.sequencer.redo()?(this.commit(),!0):!1}activeDockPaneId(){return GY(this.state)}},cX={x:0,y:0,width:0,height:0},lX={row:!0,column:!0};function uX(e){return e===null?cX:e.getBoundingClientRect()}function dX(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function fX(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 pX(e){let t=e.querySelector(`[data-dockkit-tab]`);if(t===null)return MY.chip;let n=getComputedStyle(t),r=dX(n.minWidth);return r<=0?MY.chip:n.boxSizing===`border-box`?r:r+dX(n.paddingLeft)+dX(n.paddingRight)+dX(n.borderLeftWidth)+dX(n.borderRightWidth)}function mX(e){let t=e.querySelector(`[data-dockkit-divider]`);if(t===null)return MY.divider;let{width:n,height:r}=t.getBoundingClientRect(),i=Math.min(n,r);return i>0?i:MY.divider}function hX(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:dX(getComputedStyle(r).columnGap))}function gX(e,t=!1){let n={divider:mX(e),chip:pX(e),body:MY.body},r=new Map;for(let[i,a]of fX(e))r.set(i,NY({pane:uX(a),strip:uX(a.querySelector(`[data-dockkit-strip]`)),chipsWidth:uX(a.querySelector(`[data-dockkit-strip-tabs]`)).width,fillWidth:uX(a.querySelector(`[data-dockkit-strip-fill]`)).width,splitControlWidth:t?hX(a):0},n));return r}function _X(e,t){return e.get(t)??lX}function vX(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 yX(e,t){typeof e.setPointerCapture==`function`&&e.setPointerCapture(t)}function bX(e,t,n){yX(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 xX(e){let t=(0,P.useRef)(void 0);return(0,P.useEffect)(()=>()=>{t.current?.stop()},[]),(n,r,i)=>{t.current?.end();let a=()=>{t.current=void 0,e()},o=bX(n,r,{move:i.move,up:e=>{a(),i.up(e)},cancel:a});t.current={stop:o,end:()=>{o(),a()}}}}var SX=new WeakMap,CX=new Set([`Tab`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function wX(e,t){SX.get(e)?.();let n=()=>{e.removeAttribute(`data-dsh-automatic-focus`),e.removeEventListener(`blur`,n),e.removeEventListener(`keydown`,r,!0),SX.delete(e)},r=e=>{e.isComposing||e.ctrlKey||e.altKey||e.metaKey||!CX.has(e.key)||n()};SX.set(e,n),e.setAttribute(`data-dsh-automatic-focus`,``),e.addEventListener(`blur`,n),e.addEventListener(`keydown`,r,!0),e.focus(t),e.matches(`:focus`)||n()}function TX(e){let t=!1,n=!1,r=()=>{t=!0},i=()=>{t=!1,n=!0},a=()=>{n=!1},o=()=>{t=!1,n=!1};return e.addEventListener(`compositionstart`,r,!0),e.addEventListener(`compositionend`,i,!0),e.addEventListener(`keyup`,a,!0),e.defaultView?.addEventListener(`blur`,o),{guards:e=>{let r=t||n||e.isComposing||e.keyCode===229;return n=!1,r},dispose:()=>{e.removeEventListener(`compositionstart`,r,!0),e.removeEventListener(`compositionend`,i,!0),e.removeEventListener(`keyup`,a,!0),e.defaultView?.removeEventListener(`blur`,o)}}}var EX=new WeakMap,DX=`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]`;function OX(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.useLayoutEffect)(()=>{let n=e.current;if(!t||n===null)return;let i=n.ownerDocument,a=TX(i),o=i.activeElement,s=EX.get(i)??[];EX.set(i,s);let c={element:n,close:()=>{r.current()}};s.push(c);let l=n.querySelector(`[data-modal-autofocus]`)??n.querySelector(DX)??n;n.contains(i.activeElement)||wX(l);let u=e=>{let t=a.guards(e);if(s.at(-1)!==c||e.defaultPrevented||t||e.ctrlKey||e.altKey||e.metaKey||(e.key===`Escape`&&!e.shiftKey&&(e.preventDefault(),e.repeat||r.current()),e.key!==`Tab`)||i.activeElement?.closest(`[role="menu"]`))return;let o=[...n.querySelectorAll(DX)].filter(e=>!e.closest(`[inert], [hidden]`)),l=o[0]??n,u=o.at(-1)??n,d=e.shiftKey?i.activeElement===l:i.activeElement===u;(i.activeElement===n||!n.contains(i.activeElement)||d)&&(e.preventDefault(),(e.shiftKey?u:l).focus())};return i.addEventListener(`keydown`,u),()=>{a.dispose();let e=s.at(-1)===c;if(s.splice(s.indexOf(c),1),i.removeEventListener(`keydown`,u),s.length===0&&EX.delete(i),e){let e=o instanceof HTMLElement&&o.isConnected?o:s.at(-1)?.element;e!==void 0&&wX(e)}}},[e,t])}var kX={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`},AX=4;function jX(e,t){let n=e.getBoundingClientRect(),r=t.offsetWidth,i=n.left+r+AX>window.innerWidth?Math.max(AX,n.right-r):n.left;return{top:n.bottom+AX,left:i}}function MX({labels:e,anchor:t,onClose:n,onDismiss:r,extras:i}){let a=(0,P.useRef)(null),[o,s]=(0,P.useState)(void 0),c=n!==void 0||P.Children.toArray(i).some(e=>e!==``);return(0,P.useLayoutEffect)(()=>{a.current!==null&&s(jX(t,a.current))},[t,c]),(0,P.useEffect)(()=>{let e=a.current;if(e===null)return;let n=e.ownerDocument,i=TX(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&&wX(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,jt.createPortal)((0,F.jsxs)(kp,{className:kX.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,F.jsx)(`button`,{type:`button`,role:`menuitem`,className:kX.menuItem,"data-dockkit-menu-close":!0,onClick:n,children:e.closeTab}),i]}),document.body):null}function NX(e){e.scrollWidth>e.clientWidth+1?e.dataset.dockkitTabClipped=``:delete e.dataset.dockkitTabClipped}function PX({children:e}){let t=(0,P.useRef)(null);return(0,P.useLayoutEffect)(()=>{t.current!==null&&NX(t.current)}),(0,P.useLayoutEffect)(()=>{let e=t.current;if(e===null||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{NX(e)});return n.observe(e),()=>{n.disconnect()}},[]),(0,F.jsx)(`span`,{ref:t,className:kX.tabTitle,"data-dockkit-tab-title":!0,children:e})}var FX=`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 IX(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.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,F.jsx)(`path`,{d:`M8 1.5V14.5`,stroke:`currentColor`})]})}var LX={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 RX({zone:e}){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:FX,fill:`currentColor`}),(0,F.jsx)(`path`,{d:LX[e],fill:`currentColor`})]})}function zX({zone:e,active:t,labels:n}){return(0,F.jsx)(`div`,{className:kX.dockHint,"data-dockkit-dock-zone":e,"data-dockkit-drop-active":t||void 0,children:(0,F.jsxs)(`div`,{className:kX.dockHintCard,children:[(0,F.jsx)(RX,{zone:e}),(0,F.jsx)(`span`,{className:kX.dockHintLabel,children:n.dropZone[e]})]})})}function BX(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 VX(e){return e===`Enter`||e===` `}function HX(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 UX(e,t){(0,P.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let n=()=>{let e=HX(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 WX(e,t,n,r){(0,P.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-GX:o.right>a.right&&(n.scrollLeft+=o.right-a.right+GX)},[e,t,n,r])}var GX=24;function KX(e,t){switch(t){case`budget`:return e.splitPaneDisabled;case`width`:return e.splitPaneNarrow}}function qX({state:e,pane:t,callbacks:r}){let[i,a]=(0,P.useState)(void 0),[o]=(0,P.useState)(()=>new Map),s=(0,P.useRef)(null);UX(s,t.tabs),WX(s,o,t.tabs,t.activeTabId);let c=r.splitBlock(t.id),l=r.dropTarget,u=l!==void 0&&l.kind===`strip`&&l.paneId===t.id?l.index:void 0,d=n=>{(e.activePaneId!==t.id||t.activeTabId!==n)&&r.onFocusTab(n)},f=e=>{let t=o.get(e);t!==void 0&&t.focus()};return(0,F.jsxs)(`div`,{className:kX.tabStrip,role:`tablist`,"data-dockkit-strip":t.id,"data-window-drag":e.floats.length===0||void 0,children:[(0,F.jsxs)(`div`,{ref:s,className:kX.stripTabs,role:`presentation`,"data-dockkit-strip-tabs":t.id,children:[t.tabs.map((s,c)=>{let l=vJ(e,s),p=s===t.activeTabId,m=r.canCloseTab(s),h=!m&&t.tabs.length===1;return(0,F.jsxs)(P.Fragment,{children:[(c>0||u===c)&&(0,F.jsx)(`div`,{className:n(kX.slot,u===c&&kX.slotCaret),"data-dockkit-caret":u===c?c:void 0}),(0,F.jsxs)(`div`,{role:`tab`,"aria-selected":p,tabIndex:p?0:-1,className:n(kX.tab,p&&kX.tabActive,h&&kX.tabQuiet,r.draggingTabId===s&&kX.tabDragging),"data-dockkit-tab":s,"data-dockkit-tab-quiet":h||void 0,ref:e=>{e===null?o.delete(s):o.set(s,e)},onPointerDown:e=>{e.button!==2&&r.onTabPressed(s,e)},onClick:e=>{e.stopPropagation(),d(s)},onKeyDown:e=>{if(e.target!==e.currentTarget||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let n=BX(e.key,t.tabs,s);n===void 0?VX(e.key)&&(e.preventDefault(),d(s)):(e.preventDefault(),f(n))},onContextMenu:e=>{e.preventDefault();let t=e.currentTarget;a(e=>e?.tabId===s?void 0:{tabId:s,anchor:t})},children:[(0,F.jsx)(PX,{children:r.renderTabTitle?.(l)??l.title}),m&&(0,F.jsx)(hO,{disabled:i!==void 0,label:r.labels.closeTab,shortcutKeys:r.labels.closeTabKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.tabClose,"aria-label":r.labels.closeTab,"aria-keyshortcuts":r.labels.closeTabShortcut,"data-dockkit-tab-close":s,onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r.onCloseTab(s)},children:(0,F.jsx)(le,{size:14})})}),i?.tabId===s&&(0,F.jsx)(MX,{labels:r.labels,anchor:i.anchor,onClose:m?()=>{a(void 0),r.onCloseTab(s)}:void 0,onDismiss:()=>{a(void 0)},extras:r.renderTabMenuItems?.(l,()=>{a(void 0)})})]})]},s)}),u===t.tabs.length&&(0,F.jsx)(`div`,{className:n(kX.slot,kX.slotCaret),"data-dockkit-caret":u})]}),r.canAddTab(t.id)&&(0,F.jsx)(hO,{label:r.labels.addTab,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.addTab,"aria-label":r.labels.addTab,"data-dockkit-add-tab":t.id,onClick:e=>{e.stopPropagation(),r.onAddTab(t.id)},children:(0,F.jsx)(me,{size:14})})}),(0,F.jsx)(`div`,{className:kX.stripFill,"data-dockkit-strip-fill":!0}),!(r.hideSplitWhenBlocked&&c!==void 0)&&(0,F.jsx)(hO,{label:c===void 0?r.labels.splitPane:KX(r.labels,c),shortcutKeys:r.labels.splitPaneKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`span`,{tabIndex:c===void 0?void 0:0,"aria-label":c===void 0?void 0:KX(r.labels,c),children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.labels.splitPane,"aria-keyshortcuts":r.labels.splitPaneShortcut,disabled:c!==void 0,"data-dockkit-split-button":t.id,"data-dockkit-split-blocked":c,onClick:e=>{e.stopPropagation(),r.onSplitPane(t.id)},children:(0,F.jsx)(IX,{})})})}),t.id===r.chromePaneId&&r.chrome!==void 0&&(0,F.jsx)(`div`,{className:kX.stripChrome,"data-dockkit-strip-chrome":!0,onClick:e=>{e.stopPropagation()},children:r.chrome})]})}function JX({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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:kX.dockScrim,"data-dockkit-dock-scrim":!0}),t.horizontalDrops&&r!==`center`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(zX,{zone:`left`,active:r===`left`,labels:t.labels}),(0,F.jsx)(zX,{zone:`right`,active:r===`right`,labels:t.labels})]}):(0,F.jsx)(zX,{zone:r,active:!0,labels:t.labels})]})}function YX({state:e,pane:t,callbacks:n}){let r=t.activeTabId===void 0?void 0:vJ(e,t.activeTabId);return(0,F.jsxs)(`section`,{className:kX.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,F.jsx)(qX,{state:e,pane:t,callbacks:n}),(0,F.jsxs)(`div`,{className:kX.paneBody,children:[r===void 0?(0,F.jsx)(`p`,{className:kX.empty,children:n.labels.emptyPane}):n.renderTab(r),(0,F.jsx)(JX,{pane:t,callbacks:n})]})]})}function XX(e,t,n){let r=t-e.originX,i=n-e.originY;return e.mode===`move`?IY(e.rect,r,i):LY(e.rect,r,i,SY)}function ZX(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QX(e,t){return e.activePaneId===t&&e.floats.at(-1)===t}function $X(e,t){let[n,r]=(0,P.useState)(void 0),i=xX(()=>{r(void 0)}),a=n=>{QX(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:yJ(gJ(e,o))};i(s.currentTarget,s.pointerId,{move:e=>{r({paneId:o,rect:XX(c,e.clientX,e.clientY)})},up:e=>{let r=XX(c,e.clientX,e.clientY);ZX(r,c.rect)?a(o):n===`move`?t.moveFloat(o,r.x,r.y):t.resizeFloat(o,r)}})}}}function eZ({paneId:e,tab:t,labels:r,intents:i,renderTabTitle:a,canCloseTab:o,drag:s}){return(0,F.jsxs)(`header`,{className:n(kX.tabStrip,kX.floatHeader),"data-dockkit-float-grip":e,onPointerDown:t=>{s(`move`,e,t)},children:[(0,F.jsx)(`div`,{className:n(kX.tab,kX.floatTitle),"data-dockkit-float-title":!0,children:(0,F.jsx)(PX,{children:a?.(t)??t.title})}),(0,F.jsx)(`div`,{className:kX.stripFill}),(0,F.jsx)(hO,{label:r.dockFloat,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.dockFloat,"data-dockkit-float-dock":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{i.unfloatPane(e)},children:(0,F.jsx)(te,{className:kX.dockGlyph})})}),(o?.(t.id)??!0)&&(0,F.jsx)(hO,{label:r.closeTab,shortcutKeys:r.closeTabKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.closeTab,"data-dockkit-float-close":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{i.closeTab(t.id)},children:(0,F.jsx)(O,{})})})]})}function tZ({state:e,callbacks:t,intents:r,tab:i,pane:a,column:o,floats:s,focusRequest:c,keepMounted:l,active:u=!0}){let d=a.host===`float`,f=d||a.activeTabId===i.id,p=u&&f&&(d||e.expanded),m=l?.(i)??!1,[h,g]=(0,P.useState)(p);p&&!h&&g(!0);let _=(0,P.useRef)(null),v=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let e=_.current;e.inert=!p;let t=document.activeElement;!p&&t instanceof HTMLElement&&e.contains(t)&&t.blur();let n=c.current;p&&n?.tabId===i.id&&(c.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===i.id)?.focus({preventScroll:!0}))},[p,i.id,c]),(0,P.useEffect)(()=>{let n=v.current,r=()=>{p&&(d?s.raise(a.id):e.activePaneId!==a.id&&t.onFocusPane(a.id))};return n.addEventListener(`focus`,r,!0),()=>{n.removeEventListener(`focus`,r,!0)}},[p,d,s,a.id,e.activePaneId,t]);let y=d&&s.preview?.paneId===a.id?s.preview.rect:void 0,b=d?y??yJ(a):void 0,x=y===void 0?e.floats.indexOf(a.id)+1:e.floats.length+1;return(0,F.jsx)(`div`,{className:n(kX.tabCell,d&&kX.floatingCell),hidden:!f,"data-dockkit-host":d?`float`:`dock`,"data-dockkit-column":d?void 0:o,style:{gridColumn:d?1:o*2+1,gridRow:1,order:d?x:0},children:(0,F.jsxs)(`section`,{ref:_,tabIndex:-1,className:n(kX.tabHost,d?kX.float:kX.pane),"aria-hidden":!p||void 0,"data-dockkit-content":i.id,"data-dockkit-pane":!d&&f?a.id:void 0,"data-dockkit-pane-active":!d&&e.activePaneId===a.id||void 0,"data-dockkit-float":d?a.id:void 0,"data-dockkit-float-active":d&&e.activePaneId===a.id||void 0,"data-dockkit-column":d?void 0:o,style:b===void 0?void 0:{left:b.x,top:b.y,width:b.width,height:b.height},onPointerDown:()=>{d&&s.raise(a.id)},onClick:()=>{!d&&e.activePaneId!==a.id&&t.onFocusPane(a.id)},children:[(0,F.jsx)(`div`,{className:kX.tabHostHeader,children:f&&(d?(0,F.jsx)(eZ,{paneId:a.id,tab:i,labels:t.labels,intents:r,renderTabTitle:t.renderTabTitle,canCloseTab:t.canCloseTab,drag:s.drag}):(0,F.jsx)(qX,{state:e,pane:a,callbacks:t}))}),(0,F.jsxs)(`div`,{ref:v,className:n(kX.tabHostBody,d?kX.floatBody:kX.paneBody),children:[h&&(m||u&&f)?t.renderTab(i):null,!d&&(0,F.jsx)(JX,{pane:a,callbacks:t})]}),d&&(0,F.jsx)(`div`,{className:kX.floatResize,"data-dockkit-float-resize":a.id,onPointerDown:e=>{s.drag(`resize`,a.id,e)}})]})})}function nZ(e){let{state:t,callbacks:r,preview:i}=e,a=(0,P.useRef)(void 0),o={...r,onFocusTab:e=>{a.current=CJ(t,e).activeTabId===e?void 0:{tabId:e,origin:document.activeElement},r.onFocusTab(e)}},s=hJ(t,t.rootId);if(s.kind===`split`&&(s.axis!==`row`||s.children.length!==2))throw Error(`DockLayout requires one pane or two horizontally split panes`);let c=s.kind===`pane`?[s]:s.children.map(e=>gJ(t,e)),l=s.kind===`split`?i?.splitId===s.id?i.sizes:s.sizes:[1],u=$X(t,e.intents),d=l.map(e=>`minmax(0, ${e}fr)`).join(` 0px `);return(0,F.jsxs)(`div`,{className:kX.tabLayout,"data-dockkit-split":s.kind===`split`?s.id:void 0,style:{gridTemplateColumns:d},children:[Object.values(t.tabs).sort((e,t)=>e.id.localeCompare(t.id)).map(n=>{let r=CJ(t,n.id);return(0,F.jsx)(tZ,{...e,callbacks:o,tab:n,pane:r,column:c.findIndex(e=>e.id===r.id),floats:u,focusRequest:a},n.id)}),c.filter(e=>e.tabs.length===0).map(e=>(0,F.jsx)(`div`,{className:kX.emptyTabHost,"data-dockkit-empty":!0,style:{gridColumn:c.indexOf(e)*2+1,gridRow:1},children:(0,F.jsx)(YX,{state:t,pane:e,callbacks:r})},e.id)),s.kind===`split`&&(0,F.jsx)(`div`,{className:n(kX.divider,kX.tabLayoutDivider),"data-dockkit-divider":`${s.id}:0`,style:{gridColumn:2,gridRow:1},onPointerDown:e=>{r.onDividerPressed(s.id,0,e)}})]})}var rZ={draggingTabId:void 0,dropTarget:void 0,sizes:void 0},iZ=new Map,aZ=()=>!0;function oZ(e,t,n,r,i,a){for(let[o,s]of fX(e)){let e=s.getBoundingClientRect();if(!kY(e,t,n))continue;let c=s.querySelector(`[data-dockkit-strip]`);if(c!==null&&kY(c.getBoundingClientRect(),t,n))return{kind:`strip`,paneId:o,index:jY([...c.querySelectorAll(`[data-dockkit-tab]`)].map(e=>e.getBoundingClientRect()),t)};let l=a===`horizontal`?r&&_X(i,o).row?t<e.x+e.width/2?`left`:`right`:`center`:AY(e,t,n);if(l!==`center`){let e=_X(i,o),t=l===`left`||l===`right`?e.row:e.column;if(!r||!t)return}return{kind:`zone`,paneId:o,zone:l}}}function sZ(e,t,n,r){let i=(e.axis===`row`?t:n)-e.origin,a=e.extent>0?i/e.extent:0;return OY(FY(e.sizes,e.index,a),r)}var cZ=1e-9;function lZ(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&Math.abs(e-r)<cZ})}function uZ({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=bY,hideSplitWhenBlocked:m=!1}){let h=(0,P.useRef)(null),[g,_]=(0,P.useState)(rZ),[v,y]=(0,P.useState)(iZ),b=xX(()=>{_(rZ)}),x=(0,P.useCallback)(e=>{let t=h.current;t!==null&&e(t)},[]),S=(0,P.useCallback)(()=>{x(e=>{let t=gX(e,m);y(e=>vX(e,t)?e:t)})},[x,m]);(0,P.useLayoutEffect)(()=>{S()}),(0,P.useEffect)(()=>{u?.(v)},[v,u]),(0,P.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(!PY(a,o,n.clientX,n.clientY))return;s=!0}_({...rZ,draggingTabId:e,dropTarget:oZ(r,n.clientX,n.clientY,t,v,f)})},up:n=>{if(!s)return;let a=oZ(r,n.clientX,n.clientY,t,v,f);if(a===void 0){if(kY(r.getBoundingClientRect(),n.clientX,n.clientY))return;i.floatTab(e,RY(n.clientX,n.clientY,xY))}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=_J(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=>{_({...rZ,sizes:{splitId:t,sizes:sZ(c,e.clientX,e.clientY,p)}})},up:e=>{let n=sZ(c,e.clientX,e.clientY,p);lZ(n,c.sizes)||i.resizeSplit(t,n)}})},splitBlock:e=>t?_X(v,e).row?void 0:`width`:`budget`,hideSplitWhenBlocked:m,canAddTab:n??aZ,canCloseTab:r??aZ,dropTarget:g.dropTarget,horizontalDrops:f===`horizontal`,draggingTabId:g.draggingTabId,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chromePaneId:LJ(e),chrome:l};return(0,F.jsx)(`div`,{className:kX.surface,ref:h,"data-dockkit-surface":!0,"data-dockkit-drop-zones":f,children:d(C,g.sizes)})}function dZ(e){return(0,F.jsx)(uZ,{...e,draw:(t,n)=>(0,F.jsx)(nZ,{...e,callbacks:t,preview:n})})}var fZ={session:`_session_nj5n1_24`,panel:`_panel_nj5n1_32`,iconButton:`_iconButton_nj5n1_121`,collapseGlyph:`_collapseGlyph_nj5n1_147`,panelBody:`_panelBody_nj5n1_151`,unavailable:`_unavailable_nj5n1_157`,tabTitle:`_tabTitle_nj5n1_165`,tabBody:`_tabBody_nj5n1_169`};function pZ(){return(0,F.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,F.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 mZ(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.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,F.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 hZ({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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(hO,{label:c,shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:fZ.iconButton,"aria-label":c,"aria-keyshortcuts":l?.aria,"data-sidebar-right-mode":s,onClick:o,children:t?(0,F.jsx)(mZ,{}):(0,F.jsx)(pZ,{})})}),(0,F.jsx)(hO,{label:i(`chrome.collapse`),shortcutKeys:u?.keys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:fZ.iconButton,"aria-label":i(`chrome.collapseAria`),"aria-keyshortcuts":u?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{r.toggleExpanded(e)},children:(0,F.jsx)(te,{className:fZ.collapseGlyph})})})]})}function gZ(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 _Z={"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":`这类内容还没有可用的查看方式。`},vZ={"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.`},yZ={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`},bZ=(0,P.forwardRef)(function({variant:e=`ghost`,size:t=`md`,icon:r,className:i,children:a,...o},s){return(0,F.jsxs)(`button`,{ref:s,type:`button`,className:n(yZ.button,yZ[e],yZ[t],i),...o,children:[r!=null&&(0,F.jsx)(`span`,{className:yZ.icon,children:r}),a]})}),xZ={button:`_button_11lrx_2`,icon:`_icon_11lrx_15`};function SZ(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=>!u(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||!p(e.label)||!p(e.description)||e.panelTitle!==void 0&&!p(e.panelTitle)||typeof e.icon!=`function`||!t.some(t=>t.kind===e.kind)))throw Error(`Invalid workbench entry`)}return n}function CZ(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 wZ=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)}}},TZ=(e,t=null)=>({sessionId:t,generation:e,plugins:[],errors:[],ready:!1}),EZ=class{environment;run=null;snapshot=TZ(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(TZ(n.generation,e));try{let r=await CZ(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 wZ(e=>this.error(n,t.id,`dispose`,e));n.scopes.push(r);let i=r.context(e),a=`load`;try{let e=await CZ(this.environment.loadModule(t.client),n.controller.signal,this.environment.loadTimeoutMs??1e4);if(this.run!==n)break;a=`validate`;let o=SZ(e?.default,t.id);if(t.style&&(a=`style`,await CZ(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(TZ(this.generation))}}},DZ={"builtin:@pi-webapp/files":()=>N(()=>import(`./plugin-DJaiYPEQ.js`),__vite__mapDeps([34,2,3,35,36])),"builtin:@pi-webapp/terminal":()=>N(()=>import(`./plugin-DObSoug1.js`),__vite__mapDeps([37,2,3,38])),"builtin:@pi-webapp/git":()=>N(()=>import(`./plugin-3Ib-WXMi.js`),__vite__mapDeps([39,2,3,35,36,40]))};function OZ(e){let t=DZ[e];if(!t)throw Error(`Unknown builtin plugin module`);return t()}function kZ(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 AZ(e,t,n,r=0){let[i]=(0,P.useState)(()=>new EZ({loadModule:e=>e.startsWith(`builtin:`)?OZ(e):import(e),loadStyle:kZ})),a=(0,P.useSyncExternalStore)(i.subscribe,i.getSnapshot),o=(0,P.useRef)(new Map);a.sessionId&&a.ready&&o.current.set(a.sessionId,a.plugins.filter(e=>e.definition.workbench)),(0,P.useEffect)(()=>{if(e&&t)return globalThis.__PI_WEBAPP_REACT__=P,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 jZ=class extends P.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 MZ(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 NZ({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,F.jsx)(jZ,{id:r.id,children:(0,F.jsx)(i,{...MZ({...t,interaction:n},r.id)})},`${r.instanceId??r.id}/${n.requestId}`)}function PZ({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,F.jsx)(jZ,{id:a.plugin.id,children:(0,F.jsx)(o,{...MZ(t,a.plugin.id),call:n,result:r,running:i})})}function FZ({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,F.jsx)(F.Fragment,{children:r.map(({plugin:e,item:t})=>{let r=t.component;return(0,F.jsx)(jZ,{id:e.id,children:(0,F.jsx)(r,{...MZ(n,e.id)})},`${e.instanceId??e.id}/${t.id}`)})})}function IZ(e,t=[]){let n=(0,P.useRef)(new Map),{controller:r,resources:i,owners:a}=(0,P.useMemo)(()=>{let t=e??``,r=n.current.get(t);if(!r){let e=e=>({id:e,kind:`guide`,contentId:`guide`,title:`开始`});r={controller:new sX({makeInitialTab:e,makePaneTab:e}),resources:new Map,owners: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)}),n.current.set(t,r)}return r},[e]);(0,P.useEffect)(()=>{for(let[t,r]of n.current)for(let n of r.resources.values())n.activate?.(t===e)},[e]),(0,P.useEffect)(()=>{for(let e of n.current.values())for(let[n,r]of[...e.owners])t.includes(r)&&e.controller.closeTab(n)},[t]),(0,P.useEffect)(()=>()=>{for(let e of n.current.values())for(let t of e.resources.values())t.dispose?.()},[]);let o=(0,P.useSyncExternalStore)(r.subscribe,r.getSnapshot),s=gJ(o.state,o.state.activePaneId).activeTabId,c=s?vJ(o.state,s):void 0;return{controller:r,snapshot:o,panelId:c?.kind===`plugin`?c.contentId:null,resources:i,owners:a,expand:()=>{Object.keys(r.getSnapshot().state.tabs).length||r.openContent({kind:`guide`,contentId:`guide`,title:`开始`}),r.setExpanded(!0)},openContent:(0,P.useCallback)((e,t,n,i,o)=>{let s=r.getSnapshot().state,c=i&&gJ(s,i).host===`dock`?i:GY(s),l=gJ(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??r.openContent({kind:e,contentId:t,title:n,paneId:c,revealIfOpened:e!==`files`});return o&&a.set(f,o),d&&r.focusTab(d),u&&r.closeTab(u),r.setExpanded(!0),requestAnimationFrame(()=>document.querySelector(`[data-dockkit-content="${f}"]`)?.focus()),f},[r,a]),shown:o.state.expanded&&Object.keys(o.state.tabs).length>0}}function LZ({panel:e,width:t,narrow:n,focus:i,onExitFocus:a,plugins:o,props:s,cwd:c}){let{controller:l,snapshot:u,openContent:d}=e,{state:f}=u,[p,m]=(0,P.useState)(``),h=(0,P.useRef)(!1),g=(0,P.useMemo)(()=>new Proxy(l,{get(e,t){if(t===`closeTab`)return t=>{if(h.current)return;h.current=!0;let n=s.session?.sessionId??``;op.flush(n).then(async()=>{let r=document.querySelector(`[data-dockkit-content="${CSS.escape(t)}"]`);r&&await op.retireWithin(n,r),m(``),e.closeTab(t)}).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>{h.current=!1})};let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}}),[l,s.session?.sessionId]),_=n||f.mode===`fullscreen`,v=s.locale===`zh`?_Z:vZ,y=e=>v[e]??e,b=e=>typeof e==`string`?e:e[s.locale],x=o.flatMap(e=>(e.definition.workbench?.panels??[]).map(t=>({plugin:e,contribution:t}))),S=()=>{a(),l.setExpanded(!1),requestAnimationFrame(()=>document.querySelector(`[data-sidebar-right-expand]`)?.focus())},C=n?`100vw`:t;return(0,F.jsx)(`div`,{className:fZ.panel,style:{width:C,"--dsh-sidebar-width":typeof C==`number`?`${C}px`:C},"data-sidebar-right-session":s.session?.sessionId,"data-sidebar-right-panel":_?`fullscreen`:i?`focus`:`push`,"data-sidebar-right-open":e.shown||void 0,"aria-hidden":!e.shown||void 0,children:(0,F.jsxs)(`div`,{className:fZ.panelBody,children:[p&&(0,F.jsx)(`p`,{role:`alert`,children:p}),(0,F.jsx)(dZ,{state:f,canSplit:u.canSplit&&wJ(f).length<2,dropZones:`horizontal`,minPaneFraction:.2,intents:g,labels:gZ(y),active:!0,keepMounted:()=>!0,renderTab:t=>{let n=CJ(f,t.id).id,i=f.expanded&&gJ(f,n).activeTabId===t.id;if(t.kind===`guide`)return(0,F.jsx)(`div`,{className:ue.guide,children:(0,F.jsxs)(`div`,{className:ue.guideGrid,role:`group`,"aria-label":r(`工作区工具`,`Workspace tools`),children:[o.map(e=>{let t=e.definition.workbench?.entry;if(!t)return null;let r=t.icon;return(0,F.jsxs)(`button`,{type:`button`,className:ue.guideEntry,disabled:!s.session||!c,"aria-label":b(t.label),onClick:()=>d(t.kind,t.multiple?ge():`workspace`,b(t.panelTitle??t.label),n,e.id),children:[(0,F.jsx)(`span`,{className:ue.guideIcon,"aria-hidden":`true`,children:(0,F.jsx)(r,{size:24})}),(0,F.jsxs)(`span`,{className:ue.guideCopy,children:[(0,F.jsx)(`span`,{className:ue.guideLabel,children:b(t.label)}),(0,F.jsx)(`span`,{className:ue.guideDescription,children:b(t.description)})]})]},e.id)}),!o.some(e=>e.definition.workbench?.entry)&&(0,F.jsx)(`p`,{className:ue.state,children:r(`没有已启用的工作区插件,可在设置中启用。`,`No workspace plugins enabled. Enable one in Settings.`)})]})});let a=x.find(e=>e.contribution.kind===t.kind);if(a&&s.session){let{plugin:r,contribution:o}=a;e.owners.set(t.id,r.id);let c=o.component;return(0,F.jsx)(jZ,{id:r.id,children:(0,F.jsx)(c,{sendMessage:s.sendMessage,session:s.session,locale:s.locale,visible:i,contentId:t.contentId,title:t.title,renderMarkdown:s.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},open:(e,t,i)=>d(e,t,i,n,r.id)})})}return(0,F.jsx)(FZ,{plugins:o,slot:`rightbar.panel`,props:{...s,panelId:t.contentId}})},renderTabTitle:e=>{if(e.kind===`guide`)return y(`tab.guide.title`);let t=x.find(t=>t.contribution.kind===e.kind);return t?(0,F.jsx)(`span`,{className:ue.title,children:t.contribution.title?.(e.contentId,e.title)??e.title}):(0,F.jsx)(FZ,{plugins:o,slot:`rightbar.title`,props:{...s,panelId:e.contentId}})},chrome:(0,F.jsx)(hZ,{sessionId:s.session?.sessionId??``,fullscreen:_||i,focus:i,shortcuts:[],t:y,actions:{toggleExpanded:S},toggleFullscreen:()=>i?a():n?S():l.setMode(_?`push`:`fullscreen`)})})]})})}function RZ({panel:e,locale:t}){if(e.shown)return null;let n=t===`zh`?_Z:vZ;return(0,F.jsx)(hO,{label:n[`chrome.expand`],side:`bottom`,delayMs:500,children:(0,F.jsx)(bZ,{size:`sm`,className:xZ.button,"aria-label":n[`chrome.expandAria`],"data-sidebar-right-expand":!0,onClick:e.expand,children:(0,F.jsx)(te,{className:xZ.icon})})})}function zZ(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 BZ=`pi:hosted:unconfirmed-views:v1`,VZ=`pi:hosted:unconfirmed-view:v1:`,HZ=`pi:hosted:retired-view:v1:`,UZ=``,WZ=()=>{UZ=`View recovery journal could not be read. Its original data has been retained.`},GZ=()=>{UZ=`View recovery journal could not be stored. Keep this page open and download local drafts.`};function KZ(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))&&[`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 qZ(){try{if(typeof sessionStorage>`u`)return[];let e=sessionStorage.getItem(BZ);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t)||!t.every(KZ))throw Error(`Invalid view recovery journal`);return t}catch{return WZ(),[]}}function JZ(e){if(typeof localStorage>`u`)return null;let t=localStorage.getItem(HZ+e);if(t!==null){if(JSON.parse(t)!==!0)throw Error(`Invalid view retirement receipt`);return`retired`}let n=localStorage.getItem(VZ+e);if(!n)return null;let r=JSON.parse(n);if(!KZ(r)||r.viewToken!==e)throw Error(`Invalid durable view recovery record`);return r}function YZ(e,t){return e.sessionId===t.sessionId&&e.pluginId===t.pluginId&&e.generation===t.generation&&e.mountId===t.mountId}var XZ=qZ(),ZZ=new Set(XZ.map(e=>e.viewToken));function QZ(){let e=new Map(XZ.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(VZ)?VZ:n?.startsWith(HZ)?HZ:void 0;if(!r)continue;let i=n.slice(r.length);try{let t=JZ(i);if(t===`retired`)e.delete(i);else if(t){let n=e.get(i);if(n&&!YZ(n,t))throw Error(`Conflicting view recovery identity`);e.set(i,{...t,discovered:!ZZ.has(i)})}}catch{WZ()}}}catch{WZ()}return[...e.values()]}var $Z=QZ(),eQ=[...$Z];function tQ(){return eQ=eQ.filter(e=>{try{return JZ(e.viewToken)!==`retired`}catch{return WZ(),!0}}),eQ.filter(e=>$Z.some(t=>t.viewToken===e.viewToken))}var nQ=new Map,rQ=`pi:hosted:recovery-draft:v1:`,iQ=()=>UZ;function aQ(){if(UZ)return!1;try{return typeof sessionStorage<`u`&&sessionStorage.setItem(BZ,JSON.stringify(eQ.filter(e=>ZZ.has(e.viewToken)))),!0}catch{return GZ(),!1}}function oQ(e){if(UZ)return!1;try{if(typeof localStorage>`u`)return!0;let t=JZ(e.viewToken);if(t===`retired`)return!1;if(t&&!YZ(t,e))throw Error(`Conflicting view recovery identity`);let{discovered:n,...r}={...e,...t?.frameStarted?{frameStarted:!0}:{},...t?.retained?{retained:!0}:{},backups:[...new Map([...t?.backups??[],...e.backups??[]].map(e=>[e.key,e])).values()]};return localStorage.setItem(VZ+e.viewToken,JSON.stringify(r)),!0}catch{return GZ(),!1}}function sQ(e,t,n){ZZ.add(t),eQ=eQ.filter(e=>e.viewToken!==t);let r={...e,viewToken:t,kind:n.kind,contentId:n.contentId,frameStarted:!1,createdAt:Date.now()};eQ.push(r),oQ(r),aQ()}function cQ(e){let t=eQ.find(t=>t.viewToken===e);if(!t||t.retained)return!1;let n={...t,frameStarted:!0};return oQ(n)?(eQ=eQ.map(t=>t.viewToken===e?n:t),aQ()):!1}function lQ(e){eQ=eQ.filter(t=>t.viewToken!==e),ZZ.delete(e);try{JZ(e),typeof localStorage<`u`&&localStorage.setItem(HZ+e,JSON.stringify(!0))}catch{WZ()}aQ()}async function uQ(e){if(e.discovered&&(e.kind===`controller`||e.frameStarted!==!0))return;let t=(await qk.view({...e,operation:`reconcile`})).recovery;return t?.state===`unconfirmed`&&e.frameStarted===!1&&ZZ.has(e.viewToken)&&(await qk.view({...e,operation:`cancel-initialization`}),lQ(e.viewToken),t={...t,state:`retired`}),(t?.state===`retired`||t?.state===`absent`&&e.kind===`controller`)&&lQ(e.viewToken),t}var dQ=3e5,fQ=new Set([`invalid_scope`,`unknown_plugin`]),pQ=`@chengzhiyi/pi-excalidraw`;function mQ(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 hQ(e,t){if(e.kind===`controller`)return!0;let n=yQ(e);if(!n.length)return!0;if(e.pluginId!==pQ||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 qk.action({sessionId:e.sessionId,pluginId:e.pluginId,generation:t,action:`get`,input:{id:n}}),a=mQ(JSON.parse(r.json).elements);if(!a||a!==mQ(i?.scene?.elements))return!1}catch{return!1}}return!0}async function gQ(e,t,n=Date.now()){if(e.retained)return{state:`retained`};let r=e.frameStarted===!0||e.createdAt===void 0||n-e.createdAt>dQ,i=async()=>await hQ(e,t)?(lQ(e.viewToken),!0):!1,a;try{a=(await qk.view({...e,operation:`status`})).recovery}catch(t){let n=t?.code;if(r&&typeof n==`string`&&fQ.has(n)&&await i())return{state:`retired`};if(t instanceof Error&&t.message===`Unknown view operation`)return uQ(e);throw t}if(a?.state===`retired`)return lQ(e.viewToken),a;if(a?.state===`absent`)return r&&await i()?{state:`retired`}:r||e.discovered?a:uQ(e);if(a?.state===`unconfirmed`&&a.stale){if(e.kind===`controller`)return uQ({...e,discovered:!1});if(!a.dirty&&!a.busy&&await hQ(e,t))try{return await qk.view({...e,operation:`close`}),lQ(e.viewToken),{state:`retired`}}catch{return a}return a}return a?.state===`unconfirmed`&&!e.discovered?uQ(e):a}async function _Q(e){let t=await qk.view({...e,operation:`recover`,confirmation:`retain-unconfirmed-edits`});if(t.recovery?.state===`retired`){lQ(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.`);eQ=eQ.map(t=>t.viewToken===e.viewToken?{...t,retained:!0}:t);let n=eQ.find(t=>t.viewToken===e.viewToken);n&&oQ(n),aQ()}async function vQ(e){(await qk.view({...e,operation:`reconcile`})).recovery?.state!==`absent`&&await qk.view({...e,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),lQ(e.viewToken)}function yQ(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(`${rQ}${e.viewToken}:`))continue;let r=nQ.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 $Z){if(e.kind===`controller`)continue;let t=yQ(e);t.length&&(e.backups=t.map(t=>{let n=`${rQ}${e.viewToken}:${t.name}`;nQ.set(n,t.json);try{localStorage.getItem(n)||localStorage.setItem(n,t.json)}catch{UZ=`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 eQ)oQ(e);aQ();function bQ(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`,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 xQ(e){let{blob:t,name:n}=bQ(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 SQ={entry:`_entry_ic7m3_1`,trigger:`_trigger_ic7m3_3`,dialog:`_dialog_ic7m3_5`,content:`_content_ic7m3_8`,list:`_list_ic7m3_10`,item:`_item_ic7m3_11`,error:`_error_ic7m3_14`,history:`_history_ic7m3_20`,actions:`_actions_ic7m3_24`};function CQ({sessionId:e,locale:t,openRecovered:n}){let[r,i]=(0,P.useState)(tQ),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(``),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(0),h=(e,n)=>t===`zh`?e:n,[g,_]=(0,P.useState)(new Set),[v,y]=(0,P.useState)(new Set),b=r.filter(e=>v.has(e.viewToken)&&!g.has(e.viewToken)),x=iQ(),S=e=>{lQ(e),i(t=>t.filter(t=>t.viewToken!==e))};if((0,P.useEffect)(()=>{o(!1),c(null),u(``)},[e]),(0,P.useEffect)(()=>{let e=!0;return(async()=>{let t=new Map;try{t=new Map((await qk.catalog()).plugins.flatMap(e=>e.generation===void 0?[]:[[e.pluginId,e.generation]]))}catch{}let n=e=>y(t=>new Set(t).add(e));for(let a of r){if(!e)return;try{let r=await gQ(a,t.get(a.pluginId));if(!e)return;r?.state===`retired`||r?.state===`absent`&&a.kind===`controller`?S(a.viewToken):r?.state===`retained`&&i(e=>e.map(e=>e.viewToken===a.viewToken?{...e,retained:!0}:e)),_(e=>{let t=new Set(e);return a.discovered&&r?.state===`unconfirmed`&&r.stale===!1?t.add(a.viewToken):t.delete(a.viewToken),t}),n(a.viewToken)}catch(t){if(!e)return;if(t instanceof Error&&t.message===`Unknown view operation`){y(new Set(r.map(e=>e.viewToken)));return}n(a.viewToken),u(String(t))}}})(),()=>{e=!1}},[e,p]),!b.length&&!x)return null;let C=e=>({controller:h(`后台控制器`,`Controller`),workspace:h(`工作区`,`Workspace`),editor:h(`编辑器`,`Editor`),tool:h(`工具预览`,`Tool preview`)})[e]??h(`插件视图`,`Plugin view`),w=s?.operation===`retain`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:SQ.entry,"data-hosted-recovery":!0,children:[(0,F.jsx)(`p`,{children:h(`刷新或关闭窗口后,旧插件视图可能尚未完成保存和关闭确认;部分记录也可能属于仍打开的窗口。请先核对原窗口及备份,再保留失联视图的恢复记录,解除升级等操作的阻塞。`,`After reloading or closing a window, previous plugin views may lack save and close confirmations. Some records may belong to windows still open. Check original windows and backups, then retain disconnected views for recovery to unblock updates and other operations.`)}),(0,F.jsxs)(`button`,{type:`button`,className:SQ.trigger,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:[h(`插件视图恢复`,`Plugin view recovery`),` · `,b.length]})]}),(0,F.jsx)(OO,{open:a,onClose:()=>o(!1),title:h(`检查之前的插件视图`,`Review previous plugin views`),closeLabel:h(`关闭`,`Close`),className:SQ.dialog,footer:(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>{u(``),m(e=>e+1)},children:h(`重新检查`,`Check again`)}),children:(0,F.jsxs)(`div`,{className:SQ.content,children:[(0,F.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,F.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,F.jsx)(`div`,{className:SQ.list,children:b.map((t,r)=>(0,F.jsxs)(`section`,{className:SQ.item,"data-unconfirmed-view":t.mountId,children:[(0,F.jsxs)(`h3`,{children:[C(t.kind),` `,r+1]}),t.retained&&(0,F.jsx)(`p`,{children:h(`失联视图的恢复记录已保留。插件可继续操作;旧稿是否完整仍需核对。`,`Disconnected view recovery record retained. Plugin operations may continue; the old draft still needs verification.`)}),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:h(`视图信息`,`View details`)}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:h(`会话`,`Session`)}),(0,F.jsx)(`dd`,{children:t.sessionId}),(0,F.jsx)(`dt`,{children:h(`插件`,`Plugin`)}),(0,F.jsx)(`dd`,{children:t.pluginId}),(0,F.jsx)(`dt`,{children:h(`版本代次`,`Generation`)}),(0,F.jsx)(`dd`,{children:t.generation}),(0,F.jsx)(`dt`,{children:h(`视图标识`,`View ID`)}),(0,F.jsx)(`dd`,{children:t.mountId}),t.contentId&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:h(`内容标识`,`Content ID`)}),(0,F.jsx)(`dd`,{children:t.contentId})]})]})]}),(0,F.jsxs)(`div`,{className:SQ.actions,children:[yQ(t).map(e=>(0,F.jsxs)(EO,{variant:`outline`,disabled:d,onClick:()=>xQ({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,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>{o(!1),n(t.contentId)},children:h(`打开图稿并核对备份`,`Open drawing and compare backup`)}),!t.retained&&(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c({item:t,operation:`retain`}),children:h(`保留恢复记录并解除阻塞`,`Retain recovery record and unblock`)}),(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c({item:t,operation:`discard`}),children:h(`丢弃此视图的未确认修改`,`Discard this view's unconfirmed edits`)})]})]},t.viewToken))}),(l||x)&&(0,F.jsxs)(`div`,{role:`alert`,className:SQ.error,children:[h(`未能确认部分视图,请保留恢复记录并重试。`,`Some views could not be verified. Keep their recovery records and retry.`),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:h(`诊断信息`,`Diagnostics`)}),l||x]})]})]})}),(0,F.jsx)(OO,{open:!!s&&a,onClose:()=>c(null),title:w?h(`保留此视图用于恢复?`,`Retain this view for recovery?`):h(`丢弃此视图的未确认修改?`,`Discard this view's unconfirmed edits?`),closeLabel:h(`关闭`,`Close`),description:w?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.`):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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c(null),children:h(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:d,onClick:()=>{if(!s||d)return;let{item:e,operation:t}=s;f(!0),u(``),(t===`retain`?_Q(e):vQ(e)).then(()=>{t===`retain`?i(tQ()):S(e.viewToken),c(null)}).catch(e=>{u(String(e)),c(null)}).finally(()=>f(!1))},children:w?h(`保留恢复记录`,`Retain record`):h(`确认丢弃`,`Discard edits`)})]})})]})}var wQ=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 Kk(`/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||wQ.wake()});var TQ=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(!cQ(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=wQ){this.poller=a,this.identity=e,this.adapter=t,this.mount=n,this.reconnect=r,this.failed=i}async start(){this.token=crypto.randomUUID(),sQ(this.identity,this.token,this.mount);let e=await qk.view({...this.identity,operation:`register`,kind:this.mount.kind,viewToken:this.token});e.viewToken!==this.token&&(lQ(this.token),this.token=e.viewToken,sQ(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 qk.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 qk.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 qk.view({...this.identity,viewToken:this.token,operation:`change`,dirty:!1,busy:!1}),await qk.view({...this.identity,viewToken:this.token,operation:`close`})),this.closed=!0,lQ(this.token))})().catch(e=>{throw this.closing=void 0,e})),this.closing)}},EQ={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 DQ({title:e,tool:t,locale:n,children:r}){let[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(!1),c=(0,P.useId)(),l=(e,t)=>n===`zh`?e:t,u=t.result?.blocks.filter(e=>e.kind===`text`).map(e=>e.text??``).join(`
|
|
500
|
+
`,c),this.lastText=e,this.lastRendered=s,this.lastRendered}},pJ=(0,P.memo)(function({text:e,streaming:t=!1,labels:r,fileMentions:i,pathImages:a,variant:o=`body`}){let s=(0,P.useRef)(null),c=(0,P.useRef)(r),l=(0,P.useMemo)(()=>t?((s.current===null||c.current!==r)&&(s.current=new fJ(r),c.current=r),s.current.render(e)):(s.current=null,dJ(e,r,i,a)),[e,t,r,i,a]);return(0,F.jsx)(`div`,{className:n(Mq.markdown,o===`compact`&&Mq.compact),"data-markdown-variant":o===`compact`?o:void 0,children:l})});function mJ(e,t){throw Error(`${t}: unhandled ${JSON.stringify(e)}`)}function hJ(e,t){let n=e.nodes[t];if(n===void 0)throw Error(`layout: unknown node ${t}`);return n}function gJ(e,t){let n=hJ(e,t);if(n.kind!==`pane`)throw Error(`layout: ${t} is not a pane`);return n}function _J(e,t){let n=hJ(e,t);if(n.kind!==`split`)throw Error(`layout: ${t} is not a split`);return n}function vJ(e,t){let n=e.tabs[t];if(n===void 0)throw Error(`layout: unknown tab ${t}`);return n}function yJ(e){if(e.host!==`float`||e.rect===void 0)throw Error(`layout: ${e.id} is not floating`);return e.rect}function bJ(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 xJ(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 SJ(e,t){for(let n of Object.values(e.nodes))if(n.kind===`split`&&n.children.includes(t))return n}function CJ(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 wJ(e){let t=[],n=r=>{let i=hJ(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 TJ(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 EJ(e){return Object.entries(e)}function DJ(e){return Object.keys(e)}function OJ(e,t){let n={};for(let[r,i]of EJ(e.nodes))r in t||(n[r]=i);for(let[e,r]of EJ(t))r!==null&&(n[e]=r);return{...e,nodes:n}}function kJ(e,t){let n={};for(let[r,i]of EJ(e.tabs))r in t||(n[r]=i);for(let[e,r]of EJ(t))r!==null&&(n[e]=r);return{...e,tabs:n}}function AJ(e,t,n){let r=Math.max(0,Math.min(t,e.length));return[...e.slice(0,r),n,...e.slice(r)]}function jJ(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function MJ(e,t){let n=jJ(e,t);if(n.length!==0)return n[Math.max(0,t-1)]}function NJ(e,t,n){return{...e,tabs:t,activeTabId:n}}function PJ(e,t,n){let r=SJ(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 OJ(e,{[r.id]:{...r,children:i}})}function FJ(e,t){let n=hJ(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=hJ(e,r)}return n.id}function IJ(e){return FJ(e,e=>e.children[0])}function LJ(e){return FJ(e,e=>e.axis===`row`?e.children.at(-1):e.children[0])}function RJ(e,t){let n={};for(let r of t)n[r]=gJ(e,r).activeTabId;return{type:`restoreFocus`,activePaneId:e.activePaneId,floats:e.floats,paneActiveTabs:n}}function zJ(e,t){return[...e.filter(e=>e!==t),t]}function BJ(e,t){return e.activePaneId===t?{...e,activePaneId:IJ(e)}:e}function VJ(e){return{kind:`pane`,id:e,host:`dock`,tabs:[],activeTabId:void 0,rect:void 0}}function HJ(e,t){if(e.nodes[t]!==void 0)throw Error(`layout: node ${t} already exists`)}function UJ(e,t){if(e.tabs[t]!==void 0)throw Error(`layout: tab ${t} already exists`)}function WJ(e,t){if(gJ(e,t.paneId).host!==`dock`)throw Error(`layout: split requires a docked pane`);HJ(e,t.newPaneId);let n=VJ(t.newPaneId),r=SJ(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=AJ(r.children,a,t.newPaneId),s=r.sizes.flatMap((e,t)=>t===i?[e/2,e/2]:[e]);return{state:OJ(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}]}}HJ(e,t.newSplitId);let i=PJ(e,t.paneId,t.newSplitId),a=t.direction===`after`?[t.paneId,t.newPaneId]:[t.newPaneId,t.paneId];return{state:OJ(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 GJ(e,t){let n=gJ(e,t.paneId);if(n.tabs.length>0)throw Error(`layout: merge requires an empty pane`);let r=RJ(e,[]);if(n.host===`float`){let i=bJ(e,t.paneId);return{state:BJ(OJ({...e,floats:jJ(e.floats,i)},{[t.paneId]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`float`,index:i}},r]}}let i=SJ(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=jJ(i.children,a),s=TJ(jJ(i.sizes,a));return{state:BJ(OJ(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:BJ(OJ(PJ(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 KJ(e,t){let n=gJ(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: openTab requires a docked pane`);UJ(e,t.tab.id);let r=RJ(e,[n.id]);return{state:{...OJ(kJ(e,{[t.tab.id]:t.tab}),{[n.id]:NJ(n,AJ(n.tabs,t.index,t.tab.id),t.tab.id)}),activePaneId:n.id},inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function qJ(e,t){let n=gJ(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: insertTab requires a docked pane`);UJ(e,t.tab.id);let r=RJ(e,[n.id]),i=AJ(n.tabs,t.index,t.tab.id);return{state:OJ(kJ(e,{[t.tab.id]:t.tab}),{[n.id]:NJ(n,i,n.activeTabId??t.tab.id)}),inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function JJ(e,t){let n=vJ(e,t.tabId),r=CJ(e,t.tabId),i=r.tabs.indexOf(t.tabId),a=RJ(e,[r.id]);if(r.host===`float`){let i=bJ(e,r.id);return{state:BJ(kJ(OJ({...e,floats:jJ(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?MJ(r.tabs,i):r.activeTabId;return{state:kJ(OJ(e,{[r.id]:NJ(r,jJ(r.tabs,i),o)}),{[t.tabId]:null}),inverse:[{type:`insertTab`,paneId:r.id,tab:n,index:i},a]}}function YJ(e,t){if(HJ(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)UJ(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},RJ(e,[])],a=t.attach;switch(a.mode){case`child`:{let r=_J(e,a.parentId),o=AJ(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:OJ(kJ(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:OJ(kJ(PJ(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=AJ(e.floats,a.index,t.pane.id);return{state:OJ(kJ({...e,floats:r},n),{[t.pane.id]:t.pane}),inverse:i}}default:return mJ(a,`layout: insertPane attachment`)}}function XJ(e,t){let n=CJ(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: moveTab source must be docked; use unfloat`);let r=gJ(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=RJ(e,[n.id,r.id]),o=n.activeTabId===t.tabId?MJ(n.tabs,i):n.activeTabId;return{state:{...OJ(e,{[n.id]:NJ(n,jJ(n.tabs,i),o),[r.id]:NJ(r,AJ(r.tabs,t.index,t.tabId),t.tabId)}),activePaneId:r.id},inverse:[{type:`moveTab`,tabId:t.tabId,toPaneId:n.id,index:i},a]}}function ZJ(e,t){let n=CJ(e,t.tabId),r=n.tabs.indexOf(t.tabId),i=AJ(jJ(n.tabs,r),t.index,t.tabId);return{state:OJ(e,{[n.id]:{...n,tabs:i}}),inverse:[{type:`reorderTab`,tabId:t.tabId,index:r}]}}function QJ(e,t){let n=CJ(e,t.tabId),r=RJ(e,[n.id]),i=OJ(e,{[n.id]:{...n,activeTabId:t.tabId}}),a=n.host===`float`?zJ(i.floats,n.id):i.floats;return{state:{...i,activePaneId:n.id,floats:a},inverse:[r]}}function $J(e,t){let n=gJ(e,t.paneId),r=RJ(e,[]),i=n.host===`float`?zJ(e.floats,n.id):e.floats;return{state:{...e,activePaneId:n.id,floats:i},inverse:[r]}}function eY(e,t){let n=_J(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:OJ(e,{[n.id]:{...n,sizes:TJ(t.sizes)}}),inverse:[{type:`resize`,splitId:n.id,sizes:n.sizes}]}}function tY(e,t){vJ(e,t.tabId);let n=CJ(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: float requires a docked tab`);HJ(e,t.newPaneId);let r=n.tabs.indexOf(t.tabId),i=RJ(e,[n.id]),a=n.activeTabId===t.tabId?MJ(n.tabs,r):n.activeTabId,o=OJ(e,{[n.id]:NJ(n,jJ(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 nY(e,t){let n=gJ(e,t.paneId),r=yJ(n),i=xJ(n),a=gJ(e,t.toPaneId);if(a.host!==`dock`)throw Error(`layout: unfloat target must be docked`);let o=RJ(e,[a.id]);return{state:{...OJ({...e,floats:jJ(e.floats,bJ(e,t.paneId))},{[t.paneId]:null,[a.id]:NJ(a,AJ(a.tabs,t.index,i),i)}),activePaneId:a.id},inverse:[{type:`float`,tabId:i,newPaneId:t.paneId,rect:r},o]}}function rY(e,t,n){let r=OJ(e,{[t.id]:{...t,rect:n}});return{...r,activePaneId:t.id,floats:zJ(r.floats,t.id)}}function iY(e,t){let n=gJ(e,t.paneId),r=yJ(n);return{state:rY(e,n,{...r,x:t.x,y:t.y}),inverse:[{type:`moveFloat`,paneId:t.paneId,x:r.x,y:r.y},RJ(e,[])]}}function aY(e,t){let n=gJ(e,t.paneId),r=yJ(n);if(!(t.rect.width>0)||!(t.rect.height>0))throw Error(`layout: float size must be above zero`);return{state:rY(e,n,t.rect),inverse:[{type:`resizeFloat`,paneId:t.paneId,rect:r},RJ(e,[])]}}function oY(e,t){let n=RJ(e,DJ(t.paneActiveTabs));for(let n of t.floats)if(gJ(e,n).host!==`float`)throw Error(`layout: restoreFocus lists docked pane ${n} as floating`);let r=e;for(let[e,n]of EJ(t.paneActiveTabs)){let t=gJ(r,e);r=OJ(r,{[e]:{...t,activeTabId:n}})}return gJ(r,t.activePaneId),{state:{...r,activePaneId:t.activePaneId,floats:t.floats},inverse:[n]}}function sY(e,t){switch(t.type){case`split`:return WJ(e,t);case`merge`:return GJ(e,t);case`openTab`:return KJ(e,t);case`insertTab`:return qJ(e,t);case`closeTab`:return JJ(e,t);case`insertPane`:return YJ(e,t);case`moveTab`:return XJ(e,t);case`reorderTab`:return ZJ(e,t);case`focusTab`:return QJ(e,t);case`focusPane`:return $J(e,t);case`resize`:return eY(e,t);case`float`:return tY(e,t);case`unfloat`:return nY(e,t);case`moveFloat`:return iY(e,t);case`resizeFloat`:return aY(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 oY(e,t);default:return mJ(t,`layout: operation`)}}function cY(e,t){return t.reduce((e,t)=>sY(e,t).state,e)}var lY={entries:[],cursor:0},uY=new Set([`focusTab`,`focusPane`,`restoreFocus`]);function dY(e){return uY.has(e.type)}function fY(e,t){let n=e.entries[t];return n!==void 0&&n.ops.every(dY)}function pY(e){return e.cursor>0}function mY(e){return e.cursor<e.entries.length}function hY(e){return e.entries.flatMap(e=>e.ops)}function gY(e,t,n){if(n.length===0)return{history:e,state:t};let r=t,i=[];for(let e of n){let t=sY(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 _Y(e,t){if(!pY(e))return;let n=1;if(fY(e,e.cursor-1))for(;fY(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=sY(r,e).state;return{history:{entries:e.entries,cursor:e.cursor-n},state:r}}function vY(e,t){if(!mY(e))return;let n=1;if(fY(e,e.cursor))for(;fY(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=sY(r,e).state;return{history:{entries:e.entries,cursor:e.cursor+n},state:r}}var yY=class{current;recorded=lY;constructor(e){this.current=e}get state(){return this.current}get history(){return this.recorded}get ops(){return hY(this.recorded)}get cursor(){return this.recorded.cursor}get canUndo(){return pY(this.recorded)}get canRedo(){return mY(this.recorded)}dispatch(e){return this.dispatchAll([e])}dispatchAll(e){let t=gY(this.recorded,this.current,e);return this.recorded=t.history,this.current=t.state,this.current}undo(){let e=_Y(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}redo(){let e=vY(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}},bY=.12,xY={width:380,height:300},SY={width:220,height:140},CY=.25;function wY(e){return wJ(e).length}function TY(e){return wY(e)<4}function EY(e,t,n=CY){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 DY(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 mJ(e,`layout: dock zone`)}}function OY(e,t=bY){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 kY(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function AY(e,t,n,r=CY){return!(e.width>0)||!(e.height>0)?`center`:EY((t-e.x)/e.width,(n-e.y)/e.height,r)}function jY(e,t){let n=0;for(let r of e){if(t<r.x+r.width/2)break;n+=1}return n}var MY={divider:0,chip:100,body:48};function NY(e,t=MY){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 PY(e,t,n,r){return Math.abs(n-e)>=4||Math.abs(r-t)>=4}function FY(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 IY(e,t,n){return{...e,x:e.x+t,y:e.y+n}}function LY(e,t,n,r){return{...e,width:Math.max(r.width,e.width+t),height:Math.max(r.height,e.height+n)}}function RY(e,t,n){return{x:Math.max(0,e-zY.x),y:Math.max(0,t-zY.y),...n}}var zY={x:60,y:14},BY=24,VY={x:160,y:120},HY=[];function UY(e,t,n,r){for(let i of gJ(e,t).tabs){let t=e.tabs[i];if(t?.contentId===n&&(r===void 0||t.kind===r))return i}}function WY(e,t,n){for(let r of[...wJ(e),...e.floats]){let i=UY(e,r,t,n);if(i!==void 0)return i}}function GY(e){let t=gJ(e,e.activePaneId);return t.host===`dock`?t.id:IJ(e)}function KY(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 qY(e,t){return e.expanded===t?HY:[{type:`setExpanded`,expanded:t}]}function JY(e,t){return e.mode===t?HY:[{type:`setMode`,mode:t}]}function YY(e,t,n,r){if(!TY(e))return HY;let i=n??GY(e);if(gJ(e,i).host!==`dock`)return HY;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 XY(e,t,n,r){if(r===void 0)return HY;let i=gJ(e,n);return i.host===`dock`?[{type:`openTab`,paneId:n,tab:r(t(`tab`)),index:i.tabs.length}]:HY}function ZY(e,t,n){let r=n.revealIfOpened===!1?void 0:WY(e,n.contentId,n.kind);if(r!==void 0)return{ops:[{type:`focusTab`,tabId:r}],tabId:r};let i=n.paneId??GY(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??gJ(e,i).tabs.length}],tabId:a.id}}function QY(e,t,n){let r=vJ(e,n),i=CJ(e,n),a=i.host===`dock`?i.id:GY(e),o=i.host===`dock`?i.tabs.indexOf(n)+1:gJ(e,a).tabs.length,s={...r,id:t(`tab`)};return{ops:[{type:`openTab`,paneId:a,tab:s,index:o}],tabId:s.id}}function $Y(e,t,n,r){let i=CJ(e,t);if(gJ(e,n).host!==`dock`)return HY;if(i.id===n){let e=i.tabs.indexOf(t),n=r>e?r-1:r;return n===e?HY:[{type:`reorderTab`,tabId:t,index:n}]}return[KY(i,t,n,r)]}function eX(e,t,n,r,i,a){let o=CJ(e,n),s=gJ(e,r);if(s.host!==`dock`)return HY;let c=DY(i);if(c===void 0)return o.id===r?HY:[KY(o,n,r,s.tabs.length)];let l=o.id===r&&o.tabs.length===1;if(l&&a===void 0||!TY(e))return HY;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(KY(o,n,u,0)),d}function tX(e,t,n,r){let i=e.floats.length*BY,a=t(`float`);return{ops:[{type:`float`,tabId:n,newPaneId:a,rect:r??{x:VY.x+i,y:VY.y+i,width:xY.width,height:xY.height}}],paneId:a}}function nX(e,t,n){let r=n??GY(e);return[{type:`unfloat`,paneId:t,toPaneId:r,index:gJ(e,r).tabs.length}]}function rX(e,t,n){return[{type:`resize`,splitId:e,sizes:OY(t,n)}]}function iX(e,t,n){let r=[],i=e;for(;;){let e=wJ(i).find(e=>e!==i.rootId&&gJ(i,e).tabs.length===0);if(e===void 0)break;let t={type:`merge`,paneId:e};r.push(t),i=sY(i,t).state}let a=hJ(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 aX(e=0){let t=e;return{next:(e=>(t+=1,`${e}${t}`))}}function oX(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 sX=class{minter;sequencer;listeners=new Set;makePaneTab;snapshot;constructor(e={}){this.minter=aX(),this.makePaneTab=e.makePaneTab,this.sequencer=new yY(oX(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:TY(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=cY(this.state,e);e=[...e,...iX(t,this.mint,t.floats.length>0?this.makePaneTab:void 0)]}return this.sequencer.dispatchAll(e),this.commit(),!0}setExpanded(e){this.run(qY(this.state,e))}toggleExpanded(){this.setExpanded(!this.state.expanded)}setMode(e){this.run(JY(this.state,e))}splitPane(e){return this.run(YY(this.state,this.mint,e,this.makePaneTab))}addTab(e){return this.run(XY(this.state,this.mint,e,this.makePaneTab))}openContent(e){let t=ZY(this.state,this.mint,e);return this.run(t.ops),t.tabId}duplicateTab(e){let t=QY(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($Y(this.state,e,t,n),!0)}dropTab(e,t,n){return this.run(eX(this.state,this.mint,e,t,n),!0)}floatTab(e,t){let n=tX(this.state,this.mint,e,t);return this.run(n.ops,!0),n.paneId}unfloatPane(e,t){this.run(nX(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(rX(e,t))}undo(){return this.sequencer.undo()?(this.commit(),!0):!1}redo(){return this.sequencer.redo()?(this.commit(),!0):!1}activeDockPaneId(){return GY(this.state)}},cX={x:0,y:0,width:0,height:0},lX={row:!0,column:!0};function uX(e){return e===null?cX:e.getBoundingClientRect()}function dX(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function fX(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 pX(e){let t=e.querySelector(`[data-dockkit-tab]`);if(t===null)return MY.chip;let n=getComputedStyle(t),r=dX(n.minWidth);return r<=0?MY.chip:n.boxSizing===`border-box`?r:r+dX(n.paddingLeft)+dX(n.paddingRight)+dX(n.borderLeftWidth)+dX(n.borderRightWidth)}function mX(e){let t=e.querySelector(`[data-dockkit-divider]`);if(t===null)return MY.divider;let{width:n,height:r}=t.getBoundingClientRect(),i=Math.min(n,r);return i>0?i:MY.divider}function hX(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:dX(getComputedStyle(r).columnGap))}function gX(e,t=!1){let n={divider:mX(e),chip:pX(e),body:MY.body},r=new Map;for(let[i,a]of fX(e))r.set(i,NY({pane:uX(a),strip:uX(a.querySelector(`[data-dockkit-strip]`)),chipsWidth:uX(a.querySelector(`[data-dockkit-strip-tabs]`)).width,fillWidth:uX(a.querySelector(`[data-dockkit-strip-fill]`)).width,splitControlWidth:t?hX(a):0},n));return r}function _X(e,t){return e.get(t)??lX}function vX(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 yX(e,t){typeof e.setPointerCapture==`function`&&e.setPointerCapture(t)}function bX(e,t,n){yX(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 xX(e){let t=(0,P.useRef)(void 0);return(0,P.useEffect)(()=>()=>{t.current?.stop()},[]),(n,r,i)=>{t.current?.end();let a=()=>{t.current=void 0,e()},o=bX(n,r,{move:i.move,up:e=>{a(),i.up(e)},cancel:a});t.current={stop:o,end:()=>{o(),a()}}}}var SX=new WeakMap,CX=new Set([`Tab`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function wX(e,t){SX.get(e)?.();let n=()=>{e.removeAttribute(`data-dsh-automatic-focus`),e.removeEventListener(`blur`,n),e.removeEventListener(`keydown`,r,!0),SX.delete(e)},r=e=>{e.isComposing||e.ctrlKey||e.altKey||e.metaKey||!CX.has(e.key)||n()};SX.set(e,n),e.setAttribute(`data-dsh-automatic-focus`,``),e.addEventListener(`blur`,n),e.addEventListener(`keydown`,r,!0),e.focus(t),e.matches(`:focus`)||n()}function TX(e){let t=!1,n=!1,r=()=>{t=!0},i=()=>{t=!1,n=!0},a=()=>{n=!1},o=()=>{t=!1,n=!1};return e.addEventListener(`compositionstart`,r,!0),e.addEventListener(`compositionend`,i,!0),e.addEventListener(`keyup`,a,!0),e.defaultView?.addEventListener(`blur`,o),{guards:e=>{let r=t||n||e.isComposing||e.keyCode===229;return n=!1,r},dispose:()=>{e.removeEventListener(`compositionstart`,r,!0),e.removeEventListener(`compositionend`,i,!0),e.removeEventListener(`keyup`,a,!0),e.defaultView?.removeEventListener(`blur`,o)}}}var EX=new WeakMap,DX=`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]`;function OX(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.useLayoutEffect)(()=>{let n=e.current;if(!t||n===null)return;let i=n.ownerDocument,a=TX(i),o=i.activeElement,s=EX.get(i)??[];EX.set(i,s);let c={element:n,close:()=>{r.current()}};s.push(c);let l=n.querySelector(`[data-modal-autofocus]`)??n.querySelector(DX)??n;n.contains(i.activeElement)||wX(l);let u=e=>{let t=a.guards(e);if(s.at(-1)!==c||e.defaultPrevented||t||e.ctrlKey||e.altKey||e.metaKey||(e.key===`Escape`&&!e.shiftKey&&(e.preventDefault(),e.repeat||r.current()),e.key!==`Tab`)||i.activeElement?.closest(`[role="menu"]`))return;let o=[...n.querySelectorAll(DX)].filter(e=>!e.closest(`[inert], [hidden]`)),l=o[0]??n,u=o.at(-1)??n,d=e.shiftKey?i.activeElement===l:i.activeElement===u;(i.activeElement===n||!n.contains(i.activeElement)||d)&&(e.preventDefault(),(e.shiftKey?u:l).focus())};return i.addEventListener(`keydown`,u),()=>{a.dispose();let e=s.at(-1)===c;if(s.splice(s.indexOf(c),1),i.removeEventListener(`keydown`,u),s.length===0&&EX.delete(i),e){let e=o instanceof HTMLElement&&o.isConnected?o:s.at(-1)?.element;e!==void 0&&wX(e)}}},[e,t])}var kX={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`},AX=4;function jX(e,t){let n=e.getBoundingClientRect(),r=t.offsetWidth,i=n.left+r+AX>window.innerWidth?Math.max(AX,n.right-r):n.left;return{top:n.bottom+AX,left:i}}function MX({labels:e,anchor:t,onClose:n,onDismiss:r,extras:i}){let a=(0,P.useRef)(null),[o,s]=(0,P.useState)(void 0),c=n!==void 0||P.Children.toArray(i).some(e=>e!==``);return(0,P.useLayoutEffect)(()=>{a.current!==null&&s(jX(t,a.current))},[t,c]),(0,P.useEffect)(()=>{let e=a.current;if(e===null)return;let n=e.ownerDocument,i=TX(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&&wX(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,jt.createPortal)((0,F.jsxs)(kp,{className:kX.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,F.jsx)(`button`,{type:`button`,role:`menuitem`,className:kX.menuItem,"data-dockkit-menu-close":!0,onClick:n,children:e.closeTab}),i]}),document.body):null}function NX(e){e.scrollWidth>e.clientWidth+1?e.dataset.dockkitTabClipped=``:delete e.dataset.dockkitTabClipped}function PX({children:e}){let t=(0,P.useRef)(null);return(0,P.useLayoutEffect)(()=>{t.current!==null&&NX(t.current)}),(0,P.useLayoutEffect)(()=>{let e=t.current;if(e===null||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{NX(e)});return n.observe(e),()=>{n.disconnect()}},[]),(0,F.jsx)(`span`,{ref:t,className:kX.tabTitle,"data-dockkit-tab-title":!0,children:e})}var FX=`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 IX(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.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,F.jsx)(`path`,{d:`M8 1.5V14.5`,stroke:`currentColor`})]})}var LX={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 RX({zone:e}){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:FX,fill:`currentColor`}),(0,F.jsx)(`path`,{d:LX[e],fill:`currentColor`})]})}function zX({zone:e,active:t,labels:n}){return(0,F.jsx)(`div`,{className:kX.dockHint,"data-dockkit-dock-zone":e,"data-dockkit-drop-active":t||void 0,children:(0,F.jsxs)(`div`,{className:kX.dockHintCard,children:[(0,F.jsx)(RX,{zone:e}),(0,F.jsx)(`span`,{className:kX.dockHintLabel,children:n.dropZone[e]})]})})}function BX(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 VX(e){return e===`Enter`||e===` `}function HX(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 UX(e,t){(0,P.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let n=()=>{let e=HX(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 WX(e,t,n,r){(0,P.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-GX:o.right>a.right&&(n.scrollLeft+=o.right-a.right+GX)},[e,t,n,r])}var GX=24;function KX(e,t){switch(t){case`budget`:return e.splitPaneDisabled;case`width`:return e.splitPaneNarrow}}function qX({state:e,pane:t,callbacks:r}){let[i,a]=(0,P.useState)(void 0),[o]=(0,P.useState)(()=>new Map),s=(0,P.useRef)(null);UX(s,t.tabs),WX(s,o,t.tabs,t.activeTabId);let c=r.splitBlock(t.id),l=r.dropTarget,u=l!==void 0&&l.kind===`strip`&&l.paneId===t.id?l.index:void 0,d=n=>{(e.activePaneId!==t.id||t.activeTabId!==n)&&r.onFocusTab(n)},f=e=>{let t=o.get(e);t!==void 0&&t.focus()};return(0,F.jsxs)(`div`,{className:kX.tabStrip,role:`tablist`,"data-dockkit-strip":t.id,"data-window-drag":e.floats.length===0||void 0,children:[(0,F.jsxs)(`div`,{ref:s,className:kX.stripTabs,role:`presentation`,"data-dockkit-strip-tabs":t.id,children:[t.tabs.map((s,c)=>{let l=vJ(e,s),p=s===t.activeTabId,m=r.canCloseTab(s),h=!m&&t.tabs.length===1;return(0,F.jsxs)(P.Fragment,{children:[(c>0||u===c)&&(0,F.jsx)(`div`,{className:n(kX.slot,u===c&&kX.slotCaret),"data-dockkit-caret":u===c?c:void 0}),(0,F.jsxs)(`div`,{role:`tab`,"aria-selected":p,tabIndex:p?0:-1,className:n(kX.tab,p&&kX.tabActive,h&&kX.tabQuiet,r.draggingTabId===s&&kX.tabDragging),"data-dockkit-tab":s,"data-dockkit-tab-quiet":h||void 0,ref:e=>{e===null?o.delete(s):o.set(s,e)},onPointerDown:e=>{e.button!==2&&r.onTabPressed(s,e)},onClick:e=>{e.stopPropagation(),d(s)},onKeyDown:e=>{if(e.target!==e.currentTarget||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let n=BX(e.key,t.tabs,s);n===void 0?VX(e.key)&&(e.preventDefault(),d(s)):(e.preventDefault(),f(n))},onContextMenu:e=>{e.preventDefault();let t=e.currentTarget;a(e=>e?.tabId===s?void 0:{tabId:s,anchor:t})},children:[(0,F.jsx)(PX,{children:r.renderTabTitle?.(l)??l.title}),m&&(0,F.jsx)(hO,{disabled:i!==void 0,label:r.labels.closeTab,shortcutKeys:r.labels.closeTabKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.tabClose,"aria-label":r.labels.closeTab,"aria-keyshortcuts":r.labels.closeTabShortcut,"data-dockkit-tab-close":s,onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r.onCloseTab(s)},children:(0,F.jsx)(le,{size:14})})}),i?.tabId===s&&(0,F.jsx)(MX,{labels:r.labels,anchor:i.anchor,onClose:m?()=>{a(void 0),r.onCloseTab(s)}:void 0,onDismiss:()=>{a(void 0)},extras:r.renderTabMenuItems?.(l,()=>{a(void 0)})})]})]},s)}),u===t.tabs.length&&(0,F.jsx)(`div`,{className:n(kX.slot,kX.slotCaret),"data-dockkit-caret":u})]}),r.canAddTab(t.id)&&(0,F.jsx)(hO,{label:r.labels.addTab,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.addTab,"aria-label":r.labels.addTab,"data-dockkit-add-tab":t.id,onClick:e=>{e.stopPropagation(),r.onAddTab(t.id)},children:(0,F.jsx)(me,{size:14})})}),(0,F.jsx)(`div`,{className:kX.stripFill,"data-dockkit-strip-fill":!0}),!(r.hideSplitWhenBlocked&&c!==void 0)&&(0,F.jsx)(hO,{label:c===void 0?r.labels.splitPane:KX(r.labels,c),shortcutKeys:r.labels.splitPaneKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`span`,{tabIndex:c===void 0?void 0:0,"aria-label":c===void 0?void 0:KX(r.labels,c),children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.labels.splitPane,"aria-keyshortcuts":r.labels.splitPaneShortcut,disabled:c!==void 0,"data-dockkit-split-button":t.id,"data-dockkit-split-blocked":c,onClick:e=>{e.stopPropagation(),r.onSplitPane(t.id)},children:(0,F.jsx)(IX,{})})})}),t.id===r.chromePaneId&&r.chrome!==void 0&&(0,F.jsx)(`div`,{className:kX.stripChrome,"data-dockkit-strip-chrome":!0,onClick:e=>{e.stopPropagation()},children:r.chrome})]})}function JX({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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:kX.dockScrim,"data-dockkit-dock-scrim":!0}),t.horizontalDrops&&r!==`center`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(zX,{zone:`left`,active:r===`left`,labels:t.labels}),(0,F.jsx)(zX,{zone:`right`,active:r===`right`,labels:t.labels})]}):(0,F.jsx)(zX,{zone:r,active:!0,labels:t.labels})]})}function YX({state:e,pane:t,callbacks:n}){let r=t.activeTabId===void 0?void 0:vJ(e,t.activeTabId);return(0,F.jsxs)(`section`,{className:kX.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,F.jsx)(qX,{state:e,pane:t,callbacks:n}),(0,F.jsxs)(`div`,{className:kX.paneBody,children:[r===void 0?(0,F.jsx)(`p`,{className:kX.empty,children:n.labels.emptyPane}):n.renderTab(r),(0,F.jsx)(JX,{pane:t,callbacks:n})]})]})}function XX(e,t,n){let r=t-e.originX,i=n-e.originY;return e.mode===`move`?IY(e.rect,r,i):LY(e.rect,r,i,SY)}function ZX(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QX(e,t){return e.activePaneId===t&&e.floats.at(-1)===t}function $X(e,t){let[n,r]=(0,P.useState)(void 0),i=xX(()=>{r(void 0)}),a=n=>{QX(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:yJ(gJ(e,o))};i(s.currentTarget,s.pointerId,{move:e=>{r({paneId:o,rect:XX(c,e.clientX,e.clientY)})},up:e=>{let r=XX(c,e.clientX,e.clientY);ZX(r,c.rect)?a(o):n===`move`?t.moveFloat(o,r.x,r.y):t.resizeFloat(o,r)}})}}}function eZ({paneId:e,tab:t,labels:r,intents:i,renderTabTitle:a,canCloseTab:o,drag:s}){return(0,F.jsxs)(`header`,{className:n(kX.tabStrip,kX.floatHeader),"data-dockkit-float-grip":e,onPointerDown:t=>{s(`move`,e,t)},children:[(0,F.jsx)(`div`,{className:n(kX.tab,kX.floatTitle),"data-dockkit-float-title":!0,children:(0,F.jsx)(PX,{children:a?.(t)??t.title})}),(0,F.jsx)(`div`,{className:kX.stripFill}),(0,F.jsx)(hO,{label:r.dockFloat,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.dockFloat,"data-dockkit-float-dock":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{i.unfloatPane(e)},children:(0,F.jsx)(te,{className:kX.dockGlyph})})}),(o?.(t.id)??!0)&&(0,F.jsx)(hO,{label:r.closeTab,shortcutKeys:r.closeTabKeys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:kX.iconButton,"aria-label":r.closeTab,"data-dockkit-float-close":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{i.closeTab(t.id)},children:(0,F.jsx)(O,{})})})]})}function tZ({state:e,callbacks:t,intents:r,tab:i,pane:a,column:o,floats:s,focusRequest:c,keepMounted:l,active:u=!0}){let d=a.host===`float`,f=d||a.activeTabId===i.id,p=u&&f&&(d||e.expanded),m=l?.(i)??!1,[h,g]=(0,P.useState)(p);p&&!h&&g(!0);let _=(0,P.useRef)(null),v=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let e=_.current;e.inert=!p;let t=document.activeElement;!p&&t instanceof HTMLElement&&e.contains(t)&&t.blur();let n=c.current;p&&n?.tabId===i.id&&(c.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===i.id)?.focus({preventScroll:!0}))},[p,i.id,c]),(0,P.useEffect)(()=>{let n=v.current,r=()=>{p&&(d?s.raise(a.id):e.activePaneId!==a.id&&t.onFocusPane(a.id))};return n.addEventListener(`focus`,r,!0),()=>{n.removeEventListener(`focus`,r,!0)}},[p,d,s,a.id,e.activePaneId,t]);let y=d&&s.preview?.paneId===a.id?s.preview.rect:void 0,b=d?y??yJ(a):void 0,x=y===void 0?e.floats.indexOf(a.id)+1:e.floats.length+1;return(0,F.jsx)(`div`,{className:n(kX.tabCell,d&&kX.floatingCell),hidden:!f,"data-dockkit-host":d?`float`:`dock`,"data-dockkit-column":d?void 0:o,style:{gridColumn:d?1:o*2+1,gridRow:1,order:d?x:0},children:(0,F.jsxs)(`section`,{ref:_,tabIndex:-1,className:n(kX.tabHost,d?kX.float:kX.pane),"aria-hidden":!p||void 0,"data-dockkit-content":i.id,"data-dockkit-pane":!d&&f?a.id:void 0,"data-dockkit-pane-active":!d&&e.activePaneId===a.id||void 0,"data-dockkit-float":d?a.id:void 0,"data-dockkit-float-active":d&&e.activePaneId===a.id||void 0,"data-dockkit-column":d?void 0:o,style:b===void 0?void 0:{left:b.x,top:b.y,width:b.width,height:b.height},onPointerDown:()=>{d&&s.raise(a.id)},onClick:()=>{!d&&e.activePaneId!==a.id&&t.onFocusPane(a.id)},children:[(0,F.jsx)(`div`,{className:kX.tabHostHeader,children:f&&(d?(0,F.jsx)(eZ,{paneId:a.id,tab:i,labels:t.labels,intents:r,renderTabTitle:t.renderTabTitle,canCloseTab:t.canCloseTab,drag:s.drag}):(0,F.jsx)(qX,{state:e,pane:a,callbacks:t}))}),(0,F.jsxs)(`div`,{ref:v,className:n(kX.tabHostBody,d?kX.floatBody:kX.paneBody),children:[h&&(m||u&&f)?t.renderTab(i):null,!d&&(0,F.jsx)(JX,{pane:a,callbacks:t})]}),d&&(0,F.jsx)(`div`,{className:kX.floatResize,"data-dockkit-float-resize":a.id,onPointerDown:e=>{s.drag(`resize`,a.id,e)}})]})})}function nZ(e){let{state:t,callbacks:r,preview:i}=e,a=(0,P.useRef)(void 0),o={...r,onFocusTab:e=>{a.current=CJ(t,e).activeTabId===e?void 0:{tabId:e,origin:document.activeElement},r.onFocusTab(e)}},s=hJ(t,t.rootId);if(s.kind===`split`&&(s.axis!==`row`||s.children.length!==2))throw Error(`DockLayout requires one pane or two horizontally split panes`);let c=s.kind===`pane`?[s]:s.children.map(e=>gJ(t,e)),l=s.kind===`split`?i?.splitId===s.id?i.sizes:s.sizes:[1],u=$X(t,e.intents),d=l.map(e=>`minmax(0, ${e}fr)`).join(` 0px `);return(0,F.jsxs)(`div`,{className:kX.tabLayout,"data-dockkit-split":s.kind===`split`?s.id:void 0,style:{gridTemplateColumns:d},children:[Object.values(t.tabs).sort((e,t)=>e.id.localeCompare(t.id)).map(n=>{let r=CJ(t,n.id);return(0,F.jsx)(tZ,{...e,callbacks:o,tab:n,pane:r,column:c.findIndex(e=>e.id===r.id),floats:u,focusRequest:a},n.id)}),c.filter(e=>e.tabs.length===0).map(e=>(0,F.jsx)(`div`,{className:kX.emptyTabHost,"data-dockkit-empty":!0,style:{gridColumn:c.indexOf(e)*2+1,gridRow:1},children:(0,F.jsx)(YX,{state:t,pane:e,callbacks:r})},e.id)),s.kind===`split`&&(0,F.jsx)(`div`,{className:n(kX.divider,kX.tabLayoutDivider),"data-dockkit-divider":`${s.id}:0`,style:{gridColumn:2,gridRow:1},onPointerDown:e=>{r.onDividerPressed(s.id,0,e)}})]})}var rZ={draggingTabId:void 0,dropTarget:void 0,sizes:void 0},iZ=new Map,aZ=()=>!0;function oZ(e,t,n,r,i,a){for(let[o,s]of fX(e)){let e=s.getBoundingClientRect();if(!kY(e,t,n))continue;let c=s.querySelector(`[data-dockkit-strip]`);if(c!==null&&kY(c.getBoundingClientRect(),t,n))return{kind:`strip`,paneId:o,index:jY([...c.querySelectorAll(`[data-dockkit-tab]`)].map(e=>e.getBoundingClientRect()),t)};let l=a===`horizontal`?r&&_X(i,o).row?t<e.x+e.width/2?`left`:`right`:`center`:AY(e,t,n);if(l!==`center`){let e=_X(i,o),t=l===`left`||l===`right`?e.row:e.column;if(!r||!t)return}return{kind:`zone`,paneId:o,zone:l}}}function sZ(e,t,n,r){let i=(e.axis===`row`?t:n)-e.origin,a=e.extent>0?i/e.extent:0;return OY(FY(e.sizes,e.index,a),r)}var cZ=1e-9;function lZ(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&Math.abs(e-r)<cZ})}function uZ({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=bY,hideSplitWhenBlocked:m=!1}){let h=(0,P.useRef)(null),[g,_]=(0,P.useState)(rZ),[v,y]=(0,P.useState)(iZ),b=xX(()=>{_(rZ)}),x=(0,P.useCallback)(e=>{let t=h.current;t!==null&&e(t)},[]),S=(0,P.useCallback)(()=>{x(e=>{let t=gX(e,m);y(e=>vX(e,t)?e:t)})},[x,m]);(0,P.useLayoutEffect)(()=>{S()}),(0,P.useEffect)(()=>{u?.(v)},[v,u]),(0,P.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(!PY(a,o,n.clientX,n.clientY))return;s=!0}_({...rZ,draggingTabId:e,dropTarget:oZ(r,n.clientX,n.clientY,t,v,f)})},up:n=>{if(!s)return;let a=oZ(r,n.clientX,n.clientY,t,v,f);if(a===void 0){if(kY(r.getBoundingClientRect(),n.clientX,n.clientY))return;i.floatTab(e,RY(n.clientX,n.clientY,xY))}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=_J(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=>{_({...rZ,sizes:{splitId:t,sizes:sZ(c,e.clientX,e.clientY,p)}})},up:e=>{let n=sZ(c,e.clientX,e.clientY,p);lZ(n,c.sizes)||i.resizeSplit(t,n)}})},splitBlock:e=>t?_X(v,e).row?void 0:`width`:`budget`,hideSplitWhenBlocked:m,canAddTab:n??aZ,canCloseTab:r??aZ,dropTarget:g.dropTarget,horizontalDrops:f===`horizontal`,draggingTabId:g.draggingTabId,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chromePaneId:LJ(e),chrome:l};return(0,F.jsx)(`div`,{className:kX.surface,ref:h,"data-dockkit-surface":!0,"data-dockkit-drop-zones":f,children:d(C,g.sizes)})}function dZ(e){return(0,F.jsx)(uZ,{...e,draw:(t,n)=>(0,F.jsx)(nZ,{...e,callbacks:t,preview:n})})}var fZ={session:`_session_nj5n1_24`,panel:`_panel_nj5n1_32`,iconButton:`_iconButton_nj5n1_121`,collapseGlyph:`_collapseGlyph_nj5n1_147`,panelBody:`_panelBody_nj5n1_151`,unavailable:`_unavailable_nj5n1_157`,tabTitle:`_tabTitle_nj5n1_165`,tabBody:`_tabBody_nj5n1_169`};function pZ(){return(0,F.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,F.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 mZ(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,F.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,F.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 hZ({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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(hO,{label:c,shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:fZ.iconButton,"aria-label":c,"aria-keyshortcuts":l?.aria,"data-sidebar-right-mode":s,onClick:o,children:t?(0,F.jsx)(mZ,{}):(0,F.jsx)(pZ,{})})}),(0,F.jsx)(hO,{label:i(`chrome.collapse`),shortcutKeys:u?.keys,side:`bottom`,delayMs:500,children:(0,F.jsx)(`button`,{type:`button`,className:fZ.iconButton,"aria-label":i(`chrome.collapseAria`),"aria-keyshortcuts":u?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{r.toggleExpanded(e)},children:(0,F.jsx)(te,{className:fZ.collapseGlyph})})})]})}function gZ(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 _Z={"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":`这类内容还没有可用的查看方式。`},vZ={"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.`},yZ={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`},bZ=(0,P.forwardRef)(function({variant:e=`ghost`,size:t=`md`,icon:r,className:i,children:a,...o},s){return(0,F.jsxs)(`button`,{ref:s,type:`button`,className:n(yZ.button,yZ[e],yZ[t],i),...o,children:[r!=null&&(0,F.jsx)(`span`,{className:yZ.icon,children:r}),a]})}),xZ={button:`_button_11lrx_2`,icon:`_icon_11lrx_15`};function SZ(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=>!u(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||!p(e.label)||!p(e.description)||e.panelTitle!==void 0&&!p(e.panelTitle)||typeof e.icon!=`function`||!t.some(t=>t.kind===e.kind)))throw Error(`Invalid workbench entry`)}return n}function CZ(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 wZ=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)}}},TZ=(e,t=null)=>({sessionId:t,generation:e,plugins:[],errors:[],ready:!1}),EZ=class{environment;run=null;snapshot=TZ(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(TZ(n.generation,e));try{let r=await CZ(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 wZ(e=>this.error(n,t.id,`dispose`,e));n.scopes.push(r);let i=r.context(e),a=`load`;try{let e=await CZ(this.environment.loadModule(t.client),n.controller.signal,this.environment.loadTimeoutMs??1e4);if(this.run!==n)break;a=`validate`;let o=SZ(e?.default,t.id);if(t.style&&(a=`style`,await CZ(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(TZ(this.generation))}}},DZ={"builtin:@pi-webapp/files":()=>N(()=>import(`./plugin-CiZqbXIv.js`),__vite__mapDeps([34,2,3,35,36])),"builtin:@pi-webapp/terminal":()=>N(()=>import(`./plugin-Ck_3M7GH.js`),__vite__mapDeps([37,2,3,38])),"builtin:@pi-webapp/git":()=>N(()=>import(`./plugin-CpMftYuc.js`),__vite__mapDeps([39,2,3,35,36,40]))};function OZ(e){let t=DZ[e];if(!t)throw Error(`Unknown builtin plugin module`);return t()}function kZ(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 AZ(e,t,n,r=0){let[i]=(0,P.useState)(()=>new EZ({loadModule:e=>e.startsWith(`builtin:`)?OZ(e):import(e),loadStyle:kZ})),a=(0,P.useSyncExternalStore)(i.subscribe,i.getSnapshot),o=(0,P.useRef)(new Map);a.sessionId&&a.ready&&o.current.set(a.sessionId,a.plugins.filter(e=>e.definition.workbench)),(0,P.useEffect)(()=>{if(e&&t)return globalThis.__PI_WEBAPP_REACT__=P,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 jZ=class extends P.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 MZ(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 NZ({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,F.jsx)(jZ,{id:r.id,children:(0,F.jsx)(i,{...MZ({...t,interaction:n},r.id)})},`${r.instanceId??r.id}/${n.requestId}`)}function PZ({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,F.jsx)(jZ,{id:a.plugin.id,children:(0,F.jsx)(o,{...MZ(t,a.plugin.id),call:n,result:r,running:i})})}function FZ({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,F.jsx)(F.Fragment,{children:r.map(({plugin:e,item:t})=>{let r=t.component;return(0,F.jsx)(jZ,{id:e.id,children:(0,F.jsx)(r,{...MZ(n,e.id)})},`${e.instanceId??e.id}/${t.id}`)})})}function IZ(e,t=[]){let n=(0,P.useRef)(new Map),{controller:r,resources:i,owners:a}=(0,P.useMemo)(()=>{let t=e??``,r=n.current.get(t);if(!r){let e=e=>({id:e,kind:`guide`,contentId:`guide`,title:`开始`});r={controller:new sX({makeInitialTab:e,makePaneTab:e}),resources:new Map,owners: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)}),n.current.set(t,r)}return r},[e]);(0,P.useEffect)(()=>{for(let[t,r]of n.current)for(let n of r.resources.values())n.activate?.(t===e)},[e]),(0,P.useEffect)(()=>{for(let e of n.current.values())for(let[n,r]of[...e.owners])t.includes(r)&&e.controller.closeTab(n)},[t]),(0,P.useEffect)(()=>()=>{for(let e of n.current.values())for(let t of e.resources.values())t.dispose?.()},[]);let o=(0,P.useSyncExternalStore)(r.subscribe,r.getSnapshot),s=gJ(o.state,o.state.activePaneId).activeTabId,c=s?vJ(o.state,s):void 0;return{controller:r,snapshot:o,panelId:c?.kind===`plugin`?c.contentId:null,resources:i,owners:a,expand:()=>{Object.keys(r.getSnapshot().state.tabs).length||r.openContent({kind:`guide`,contentId:`guide`,title:`开始`}),r.setExpanded(!0)},openContent:(0,P.useCallback)((e,t,n,i,o)=>{let s=r.getSnapshot().state,c=i&&gJ(s,i).host===`dock`?i:GY(s),l=gJ(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??r.openContent({kind:e,contentId:t,title:n,paneId:c,revealIfOpened:e!==`files`});return o&&a.set(f,o),d&&r.focusTab(d),u&&r.closeTab(u),r.setExpanded(!0),requestAnimationFrame(()=>document.querySelector(`[data-dockkit-content="${f}"]`)?.focus()),f},[r,a]),shown:o.state.expanded&&Object.keys(o.state.tabs).length>0}}function LZ({panel:e,width:t,narrow:n,focus:i,onExitFocus:a,plugins:o,props:s,cwd:c}){let{controller:l,snapshot:u,openContent:d}=e,{state:f}=u,[p,m]=(0,P.useState)(``),h=(0,P.useRef)(!1),g=(0,P.useMemo)(()=>new Proxy(l,{get(e,t){if(t===`closeTab`)return t=>{if(h.current)return;h.current=!0;let n=s.session?.sessionId??``;op.flush(n).then(async()=>{let r=document.querySelector(`[data-dockkit-content="${CSS.escape(t)}"]`);r&&await op.retireWithin(n,r),m(``),e.closeTab(t)}).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>{h.current=!1})};let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}}),[l,s.session?.sessionId]),_=n||f.mode===`fullscreen`,v=s.locale===`zh`?_Z:vZ,y=e=>v[e]??e,b=e=>typeof e==`string`?e:e[s.locale],x=o.flatMap(e=>(e.definition.workbench?.panels??[]).map(t=>({plugin:e,contribution:t}))),S=()=>{a(),l.setExpanded(!1),requestAnimationFrame(()=>document.querySelector(`[data-sidebar-right-expand]`)?.focus())},C=n?`100vw`:t;return(0,F.jsx)(`div`,{className:fZ.panel,style:{width:C,"--dsh-sidebar-width":typeof C==`number`?`${C}px`:C},"data-sidebar-right-session":s.session?.sessionId,"data-sidebar-right-panel":_?`fullscreen`:i?`focus`:`push`,"data-sidebar-right-open":e.shown||void 0,"aria-hidden":!e.shown||void 0,children:(0,F.jsxs)(`div`,{className:fZ.panelBody,children:[p&&(0,F.jsx)(`p`,{role:`alert`,children:p}),(0,F.jsx)(dZ,{state:f,canSplit:u.canSplit&&wJ(f).length<2,dropZones:`horizontal`,minPaneFraction:.2,intents:g,labels:gZ(y),active:!0,keepMounted:()=>!0,renderTab:t=>{let n=CJ(f,t.id).id,i=f.expanded&&gJ(f,n).activeTabId===t.id;if(t.kind===`guide`)return(0,F.jsx)(`div`,{className:ue.guide,children:(0,F.jsxs)(`div`,{className:ue.guideGrid,role:`group`,"aria-label":r(`工作区工具`,`Workspace tools`),children:[o.map(e=>{let t=e.definition.workbench?.entry;if(!t)return null;let r=t.icon;return(0,F.jsxs)(`button`,{type:`button`,className:ue.guideEntry,disabled:!s.session||!c,"aria-label":b(t.label),onClick:()=>d(t.kind,t.multiple?ge():`workspace`,b(t.panelTitle??t.label),n,e.id),children:[(0,F.jsx)(`span`,{className:ue.guideIcon,"aria-hidden":`true`,children:(0,F.jsx)(r,{size:24})}),(0,F.jsxs)(`span`,{className:ue.guideCopy,children:[(0,F.jsx)(`span`,{className:ue.guideLabel,children:b(t.label)}),(0,F.jsx)(`span`,{className:ue.guideDescription,children:b(t.description)})]})]},e.id)}),!o.some(e=>e.definition.workbench?.entry)&&(0,F.jsx)(`p`,{className:ue.state,children:r(`没有已启用的工作区插件,可在设置中启用。`,`No workspace plugins enabled. Enable one in Settings.`)})]})});let a=x.find(e=>e.contribution.kind===t.kind);if(a&&s.session){let{plugin:r,contribution:o}=a;e.owners.set(t.id,r.id);let c=o.component;return(0,F.jsx)(jZ,{id:r.id,children:(0,F.jsx)(c,{sendMessage:s.sendMessage,session:s.session,locale:s.locale,visible:i,contentId:t.contentId,title:t.title,renderMarkdown:s.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},open:(e,t,i)=>d(e,t,i,n,r.id)})})}return(0,F.jsx)(FZ,{plugins:o,slot:`rightbar.panel`,props:{...s,panelId:t.contentId}})},renderTabTitle:e=>{if(e.kind===`guide`)return y(`tab.guide.title`);let t=x.find(t=>t.contribution.kind===e.kind);return t?(0,F.jsx)(`span`,{className:ue.title,children:t.contribution.title?.(e.contentId,e.title)??e.title}):(0,F.jsx)(FZ,{plugins:o,slot:`rightbar.title`,props:{...s,panelId:e.contentId}})},chrome:(0,F.jsx)(hZ,{sessionId:s.session?.sessionId??``,fullscreen:_||i,focus:i,shortcuts:[],t:y,actions:{toggleExpanded:S},toggleFullscreen:()=>i?a():n?S():l.setMode(_?`push`:`fullscreen`)})})]})})}function RZ({panel:e,locale:t}){if(e.shown)return null;let n=t===`zh`?_Z:vZ;return(0,F.jsx)(hO,{label:n[`chrome.expand`],side:`bottom`,delayMs:500,children:(0,F.jsx)(bZ,{size:`sm`,className:xZ.button,"aria-label":n[`chrome.expandAria`],"data-sidebar-right-expand":!0,onClick:e.expand,children:(0,F.jsx)(te,{className:xZ.icon})})})}function zZ(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 BZ=`pi:hosted:unconfirmed-views:v1`,VZ=`pi:hosted:unconfirmed-view:v1:`,HZ=`pi:hosted:retired-view:v1:`,UZ=``,WZ=()=>{UZ=`View recovery journal could not be read. Its original data has been retained.`},GZ=()=>{UZ=`View recovery journal could not be stored. Keep this page open and download local drafts.`};function KZ(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))&&[`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 qZ(){try{if(typeof sessionStorage>`u`)return[];let e=sessionStorage.getItem(BZ);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t)||!t.every(KZ))throw Error(`Invalid view recovery journal`);return t}catch{return WZ(),[]}}function JZ(e){if(typeof localStorage>`u`)return null;let t=localStorage.getItem(HZ+e);if(t!==null){if(JSON.parse(t)!==!0)throw Error(`Invalid view retirement receipt`);return`retired`}let n=localStorage.getItem(VZ+e);if(!n)return null;let r=JSON.parse(n);if(!KZ(r)||r.viewToken!==e)throw Error(`Invalid durable view recovery record`);return r}function YZ(e,t){return e.sessionId===t.sessionId&&e.pluginId===t.pluginId&&e.generation===t.generation&&e.mountId===t.mountId}var XZ=qZ(),ZZ=new Set(XZ.map(e=>e.viewToken));function QZ(){let e=new Map(XZ.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(VZ)?VZ:n?.startsWith(HZ)?HZ:void 0;if(!r)continue;let i=n.slice(r.length);try{let t=JZ(i);if(t===`retired`)e.delete(i);else if(t){let n=e.get(i);if(n&&!YZ(n,t))throw Error(`Conflicting view recovery identity`);e.set(i,{...t,discovered:!ZZ.has(i)})}}catch{WZ()}}}catch{WZ()}return[...e.values()]}var $Z=QZ(),eQ=[...$Z];function tQ(){return eQ=eQ.filter(e=>{try{return JZ(e.viewToken)!==`retired`}catch{return WZ(),!0}}),eQ.filter(e=>$Z.some(t=>t.viewToken===e.viewToken))}var nQ=new Map,rQ=`pi:hosted:recovery-draft:v1:`,iQ=()=>UZ;function aQ(){if(UZ)return!1;try{return typeof sessionStorage<`u`&&sessionStorage.setItem(BZ,JSON.stringify(eQ.filter(e=>ZZ.has(e.viewToken)))),!0}catch{return GZ(),!1}}function oQ(e){if(UZ)return!1;try{if(typeof localStorage>`u`)return!0;let t=JZ(e.viewToken);if(t===`retired`)return!1;if(t&&!YZ(t,e))throw Error(`Conflicting view recovery identity`);let{discovered:n,...r}={...e,...t?.frameStarted?{frameStarted:!0}:{},...t?.retained?{retained:!0}:{},backups:[...new Map([...t?.backups??[],...e.backups??[]].map(e=>[e.key,e])).values()]};return localStorage.setItem(VZ+e.viewToken,JSON.stringify(r)),!0}catch{return GZ(),!1}}function sQ(e,t,n){ZZ.add(t),eQ=eQ.filter(e=>e.viewToken!==t);let r={...e,viewToken:t,kind:n.kind,contentId:n.contentId,frameStarted:!1,createdAt:Date.now()};eQ.push(r),oQ(r),aQ()}function cQ(e){let t=eQ.find(t=>t.viewToken===e);if(!t||t.retained)return!1;let n={...t,frameStarted:!0};return oQ(n)?(eQ=eQ.map(t=>t.viewToken===e?n:t),aQ()):!1}function lQ(e){eQ=eQ.filter(t=>t.viewToken!==e),ZZ.delete(e);try{JZ(e),typeof localStorage<`u`&&localStorage.setItem(HZ+e,JSON.stringify(!0))}catch{WZ()}aQ()}async function uQ(e){if(e.discovered&&(e.kind===`controller`||e.frameStarted!==!0))return;let t=(await qk.view({...e,operation:`reconcile`})).recovery;return t?.state===`unconfirmed`&&e.frameStarted===!1&&ZZ.has(e.viewToken)&&(await qk.view({...e,operation:`cancel-initialization`}),lQ(e.viewToken),t={...t,state:`retired`}),(t?.state===`retired`||t?.state===`absent`&&e.kind===`controller`)&&lQ(e.viewToken),t}var dQ=3e5,fQ=new Set([`invalid_scope`,`unknown_plugin`]),pQ=`@chengzhiyi/pi-excalidraw`;function mQ(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 hQ(e,t){if(e.kind===`controller`)return!0;let n=yQ(e);if(!n.length)return!0;if(e.pluginId!==pQ||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 qk.action({sessionId:e.sessionId,pluginId:e.pluginId,generation:t,action:`get`,input:{id:n}}),a=mQ(JSON.parse(r.json).elements);if(!a||a!==mQ(i?.scene?.elements))return!1}catch{return!1}}return!0}async function gQ(e,t,n=Date.now()){if(e.retained)return{state:`retained`};let r=e.frameStarted===!0||e.createdAt===void 0||n-e.createdAt>dQ,i=async()=>await hQ(e,t)?(lQ(e.viewToken),!0):!1,a;try{a=(await qk.view({...e,operation:`status`})).recovery}catch(t){let n=t?.code;if(r&&typeof n==`string`&&fQ.has(n)&&await i())return{state:`retired`};if(t instanceof Error&&t.message===`Unknown view operation`)return uQ(e);throw t}if(a?.state===`retired`)return lQ(e.viewToken),a;if(a?.state===`absent`)return r&&await i()?{state:`retired`}:r||e.discovered?a:uQ(e);if(a?.state===`unconfirmed`&&a.stale){if(e.kind===`controller`)return uQ({...e,discovered:!1});if(!a.dirty&&!a.busy&&await hQ(e,t))try{return await qk.view({...e,operation:`close`}),lQ(e.viewToken),{state:`retired`}}catch{return a}return a}return a?.state===`unconfirmed`&&!e.discovered?uQ(e):a}async function _Q(e){let t=await qk.view({...e,operation:`recover`,confirmation:`retain-unconfirmed-edits`});if(t.recovery?.state===`retired`){lQ(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.`);eQ=eQ.map(t=>t.viewToken===e.viewToken?{...t,retained:!0}:t);let n=eQ.find(t=>t.viewToken===e.viewToken);n&&oQ(n),aQ()}async function vQ(e){(await qk.view({...e,operation:`reconcile`})).recovery?.state!==`absent`&&await qk.view({...e,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),lQ(e.viewToken)}function yQ(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(`${rQ}${e.viewToken}:`))continue;let r=nQ.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 $Z){if(e.kind===`controller`)continue;let t=yQ(e);t.length&&(e.backups=t.map(t=>{let n=`${rQ}${e.viewToken}:${t.name}`;nQ.set(n,t.json);try{localStorage.getItem(n)||localStorage.setItem(n,t.json)}catch{UZ=`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 eQ)oQ(e);aQ();function bQ(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`,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 xQ(e){let{blob:t,name:n}=bQ(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 SQ={entry:`_entry_ic7m3_1`,trigger:`_trigger_ic7m3_3`,dialog:`_dialog_ic7m3_5`,content:`_content_ic7m3_8`,list:`_list_ic7m3_10`,item:`_item_ic7m3_11`,error:`_error_ic7m3_14`,history:`_history_ic7m3_20`,actions:`_actions_ic7m3_24`};function CQ({sessionId:e,locale:t,openRecovered:n}){let[r,i]=(0,P.useState)(tQ),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(``),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(0),h=(e,n)=>t===`zh`?e:n,[g,_]=(0,P.useState)(new Set),[v,y]=(0,P.useState)(new Set),b=r.filter(e=>v.has(e.viewToken)&&!g.has(e.viewToken)),x=iQ(),S=e=>{lQ(e),i(t=>t.filter(t=>t.viewToken!==e))};if((0,P.useEffect)(()=>{o(!1),c(null),u(``)},[e]),(0,P.useEffect)(()=>{let e=!0;return(async()=>{let t=new Map;try{t=new Map((await qk.catalog()).plugins.flatMap(e=>e.generation===void 0?[]:[[e.pluginId,e.generation]]))}catch{}let n=e=>y(t=>new Set(t).add(e));for(let a of r){if(!e)return;try{let r=await gQ(a,t.get(a.pluginId));if(!e)return;r?.state===`retired`||r?.state===`absent`&&a.kind===`controller`?S(a.viewToken):r?.state===`retained`&&i(e=>e.map(e=>e.viewToken===a.viewToken?{...e,retained:!0}:e)),_(e=>{let t=new Set(e);return a.discovered&&r?.state===`unconfirmed`&&r.stale===!1?t.add(a.viewToken):t.delete(a.viewToken),t}),n(a.viewToken)}catch(t){if(!e)return;if(t instanceof Error&&t.message===`Unknown view operation`){y(new Set(r.map(e=>e.viewToken)));return}n(a.viewToken),u(String(t))}}})(),()=>{e=!1}},[e,p]),!b.length&&!x)return null;let C=e=>({controller:h(`后台控制器`,`Controller`),workspace:h(`工作区`,`Workspace`),editor:h(`编辑器`,`Editor`),tool:h(`工具预览`,`Tool preview`)})[e]??h(`插件视图`,`Plugin view`),w=s?.operation===`retain`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:SQ.entry,"data-hosted-recovery":!0,children:[(0,F.jsx)(`p`,{children:h(`刷新或关闭窗口后,旧插件视图可能尚未完成保存和关闭确认;部分记录也可能属于仍打开的窗口。请先核对原窗口及备份,再保留失联视图的恢复记录,解除升级等操作的阻塞。`,`After reloading or closing a window, previous plugin views may lack save and close confirmations. Some records may belong to windows still open. Check original windows and backups, then retain disconnected views for recovery to unblock updates and other operations.`)}),(0,F.jsxs)(`button`,{type:`button`,className:SQ.trigger,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:[h(`插件视图恢复`,`Plugin view recovery`),` · `,b.length]})]}),(0,F.jsx)(OO,{open:a,onClose:()=>o(!1),title:h(`检查之前的插件视图`,`Review previous plugin views`),closeLabel:h(`关闭`,`Close`),className:SQ.dialog,footer:(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>{u(``),m(e=>e+1)},children:h(`重新检查`,`Check again`)}),children:(0,F.jsxs)(`div`,{className:SQ.content,children:[(0,F.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,F.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,F.jsx)(`div`,{className:SQ.list,children:b.map((t,r)=>(0,F.jsxs)(`section`,{className:SQ.item,"data-unconfirmed-view":t.mountId,children:[(0,F.jsxs)(`h3`,{children:[C(t.kind),` `,r+1]}),t.retained&&(0,F.jsx)(`p`,{children:h(`失联视图的恢复记录已保留。插件可继续操作;旧稿是否完整仍需核对。`,`Disconnected view recovery record retained. Plugin operations may continue; the old draft still needs verification.`)}),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:h(`视图信息`,`View details`)}),(0,F.jsxs)(`dl`,{children:[(0,F.jsx)(`dt`,{children:h(`会话`,`Session`)}),(0,F.jsx)(`dd`,{children:t.sessionId}),(0,F.jsx)(`dt`,{children:h(`插件`,`Plugin`)}),(0,F.jsx)(`dd`,{children:t.pluginId}),(0,F.jsx)(`dt`,{children:h(`版本代次`,`Generation`)}),(0,F.jsx)(`dd`,{children:t.generation}),(0,F.jsx)(`dt`,{children:h(`视图标识`,`View ID`)}),(0,F.jsx)(`dd`,{children:t.mountId}),t.contentId&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{children:h(`内容标识`,`Content ID`)}),(0,F.jsx)(`dd`,{children:t.contentId})]})]})]}),(0,F.jsxs)(`div`,{className:SQ.actions,children:[yQ(t).map(e=>(0,F.jsxs)(EO,{variant:`outline`,disabled:d,onClick:()=>xQ({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,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>{o(!1),n(t.contentId)},children:h(`打开图稿并核对备份`,`Open drawing and compare backup`)}),!t.retained&&(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c({item:t,operation:`retain`}),children:h(`保留恢复记录并解除阻塞`,`Retain recovery record and unblock`)}),(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c({item:t,operation:`discard`}),children:h(`丢弃此视图的未确认修改`,`Discard this view's unconfirmed edits`)})]})]},t.viewToken))}),(l||x)&&(0,F.jsxs)(`div`,{role:`alert`,className:SQ.error,children:[h(`未能确认部分视图,请保留恢复记录并重试。`,`Some views could not be verified. Keep their recovery records and retry.`),(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{children:h(`诊断信息`,`Diagnostics`)}),l||x]})]})]})}),(0,F.jsx)(OO,{open:!!s&&a,onClose:()=>c(null),title:w?h(`保留此视图用于恢复?`,`Retain this view for recovery?`):h(`丢弃此视图的未确认修改?`,`Discard this view's unconfirmed edits?`),closeLabel:h(`关闭`,`Close`),description:w?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.`):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,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(EO,{variant:`outline`,disabled:d,onClick:()=>c(null),children:h(`取消`,`Cancel`)}),(0,F.jsx)(EO,{variant:`primary`,disabled:d,onClick:()=>{if(!s||d)return;let{item:e,operation:t}=s;f(!0),u(``),(t===`retain`?_Q(e):vQ(e)).then(()=>{t===`retain`?i(tQ()):S(e.viewToken),c(null)}).catch(e=>{u(String(e)),c(null)}).finally(()=>f(!1))},children:w?h(`保留恢复记录`,`Retain record`):h(`确认丢弃`,`Discard edits`)})]})})]})}var wQ=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 Kk(`/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||wQ.wake()});var TQ=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(!cQ(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=wQ){this.poller=a,this.identity=e,this.adapter=t,this.mount=n,this.reconnect=r,this.failed=i}async start(){this.token=crypto.randomUUID(),sQ(this.identity,this.token,this.mount);let e=await qk.view({...this.identity,operation:`register`,kind:this.mount.kind,viewToken:this.token});e.viewToken!==this.token&&(lQ(this.token),this.token=e.viewToken,sQ(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 qk.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 qk.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 qk.view({...this.identity,viewToken:this.token,operation:`change`,dirty:!1,busy:!1}),await qk.view({...this.identity,viewToken:this.token,operation:`close`})),this.closed=!0,lQ(this.token))})().catch(e=>{throw this.closing=void 0,e})),this.closing)}},EQ={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 DQ({title:e,tool:t,locale:n,children:r}){let[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(!1),c=(0,P.useId)(),l=(e,t)=>n===`zh`?e:t,u=t.result?.blocks.filter(e=>e.kind===`text`).map(e=>e.text??``).join(`
|
|
501
501
|
`);return(0,F.jsxs)(`article`,{className:e?EQ.card:void 0,"data-hosted-tool-card":e?``:void 0,children:[e&&(0,F.jsxs)(`header`,{className:EQ.header,children:[(0,F.jsxs)(`button`,{type:`button`,className:EQ.toggle,"aria-label":l(`展开或收起预览`,`Toggle preview`),"aria-expanded":!i,"aria-controls":c,onClick:()=>a(e=>!e),children:[(0,F.jsx)(`span`,{className:EQ.title,children:e}),(0,F.jsx)(`span`,{className:EQ.status,children:t.result?.isError?l(`失败`,`Failed`):t.result?l(`已完成`,`Completed`):t.running?l(`运行中`,`Running`):l(`未完成`,`Incomplete`)}),(0,F.jsx)(`span`,{className:EQ.chevron,"data-collapsed":i,"aria-hidden":`true`,children:(0,F.jsx)(ct,{size:16})})]}),(0,F.jsx)(`button`,{type:`button`,className:EQ.parameters,"aria-haspopup":`dialog`,onClick:()=>s(!0),children:l(`查看参数`,`View parameters`)})]}),(0,F.jsx)(`div`,{id:c,hidden:!!e&&i,className:EQ.preview,children:r}),(0,F.jsx)(OO,{open:o&&!!e,onClose:()=>s(!1),title:l(`工具参数`,`Tool parameters`),closeLabel:l(`关闭`,`Close`),className:EQ.dialog,children:(0,F.jsxs)(`div`,{className:EQ.details,"data-tool-parameters":!0,children:[(0,F.jsx)(`h3`,{children:l(`输入参数`,`Input`)}),(0,F.jsx)(`pre`,{tabIndex:0,children:t.call.text}),u!==void 0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`h3`,{children:l(`工具结果`,`Result`)}),(0,F.jsx)(`pre`,{tabIndex:0,children:u})]})]})})]})}function OQ(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 kQ(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 AQ(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}}function jQ({card:e,mount:t,update:n,open:r,sendMessage:i,reconnect:a,abort:o}){let s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useRef)(Promise.resolve()),d=(0,P.useRef)({open:r,sendMessage:i,reconnect:a,abort:o});d.current={open:r,sendMessage:i,reconnect:a,abort:o};let[f,p]=(0,P.useState)(``),[m,h]=(0,P.useState)(),[g,_]=(0,P.useState)(240),[v,y]=(0,P.useState)(),[b,x]=(0,P.useState)(MQ);(0,P.useEffect)(()=>{let e=new MutationObserver(()=>x(MQ()));return e.observe(document.body,{attributes:!0,attributeFilter:[`data-ds-dark-theme`]}),()=>e.disconnect()},[]),(0,P.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,a=e=>{i&&p(e instanceof Error?e.message:String(e))},o,f=new ap(s.current,r,async(n,a)=>{if(!i)throw Error(`Frame mount cancelled`);let s=a;if(n===`toolPresentation`&&t.kind===`tool`)return h(OQ(a)),null;if(n===`resize`&&t.kind===`tool`)return _(kQ(a)),null;if(n===`notify`)return y(AQ(a)),null;if(n===`action`){if(typeof s?.action!=`string`)throw Error(`Invalid action`);return qk.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 xQ(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 TQ(r,f,t,()=>d.current.reconnect(),a),c.current=f,l.current=o;let m=(async()=>{if(await o.start(),!i)throw Error(`Frame mount cancelled`);o.connecting(),await f.connect(t.kind===`controller`?e.controllerUrl:e.documentUrl,{...t,theme:MQ(),hostUi:{toolCard:!0,autoResize:!0,notifications:!0}}),o.listen()})();u.current=m;let g=op.add({identity:r,ready:m,adapter:f,afterFlush:()=>o.flushed(),toolCallId:n?.call?.toolCallId,retire:()=>o.close()});return m.catch(a),()=>{i=!1,g(),c.current=null,l.current=null,m.catch(()=>{}).then(()=>o.close()).catch(e=>console.error(`Hosted view cleanup did not acknowledge edits`,e)).finally(()=>f.dispose())}},[e.pluginId,e.generation,e.documentUrl,e.controllerUrl,t.sessionId,t.kind,t.contentId]),(0,P.useEffect)(()=>{u.current.then(()=>c.current?.call(`update`,{...t,...n??{},theme:b})).catch(e=>p(String(e)))},[n,t.locale,b,t.visible,t.title]);let S=(0,F.jsxs)(`div`,{"data-hosted-plugin":e.pluginId,style:{height:t.kind===`controller`||t.kind===`tool`?`auto`:`100%`,minHeight:0},children:[f&&(0,F.jsxs)(`p`,{role:`alert`,children:[f,` `,(0,F.jsx)(`button`,{type:`button`,onClick:()=>{try{l.current?.retry(),p(``)}catch(e){p(String(e))}},children:`Retry view connection`})]}),v&&(0,F.jsxs)(`p`,{role:v.level===`error`?`alert`:`status`,children:[v.message,(0,F.jsx)(`button`,{type:`button`,"aria-label":t.locale===`zh`?`关闭通知`:`Dismiss notification`,onClick:()=>y(void 0),children:`×`})]}),(0,F.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`?g:`100%`,border:0}})]});return t.kind===`tool`?(0,F.jsx)(DQ,{title:m?.title,tool:n,locale:t.locale,children:S}):S}var MQ=()=>document.body.hasAttribute(`data-ds-dark-theme`)?`dark`:`light`;function NQ(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,F.jsx)(Zk,{card:e,...t})},panels:r.panels.map(a=>({kind:i(a),component:o=>(0,F.jsx)(jQ,{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:MQ()},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,F.jsx)(jQ,{card:e,reconnect:t,abort:()=>n.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`tool`,sessionId:i.session.sessionId,locale:i.locale,theme:MQ()},update:{call:i.call,result:i.result,running:i.running},open:(e,t)=>i.openPanel(`${r.panelAlias.prefix}${t}`),sendMessage:i.sendMessage},op.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 PQ(e,t,n,r,i){let a=CQ({sessionId:t,locale:i,openRecovered:e=>r.current.openPanel?.(`diagram:${e}`)}),[o,s]=(0,P.useState)([]),[c,l]=(0,P.useState)([]),[u,d]=(0,P.useState)([]),[f,p]=(0,P.useState)(0),[m,h]=(0,P.useState)(``),g=(0,P.useMemo)(()=>()=>p(e=>e+1),[]);(0,P.useEffect)(()=>{if(!e||!t){s([]);return}let n=!0,r=new AbortController;return window.addEventListener(`pi:hosted-catalog-changed`,g),qk.catalog(r.signal).then(e=>{n&&(s(t=>zZ(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,P.useRef)(new WeakMap),v=(0,P.useMemo)(()=>o.map(e=>{let t=_.current.get(e);return t||(t=NQ(e,g,r),_.current.set(e,t)),t}),[o,g,r]),y=e&&t?o.map(e=>(0,F.jsx)(jQ,{card:e,reconnect:g,abort:()=>r.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`controller`,sessionId:t,locale:i,theme:MQ()},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,P.useCallback)((e,t)=>{qk.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 FQ={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 IQ({approvals:e,locale:t,decide:n}){let r=FQ[t];return e.length?(0,F.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,F.jsx)(`strong`,{children:r.title}),e.map(e=>(0,F.jsxs)(`div`,{style:{marginTop:8},children:[(0,F.jsx)(`p`,{style:{margin:`0 0 6px`},children:r.body(e.pluginId,e.title)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`allow`),children:r.allow}),` `,(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`deny`),children:r.deny})]},e.id))]}):null}var LQ=`@chengzhiyi/pi-excalidraw`,RQ=[`excalidraw_create_view`,`diagram_create`,`diagram_patch`];function zQ(e){let t=({locale:t})=>(0,F.jsxs)(`section`,{role:`status`,className:SQ.history,children:[(0,F.jsx)(`h3`,{children:`Excalidraw`}),(0,F.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,F.jsx)(EO,{variant:`outline`,onClick:e,children:t===`zh`?`打开插件管理`:`Open plugin management`})]});return{id:LQ,instanceId:`drawing-recovery`,definition:{id:LQ,apiVersion:1,activate(){},artifactTools:RQ,workbench:{apiVersion:1,panels:[{kind:`drawing-recovery`,component:t}],toolViews:[{tools:RQ,component:t}],resolvePanel:e=>/^diagram:[\w-]{1,80}$/.test(e)?{kind:`drawing-recovery`,contentId:e.slice(8),title:`Excalidraw`}:null}}}}function BQ(){let e=l(),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=EA(),i=(0,P.useRef)(n.session?.sessionId);i.current=n.session?.sessionId;let[a,o]=(0,P.useState)(``);(0,P.useEffect)(()=>o(``),[n.session?.sessionId]);let{plugins:s,errors:c}=AZ(n.connection===`connected`,n.session?.sessionId,n.plugins,n.pluginGeneration),u=(0,P.useRef)({}),f=PQ(n.connection===`connected`,n.session?.sessionId,n.pluginGeneration,u,e);Vt(`hosted-runtime`,f.error);let[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!1),_=(0,P.useMemo)(()=>zQ(()=>g(!0)),[]),v=[...s,...f.plugins.filter(e=>!s.some(t=>t.id===e.id||t.definition.artifactTools?.some(t=>e.definition.artifactTools?.includes(t))))],y=v.some(e=>e.id===`@chengzhiyi/pi-excalidraw`)?v:[...v,_],b=(0,P.useMemo)(()=>[...n.disabledPlugins,...f.inactivePlugins],[n.disabledPlugins,f.inactivePlugins]),x=IZ(n.session?.sessionId,b),S=x.panelId,C=n.connection===`connected`&&n.session!==null&&n.modelsStatus===`ready`&&n.models.length===0;(0,P.useEffect)(()=>{C&&m(!0)},[C]);let w=(0,P.useCallback)(()=>{m(!1),requestAnimationFrame(()=>document.querySelector(`[aria-haspopup="dialog"].pi-settings-sidebar`)?.focus())},[]),[T,E]=(0,P.useState)(()=>({sidebar:280,viewportWidth:window.innerWidth,narrowExpanded:!1,rightbar:null,rightbarShown:!1,rightbarTrack:!1,rightbarFullscreen:!1,rightbarFocus:!1,rightbarInstant:!1})),D=(0,P.useRef)(280),O=(0,P.useRef)(!1),[k,ee]=(0,P.useState)(!1),te=(0,P.useCallback)(()=>E(e=>({...e,narrowExpanded:!1})),[]),ne=async e=>{if(!O.current){O.current=!0,ee(!0);try{n.session?.sessionId&&await op.flush(n.session.sessionId),await e(),g(!1),te()}catch(e){throw o(e instanceof Error?e.message:String(e)),e}finally{O.current=!1,ee(!1)}}},A=(0,P.useMemo)(()=>({closeSidebar:te,setViewportWidth(e){E(t=>t.viewportWidth===e?t:{...t,viewportWidth:e,narrowExpanded:t.viewportWidth<1024==e<1024&&t.narrowExpanded})},setSidebar(e){D.current=Math.min(420,Math.max(264,Math.round(e))),E(e=>({...e,sidebar:D.current}))},setRightbar(e){E(t=>({...t,rightbar:Ne(e,300,t.viewportWidth*Ae)}))},focusRightbar(){E(e=>({...e,rightbarFocus:!0}))},collapseRightbar(){E(e=>({...e,rightbarFocus:!1})),x.controller.setExpanded(!1)}}),[te,x.controller]),re=e=>{let t=y.flatMap(t=>{let n=t.definition.workbench?.resolvePanel?.(e);return n?[{...n,pluginId:t.id}]:[]})[0];t?x.openContent(t.kind,t.contentId,t.title,void 0,t.pluginId):x.controller.openContent({kind:`plugin`,contentId:e,title:r(`预览`,`Preview`)}),x.controller.setExpanded(!0),g(!1),E(e=>({...e,narrowExpanded:!1}))},ie=()=>x.controller.setExpanded(!1),j=(0,P.useCallback)(e=>{if(!n.session||n.disabledPlugins.includes(d.files))return;let t=Xt(n.session.cwd,e);x.openContent(`file-preview`,t,t.split(`/`).at(-1),void 0,d.files),E(e=>({...e,narrowExpanded:!1}))},[n.session?.cwd,n.disabledPlugins,x.openContent]);(0,P.useEffect)(()=>{let e=T.viewportWidth<767||x.snapshot.state.mode===`fullscreen`;E(t=>({...t,rightbarShown:x.shown&&!h,rightbarTrack:x.shown&&!h,rightbarFullscreen:e,rightbarFocus:t.rightbarFocus&&x.shown&&!h&&!e}))},[x.shown,x.snapshot.state.mode,T.viewportWidth,h]),(0,P.useEffect)(()=>{E(e=>e.rightbarFocus?{...e,rightbarFocus:!1}:e)},[n.session?.sessionId]);let ae=(0,P.useCallback)((e,t)=>(0,F.jsx)(pJ,{text:e,pathImages:t,labels:{code:{copyLabel:r(`复制`,`Copy`),copiedLabel:r(`已复制`,`Copied`),toolbarLabels:{codeLabel:r(`代码块`,`Code block`),wrapLabel:r(`自动换行`,`Wrap`),unwrapLabel:r(`取消换行`,`Unwrap`)}},footnotes:r(`脚注`,`Footnotes`)}}),[e]),oe=async(...e)=>{let t=n.session?.sessionId;o(``);try{if(t){await op.flush(t);for(let e of y)await e.definition.workbench?.beforeSend?.(t)}if(t!==i.current)throw Error(r(`会话已切换,请在原会话重试`,`Session changed. Retry in the original conversation.`))}catch(e){throw o(e instanceof Error?e.message:String(e)),e}return n.send(...e)},M={session:n.session,locale:e,openPanel:re,closePanel:ie,panelId:S,invokePluginAction:n.invokePluginAction,resolvePluginInteraction:n.resolvePluginInteraction,sendMessage:e=>oe(e,[]),renderMarkdown:ae};u.current={openPanel:re,sendMessage:M.sendMessage,abort:n.stop};let se=(e,t)=>(0,F.jsx)(FZ,{plugins:y,slot:e,props:{...M,turn:t}}),ce=()=>E(e=>e.viewportWidth<1024?{...e,narrowExpanded:!e.narrowExpanded}:{...e,sidebar:e.sidebar===0?D.current:0}),le=e=>e({layoutInfo:T}),ue=e=>e({activePanelId:h?`plugins`:null}),de=e=>e([{id:`plugins`,label:r(`插件`,`Plugins`)}]),pe=(e,t,i)=>e===`sidebar.brand.mark`?(0,F.jsx)(Je,{size:24}):e===`sidebar.brand.name`?(0,F.jsx)(`span`,{children:`pi-webapp`}):e===`sidebar.footer.action`?(0,F.jsx)(iA,{wide:t.wide,hideError:p,getUpdate:n.getUpdate,getRunningVersion:n.getRunningVersion,setUpdateChannel:n.setUpdateChannel,cancelUpdate:n.cancelUpdate,update:n.update}):e===`sidebar.panellist`?(0,F.jsx)(fe,{size:t.size}):e===`sidebar.settings`?(0,F.jsxs)(`div`,{className:`pi-settings-trigger-row pi-settings-trigger-split ${t.wide?``:`pi-settings-trigger-rail`}`,children:[!t.wide&&(0,F.jsx)(cA,{wide:!1}),(0,F.jsxs)(`button`,{className:`pi-settings-sidebar`,"data-wide":t.wide,type:`button`,"aria-label":r(`Pi 设置`,`Pi Settings`),"aria-haspopup":`dialog`,"aria-expanded":p,onClick:()=>m(!0),children:[t.wide?(0,F.jsx)(rt,{size:16}):(0,F.jsx)(nt,{size:18}),t.wide&&(0,F.jsx)(`span`,{children:r(`Pi 设置`,`Pi Settings`)})]}),t.wide&&(0,F.jsx)(cA,{wide:!0})]}):e===`sidebar.workspaces`?(0,F.jsx)(XO,{wide:t.wide,expandSidebar:t.expandSidebar,session:n.session,workspaces:n.workspaces,navigationBusy:k,connected:n.connection===`connected`&&n.session!==null,onAdd:(e,t)=>ne(()=>n.addWorkspace(e,t)),directoryPickerKind:n.directoryPickerKind,pickDirectory:n.pickDirectory,listDirectory:n.listDirectory,createDirectory:n.createDirectory,onRemove:e=>ne(()=>n.removeWorkspace(e)),onSelectSession:(e,t,r)=>ne(()=>n.selectSession(e,t,r)),onNewSession:e=>ne(()=>n.newSessionInWorkspace(e)),onRenameSession:(e,t,r,i)=>n.renameSession(e,t,r,i),onDeleteSession:(e,t,r)=>ne(()=>n.deleteSession(e,t,r))}):i?.fallback??null;return(0,F.jsxs)(Tk,{actions:n,children:[f.controllers,(0,F.jsx)(Wt,{closeLabel:r(`关闭`,`Dismiss`),detailLabel:r(`诊断信息`,`Diagnostics`)}),(0,F.jsx)(IQ,{approvals:f.approvals,locale:e,decide:f.decide}),(0,F.jsx)(Ke,{useStore:le,usePanelInfo:ue,actions:A,renderSlot:(r,i)=>r===`sidebar`?(0,F.jsx)(Yt,{collapsed:i.collapsed,width:i.width,startSession:()=>{ne(n.newSession).catch(()=>{})},sessionBusy:k||n.connection!==`connected`||n.session===null,toggleSidebar:ce,selectPanel:()=>{g(!0),te()},usePanels:de,usePanelInfo:ue,t:e=>t[e]??e,renderSlot:pe}):r===`main`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{hidden:h,style:{height:`100%`},children:(0,F.jsx)(Qd,{openFile:j,children:(0,F.jsx)(wO,{rightbarControl:(0,F.jsx)(RZ,{panel:x,locale:e}),session:n.session,streaming:n.streaming,connection:n.connection,error:a||n.error,onDismissError:()=>{o(``),n.clearError()},onSend:oe,onUpdateQueuedPrompt:n.updateQueuedPrompt,onLoadImage:n.loadMessageImage,onUpload:n.upload,onDiscardAttachment:n.discardAttachment,onStop:n.stop,onResume:n.resume,onCompact:n.compact,onNewSession:()=>ne(n.newSession),commands:n.commands,models:n.models,modelsStatus:n.modelsStatus,onConfigureModels:()=>m(!0),onSetModel:n.setModel,onSetThinkingLevel:n.setThinkingLevel,composerInteraction:n.session?.interactions?.some(e=>y.some(t=>t.id===e.pluginId&&t.definition.interactions?.some(t=>t.kind===e.kind)))?(0,F.jsx)(NZ,{plugins:y,props:M}):void 0,renderToolView:(e,t,n)=>(0,F.jsx)(PZ,{plugins:y,props:M,call:e,result:t,running:n}),renderPluginSlot:se,plugins:y,onPluginAction:n.invokePluginAction})})}),h&&(0,F.jsx)(nA,{recovery:f.recovery,getPluginManagement:n.getPluginManagement,togglePlugin:n.togglePlugin,generation:n.pluginGeneration})]}):r===`rightbar`&&Object.keys(x.snapshot.state.tabs).length>0?(0,F.jsx)(`div`,{hidden:h,style:{height:`100%`},children:(0,F.jsx)(LZ,{panel:x,cwd:n.session?.cwd,width:i.width,narrow:T.viewportWidth<767,focus:T.rightbarFocus,onExitFocus:()=>E(e=>({...e,rightbarFocus:!1})),plugins:y,props:M},n.session?.sessionId)}):null,t:e=>t[e]??e}),c.length>0&&(0,F.jsxs)(`div`,{className:`pi-plugin-errors`,role:`status`,title:c.join(`
|
|
502
502
|
`),children:[r(`插件加载失败`,`Plugin load failed`),`: `,c.length]}),p&&(0,F.jsx)(Hk,{onBack:w,setupMode:C,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 VQ=e({});fk(),h();var HQ=document.getElementById(`root`);if(!HQ)throw Error(`Missing #root`);(0,De.createRoot)(HQ).render((0,F.jsx)(Oe,{children:(0,F.jsx)(BQ,{})}));export{cB as a,tf as c,TX as i,bZ as n,Np as o,OX as r,kp as s,VQ as t};
|
|
503
|
-
//# debugId=
|
|
503
|
+
//# debugId=0ad314d6-7ae9-49b6-b433-85dbaf0146ab
|