@letra-ai/cli 0.5.3 → 0.6.1
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/chunk-4QDEU6KP.js +2765 -0
- package/dist/chunk-6HSUVCTR.js +363 -0
- package/dist/chunk-BKAUN5QH.js +300 -0
- package/dist/chunk-BTPFUKHG.js +275 -0
- package/dist/chunk-EDD55PWL.js +119 -0
- package/dist/chunk-ELBTIPYN.js +256 -0
- package/dist/chunk-IEFSLCJL.js +837 -0
- package/dist/chunk-JMIC5NKB.js +235 -0
- package/dist/chunk-KGQLHMGZ.js +4494 -0
- package/dist/chunk-MJ2QXNH6.js +130 -0
- package/dist/chunk-MSF44WWE.js +443 -0
- package/dist/chunk-PDX44BCA.js +11 -0
- package/dist/chunk-QIVKP3EY.js +362 -0
- package/dist/client/assets/index-BuABgOyz.js +232 -0
- package/dist/client/assets/index-CpseCZh9.css +1 -0
- package/dist/client/favicon.svg +16 -4
- package/dist/client/index.html +25 -20
- package/dist/fallback-UXSZ4LNR.js +47 -0
- package/dist/flow-serve-MTB6KZMR.js +19 -0
- package/dist/focus-sync-3D3XWCTI.js +17 -0
- package/dist/generate-N22QOXUF.js +20 -0
- package/dist/harness/default/v0.1.0/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.0/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.0/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.0/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.0/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.0/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.0/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.0/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.0/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.0/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.1/flows/flow-main.yaml +61 -0
- package/dist/harness/default/v0.1.1/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.1/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.1/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.1/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.1/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.1/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.1/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.1/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.1/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.1/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.2/flows/flow-main.yaml +86 -0
- package/dist/harness/default/v0.1.2/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.2/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.2/gates/human-approved-code.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/human-approved-spec.yaml +8 -0
- package/dist/harness/default/v0.1.2/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.2/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.2/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.2/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.2/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.2/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.2/roles/security.yaml +8 -0
- package/dist/harness/default/v0.1.3/flows/flow-main.yaml +90 -0
- package/dist/harness/default/v0.1.3/flows/sdlc.yaml +179 -0
- package/dist/harness/default/v0.1.3/gates/all-acs-passing.yaml +8 -0
- package/dist/harness/default/v0.1.3/gates/has-spec-file.yaml +7 -0
- package/dist/harness/default/v0.1.3/gates/human-approved-code.yaml +9 -0
- package/dist/harness/default/v0.1.3/gates/human-approved-spec.yaml +9 -0
- package/dist/harness/default/v0.1.3/gates/security-clear.yaml +8 -0
- package/dist/harness/default/v0.1.3/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.1.3/roles/analyst.yaml +9 -0
- package/dist/harness/default/v0.1.3/roles/builder.yaml +9 -0
- package/dist/harness/default/v0.1.3/roles/pr-bot.yaml +8 -0
- package/dist/harness/default/v0.1.3/roles/reviewer.yaml +10 -0
- package/dist/harness/default/v0.1.3/roles/security.yaml +8 -0
- package/dist/harness/default/v0.2.0/executors/registry.yaml +51 -0
- package/dist/harness/default/v0.2.0/flows/flow-main.yaml +247 -0
- package/dist/harness/default/v0.2.0/gates/code-reviewed.yaml +7 -0
- package/dist/harness/default/v0.2.0/gates/human-approved.yaml +10 -0
- package/dist/harness/default/v0.2.0/gates/security-clear.yaml +7 -0
- package/dist/harness/default/v0.2.0/gates/spec-approved.yaml +10 -0
- package/dist/harness/default/v0.2.0/policies/sdlc-default.json +20 -0
- package/dist/harness/default/v0.2.0/roles/analyst.yaml +16 -0
- package/dist/harness/default/v0.2.0/roles/implementer.yaml +17 -0
- package/dist/harness/default/v0.2.0/roles/reviewer.yaml +17 -0
- package/dist/harness/default/v0.2.0/roles/security.yaml +17 -0
- package/dist/health-record-YDVXEVLR.js +21 -0
- package/dist/index.js +1932 -2528
- package/dist/init-wizard-NODBBNKO.js +178 -0
- package/dist/push-5JEYSXBY.js +116 -0
- package/dist/registry-6VPIA3EG.js +18 -0
- package/dist/server-FUP3APZA.js +415 -0
- package/dist/service-OGF7BMCQ.js +21 -0
- package/dist/session-log-WTQ5JBEN.js +21 -0
- package/dist/sitrep-DJXTP3JO.js +16 -0
- package/package.json +37 -28
- package/dist/chunk-56GTTLC4.js +0 -1322
- package/dist/chunk-QWT5M4XU.js +0 -643
- package/dist/client/assets/index-CuLfFw4K.js +0 -85
- package/dist/client/assets/index-iyLqZcWx.css +0 -1
- package/dist/generate-BF5R5GGA.js +0 -7
- package/dist/sitrep-SI6ZFIAM.js +0 -10
- package/tsup.config.ts +0 -11
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
var vg=Object.defineProperty;var gg=(s,o,u)=>o in s?vg(s,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[o]=u;var _a=(s,o,u)=>gg(s,typeof o!="symbol"?o+"":o,u);function bg(s,o){for(var u=0;u<o.length;u++){const c=o[u];if(typeof c!="string"&&!Array.isArray(c)){for(const d in c)if(d!=="default"&&!(d in s)){const m=Object.getOwnPropertyDescriptor(c,d);m&&Object.defineProperty(s,d,m.get?m:{enumerable:!0,get:()=>c[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();function yg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wc={exports:{}},Js={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ah;function jg(){if(Ah)return Js;Ah=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function u(c,d,m){var p=null;if(m!==void 0&&(p=""+m),d.key!==void 0&&(p=""+d.key),"key"in d){m={};for(var x in d)x!=="key"&&(m[x]=d[x])}else m=d;return d=m.ref,{$$typeof:s,type:c,key:p,ref:d!==void 0?d:null,props:m}}return Js.Fragment=o,Js.jsx=u,Js.jsxs=u,Js}var kh;function Ng(){return kh||(kh=1,Wc.exports=jg()),Wc.exports}var l=Ng(),Fc={exports:{}},Re={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Th;function Sg(){if(Th)return Re;Th=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),E=Symbol.iterator;function M(b){return b===null||typeof b!="object"?null:(b=E&&b[E]||b["@@iterator"],typeof b=="function"?b:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,P={};function ee(b,A,$){this.props=b,this.context=A,this.refs=P,this.updater=$||B}ee.prototype.isReactComponent={},ee.prototype.setState=function(b,A){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,A,"setState")},ee.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function ue(){}ue.prototype=ee.prototype;function ve(b,A,$){this.props=b,this.context=A,this.refs=P,this.updater=$||B}var Y=ve.prototype=new ue;Y.constructor=ve,J(Y,ee.prototype),Y.isPureReactComponent=!0;var de=Array.isArray;function he(){}var te={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function pe(b,A,$){var I=$.ref;return{$$typeof:s,type:b,key:A,ref:I!==void 0?I:null,props:$}}function Ee(b,A){return pe(b.type,A,b.props)}function me(b){return typeof b=="object"&&b!==null&&b.$$typeof===s}function R(b){var A={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function($){return A[$]})}var re=/\/+/g;function ce(b,A){return typeof b=="object"&&b!==null&&b.key!=null?R(""+b.key):A.toString(36)}function Se(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(he,he):(b.status="pending",b.then(function(A){b.status==="pending"&&(b.status="fulfilled",b.value=A)},function(A){b.status==="pending"&&(b.status="rejected",b.reason=A)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function z(b,A,$,I,fe){var V=typeof b;(V==="undefined"||V==="boolean")&&(b=null);var T=!1;if(b===null)T=!0;else switch(V){case"bigint":case"string":case"number":T=!0;break;case"object":switch(b.$$typeof){case s:case o:T=!0;break;case N:return T=b._init,z(T(b._payload),A,$,I,fe)}}if(T)return fe=fe(b),T=I===""?"."+ce(b,0):I,de(fe)?($="",T!=null&&($=T.replace(re,"$&/")+"/"),z(fe,A,$,"",function(De){return De})):fe!=null&&(me(fe)&&(fe=Ee(fe,$+(fe.key==null||b&&b.key===fe.key?"":(""+fe.key).replace(re,"$&/")+"/")+T)),A.push(fe)),1;T=0;var Q=I===""?".":I+":";if(de(b))for(var oe=0;oe<b.length;oe++)I=b[oe],V=Q+ce(I,oe),T+=z(I,A,$,V,fe);else if(oe=M(b),typeof oe=="function")for(b=oe.call(b),oe=0;!(I=b.next()).done;)I=I.value,V=Q+ce(I,oe++),T+=z(I,A,$,V,fe);else if(V==="object"){if(typeof b.then=="function")return z(Se(b),A,$,I,fe);throw A=String(b),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.")}return T}function L(b,A,$){if(b==null)return b;var I=[],fe=0;return z(b,I,"","",function(V){return A.call($,V,fe++)}),I}function le(b){if(b._status===-1){var A=b._result;A=A(),A.then(function($){(b._status===0||b._status===-1)&&(b._status=1,b._result=$)},function($){(b._status===0||b._status===-1)&&(b._status=2,b._result=$)}),b._status===-1&&(b._status=0,b._result=A)}if(b._status===1)return b._result.default;throw b._result}var ie=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},D={map:L,forEach:function(b,A,$){L(b,function(){A.apply(this,arguments)},$)},count:function(b){var A=0;return L(b,function(){A++}),A},toArray:function(b){return L(b,function(A){return A})||[]},only:function(b){if(!me(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return Re.Activity=j,Re.Children=D,Re.Component=ee,Re.Fragment=u,Re.Profiler=d,Re.PureComponent=ve,Re.StrictMode=c,Re.Suspense=y,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=te,Re.__COMPILER_RUNTIME={__proto__:null,c:function(b){return te.H.useMemoCache(b)}},Re.cache=function(b){return function(){return b.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(b,A,$){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var I=J({},b.props),fe=b.key;if(A!=null)for(V in A.key!==void 0&&(fe=""+A.key),A)!H.call(A,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&A.ref===void 0||(I[V]=A[V]);var V=arguments.length-2;if(V===1)I.children=$;else if(1<V){for(var T=Array(V),Q=0;Q<V;Q++)T[Q]=arguments[Q+2];I.children=T}return pe(b.type,fe,I)},Re.createContext=function(b){return b={$$typeof:p,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:m,_context:b},b},Re.createElement=function(b,A,$){var I,fe={},V=null;if(A!=null)for(I in A.key!==void 0&&(V=""+A.key),A)H.call(A,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(fe[I]=A[I]);var T=arguments.length-2;if(T===1)fe.children=$;else if(1<T){for(var Q=Array(T),oe=0;oe<T;oe++)Q[oe]=arguments[oe+2];fe.children=Q}if(b&&b.defaultProps)for(I in T=b.defaultProps,T)fe[I]===void 0&&(fe[I]=T[I]);return pe(b,V,fe)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(b){return{$$typeof:x,render:b}},Re.isValidElement=me,Re.lazy=function(b){return{$$typeof:N,_payload:{_status:-1,_result:b},_init:le}},Re.memo=function(b,A){return{$$typeof:g,type:b,compare:A===void 0?null:A}},Re.startTransition=function(b){var A=te.T,$={};te.T=$;try{var I=b(),fe=te.S;fe!==null&&fe($,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(he,ie)}catch(V){ie(V)}finally{A!==null&&$.types!==null&&(A.types=$.types),te.T=A}},Re.unstable_useCacheRefresh=function(){return te.H.useCacheRefresh()},Re.use=function(b){return te.H.use(b)},Re.useActionState=function(b,A,$){return te.H.useActionState(b,A,$)},Re.useCallback=function(b,A){return te.H.useCallback(b,A)},Re.useContext=function(b){return te.H.useContext(b)},Re.useDebugValue=function(){},Re.useDeferredValue=function(b,A){return te.H.useDeferredValue(b,A)},Re.useEffect=function(b,A){return te.H.useEffect(b,A)},Re.useEffectEvent=function(b){return te.H.useEffectEvent(b)},Re.useId=function(){return te.H.useId()},Re.useImperativeHandle=function(b,A,$){return te.H.useImperativeHandle(b,A,$)},Re.useInsertionEffect=function(b,A){return te.H.useInsertionEffect(b,A)},Re.useLayoutEffect=function(b,A){return te.H.useLayoutEffect(b,A)},Re.useMemo=function(b,A){return te.H.useMemo(b,A)},Re.useOptimistic=function(b,A){return te.H.useOptimistic(b,A)},Re.useReducer=function(b,A,$){return te.H.useReducer(b,A,$)},Re.useRef=function(b){return te.H.useRef(b)},Re.useState=function(b){return te.H.useState(b)},Re.useSyncExternalStore=function(b,A,$){return te.H.useSyncExternalStore(b,A,$)},Re.useTransition=function(){return te.H.useTransition()},Re.version="19.2.7",Re}var Mh;function yu(){return Mh||(Mh=1,Fc.exports=Sg()),Fc.exports}var v=yu();const wg=yg(v),Cg=bg({__proto__:null,default:wg},[v]);var Ic={exports:{}},$s={},Pc={exports:{}},eu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Dh;function zg(){return Dh||(Dh=1,(function(s){function o(z,L){var le=z.length;z.push(L);e:for(;0<le;){var ie=le-1>>>1,D=z[ie];if(0<d(D,L))z[ie]=L,z[le]=D,le=ie;else break e}}function u(z){return z.length===0?null:z[0]}function c(z){if(z.length===0)return null;var L=z[0],le=z.pop();if(le!==L){z[0]=le;e:for(var ie=0,D=z.length,b=D>>>1;ie<b;){var A=2*(ie+1)-1,$=z[A],I=A+1,fe=z[I];if(0>d($,le))I<D&&0>d(fe,$)?(z[ie]=fe,z[I]=le,ie=I):(z[ie]=$,z[A]=le,ie=A);else if(I<D&&0>d(fe,le))z[ie]=fe,z[I]=le,ie=I;else break e}}return L}function d(z,L){var le=z.sortIndex-L.sortIndex;return le!==0?le:z.id-L.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var p=Date,x=p.now();s.unstable_now=function(){return p.now()-x}}var y=[],g=[],N=1,j=null,E=3,M=!1,B=!1,J=!1,P=!1,ee=typeof setTimeout=="function"?setTimeout:null,ue=typeof clearTimeout=="function"?clearTimeout:null,ve=typeof setImmediate<"u"?setImmediate:null;function Y(z){for(var L=u(g);L!==null;){if(L.callback===null)c(g);else if(L.startTime<=z)c(g),L.sortIndex=L.expirationTime,o(y,L);else break;L=u(g)}}function de(z){if(J=!1,Y(z),!B)if(u(y)!==null)B=!0,he||(he=!0,R());else{var L=u(g);L!==null&&Se(de,L.startTime-z)}}var he=!1,te=-1,H=5,pe=-1;function Ee(){return P?!0:!(s.unstable_now()-pe<H)}function me(){if(P=!1,he){var z=s.unstable_now();pe=z;var L=!0;try{e:{B=!1,J&&(J=!1,ue(te),te=-1),M=!0;var le=E;try{t:{for(Y(z),j=u(y);j!==null&&!(j.expirationTime>z&&Ee());){var ie=j.callback;if(typeof ie=="function"){j.callback=null,E=j.priorityLevel;var D=ie(j.expirationTime<=z);if(z=s.unstable_now(),typeof D=="function"){j.callback=D,Y(z),L=!0;break t}j===u(y)&&c(y),Y(z)}else c(y);j=u(y)}if(j!==null)L=!0;else{var b=u(g);b!==null&&Se(de,b.startTime-z),L=!1}}break e}finally{j=null,E=le,M=!1}L=void 0}}finally{L?R():he=!1}}}var R;if(typeof ve=="function")R=function(){ve(me)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ce=re.port2;re.port1.onmessage=me,R=function(){ce.postMessage(null)}}else R=function(){ee(me,0)};function Se(z,L){te=ee(function(){z(s.unstable_now())},L)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(z){z.callback=null},s.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<z?Math.floor(1e3/z):5},s.unstable_getCurrentPriorityLevel=function(){return E},s.unstable_next=function(z){switch(E){case 1:case 2:case 3:var L=3;break;default:L=E}var le=E;E=L;try{return z()}finally{E=le}},s.unstable_requestPaint=function(){P=!0},s.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var le=E;E=z;try{return L()}finally{E=le}},s.unstable_scheduleCallback=function(z,L,le){var ie=s.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ie+le:ie):le=ie,z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=le+D,z={id:N++,callback:L,priorityLevel:z,startTime:le,expirationTime:D,sortIndex:-1},le>ie?(z.sortIndex=le,o(g,z),u(y)===null&&z===u(g)&&(J?(ue(te),te=-1):J=!0,Se(de,le-ie))):(z.sortIndex=D,o(y,z),B||M||(B=!0,he||(he=!0,R()))),z},s.unstable_shouldYield=Ee,s.unstable_wrapCallback=function(z){var L=E;return function(){var le=E;E=L;try{return z.apply(this,arguments)}finally{E=le}}}})(eu)),eu}var Oh;function Eg(){return Oh||(Oh=1,Pc.exports=zg()),Pc.exports}var tu={exports:{}},qt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var _h;function Ag(){if(_h)return qt;_h=1;var s=yu();function o(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)g+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(o(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(y,g,N){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:y,containerInfo:g,implementation:N}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,qt.createPortal=function(y,g){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(o(299));return m(y,g,null,N)},qt.flushSync=function(y){var g=p.T,N=c.p;try{if(p.T=null,c.p=2,y)return y()}finally{p.T=g,c.p=N,c.d.f()}},qt.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,c.d.C(y,g))},qt.prefetchDNS=function(y){typeof y=="string"&&c.d.D(y)},qt.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var N=g.as,j=x(N,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,M=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;N==="style"?c.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:E,fetchPriority:M}):N==="script"&&c.d.X(y,{crossOrigin:j,integrity:E,fetchPriority:M,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},qt.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var N=x(g.as,g.crossOrigin);c.d.M(y,{crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&c.d.M(y)},qt.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var N=g.as,j=x(N,g.crossOrigin);c.d.L(y,N,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},qt.preloadModule=function(y,g){if(typeof y=="string")if(g){var N=x(g.as,g.crossOrigin);c.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else c.d.m(y)},qt.requestFormReset=function(y){c.d.r(y)},qt.unstable_batchedUpdates=function(y,g){return y(g)},qt.useFormState=function(y,g,N){return p.H.useFormState(y,g,N)},qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},qt.version="19.2.7",qt}var Rh;function bp(){if(Rh)return tu.exports;Rh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),tu.exports=Ag(),tu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Lh;function kg(){if(Lh)return $s;Lh=1;var s=Eg(),o=yu(),u=bp();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function p(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 x(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 y(e){if(m(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var r=a.return;if(r===null)break;var i=r.alternate;if(i===null){if(n=r.return,n!==null){a=n;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===a)return y(r),e;if(i===n)return y(r),t;i=i.sibling}throw Error(c(188))}if(a.return!==n.return)a=r,n=i;else{for(var f=!1,h=r.child;h;){if(h===a){f=!0,a=r,n=i;break}if(h===n){f=!0,n=r,a=i;break}h=h.sibling}if(!f){for(h=i.child;h;){if(h===a){f=!0,a=i,n=r;break}if(h===n){f=!0,n=i,a=r;break}h=h.sibling}if(!f)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,E=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),ue=Symbol.for("react.consumer"),ve=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),Ee=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=me&&e[me]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case ee:return"Profiler";case P:return"StrictMode";case de:return"Suspense";case he:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case ve:return e.displayName||"Context";case ue:return(e._context.displayName||"Context")+".Consumer";case Y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var Se=Array.isArray,z=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ie=[],D=-1;function b(e){return{current:e}}function A(e){0>D||(e.current=ie[D],ie[D]=null,D--)}function $(e,t){D++,ie[D]=e.current,e.current=t}var I=b(null),fe=b(null),V=b(null),T=b(null);function Q(e,t){switch($(V,t),$(fe,e),$(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fm(t),e=Im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}A(I),$(I,e)}function oe(){A(I),A(fe),A(V)}function De(e){e.memoizedState!==null&&$(T,e);var t=I.current,a=Im(t,e.type);t!==a&&($(fe,e),$(I,a))}function ne(e){fe.current===e&&(A(I),A(fe)),T.current===e&&(A(T),Qs._currentValue=le)}var be,xe;function q(e){if(be===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",xe=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+be+e+xe}var we=!1;function Oe(e,t){if(!e||we)return"";we=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var U=G}Reflect.construct(e,[],W)}else{try{W.call()}catch(G){U=G}e.call(W.prototype)}}else{try{throw Error()}catch(G){U=G}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&U&&typeof G.stack=="string")return[G.stack,U.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),f=i[0],h=i[1];if(f&&h){var S=f.split(`
|
|
44
|
+
`),_=h.split(`
|
|
45
|
+
`);for(r=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;r<_.length&&!_[r].includes("DetermineComponentFrameRoot");)r++;if(n===S.length||r===_.length)for(n=S.length-1,r=_.length-1;1<=n&&0<=r&&S[n]!==_[r];)r--;for(;1<=n&&0<=r;n--,r--)if(S[n]!==_[r]){if(n!==1||r!==1)do if(n--,r--,0>r||S[n]!==_[r]){var X=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=n&&0<=r);break}}}finally{we=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?q(a):""}function kt(e,t){switch(e.tag){case 26:case 27:case 5:return q(e.type);case 16:return q("Lazy");case 13:return e.child!==t&&t!==null?q("Suspense Fallback"):q("Suspense");case 19:return q("SuspenseList");case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return q("Activity");default:return""}}function ht(e){try{var t="",a=null;do t+=kt(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var Vt=Object.prototype.hasOwnProperty,Pt=s.unstable_scheduleCallback,ol=s.unstable_cancelCallback,Ie=s.unstable_shouldYield,ca=s.unstable_requestPaint,tt=s.unstable_now,Ul=s.unstable_getCurrentPriorityLevel,cl=s.unstable_ImmediatePriority,Hl=s.unstable_UserBlockingPriority,Yt=s.unstable_NormalPriority,Z=s.unstable_LowPriority,Te=s.unstable_IdlePriority,Le=s.log,at=s.unstable_setDisableYieldValue,pt=null,ut=null;function Tt(e){if(typeof Le=="function"&&at(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(pt,e)}catch{}}var Ct=Math.clz32?Math.clz32:Xt,ua=Math.log,Qt=Math.LN2;function Xt(e){return e>>>=0,e===0?32:31-(ua(e)/Qt|0)|0}var Ot=256,Na=262144,fn=4194304;function Ua(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&261888;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 mn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var h=n&134217727;return h!==0?(n=h&~i,n!==0?r=Ua(n):(f&=h,f!==0?r=Ua(f):a||(a=h&~e,a!==0&&(r=Ua(a))))):(h=n&~i,h!==0?r=Ua(h):f!==0?r=Ua(f):a||(a=n&~e,a!==0&&(r=Ua(a)))),r===0?0:t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:r}function Bl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qi(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 hn(){var e=fn;return fn<<=1,(fn&62914560)===0&&(fn=4194304),e}function ns(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ql(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Gi(e,t,a,n,r,i){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var h=e.entanglements,S=e.expirationTimes,_=e.hiddenUpdates;for(a=f&~a;0<a;){var X=31-Ct(a),W=1<<X;h[X]=0,S[X]=-1;var U=_[X];if(U!==null)for(_[X]=null,X=0;X<U.length;X++){var G=U[X];G!==null&&(G.lane&=-536870913)}a&=~W}n!==0&&ss(e,n,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(f&~t))}function ss(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ct(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function ur(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ct(a),r=1<<n;r&t|e[n]&t&&(e[n]|=t),a&=~r}}function dr(e,t){var a=t&-t;return a=(a&42)!==0?1:rs(a),(a&(e.suspendedLanes|t))!==0?0:a}function rs(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 pn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function fr(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:jh(e.type))}function mr(e,t){var a=L.p;try{return L.p=e,t()}finally{L.p=a}}var ka=Math.random().toString(36).slice(2),zt="__reactFiber$"+ka,Ht="__reactProps$"+ka,ul="__reactContainer$"+ka,Gl="__reactEvents$"+ka,hr="__reactListeners$"+ka,se="__reactHandles$"+ka,ae="__reactResources$"+ka,ye="__reactMarker$"+ka;function _e(e){delete e[zt],delete e[Ht],delete e[Gl],delete e[hr],delete e[se]}function Be(e){var t=e[zt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ul]||a[zt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=sh(e);e!==null;){if(a=e[zt])return a;e=sh(e)}return t}e=a,a=e.parentNode}return null}function qe(e){if(e=e[zt]||e[ul]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Ve(e){var t=e[ae];return t||(t=e[ae]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function lt(e){e[ye]=!0}var Sa=new Set,xn={};function Vl(e,t){vn(e,t),vn(e+"Capture",t)}function vn(e,t){for(xn[e]=t,e=0;e<t.length;e++)Sa.add(t[e])}var ox=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]*$"),qu={},Gu={};function cx(e){return Vt.call(Gu,e)?!0:Vt.call(qu,e)?!1:ox.test(e)?Gu[e]=!0:(qu[e]=!0,!1)}function pr(e,t,a){if(cx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function xr(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Ha(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ux(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(f){a=""+f,i.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vi(e){if(!e._valueTracker){var t=Vu(e)?"checked":"value";e._valueTracker=ux(e,t,""+e[t])}}function Yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Vu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function vr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dx=/[\n"\\]/g;function fa(e){return e.replace(dx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yi(e,t,a,n,r,i,f,h){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Qi(e,f,da(t)):a!=null?Qi(e,f,da(a)):n!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+da(h):e.removeAttribute("name")}function Qu(e,t,a,n,r,i,f,h){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Vi(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(t):a,h||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=h?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Vi(e)}function Qi(e,t,a){t==="number"&&vr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function gn(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&n&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Xu(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function Zu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(Se(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Vi(e)}function bn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var fx=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 Ku(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||fx.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ju(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var r in t)n=t[r],t.hasOwnProperty(r)&&a[r]!==n&&Ku(e,r,n)}else for(var i in t)t.hasOwnProperty(i)&&Ku(e,i,t[i])}function Xi(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 mx=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"],["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"]]),hx=/^[\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 gr(e){return hx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ba(){}var Zi=null;function Ki(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,jn=null;function $u(e){var t=qe(e);if(t&&(e=t.stateNode)){var a=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yi(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+fa(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var r=n[Ht]||null;if(!r)throw Error(c(90));Yi(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Yu(n)}break e;case"textarea":Xu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&gn(e,!!a.multiple,t,!1)}}}var Ji=!1;function Wu(e,t,a){if(Ji)return e(t,a);Ji=!0;try{var n=e(t);return n}finally{if(Ji=!1,(yn!==null||jn!==null)&&(si(),yn&&(t=yn,e=jn,jn=yn=null,$u(t),e)))for(t=0;t<e.length;t++)$u(e[t])}}function is(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Ht]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$i=!1;if(qa)try{var os={};Object.defineProperty(os,"passive",{get:function(){$i=!0}}),window.addEventListener("test",os,os),window.removeEventListener("test",os,os)}catch{$i=!1}var dl=null,Wi=null,br=null;function Fu(){if(br)return br;var e,t=Wi,a=t.length,n,r="value"in dl?dl.value:dl.textContent,i=r.length;for(e=0;e<a&&t[e]===r[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===r[i-n];n++);return br=r.slice(e,1<n?1-n:void 0)}function yr(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 jr(){return!0}function Iu(){return!1}function Zt(e){function t(a,n,r,i,f){this._reactName=a,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=f,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(a=e[h],this[h]=a?a(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?jr:Iu,this.isPropagationStopped=Iu,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=jr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=jr)},persist:function(){},isPersistent:jr}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nr=Zt(Yl),cs=j({},Yl,{view:0,detail:0}),px=Zt(cs),Fi,Ii,us,Sr=j({},cs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eo,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!==us&&(us&&e.type==="mousemove"?(Fi=e.screenX-us.screenX,Ii=e.screenY-us.screenY):Ii=Fi=0,us=e),Fi)},movementY:function(e){return"movementY"in e?e.movementY:Ii}}),Pu=Zt(Sr),xx=j({},Sr,{dataTransfer:0}),vx=Zt(xx),gx=j({},cs,{relatedTarget:0}),Pi=Zt(gx),bx=j({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),yx=Zt(bx),jx=j({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nx=Zt(jx),Sx=j({},Yl,{data:0}),ed=Zt(Sx),wx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cx={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"},zx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ex(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zx[e])?!!t[e]:!1}function eo(){return Ex}var Ax=j({},cs,{key:function(e){if(e.key){var t=wx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=yr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eo,charCode:function(e){return e.type==="keypress"?yr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kx=Zt(Ax),Tx=j({},Sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),td=Zt(Tx),Mx=j({},cs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eo}),Dx=Zt(Mx),Ox=j({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),_x=Zt(Ox),Rx=j({},Sr,{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}),Lx=Zt(Rx),Ux=j({},Yl,{newState:0,oldState:0}),Hx=Zt(Ux),Bx=[9,13,27,32],to=qa&&"CompositionEvent"in window,ds=null;qa&&"documentMode"in document&&(ds=document.documentMode);var qx=qa&&"TextEvent"in window&&!ds,ad=qa&&(!to||ds&&8<ds&&11>=ds),ld=" ",nd=!1;function sd(e,t){switch(e){case"keyup":return Bx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nn=!1;function Gx(e,t){switch(e){case"compositionend":return rd(t);case"keypress":return t.which!==32?null:(nd=!0,ld);case"textInput":return e=t.data,e===ld&&nd?null:e;default:return null}}function Vx(e,t){if(Nn)return e==="compositionend"||!to&&sd(e,t)?(e=Fu(),br=Wi=dl=null,Nn=!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 ad&&t.locale!=="ko"?null:t.data;default:return null}}var Yx={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 id(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yx[e.type]:t==="textarea"}function od(e,t,a,n){yn?jn?jn.push(n):jn=[n]:yn=n,t=fi(t,"onChange"),0<t.length&&(a=new Nr("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var fs=null,ms=null;function Qx(e){Xm(e,0)}function wr(e){var t=Bt(e);if(Yu(t))return e}function cd(e,t){if(e==="change")return t}var ud=!1;if(qa){var ao;if(qa){var lo="oninput"in document;if(!lo){var dd=document.createElement("div");dd.setAttribute("oninput","return;"),lo=typeof dd.oninput=="function"}ao=lo}else ao=!1;ud=ao&&(!document.documentMode||9<document.documentMode)}function fd(){fs&&(fs.detachEvent("onpropertychange",md),ms=fs=null)}function md(e){if(e.propertyName==="value"&&wr(ms)){var t=[];od(t,ms,e,Ki(e)),Wu(Qx,t)}}function Xx(e,t,a){e==="focusin"?(fd(),fs=t,ms=a,fs.attachEvent("onpropertychange",md)):e==="focusout"&&fd()}function Zx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wr(ms)}function Kx(e,t){if(e==="click")return wr(t)}function Jx(e,t){if(e==="input"||e==="change")return wr(t)}function $x(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ea=typeof Object.is=="function"?Object.is:$x;function hs(e,t){if(ea(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var r=a[n];if(!Vt.call(t,r)||!ea(e[r],t[r]))return!1}return!0}function hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pd(e,t){var a=hd(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hd(a)}}function xd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=vr(e.document)}return t}function no(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 Wx=qa&&"documentMode"in document&&11>=document.documentMode,Sn=null,so=null,ps=null,ro=!1;function gd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ro||Sn==null||Sn!==vr(n)||(n=Sn,"selectionStart"in n&&no(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ps&&hs(ps,n)||(ps=n,n=fi(so,"onSelect"),0<n.length&&(t=new Nr("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Sn)))}function Ql(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var wn={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionrun:Ql("Transition","TransitionRun"),transitionstart:Ql("Transition","TransitionStart"),transitioncancel:Ql("Transition","TransitionCancel"),transitionend:Ql("Transition","TransitionEnd")},io={},bd={};qa&&(bd=document.createElement("div").style,"AnimationEvent"in window||(delete wn.animationend.animation,delete wn.animationiteration.animation,delete wn.animationstart.animation),"TransitionEvent"in window||delete wn.transitionend.transition);function Xl(e){if(io[e])return io[e];if(!wn[e])return e;var t=wn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in bd)return io[e]=t[a];return e}var yd=Xl("animationend"),jd=Xl("animationiteration"),Nd=Xl("animationstart"),Fx=Xl("transitionrun"),Ix=Xl("transitionstart"),Px=Xl("transitioncancel"),Sd=Xl("transitionend"),wd=new Map,oo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");oo.push("scrollEnd");function wa(e,t){wd.set(e,t),Vl(t,[e])}var Cr=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!==null&&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)},ma=[],Cn=0,co=0;function zr(){for(var e=Cn,t=co=Cn=0;t<e;){var a=ma[t];ma[t++]=null;var n=ma[t];ma[t++]=null;var r=ma[t];ma[t++]=null;var i=ma[t];if(ma[t++]=null,n!==null&&r!==null){var f=n.pending;f===null?r.next=r:(r.next=f.next,f.next=r),n.pending=r}i!==0&&Cd(a,r,i)}}function Er(e,t,a,n){ma[Cn++]=e,ma[Cn++]=t,ma[Cn++]=a,ma[Cn++]=n,co|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function uo(e,t,a,n){return Er(e,t,a,n),Ar(e)}function Zl(e,t){return Er(e,null,null,t),Ar(e)}function Cd(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var r=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-Ct(a),e=i.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=a|536870912),i):null}function Ar(e){if(50<Us)throw Us=0,yc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zn={};function ev(e,t,a,n){this.tag=e,this.key=a,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ta(e,t,a,n){return new ev(e,t,a,n)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ga(e,t){var a=e.alternate;return a===null?(a=ta(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function zd(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function kr(e,t,a,n,r,i){var f=0;if(n=e,typeof e=="function")fo(e)&&(f=1);else if(typeof e=="string")f=sg(e,a,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case pe:return e=ta(31,a,t,r),e.elementType=pe,e.lanes=i,e;case J:return Kl(a.children,r,i,t);case P:f=8,r|=24;break;case ee:return e=ta(12,a,t,r|2),e.elementType=ee,e.lanes=i,e;case de:return e=ta(13,a,t,r),e.elementType=de,e.lanes=i,e;case he:return e=ta(19,a,t,r),e.elementType=he,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ve:f=10;break e;case ue:f=9;break e;case Y:f=11;break e;case te:f=14;break e;case H:f=16,n=null;break e}f=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=ta(f,a,t,r),t.elementType=e,t.type=n,t.lanes=i,t}function Kl(e,t,a,n){return e=ta(7,e,n,t),e.lanes=a,e}function mo(e,t,a){return e=ta(6,e,null,t),e.lanes=a,e}function Ed(e){var t=ta(18,null,null,0);return t.stateNode=e,t}function ho(e,t,a){return t=ta(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ad=new WeakMap;function ha(e,t){if(typeof e=="object"&&e!==null){var a=Ad.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ht(t)},Ad.set(e,t),t)}return{value:e,source:t,stack:ht(t)}}var En=[],An=0,Tr=null,xs=0,pa=[],xa=0,fl=null,Ta=1,Ma="";function Va(e,t){En[An++]=xs,En[An++]=Tr,Tr=e,xs=t}function kd(e,t,a){pa[xa++]=Ta,pa[xa++]=Ma,pa[xa++]=fl,fl=e;var n=Ta;e=Ma;var r=32-Ct(n)-1;n&=~(1<<r),a+=1;var i=32-Ct(t)+r;if(30<i){var f=r-r%5;i=(n&(1<<f)-1).toString(32),n>>=f,r-=f,Ta=1<<32-Ct(t)+r|a<<r|n,Ma=i+e}else Ta=1<<i|a<<r|n,Ma=e}function po(e){e.return!==null&&(Va(e,1),kd(e,1,0))}function xo(e){for(;e===Tr;)Tr=En[--An],En[An]=null,xs=En[--An],En[An]=null;for(;e===fl;)fl=pa[--xa],pa[xa]=null,Ma=pa[--xa],pa[xa]=null,Ta=pa[--xa],pa[xa]=null}function Td(e,t){pa[xa++]=Ta,pa[xa++]=Ma,pa[xa++]=fl,Ta=t.id,Ma=t.overflow,fl=e}var _t=null,dt=null,Ke=!1,ml=null,va=!1,vo=Error(c(519));function hl(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vs(ha(t,e)),vo}function Md(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[zt]=e,t[Ht]=n,a){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(a=0;a<Bs.length;a++)Qe(Bs[a],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),Qu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),Zu(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||$m(t.textContent,a)?(n.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),n.onScroll!=null&&Qe("scroll",t),n.onScrollEnd!=null&&Qe("scrollend",t),n.onClick!=null&&(t.onclick=Ba),t=!0):t=!1,t||hl(e,!0)}function Dd(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:_t=_t.return}}function kn(e){if(e!==_t)return!1;if(!Ke)return Dd(e),Ke=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Rc(e.type,e.memoizedProps)),a=!a),a&&dt&&hl(e),Dd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));dt=nh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));dt=nh(e)}else t===27?(t=dt,Al(e.type)?(e=qc,qc=null,dt=e):dt=t):dt=_t?ba(e.stateNode.nextSibling):null;return!0}function Jl(){dt=_t=null,Ke=!1}function go(){var e=ml;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),ml=null),e}function vs(e){ml===null?ml=[e]:ml.push(e)}var bo=b(null),$l=null,Ya=null;function pl(e,t,a){$(bo,t._currentValue),t._currentValue=a}function Qa(e){e._currentValue=bo.current,A(bo)}function yo(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function jo(e,t,a,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var f=r.child;i=i.firstContext;e:for(;i!==null;){var h=i;i=r;for(var S=0;S<t.length;S++)if(h.context===t[S]){i.lanes|=a,h=i.alternate,h!==null&&(h.lanes|=a),yo(i.return,a,e),n||(f=null);break e}i=h.next}}else if(r.tag===18){if(f=r.return,f===null)throw Error(c(341));f.lanes|=a,i=f.alternate,i!==null&&(i.lanes|=a),yo(f,a,e),f=null}else f=r.child;if(f!==null)f.return=r;else for(f=r;f!==null;){if(f===e){f=null;break}if(r=f.sibling,r!==null){r.return=f.return,f=r;break}f=f.return}r=f}}function Tn(e,t,a,n){e=null;for(var r=t,i=!1;r!==null;){if(!i){if((r.flags&524288)!==0)i=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var f=r.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var h=r.type;ea(r.pendingProps.value,f.value)||(e!==null?e.push(h):e=[h])}}else if(r===T.current){if(f=r.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Qs):e=[Qs])}r=r.return}e!==null&&jo(t,e,a,n),t.flags|=262144}function Mr(e){for(e=e.firstContext;e!==null;){if(!ea(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){$l=e,Ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return Od($l,e)}function Dr(e,t){return $l===null&&Wl(e),Od(e,t)}function Od(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ya===null){if(e===null)throw Error(c(308));Ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ya=Ya.next=t;return a}var tv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},av=s.unstable_scheduleCallback,lv=s.unstable_NormalPriority,jt={$$typeof:ve,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function No(){return{controller:new tv,data:new Map,refCount:0}}function gs(e){e.refCount--,e.refCount===0&&av(lv,function(){e.controller.abort()})}var bs=null,So=0,Mn=0,Dn=null;function nv(e,t){if(bs===null){var a=bs=[];So=0,Mn=zc(),Dn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return So++,t.then(_d,_d),t}function _d(){if(--So===0&&bs!==null){Dn!==null&&(Dn.status="fulfilled");var e=bs;bs=null,Mn=0,Dn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sv(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),n}var Rd=z.S;z.S=function(e,t){bm=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nv(e,t),Rd!==null&&Rd(e,t)};var Fl=b(null);function wo(){var e=Fl.current;return e!==null?e:ct.pooledCache}function Or(e,t){t===null?$(Fl,Fl.current):$(Fl,t.pool)}function Ld(){var e=wo();return e===null?null:{parent:jt._currentValue,pool:e}}var On=Error(c(460)),Co=Error(c(474)),_r=Error(c(542)),Rr={then:function(){}};function Ud(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Hd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ba,Ba),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e;default:if(typeof t.status=="string")t.then(Ba,Ba);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e}throw Pl=t,On}}function Il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Pl=a,On):a}}var Pl=null;function Bd(){if(Pl===null)throw Error(c(459));var e=Pl;return Pl=null,e}function qd(e){if(e===On||e===_r)throw Error(c(483))}var _n=null,ys=0;function Lr(e){var t=ys;return ys+=1,_n===null&&(_n=[]),Hd(_n,e,t)}function js(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ur(e,t){throw t.$$typeof===E?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gd(e){function t(k,w){if(e){var O=k.deletions;O===null?(k.deletions=[w],k.flags|=16):O.push(w)}}function a(k,w){if(!e)return null;for(;w!==null;)t(k,w),w=w.sibling;return null}function n(k){for(var w=new Map;k!==null;)k.key!==null?w.set(k.key,k):w.set(k.index,k),k=k.sibling;return w}function r(k,w){return k=Ga(k,w),k.index=0,k.sibling=null,k}function i(k,w,O){return k.index=O,e?(O=k.alternate,O!==null?(O=O.index,O<w?(k.flags|=67108866,w):O):(k.flags|=67108866,w)):(k.flags|=1048576,w)}function f(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function h(k,w,O,K){return w===null||w.tag!==6?(w=mo(O,k.mode,K),w.return=k,w):(w=r(w,O),w.return=k,w)}function S(k,w,O,K){var Ae=O.type;return Ae===J?X(k,w,O.props.children,K,O.key):w!==null&&(w.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===H&&Il(Ae)===w.type)?(w=r(w,O.props),js(w,O),w.return=k,w):(w=kr(O.type,O.key,O.props,null,k.mode,K),js(w,O),w.return=k,w)}function _(k,w,O,K){return w===null||w.tag!==4||w.stateNode.containerInfo!==O.containerInfo||w.stateNode.implementation!==O.implementation?(w=ho(O,k.mode,K),w.return=k,w):(w=r(w,O.children||[]),w.return=k,w)}function X(k,w,O,K,Ae){return w===null||w.tag!==7?(w=Kl(O,k.mode,K,Ae),w.return=k,w):(w=r(w,O),w.return=k,w)}function W(k,w,O){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=mo(""+w,k.mode,O),w.return=k,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case M:return O=kr(w.type,w.key,w.props,null,k.mode,O),js(O,w),O.return=k,O;case B:return w=ho(w,k.mode,O),w.return=k,w;case H:return w=Il(w),W(k,w,O)}if(Se(w)||R(w))return w=Kl(w,k.mode,O,null),w.return=k,w;if(typeof w.then=="function")return W(k,Lr(w),O);if(w.$$typeof===ve)return W(k,Dr(k,w),O);Ur(k,w)}return null}function U(k,w,O,K){var Ae=w!==null?w.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return Ae!==null?null:h(k,w,""+O,K);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case M:return O.key===Ae?S(k,w,O,K):null;case B:return O.key===Ae?_(k,w,O,K):null;case H:return O=Il(O),U(k,w,O,K)}if(Se(O)||R(O))return Ae!==null?null:X(k,w,O,K,null);if(typeof O.then=="function")return U(k,w,Lr(O),K);if(O.$$typeof===ve)return U(k,w,Dr(k,O),K);Ur(k,O)}return null}function G(k,w,O,K,Ae){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return k=k.get(O)||null,h(w,k,""+K,Ae);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case M:return k=k.get(K.key===null?O:K.key)||null,S(w,k,K,Ae);case B:return k=k.get(K.key===null?O:K.key)||null,_(w,k,K,Ae);case H:return K=Il(K),G(k,w,O,K,Ae)}if(Se(K)||R(K))return k=k.get(O)||null,X(w,k,K,Ae,null);if(typeof K.then=="function")return G(k,w,O,Lr(K),Ae);if(K.$$typeof===ve)return G(k,w,O,Dr(w,K),Ae);Ur(w,K)}return null}function Ce(k,w,O,K){for(var Ae=null,$e=null,ze=w,He=w=0,Ze=null;ze!==null&&He<O.length;He++){ze.index>He?(Ze=ze,ze=null):Ze=ze.sibling;var We=U(k,ze,O[He],K);if(We===null){ze===null&&(ze=Ze);break}e&&ze&&We.alternate===null&&t(k,ze),w=i(We,w,He),$e===null?Ae=We:$e.sibling=We,$e=We,ze=Ze}if(He===O.length)return a(k,ze),Ke&&Va(k,He),Ae;if(ze===null){for(;He<O.length;He++)ze=W(k,O[He],K),ze!==null&&(w=i(ze,w,He),$e===null?Ae=ze:$e.sibling=ze,$e=ze);return Ke&&Va(k,He),Ae}for(ze=n(ze);He<O.length;He++)Ze=G(ze,k,He,O[He],K),Ze!==null&&(e&&Ze.alternate!==null&&ze.delete(Ze.key===null?He:Ze.key),w=i(Ze,w,He),$e===null?Ae=Ze:$e.sibling=Ze,$e=Ze);return e&&ze.forEach(function(Ol){return t(k,Ol)}),Ke&&Va(k,He),Ae}function Me(k,w,O,K){if(O==null)throw Error(c(151));for(var Ae=null,$e=null,ze=w,He=w=0,Ze=null,We=O.next();ze!==null&&!We.done;He++,We=O.next()){ze.index>He?(Ze=ze,ze=null):Ze=ze.sibling;var Ol=U(k,ze,We.value,K);if(Ol===null){ze===null&&(ze=Ze);break}e&&ze&&Ol.alternate===null&&t(k,ze),w=i(Ol,w,He),$e===null?Ae=Ol:$e.sibling=Ol,$e=Ol,ze=Ze}if(We.done)return a(k,ze),Ke&&Va(k,He),Ae;if(ze===null){for(;!We.done;He++,We=O.next())We=W(k,We.value,K),We!==null&&(w=i(We,w,He),$e===null?Ae=We:$e.sibling=We,$e=We);return Ke&&Va(k,He),Ae}for(ze=n(ze);!We.done;He++,We=O.next())We=G(ze,k,He,We.value,K),We!==null&&(e&&We.alternate!==null&&ze.delete(We.key===null?He:We.key),w=i(We,w,He),$e===null?Ae=We:$e.sibling=We,$e=We);return e&&ze.forEach(function(xg){return t(k,xg)}),Ke&&Va(k,He),Ae}function rt(k,w,O,K){if(typeof O=="object"&&O!==null&&O.type===J&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case M:e:{for(var Ae=O.key;w!==null;){if(w.key===Ae){if(Ae=O.type,Ae===J){if(w.tag===7){a(k,w.sibling),K=r(w,O.props.children),K.return=k,k=K;break e}}else if(w.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===H&&Il(Ae)===w.type){a(k,w.sibling),K=r(w,O.props),js(K,O),K.return=k,k=K;break e}a(k,w);break}else t(k,w);w=w.sibling}O.type===J?(K=Kl(O.props.children,k.mode,K,O.key),K.return=k,k=K):(K=kr(O.type,O.key,O.props,null,k.mode,K),js(K,O),K.return=k,k=K)}return f(k);case B:e:{for(Ae=O.key;w!==null;){if(w.key===Ae)if(w.tag===4&&w.stateNode.containerInfo===O.containerInfo&&w.stateNode.implementation===O.implementation){a(k,w.sibling),K=r(w,O.children||[]),K.return=k,k=K;break e}else{a(k,w);break}else t(k,w);w=w.sibling}K=ho(O,k.mode,K),K.return=k,k=K}return f(k);case H:return O=Il(O),rt(k,w,O,K)}if(Se(O))return Ce(k,w,O,K);if(R(O)){if(Ae=R(O),typeof Ae!="function")throw Error(c(150));return O=Ae.call(O),Me(k,w,O,K)}if(typeof O.then=="function")return rt(k,w,Lr(O),K);if(O.$$typeof===ve)return rt(k,w,Dr(k,O),K);Ur(k,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,w!==null&&w.tag===6?(a(k,w.sibling),K=r(w,O),K.return=k,k=K):(a(k,w),K=mo(O,k.mode,K),K.return=k,k=K),f(k)):a(k,w)}return function(k,w,O,K){try{ys=0;var Ae=rt(k,w,O,K);return _n=null,Ae}catch(ze){if(ze===On||ze===_r)throw ze;var $e=ta(29,ze,null,k.mode);return $e.lanes=K,$e.return=k,$e}finally{}}}var en=Gd(!0),Vd=Gd(!1),xl=!1;function zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eo(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 vl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gl(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Ar(e),Cd(e,null,a),t}return Er(e,n,t,a),Ar(e)}function Ns(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,ur(e,a)}}function Ao(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?r=i=f:i=i.next=f,a=a.next}while(a!==null);i===null?r=i=t:i=i.next=t}else r=i=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ko=!1;function Ss(){if(ko){var e=Dn;if(e!==null)throw e}}function ws(e,t,a,n){ko=!1;var r=e.updateQueue;xl=!1;var i=r.firstBaseUpdate,f=r.lastBaseUpdate,h=r.shared.pending;if(h!==null){r.shared.pending=null;var S=h,_=S.next;S.next=null,f===null?i=_:f.next=_,f=S;var X=e.alternate;X!==null&&(X=X.updateQueue,h=X.lastBaseUpdate,h!==f&&(h===null?X.firstBaseUpdate=_:h.next=_,X.lastBaseUpdate=S))}if(i!==null){var W=r.baseState;f=0,X=_=S=null,h=i;do{var U=h.lane&-536870913,G=U!==h.lane;if(G?(Xe&U)===U:(n&U)===U){U!==0&&U===Mn&&(ko=!0),X!==null&&(X=X.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var Ce=e,Me=h;U=t;var rt=a;switch(Me.tag){case 1:if(Ce=Me.payload,typeof Ce=="function"){W=Ce.call(rt,W,U);break e}W=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Me.payload,U=typeof Ce=="function"?Ce.call(rt,W,U):Ce,U==null)break e;W=j({},W,U);break e;case 2:xl=!0}}U=h.callback,U!==null&&(e.flags|=64,G&&(e.flags|=8192),G=r.callbacks,G===null?r.callbacks=[U]:G.push(U))}else G={lane:U,tag:h.tag,payload:h.payload,callback:h.callback,next:null},X===null?(_=X=G,S=W):X=X.next=G,f|=U;if(h=h.next,h===null){if(h=r.shared.pending,h===null)break;G=h,h=G.next,G.next=null,r.lastBaseUpdate=G,r.shared.pending=null}}while(!0);X===null&&(S=W),r.baseState=S,r.firstBaseUpdate=_,r.lastBaseUpdate=X,i===null&&(r.shared.lanes=0),Sl|=f,e.lanes=f,e.memoizedState=W}}function Yd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Qd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Yd(a[e],t)}var Rn=b(null),Hr=b(0);function Xd(e,t){e=Pa,$(Hr,e),$(Rn,t),Pa=e|t.baseLanes}function To(){$(Hr,Pa),$(Rn,Rn.current)}function Mo(){Pa=Hr.current,A(Rn),A(Hr)}var aa=b(null),ga=null;function bl(e){var t=e.alternate;$(bt,bt.current&1),$(aa,e),ga===null&&(t===null||Rn.current!==null||t.memoizedState!==null)&&(ga=e)}function Do(e){$(bt,bt.current),$(aa,e),ga===null&&(ga=e)}function Zd(e){e.tag===22?($(bt,bt.current),$(aa,e),ga===null&&(ga=e)):yl()}function yl(){$(bt,bt.current),$(aa,aa.current)}function la(e){A(aa),ga===e&&(ga=null),A(bt)}var bt=b(0);function Br(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Hc(a)||Bc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Xa=0,Ue=null,nt=null,Nt=null,qr=!1,Ln=!1,tn=!1,Gr=0,Cs=0,Un=null,rv=0;function vt(){throw Error(c(321))}function Oo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ea(e[a],t[a]))return!1;return!0}function _o(e,t,a,n,r,i){return Xa=i,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Tf:$o,tn=!1,i=a(n,r),tn=!1,Ln&&(i=Jd(t,a,n,r)),Kd(e),i}function Kd(e){z.H=As;var t=nt!==null&&nt.next!==null;if(Xa=0,Nt=nt=Ue=null,qr=!1,Cs=0,Un=null,t)throw Error(c(300));e===null||St||(e=e.dependencies,e!==null&&Mr(e)&&(St=!0))}function Jd(e,t,a,n){Ue=e;var r=0;do{if(Ln&&(Un=null),Cs=0,Ln=!1,25<=r)throw Error(c(301));if(r+=1,Nt=nt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}z.H=Mf,i=t(a,n)}while(Ln);return i}function iv(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?zs(t):t,e=e.useState()[0],(nt!==null?nt.memoizedState:null)!==e&&(Ue.flags|=1024),t}function Ro(){var e=Gr!==0;return Gr=0,e}function Lo(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Uo(e){if(qr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qr=!1}Xa=0,Nt=nt=Ue=null,Ln=!1,Cs=Gr=0,Un=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Ue.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function yt(){if(nt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=Nt===null?Ue.memoizedState:Nt.next;if(t!==null)Nt=t,nt=e;else{if(e===null)throw Ue.alternate===null?Error(c(467)):Error(c(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Nt===null?Ue.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function Vr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zs(e){var t=Cs;return Cs+=1,Un===null&&(Un=[]),e=Hd(Un,e,t),t=Ue,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Tf:$o),e}function Yr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zs(e);if(e.$$typeof===ve)return Rt(e)}throw Error(c(438,String(e)))}function Ho(e){var t=null,a=Ue.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ue.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Vr(),Ue.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=Ee;return t.index++,a}function Za(e,t){return typeof t=="function"?t(e):t}function Qr(e){var t=yt();return Bo(t,nt,e)}function Bo(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var r=e.baseQueue,i=n.pending;if(i!==null){if(r!==null){var f=r.next;r.next=i.next,i.next=f}t.baseQueue=r=i,n.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var h=f=null,S=null,_=t,X=!1;do{var W=_.lane&-536870913;if(W!==_.lane?(Xe&W)===W:(Xa&W)===W){var U=_.revertLane;if(U===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),W===Mn&&(X=!0);else if((Xa&U)===U){_=_.next,U===Mn&&(X=!0);continue}else W={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(h=S=W,f=i):S=S.next=W,Ue.lanes|=U,Sl|=U;W=_.action,tn&&a(i,W),i=_.hasEagerState?_.eagerState:a(i,W)}else U={lane:W,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(h=S=U,f=i):S=S.next=U,Ue.lanes|=W,Sl|=W;_=_.next}while(_!==null&&_!==t);if(S===null?f=i:S.next=h,!ea(i,e.memoizedState)&&(St=!0,X&&(a=Dn,a!==null)))throw a;e.memoizedState=i,e.baseState=f,e.baseQueue=S,n.lastRenderedState=i}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function qo(e){var t=yt(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,r=a.pending,i=t.memoizedState;if(r!==null){a.pending=null;var f=r=r.next;do i=e(i,f.action),f=f.next;while(f!==r);ea(i,t.memoizedState)||(St=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function $d(e,t,a){var n=Ue,r=yt(),i=Ke;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var f=!ea((nt||r).memoizedState,a);if(f&&(r.memoizedState=a,St=!0),r=r.queue,Yo(Id.bind(null,n,r,e),[e]),r.getSnapshot!==t||f||Nt!==null&&Nt.memoizedState.tag&1){if(n.flags|=2048,Hn(9,{destroy:void 0},Fd.bind(null,n,r,a,t),null),ct===null)throw Error(c(349));i||(Xa&127)!==0||Wd(n,t,a)}return a}function Wd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ue.updateQueue,t===null?(t=Vr(),Ue.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Fd(e,t,a,n){t.value=a,t.getSnapshot=n,Pd(t)&&ef(e)}function Id(e,t,a){return a(function(){Pd(t)&&ef(e)})}function Pd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ea(e,a)}catch{return!0}}function ef(e){var t=Zl(e,2);t!==null&&Ft(t,e,2)}function Go(e){var t=Gt();if(typeof e=="function"){var a=e;if(e=a(),tn){Tt(!0);try{a()}finally{Tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:e},t}function tf(e,t,a,n){return e.baseState=a,Bo(e,nt,typeof n=="function"?n:Za)}function ov(e,t,a,n,r){if(Kr(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){i.listeners.push(f)}};z.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,af(t,i)):(i.next=a.next,t.pending=a.next=i)}}function af(e,t){var a=t.action,n=t.payload,r=e.state;if(t.isTransition){var i=z.T,f={};z.T=f;try{var h=a(r,n),S=z.S;S!==null&&S(f,h),lf(e,t,h)}catch(_){Vo(e,t,_)}finally{i!==null&&f.types!==null&&(i.types=f.types),z.T=i}}else try{i=a(r,n),lf(e,t,i)}catch(_){Vo(e,t,_)}}function lf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){nf(e,t,n)},function(n){return Vo(e,t,n)}):nf(e,t,a)}function nf(e,t,a){t.status="fulfilled",t.value=a,sf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,af(e,a)))}function Vo(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,sf(t),t=t.next;while(t!==n)}e.action=null}function sf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rf(e,t){return t}function of(e,t){if(Ke){var a=ct.formState;if(a!==null){e:{var n=Ue;if(Ke){if(dt){t:{for(var r=dt,i=va;r.nodeType!==8;){if(!i){r=null;break t}if(r=ba(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){dt=ba(r.nextSibling),n=r.data==="F!";break e}}hl(n)}n=!1}n&&(t=a[0])}}return a=Gt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rf,lastRenderedState:t},a.queue=n,a=Ef.bind(null,Ue,n),n.dispatch=a,n=Go(!1),i=Jo.bind(null,Ue,!1,n.queue),n=Gt(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,a=ov.bind(null,Ue,r,i,a),r.dispatch=a,n.memoizedState=e,[t,a,!1]}function cf(e){var t=yt();return uf(t,nt,e)}function uf(e,t,a){if(t=Bo(e,t,rf)[0],e=Qr(Za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=zs(t)}catch(f){throw f===On?_r:f}else n=t;t=yt();var r=t.queue,i=r.dispatch;return a!==t.memoizedState&&(Ue.flags|=2048,Hn(9,{destroy:void 0},cv.bind(null,r,a),null)),[n,i,e]}function cv(e,t){e.action=t}function df(e){var t=yt(),a=nt;if(a!==null)return uf(t,a,e);yt(),t=t.memoizedState,a=yt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Hn(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=Vr(),Ue.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function ff(){return yt().memoizedState}function Xr(e,t,a,n){var r=Gt();Ue.flags|=e,r.memoizedState=Hn(1|t,{destroy:void 0},a,n===void 0?null:n)}function Zr(e,t,a,n){var r=yt();n=n===void 0?null:n;var i=r.memoizedState.inst;nt!==null&&n!==null&&Oo(n,nt.memoizedState.deps)?r.memoizedState=Hn(t,i,a,n):(Ue.flags|=e,r.memoizedState=Hn(1|t,i,a,n))}function mf(e,t){Xr(8390656,8,e,t)}function Yo(e,t){Zr(2048,8,e,t)}function uv(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=Vr(),Ue.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function hf(e){var t=yt().memoizedState;return uv({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function pf(e,t){return Zr(4,2,e,t)}function xf(e,t){return Zr(4,4,e,t)}function vf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gf(e,t,a){a=a!=null?a.concat([e]):null,Zr(4,4,vf.bind(null,t,e),a)}function Qo(){}function bf(e,t){var a=yt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Oo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function yf(e,t){var a=yt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Oo(t,n[1]))return n[0];if(n=e(),tn){Tt(!0);try{e()}finally{Tt(!1)}}return a.memoizedState=[n,t],n}function Xo(e,t,a){return a===void 0||(Xa&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=jm(),Ue.lanes|=e,Sl|=e,a)}function jf(e,t,a,n){return ea(a,t)?a:Rn.current!==null?(e=Xo(e,a,n),ea(e,t)||(St=!0),e):(Xa&42)===0||(Xa&1073741824)!==0&&(Xe&261930)===0?(St=!0,e.memoizedState=a):(e=jm(),Ue.lanes|=e,Sl|=e,t)}function Nf(e,t,a,n,r){var i=L.p;L.p=i!==0&&8>i?i:8;var f=z.T,h={};z.T=h,Jo(e,!1,t,a);try{var S=r(),_=z.S;if(_!==null&&_(h,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var X=sv(S,n);Es(e,t,X,ra(e))}else Es(e,t,n,ra(e))}catch(W){Es(e,t,{then:function(){},status:"rejected",reason:W},ra())}finally{L.p=i,f!==null&&h.types!==null&&(f.types=h.types),z.T=f}}function dv(){}function Zo(e,t,a,n){if(e.tag!==5)throw Error(c(476));var r=Sf(e).queue;Nf(e,r,t,le,a===null?dv:function(){return wf(e),a(n)})}function Sf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:le},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Za,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wf(e){var t=Sf(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},ra())}function Ko(){return Rt(Qs)}function Cf(){return yt().memoizedState}function zf(){return yt().memoizedState}function fv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ra();e=vl(a);var n=gl(t,e,a);n!==null&&(Ft(n,t,a),Ns(n,t,a)),t={cache:No()},e.payload=t;return}t=t.return}}function mv(e,t,a){var n=ra();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kr(e)?Af(t,a):(a=uo(e,t,a,n),a!==null&&(Ft(a,e,n),kf(a,t,n)))}function Ef(e,t,a){var n=ra();Es(e,t,a,n)}function Es(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kr(e))Af(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var f=t.lastRenderedState,h=i(f,a);if(r.hasEagerState=!0,r.eagerState=h,ea(h,f))return Er(e,t,r,0),ct===null&&zr(),!1}catch{}finally{}if(a=uo(e,t,r,n),a!==null)return Ft(a,e,n),kf(a,t,n),!0}return!1}function Jo(e,t,a,n){if(n={lane:2,revertLane:zc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Kr(e)){if(t)throw Error(c(479))}else t=uo(e,a,n,2),t!==null&&Ft(t,e,2)}function Kr(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Af(e,t){Ln=qr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,ur(e,a)}}var As={readContext:Rt,use:Yr,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};As.useEffectEvent=vt;var Tf={readContext:Rt,use:Yr,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:mf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Xr(4194308,4,vf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Xr(4194308,4,e,t)},useInsertionEffect:function(e,t){Xr(4,2,e,t)},useMemo:function(e,t){var a=Gt();t=t===void 0?null:t;var n=e();if(tn){Tt(!0);try{e()}finally{Tt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Gt();if(a!==void 0){var r=a(t);if(tn){Tt(!0);try{a(t)}finally{Tt(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=mv.bind(null,Ue,e),[n.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,a=Ef.bind(null,Ue,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Qo,useDeferredValue:function(e,t){var a=Gt();return Xo(a,e,t)},useTransition:function(){var e=Go(!1);return e=Nf.bind(null,Ue,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ue,r=Gt();if(Ke){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),ct===null)throw Error(c(349));(Xe&127)!==0||Wd(n,t,a)}r.memoizedState=a;var i={value:a,getSnapshot:t};return r.queue=i,mf(Id.bind(null,n,i,e),[e]),n.flags|=2048,Hn(9,{destroy:void 0},Fd.bind(null,n,i,a,t),null),a},useId:function(){var e=Gt(),t=ct.identifierPrefix;if(Ke){var a=Ma,n=Ta;a=(n&~(1<<32-Ct(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Gr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=rv++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ko,useFormState:of,useActionState:of,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Jo.bind(null,Ue,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ho,useCacheRefresh:function(){return Gt().memoizedState=fv.bind(null,Ue)},useEffectEvent:function(e){var t=Gt(),a={impl:e};return t.memoizedState=a,function(){if((Fe&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},$o={readContext:Rt,use:Yr,useCallback:bf,useContext:Rt,useEffect:Yo,useImperativeHandle:gf,useInsertionEffect:pf,useLayoutEffect:xf,useMemo:yf,useReducer:Qr,useRef:ff,useState:function(){return Qr(Za)},useDebugValue:Qo,useDeferredValue:function(e,t){var a=yt();return jf(a,nt.memoizedState,e,t)},useTransition:function(){var e=Qr(Za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:$d,useId:Cf,useHostTransitionStatus:Ko,useFormState:cf,useActionState:cf,useOptimistic:function(e,t){var a=yt();return tf(a,nt,e,t)},useMemoCache:Ho,useCacheRefresh:zf};$o.useEffectEvent=hf;var Mf={readContext:Rt,use:Yr,useCallback:bf,useContext:Rt,useEffect:Yo,useImperativeHandle:gf,useInsertionEffect:pf,useLayoutEffect:xf,useMemo:yf,useReducer:qo,useRef:ff,useState:function(){return qo(Za)},useDebugValue:Qo,useDeferredValue:function(e,t){var a=yt();return nt===null?Xo(a,e,t):jf(a,nt.memoizedState,e,t)},useTransition:function(){var e=qo(Za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:zs(e),t]},useSyncExternalStore:$d,useId:Cf,useHostTransitionStatus:Ko,useFormState:df,useActionState:df,useOptimistic:function(e,t){var a=yt();return nt!==null?tf(a,nt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ho,useCacheRefresh:zf};Mf.useEffectEvent=hf;function Wo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Fo={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=ra(),r=vl(n);r.payload=t,a!=null&&(r.callback=a),t=gl(e,r,n),t!==null&&(Ft(t,e,n),Ns(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=ra(),r=vl(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=gl(e,r,n),t!==null&&(Ft(t,e,n),Ns(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ra(),n=vl(a);n.tag=2,t!=null&&(n.callback=t),t=gl(e,n,a),t!==null&&(Ft(t,e,a),Ns(t,e,a))}};function Df(e,t,a,n,r,i,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,f):t.prototype&&t.prototype.isPureReactComponent?!hs(a,n)||!hs(r,i):!0}function Of(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Fo.enqueueReplaceState(t,t.state,null)}function an(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}function _f(e){Cr(e)}function Rf(e){console.error(e)}function Lf(e){Cr(e)}function Jr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Uf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Io(e,t,a){return a=vl(a),a.tag=3,a.payload={element:null},a.callback=function(){Jr(e,t)},a}function Hf(e){return e=vl(e),e.tag=3,e}function Bf(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var i=n.value;e.payload=function(){return r(i)},e.callback=function(){Uf(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Uf(t,a,n),typeof r!="function"&&(wl===null?wl=new Set([this]):wl.add(this));var h=n.stack;this.componentDidCatch(n.value,{componentStack:h!==null?h:""})})}function hv(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Tn(t,a,r,!0),a=aa.current,a!==null){switch(a.tag){case 31:case 13:return ga===null?ri():a.alternate===null&>===0&&(gt=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===Rr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Sc(e,n,r)),!1;case 22:return a.flags|=65536,n===Rr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Sc(e,n,r)),!1}throw Error(c(435,a.tag))}return Sc(e,n,r),ri(),!1}if(Ke)return t=aa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==vo&&(e=Error(c(422),{cause:n}),vs(ha(e,a)))):(n!==vo&&(t=Error(c(423),{cause:n}),vs(ha(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=ha(n,a),r=Io(e.stateNode,n,r),Ao(e,r),gt!==4&&(gt=2)),!1;var i=Error(c(520),{cause:n});if(i=ha(i,a),Ls===null?Ls=[i]:Ls.push(i),gt!==4&&(gt=2),t===null)return!0;n=ha(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Io(a.stateNode,n,e),Ao(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(wl===null||!wl.has(i))))return a.flags|=65536,r&=-r,a.lanes|=r,r=Hf(r),Bf(r,e,a,n),Ao(a,r),!1}a=a.return}while(a!==null);return!1}var Po=Error(c(461)),St=!1;function Lt(e,t,a,n){t.child=e===null?Vd(t,null,a,n):en(t,e.child,a,n)}function qf(e,t,a,n,r){a=a.render;var i=t.ref;if("ref"in n){var f={};for(var h in n)h!=="ref"&&(f[h]=n[h])}else f=n;return Wl(t),n=_o(e,t,a,f,i,r),h=Ro(),e!==null&&!St?(Lo(e,t,r),Ka(e,t,r)):(Ke&&h&&po(t),t.flags|=1,Lt(e,t,n,r),t.child)}function Gf(e,t,a,n,r){if(e===null){var i=a.type;return typeof i=="function"&&!fo(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Vf(e,t,i,n,r)):(e=kr(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!ic(e,r)){var f=i.memoizedProps;if(a=a.compare,a=a!==null?a:hs,a(f,n)&&e.ref===t.ref)return Ka(e,t,r)}return t.flags|=1,e=Ga(i,n),e.ref=t.ref,e.return=t,t.child=e}function Vf(e,t,a,n,r){if(e!==null){var i=e.memoizedProps;if(hs(i,n)&&e.ref===t.ref)if(St=!1,t.pendingProps=n=i,ic(e,r))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,Ka(e,t,r)}return ec(e,t,a,n,r)}function Yf(e,t,a,n){var r=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~i}else n=0,t.child=null;return Qf(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Or(t,i!==null?i.cachePool:null),i!==null?Xd(t,i):To(),Zd(t);else return n=t.lanes=536870912,Qf(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Or(t,i.cachePool),Xd(t,i),yl(),t.memoizedState=null):(e!==null&&Or(t,null),To(),yl());return Lt(e,t,r,a),t.child}function ks(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qf(e,t,a,n,r){var i=wo();return i=i===null?null:{parent:jt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Or(t,null),To(),Zd(t),e!==null&&Tn(e,t,n,!0),t.childLanes=r,null}function $r(e,t){return t=Fr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,a){return en(t,e.child,null,a),e=$r(t,t.pendingProps),e.flags|=2,la(t),t.memoizedState=null,e}function pv(e,t,a){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ke){if(n.mode==="hidden")return e=$r(t,n),t.lanes=536870912,ks(null,e);if(Do(t),(e=dt)?(e=lh(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fl!==null?{id:Ta,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=Ed(e),a.return=t,t.child=a,_t=t,dt=null)):e=null,e===null)throw hl(t);return t.lanes=536870912,null}return $r(t,n)}var i=e.memoizedState;if(i!==null){var f=i.dehydrated;if(Do(t),r)if(t.flags&256)t.flags&=-257,t=Xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(St||Tn(e,t,a,!1),r=(a&e.childLanes)!==0,St||r){if(n=ct,n!==null&&(f=dr(n,a),f!==0&&f!==i.retryLane))throw i.retryLane=f,Zl(e,f),Ft(n,e,f),Po;ri(),t=Xf(e,t,a)}else e=i.treeContext,dt=ba(f.nextSibling),_t=t,Ke=!0,ml=null,va=!1,e!==null&&Td(t,e),t=$r(t,n),t.flags|=4096;return t}return e=Ga(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ec(e,t,a,n,r){return Wl(t),a=_o(e,t,a,n,void 0,r),n=Ro(),e!==null&&!St?(Lo(e,t,r),Ka(e,t,r)):(Ke&&n&&po(t),t.flags|=1,Lt(e,t,a,r),t.child)}function Zf(e,t,a,n,r,i){return Wl(t),t.updateQueue=null,a=Jd(t,n,a,r),Kd(e),n=Ro(),e!==null&&!St?(Lo(e,t,i),Ka(e,t,i)):(Ke&&n&&po(t),t.flags|=1,Lt(e,t,a,i),t.child)}function Kf(e,t,a,n,r){if(Wl(t),t.stateNode===null){var i=zn,f=a.contextType;typeof f=="object"&&f!==null&&(i=Rt(f)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Fo,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},zo(t),f=a.contextType,i.context=typeof f=="object"&&f!==null?Rt(f):zn,i.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Wo(t,a,f,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(f=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),f!==i.state&&Fo.enqueueReplaceState(i,i.state,null),ws(t,n,i,r),Ss(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var h=t.memoizedProps,S=an(a,h);i.props=S;var _=i.context,X=a.contextType;f=zn,typeof X=="object"&&X!==null&&(f=Rt(X));var W=a.getDerivedStateFromProps;X=typeof W=="function"||typeof i.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,X||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(h||_!==f)&&Of(t,i,n,f),xl=!1;var U=t.memoizedState;i.state=U,ws(t,n,i,r),Ss(),_=t.memoizedState,h||U!==_||xl?(typeof W=="function"&&(Wo(t,a,W,n),_=t.memoizedState),(S=xl||Df(t,a,S,n,U,_,f))?(X||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=_),i.props=n,i.state=_,i.context=f,n=S):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Eo(e,t),f=t.memoizedProps,X=an(a,f),i.props=X,W=t.pendingProps,U=i.context,_=a.contextType,S=zn,typeof _=="object"&&_!==null&&(S=Rt(_)),h=a.getDerivedStateFromProps,(_=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f!==W||U!==S)&&Of(t,i,n,S),xl=!1,U=t.memoizedState,i.state=U,ws(t,n,i,r),Ss();var G=t.memoizedState;f!==W||U!==G||xl||e!==null&&e.dependencies!==null&&Mr(e.dependencies)?(typeof h=="function"&&(Wo(t,a,h,n),G=t.memoizedState),(X=xl||Df(t,a,X,n,U,G,S)||e!==null&&e.dependencies!==null&&Mr(e.dependencies))?(_||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,G,S),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,G,S)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=G),i.props=n,i.state=G,i.context=S,n=X):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Wr(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=en(t,e.child,null,r),t.child=en(t,null,a,r)):Lt(e,t,a,r),t.memoizedState=i.state,e=t.child):e=Ka(e,t,r),e}function Jf(e,t,a,n){return Jl(),t.flags|=256,Lt(e,t,a,n),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Ld()}}function lc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=sa),e}function $f(e,t,a){var n=t.pendingProps,r=!1,i=(t.flags&128)!==0,f;if((f=i)||(f=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),f&&(r=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ke){if(r?bl(t):yl(),(e=dt)?(e=lh(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fl!==null?{id:Ta,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=Ed(e),a.return=t,t.child=a,_t=t,dt=null)):e=null,e===null)throw hl(t);return Bc(e)?t.lanes=32:t.lanes=536870912,null}var h=n.children;return n=n.fallback,r?(yl(),r=t.mode,h=Fr({mode:"hidden",children:h},r),n=Kl(n,r,a,null),h.return=t,n.return=t,h.sibling=n,t.child=h,n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,ks(null,n)):(bl(t),nc(t,h))}var S=e.memoizedState;if(S!==null&&(h=S.dehydrated,h!==null)){if(i)t.flags&256?(bl(t),t.flags&=-257,t=sc(e,t,a)):t.memoizedState!==null?(yl(),t.child=e.child,t.flags|=128,t=null):(yl(),h=n.fallback,r=t.mode,n=Fr({mode:"visible",children:n.children},r),h=Kl(h,r,a,null),h.flags|=2,n.return=t,h.return=t,n.sibling=h,t.child=n,en(t,e.child,null,a),n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,t=ks(null,n));else if(bl(t),Bc(h)){if(f=h.nextSibling&&h.nextSibling.dataset,f)var _=f.dgst;f=_,n=Error(c(419)),n.stack="",n.digest=f,vs({value:n,source:null,stack:null}),t=sc(e,t,a)}else if(St||Tn(e,t,a,!1),f=(a&e.childLanes)!==0,St||f){if(f=ct,f!==null&&(n=dr(f,a),n!==0&&n!==S.retryLane))throw S.retryLane=n,Zl(e,n),Ft(f,e,n),Po;Hc(h)||ri(),t=sc(e,t,a)}else Hc(h)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,dt=ba(h.nextSibling),_t=t,Ke=!0,ml=null,va=!1,e!==null&&Td(t,e),t=nc(t,n.children),t.flags|=4096);return t}return r?(yl(),h=n.fallback,r=t.mode,S=e.child,_=S.sibling,n=Ga(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,_!==null?h=Ga(_,h):(h=Kl(h,r,a,null),h.flags|=2),h.return=t,n.return=t,n.sibling=h,t.child=n,ks(null,n),n=t.child,h=e.child.memoizedState,h===null?h=ac(a):(r=h.cachePool,r!==null?(S=jt._currentValue,r=r.parent!==S?{parent:S,pool:S}:r):r=Ld(),h={baseLanes:h.baseLanes|a,cachePool:r}),n.memoizedState=h,n.childLanes=lc(e,f,a),t.memoizedState=tc,ks(e.child,n)):(bl(t),a=e.child,e=a.sibling,a=Ga(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function nc(e,t){return t=Fr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Fr(e,t){return e=ta(22,e,null,t),e.lanes=0,e}function sc(e,t,a){return en(t,e.child,null,a),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),yo(e.return,t,a)}function rc(e,t,a,n,r,i){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r,treeForkCount:i}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=r,f.treeForkCount=i)}function Ff(e,t,a){var n=t.pendingProps,r=n.revealOrder,i=n.tail;n=n.children;var f=bt.current,h=(f&2)!==0;if(h?(f=f&1|2,t.flags|=128):f&=1,$(bt,f),Lt(e,t,n,a),n=Ke?xs:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wf(e,a,t);else if(e.tag===19)Wf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&Br(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),rc(t,!1,r,a,i,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Br(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}rc(t,!0,a,null,i,n);break;case"together":rc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ka(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Sl|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Tn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Ga(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ga(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Mr(e)))}function xv(e,t,a){switch(t.tag){case 3:Q(t,t.stateNode.containerInfo),pl(t,jt,e.memoizedState.cache),Jl();break;case 27:case 5:De(t);break;case 4:Q(t,t.stateNode.containerInfo);break;case 10:pl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(bl(t),t.flags|=128,null):(a&t.child.childLanes)!==0?$f(e,t,a):(bl(t),e=Ka(e,t,a),e!==null?e.sibling:null);bl(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Tn(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return Ff(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),$(bt,bt.current),n)break;return null;case 22:return t.lanes=0,Yf(e,t,a,t.pendingProps);case 24:pl(t,jt,e.memoizedState.cache)}return Ka(e,t,a)}function If(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!ic(e,a)&&(t.flags&128)===0)return St=!1,xv(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ke&&(t.flags&1048576)!==0&&kd(t,xs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Il(t.elementType),t.type=e,typeof e=="function")fo(e)?(n=an(e,n),t.tag=1,t=Kf(null,t,e,n,a)):(t.tag=0,t=ec(null,t,e,n,a));else{if(e!=null){var r=e.$$typeof;if(r===Y){t.tag=11,t=qf(null,t,e,n,a);break e}else if(r===te){t.tag=14,t=Gf(null,t,e,n,a);break e}}throw t=ce(e)||e,Error(c(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=an(n,t.pendingProps),Kf(e,t,n,r,a);case 3:e:{if(Q(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var i=t.memoizedState;r=i.element,Eo(e,t),ws(t,n,null,a);var f=t.memoizedState;if(n=f.cache,pl(t,jt,n),n!==i.cache&&jo(t,[jt],a,!0),Ss(),n=f.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Jf(e,t,n,a);break e}else if(n!==r){r=ha(Error(c(424)),t),vs(r),t=Jf(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(dt=ba(e.firstChild),_t=t,Ke=!0,ml=null,va=!0,a=Vd(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Jl(),n===r){t=Ka(e,t,a);break e}Lt(e,t,n,a)}t=t.child}return t;case 26:return Wr(e,t),e===null?(a=ch(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ke||(a=t.type,e=t.pendingProps,n=mi(V.current).createElement(a),n[zt]=t,n[Ht]=e,Ut(n,a,e),lt(n),t.stateNode=n):t.memoizedState=ch(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&Ke&&(n=t.stateNode=rh(t.type,t.pendingProps,V.current),_t=t,va=!0,r=dt,Al(t.type)?(qc=r,dt=ba(n.firstChild)):dt=r),Lt(e,t,t.pendingProps.children,a),Wr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ke&&((r=n=dt)&&(n=Zv(n,t.type,t.pendingProps,va),n!==null?(t.stateNode=n,_t=t,dt=ba(n.firstChild),va=!1,r=!0):r=!1),r||hl(t)),De(t),r=t.type,i=t.pendingProps,f=e!==null?e.memoizedProps:null,n=i.children,Rc(r,i)?n=null:f!==null&&Rc(r,f)&&(t.flags|=32),t.memoizedState!==null&&(r=_o(e,t,iv,null,null,a),Qs._currentValue=r),Wr(e,t),Lt(e,t,n,a),t.child;case 6:return e===null&&Ke&&((e=a=dt)&&(a=Kv(a,t.pendingProps,va),a!==null?(t.stateNode=a,_t=t,dt=null,e=!0):e=!1),e||hl(t)),null;case 13:return $f(e,t,a);case 4:return Q(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=en(t,null,n,a):Lt(e,t,n,a),t.child;case 11:return qf(e,t,t.type,t.pendingProps,a);case 7:return Lt(e,t,t.pendingProps,a),t.child;case 8:return Lt(e,t,t.pendingProps.children,a),t.child;case 12:return Lt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,pl(t,t.type,n.value),Lt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,Wl(t),r=Rt(r),n=n(r),t.flags|=1,Lt(e,t,n,a),t.child;case 14:return Gf(e,t,t.type,t.pendingProps,a);case 15:return Vf(e,t,t.type,t.pendingProps,a);case 19:return Ff(e,t,a);case 31:return pv(e,t,a);case 22:return Yf(e,t,a,t.pendingProps);case 24:return Wl(t),n=Rt(jt),e===null?(r=wo(),r===null&&(r=ct,i=No(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=a),r=i),t.memoizedState={parent:n,cache:r},zo(t),pl(t,jt,r)):((e.lanes&a)!==0&&(Eo(e,t),ws(t,null,null,a),Ss()),r=e.memoizedState,i=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pl(t,jt,n)):(n=i.cache,pl(t,jt,n),n!==r.cache&&jo(t,[jt],a,!0))),Lt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ja(e){e.flags|=4}function oc(e,t,a,n,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Cm())e.flags|=8192;else throw Pl=Rr,Co}else e.flags&=-16777217}function Pf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hh(t))if(Cm())e.flags|=8192;else throw Pl=Rr,Co}function Ir(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hn():536870912,e.lanes|=t,Vn|=t)}function Ts(e,t){if(!Ke)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function vv(e,t,a){var n=t.pendingProps;switch(xo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qa(jt),oe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(kn(t)?Ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,go())),ft(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(Ja(t),i!==null?(ft(t),Pf(t,i)):(ft(t),oc(t,r,null,n,a))):i?i!==e.memoizedState?(Ja(t),ft(t),Pf(t,i)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ja(t),ft(t),oc(t,r,e,n,a)),null;case 27:if(ne(t),a=V.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return ft(t),null}e=I.current,kn(t)?Md(t):(e=rh(r,n,a),t.stateNode=e,Ja(t))}return ft(t),null;case 5:if(ne(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return ft(t),null}if(i=I.current,kn(t))Md(t);else{var f=mi(V.current);switch(i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?f.createElement(r,{is:n.is}):f.createElement(r)}}i[zt]=t,i[Ht]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=i;e:switch(Ut(i,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ja(t)}}return ft(t),oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ja(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=V.current,kn(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=_t,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[zt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||$m(e.nodeValue,a)),e||hl(t,!0)}else e=mi(e).createTextNode(n),e[zt]=t,t.stateNode=e}return ft(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=kn(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[zt]=t}else Jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else a=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(la(t),t):(la(t),null);if((t.flags&128)!==0)throw Error(c(558))}return ft(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=kn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(c(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(c(317));r[zt]=t}else Jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),r=!1}else r=go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(la(t),t):(la(t),null)}return la(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ir(t,t.updateQueue),ft(t),null);case 4:return oe(),e===null&&Tc(t.stateNode.containerInfo),ft(t),null;case 10:return Qa(t.type),ft(t),null;case 19:if(A(bt),n=t.memoizedState,n===null)return ft(t),null;if(r=(t.flags&128)!==0,i=n.rendering,i===null)if(r)Ts(n,!1);else{if(gt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Br(e),i!==null){for(t.flags|=128,Ts(n,!1),e=i.updateQueue,t.updateQueue=e,Ir(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)zd(a,e),a=a.sibling;return $(bt,bt.current&1|2),Ke&&Va(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&tt()>li&&(t.flags|=128,r=!0,Ts(n,!1),t.lanes=4194304)}else{if(!r)if(e=Br(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ir(t,e),Ts(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!Ke)return ft(t),null}else 2*tt()-n.renderingStartTime>li&&a!==536870912&&(t.flags|=128,r=!0,Ts(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=tt(),e.sibling=null,a=bt.current,$(bt,r?a&1|2:a&1),Ke&&Va(t,n.treeForkCount),e):(ft(t),null);case 22:case 23:return la(t),Mo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),a=t.updateQueue,a!==null&&Ir(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&A(Fl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qa(jt),ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function gv(e,t){switch(xo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qa(jt),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ne(t),null;case 31:if(t.memoizedState!==null){if(la(t),t.alternate===null)throw Error(c(340));Jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(la(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return A(bt),null;case 4:return oe(),null;case 10:return Qa(t.type),null;case 22:case 23:return la(t),Mo(),e!==null&&A(Fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qa(jt),null;case 25:return null;default:return null}}function em(e,t){switch(xo(t),t.tag){case 3:Qa(jt),oe();break;case 26:case 27:case 5:ne(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&la(t);break;case 13:la(t);break;case 19:A(bt);break;case 10:Qa(t.type);break;case 22:case 23:la(t),Mo(),e!==null&&A(Fl);break;case 24:Qa(jt)}}function Ms(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var i=a.create,f=a.inst;n=i(),f.destroy=n}a=a.next}while(a!==r)}}catch(h){et(t,t.return,h)}}function jl(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){var f=n.inst,h=f.destroy;if(h!==void 0){f.destroy=void 0,r=t;var S=a,_=h;try{_()}catch(X){et(r,S,X)}}}n=n.next}while(n!==i)}}catch(X){et(t,t.return,X)}}function tm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Qd(t,a)}catch(n){et(e,e.return,n)}}}function am(e,t,a){a.props=an(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){et(e,t,n)}}function Ds(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){et(e,t,r)}}function Da(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){et(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){et(e,t,r)}else a.current=null}function lm(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){et(e,e.return,r)}}function cc(e,t,a){try{var n=e.stateNode;qv(n,e.type,a,t),n[Ht]=t}catch(r){et(e,e.return,r)}}function nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Al(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nm(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&&Al(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ba));else if(n!==4&&(n===27&&Al(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,a),e=e.sibling;e!==null;)dc(e,t,a),e=e.sibling}function Pr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Al(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Pr(e,t,a),e=e.sibling;e!==null;)Pr(e,t,a),e=e.sibling}function sm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ut(t,n,a),t[zt]=e,t[Ht]=a}catch(i){et(e,e.return,i)}}var $a=!1,wt=!1,fc=!1,rm=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function bv(e,t){if(e=e.containerInfo,Oc=yi,e=vd(e),no(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var f=0,h=-1,S=-1,_=0,X=0,W=e,U=null;t:for(;;){for(var G;W!==a||r!==0&&W.nodeType!==3||(h=f+r),W!==i||n!==0&&W.nodeType!==3||(S=f+n),W.nodeType===3&&(f+=W.nodeValue.length),(G=W.firstChild)!==null;)U=W,W=G;for(;;){if(W===e)break t;if(U===a&&++_===r&&(h=f),U===i&&++X===n&&(S=f),(G=W.nextSibling)!==null)break;W=U,U=W.parentNode}W=G}a=h===-1||S===-1?null:{start:h,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(_c={focusedElem:e,selectionRange:a},yi=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)r=e[a],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,r=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var Ce=an(a.type,r);e=n.getSnapshotBeforeUpdate(Ce,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(Me){et(a,a.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Uc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Uc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function im(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Fa(e,a),n&4&&Ms(5,a);break;case 1:if(Fa(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){et(a,a.return,f)}else{var r=an(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){et(a,a.return,f)}}n&64&&tm(a),n&512&&Ds(a,a.return);break;case 3:if(Fa(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Qd(e,t)}catch(f){et(a,a.return,f)}}break;case 27:t===null&&n&4&&sm(a);case 26:case 5:Fa(e,a),t===null&&n&4&&lm(a),n&512&&Ds(a,a.return);break;case 12:Fa(e,a);break;case 31:Fa(e,a),n&4&&um(e,a);break;case 13:Fa(e,a),n&4&&dm(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Av.bind(null,a),Jv(e,a))));break;case 22:if(n=a.memoizedState!==null||$a,!n){t=t!==null&&t.memoizedState!==null||wt,r=$a;var i=wt;$a=n,(wt=t)&&!i?Ia(e,a,(a.subtreeFlags&8772)!==0):Fa(e,a),$a=r,wt=i}break;case 30:break;default:Fa(e,a)}}function om(e){var t=e.alternate;t!==null&&(e.alternate=null,om(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_e(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 mt=null,Kt=!1;function Wa(e,t,a){for(a=a.child;a!==null;)cm(e,t,a),a=a.sibling}function cm(e,t,a){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(pt,a)}catch{}switch(a.tag){case 26:wt||Da(a,t),Wa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:wt||Da(a,t);var n=mt,r=Kt;Al(a.type)&&(mt=a.stateNode,Kt=!1),Wa(e,t,a),Gs(a.stateNode),mt=n,Kt=r;break;case 5:wt||Da(a,t);case 6:if(n=mt,r=Kt,mt=null,Wa(e,t,a),mt=n,Kt=r,mt!==null)if(Kt)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(a.stateNode)}catch(i){et(a,t,i)}else try{mt.removeChild(a.stateNode)}catch(i){et(a,t,i)}break;case 18:mt!==null&&(Kt?(e=mt,th(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Wn(e)):th(mt,a.stateNode));break;case 4:n=mt,r=Kt,mt=a.stateNode.containerInfo,Kt=!0,Wa(e,t,a),mt=n,Kt=r;break;case 0:case 11:case 14:case 15:jl(2,a,t),wt||jl(4,a,t),Wa(e,t,a);break;case 1:wt||(Da(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&am(a,t,n)),Wa(e,t,a);break;case 21:Wa(e,t,a);break;case 22:wt=(n=wt)||a.memoizedState!==null,Wa(e,t,a),wt=n;break;default:Wa(e,t,a)}}function um(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wn(e)}catch(a){et(t,t.return,a)}}}function dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wn(e)}catch(a){et(t,t.return,a)}}function yv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rm),t;default:throw Error(c(435,e.tag))}}function ei(e,t){var a=yv(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var r=kv.bind(null,e,n);n.then(r,r)}})}function Jt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var r=a[n],i=e,f=t,h=f;e:for(;h!==null;){switch(h.tag){case 27:if(Al(h.type)){mt=h.stateNode,Kt=!1;break e}break;case 5:mt=h.stateNode,Kt=!1;break e;case 3:case 4:mt=h.stateNode.containerInfo,Kt=!0;break e}h=h.return}if(mt===null)throw Error(c(160));cm(i,f,r),mt=null,Kt=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fm(t,e),t=t.sibling}var Ca=null;function fm(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),$t(e),n&4&&(jl(3,e,e.return),Ms(3,e),jl(5,e,e.return));break;case 1:Jt(t,e),$t(e),n&512&&(wt||a===null||Da(a,a.return)),n&64&&$a&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var r=Ca;if(Jt(t,e),$t(e),n&512&&(wt||a===null||Da(a,a.return)),n&4){var i=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(n){case"title":i=r.getElementsByTagName("title")[0],(!i||i[ye]||i[zt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(n),r.head.insertBefore(i,r.querySelector("head > title"))),Ut(i,n,a),i[zt]=e,lt(i),n=i;break e;case"link":var f=fh("link","href",r).get(n+(a.href||""));if(f){for(var h=0;h<f.length;h++)if(i=f[h],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(h,1);break t}}i=r.createElement(n),Ut(i,n,a),r.head.appendChild(i);break;case"meta":if(f=fh("meta","content",r).get(n+(a.content||""))){for(h=0;h<f.length;h++)if(i=f[h],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(h,1);break t}}i=r.createElement(n),Ut(i,n,a),r.head.appendChild(i);break;default:throw Error(c(468,n))}i[zt]=e,lt(i),n=i}e.stateNode=n}else mh(r,e.type,e.stateNode);else e.stateNode=dh(r,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?mh(r,e.type,e.stateNode):dh(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&cc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Jt(t,e),$t(e),n&512&&(wt||a===null||Da(a,a.return)),a!==null&&n&4&&cc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Jt(t,e),$t(e),n&512&&(wt||a===null||Da(a,a.return)),e.flags&32){r=e.stateNode;try{bn(r,"")}catch(Ce){et(e,e.return,Ce)}}n&4&&e.stateNode!=null&&(r=e.memoizedProps,cc(e,r,a!==null?a.memoizedProps:r)),n&1024&&(fc=!0);break;case 6:if(Jt(t,e),$t(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Ce){et(e,e.return,Ce)}}break;case 3:if(xi=null,r=Ca,Ca=hi(t.containerInfo),Jt(t,e),Ca=r,$t(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Wn(t.containerInfo)}catch(Ce){et(e,e.return,Ce)}fc&&(fc=!1,mm(e));break;case 4:n=Ca,Ca=hi(e.stateNode.containerInfo),Jt(t,e),$t(e),Ca=n;break;case 12:Jt(t,e),$t(e);break;case 31:Jt(t,e),$t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ei(e,n)));break;case 13:Jt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ai=tt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ei(e,n)));break;case 22:r=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,_=$a,X=wt;if($a=_||r,wt=X||S,Jt(t,e),wt=X,$a=_,$t(e),n&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(a===null||S||$a||wt||ln(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(i=S.stateNode,r)f=i.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{h=S.stateNode;var W=S.memoizedProps.style,U=W!=null&&W.hasOwnProperty("display")?W.display:null;h.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(Ce){et(S,S.return,Ce)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=r?"":S.memoizedProps}catch(Ce){et(S,S.return,Ce)}}}else if(t.tag===18){if(a===null){S=t;try{var G=S.stateNode;r?ah(G,!0):ah(S.stateNode,!1)}catch(Ce){et(S,S.return,Ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,ei(e,a))));break;case 19:Jt(t,e),$t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,ei(e,n)));break;case 30:break;case 21:break;default:Jt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(nm(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var r=a.stateNode,i=uc(e);Pr(e,i,r);break;case 5:var f=a.stateNode;a.flags&32&&(bn(f,""),a.flags&=-33);var h=uc(e);Pr(e,h,f);break;case 3:case 4:var S=a.stateNode.containerInfo,_=uc(e);dc(e,_,S);break;default:throw Error(c(161))}}catch(X){et(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Fa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)im(e,t.alternate,t),t=t.sibling}function ln(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:jl(4,t,t.return),ln(t);break;case 1:Da(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&am(t,t.return,a),ln(t);break;case 27:Gs(t.stateNode);case 26:case 5:Da(t,t.return),ln(t);break;case 22:t.memoizedState===null&&ln(t);break;case 30:ln(t);break;default:ln(t)}e=e.sibling}}function Ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,r=e,i=t,f=i.flags;switch(i.tag){case 0:case 11:case 15:Ia(r,i,a),Ms(4,i);break;case 1:if(Ia(r,i,a),n=i,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(_){et(n,n.return,_)}if(n=i,r=n.updateQueue,r!==null){var h=n.stateNode;try{var S=r.shared.hiddenCallbacks;if(S!==null)for(r.shared.hiddenCallbacks=null,r=0;r<S.length;r++)Yd(S[r],h)}catch(_){et(n,n.return,_)}}a&&f&64&&tm(i),Ds(i,i.return);break;case 27:sm(i);case 26:case 5:Ia(r,i,a),a&&n===null&&f&4&&lm(i),Ds(i,i.return);break;case 12:Ia(r,i,a);break;case 31:Ia(r,i,a),a&&f&4&&um(r,i);break;case 13:Ia(r,i,a),a&&f&4&&dm(r,i);break;case 22:i.memoizedState===null&&Ia(r,i,a),Ds(i,i.return);break;case 30:break;default:Ia(r,i,a)}t=t.sibling}}function mc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&gs(a))}function hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e))}function za(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hm(e,t,a,n),t=t.sibling}function hm(e,t,a,n){var r=t.flags;switch(t.tag){case 0:case 11:case 15:za(e,t,a,n),r&2048&&Ms(9,t);break;case 1:za(e,t,a,n);break;case 3:za(e,t,a,n),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gs(e)));break;case 12:if(r&2048){za(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,f=i.id,h=i.onPostCommit;typeof h=="function"&&h(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){et(t,t.return,S)}}else za(e,t,a,n);break;case 31:za(e,t,a,n);break;case 13:za(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,f=t.alternate,t.memoizedState!==null?i._visibility&2?za(e,t,a,n):Os(e,t):i._visibility&2?za(e,t,a,n):(i._visibility|=2,Bn(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),r&2048&&mc(f,t);break;case 24:za(e,t,a,n),r&2048&&hc(t.alternate,t);break;default:za(e,t,a,n)}}function Bn(e,t,a,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,f=t,h=a,S=n,_=f.flags;switch(f.tag){case 0:case 11:case 15:Bn(i,f,h,S,r),Ms(8,f);break;case 23:break;case 22:var X=f.stateNode;f.memoizedState!==null?X._visibility&2?Bn(i,f,h,S,r):Os(i,f):(X._visibility|=2,Bn(i,f,h,S,r)),r&&_&2048&&mc(f.alternate,f);break;case 24:Bn(i,f,h,S,r),r&&_&2048&&hc(f.alternate,f);break;default:Bn(i,f,h,S,r)}t=t.sibling}}function Os(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,r=n.flags;switch(n.tag){case 22:Os(a,n),r&2048&&mc(n.alternate,n);break;case 24:Os(a,n),r&2048&&hc(n.alternate,n);break;default:Os(a,n)}t=t.sibling}}var _s=8192;function qn(e,t,a){if(e.subtreeFlags&_s)for(e=e.child;e!==null;)pm(e,t,a),e=e.sibling}function pm(e,t,a){switch(e.tag){case 26:qn(e,t,a),e.flags&_s&&e.memoizedState!==null&&rg(a,Ca,e.memoizedState,e.memoizedProps);break;case 5:qn(e,t,a);break;case 3:case 4:var n=Ca;Ca=hi(e.stateNode.containerInfo),qn(e,t,a),Ca=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=_s,_s=16777216,qn(e,t,a),_s=n):qn(e,t,a));break;default:qn(e,t,a)}}function xm(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 Rs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Mt=n,gm(n,e)}xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vm(e),e=e.sibling}function vm(e){switch(e.tag){case 0:case 11:case 15:Rs(e),e.flags&2048&&jl(9,e,e.return);break;case 3:Rs(e);break;case 12:Rs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ti(e)):Rs(e);break;default:Rs(e)}}function ti(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Mt=n,gm(n,e)}xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),ti(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ti(t));break;default:ti(t)}e=e.sibling}}function gm(e,t){for(;Mt!==null;){var a=Mt;switch(a.tag){case 0:case 11:case 15:jl(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:gs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Mt=n;else e:for(a=e;Mt!==null;){n=Mt;var r=n.sibling,i=n.return;if(om(n),n===a){Mt=null;break e}if(r!==null){r.return=i,Mt=r;break e}Mt=i}}}var jv={getCacheForType:function(e){var t=Rt(jt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Rt(jt).controller.signal}},Nv=typeof WeakMap=="function"?WeakMap:Map,Fe=0,ct=null,Ye=null,Xe=0,Pe=0,na=null,Nl=!1,Gn=!1,pc=!1,Pa=0,gt=0,Sl=0,nn=0,xc=0,sa=0,Vn=0,Ls=null,Wt=null,vc=!1,ai=0,bm=0,li=1/0,ni=null,wl=null,Et=0,Cl=null,Yn=null,el=0,gc=0,bc=null,ym=null,Us=0,yc=null;function ra(){return(Fe&2)!==0&&Xe!==0?Xe&-Xe:z.T!==null?zc():fr()}function jm(){if(sa===0)if((Xe&536870912)===0||Ke){var e=Na;Na<<=1,(Na&3932160)===0&&(Na=262144),sa=e}else sa=536870912;return e=aa.current,e!==null&&(e.flags|=32),sa}function Ft(e,t,a){(e===ct&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(Qn(e,0),zl(e,Xe,sa,!1)),ql(e,a),((Fe&2)===0||e!==ct)&&(e===ct&&((Fe&2)===0&&(nn|=a),gt===4&&zl(e,Xe,sa,!1)),Oa(e))}function Nm(e,t,a){if((Fe&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Bl(e,t),r=n?Cv(e,t):Nc(e,t,!0),i=n;do{if(r===0){Gn&&!n&&zl(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Sv(a)){r=Nc(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var h=e;r=Ls;var S=h.current.memoizedState.isDehydrated;if(S&&(Qn(h,f).flags|=256),f=Nc(h,f,!1),f!==2){if(pc&&!S){h.errorRecoveryDisabledLanes|=i,nn|=i,r=4;break e}i=Wt,Wt=r,i!==null&&(Wt===null?Wt=i:Wt.push.apply(Wt,i))}r=f}if(i=!1,r!==2)continue}}if(r===1){Qn(e,0),zl(e,t,0,!0);break}e:{switch(n=e,i=r,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:zl(n,t,sa,!Nl);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(r=ai+300-tt(),10<r)){if(zl(n,t,sa,!Nl),mn(n,0,!0)!==0)break e;el=t,n.timeoutHandle=Pm(Sm.bind(null,n,a,Wt,ni,vc,t,sa,nn,Vn,Nl,i,"Throttled",-0,0),r);break e}Sm(n,a,Wt,ni,vc,t,sa,nn,Vn,Nl,i,null,-0,0)}}break}while(!0);Oa(e)}function Sm(e,t,a,n,r,i,f,h,S,_,X,W,U,G){if(e.timeoutHandle=-1,W=t.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ba},pm(t,i,W);var Ce=(i&62914560)===i?ai-tt():(i&4194048)===i?bm-tt():0;if(Ce=ig(W,Ce),Ce!==null){el=i,e.cancelPendingCommit=Ce(Mm.bind(null,e,t,i,a,n,r,f,h,S,X,W,null,U,G)),zl(e,i,f,!_);return}}Mm(e,t,i,a,n,r,f,h,S)}function Sv(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var r=a[n],i=r.getSnapshot;r=r.value;try{if(!ea(i(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 zl(e,t,a,n){t&=~xc,t&=~nn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var i=31-Ct(r),f=1<<i;n[i]=-1,r&=~f}a!==0&&ss(e,a,t)}function si(){return(Fe&6)===0?(Hs(0),!1):!0}function jc(){if(Ye!==null){if(Pe===0)var e=Ye.return;else e=Ye,Ya=$l=null,Uo(e),_n=null,ys=0,e=Ye;for(;e!==null;)em(e.alternate,e),e=e.return;Ye=null}}function Qn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Yv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),el=0,jc(),ct=e,Ye=a=Ga(e.current,null),Xe=t,Pe=0,na=null,Nl=!1,Gn=Bl(e,t),pc=!1,Vn=sa=xc=nn=Sl=gt=0,Wt=Ls=null,vc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ct(n),i=1<<r;t|=e[r],n&=~i}return Pa=t,zr(),a}function wm(e,t){Ue=null,z.H=As,t===On||t===_r?(t=Bd(),Pe=3):t===Co?(t=Bd(),Pe=4):Pe=t===Po?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,na=t,Ye===null&&(gt=1,Jr(e,ha(t,e.current)))}function Cm(){var e=aa.current;return e===null?!0:(Xe&4194048)===Xe?ga===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===ga:!1}function zm(){var e=z.H;return z.H=As,e===null?As:e}function Em(){var e=z.A;return z.A=jv,e}function ri(){gt=4,Nl||(Xe&4194048)!==Xe&&aa.current!==null||(Gn=!0),(Sl&134217727)===0&&(nn&134217727)===0||ct===null||zl(ct,Xe,sa,!1)}function Nc(e,t,a){var n=Fe;Fe|=2;var r=zm(),i=Em();(ct!==e||Xe!==t)&&(ni=null,Qn(e,t)),t=!1;var f=gt;e:do try{if(Pe!==0&&Ye!==null){var h=Ye,S=na;switch(Pe){case 8:jc(),f=6;break e;case 3:case 2:case 9:case 6:aa.current===null&&(t=!0);var _=Pe;if(Pe=0,na=null,Xn(e,h,S,_),a&&Gn){f=0;break e}break;default:_=Pe,Pe=0,na=null,Xn(e,h,S,_)}}wv(),f=gt;break}catch(X){wm(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ya=$l=null,Fe=n,z.H=r,z.A=i,Ye===null&&(ct=null,Xe=0,zr()),f}function wv(){for(;Ye!==null;)Am(Ye)}function Cv(e,t){var a=Fe;Fe|=2;var n=zm(),r=Em();ct!==e||Xe!==t?(ni=null,li=tt()+500,Qn(e,t)):Gn=Bl(e,t);e:do try{if(Pe!==0&&Ye!==null){t=Ye;var i=na;t:switch(Pe){case 1:Pe=0,na=null,Xn(e,t,i,1);break;case 2:case 9:if(Ud(i)){Pe=0,na=null,km(t);break}t=function(){Pe!==2&&Pe!==9||ct!==e||(Pe=7),Oa(e)},i.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Ud(i)?(Pe=0,na=null,km(t)):(Pe=0,na=null,Xn(e,t,i,7));break;case 5:var f=null;switch(Ye.tag){case 26:f=Ye.memoizedState;case 5:case 27:var h=Ye;if(f?hh(f):h.stateNode.complete){Pe=0,na=null;var S=h.sibling;if(S!==null)Ye=S;else{var _=h.return;_!==null?(Ye=_,ii(_)):Ye=null}break t}}Pe=0,na=null,Xn(e,t,i,5);break;case 6:Pe=0,na=null,Xn(e,t,i,6);break;case 8:jc(),gt=6;break e;default:throw Error(c(462))}}zv();break}catch(X){wm(e,X)}while(!0);return Ya=$l=null,z.H=n,z.A=r,Fe=a,Ye!==null?0:(ct=null,Xe=0,zr(),gt)}function zv(){for(;Ye!==null&&!Ie();)Am(Ye)}function Am(e){var t=If(e.alternate,e,Pa);e.memoizedProps=e.pendingProps,t===null?ii(e):Ye=t}function km(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zf(a,t,t.pendingProps,t.type,void 0,Xe);break;case 11:t=Zf(a,t,t.pendingProps,t.type.render,t.ref,Xe);break;case 5:Uo(t);default:em(a,t),t=Ye=zd(t,Pa),t=If(a,t,Pa)}e.memoizedProps=e.pendingProps,t===null?ii(e):Ye=t}function Xn(e,t,a,n){Ya=$l=null,Uo(t),_n=null,ys=0;var r=t.return;try{if(hv(e,r,t,a,Xe)){gt=1,Jr(e,ha(a,e.current)),Ye=null;return}}catch(i){if(r!==null)throw Ye=r,i;gt=1,Jr(e,ha(a,e.current)),Ye=null;return}t.flags&32768?(Ke||n===1?e=!0:Gn||(Xe&536870912)!==0?e=!1:(Nl=e=!0,(n===2||n===9||n===3||n===6)&&(n=aa.current,n!==null&&n.tag===13&&(n.flags|=16384))),Tm(t,e)):ii(t)}function ii(e){var t=e;do{if((t.flags&32768)!==0){Tm(t,Nl);return}e=t.return;var a=vv(t.alternate,t,Pa);if(a!==null){Ye=a;return}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);gt===0&&(gt=5)}function Tm(e,t){do{var a=gv(e.alternate,e);if(a!==null){a.flags&=32767,Ye=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ye=e;return}Ye=e=a}while(e!==null);gt=6,Ye=null}function Mm(e,t,a,n,r,i,f,h,S){e.cancelPendingCommit=null;do oi();while(Et!==0);if((Fe&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=co,Gi(e,a,i,f,h,S),e===ct&&(Ye=ct=null,Xe=0),Yn=t,Cl=e,el=a,gc=i,bc=r,ym=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Tv(Yt,function(){return Lm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null,r=L.p,L.p=2,f=Fe,Fe|=4;try{bv(e,t,a)}finally{Fe=f,L.p=r,z.T=n}}Et=1,Dm(),Om(),_m()}}function Dm(){if(Et===1){Et=0;var e=Cl,t=Yn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=z.T,z.T=null;var n=L.p;L.p=2;var r=Fe;Fe|=4;try{fm(t,e);var i=_c,f=vd(e.containerInfo),h=i.focusedElem,S=i.selectionRange;if(f!==h&&h&&h.ownerDocument&&xd(h.ownerDocument.documentElement,h)){if(S!==null&&no(h)){var _=S.start,X=S.end;if(X===void 0&&(X=_),"selectionStart"in h)h.selectionStart=_,h.selectionEnd=Math.min(X,h.value.length);else{var W=h.ownerDocument||document,U=W&&W.defaultView||window;if(U.getSelection){var G=U.getSelection(),Ce=h.textContent.length,Me=Math.min(S.start,Ce),rt=S.end===void 0?Me:Math.min(S.end,Ce);!G.extend&&Me>rt&&(f=rt,rt=Me,Me=f);var k=pd(h,Me),w=pd(h,rt);if(k&&w&&(G.rangeCount!==1||G.anchorNode!==k.node||G.anchorOffset!==k.offset||G.focusNode!==w.node||G.focusOffset!==w.offset)){var O=W.createRange();O.setStart(k.node,k.offset),G.removeAllRanges(),Me>rt?(G.addRange(O),G.extend(w.node,w.offset)):(O.setEnd(w.node,w.offset),G.addRange(O))}}}}for(W=[],G=h;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<W.length;h++){var K=W[h];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}yi=!!Oc,_c=Oc=null}finally{Fe=r,L.p=n,z.T=a}}e.current=t,Et=2}}function Om(){if(Et===2){Et=0;var e=Cl,t=Yn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=z.T,z.T=null;var n=L.p;L.p=2;var r=Fe;Fe|=4;try{im(e,t.alternate,t)}finally{Fe=r,L.p=n,z.T=a}}Et=3}}function _m(){if(Et===4||Et===3){Et=0,ca();var e=Cl,t=Yn,a=el,n=ym;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,Yn=Cl=null,Rm(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(wl=null),pn(a),t=t.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(pt,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=z.T,r=L.p,L.p=2,z.T=null;try{for(var i=e.onRecoverableError,f=0;f<n.length;f++){var h=n[f];i(h.value,{componentStack:h.stack})}}finally{z.T=t,L.p=r}}(el&3)!==0&&oi(),Oa(e),r=e.pendingLanes,(a&261930)!==0&&(r&42)!==0?e===yc?Us++:(Us=0,yc=e):Us=0,Hs(0)}}function Rm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,gs(t)))}function oi(){return Dm(),Om(),_m(),Lm()}function Lm(){if(Et!==5)return!1;var e=Cl,t=gc;gc=0;var a=pn(el),n=z.T,r=L.p;try{L.p=32>a?32:a,z.T=null,a=bc,bc=null;var i=Cl,f=el;if(Et=0,Yn=Cl=null,el=0,(Fe&6)!==0)throw Error(c(331));var h=Fe;if(Fe|=4,vm(i.current),hm(i,i.current,f,a),Fe=h,Hs(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(pt,i)}catch{}return!0}finally{L.p=r,z.T=n,Rm(e,t)}}function Um(e,t,a){t=ha(a,t),t=Io(e.stateNode,t,2),e=gl(e,t,2),e!==null&&(ql(e,2),Oa(e))}function et(e,t,a){if(e.tag===3)Um(e,e,a);else for(;t!==null;){if(t.tag===3){Um(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(wl===null||!wl.has(n))){e=ha(a,e),a=Hf(2),n=gl(t,a,2),n!==null&&(Bf(a,n,t,e),ql(n,2),Oa(n));break}}t=t.return}}function Sc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Nv;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(pc=!0,r.add(a),e=Ev.bind(null,e,t,a),t.then(e,e))}function Ev(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ct===e&&(Xe&a)===a&&(gt===4||gt===3&&(Xe&62914560)===Xe&&300>tt()-ai?(Fe&2)===0&&Qn(e,0):xc|=a,Vn===Xe&&(Vn=0)),Oa(e)}function Hm(e,t){t===0&&(t=hn()),e=Zl(e,t),e!==null&&(ql(e,t),Oa(e))}function Av(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Hm(e,a)}function kv(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),Hm(e,a)}function Tv(e,t){return Pt(e,t)}var ci=null,Zn=null,wc=!1,ui=!1,Cc=!1,El=0;function Oa(e){e!==Zn&&e.next===null&&(Zn===null?ci=Zn=e:Zn=Zn.next=e),ui=!0,wc||(wc=!0,Dv())}function Hs(e,t){if(!Cc&&ui){Cc=!0;do for(var a=!1,n=ci;n!==null;){if(e!==0){var r=n.pendingLanes;if(r===0)var i=0;else{var f=n.suspendedLanes,h=n.pingedLanes;i=(1<<31-Ct(42|e)+1)-1,i&=r&~(f&~h),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Vm(n,i))}else i=Xe,i=mn(n,n===ct?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Bl(n,i)||(a=!0,Vm(n,i));n=n.next}while(a);Cc=!1}}function Mv(){Bm()}function Bm(){ui=wc=!1;var e=0;El!==0&&Vv()&&(e=El);for(var t=tt(),a=null,n=ci;n!==null;){var r=n.next,i=qm(n,t);i===0?(n.next=null,a===null?ci=r:a.next=r,r===null&&(Zn=a)):(a=n,(e!==0||(i&3)!==0)&&(ui=!0)),n=r}Et!==0&&Et!==5||Hs(e),El!==0&&(El=0)}function qm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var f=31-Ct(i),h=1<<f,S=r[f];S===-1?((h&a)===0||(h&n)!==0)&&(r[f]=qi(h,t)):S<=t&&(e.expiredLanes|=h),i&=~h}if(t=ct,a=Xe,a=mn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&ol(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Bl(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&ol(n),pn(a)){case 2:case 8:a=Hl;break;case 32:a=Yt;break;case 268435456:a=Te;break;default:a=Yt}return n=Gm.bind(null,e),a=Pt(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&ol(n),e.callbackPriority=2,e.callbackNode=null,2}function Gm(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(oi()&&e.callbackNode!==a)return null;var n=Xe;return n=mn(e,e===ct?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Nm(e,n,t),qm(e,tt()),e.callbackNode!=null&&e.callbackNode===a?Gm.bind(null,e):null)}function Vm(e,t){if(oi())return null;Nm(e,t,!0)}function Dv(){Qv(function(){(Fe&6)!==0?Pt(cl,Mv):Bm()})}function zc(){if(El===0){var e=Mn;e===0&&(e=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),El=e}return El}function Ym(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gr(""+e)}function Qm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Ov(e,t,a,n,r){if(t==="submit"&&a&&a.stateNode===r){var i=Ym((r[Ht]||null).action),f=n.submitter;f&&(t=(t=f[Ht]||null)?Ym(t.formAction):f.getAttribute("formAction"),t!==null&&(i=t,f=null));var h=new Nr("action","action",null,n,r);e.push({event:h,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(El!==0){var S=f?Qm(r,f):new FormData(r);Zo(a,{pending:!0,data:S,method:r.method,action:i},null,S)}}else typeof i=="function"&&(h.preventDefault(),S=f?Qm(r,f):new FormData(r),Zo(a,{pending:!0,data:S,method:r.method,action:i},i,S))},currentTarget:r}]})}}for(var Ec=0;Ec<oo.length;Ec++){var Ac=oo[Ec],_v=Ac.toLowerCase(),Rv=Ac[0].toUpperCase()+Ac.slice(1);wa(_v,"on"+Rv)}wa(yd,"onAnimationEnd"),wa(jd,"onAnimationIteration"),wa(Nd,"onAnimationStart"),wa("dblclick","onDoubleClick"),wa("focusin","onFocus"),wa("focusout","onBlur"),wa(Fx,"onTransitionRun"),wa(Ix,"onTransitionStart"),wa(Px,"onTransitionCancel"),wa(Sd,"onTransitionEnd"),vn("onMouseEnter",["mouseout","mouseover"]),vn("onMouseLeave",["mouseout","mouseover"]),vn("onPointerEnter",["pointerout","pointerover"]),vn("onPointerLeave",["pointerout","pointerover"]),Vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bs="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(" "),Lv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bs));function Xm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],r=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var f=n.length-1;0<=f;f--){var h=n[f],S=h.instance,_=h.currentTarget;if(h=h.listener,S!==i&&r.isPropagationStopped())break e;i=h,r.currentTarget=_;try{i(r)}catch(X){Cr(X)}r.currentTarget=null,i=S}else for(f=0;f<n.length;f++){if(h=n[f],S=h.instance,_=h.currentTarget,h=h.listener,S!==i&&r.isPropagationStopped())break e;i=h,r.currentTarget=_;try{i(r)}catch(X){Cr(X)}r.currentTarget=null,i=S}}}}function Qe(e,t){var a=t[Gl];a===void 0&&(a=t[Gl]=new Set);var n=e+"__bubble";a.has(n)||(Zm(t,e,2,!1),a.add(n))}function kc(e,t,a){var n=0;t&&(n|=4),Zm(a,e,n,t)}var di="_reactListening"+Math.random().toString(36).slice(2);function Tc(e){if(!e[di]){e[di]=!0,Sa.forEach(function(a){a!=="selectionchange"&&(Lv.has(a)||kc(a,!1,e),kc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[di]||(t[di]=!0,kc("selectionchange",!1,t))}}function Zm(e,t,a,n){switch(jh(t)){case 2:var r=ug;break;case 8:r=dg;break;default:r=Xc}a=r.bind(null,t,a,e),r=void 0,!$i||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Mc(e,t,a,n,r){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var h=n.stateNode.containerInfo;if(h===r)break;if(f===4)for(f=n.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===r)return;f=f.return}for(;h!==null;){if(f=Be(h),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=i=f;continue e}h=h.parentNode}}n=n.return}Wu(function(){var _=i,X=Ki(a),W=[];e:{var U=wd.get(e);if(U!==void 0){var G=Nr,Ce=e;switch(e){case"keypress":if(yr(a)===0)break e;case"keydown":case"keyup":G=kx;break;case"focusin":Ce="focus",G=Pi;break;case"focusout":Ce="blur",G=Pi;break;case"beforeblur":case"afterblur":G=Pi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=Pu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=vx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Dx;break;case yd:case jd:case Nd:G=yx;break;case Sd:G=_x;break;case"scroll":case"scrollend":G=px;break;case"wheel":G=Lx;break;case"copy":case"cut":case"paste":G=Nx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=td;break;case"toggle":case"beforetoggle":G=Hx}var Me=(t&4)!==0,rt=!Me&&(e==="scroll"||e==="scrollend"),k=Me?U!==null?U+"Capture":null:U;Me=[];for(var w=_,O;w!==null;){var K=w;if(O=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||O===null||k===null||(K=is(w,k),K!=null&&Me.push(qs(w,K,O))),rt)break;w=w.return}0<Me.length&&(U=new G(U,Ce,null,a,X),W.push({event:U,listeners:Me}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",U&&a!==Zi&&(Ce=a.relatedTarget||a.fromElement)&&(Be(Ce)||Ce[ul]))break e;if((G||U)&&(U=X.window===X?X:(U=X.ownerDocument)?U.defaultView||U.parentWindow:window,G?(Ce=a.relatedTarget||a.toElement,G=_,Ce=Ce?Be(Ce):null,Ce!==null&&(rt=m(Ce),Me=Ce.tag,Ce!==rt||Me!==5&&Me!==27&&Me!==6)&&(Ce=null)):(G=null,Ce=_),G!==Ce)){if(Me=Pu,K="onMouseLeave",k="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(Me=td,K="onPointerLeave",k="onPointerEnter",w="pointer"),rt=G==null?U:Bt(G),O=Ce==null?U:Bt(Ce),U=new Me(K,w+"leave",G,a,X),U.target=rt,U.relatedTarget=O,K=null,Be(X)===_&&(Me=new Me(k,w+"enter",Ce,a,X),Me.target=O,Me.relatedTarget=rt,K=Me),rt=K,G&&Ce)t:{for(Me=Uv,k=G,w=Ce,O=0,K=k;K;K=Me(K))O++;K=0;for(var Ae=w;Ae;Ae=Me(Ae))K++;for(;0<O-K;)k=Me(k),O--;for(;0<K-O;)w=Me(w),K--;for(;O--;){if(k===w||w!==null&&k===w.alternate){Me=k;break t}k=Me(k),w=Me(w)}Me=null}else Me=null;G!==null&&Km(W,U,G,Me,!1),Ce!==null&&rt!==null&&Km(W,rt,Ce,Me,!0)}}e:{if(U=_?Bt(_):window,G=U.nodeName&&U.nodeName.toLowerCase(),G==="select"||G==="input"&&U.type==="file")var $e=cd;else if(id(U))if(ud)$e=Jx;else{$e=Zx;var ze=Xx}else G=U.nodeName,!G||G.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?_&&Xi(_.elementType)&&($e=cd):$e=Kx;if($e&&($e=$e(e,_))){od(W,$e,a,X);break e}ze&&ze(e,U,_),e==="focusout"&&_&&U.type==="number"&&_.memoizedProps.value!=null&&Qi(U,"number",U.value)}switch(ze=_?Bt(_):window,e){case"focusin":(id(ze)||ze.contentEditable==="true")&&(Sn=ze,so=_,ps=null);break;case"focusout":ps=so=Sn=null;break;case"mousedown":ro=!0;break;case"contextmenu":case"mouseup":case"dragend":ro=!1,gd(W,a,X);break;case"selectionchange":if(Wx)break;case"keydown":case"keyup":gd(W,a,X)}var He;if(to)e:{switch(e){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Nn?sd(e,a)&&(Ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(ad&&a.locale!=="ko"&&(Nn||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Nn&&(He=Fu()):(dl=X,Wi="value"in dl?dl.value:dl.textContent,Nn=!0)),ze=fi(_,Ze),0<ze.length&&(Ze=new ed(Ze,e,null,a,X),W.push({event:Ze,listeners:ze}),He?Ze.data=He:(He=rd(a),He!==null&&(Ze.data=He)))),(He=qx?Gx(e,a):Vx(e,a))&&(Ze=fi(_,"onBeforeInput"),0<Ze.length&&(ze=new ed("onBeforeInput","beforeinput",null,a,X),W.push({event:ze,listeners:Ze}),ze.data=He)),Ov(W,e,_,a,X)}Xm(W,t)})}function qs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function fi(e,t){for(var a=t+"Capture",n=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=is(e,a),r!=null&&n.unshift(qs(e,r,i)),r=is(e,t),r!=null&&n.push(qs(e,r,i))),e.tag===3)return n;e=e.return}return[]}function Uv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Km(e,t,a,n,r){for(var i=t._reactName,f=[];a!==null&&a!==n;){var h=a,S=h.alternate,_=h.stateNode;if(h=h.tag,S!==null&&S===n)break;h!==5&&h!==26&&h!==27||_===null||(S=_,r?(_=is(a,i),_!=null&&f.unshift(qs(a,_,S))):r||(_=is(a,i),_!=null&&f.push(qs(a,_,S)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var Hv=/\r\n?/g,Bv=/\u0000|\uFFFD/g;function Jm(e){return(typeof e=="string"?e:""+e).replace(Hv,`
|
|
49
|
+
`).replace(Bv,"")}function $m(e,t){return t=Jm(t),Jm(e)===t}function st(e,t,a,n,r,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||bn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&bn(e,""+n);break;case"className":xr(e,"class",n);break;case"tabIndex":xr(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":xr(e,a,n);break;case"style":Ju(e,n,i);break;case"data":if(t!=="object"){xr(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=gr(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&st(e,t,"name",r.name,r,null),st(e,t,"formEncType",r.formEncType,r,null),st(e,t,"formMethod",r.formMethod,r,null),st(e,t,"formTarget",r.formTarget,r,null)):(st(e,t,"encType",r.encType,r,null),st(e,t,"method",r.method,r,null),st(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=gr(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Ba);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=gr(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),pr(e,"popover",n);break;case"xlinkActuate":Ha(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ha(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ha(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ha(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ha(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ha(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ha(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":pr(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=mx.get(a)||a,pr(e,a,n))}}function Dc(e,t,a,n,r,i){switch(a){case"style":Ju(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(r.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?bn(e,n):(typeof n=="number"||typeof n=="bigint")&&bn(e,""+n);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ba);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xn.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),i=e[Ht]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof n=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,r);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):pr(e,a,n)}}}function Ut(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var n=!1,r=!1,i;for(i in a)if(a.hasOwnProperty(i)){var f=a[i];if(f!=null)switch(i){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:st(e,t,i,f,a,null)}}r&&st(e,t,"srcSet",a.srcSet,a,null),n&&st(e,t,"src",a.src,a,null);return;case"input":Qe("invalid",e);var h=i=f=r=null,S=null,_=null;for(n in a)if(a.hasOwnProperty(n)){var X=a[n];if(X!=null)switch(n){case"name":r=X;break;case"type":f=X;break;case"checked":S=X;break;case"defaultChecked":_=X;break;case"value":i=X;break;case"defaultValue":h=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(c(137,t));break;default:st(e,t,n,X,a,null)}}Qu(e,i,h,S,_,f,r,!1);return;case"select":Qe("invalid",e),n=f=i=null;for(r in a)if(a.hasOwnProperty(r)&&(h=a[r],h!=null))switch(r){case"value":i=h;break;case"defaultValue":f=h;break;case"multiple":n=h;default:st(e,t,r,h,a,null)}t=i,a=f,e.multiple=!!n,t!=null?gn(e,!!n,t,!1):a!=null&&gn(e,!!n,a,!0);return;case"textarea":Qe("invalid",e),i=r=n=null;for(f in a)if(a.hasOwnProperty(f)&&(h=a[f],h!=null))switch(f){case"value":n=h;break;case"defaultValue":r=h;break;case"children":i=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:st(e,t,f,h,a,null)}Zu(e,n,r,i);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(n=a[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:st(e,t,S,n,a,null)}return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(n=0;n<Bs.length;n++)Qe(Bs[n],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("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(_ in a)if(a.hasOwnProperty(_)&&(n=a[_],n!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:st(e,t,_,n,a,null)}return;default:if(Xi(t)){for(X in a)a.hasOwnProperty(X)&&(n=a[X],n!==void 0&&Dc(e,t,X,n,a,void 0));return}}for(h in a)a.hasOwnProperty(h)&&(n=a[h],n!=null&&st(e,t,h,n,a,null))}function qv(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,f=null,h=null,S=null,_=null,X=null;for(G in a){var W=a[G];if(a.hasOwnProperty(G)&&W!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":S=W;default:n.hasOwnProperty(G)||st(e,t,G,null,n,W)}}for(var U in n){var G=n[U];if(W=a[U],n.hasOwnProperty(U)&&(G!=null||W!=null))switch(U){case"type":i=G;break;case"name":r=G;break;case"checked":_=G;break;case"defaultChecked":X=G;break;case"value":f=G;break;case"defaultValue":h=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(c(137,t));break;default:G!==W&&st(e,t,U,G,n,W)}}Yi(e,f,h,S,_,X,i,r);return;case"select":G=f=h=U=null;for(i in a)if(S=a[i],a.hasOwnProperty(i)&&S!=null)switch(i){case"value":break;case"multiple":G=S;default:n.hasOwnProperty(i)||st(e,t,i,null,n,S)}for(r in n)if(i=n[r],S=a[r],n.hasOwnProperty(r)&&(i!=null||S!=null))switch(r){case"value":U=i;break;case"defaultValue":h=i;break;case"multiple":f=i;default:i!==S&&st(e,t,r,i,n,S)}t=h,a=f,n=G,U!=null?gn(e,!!a,U,!1):!!n!=!!a&&(t!=null?gn(e,!!a,t,!0):gn(e,!!a,a?[]:"",!1));return;case"textarea":G=U=null;for(h in a)if(r=a[h],a.hasOwnProperty(h)&&r!=null&&!n.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:st(e,t,h,null,n,r)}for(f in n)if(r=n[f],i=a[f],n.hasOwnProperty(f)&&(r!=null||i!=null))switch(f){case"value":U=r;break;case"defaultValue":G=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(c(91));break;default:r!==i&&st(e,t,f,r,n,i)}Xu(e,U,G);return;case"option":for(var Ce in a)if(U=a[Ce],a.hasOwnProperty(Ce)&&U!=null&&!n.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:st(e,t,Ce,null,n,U)}for(S in n)if(U=n[S],G=a[S],n.hasOwnProperty(S)&&U!==G&&(U!=null||G!=null))switch(S){case"selected":e.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:st(e,t,S,U,n,G)}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 Me in a)U=a[Me],a.hasOwnProperty(Me)&&U!=null&&!n.hasOwnProperty(Me)&&st(e,t,Me,null,n,U);for(_ in n)if(U=n[_],G=a[_],n.hasOwnProperty(_)&&U!==G&&(U!=null||G!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:st(e,t,_,U,n,G)}return;default:if(Xi(t)){for(var rt in a)U=a[rt],a.hasOwnProperty(rt)&&U!==void 0&&!n.hasOwnProperty(rt)&&Dc(e,t,rt,void 0,n,U);for(X in n)U=n[X],G=a[X],!n.hasOwnProperty(X)||U===G||U===void 0&&G===void 0||Dc(e,t,X,U,n,G);return}}for(var k in a)U=a[k],a.hasOwnProperty(k)&&U!=null&&!n.hasOwnProperty(k)&&st(e,t,k,null,n,U);for(W in n)U=n[W],G=a[W],!n.hasOwnProperty(W)||U===G||U==null&&G==null||st(e,t,W,U,n,G)}function Wm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var r=a[n],i=r.transferSize,f=r.initiatorType,h=r.duration;if(i&&h&&Wm(f)){for(f=0,h=r.responseEnd,n+=1;n<a.length;n++){var S=a[n],_=S.startTime;if(_>h)break;var X=S.transferSize,W=S.initiatorType;X&&Wm(W)&&(S=S.responseEnd,f+=X*(S<h?1:(h-_)/(S-_)))}if(--n,t+=8*(i+f)/(r.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 Oc=null,_c=null;function mi(e){return e.nodeType===9?e:e.ownerDocument}function Fm(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 Im(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 Rc(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 Lc=null;function Vv(){var e=window.event;return e&&e.type==="popstate"?e===Lc?!1:(Lc=e,!0):(Lc=null,!1)}var Pm=typeof setTimeout=="function"?setTimeout:void 0,Yv=typeof clearTimeout=="function"?clearTimeout:void 0,eh=typeof Promise=="function"?Promise:void 0,Qv=typeof queueMicrotask=="function"?queueMicrotask:typeof eh<"u"?function(e){return eh.resolve(null).then(e).catch(Xv)}:Pm;function Xv(e){setTimeout(function(){throw e})}function Al(e){return e==="head"}function th(e,t){var a=t,n=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(r),Wn(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Gs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Gs(a);for(var i=a.firstChild;i;){var f=i.nextSibling,h=i.nodeName;i[ye]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=f}}else a==="body"&&Gs(e.ownerDocument.body);a=r}while(a);Wn(t)}function ah(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Uc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Uc(a),_e(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Zv(e,t,a,n){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ba(e.nextSibling),e===null)break}return null}function Kv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ba(e.nextSibling),e===null))return null;return e}function lh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ba(e.nextSibling),e===null))return null;return e}function Hc(e){return e.data==="$?"||e.data==="$~"}function Bc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Jv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ba(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 qc=null;function nh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ba(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function sh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function rh(e,t,a){switch(t=mi(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Gs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_e(e)}var ya=new Map,ih=new Set;function hi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var tl=L.d;L.d={f:$v,r:Wv,D:Fv,C:Iv,L:Pv,m:eg,X:ag,S:tg,M:lg};function $v(){var e=tl.f(),t=si();return e||t}function Wv(e){var t=qe(e);t!==null&&t.tag===5&&t.type==="form"?wf(t):tl.r(e)}var Kn=typeof document>"u"?null:document;function oh(e,t,a){var n=Kn;if(n&&typeof t=="string"&&t){var r=fa(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),ih.has(r)||(ih.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Ut(t,"link",e),lt(t),n.head.appendChild(t)))}}function Fv(e){tl.D(e),oh("dns-prefetch",e,null)}function Iv(e,t){tl.C(e,t),oh("preconnect",e,t)}function Pv(e,t,a){tl.L(e,t,a);var n=Kn;if(n&&e&&t){var r='link[rel="preload"][as="'+fa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+fa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+fa(a.imageSizes)+'"]')):r+='[href="'+fa(e)+'"]';var i=r;switch(t){case"style":i=Jn(e);break;case"script":i=$n(e)}ya.has(i)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ya.set(i,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Vs(i))||t==="script"&&n.querySelector(Ys(i))||(t=n.createElement("link"),Ut(t,"link",e),lt(t),n.head.appendChild(t)))}}function eg(e,t){tl.m(e,t);var a=Kn;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+fa(n)+'"][href="'+fa(e)+'"]',i=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=$n(e)}if(!ya.has(i)&&(e=j({rel:"modulepreload",href:e},t),ya.set(i,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ys(i)))return}n=a.createElement("link"),Ut(n,"link",e),lt(n),a.head.appendChild(n)}}}function tg(e,t,a){tl.S(e,t,a);var n=Kn;if(n&&e){var r=Ve(n).hoistableStyles,i=Jn(e);t=t||"default";var f=r.get(i);if(!f){var h={loading:0,preload:null};if(f=n.querySelector(Vs(i)))h.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ya.get(i))&&Gc(e,a);var S=f=n.createElement("link");lt(S),Ut(S,"link",e),S._p=new Promise(function(_,X){S.onload=_,S.onerror=X}),S.addEventListener("load",function(){h.loading|=1}),S.addEventListener("error",function(){h.loading|=2}),h.loading|=4,pi(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:h},r.set(i,f)}}}function ag(e,t){tl.X(e,t);var a=Kn;if(a&&e){var n=Ve(a).hoistableScripts,r=$n(e),i=n.get(r);i||(i=a.querySelector(Ys(r)),i||(e=j({src:e,async:!0},t),(t=ya.get(r))&&Vc(e,t),i=a.createElement("script"),lt(i),Ut(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function lg(e,t){tl.M(e,t);var a=Kn;if(a&&e){var n=Ve(a).hoistableScripts,r=$n(e),i=n.get(r);i||(i=a.querySelector(Ys(r)),i||(e=j({src:e,async:!0,type:"module"},t),(t=ya.get(r))&&Vc(e,t),i=a.createElement("script"),lt(i),Ut(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function ch(e,t,a,n){var r=(r=V.current)?hi(r):null;if(!r)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Jn(a.href),a=Ve(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Jn(a.href);var i=Ve(r).hoistableStyles,f=i.get(e);if(f||(r=r.ownerDocument||r,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,f),(i=r.querySelector(Vs(e)))&&!i._p&&(f.instance=i,f.state.loading=5),ya.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ya.set(e,a),i||ng(r,e,a,f.state))),t&&n===null)throw Error(c(528,""));return f}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=$n(a),a=Ve(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Jn(e){return'href="'+fa(e)+'"'}function Vs(e){return'link[rel="stylesheet"]['+e+"]"}function uh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function ng(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Ut(t,"link",a),lt(t),e.head.appendChild(t))}function $n(e){return'[src="'+fa(e)+'"]'}function Ys(e){return"script[async]"+e}function dh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+fa(a.href)+'"]');if(n)return t.instance=n,lt(n),n;var r=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),lt(n),Ut(n,"style",r),pi(n,a.precedence,e),t.instance=n;case"stylesheet":r=Jn(a.href);var i=e.querySelector(Vs(r));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;n=uh(a),(r=ya.get(r))&&Gc(n,r),i=(e.ownerDocument||e).createElement("link"),lt(i);var f=i;return f._p=new Promise(function(h,S){f.onload=h,f.onerror=S}),Ut(i,"link",n),t.state.loading|=4,pi(i,a.precedence,e),t.instance=i;case"script":return i=$n(a.src),(r=e.querySelector(Ys(i)))?(t.instance=r,lt(r),r):(n=a,(r=ya.get(i))&&(n=j({},a),Vc(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),lt(r),Ut(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,pi(n,a.precedence,e));return t.instance}function pi(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,i=r,f=0;f<n.length;f++){var h=n[f];if(h.dataset.precedence===t)i=h;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xi=null;function fh(e,t,a){if(xi===null){var n=new Map,r=xi=new Map;r.set(a,n)}else r=xi,n=r.get(a),n||(n=new Map,r.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var i=a[r];if(!(i[ye]||i[zt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var f=i.getAttribute(t)||"";f=e+f;var h=n.get(f);h?h.push(i):n.set(f,[i])}}return n}function mh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function sg(e,t,a){if(a===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 hh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rg(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Jn(n.href),i=t.querySelector(Vs(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=vi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,lt(i);return}i=t.ownerDocument||t,n=uh(n),(r=ya.get(r))&&Gc(n,r),i=i.createElement("link"),lt(i);var f=i;f._p=new Promise(function(h,S){f.onload=h,f.onerror=S}),Ut(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=vi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Yc=0;function ig(e,t){return e.stylesheets&&e.count===0&&bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&bi(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Yc===0&&(Yc=62500*Gv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bi(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Yc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function vi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gi=null;function bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gi=new Map,t.forEach(og,e),gi=null,vi.call(e))}function og(e,t){if(!(t.state.loading&4)){var a=gi.get(e);if(a)var n=a.get(null);else{a=new Map,gi.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var f=r[i];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}r=t.instance,f=r.getAttribute("data-precedence"),i=a.get(f)||n,i===n&&a.set(null,r),a.set(f,r),this.count++,n=vi.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Qs={$$typeof:ve,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function cg(e,t,a,n,r,i,f,h,S){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=ns(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ns(0),this.hiddenUpdates=ns(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function ph(e,t,a,n,r,i,f,h,S,_,X,W){return e=new cg(e,t,a,f,S,_,X,W,h),t=1,i===!0&&(t|=24),i=ta(3,null,null,t),e.current=i,i.stateNode=e,t=No(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},zo(i),e}function xh(e){return e?(e=zn,e):zn}function vh(e,t,a,n,r,i){r=xh(r),n.context===null?n.context=r:n.pendingContext=r,n=vl(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=gl(e,n,t),a!==null&&(Ft(a,e,t),Ns(a,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Qc(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Zl(e,67108864);t!==null&&Ft(t,e,67108864),Qc(e,67108864)}}function yh(e){if(e.tag===13||e.tag===31){var t=ra();t=rs(t);var a=Zl(e,t);a!==null&&Ft(a,e,t),Qc(e,t)}}var yi=!0;function ug(e,t,a,n){var r=z.T;z.T=null;var i=L.p;try{L.p=2,Xc(e,t,a,n)}finally{L.p=i,z.T=r}}function dg(e,t,a,n){var r=z.T;z.T=null;var i=L.p;try{L.p=8,Xc(e,t,a,n)}finally{L.p=i,z.T=r}}function Xc(e,t,a,n){if(yi){var r=Zc(n);if(r===null)Mc(e,t,n,ji,a),Nh(e,n);else if(mg(r,e,t,a,n))n.stopPropagation();else if(Nh(e,n),t&4&&-1<fg.indexOf(e)){for(;r!==null;){var i=qe(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var f=Ua(i.pendingLanes);if(f!==0){var h=i;for(h.pendingLanes|=2,h.entangledLanes|=2;f;){var S=1<<31-Ct(f);h.entanglements[1]|=S,f&=~S}Oa(i),(Fe&6)===0&&(li=tt()+500,Hs(0))}}break;case 31:case 13:h=Zl(i,2),h!==null&&Ft(h,i,2),si(),Qc(i,2)}if(i=Zc(n),i===null&&Mc(e,t,n,ji,a),i===r)break;r=i}r!==null&&n.stopPropagation()}else Mc(e,t,n,null,a)}}function Zc(e){return e=Ki(e),Kc(e)}var ji=null;function Kc(e){if(ji=null,e=Be(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=p(t),e!==null)return e;e=null}else if(a===31){if(e=x(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ji=e,null}function jh(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ul()){case cl:return 2;case Hl:return 8;case Yt:case Z:return 32;case Te:return 268435456;default:return 32}default:return 32}}var Jc=!1,kl=null,Tl=null,Ml=null,Xs=new Map,Zs=new Map,Dl=[],fg="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 Nh(e,t){switch(e){case"focusin":case"focusout":kl=null;break;case"dragenter":case"dragleave":Tl=null;break;case"mouseover":case"mouseout":Ml=null;break;case"pointerover":case"pointerout":Xs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zs.delete(t.pointerId)}}function Ks(e,t,a,n,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[r]},t!==null&&(t=qe(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function mg(e,t,a,n,r){switch(t){case"focusin":return kl=Ks(kl,e,t,a,n,r),!0;case"dragenter":return Tl=Ks(Tl,e,t,a,n,r),!0;case"mouseover":return Ml=Ks(Ml,e,t,a,n,r),!0;case"pointerover":var i=r.pointerId;return Xs.set(i,Ks(Xs.get(i)||null,e,t,a,n,r)),!0;case"gotpointercapture":return i=r.pointerId,Zs.set(i,Ks(Zs.get(i)||null,e,t,a,n,r)),!0}return!1}function Sh(e){var t=Be(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=p(a),t!==null){e.blockedOn=t,mr(e.priority,function(){yh(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,mr(e.priority,function(){yh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ni(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Zc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Zi=n,a.target.dispatchEvent(n),Zi=null}else return t=qe(a),t!==null&&bh(t),e.blockedOn=a,!1;t.shift()}return!0}function wh(e,t,a){Ni(e)&&a.delete(t)}function hg(){Jc=!1,kl!==null&&Ni(kl)&&(kl=null),Tl!==null&&Ni(Tl)&&(Tl=null),Ml!==null&&Ni(Ml)&&(Ml=null),Xs.forEach(wh),Zs.forEach(wh)}function Si(e,t){e.blockedOn===t&&(e.blockedOn=null,Jc||(Jc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,hg)))}var wi=null;function Ch(e){wi!==e&&(wi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){wi===e&&(wi=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(Kc(n||a)===null)continue;break}var i=qe(a);i!==null&&(e.splice(t,3),t-=3,Zo(i,{pending:!0,data:r,method:a.method,action:n},n,r))}}))}function Wn(e){function t(S){return Si(S,e)}kl!==null&&Si(kl,e),Tl!==null&&Si(Tl,e),Ml!==null&&Si(Ml,e),Xs.forEach(t),Zs.forEach(t);for(var a=0;a<Dl.length;a++){var n=Dl[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Dl.length&&(a=Dl[0],a.blockedOn===null);)Sh(a),a.blockedOn===null&&Dl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var r=a[n],i=a[n+1],f=r[Ht]||null;if(typeof i=="function")f||Ch(a);else if(f){var h=null;if(i&&i.hasAttribute("formAction")){if(r=i,f=i[Ht]||null)h=f.formAction;else if(Kc(r)!==null)continue}else h=f.action;typeof h=="function"?a[n+1]=h:(a.splice(n,3),n-=3),Ch(a)}}}function zh(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(f){return r=f})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function $c(e){this._internalRoot=e}Ci.prototype.render=$c.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=ra();vh(a,n,e,t,null,null)},Ci.prototype.unmount=$c.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),si(),t[ul]=null}};function Ci(e){this._internalRoot=e}Ci.prototype.unstable_scheduleHydration=function(e){if(e){var t=fr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Dl.length&&t!==0&&t<Dl[a].priority;a++);Dl.splice(a,0,e),a===0&&Sh(e)}};var Eh=o.version;if(Eh!=="19.2.7")throw Error(c(527,Eh,"19.2.7"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var pg={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zi.isDisabled&&zi.supportsFiber)try{pt=zi.inject(pg),ut=zi}catch{}}return $s.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",r=_f,i=Rf,f=Lf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=ph(e,1,!1,null,null,a,n,null,r,i,f,zh),e[ul]=t.current,Tc(e),new $c(t)},$s.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,r="",i=_f,f=Rf,h=Lf,S=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(h=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=ph(e,1,!0,t,a??null,n,r,S,i,f,h,zh),t.context=xh(null),a=t.current,n=ra(),n=rs(n),r=vl(n),r.callback=null,gl(a,r,n),a=n,t.current.lanes=a,ql(t,a),Oa(t),e[ul]=t.current,Tc(e),new Ci(t)},$s.version="19.2.7",$s}var Uh;function Tg(){if(Uh)return Ic.exports;Uh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Ic.exports=kg(),Ic.exports}var Mg=Tg();function yp(s){var o,u,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(u=yp(s[o]))&&(c&&(c+=" "),c+=u)}else for(u in s)s[u]&&(c&&(c+=" "),c+=u);return c}function jp(){for(var s,o,u=0,c="",d=arguments.length;u<d;u++)(s=arguments[u])&&(o=yp(s))&&(c&&(c+=" "),c+=o);return c}const Dg=(s,o)=>{const u=new Array(s.length+o.length);for(let c=0;c<s.length;c++)u[c]=s[c];for(let c=0;c<o.length;c++)u[s.length+c]=o[c];return u},Og=(s,o)=>({classGroupId:s,validator:o}),Np=(s=new Map,o=null,u)=>({nextPart:s,validators:o,classGroupId:u}),Oi="-",Hh=[],_g="arbitrary..",Rg=s=>{const o=Ug(s),{conflictingClassGroups:u,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return Lg(p);const x=p.split(Oi),y=x[0]===""&&x.length>1?1:0;return Sp(x,y,o)},getConflictingClassGroupIds:(p,x)=>{if(x){const y=c[p],g=u[p];return y?g?Dg(g,y):y:g||Hh}return u[p]||Hh}}},Sp=(s,o,u)=>{if(s.length-o===0)return u.classGroupId;const d=s[o],m=u.nextPart.get(d);if(m){const g=Sp(s,o+1,m);if(g)return g}const p=u.validators;if(p===null)return;const x=o===0?s.join(Oi):s.slice(o).join(Oi),y=p.length;for(let g=0;g<y;g++){const N=p[g];if(N.validator(x))return N.classGroupId}},Lg=s=>s.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=s.slice(1,-1),u=o.indexOf(":"),c=o.slice(0,u);return c?_g+c:void 0})(),Ug=s=>{const{theme:o,classGroups:u}=s;return Hg(u,o)},Hg=(s,o)=>{const u=Np();for(const c in s){const d=s[c];ju(d,u,c,o)}return u},ju=(s,o,u,c)=>{const d=s.length;for(let m=0;m<d;m++){const p=s[m];Bg(p,o,u,c)}},Bg=(s,o,u,c)=>{if(typeof s=="string"){qg(s,o,u);return}if(typeof s=="function"){Gg(s,o,u,c);return}Vg(s,o,u,c)},qg=(s,o,u)=>{const c=s===""?o:wp(o,s);c.classGroupId=u},Gg=(s,o,u,c)=>{if(Yg(s)){ju(s(c),o,u,c);return}o.validators===null&&(o.validators=[]),o.validators.push(Og(u,s))},Vg=(s,o,u,c)=>{const d=Object.entries(s),m=d.length;for(let p=0;p<m;p++){const[x,y]=d[p];ju(y,wp(o,x),u,c)}},wp=(s,o)=>{let u=s;const c=o.split(Oi),d=c.length;for(let m=0;m<d;m++){const p=c[m];let x=u.nextPart.get(p);x||(x=Np(),u.nextPart.set(p,x)),u=x}return u},Yg=s=>"isThemeGetter"in s&&s.isThemeGetter===!0,Qg=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,u=Object.create(null),c=Object.create(null);const d=(m,p)=>{u[m]=p,o++,o>s&&(o=0,c=u,u=Object.create(null))};return{get(m){let p=u[m];if(p!==void 0)return p;if((p=c[m])!==void 0)return d(m,p),p},set(m,p){m in u?u[m]=p:d(m,p)}}},du="!",Bh=":",Xg=[],qh=(s,o,u,c,d)=>({modifiers:s,hasImportantModifier:o,baseClassName:u,maybePostfixModifierPosition:c,isExternal:d}),Zg=s=>{const{prefix:o,experimentalParseClassName:u}=s;let c=d=>{const m=[];let p=0,x=0,y=0,g;const N=d.length;for(let J=0;J<N;J++){const P=d[J];if(p===0&&x===0){if(P===Bh){m.push(d.slice(y,J)),y=J+1;continue}if(P==="/"){g=J;continue}}P==="["?p++:P==="]"?p--:P==="("?x++:P===")"&&x--}const j=m.length===0?d:d.slice(y);let E=j,M=!1;j.endsWith(du)?(E=j.slice(0,-1),M=!0):j.startsWith(du)&&(E=j.slice(1),M=!0);const B=g&&g>y?g-y:void 0;return qh(m,M,E,B)};if(o){const d=o+Bh,m=c;c=p=>p.startsWith(d)?m(p.slice(d.length)):qh(Xg,!1,p,void 0,!0)}if(u){const d=c;c=m=>u({className:m,parseClassName:d})}return c},Kg=s=>{const o=new Map;return s.orderSensitiveModifiers.forEach((u,c)=>{o.set(u,1e6+c)}),u=>{const c=[];let d=[];for(let m=0;m<u.length;m++){const p=u[m],x=p[0]==="[",y=o.has(p);x||y?(d.length>0&&(d.sort(),c.push(...d),d=[]),c.push(p)):d.push(p)}return d.length>0&&(d.sort(),c.push(...d)),c}},Jg=s=>({cache:Qg(s.cacheSize),parseClassName:Zg(s),sortModifiers:Kg(s),postfixLookupClassGroupIds:$g(s),...Rg(s)}),$g=s=>{const o=Object.create(null),u=s.postfixLookupClassGroups;if(u)for(let c=0;c<u.length;c++)o[u[c]]=!0;return o},Wg=/\s+/,Fg=(s,o)=>{const{parseClassName:u,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:m,postfixLookupClassGroupIds:p}=o,x=[],y=s.trim().split(Wg);let g="";for(let N=y.length-1;N>=0;N-=1){const j=y[N],{isExternal:E,modifiers:M,hasImportantModifier:B,baseClassName:J,maybePostfixModifierPosition:P}=u(j);if(E){g=j+(g.length>0?" "+g:g);continue}let ee=!!P,ue;if(ee){const te=J.substring(0,P);ue=c(te);const H=ue&&p[ue]?c(J):void 0;H&&H!==ue&&(ue=H,ee=!1)}else ue=c(J);if(!ue){if(!ee){g=j+(g.length>0?" "+g:g);continue}if(ue=c(J),!ue){g=j+(g.length>0?" "+g:g);continue}ee=!1}const ve=M.length===0?"":M.length===1?M[0]:m(M).join(":"),Y=B?ve+du:ve,de=Y+ue;if(x.indexOf(de)>-1)continue;x.push(de);const he=d(ue,ee);for(let te=0;te<he.length;++te){const H=he[te];x.push(Y+H)}g=j+(g.length>0?" "+g:g)}return g},Ig=(...s)=>{let o=0,u,c,d="";for(;o<s.length;)(u=s[o++])&&(c=Cp(u))&&(d&&(d+=" "),d+=c);return d},Cp=s=>{if(typeof s=="string")return s;let o,u="";for(let c=0;c<s.length;c++)s[c]&&(o=Cp(s[c]))&&(u&&(u+=" "),u+=o);return u},Pg=(s,...o)=>{let u,c,d,m;const p=y=>{const g=o.reduce((N,j)=>j(N),s());return u=Jg(g),c=u.cache.get,d=u.cache.set,m=x,x(y)},x=y=>{const g=c(y);if(g)return g;const N=Fg(y,u);return d(y,N),N};return m=p,(...y)=>m(Ig(...y))},eb=[],At=s=>{const o=u=>u[s]||eb;return o.isThemeGetter=!0,o},zp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ep=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ab=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_l=s=>tb.test(s),Ge=s=>!!s&&!Number.isNaN(Number(s)),Ra=s=>!!s&&Number.isInteger(Number(s)),au=s=>s.endsWith("%")&&Ge(s.slice(0,-1)),al=s=>ab.test(s),Ap=()=>!0,ib=s=>lb.test(s)&&!nb.test(s),Nu=()=>!1,ob=s=>sb.test(s),cb=s=>rb.test(s),ub=s=>!je(s)&&!Ne(s),db=s=>s.startsWith("@container")&&(s[10]==="/"&&s[11]!==void 0||s[11]==="s"&&s[16]!==void 0&&s.startsWith("-size/",10)||s[11]==="n"&&s[18]!==void 0&&s.startsWith("-normal/",10)),fb=s=>Ll(s,Mp,Nu),je=s=>zp.test(s),sn=s=>Ll(s,Dp,ib),Gh=s=>Ll(s,yb,Ge),mb=s=>Ll(s,_p,Ap),hb=s=>Ll(s,Op,Nu),Vh=s=>Ll(s,kp,Nu),pb=s=>Ll(s,Tp,cb),Ei=s=>Ll(s,Rp,ob),Ne=s=>Ep.test(s),Ws=s=>dn(s,Dp),xb=s=>dn(s,Op),Yh=s=>dn(s,kp),vb=s=>dn(s,Mp),gb=s=>dn(s,Tp),Ai=s=>dn(s,Rp,!0),bb=s=>dn(s,_p,!0),Ll=(s,o,u)=>{const c=zp.exec(s);return c?c[1]?o(c[1]):u(c[2]):!1},dn=(s,o,u=!1)=>{const c=Ep.exec(s);return c?c[1]?o(c[1]):u:!1},kp=s=>s==="position"||s==="percentage",Tp=s=>s==="image"||s==="url",Mp=s=>s==="length"||s==="size"||s==="bg-size",Dp=s=>s==="length",yb=s=>s==="number",Op=s=>s==="family-name",_p=s=>s==="number"||s==="weight",Rp=s=>s==="shadow",jb=()=>{const s=At("color"),o=At("font"),u=At("text"),c=At("font-weight"),d=At("tracking"),m=At("leading"),p=At("breakpoint"),x=At("container"),y=At("spacing"),g=At("radius"),N=At("shadow"),j=At("inset-shadow"),E=At("text-shadow"),M=At("drop-shadow"),B=At("blur"),J=At("perspective"),P=At("aspect"),ee=At("ease"),ue=At("animate"),ve=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],de=()=>[...Y(),Ne,je],he=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],H=()=>[Ne,je,y],pe=()=>[_l,"full","auto",...H()],Ee=()=>[Ra,"none","subgrid",Ne,je],me=()=>["auto",{span:["full",Ra,Ne,je]},Ra,Ne,je],R=()=>[Ra,"auto",Ne,je],re=()=>["auto","min","max","fr",Ne,je],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...H()],L=()=>[_l,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],le=()=>[_l,"screen","full","dvw","lvw","svw","min","max","fit",...H()],ie=()=>[_l,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],D=()=>[s,Ne,je],b=()=>[...Y(),Yh,Vh,{position:[Ne,je]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",vb,fb,{size:[Ne,je]}],I=()=>[au,Ws,sn],fe=()=>["","none","full",g,Ne,je],V=()=>["",Ge,Ws,sn],T=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[Ge,au,Yh,Vh],De=()=>["","none",B,Ne,je],ne=()=>["none",Ge,Ne,je],be=()=>["none",Ge,Ne,je],xe=()=>[Ge,Ne,je],q=()=>[_l,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[al],breakpoint:[al],color:[Ap],container:[al],"drop-shadow":[al],ease:["in","out","in-out"],font:[ub],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[al],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[al],shadow:[al],spacing:["px",Ge],text:[al],"text-shadow":[al],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_l,je,Ne,P]}],container:["container"],"container-type":[{"@container":["","normal","size",Ne,je]}],"container-named":[db],columns:[{columns:[Ge,je,Ne,x]}],"break-after":[{"break-after":ve()}],"break-before":[{"break-before":ve()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:de()}],overflow:[{overflow:he()}],"overflow-x":[{"overflow-x":he()}],"overflow-y":[{"overflow-y":he()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ra,"auto",Ne,je]}],basis:[{basis:[_l,"full","auto",x,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,_l,"auto","initial","none",je]}],grow:[{grow:["",Ge,Ne,je]}],shrink:[{shrink:["",Ge,Ne,je]}],order:[{order:[Ra,"first","last","none",Ne,je]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...le()]}],"min-inline-size":[{"min-inline":["auto",...le()]}],"max-inline-size":[{"max-inline":["none",...le()]}],"block-size":[{block:["auto",...ie()]}],"min-block-size":[{"min-block":["auto",...ie()]}],"max-block-size":[{"max-block":["none",...ie()]}],w:[{w:[x,"screen",...L()]}],"min-w":[{"min-w":[x,"screen","none",...L()]}],"max-w":[{"max-w":[x,"screen","none","prose",{screen:[p]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",u,Ws,sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,bb,mb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",au,je]}],"font-family":[{font:[xb,hb,o]}],"font-features":[{"font-features":[je]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,Ne,je]}],"line-clamp":[{"line-clamp":[Ge,"none",Ne,Gh]}],leading:[{leading:[m,...H()]}],"list-image":[{"list-image":["none",Ne,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ne,sn]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ne,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"tab-size":[{tab:[Ra,Ne,je]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:b()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ra,Ne,je],radial:["",Ne,je],conic:[Ra,Ne,je]},gb,pb]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...T(),"hidden","none"]}],"divide-style":[{divide:[...T(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...T(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ne,je]}],"outline-w":[{outline:["",Ge,Ws,sn]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",N,Ai,Ei]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",j,Ai,Ei]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Ge,sn]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",E,Ai,Ei]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[Ge,Ne,je]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Ne,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Y()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:b()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,je]}],filter:[{filter:["","none",Ne,je]}],blur:[{blur:De()}],brightness:[{brightness:[Ge,Ne,je]}],contrast:[{contrast:[Ge,Ne,je]}],"drop-shadow":[{"drop-shadow":["","none",M,Ai,Ei]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",Ge,Ne,je]}],"hue-rotate":[{"hue-rotate":[Ge,Ne,je]}],invert:[{invert:["",Ge,Ne,je]}],saturate:[{saturate:[Ge,Ne,je]}],sepia:[{sepia:["",Ge,Ne,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,je]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ne,je]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ne,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ne,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ne,je]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ne,je]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ne,je]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ne,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ne,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ne,je]}],ease:[{ease:["linear","initial",ee,Ne,je]}],delay:[{delay:[Ge,Ne,je]}],animate:[{animate:["none",ue,Ne,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[J,Ne,je]}],"perspective-origin":[{"perspective-origin":de()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Ne,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:de()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:q()}],"translate-x":[{"translate-x":q()}],"translate-y":[{"translate-y":q()}],"translate-z":[{"translate-z":q()}],"translate-none":["translate-none"],zoom:[{zoom:[Ra,Ne,je]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,je]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Ge,Ws,sn,Gh]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lp=Pg(jb);var Up=bp();const Su={...Cg},Qh={};function ar(s,o){const u=v.useRef(Qh);return u.current===Qh&&(u.current=s(o)),u}const lu=Su.useInsertionEffect,Nb=lu&&lu!==Su.useLayoutEffect?lu:s=>s();function nl(s){const o=ar(Sb).current;return o.next=s,Nb(o.effect),o.trampoline}function Sb(){const s={next:void 0,callback:wb,trampoline:(...o)=>{var u;return(u=s.callback)==null?void 0:u.call(s,...o)},effect:()=>{s.callback=s.next}};return s}function wb(){}function Cb(s,o){return function(c,...d){const m=new URL(s);return m.searchParams.set("code",c.toString()),d.forEach(p=>m.searchParams.append("args[]",p)),`${o} error #${c}; visit ${m} for the full message.`}}const wu=Cb("https://base-ui.com/production-error","Base UI");function fu(s,o,u,c){const d=ar(Hp).current;return Eb(d,s,o,u,c)&&Bp(d,[s,o,u,c]),d.callback}function zb(s){const o=ar(Hp).current;return Ab(o,s)&&Bp(o,s),o.callback}function Hp(){return{callback:null,cleanup:null,refs:[]}}function Eb(s,o,u,c,d){return s.refs[0]!==o||s.refs[1]!==u||s.refs[2]!==c||s.refs[3]!==d}function Ab(s,o){return s.refs.length!==o.length||s.refs.some((u,c)=>u!==o[c])}function Bp(s,o){if(s.refs=o,o.every(u=>u==null)){s.callback=null;return}s.callback=u=>{if(s.cleanup&&(s.cleanup(),s.cleanup=null),u!=null){const c=Array(o.length).fill(null);for(let d=0;d<o.length;d+=1){const m=o[d];if(m!=null)switch(typeof m){case"function":{const p=m(u);typeof p=="function"&&(c[d]=p);break}case"object":{m.current=u;break}}}s.cleanup=()=>{for(let d=0;d<o.length;d+=1){const m=o[d];if(m!=null)switch(typeof m){case"function":{const p=c[d];typeof p=="function"?p():m(null);break}case"object":{m.current=null;break}}}}}}}const kb=parseInt(v.version,10);function Tb(s){return kb>=s}function Xh(s){if(!v.isValidElement(s))return null;const o=s,u=o.props;return(Tb(19)?u==null?void 0:u.ref:o.ref)??null}function mu(s,o){if(s&&!o)return s;if(!s&&o)return o;if(s||o)return{...s,...o}}const es=Object.freeze({});function Mb(s,o){const u={};for(const c in s){const d=s[c];if(o!=null&&o.hasOwnProperty(c)){const m=o[c](d);m!=null&&Object.assign(u,m);continue}d===!0?u[`data-${c.toLowerCase()}`]="":d&&(u[`data-${c.toLowerCase()}`]=d.toString())}return u}function Db(s,o){return typeof s=="function"?s(o):s}function qp(s,o){return typeof s=="function"?s(o):s}const Cu={};function zu(s,o,u,c,d){if(!u&&!c&&!s)return _i(o);let m=_i(s);return o&&(m=Di(m,o)),u&&(m=Di(m,u)),c&&(m=Di(m,c)),m}function Ob(s){if(s.length===0)return Cu;if(s.length===1)return _i(s[0]);let o=_i(s[0]);for(let u=1;u<s.length;u+=1)o=Di(o,s[u]);return o}function _i(s){return Eu(s)?{...Vp(s,Cu)}:_b(s)}function Di(s,o){return Eu(o)?Vp(o,s):Rb(s,o)}function _b(s){const o={...s};for(const u in o){const c=o[u];Gp(u,c)&&(o[u]=Yp(c))}return o}function Rb(s,o){if(!o)return s;for(const u in o){const c=o[u];switch(u){case"style":{s[u]=mu(s.style,c);break}case"className":{s[u]=Qp(s.className,c);break}default:Gp(u,c)?s[u]=Lb(s[u],c):s[u]=c}}return s}function Gp(s,o){const u=s.charCodeAt(0),c=s.charCodeAt(1),d=s.charCodeAt(2);return u===111&&c===110&&d>=65&&d<=90&&(typeof o=="function"||typeof o>"u")}function Eu(s){return typeof s=="function"}function Vp(s,o){return Eu(s)?s(o):s??Cu}function Lb(s,o){return o?s?(...u)=>{const c=u[0];if(Xp(c)){const m=c;Ri(m);const p=o(...u);return m.baseUIHandlerPrevented||s==null||s(...u),p}const d=o(...u);return s==null||s(...u),d}:Yp(o):s}function Yp(s){return s&&((...o)=>{const u=o[0];return Xp(u)&&Ri(u),s(...o)})}function Ri(s){return s.preventBaseUIHandler=()=>{s.baseUIHandlerPrevented=!0},s}function Qp(s,o){return o?s?o+" "+s:o:s}function Xp(s){return s!=null&&typeof s=="object"&&"nativeEvent"in s}function Au(s,o,u={}){const c=o.render,d=Ub(o,u);if(u.enabled===!1)return null;const m=u.state??es;return qb(s,c,d,m)}function Ub(s,o={}){const{className:u,style:c,render:d}=s,{state:m=es,ref:p,props:x,stateAttributesMapping:y,enabled:g=!0}=o,N=g?Db(u,m):void 0,j=g?qp(c,m):void 0,E=g?Mb(m,y):es,M=g&&x?Hb(x):void 0,B=g?mu(E,M)??{}:es;return typeof document<"u"&&(g?Array.isArray(p)?B.ref=zb([B.ref,Xh(d),...p]):B.ref=fu(B.ref,Xh(d),p):fu(null,null)),g?(N!==void 0&&(B.className=Qp(B.className,N)),j!==void 0&&(B.style=mu(B.style,j)),B):es}function Hb(s){return Array.isArray(s)?Ob(s):zu(void 0,s)}const Bb=Symbol.for("react.lazy");function qb(s,o,u,c){if(o){if(typeof o=="function")return o(u,c);const d=zu(u,o.props);d.ref=u.ref;let m=o;return(m==null?void 0:m.$$typeof)===Bb&&(m=v.Children.toArray(o)[0]),v.cloneElement(m,d)}if(s&&typeof s=="string")return Gb(s,u);throw new Error(wu(8))}function Gb(s,o){return s==="button"?v.createElement("button",{type:"button",...o,key:o.key}):s==="img"?v.createElement("img",{alt:"",...o,key:o.key}):v.createElement(s,o)}function Vb({controlled:s,default:o,name:u,state:c="value"}){const{current:d}=v.useRef(s!==void 0),[m,p]=v.useState(o),x=d?s:m,y=v.useCallback(g=>{d||p(g)},[]);return[x,y]}let Zh=0;function Yb(s,o="mui"){const[u,c]=v.useState(s),d=s||u;return v.useEffect(()=>{u==null&&(Zh+=1,c(`${o}-${Zh}`))},[u,o]),d}const Kh=Su.useId;function Qb(s,o){if(Kh!==void 0){const u=Kh();return`${o}-${u}`}return Yb(s,o)}function Xb(s){return Qb(s,"base-ui")}const Zb="none",Kb="trigger-press";function Zp(s,o,u,c){let d=!1,m=!1;const p=es;return{reason:s,event:o??new Event("base-ui"),cancel(){d=!0},allowPropagation(){m=!0},get isCanceled(){return d},get isPropagationAllowed(){return m},trigger:u,...p}}const Jb=()=>{},sl=typeof document<"u"?v.useLayoutEffect:Jb,$b=[];function Wb(s){v.useEffect(s,$b)}const ki=null;class Fb{constructor(){_a(this,"callbacks",[]);_a(this,"callbacksCount",0);_a(this,"nextId",1);_a(this,"startId",1);_a(this,"isScheduled",!1);_a(this,"tick",o=>{var d;this.isScheduled=!1;const u=this.callbacks,c=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,c>0)for(let m=0;m<u.length;m+=1)(d=u[m])==null||d.call(u,o)})}request(o){const u=this.nextId;return this.nextId+=1,this.callbacks.push(o),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),u}cancel(o){const u=o-this.startId;u<0||u>=this.callbacks.length||(this.callbacks[u]=null,this.callbacksCount-=1)}}const Ti=new Fb;class ia{constructor(){_a(this,"currentId",ki);_a(this,"cancel",()=>{this.currentId!==ki&&(Ti.cancel(this.currentId),this.currentId=ki)});_a(this,"disposeEffect",()=>this.cancel)}static create(){return new ia}static request(o){return Ti.request(o)}static cancel(o){return Ti.cancel(o)}request(o){this.cancel(),this.currentId=Ti.request(()=>{this.currentId=ki,o()})}}function Ib(){const s=ar(ia.create).current;return Wb(s.disposeEffect),s}function Pb(s,o=!1,u=!1){const[c,d]=v.useState(s&&o?"idle":void 0),[m,p]=v.useState(s);return s&&!m&&(p(!0),d("starting")),!s&&m&&c!=="ending"&&!u&&d("ending"),!s&&!m&&c==="ending"&&d(void 0),sl(()=>{if(!s&&m&&c!=="ending"&&u){const x=ia.request(()=>{d("ending")});return()=>{ia.cancel(x)}}},[s,m,c,u]),sl(()=>{if(!s||o)return;const x=ia.request(()=>{d(void 0)});return()=>{ia.cancel(x)}},[o,s]),sl(()=>{if(!s||!o)return;s&&m&&c!=="idle"&&d("starting");const x=ia.request(()=>{d("idle")});return()=>{ia.cancel(x)}},[o,s,m,c]),{mounted:m,setMounted:p,transitionStatus:c}}function ey(s){const{open:o,defaultOpen:u,onOpenChange:c,disabled:d}=s,[m,p]=Vb({controlled:o,default:u,name:"Collapsible",state:"open"}),{mounted:x,setMounted:y,transitionStatus:g}=Pb(m,!0,!0),N=Xb(),[j,E]=v.useState(),M=j??N,B=nl(J=>{const P=!m,ee=Zp(Kb,J.nativeEvent);c(P,ee),!ee.isCanceled&&p(P)});return v.useMemo(()=>({disabled:d,handleTrigger:B,mounted:x,open:m,panelId:M,setMounted:y,setOpen:p,setPanelIdState:E,transitionStatus:g}),[d,B,x,m,M,y,p,E,g])}const Kp=v.createContext(void 0);function Jp(){const s=v.useContext(Kp);if(s===void 0)throw new Error(wu(15));return s}let er=(function(s){return s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s})({});const ty={[er.startingStyle]:""},ay={[er.endingStyle]:""},$p={transitionStatus(s){return s==="starting"?ty:s==="ending"?ay:null}};let ku=(function(s){return s.open="data-open",s.closed="data-closed",s[s.startingStyle=er.startingStyle]="startingStyle",s[s.endingStyle=er.endingStyle]="endingStyle",s})({}),ly=(function(s){return s.panelOpen="data-panel-open",s})({});const ny={[ku.open]:""},sy={[ku.closed]:""},ry={open(s){return s?{[ly.panelOpen]:""}:null}},iy={open(s){return s?ny:sy}},Wp={...iy,...$p},oy=v.forwardRef(function(o,u){const{render:c,className:d,defaultOpen:m=!1,disabled:p=!1,onOpenChange:x,open:y,style:g,...N}=o,j=nl(x),E=ey({open:y,defaultOpen:m,onOpenChange:j,disabled:p}),M=v.useMemo(()=>({open:E.open,disabled:E.disabled,transitionStatus:E.transitionStatus}),[E.open,E.disabled,E.transitionStatus]),B=v.useMemo(()=>({...E,onOpenChange:j,state:M}),[E,j,M]),J=Au("div",o,{state:M,ref:u,props:N,stateAttributesMapping:Wp});return l.jsx(Kp.Provider,{value:B,children:J})});function cy(){return typeof window<"u"}function Fp(s){var o;return(s==null||(o=s.ownerDocument)==null?void 0:o.defaultView)||window}function uy(s){return cy()?s instanceof HTMLElement||s instanceof Fp(s).HTMLElement:!1}const dy=v.createContext(void 0);function fy(s=!1){const o=v.useContext(dy);if(o===void 0&&!s)throw new Error(wu(16));return o}function my(s){const{focusableWhenDisabled:o,disabled:u,composite:c=!1,tabIndex:d=0,isNativeButton:m}=s,p=c&&o!==!1,x=c&&o===!1;return{props:v.useMemo(()=>{const g={onKeyDown(N){u&&o&&N.key!=="Tab"&&N.preventDefault()}};return c||(g.tabIndex=d,!m&&u&&(g.tabIndex=o?d:-1)),(m&&(o||p)||!m&&u)&&(g["aria-disabled"]=u),m&&(!o||x)&&(g.disabled=u),g},[c,u,o,p,x,m,d])}}function hy(s={}){const{disabled:o=!1,focusableWhenDisabled:u,tabIndex:c=0,native:d=!0,composite:m}=s,p=v.useRef(null),x=fy(!0),y=m??x!==void 0,{props:g}=my({focusableWhenDisabled:u,disabled:o,composite:y,tabIndex:c,isNativeButton:d}),N=v.useCallback(()=>{const M=p.current;nu(M)&&y&&o&&g.disabled===void 0&&M.disabled&&(M.disabled=!1)},[o,g.disabled,y]);sl(N,[N]);const j=v.useCallback((M={})=>{const{onClick:B,onMouseDown:J,onKeyUp:P,onKeyDown:ee,onPointerDown:ue,...ve}=M;return zu({onClick(Y){if(o){Y.preventDefault();return}B==null||B(Y)},onMouseDown(Y){o||J==null||J(Y)},onKeyDown(Y){if(o||(Ri(Y),ee==null||ee(Y),Y.baseUIHandlerPrevented))return;const de=Y.target===Y.currentTarget,he=Y.currentTarget,te=nu(he),H=!d&&py(he),pe=de&&(d?te:!H),Ee=Y.key==="Enter",me=Y.key===" ",R=he.getAttribute("role"),re=(R==null?void 0:R.startsWith("menuitem"))||R==="option"||R==="gridcell";if(de&&y&&me){if(Y.defaultPrevented&&re)return;Y.preventDefault(),H||d&&te?(he.click(),Y.preventBaseUIHandler()):pe&&(B==null||B(Y),Y.preventBaseUIHandler());return}pe&&(!d&&(me||Ee)&&Y.preventDefault(),!d&&Ee&&(B==null||B(Y)))},onKeyUp(Y){if(!o){if(Ri(Y),P==null||P(Y),Y.target===Y.currentTarget&&d&&y&&nu(Y.currentTarget)&&Y.key===" "){Y.preventDefault();return}Y.baseUIHandlerPrevented||Y.target===Y.currentTarget&&!d&&!y&&Y.key===" "&&(B==null||B(Y))}},onPointerDown(Y){if(o){Y.preventDefault();return}ue==null||ue(Y)}},d?{type:"button"}:{role:"button"},g,ve)},[o,g,y,d]),E=nl(M=>{p.current=M,N()});return{getButtonProps:j,buttonRef:E}}function nu(s){return uy(s)&&s.tagName==="BUTTON"}function py(s){return!!((s==null?void 0:s.tagName)==="A"&&(s!=null&&s.href))}const xy={...ry,...$p},vy=v.forwardRef(function(o,u){const{panelId:c,open:d,handleTrigger:m,state:p,disabled:x}=Jp(),{className:y,disabled:g=x,render:N,nativeButton:j=!0,style:E,...M}=o,{getButtonProps:B,buttonRef:J}=hy({disabled:g,focusableWhenDisabled:!0,native:j});return Au("button",o,{state:p,ref:[u,J],props:[{"aria-controls":d?c:void 0,"aria-expanded":d,onClick:m},M,B],stateAttributesMapping:xy})});function gy(s,o,u,c){return s.addEventListener(o,u,c),()=>{s.removeEventListener(o,u,c)}}function by(s){const o=ar(yy,s).current;return o.next=s,sl(o.effect),o}function yy(s){const o={current:s,next:s,effect:()=>{o.current=o.next}};return o}function jy(s){return s==null?s:"current"in s?s.current:s}function Ip(s,o=!1,u=!0){const c=Ib();return nl((d,m=null)=>{c.cancel();const p=jy(s);if(p==null)return;const x=p,y=()=>{Up.flushSync(d)};if(typeof x.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){d();return}function g(){Promise.all(x.getAnimations().map(N=>N.finished)).then(()=>{m!=null&&m.aborted||y()}).catch(()=>{if(u){m!=null&&m.aborted||y();return}const N=x.getAnimations();!(m!=null&&m.aborted)&&N.length>0&&N.some(j=>j.pending||j.playState!=="finished")&&g()})}if(o){const N=er.startingStyle;if(!x.hasAttribute(N)){c.request(g);return}const j=new MutationObserver(()=>{x.hasAttribute(N)||(j.disconnect(),g())});j.observe(x,{attributes:!0,attributeFilter:[N]}),m==null||m.addEventListener("abort",()=>j.disconnect(),{once:!0});return}c.request(g)})}function Ny(s){const{enabled:o=!0,open:u,ref:c,onComplete:d}=s,m=nl(d),p=Ip(c,u,!1);v.useEffect(()=>{if(!o)return;const x=new AbortController;return p(m,x.signal),()=>{x.abort()}},[o,u,m,p])}const Fs={height:void 0,width:void 0};function Sy(s){const{externalRef:o,hiddenUntilFound:u,id:c,keepMounted:d,mounted:m,onOpenChange:p,open:x,setMounted:y,setOpen:g,transitionStatus:N}=s,j=v.useRef(null),E=v.useRef(null),[M,B]=v.useState(Fs),J=v.useRef(Fs),P=v.useRef(!1),ee=v.useRef(x),ue=v.useRef(!1),[ve,Y]=v.useState(!1),de=v.useRef(null),he=fu(o,j),te=by({mounted:m,open:x}),H=Ip(j,!1,!1),pe=!x&&!m,Ee=ve?"idle":N,me=x&&(ee.current||ue.current),R=!x&&m&&E.current==="css-animation"&&M.height===void 0&&M.width===void 0?J.current:M,re=u&&pe&&E.current!=="css-animation",ce=nl((ie,D=!0)=>{D&&(J.current=ie),B(ie)}),Se=nl(()=>{var ie;(ie=de.current)==null||ie.call(de),de.current=null}),z=nl(ie=>{Se(),de.current=()=>{de.current=null,ie()}}),L=nl(()=>{x&&m&&E.current==="css-animation"&&(ue.current=!0)});sl(()=>{!ve||N==="starting"||Y(!1)},[ve,N]),v.useEffect(()=>()=>{L(),Se()},[L,Se]),sl(()=>{const ie=j.current;if(!ie)return;!x&&de.current&&Se();const D=wy(ie,me);if(E.current=D,x&&N==="idle"&&ee.current&&D==="css-animation"){J.current=Fn(ie);return}if(x&&N==="starting"){const $=P.current;if(P.current=!1,D==="none"){ce(Fn(ie)),Y(!0);return}if(D==="css-transition"){const I=Cy(ie);if(ce(Fn(ie)),!$)return I;const fe=Is(ie,"transition-duration","0s");return z(fe),Y(!0),I}if(D==="css-animation"){if(ce(Fn(ie)),!$){Is(ie,"animation-name","none")();return}const I=Is(ie,"animation-name","none"),fe=Is(ie,"animation-duration","0s");I(),z(fe),Y(!0);return}}if(!x&&m&&(N==="idle"||N==="starting")){if(ee.current=!1,ue.current=!1,D==="none"){ce(Fs,!1),y(!1);return}ce(Fn(ie));return}if(N!=="ending")return;if(D==="none"){y(!1);return}const b=Fn(ie);if(!((b.height??0)>0||(b.width??0)>0)){y(!1);return}ce(b),D==="css-animation"&&Is(ie,"animation-name","none")()},[m,x,Se,ce,y,z,me,N]),Ny({enabled:x&&m&&Ee==="idle",open:!0,ref:j,onComplete(){x&&ce(Fs,!1)}}),v.useEffect(()=>{if(x||!m||Ee!=="ending"||!j.current)return;const D=new AbortController;let b=-1;function A(){te.current.open||(y(!1),ce(Fs,!1))}return b=ia.request(()=>{D.signal.aborted||H(A,D.signal)}),()=>{ia.cancel(b),D.abort()}},[te,m,x,Ee,H,ce,y]),sl(()=>{const ie=j.current;!ie||!u||!pe||ie.setAttribute("hidden","until-found")},[pe,u]),v.useEffect(function(){const D=j.current;if(!D)return;function b(A){const $=Zp(Zb,A);p(!0,$),!$.isCanceled&&(P.current=!0,g(!0))}return gy(D,"beforematch",b)},[p,g]);const le=d||u||m||x;return{height:R.height,props:{...re?{[ku.startingStyle]:""}:void 0,hidden:pe,id:c},ref:he,shouldPreventOpenAnimation:me,shouldRender:le,transitionStatus:Ee,width:R.width}}function Fn(s){return{height:s.scrollHeight,width:s.scrollWidth}}function wy(s,o=!1){const u=Fp(s).getComputedStyle(s),c=(u.animationName.split(",").map(m=>m.trim()).some(m=>m!==""&&m!=="none")||o)&&Jh(u.animationDuration),d=Jh(u.transitionDuration);return c&&d||d?"css-transition":c?"css-animation":"none"}function Jh(s){return s.split(",").map(o=>o.trim()).some(o=>o!==""&&Number.parseFloat(o)>0)}function Is(s,o,u){const c=s.style.getPropertyValue(o),d=s.style.getPropertyPriority(o);return s.style.setProperty(o,u),()=>{if(c===""){s.style.removeProperty(o);return}s.style.setProperty(o,c,d)}}function Cy(s){const o={"justify-content":s.style.justifyContent,"align-items":s.style.alignItems,"align-content":s.style.alignContent,"justify-items":s.style.justifyItems};Object.keys(o).forEach(d=>{s.style.setProperty(d,"initial","important")});function u(){Object.entries(o).forEach(([d,m])=>{if(m===""){s.style.removeProperty(d);return}s.style.setProperty(d,m)})}const c=ia.request(u);return()=>{ia.cancel(c),u()}}let $h=(function(s){return s.collapsiblePanelHeight="--collapsible-panel-height",s.collapsiblePanelWidth="--collapsible-panel-width",s})({});const zy=v.forwardRef(function(o,u){const{className:c,hiddenUntilFound:d,keepMounted:m,render:p,id:x,style:y,...g}=o,{mounted:N,onOpenChange:j,open:E,panelId:M,setMounted:B,setPanelIdState:J,setOpen:P,state:ee,transitionStatus:ue}=Jp(),ve=d??!1,Y=m??!1;sl(()=>{if(x)return J(x),()=>{J(void 0)}},[x,J]);const{height:de,props:he,ref:te,shouldPreventOpenAnimation:H,shouldRender:pe,transitionStatus:Ee,width:me}=Sy({externalRef:u,hiddenUntilFound:ve,id:M,keepMounted:Y,mounted:N,onOpenChange:j,open:E,setMounted:B,setOpen:P,transitionStatus:ue}),R={...ee,transitionStatus:Ee},re=qp(y,R),ce=Au("div",{...o,style:void 0},{state:R,ref:te,props:[he,{style:{[$h.collapsiblePanelHeight]:de===void 0?"auto":`${de}px`,[$h.collapsiblePanelWidth]:me===void 0?"auto":`${me}px`}},g,re?{style:re}:void 0,H?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Wp});return pe?ce:null});function ge(...s){return Lp(jp(s))}var Ey={home:["M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],specs:["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"],flow:["M4 16l4.586-4.586a2 2 0 0 1 2.828 0L16 16m-2-2l1.586-1.586a2 2 0 0 1 2.828 0L20 14m-6-6h.01M6 20h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2z"],context:["M11 4a2 2 0 1 1 4 0v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4a2 2 0 1 1 4 0z","M8 10h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z"],sun:["M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42","M12 5a7 7 0 1 0 0 14 7 7 0 0 0 0-14z"],moon:["M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"],grid:["M16 3h5v5","M8 3H3v5","M3 16v5h5","M16 21h5v-5","M3 12h3","M18 12h3","M12 3v3","M12 18v3"],plus:["M12 5v14","M5 12h14"],trash:["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2","M10 11v6","M14 11v6"],check:["M20 6L9 17l-5-5"],edit:["M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7","M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"],search:["M21 21l-4.35-4.35","M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"],info:["M12 16v-4","M12 8h.01","M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10z"],"chevron-left":["M15 18l-6-6 6-6"],"chevron-right":["M9 18l6-6-6-6"],"arrow-up":["M12 19V5","M5 12l7-7 7 7"],star:["M12 2l3 7h7l-5.5 4 2 7L12 16l-5.5 4 2-7L3 9h7z"],"list-three":["M4 6h16","M4 12h16","M4 18h16"],settings:["M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z","M15 12a3 3 0 11-6 0 3 3 0 016 0z"],cross:["M3 12h3","M18 12h3","M12 3v3","M12 18v3","M5 5l14 14","M5 19l14-14"],x:["M18 6l-12 12","M6 6l12 12"],"alert-triangle":["M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","M12 9v4","M12 17h.01"],user:["M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2","M12 7a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"],"x-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M15 9l-6 6M9 9l6 6"],"check-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 12l3 3 5-5"],"alert-circle":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M12 8v5","M12 16h.01"],help:["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 9.5a4 4 0 1 1 4.75 3.94c-.41.11-.75.4-.75.81V15","M12 18h.01"],"bar-chart":["M3 21h18","M5 21V10","M9 21V6","M13 21V3","M17 21V8"],code:["M16 18l6-6-6-6","M8 6l-6 6 6 6"],"file-text":["M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z","M14 2v6h6","M16 13H8","M16 17H8","M10 9H8"],"chevron-down":["M6 9l6 6 6-6"],"chevron-up":["M18 15l-6-6-6 6"],clock:["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M12 6v6l4 2"],folder:["M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"],box:["M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"],cpu:["M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2","M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v0a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2z","M13 13h2","M9 13h.01"],book:["M4 19.5A2.5 2.5 0 0 1 6.5 17H20","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z","M8 7h8","M8 11h6"],"pen-tool":["M12 19l7-7 3 3-7 7-3-3z","M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z","M2 2l7.586 7.586","M11 11l-4 4"],"git-branch":["M6 3v12","M6 3a4 4 0 0 1 4 4v0a4 4 0 0 1-4 4","M6 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M18 9v1a2 2 0 0 1-2 2H10"],workflow:["M6 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M18 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6z","M6 9v2a3 3 0 0 0 3 3h6a3 3 0 0 1 3 3v0","M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M18 9v6"],activity:["M22 12h-4l-3 9L9 3l-3 9H2"],shield:["M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"],copy:["M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2","M12 11h4","M12 16h4","M8 11h.01","M8 16h.01","M15 2H9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1z"],bot:["M12 2c-2.5 0-5 1.5-5 4 0 1.5.8 2.8 2 3.5A5 5 0 0 0 7 14v1a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-1a5 5 0 0 0-2-4.5c1.2-.7 2-2 2-3.5 0-2.5-2.5-4-5-4z","M9 17v3a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-3","M9 11h.01","M15 11h.01"],circle:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"],"loader-circle":["M21 12a9 9 0 1 1-6.219-8.56"],sparkles:["M12 3l1.5 3.5L17 8l-3.5 1.5L12 13l-1.5-3.5L7 8l3.5-1.5z","M17.5 14l.5 1.5L19.5 16l-1.5.5-.5 1.5-.5-1.5L15.5 16l1.5-.5z","M5.5 4l.5 1.5L7.5 6 6 6.5 5.5 8 5 6.5 3.5 6 5 5.5z"],zap:["M13 2L3 14h9l-1 8 10-12h-9l1-8z"],terminal:["M4 17l6-6-6-6","M12 19h8"],"circle-check":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M8 12l3 3 5-5"],"circle-x":["M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2z","M15 9l-6 6M9 9l6 6"],"octagon-alert":["M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86z","M12 8v4","M12 16h.01"],hourglass:["M6 2v4a4 4 0 0 0 4 4 4 4 0 0 0-4 4v4H6","M18 2v4a4 4 0 0 1-4 4 4 4 0 0 1 4 4v4h0","M6 2h12","M6 22h12"],plug:["M12 22v-5","M5 12h14","M7 12V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v7","M9 9V5","M15 9V5"],"settings-2":["M20 7h-9","M14 17H5","M17 12H3","M7 7h.01","M21 17h.01","M12 12h.01"],"sliders-horizontal":["M4 6h16","M4 18h16","M10 4v4","M14 16v4","M7 10v0a2 2 0 0 0 2 2h0a2 2 0 0 0 2-2v0a2 2 0 0 0-2-2h0a2 2 0 0 0-2 2z","M17 14v0a2 2 0 0 0 2 2h0a2 2 0 0 0 2-2v0a2 2 0 0 0-2-2h0a2 2 0 0 0-2 2z"],"scroll-text":["M8 21h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H8","M16 3v18","M4 3h4v18H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z","M10 8h4","M10 12h4","M10 16h2"]};function C({name:s,size:o=16,className:u,...c}){const d=Ey[s];return d?l.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",width:o,height:o,className:ge("shrink-0",u),"aria-hidden":"true",...c,children:d.map(m=>l.jsx("path",{d:m},m))}):null}var Ay={primary:"bg-[var(--color-primary)] text-[var(--color-on-accent)] hover:bg-[var(--color-primary-hover)] hover:scale-[1.02] active:bg-[var(--color-primary-pressed)] border border-transparent",secondary:"bg-[var(--color-bg-sunken)] text-[var(--color-text-primary)] border border-[var(--color-border)] hover:border-[var(--color-text-secondary)]",danger:"bg-[var(--color-danger)] text-[var(--color-on-accent)] border border-transparent hover:opacity-90",ghost:"bg-transparent hover:bg-[var(--color-bg-sunken)] text-[var(--color-text-primary)] border border-transparent"},ky={sm:"h-8 px-[var(--space-3)] text-xs rounded-[var(--radius-sm)]",default:"h-10 px-[var(--space-4)] text-sm rounded-[var(--radius-md)]",lg:"h-11 px-[var(--space-5)] text-base rounded-[var(--radius-md)]"};function F({variant:s="primary",size:o="default",loading:u,disabled:c,children:d,className:m,...p}){return l.jsxs("button",{className:ge("inline-flex items-center justify-center gap-[var(--space-2)] font-medium disabled:opacity-50 disabled:pointer-events-none cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)]","transition-[background-color,border-color,box-shadow,opacity,color,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)] active:translate-y-px",u&&"opacity-80",Ay[s],ky[o],m),disabled:c||u,...p,children:[u&&l.jsx(C,{name:"loader-circle",size:14,className:"animate-spin"}),d]})}function Tu({ariaLabel:s,className:o,children:u,...c}){return l.jsx("div",{role:"group","aria-label":s,className:ge("inline-flex min-w-0 flex-wrap items-center gap-0.5 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-0.5",o),...c,children:u})}function Mu({selected:s=!1,count:o,children:u,className:c,type:d="button",...m}){return l.jsxs(F,{type:d,size:"sm",variant:"ghost","aria-pressed":s,"data-selected":s?"true":"false",className:ge("h-7 min-w-0 rounded-[var(--radius-xs)] border-transparent px-2 text-caption text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-surface)] hover:text-[var(--color-text-primary)]","data-[selected=true]:border-[var(--color-border)] data-[selected=true]:bg-[var(--color-bg-surface)] data-[selected=true]:text-[var(--color-text-primary)] data-[selected=true]:shadow-sm",c),...m,children:[l.jsx("span",{className:"min-w-0 truncate",children:u}),o!==void 0?l.jsx("span",{className:"font-mono text-[11px] tabular-nums text-[var(--color-text-tertiary)]",children:o}):null]})}var Ty={amber:{color:"var(--color-primary)",onColor:"var(--color-on-accent)",softColor:"#FFB800",softBg:"#1C1808",softBorder:"#5C4F1A",outlineBorder:"#8B7A25",solidBg:"var(--color-primary)"},success:{color:"var(--color-success)",onColor:"var(--color-on-status)",softColor:"#4ADE80",softBg:"#1A2B20",softBorder:"#244A33",outlineBorder:"#2D6A45",solidBg:"#178640"},info:{color:"var(--color-info)",onColor:"var(--color-on-status)",softColor:"#93C5FD",softBg:"#1C2636",softBorder:"#2B4264",outlineBorder:"#3B5E8A",solidBg:"#2858A7"},error:{color:"var(--color-danger)",onColor:"var(--color-on-status)",softColor:"#F87171",softBg:"#2C1A1A",softBorder:"#542626",outlineBorder:"#7A3636",solidBg:"#A22E2E"},agent:{color:"var(--color-agent)",onColor:"var(--color-on-status)",softColor:"#C4B5FD",softBg:"#22203A",softBorder:"#3C3568",outlineBorder:"#564D96",solidBg:"#7260AA"}},My={amber:"clock",success:"circle-check",info:"info",error:"circle-x",agent:"sparkles"};function Dy(s,o){const u=Ty[s];return o==="outline"?{background:"transparent",color:u.softColor,borderColor:u.outlineBorder}:o==="soft"?{background:u.softBg,color:u.softColor,borderColor:u.softBorder}:{background:u.solidBg,color:u.onColor,borderColor:u.solidBg}}function ke({variant:s="amber",tone:o="solid",icon:u,className:c,children:d,style:m,...p}){const x=Dy(s,o),y=u??My[s];return l.jsxs("span",{className:ge("inline-flex items-center gap-[var(--space-1)] text-caption font-medium px-[var(--space-2)] py-[var(--space-1)] rounded-[var(--radius-full)] border-[length:var(--border-thin)]",c),style:{...x,...m},...p,children:[l.jsx(C,{name:y,size:12}),d]})}var Oy={default:"border-[var(--color-border)]",warning:"ds-action-panel--warning",danger:"ds-action-panel--danger",success:"ds-action-panel--success",info:"ds-action-panel--info"};function tr({icon:s,title:o,description:u,meta:c,action:d,secondaryAction:m,tone:p="default",density:x="default",className:y,children:g,...N}){return l.jsxs("section",{className:ge("grid rounded-[var(--radius-md)] border bg-[var(--color-bg-surface)] shadow-sm",x==="compact"?"gap-[var(--layout-inline-gap)] p-[var(--space-4)]":"gap-[var(--layout-cluster-gap)] p-[var(--card-padding)]","sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:items-center",Oy[p],y),...N,children:[s?l.jsx("div",{className:ge("flex items-center justify-center rounded-[var(--radius-sm)] bg-[var(--color-bg-sunken)] text-[var(--color-text-secondary)]",x==="compact"?"size-8":"size-10"),children:s}):null,l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-1)]",children:[c?l.jsx("div",{className:"ds-cluster",children:c}):null,l.jsx("h2",{className:ge("text-[var(--color-text-primary)]",x==="compact"?"text-body-sm font-semibold":"text-h3 sm:text-h2"),children:o}),u?l.jsx("p",{className:ge("max-w-3xl text-[var(--color-text-secondary)]",x==="compact"?"text-caption":"text-body-sm"),children:u}):null,g]}),d||m?l.jsxs("div",{className:"flex flex-wrap items-center gap-[var(--layout-toolbar-gap)] sm:justify-end",children:[m,d]}):null]})}function Ea({items:s,className:o,...u}){return s.length===0?null:l.jsx("dl",{className:ge("grid gap-[var(--layout-inline-gap)] sm:grid-cols-[repeat(auto-fit,minmax(8rem,1fr))]",o),...u,children:s.map((c,d)=>l.jsxs("div",{className:"grid gap-[var(--space-1)] rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-[var(--space-3)]",children:[l.jsxs("dt",{className:"ds-cluster text-caption font-medium uppercase text-[var(--color-text-tertiary)]",children:[c.icon,l.jsx("span",{children:c.label})]}),l.jsx("dd",{className:"min-w-0 break-words text-body-sm font-medium text-[var(--color-text-primary)]",children:c.value})]},d))})}function it({variant:s="default",className:o,children:u,style:c,...d}){return l.jsx("div",{className:ge("rounded-[var(--radius-md)] border-[length:var(--border-thin)] shadow-sm transition-shadow duration-[var(--motion-fast)] ease-[var(--ease-standard)]",s==="default"&&"hover:shadow-[var(--card-hover-shadow)]",s==="agent"&&"border-l-2",s==="agent"&&"hover:shadow-[var(--card-hover-shadow)]",o),style:{background:"var(--color-bg-surface)",borderColor:s==="agent"?"var(--color-agent)":"var(--color-border)","--card-hover-shadow":s==="agent"?"0 0 28px color-mix(in oklch, var(--color-agent) 20%, transparent)":"0 0 24px color-mix(in oklch, var(--color-primary) 12%, transparent)",...c},...d,children:u})}function ja({className:s,children:o,...u}){return l.jsx("div",{className:ge("grid gap-[var(--card-header-gap)] border-b border-[var(--color-border)] p-[var(--card-padding)]",s),...u,children:o})}function ot({className:s,children:o,...u}){return l.jsx("div",{className:ge("grid gap-[var(--card-content-gap)] p-[var(--card-padding)]",s),...u,children:o})}function as({className:s,label:o,id:u,...c}){const d=u||(o==null?void 0:o.replace(/\s+/g,"-").toLowerCase());return l.jsxs("label",{htmlFor:d,className:"group flex cursor-pointer items-center gap-[var(--space-2)]",children:[l.jsx("input",{type:"checkbox",id:d,className:ge("peer sr-only",s),...c}),l.jsx("span",{"data-slot":"checkbox-control","aria-hidden":"true",className:"flex size-[var(--icon-md)] shrink-0 items-center justify-center rounded-[var(--radius-xs)] border-[length:var(--border-thin)] border-[var(--color-border)] bg-[var(--color-bg-base)] text-[var(--color-on-accent)] transition-colors [&_svg]:opacity-0 peer-checked:border-[var(--color-primary)] peer-checked:bg-[var(--color-primary)] peer-checked:[&_svg]:opacity-100 peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--focus-ring-color)] peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-[var(--color-bg-base)] peer-disabled:opacity-50",children:l.jsx(C,{name:"check",size:12,className:"transition-opacity"})}),o&&l.jsx("span",{className:"select-none text-sm transition-colors group-hover:text-[var(--color-text-primary)] peer-disabled:opacity-50",style:{color:"var(--color-text-secondary)"},children:o})]})}var Dt=v.forwardRef(function({className:o,...u},c){return l.jsx("input",{ref:c,className:ge("w-full px-[var(--space-3)] py-[var(--space-2)] rounded-[var(--radius-sm)] border-[length:var(--border-thin)] text-sm transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)]","focus-visible:outline-none focus-visible:border-[var(--focus-ring-color)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)] focus-visible:shadow-[0_0_0_4px_color-mix(in_oklch,var(--color-primary)_14%,transparent)]","placeholder:opacity-50",o),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"},...u})}),Li=v.forwardRef(function({className:o,...u},c){return l.jsx("textarea",{ref:c,className:ge("w-full px-[var(--space-3)] py-[var(--space-2)] rounded-[var(--radius-sm)] border-[length:var(--border-thin)] text-sm transition-colors font-mono","focus-visible:outline-none focus-visible:border-[var(--focus-ring-color)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-base)]","resize-y",o),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"},...u})});function ts({className:s,...o}){return l.jsx("label",{"data-slot":"label",className:ge("flex items-center gap-[var(--space-2)] text-sm leading-none font-medium select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...o})}function ls({open:s,onClose:o,title:u,children:c,actions:d,variant:m="default",hideHeader:p=!1,className:x,bodyClassName:y,contentRef:g}){const N=v.useRef(null);return v.useEffect(()=>{if(!s)return;const j=E=>{E.key==="Escape"&&o()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[s,o]),s?l.jsx("div",{ref:N,className:"fixed inset-0 z-[var(--z-modal)] flex items-center justify-center animate-fade-in backdrop-blur-sm",style:{background:"var(--overlay)"},onClick:j=>{j.target===N.current&&o()},onKeyDown:j=>{j.key==="Escape"&&o()},children:l.jsxs("dialog",{ref:g,open:!0,className:ge("border-[length:var(--border-thin)] shadow-xl animate-slide-up",m==="fullscreen"?"m-0 flex h-screen max-h-none w-screen max-w-none flex-col overflow-hidden rounded-none":"mx-4 w-full max-w-md rounded-[var(--radius-lg)]",x),style:{background:"var(--color-bg-surface)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"},"aria-label":u,children:[!p&&l.jsxs("div",{className:"flex items-center justify-between border-b px-[var(--space-4)] py-[var(--space-3)]",style:{borderColor:"var(--color-border)"},children:[l.jsx("h2",{className:"text-h2",style:{color:"var(--color-text-primary)"},children:u}),l.jsx("button",{type:"button",onClick:o,className:"inline-flex size-8 items-center justify-center rounded-[var(--radius-sm)] transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",style:{color:"var(--color-text-secondary)"},"aria-label":"Close dialog",children:l.jsx(C,{name:"x",size:16})})]}),l.jsx("div",{className:ge(m==="fullscreen"?"flex min-h-0 flex-1 flex-col":"px-[var(--space-4)] py-[var(--space-3)]",y),children:c}),d&&l.jsx("div",{className:"flex justify-end gap-[var(--space-3)] border-t px-[var(--space-4)] py-[var(--space-3)]",style:{borderColor:"var(--color-border)"},children:d})]})}):null}function Du({open:s,onClose:o,onConfirm:u,title:c,message:d,confirmLabel:m="Confirmar",cancelLabel:p="Cancelar",variant:x="default"}){return l.jsx(ls,{open:s,onClose:o,title:c,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:o,children:p}),l.jsx(F,{type:"button",variant:x==="danger"?"danger":"primary",onClick:()=>{u(),o()},children:m})]}),children:l.jsx("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:d})})}function Pp({open:s,onClose:o,onSubmit:u,title:c,label:d,placeholder:m,submitLabel:p="Criar",cancelLabel:x="Cancelar"}){const y=v.useRef(null);v.useEffect(()=>{s&&y.current&&y.current.focus()},[s]);const g=()=>{var j;const N=(j=y.current)==null?void 0:j.value.trim();N&&(u(N),o())};return l.jsx(ls,{open:s,onClose:o,title:c,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:o,children:x}),l.jsx(F,{type:"button",onClick:g,children:p})]}),children:l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:d}),l.jsx(Dt,{ref:y,type:"text",placeholder:m,onKeyDown:N=>{N.key==="Enter"&&g()}})]})})}function un({className:s,...o}){return l.jsx("div",{className:ge("skeleton-shimmer rounded-[var(--radius-sm)]",s),...o})}function It(){return l.jsxs("div",{className:"rounded-[var(--radius-md)] border-[length:var(--border-thin)] p-[var(--space-4)] flex flex-col gap-[var(--space-3)]",style:{background:"var(--card)",borderColor:"var(--border)"},children:[l.jsx(un,{className:"h-4 w-1/3"}),l.jsx(un,{className:"h-3 w-full"}),l.jsx(un,{className:"h-3 w-2/3"})]})}var Wh={success:"color-success",error:"color-danger",info:"color-info",agent:"color-agent"},_y={success:"circle-check",error:"circle-x",info:"info",agent:"sparkles"},ex=v.createContext({toast:()=>{},toastWithOptions:()=>{}});function lr(){return v.useContext(ex)}var Fh=0;function Ry({children:s}){const[o,u]=v.useState([]),c=v.useRef(new Map),d=v.useCallback(x=>{u(g=>g.filter(N=>N.id!==x));const y=c.current.get(x);y&&(clearTimeout(y),c.current.delete(x))},[]),m=v.useCallback((x,y="info")=>{const g=++Fh;u(j=>[...j,{id:g,message:x,type:y}]);const N=setTimeout(()=>d(g),3e3);c.current.set(g,N)},[d]),p=v.useCallback((x,y)=>{const g=++Fh;u(j=>[...j,{id:g,message:x,type:(y==null?void 0:y.type)??"info",action:y==null?void 0:y.action}]);const N=setTimeout(()=>d(g),(y==null?void 0:y.duration)??3e3);c.current.set(g,N)},[d]);return l.jsxs(ex.Provider,{value:{toast:m,toastWithOptions:p},children:[s,l.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-[var(--space-2)]",children:o.map(x=>l.jsxs("div",{className:"flex max-w-sm items-start gap-[var(--space-3)] rounded-[var(--radius-md)] border-[length:var(--border-thin)] px-[var(--space-4)] py-[var(--space-3)] text-body font-medium shadow-lg animate-slide-in-right",style:{background:"var(--color-bg-surface)",color:"var(--color-text-primary)",borderColor:`color-mix(in srgb, var(--${Wh[x.type]}) 35%, var(--color-border))`},children:[l.jsx(C,{name:_y[x.type],size:18,style:{color:`var(--${Wh[x.type]})`}}),l.jsx("span",{className:"flex-1",children:x.message}),x.action&&l.jsx(F,{type:"button",size:"sm",variant:x.type==="error"?"danger":"secondary",className:"shrink-0",onClick:()=>{var y;(y=x.action)==null||y.onClick(),d(x.id)},children:x.action.label})]},x.id))})]})}function Ly({tabs:s,activeTab:o,onChange:u,children:c,className:d,ariaLabel:m}){var N;const[p,x]=v.useState(((N=s[0])==null?void 0:N.id)||""),y=o??p;function g(j){o||x(j),u==null||u(j)}return l.jsxs("div",{className:ge("flex flex-col h-full",d),children:[l.jsx("div",{className:"flex border-b shrink-0",style:{borderColor:"var(--color-border)"},role:"tablist","aria-label":m,children:s.map(j=>l.jsxs("button",{type:"button",role:"tab","aria-selected":y===j.id,onClick:()=>g(j.id),className:ge("flex items-center gap-[var(--space-1)] px-[var(--space-3)] py-[var(--space-2)] text-body font-medium transition-colors border-b-2 -mb-px cursor-pointer",y===j.id?"border-[var(--color-primary)]":"border-transparent"),style:{color:y===j.id?"var(--color-primary)":"var(--color-text-secondary)"},children:[j.icon,j.label]},j.id))}),c&&l.jsx("div",{className:"flex-1 overflow-y-auto",children:c(y)})]})}var Uy={default:"var(--color-primary)",active:"var(--color-primary)",warning:"var(--color-warning)",error:"var(--color-danger)",complete:"var(--color-success)",agent:"var(--color-agent)"};function Ou({value:s,max:o=100,label:u,size:c="md",state:d="default",barColor:m,showValue:p,indeterminate:x=!1,className:y}){const g=Math.min(Math.max(s/o*100,0),100),j={xs:"h-1",sm:"h-1.5",md:"h-2"}[c],E=m??Uy[d];return l.jsxs("div",{className:ge("flex flex-col gap-[var(--space-1)]",y),children:[(u||p)&&l.jsxs("div",{className:"flex items-center justify-between",children:[u&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:u}),p&&l.jsxs("span",{className:"text-caption tabular-nums",style:{color:"var(--color-text-secondary)"},children:[Math.round(g),"%"]})]}),l.jsx("div",{className:ge("w-full rounded-full overflow-hidden",j),style:{background:"var(--color-bg-sunken)"},role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":x?void 0:s,"aria-label":u??"Progresso",children:l.jsx("div",{className:ge("rounded-full transition-all duration-300",j,x&&"animate-progress-stripes"),style:{width:x?"100%":`${g}%`,background:d==="complete"&&g>0?"var(--color-success)":E,color:"var(--color-text-primary)"}})})]})}function on({icon:s,title:o,description:u,action:c,className:d}){return l.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-[var(--layout-inline-gap)] px-[var(--empty-state-padding-inline)] py-[var(--empty-state-padding-block)] text-center",d),children:[s&&l.jsx("div",{style:{color:"var(--color-text-secondary)"},children:s}),l.jsx("h3",{className:"text-h2",style:{color:"var(--color-text-primary)"},children:o}),u&&l.jsx("p",{className:"max-w-sm text-body",style:{color:"var(--color-text-secondary)"},children:u}),c]})}var Hy={info:"info",success:"check-circle",warning:"alert-triangle",error:"x-circle"};function By({title:s,children:o,variant:u="info",className:c}){const m={info:"color-info",success:"color-success",warning:"color-warning",error:"color-danger"}[u]??"color-info";return l.jsxs("div",{className:ge("flex gap-[var(--space-2)] p-[var(--space-3)] rounded-[var(--radius-md)] border-[length:var(--border-thin)]",c),style:{background:`color-mix(in srgb, var(--${m}) 12%, transparent)`,borderColor:`color-mix(in srgb, var(--${m}) 35%, transparent)`,color:"var(--color-text-primary)"},children:[l.jsx(C,{name:Hy[u]||"info",width:"var(--icon-md)",height:"var(--icon-md)",className:"shrink-0 mt-0.5",style:{color:`var(--${m})`}}),l.jsxs("div",{className:"text-body",style:{color:"var(--color-text-primary)"},children:[s&&l.jsx("strong",{className:"block font-semibold mb-0.5",children:s}),o]})]})}function qy({title:s,children:o,details:u,onRetry:c,className:d}){const[m,p]=v.useState(!1);return l.jsxs("div",{className:ge("rounded-[var(--radius-md)] border-[length:var(--border-thin)] text-body",d),style:{background:"color-mix(in srgb, var(--color-danger) 10%, transparent)",borderColor:"var(--color-danger)"},role:"alert",children:[l.jsxs("div",{className:"flex items-start gap-[var(--space-2)] p-[var(--space-3)]",children:[l.jsx(C,{name:"x-circle",width:"var(--icon-md)",height:"var(--icon-md)",className:"shrink-0 mt-0.5",style:{color:"var(--color-danger)"}}),l.jsxs("div",{className:"flex-1 min-w-0",style:{color:"var(--color-text-primary)"},children:[s&&l.jsx("strong",{className:"block font-semibold mb-0.5",children:s}),l.jsx("div",{children:o})]}),l.jsxs("div",{className:"flex items-center gap-[var(--space-1)] shrink-0",children:[c&&l.jsx("button",{onClick:c,className:"text-caption font-medium px-[var(--space-2)] py-[var(--space-1)] rounded transition-colors hover:opacity-80",style:{background:"color-mix(in srgb, var(--color-danger) 15%, transparent)",color:"var(--color-danger)"},children:"Tentar novamente"}),u&&l.jsx("button",{onClick:()=>p(!m),className:"text-caption px-[var(--space-1)] py-[var(--space-1)] rounded transition-colors hover:opacity-80",style:{color:"var(--color-text-secondary)"},"aria-label":m?"Recolher detalhes":"Expandir detalhes","aria-expanded":m,children:l.jsx(C,{name:m?"chevron-up":"chevron-down",width:"var(--icon-sm)",height:"var(--icon-sm)"})})]})]}),u&&m&&l.jsx("div",{className:"px-[var(--space-3)] pb-[var(--space-3)] pt-0 text-caption",style:{color:"var(--color-text-secondary)"},children:l.jsx("pre",{className:"p-[var(--space-2)] rounded whitespace-pre-wrap break-words max-h-48 overflow-y-auto",style:{background:"color-mix(in srgb, var(--color-bg-sunken) 50%, transparent)",fontFamily:"var(--font-code)"},children:u})})]})}function Gy({content:s,children:o,position:u="top",className:c}){const[d,m]=v.useState(!1),[p,x]=v.useState(null),y=v.useRef(null);function g(){var j;x(((j=y.current)==null?void 0:j.getBoundingClientRect())??null),m(!0)}function N(){if(!p)return{};const j=8;return u==="right"?{left:p.right+j,top:p.top+p.height/2,transform:"translateY(-50%)"}:u==="left"?{left:p.left-j,top:p.top+p.height/2,transform:"translate(-100%, -50%)"}:u==="bottom"?{left:p.left+p.width/2,top:p.bottom+j,transform:"translateX(-50%)"}:{left:p.left+p.width/2,top:p.top-j,transform:"translate(-50%, -100%)"}}return l.jsxs("div",{ref:y,className:ge("relative inline-flex",c),onMouseEnter:g,onMouseLeave:()=>m(!1),onFocus:g,onBlur:()=>m(!1),children:[o,d&&typeof document<"u"?Up.createPortal(l.jsx("div",{className:ge("fixed z-[var(--z-tooltip)] px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs whitespace-nowrap pointer-events-none"),style:{...N(),background:"var(--foreground)",color:"var(--background)"},role:"tooltip",children:s}),document.body):null]})}function Vy({className:s,orientation:o="horizontal",decorative:u=!0,...c}){return l.jsx("div",{"data-slot":"separator",role:u?void 0:"separator","aria-orientation":o,"aria-hidden":u?!0:void 0,className:ge("shrink-0 border-0 bg-[var(--color-border)]",o==="horizontal"?"h-px w-full":"h-full w-px",s),...c})}function Yy({className:s,invalid:o,disabled:u,...c}){return l.jsx("div",{"data-slot":"field","data-invalid":o?!0:void 0,"data-disabled":u?!0:void 0,className:ge("flex min-w-0 flex-col gap-[var(--space-2)]",s),...c})}function Qy({className:s,...o}){return l.jsx(ts,{"data-slot":"field-label",className:ge("text-[var(--color-text-primary)]",s),...o})}function Xy({className:s,...o}){return l.jsx("p",{"data-slot":"field-description",className:ge("text-xs leading-relaxed text-[var(--color-text-secondary)]",s),...o})}function Zy({className:s,children:o,...u}){return o?l.jsx("p",{"data-slot":"field-error",role:"alert",className:ge("text-xs font-medium leading-relaxed text-[var(--color-danger)]",s),...u,children:o}):null}function Ky({label:s,description:o,error:u,id:c,required:d,disabled:m,...p}){const x=v.useId(),y=c??x,g=o?`${y}-description`:void 0,N=u?`${y}-error`:void 0;return l.jsxs(Yy,{invalid:!!u,disabled:m,children:[l.jsxs(Qy,{htmlFor:y,children:[s,d?l.jsx("span",{"aria-hidden":"true",children:"*"}):null]}),l.jsx(Dt,{id:y,type:"date",required:d,disabled:m,"aria-invalid":!!u,"aria-describedby":[g,N].filter(Boolean).join(" ")||void 0,...p}),o?l.jsx(Xy,{id:g,children:o}):null,l.jsx(Zy,{id:N,children:u})]})}function Jy({children:s,open:o,onOpenChange:u}){const[c,d]=v.useState(!1),m=o!==void 0,p=m?o:c,x=y=>{m||d(y),u==null||u(y)};return l.jsx("div",{className:"relative inline-block",children:typeof s=="function"?s({open:p,setOpen:x}):s})}function $y({className:s,asChild:o,children:u,...c}){return o?l.jsx(l.Fragment,{children:u}):l.jsx("button",{className:ge("inline-flex items-center justify-center gap-[var(--space-1)] rounded-[var(--radius-md)] px-[var(--space-2)] py-[var(--space-1)] text-sm font-medium transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-primary/30",s),type:"button","aria-haspopup":"true",...c,children:u})}function Wy({className:s,align:o="start",sideOffset:u=4,children:c,...d}){const m={start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"};return l.jsx("div",{className:ge("absolute z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-md)] border-[length:var(--border-thin)] bg-card p-[var(--space-2)] shadow-md",m[o],s),style:{top:`calc(100% + ${u}px)`,borderColor:"var(--border)",background:"var(--card)"},role:"menu",...d,children:c})}function Ih({className:s,inset:o,children:u,...c}){return l.jsx("button",{className:ge("relative flex w-full cursor-default select-none items-center gap-[var(--space-2)] rounded-[var(--radius-sm)] px-[var(--space-2)] py-[var(--space-1)] text-sm outline-none transition-colors hover:bg-muted focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-[var(--space-3)]",s),role:"menuitem",type:"button",...c,children:u})}function Fy({className:s,...o}){return l.jsx("div",{className:ge("-mx-1 my-1 h-px bg-border",s),...o})}function Iy({className:s,inset:o,children:u,...c}){return l.jsx("div",{className:ge("px-[var(--space-2)] py-[var(--space-1)] text-xs font-semibold text-muted-foreground",o&&"pl-[var(--space-3)]",s),...c,children:u})}var _u=v.createContext(null);function nr({children:s,open:o,onOpenChange:u}){const[c,d]=v.useState(!1),m=o!==void 0,p=m?o:c,x=v.useCallback(y=>{m||d(y),u==null||u(y)},[m,u]);return l.jsx(_u.Provider,{value:{open:p,setOpen:x},children:typeof s=="function"?s({open:p,setOpen:x}):s})}function sr({className:s,side:o="right",children:u,...c}){const d=v.useContext(_u);if(v.useEffect(()=>{if(!(d!=null&&d.open))return;const p=x=>{x.key==="Escape"&&d.setOpen(!1)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[d]),d&&!d.open)return null;const m={top:"inset-x-0 top-0 border-b",bottom:"inset-x-0 bottom-0 border-t",left:"inset-y-0 left-0 border-r",right:"inset-y-0 right-0 border-l"};return l.jsx("div",{className:"fixed inset-0 z-50 animate-fade-in backdrop-blur-sm",style:{background:"var(--overlay)"},onClick:()=>d==null?void 0:d.setOpen(!1),children:l.jsx("div",{className:ge("fixed flex flex-col shadow-xl max-h-full animate-slide-up",o==="left"||o==="right"?"h-full w-full sm:max-w-lg":"max-h-[85vh] w-full rounded-t-[var(--radius-lg)]",m[o],s),style:{borderColor:"var(--color-border)",background:"var(--color-bg-surface)"},role:"dialog","aria-modal":"true",tabIndex:-1,onClick:p=>p.stopPropagation(),...c,children:u})})}function Ui({className:s,children:o,...u}){return l.jsx("div",{className:ge("flex items-center justify-between border-b px-[var(--space-6)] py-[var(--space-4)]",s),style:{borderColor:"var(--color-border)"},...u,children:o})}function Hi({className:s,children:o,...u}){return l.jsx("h2",{className:ge("text-h2",s),...u,children:o})}function Ru({className:s,children:o,...u}){return l.jsx("p",{className:ge("text-body",s),style:{color:"var(--color-text-secondary)"},children:o})}function tx({className:s,asChild:o,children:u,onClick:c,...d}){const m=v.useContext(_u);return o?l.jsx(l.Fragment,{children:u}):l.jsx("button",{className:ge("inline-flex items-center justify-center rounded-[var(--radius-md)] p-1.5 transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",s),style:{color:"var(--color-text-secondary)"},type:"button",onClick:p=>{m==null||m.setOpen(!1),c==null||c(p)},...d,children:u})}function Lu({className:s,children:o,...u}){return l.jsx("div",{className:ge("flex items-center justify-end gap-[var(--space-3)] border-t px-[var(--space-6)] py-[var(--space-4)]",s),style:{borderColor:"var(--color-border)"},...u,children:o})}var ax=v.createContext(null);function Uu(){const s=v.useContext(ax);if(!s)throw new Error("Select sub-components must be used within <Select>");return s}function hu({children:s,value:o,onValueChange:u,defaultValue:c}){const[d,m]=v.useState(c??""),[p,x]=v.useState(!1),y=o!==void 0,g=y?o:d,N=v.useRef(null),j=v.useCallback(E=>{y||m(E),u==null||u(E),x(!1)},[y,u]);return v.useEffect(()=>{if(!p)return;function E(B){N.current&&!N.current.contains(B.target)&&x(!1)}function M(B){B.key==="Escape"&&x(!1)}return document.addEventListener("mousedown",E),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",M)}},[p]),l.jsx(ax.Provider,{value:{value:g,setValue:j,open:p,setOpen:x,selectedValue:g},children:l.jsx("div",{ref:N,className:"relative",children:typeof s=="function"?s({value:g,setValue:j}):s})})}function pu({className:s,children:o,placeholder:u,...c}){const{open:d,setOpen:m}=Uu();return l.jsxs("button",{className:ge("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-[var(--radius-sm)] border-[length:var(--border-thin)] bg-transparent px-[var(--space-3)] py-[var(--space-2)] text-sm shadow-sm transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] disabled:cursor-not-allowed disabled:opacity-50",s),style:{borderColor:"var(--color-border)"},type:"button",onClick:()=>m(!d),...c,children:[o??(u?l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:u}):null),l.jsx(C,{name:"chevron-down",size:16,className:ge("opacity-50 transition-transform",d&&"rotate-180")})]})}function xu({className:s,position:o="popper",children:u,...c}){const{open:d}=Uu();return d?l.jsx("div",{className:ge("absolute z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-xs)] border-[length:var(--border-thin)] bg-card p-[var(--space-2)] shadow-md mt-1 w-full",s),style:{borderColor:"var(--color-border)",background:"var(--color-bg-surface)"},...c,children:u}):null}function Ps({className:s,value:o,children:u,...c}){const{setValue:d,selectedValue:m}=Uu(),p=m===o;return l.jsx("button",{className:ge("relative flex w-full cursor-default select-none items-center rounded-[var(--radius-xs)] px-[var(--space-2)] py-[var(--space-1)] text-sm outline-none transition-colors duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--color-bg-sunken)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",p&&"bg-[var(--color-primary)]/10",s),style:{color:p?"var(--color-primary)":"var(--color-text-primary)"},type:"button",role:"option","aria-selected":p,onClick:()=>d(o),...c,children:u})}function Ph({className:s,placeholder:o,...u}){return l.jsx("span",{className:ge("text-sm",s),...u,children:u.children??o??""})}function rr(s){return l.jsx(oy,{"data-slot":"collapsible",...s})}function ir(s){return l.jsx(vy,{"data-slot":"collapsible-trigger",...s})}function or(s){return l.jsx(zy,{"data-slot":"collapsible-content",...s})}var Py={default:"border-[var(--color-border)]",warning:"ds-list-item--warning",danger:"ds-list-item--danger",success:"ds-list-item--success",info:"ds-list-item--info"};function rl({tone:s="default",className:o,children:u,...c}){return l.jsx("ul",{className:ge("grid gap-[var(--layout-list-gap)]",s==="surface"&&"rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-base)] p-[var(--layout-list-gap)]",o),...c,children:u})}function il({leading:s,title:o,description:u,meta:c,action:d,tone:m="default",className:p,children:x,...y}){return l.jsxs("li",{className:ge("grid gap-[var(--layout-cluster-gap)] rounded-[var(--radius-sm)] border bg-[var(--color-bg-base)] p-[var(--layout-list-item-padding)]","transition-[background-color,border-color] duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:bg-[var(--surface-hover)]","sm:grid-cols-[auto_minmax(0,1fr)_auto] sm:items-center",Py[m],p),...y,children:[s?l.jsx("div",{className:"flex items-start sm:items-center",children:s}):null,l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-1)]",children:[c?l.jsx("div",{className:"ds-cluster",children:c}):null,l.jsx("div",{className:"min-w-0 break-words text-body-sm font-medium text-[var(--color-text-primary)]",children:o}),u?l.jsx("div",{className:"min-w-0 break-words text-caption text-[var(--color-text-secondary)]",children:u}):null,x]}),d?l.jsx("div",{className:"flex min-w-0 flex-wrap items-center sm:justify-end",children:d}):null]})}v.createContext(null);var lx=v.createContext(null);function e0(){const[s,o]=v.useState(!1);return v.useEffect(()=>{const u=window.matchMedia("(max-width: 767px)"),c=()=>o(u.matches);return c(),u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),s}function t0({defaultOpen:s=!0,open:o,onOpenChange:u,className:c,style:d,children:m,...p}){const x=e0(),[y,g]=v.useState(s),[N,j]=v.useState(!1),E=o!==void 0,M=E?o:y,B=v.useCallback(ee=>{E||g(ee),u==null||u(ee)},[E,u]),J=v.useCallback(()=>{if(x){j(ee=>!ee);return}B(!M)},[x,B,M]),P=v.useMemo(()=>({open:M,setOpen:B,openMobile:N,setOpenMobile:j,isMobile:x,state:M?"expanded":"collapsed",toggleSidebar:J}),[x,N,B,M,J]);return l.jsx(lx.Provider,{value:P,children:l.jsx("div",{"data-sidebar-wrapper":!0,className:ge("group/sidebar-wrapper flex min-h-svh w-full",c),style:{"--sidebar-width":"18rem","--sidebar-width-icon":"3rem",...d},...p,children:m})})}function Aa(){const s=v.useContext(lx);if(!s)throw new Error("useSidebar must be used within SidebarProvider.");return s}function a0({side:s="left",collapsible:o="icon",className:u,children:c,...d}){const{open:m,openMobile:p,setOpenMobile:x,isMobile:y}=Aa();return y?l.jsx(nr,{open:p,onOpenChange:x,children:l.jsx(sr,{side:s,className:"w-[var(--sidebar-width)] max-w-[88vw] p-0",children:l.jsx("div",{className:"flex h-full w-full flex-col bg-[var(--color-sidebar)] text-[var(--color-sidebar-foreground)]",children:c})})}):l.jsx("aside",{"data-sidebar":"sidebar","data-state":m?"expanded":"collapsed","data-collapsible":m?"":o,"data-side":s,className:ge("relative z-[var(--z-sticky)] hidden h-full min-h-svh shrink-0 overflow-visible border-r bg-[var(--color-sidebar)] text-[var(--color-sidebar-foreground)] transition-[width] duration-[var(--motion-base)] ease-[var(--ease-standard)] md:flex md:flex-col",m?"w-[var(--sidebar-width)]":"w-[var(--sidebar-width-icon)]",s==="right"&&"border-l border-r-0",u),style:{borderColor:"var(--app-sidebar-border, var(--color-sidebar-border))"},...d,children:c})}function l0({className:s,...o}){return l.jsx("div",{className:ge("flex shrink-0 items-center gap-2",s),...o})}function n0({className:s,...o}){const{open:u}=Aa();return l.jsx("div",{className:ge("flex min-h-0 flex-1 flex-col overflow-y-auto",u?"p-2":"px-1 py-2",s),...o})}function ep({className:s,...o}){const{open:u}=Aa();return l.jsx("div",{className:ge("grid gap-2 py-2",!u&&"justify-items-center",s),...o})}function tp({className:s,...o}){const{open:u}=Aa();return l.jsx("div",{className:ge("grid gap-1",!u&&"justify-items-center",s),...o})}function ap({className:s,...o}){const{open:u}=Aa();return l.jsx("div",{className:ge("px-2 text-caption font-semibold uppercase text-[var(--color-text-secondary)] transition-[opacity,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)]",!u&&"sr-only",s),...o})}function lp({className:s,...o}){const{open:u}=Aa();return l.jsx("ul",{className:ge("grid gap-1",!u&&"justify-items-center",s),...o})}function np({className:s,...o}){const{open:u}=Aa();return l.jsx("li",{className:ge("min-w-0",!u&&"size-9",s),...o})}function sp({isActive:s,tooltip:o,className:u,children:c,...d}){const{open:m}=Aa(),p=l.jsx("button",{type:"button","data-active":s?"true":void 0,className:ge("group/sidebar-menu-button flex h-9 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 text-left text-sm font-medium text-[var(--color-sidebar-foreground)] transition-[background-color,color,border-color,box-shadow,transform] duration-[var(--motion-fast)] ease-[var(--ease-standard)]","hover:bg-[var(--color-sidebar-accent)] hover:text-[var(--color-sidebar-accent-foreground)] hover:translate-x-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]","active:translate-y-px disabled:pointer-events-none disabled:opacity-50",s&&"bg-[var(--color-sidebar-accent)] text-[var(--color-sidebar-accent-foreground)] border border-[var(--app-sidebar-border,var(--color-sidebar-border))]",!m&&"size-9 justify-center px-0",u),title:m?void 0:o,...d,children:c});return m||!o?p:l.jsx(Gy,{content:o,position:"right",className:"w-full",children:p})}function ll(s){const o=[],u=/(\*\*(.+?)\*\*)|(\*(.+?)\*)|(`(.+?)`)|(\[(.+?)\]\((.+?)\))/g;let c=0,d,m=0;for(;(d=u.exec(s))!==null;)d.index>c&&o.push(s.slice(c,d.index)),d[2]?o.push(l.jsx("strong",{children:d[2]},m++)):d[4]?o.push(l.jsx("em",{children:d[4]},m++)):d[6]?o.push(l.jsx("code",{className:"rounded px-1 py-0.5 text-xs",style:{backgroundColor:"var(--color-bg-surface)",color:"var(--color-text-primary)"},children:d[6]},m++)):d[8]&&d[9]&&o.push(l.jsx("a",{href:d[9],target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2",style:{color:"var(--color-primary)"},children:d[8]},m++)),c=u.lastIndex;return c<s.length&&o.push(s.slice(c)),o}function Rl({content:s,className:o}){var p;const u=s.split(`
|
|
50
|
+
`),c=[];let d=0,m=0;for(;d<u.length;){const x=u[d],y=x.trim();if(y===""){d++;continue}if(y.startsWith("```")){const N=[];for(d++;d<u.length&&!u[d].trim().startsWith("```");)N.push(u[d]),d++;d++,c.push(l.jsx("pre",{className:"overflow-x-auto rounded-[var(--radius-sm)] p-4 text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx("code",{children:N.join(`
|
|
51
|
+
`)})},m++));continue}if(y.startsWith("> ")){const N=[];for(;d<u.length&&u[d].trim().startsWith("> ");)N.push(u[d].trim().slice(2)),d++;c.push(l.jsx("blockquote",{className:"my-2 border-l-2 py-1 pl-4 text-sm",style:{borderColor:"var(--color-primary)",color:"var(--color-text-secondary)"},children:N.map((j,E)=>l.jsxs(v.Fragment,{children:[ll(j),E<N.length-1&&l.jsx("br",{})]},j))},m++));continue}if(y.startsWith("- ")){const N=[];for(;d<u.length&&u[d].trim().startsWith("- ");)N.push(l.jsx("li",{className:"text-sm",children:ll(u[d].trim().slice(2))},N.length)),d++;c.push(l.jsx("ul",{className:"my-2 list-disc space-y-1 pl-5",children:N},m++));continue}if(/^\d+\.\s/.test(y)){const N=[];for(;d<u.length&&/^\d+\.\s/.test(u[d].trim());)N.push(l.jsx("li",{className:"text-sm",children:ll(u[d].trim().replace(/^\d+\.\s/,""))},N.length)),d++;c.push(l.jsx("ol",{className:"my-2 list-decimal space-y-1 pl-5",children:N},m++));continue}if(y.startsWith("|")&&d+1<u.length&&/^\|[\s\-:]+\|/.test(u[d+1].trim())){const N=[];for(;d<u.length&&u[d].trim().startsWith("|");)N.push(u[d].trim()),d++;const j=B=>B.split("|").slice(1,-1).map(J=>J.trim()),E=j(N[0]),M=N.slice(2).map(j);c.push(l.jsx("div",{className:"my-3 overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-sm",style:{color:"var(--color-text-primary)"},children:[l.jsx("thead",{children:l.jsx("tr",{children:E.map(B=>l.jsx("th",{className:"border-b-2 px-3 py-2 text-left font-semibold",style:{borderColor:"var(--border)"},children:ll(B)},B))})}),l.jsx("tbody",{children:M.map((B,J)=>l.jsx("tr",{children:B.map((P,ee)=>l.jsx("td",{className:"border-b px-3 py-1.5",style:{borderColor:"var(--border)"},children:ll(P)},`${P}-${ee}`))},B.join("|")||J))})]})},m++));continue}if(/^-{3,}$/.test(y)){c.push(l.jsx("hr",{className:"my-4",style:{borderColor:"var(--border)"}},m++)),d++;continue}if(/^#{1,3}\s/.test(y)){const N=(p=y.match(/^#+/))==null?void 0:p[0].length,j=y.replace(/^#+\s/,""),E=m++;N===1?c.push(l.jsx("h2",{className:"mb-3 mt-1 text-xl font-bold",children:ll(j)},E)):N===2?c.push(l.jsx("h2",{className:"mb-2 mt-4 text-lg font-semibold",children:ll(j)},E)):c.push(l.jsx("h3",{className:"mb-1 mt-3 text-base font-semibold",children:ll(j)},E)),d++;continue}const g=[x];for(d++;d<u.length&&u[d].trim()!==""&&!u[d].trim().startsWith("#")&&!u[d].trim().startsWith("- ")&&!/^\d+\.\s/.test(u[d].trim())&&!u[d].trim().startsWith("> ")&&!u[d].trim().startsWith("```")&&!u[d].trim().startsWith("|")&&!/^-{3,}$/.test(u[d].trim());)g.push(u[d]),d++;c.push(l.jsx("p",{className:"mb-2 text-sm leading-relaxed",children:ll(g.join(`
|
|
52
|
+
`))},m++))}return l.jsx("div",{className:ge("space-y-0",o),children:c})}function s0({title:s,description:o,progress:u,sections:c,activeSection:d,actions:m}){var y,g;const p=Math.round(u*100),x=d?((y=c.find(N=>N.id===d))==null?void 0:y.label)??d:(g=c[0])==null?void 0:g.label;return l.jsxs("div",{className:"shrink-0 border-b border-border bg-[var(--color-bg-surface)]",children:[l.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between lg:px-6",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] bg-[var(--color-bg-sunken)] text-[var(--color-primary)]",children:l.jsx(C,{name:"file-text",size:16})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"truncate text-base font-semibold text-[var(--color-text-primary)]",children:s}),o?l.jsx("p",{className:"mt-1 line-clamp-2 text-sm leading-snug text-[var(--color-text-secondary)]",children:o}):null,x?l.jsx("p",{className:"mt-2 text-caption font-medium text-[var(--color-primary)]",children:x}):null]})]}),l.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-end",children:[l.jsxs("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:[p,"% lido"]}),m]})]}),l.jsxs("div",{className:"px-4 pb-3 lg:px-6",children:[l.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-[var(--color-border)]",children:l.jsx("div",{className:"h-full rounded-full bg-[var(--color-primary)] transition-[width] duration-[var(--duration-fast)] ease-[var(--ease-standard)]",style:{width:`${p}%`}})}),c.length>0?l.jsxs("div",{className:"mt-2 hidden items-center gap-1 overflow-hidden sm:flex",children:[c.slice(0,8).map(N=>{const j=d===N.id;return l.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-caption text-[var(--color-text-secondary)]",children:[l.jsx("span",{className:j?"size-1.5 shrink-0 rounded-full bg-[var(--color-primary)]":"size-1 shrink-0 rounded-full bg-[var(--color-text-disabled)]"}),l.jsx("span",{className:j?"truncate text-[var(--color-primary)]":"truncate",children:N.label})]},N.id)}),c.length>8?l.jsxs("span",{className:"text-caption text-[var(--color-text-secondary)]",children:["+",c.length-8]}):null]}):null]})]})}function r0(s){const o=s.match(/^##\s+(.+)/gm);return o?o.map(u=>{const c=u.replace(/^##\s+/,"");return{id:c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),label:c}}):[]}function vu({file:s,initialContent:o,onSave:u,title:c,description:d}){const[m,p]=v.useState("read"),[x,y]=v.useState(o),[g,N]=v.useState(!1),j=v.useRef(null),[E,M]=v.useState(0),[B,J]=v.useState(null),P=x!==o,ee=v.useMemo(()=>r0(x),[x]),ue=v.useMemo(()=>ee.map(he=>he.label),[ee]);v.useEffect(()=>{y(o),p("read")},[s,o]),v.useEffect(()=>{const he=j.current;if(!he||m!=="read")return;const te=he;function H(){var Se,z,L;const{scrollTop:pe,scrollHeight:Ee,clientHeight:me}=te,R=Ee-me;M(R>0?Math.min(pe/R,1):0);const re=te.querySelectorAll("h2");let ce=((Se=ee[0])==null?void 0:Se.id)??null;for(const le of re){const ie=((z=le.textContent)==null?void 0:z.trim())??"",D=ue.indexOf(ie);if(D===-1)continue;le.getBoundingClientRect().top-te.getBoundingClientRect().top<200&&(ce=((L=ee[D])==null?void 0:L.id)??null)}J(ce)}return te.addEventListener("scroll",H,{passive:!0}),H(),()=>te.removeEventListener("scroll",H)},[m,ee,ue]);const ve=v.useCallback(async()=>{N(!0);try{await u(x),p("read")}finally{N(!1)}},[x,u]);function Y(){P&&!window.confirm("Descartar alterações não salvas?")||(y(o),p("read"))}const de=v.useCallback(he=>{(he.metaKey||he.ctrlKey)&&he.key==="s"&&(he.preventDefault(),P&&ve())},[ve,P]);return m==="read"?l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsx(s0,{title:c,description:d,progress:E,sections:ee,activeSection:B,actions:l.jsxs(F,{size:"sm",onClick:()=>p("edit"),children:[l.jsx(C,{name:"edit",size:14}),"Editar"]})}),l.jsx("div",{ref:j,className:"flex-1 overflow-y-auto bg-[var(--color-bg-base)] px-4 py-6 sm:px-6 lg:px-8",tabIndex:0,children:l.jsx("div",{className:"mx-auto max-w-3xl rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] px-5 py-5 shadow-sm sm:px-7 sm:py-6",children:l.jsx(Rl,{content:x})})})]}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",onKeyDown:de,children:[l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-[var(--color-bg-surface)] px-4 py-3 lg:px-6",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(C,{name:"edit",size:16,className:"shrink-0 text-[var(--color-primary)]"}),l.jsx("span",{className:"truncate text-sm font-semibold text-[var(--color-text-primary)]",children:c})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:"Edite o Markdown e revise a prévia antes de salvar."})]}),P?l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-[var(--radius-full)] border border-[color-mix(in_oklch,var(--color-warning)_42%,transparent)] px-2 py-1 text-caption font-medium text-[var(--color-warning)]",title:"Alterações não salvas",role:"status","aria-label":"Alterações não salvas",children:[l.jsx("span",{className:"size-1.5 rounded-full bg-[var(--color-warning)]"}),"Alterações não salvas"]}):null,l.jsxs(F,{size:"sm",onClick:ve,loading:g,disabled:!P,children:[l.jsx(C,{name:"check",size:14}),"Salvar"]}),l.jsx(F,{size:"sm",variant:"ghost",onClick:Y,children:"Cancelar"})]}),l.jsxs("div",{className:"relative grid flex-1 grid-cols-1 overflow-y-auto lg:min-h-0 lg:grid-cols-2 lg:overflow-hidden",children:[l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 lg:px-6",children:l.jsx("span",{className:"text-caption font-medium uppercase text-[var(--color-text-secondary)]",children:"Editor"})}),l.jsx(Li,{"aria-label":"Conteúdo Markdown",value:x,onChange:he=>y(he.target.value),className:"min-h-[42svh] flex-1 resize-none rounded-none border-none px-4 py-4 text-sm leading-relaxed outline-none lg:min-h-0 lg:px-6",style:{background:"var(--color-bg-base)",color:"var(--color-text-primary)",fontFamily:"var(--font-code)"},spellCheck:!1})]}),l.jsx("div",{className:"absolute inset-y-0 left-1/2 hidden w-px bg-[var(--color-border)] lg:block"}),l.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex shrink-0 items-center gap-2 border-y border-border px-4 py-2 lg:border-b lg:border-t-0 lg:px-6",children:l.jsx("span",{className:"text-caption font-medium uppercase text-[var(--color-text-secondary)]",children:"Preview"})}),l.jsx("div",{className:"min-h-[42svh] flex-1 overflow-y-auto bg-[var(--surface-1)] px-4 py-4 lg:min-h-0 lg:px-6",children:l.jsx("div",{className:"mx-auto max-w-3xl",children:l.jsx(Rl,{content:x})})})]})]})]})}function i0(s){switch(s){case"success":return{dot:"bg-[var(--color-success)]",line:"bg-[var(--color-success)]"};case"error":return{dot:"bg-[var(--color-danger)]",line:"bg-[var(--color-danger)]"};case"agent":return{dot:"bg-[var(--color-agent)]",line:"bg-[var(--color-agent)]"};case"info":return{dot:"bg-[var(--color-info)]",line:"bg-[var(--color-info)]"};default:return{dot:"bg-[var(--color-text-secondary)]",line:"bg-[var(--color-border)]"}}}function o0({className:s,children:o}){return l.jsx("div",{className:ge("flex flex-col",s),children:o})}function rp({title:s,description:o,timestamp:u,status:c="default",icon:d,action:m,className:p,last:x=!1}){const y=i0(c);return l.jsxs("div",{className:ge("flex gap-[var(--space-3)]",p),children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:ge("mt-1 size-[var(--icon-xs)] shrink-0 rounded-full",y.dot),"aria-hidden":"true"}),!x&&l.jsx("div",{className:ge("w-px flex-1 my-[var(--space-2)]",y.line),"aria-hidden":"true"})]}),l.jsx("div",{className:"min-w-0 flex-1 pb-[var(--space-5)]",children:l.jsxs("div",{className:"flex flex-col gap-[var(--space-3)] sm:flex-row sm:items-start sm:justify-between sm:gap-[var(--space-2)]",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-[var(--space-2)]",children:[d&&l.jsx("span",{className:"shrink-0 size-[var(--icon-md)] flex items-center justify-center",children:d}),l.jsx("span",{className:"min-w-0 text-body font-medium leading-snug",style:{color:"var(--color-text-primary)"},children:s})]}),o&&l.jsx("p",{className:"mt-[var(--space-1)] text-caption leading-relaxed",style:{color:"var(--color-text-secondary)"},children:o})]}),l.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-[var(--space-2)] sm:justify-end",children:[u&&l.jsx("span",{className:"whitespace-nowrap text-caption tabular-nums",style:{color:"var(--color-text-secondary)"},children:u}),m&&l.jsx("div",{className:"shrink-0",children:m})]})]})})]})}function nx({title:s,titleId:o,description:u,left:c,right:d,className:m}){return l.jsxs("header",{className:ge("flex flex-col items-stretch justify-between gap-[var(--layout-cluster-gap)] border-b border-[var(--color-border)] bg-[var(--color-bg-surface)] px-[var(--card-padding)] py-[var(--layout-cluster-gap)] sm:flex-row sm:items-center",m),style:{color:"var(--color-text-primary)"},children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-[var(--layout-cluster-gap)]",children:[c,l.jsxs("div",{className:"flex min-w-0 flex-col",children:[s&&l.jsx("h1",{id:o,className:"text-h2",children:s}),u&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:u})]})]}),l.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-[var(--layout-toolbar-gap)] sm:justify-end",children:d})]})}var su="workspace:",In="scope:",ru="__workspace__";function Pn(s,o,u){return s===1?o:u}function c0({sidebarOpen:s=!0,onToggleSidebar:o,workspaces:u,activeWorkspaceId:c,scopes:d=[],activeScopeId:m=null,onWorkspaceChange:p,onScopeChange:x,pendingDecisions:y=0,health:g,onOpenHealthCenter:N,onOpenSettings:j,theme:E,onThemeChange:M,userSlot:B,className:J}){const P=c===void 0?u[0]:u.find(me=>me.id===c),ee=(P==null?void 0:P.name)??"Escolha um workspace",ue=d.find(me=>me.id===m),ve=(ue==null?void 0:ue.label)??"Todo o workspace",Y=m?`${In}${m}`:`${In}${ru}`,de=y>0,he=!!(g&&g.activeAlerts>0),te=de||he,H=(g==null?void 0:g.activeAlerts)??0,pe=(g==null?void 0:g.criticalAlerts)??0,Ee=E==="dark"?"light":"dark";return l.jsxs("header",{className:ge("app-header-surface grid min-h-16 grid-cols-[auto_minmax(0,1fr)_auto] grid-rows-[auto_auto] items-center gap-x-2 gap-y-2 px-4 py-3 sm:grid-cols-[auto_minmax(0,420px)_minmax(0,1fr)_auto]",J),children:[l.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"col-start-1 row-start-1 size-8 px-0","aria-label":s?"Recolher menu global":"Expandir menu global",title:s?"Recolher menu":"Expandir menu",onClick:o,children:l.jsx(C,{name:"list-three",size:16})}),l.jsxs(hu,{value:Y,onValueChange:me=>{if(me.startsWith(su)){p==null||p(me.slice(su.length));return}if(me.startsWith(In)){const R=me.slice(In.length);x==null||x(R===ru?null:R)}},children:[l.jsx(pu,{"aria-label":`Contexto atual: workspace ${ee}, escopo ${ve}`,className:"col-start-2 row-start-1 min-w-0 max-w-[420px] justify-self-start sm:min-w-[240px]",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(C,{name:"box",size:16}),l.jsx("span",{className:"truncate",children:ee}),l.jsx("span",{className:"text-[var(--color-text-secondary)]",children:"/"}),l.jsx(C,{name:"folder",size:14,className:"text-[var(--color-text-secondary)]"}),l.jsx("span",{className:"truncate text-[var(--color-text-secondary)]",children:ve})]})}),l.jsxs(xu,{className:"min-w-[280px]",children:[l.jsx("div",{className:"px-2 py-1 text-caption font-semibold uppercase text-[var(--color-text-secondary)]",children:"Workspace"}),u.length===0?l.jsx("div",{className:"px-2 py-2 text-sm text-[var(--color-text-secondary)]",children:"Nenhum workspace encontrado"}):u.map(me=>l.jsx(Ps,{value:`${su}${me.id}`,children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(C,{name:(P==null?void 0:P.id)===me.id?"check":"box",size:14}),l.jsx("span",{className:"truncate",children:me.name})]})},me.id)),l.jsx("div",{className:"my-2 border-t border-[var(--color-border)]"}),l.jsx("div",{className:"px-2 py-1 text-caption font-semibold uppercase text-[var(--color-text-secondary)]",children:"Escopo"}),l.jsx(Ps,{value:`${In}${ru}`,children:"Todo o workspace"}),d.map(me=>l.jsx(Ps,{value:`${In}${me.id}`,children:me.label},me.id))]})]}),l.jsx("div",{className:"col-start-1 col-end-4 row-start-2 flex min-w-0 flex-wrap items-center gap-2 sm:col-start-3 sm:col-end-4 sm:row-start-1 sm:justify-self-start",children:te?l.jsxs(F,{type:"button",variant:"secondary",size:"sm","aria-label":`Abrir supervisao: ${y} ${Pn(y,"decisao pendente","decisoes pendentes")}, ${H} ${Pn(H,"sinal ativo","sinais ativos")}, ${pe} ${Pn(pe,"bloqueia conclusao","bloqueiam conclusao")}`,className:"app-status-pill app-status-pill--action whitespace-nowrap",onClick:N,children:[l.jsx(C,{name:"shield",size:14}),l.jsx("span",{children:"Supervisao"}),de?l.jsxs(ke,{variant:"amber",icon:"clock",children:[y," ",Pn(y,"decisao","decisoes")]}):null,he?l.jsxs(ke,{variant:"amber",icon:"octagon-alert",children:[H," ",Pn(H,"sinal","sinais")]}):null,pe>0?l.jsxs(ke,{variant:"error",icon:"circle-x",children:[pe," ",Pn(pe,"bloqueia","bloqueiam")]}):null]}):null}),l.jsxs("div",{className:"col-start-3 row-start-1 flex shrink-0 items-center justify-end gap-2 sm:col-start-4",children:[E&&M?l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:()=>M(Ee),"aria-label":`Alternar para tema ${Ee==="light"?"claro":"escuro"}`,title:`Tema ${Ee==="light"?"claro":"escuro"}`,children:l.jsx(C,{name:E==="dark"?"sun":"moon",size:16})}):null,j?l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:j,"aria-label":"Abrir configurações do workspace",title:"Configurações do workspace",children:l.jsx(C,{name:"settings",size:16})}):null,B]})]})}function u0({sidebar:s,header:o,children:u,sidebarCollapsed:c=!1,className:d,...m}){const p=["app-shell",c?"app-shell--sidebar-collapsed":"",d??""].filter(Boolean).join(" ");return l.jsxs("div",{className:p,...m,children:[l.jsx("div",{className:"app-shell__sidebar",children:s}),l.jsx("div",{className:"app-shell__header",children:o}),l.jsx("div",{className:"app-shell__content",children:u})]})}var d0={default:{backgroundColor:"#282B32",color:"var(--color-text-secondary)",borderColor:"#2E3138"},agent:{backgroundColor:"#22203A",color:"#C4B5FD",borderColor:"#53497C"},success:{backgroundColor:"#1A2B20",color:"#4ADE80",borderColor:"#1C623A"},info:{backgroundColor:"#1C2636",color:"#93C5FD",borderColor:"#36547C"},warning:{backgroundColor:"#1C1808",color:"#FCD34D",borderColor:"#866611"},danger:{backgroundColor:"#2C1A1A",color:"#FCA5A5",borderColor:"#762C2F"}};function Je({variant:s="default",className:o,children:u,style:c,...d}){const m=d0[s];return l.jsx("span",{"data-slot":"tag",className:ge("inline-flex items-center gap-[var(--space-1)] rounded-[var(--radius-full)] border-[length:var(--border-thin)] px-[var(--space-2)] py-[var(--space-1)] text-caption font-medium leading-none",o),style:{...m,...c},...d,children:u})}function f0(s){return s?s.split(/[/\\]/).pop()||s:"Todo o workspace"}function m0({theme:s,onThemeChange:o,gateCount:u=0,activeDirectory:c,workspaces:d,activeWorkspace:m,onWorkspaceChange:p,onDirectoryChange:x,health:y,onOpenHealthCenter:g,onOpenWorkspaceSettings:N}){const{open:j,setOpen:E}=Aa(),M=(m==null?void 0:m.directories)??[];return l.jsx(c0,{sidebarOpen:j,onToggleSidebar:()=>E(!j),workspaces:d.map(B=>({id:B.slug,name:B.name})),activeWorkspaceId:(m==null?void 0:m.slug)??null,scopes:M.map(B=>({id:B,label:f0(B)})),activeScopeId:c??null,onWorkspaceChange:B=>{const J=d.find(P=>P.slug===B);J&&(p==null||p(J))},onScopeChange:x,pendingDecisions:u,health:y,onOpenHealthCenter:g,onOpenSettings:m?N:void 0,theme:s,onThemeChange:o})}function h0({size:s=64}){return l.jsxs("svg",{width:s,height:s,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Letra L",role:"img",children:[l.jsx("circle",{cx:"16",cy:"10",r:"6",fill:"var(--color-primary)"}),l.jsx("path",{d:"M16 10V50H38",stroke:"var(--color-primary)",strokeWidth:"8",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("circle",{cx:"16",cy:"30",r:"7",fill:"var(--color-primary-pressed)"}),l.jsx("circle",{cx:"16",cy:"50",r:"6",fill:"var(--color-primary)"}),l.jsx("circle",{cx:"44",cy:"50",r:"6",fill:"var(--color-primary)"}),l.jsx("circle",{cx:"57",cy:"50",r:"6",fill:"var(--color-text-primary)",opacity:"0.9"})]})}const p0=[{id:"supervision",label:"Supervisão",icon:"shield",color:"var(--color-info)"},{id:"work",label:"Trabalho",icon:"grid",color:"var(--color-primary)"},{id:"knowledge",label:"Conhecimento e Regras",icon:"book",color:"var(--color-agent)"},{id:"activity",label:"Atividade",icon:"activity",color:"var(--color-success)"}],x0=[{id:"settings",label:"Workspace",icon:"settings",color:"var(--color-text-secondary)"}];function v0({activeTab:s,onTabChange:o,workspaceActive:u,onOpenWorkspaceSettings:c}){const{open:d,isMobile:m,setOpenMobile:p}=Aa();return l.jsxs(a0,{collapsible:"icon",side:"left",children:[l.jsx(l0,{className:d?"flex flex-row items-center border-b px-4":"flex flex-row items-center justify-center border-b px-0",style:{borderColor:"var(--app-sidebar-border, var(--color-border))",height:"64px"},children:l.jsxs("div",{className:d?"flex min-w-0 items-center gap-2":"flex min-w-0 items-center justify-center",children:[l.jsx(h0,{size:28}),l.jsx("span",{"data-sidebar-label":"brand",className:d?"truncate text-sm font-semibold text-[var(--color-text-primary)]":"sr-only",children:"Letra"})]})}),l.jsxs(n0,{children:[l.jsxs(ep,{children:[l.jsx(ap,{children:"Navegação"}),l.jsx(tp,{children:l.jsx(lp,{children:p0.map(x=>l.jsx(np,{children:l.jsxs(sp,{"aria-label":x.label,isActive:s===x.id,disabled:!u,onClick:()=>{x.id==="settings"?c==null||c():o(x.id),m&&p(!1)},tooltip:x.label,children:[l.jsx(C,{name:x.icon,size:16,className:"transition-transform duration-[var(--motion-fast)] group-hover/sidebar-menu-button:scale-110",style:{color:x.color}}),l.jsx("span",{"data-sidebar-label":x.id,className:d?"truncate":"sr-only",children:x.label})]})},x.id))})})]}),l.jsx(Vy,{}),l.jsxs(ep,{children:[l.jsx(ap,{children:"Configuração"}),l.jsx(tp,{children:l.jsx(lp,{children:x0.map(x=>l.jsx(np,{children:l.jsxs(sp,{"aria-label":x.label,isActive:s===x.id,disabled:!u,onClick:()=>{c==null||c(),m&&p(!1)},tooltip:x.label,children:[l.jsx(C,{name:x.icon,size:16,className:"transition-transform duration-[var(--motion-fast)] group-hover/sidebar-menu-button:scale-110",style:{color:x.color}}),l.jsx("span",{"data-sidebar-label":x.id,className:d?"truncate":"sr-only",children:x.label})]})},x.id))})})]})]})]})}function xt(...s){return Lp(jp(s))}const iu=[{id:"opencode",label:"OpenCode"},{id:"cursor",label:"Cursor"},{id:"claude-code",label:"Claude Code"},{id:"windsurf",label:"Windsurf"},{id:"hermes",label:"Hermes"},{id:"vscode",label:"VS Code"},{id:"copilot",label:"Copilot"}],g0=[{path:"C:/Workspace",label:"C:/Workspace"},{path:"C:/Dev",label:"C:/Dev"},{path:"C:/Projects",label:"C:/Projects"},{path:"C:/Users",label:"C:/Users"},{path:"D:/",label:"D:/"}],ip={opencode:s=>`Você é um arquiteto de software especializado em configurar o Letra (framework SDD — Specification-Driven Development) para novos workspaces.
|
|
53
|
+
|
|
54
|
+
## Missão
|
|
55
|
+
Analise profundamente o workspace em **${s.workspacePath}** e seus diretórios monitorados (${s.dirs.join(", ")}) para gerar o harness completo do Letra - conjunto de arquivos de contexto que descrevem a arquitetura, decisões, glossário e fluxo de trabalho.
|
|
56
|
+
|
|
57
|
+
## Passos
|
|
58
|
+
|
|
59
|
+
### 1. Explorar o Workspace
|
|
60
|
+
- Varra todos os diretórios listados acima
|
|
61
|
+
- Identifique a stack principal (linguagem, framework, runtime, banco de dados)
|
|
62
|
+
- Detecte padrões de arquitetura (MVC, hexagonal, microsserviços, monólito, etc.)
|
|
63
|
+
- Mapeie a estrutura de diretórios e o propósito de cada módulo/pasta
|
|
64
|
+
- Identifique convenções de código (ESLint, Prettier, tsconfig, Dockerfile, CI/CD)
|
|
65
|
+
- Verifique se há package.json, Cargo.toml, pyproject.toml, Gemfile, go.mod, etc.
|
|
66
|
+
- Analise testes existentes (framework de teste, cobertura, padrões)
|
|
67
|
+
|
|
68
|
+
### 2. Gerar Constitution (${s.workspacePath}/.letra/constitution.md)
|
|
69
|
+
Regras não-negociáveis do workspace:
|
|
70
|
+
- Stack e versões obrigatórias
|
|
71
|
+
- Padrões de arquitetura que devem ser seguidos
|
|
72
|
+
- Convenções de código (naming, organização de imports, testes)
|
|
73
|
+
- Regras de segurança (nunca expor secrets, validação de input, etc.)
|
|
74
|
+
- Práticas de CI/CD e deploy
|
|
75
|
+
- Como as specs devem ser escritas (thin specs, formato)
|
|
76
|
+
|
|
77
|
+
### 3. Gerar Context (${s.workspacePath}/.letra/context.md)
|
|
78
|
+
Visão geral do workspace:
|
|
79
|
+
- Intent: propósito do workspace "${s.name}" — ${s.description}
|
|
80
|
+
- Domínio: problema de negócio que o workspace resolve
|
|
81
|
+
- Stack técnica completa (linguagem, frameworks, banco, infra)
|
|
82
|
+
- Restrições reais (prazos, equipe, limitações técnicas)
|
|
83
|
+
- Decisões arquiteturais importantes (com links para ADRs)
|
|
84
|
+
- Glossário de termos específicos do domínio
|
|
85
|
+
|
|
86
|
+
### 4. Gerar Glossary (${s.workspacePath}/.letra/glossary.md)
|
|
87
|
+
- Termos técnicos e de domínio mapeados
|
|
88
|
+
- Abreviações e siglas usadas no projeto
|
|
89
|
+
- Nomes de módulos, pacotes e suas responsabilidades
|
|
90
|
+
|
|
91
|
+
### 5. Configurar Fluxo SDLC
|
|
92
|
+
- Crie ${s.workspacePath}/.letra/workflow.json com os estágios:
|
|
93
|
+
- Backlog (todo)
|
|
94
|
+
- Spec Draft (doing)
|
|
95
|
+
- Spec Review (doing)
|
|
96
|
+
- Code (doing)
|
|
97
|
+
- Code Review (doing)
|
|
98
|
+
- Ready to PR (doing)
|
|
99
|
+
- Done (done)
|
|
100
|
+
- Para cada item existente no backlog, crie entries no workflow
|
|
101
|
+
|
|
102
|
+
### 6. Gerar Spec Inicial
|
|
103
|
+
- ${s.workspacePath}/.letra/specs/_template/spec.md — template de spec
|
|
104
|
+
- ${s.workspacePath}/.letra/specs/README.md — guia do diretório de specs
|
|
105
|
+
|
|
106
|
+
### 7. Adaptadores
|
|
107
|
+
Configure os adaptadores para: ${s.dirs.join(", ")}
|
|
108
|
+
- AGENTS.md (formato OpenCode)
|
|
109
|
+
- .cursorrules (formato Cursor)
|
|
110
|
+
- CLAUDE.md (formato Claude Code)
|
|
111
|
+
- .windsurfrules (formato Windsurf)
|
|
112
|
+
- .opencode/instructions.md (formato OpenCode)
|
|
113
|
+
- .github/copilot-instructions.md (formato GitHub Copilot)
|
|
114
|
+
|
|
115
|
+
Cada adaptador deve conter:
|
|
116
|
+
- Seção de contexto com os diretórios monitorados
|
|
117
|
+
- Comandos disponíveis (pulse, sitrep, flow move, health)
|
|
118
|
+
- Seção de item ativo (se houver)
|
|
119
|
+
- Regras de handoff entre agentes
|
|
120
|
+
|
|
121
|
+
## Formato de Saída
|
|
122
|
+
Gere todos os arquivos dentro de ${s.workspacePath}/.letra/. Retorne um resumo do que foi criado.`,cursor:s=>`You are an expert software architect configuring the Letra framework (SDD — Specification-Driven Development) for a workspace.
|
|
123
|
+
|
|
124
|
+
## Mission
|
|
125
|
+
Deeply analyze the workspace at **${s.workspacePath}** and its monitored directories (${s.dirs.join(", ")}) to generate the complete Letra harness.
|
|
126
|
+
|
|
127
|
+
## Steps
|
|
128
|
+
|
|
129
|
+
### 1. Explore the Workspace
|
|
130
|
+
- Walk all listed directories
|
|
131
|
+
- Identify the main stack (language, framework, runtime, database)
|
|
132
|
+
- Detect architecture patterns (MVC, hexagonal, microservices, monolith, etc.)
|
|
133
|
+
- Map directory structure and each module's purpose
|
|
134
|
+
- Identify code conventions (linting, formatting, tsconfig, Dockerfile, CI/CD)
|
|
135
|
+
- Check for package.json, Cargo.toml, pyproject.toml, etc.
|
|
136
|
+
- Analyze existing tests (framework, coverage, patterns)
|
|
137
|
+
|
|
138
|
+
### 2. Generate Constitution
|
|
139
|
+
Non-negotiable workspace rules in ${s.workspacePath}/.letra/constitution.md
|
|
140
|
+
|
|
141
|
+
### 3. Generate Context
|
|
142
|
+
Workspace overview in ${s.workspacePath}/.letra/context.md including intent, domain, tech stack, constraints, architectural decisions.
|
|
143
|
+
|
|
144
|
+
### 4. Generate Glossary
|
|
145
|
+
Technical and domain terms in ${s.workspacePath}/.letra/glossary.md
|
|
146
|
+
|
|
147
|
+
### 5. Configure SDLC Flow
|
|
148
|
+
Workflow with stages: Backlog, Spec Draft, Spec Review, Code, Code Review, Ready to PR, Done.
|
|
149
|
+
|
|
150
|
+
### 6. Generate Spec Template
|
|
151
|
+
- ${s.workspacePath}/.letra/specs/_template/spec.md
|
|
152
|
+
- ${s.workspacePath}/.letra/specs/README.md
|
|
153
|
+
|
|
154
|
+
### 7. Configure .cursorrules
|
|
155
|
+
Generate .cursorrules with context, available commands, active item section, and handoff rules.
|
|
156
|
+
|
|
157
|
+
Return a summary of everything created.`,"claude-code":s=>`You are configuring the Letra SDD framework for "${s.name}" at ${s.workspacePath}. Deeply analyze the workspace (${s.dirs.join(", ")}) — explore its stack, architecture, code conventions, and test patterns — then generate the complete Letra harness:
|
|
158
|
+
|
|
159
|
+
1. **${s.workspacePath}/.letra/constitution.md** — architecture rules, code conventions, security policies
|
|
160
|
+
2. **${s.workspacePath}/.letra/context.md** — workspace intent, domain, tech stack, constraints, decisions
|
|
161
|
+
3. **${s.workspacePath}/.letra/glossary.md** — domain and technical terms
|
|
162
|
+
4. **${s.workspacePath}/.letra/workflow.json** — SDLC stages
|
|
163
|
+
5. **${s.workspacePath}/.letra/specs/** — template and README
|
|
164
|
+
6. **CLAUDE.md** — Claude Code adapter with workspace context, available commands, active items, and handoff rules
|
|
165
|
+
|
|
166
|
+
For each file, reflect the actual project patterns you discover during exploration. The harness must match the real project profile.`,windsurf:s=>`Configure the Letra SDD framework for "${s.name}" at ${s.workspacePath}. Explore the codebase in ${s.dirs.join(", ")}, identify stack, architecture, patterns, and generate the full Letra harness:
|
|
167
|
+
|
|
168
|
+
- .letra/constitution.md — rules and conventions
|
|
169
|
+
- .letra/context.md — workspace overview and decisions
|
|
170
|
+
- .letra/glossary.md — terms
|
|
171
|
+
- .letra/workflow.json — SDLC pipeline
|
|
172
|
+
- .letra/specs/ — spec template
|
|
173
|
+
- .windsurfrules — Windsurf adapter with workspace context, commands, and handoff
|
|
174
|
+
|
|
175
|
+
Base every file on real project analysis, not generic templates.`,hermes:s=>`Configure Letra for "${s.name}" at ${s.workspacePath}. Analyze ${s.dirs.join(", ")} deeply — stack, architecture, code style, tests — then generate:
|
|
176
|
+
|
|
177
|
+
- .letra/constitution.md, context.md, glossary.md
|
|
178
|
+
- .letra/workflow.json with SDLC stages
|
|
179
|
+
- .letra/specs/ template
|
|
180
|
+
- .hermes/instructions.md with workspace context, commands, and handoff rules
|
|
181
|
+
|
|
182
|
+
Tailor every file to the actual project profile found during exploration.`,vscode:s=>`Configure Letra SDD for "${s.name}" at ${s.workspacePath}. Explore ${s.dirs.join(", ")}, detect tech stack, architecture, and conventions, then generate:
|
|
183
|
+
|
|
184
|
+
- .letra/constitution.md, context.md, glossary.md
|
|
185
|
+
- .letra/workflow.json
|
|
186
|
+
- .letra/specs/ template
|
|
187
|
+
- .vscode/settings.json with recommended extensions for the detected stack
|
|
188
|
+
- .vscode/copilot-instructions.md with workspace context
|
|
189
|
+
|
|
190
|
+
All files must reflect real project analysis, not generic templates.`,copilot:s=>`Analyze the workspace "${s.name}" at ${s.workspacePath}. Walk directories ${s.dirs.join(", ")}, identify stack, architecture, patterns, and configure Letra:
|
|
191
|
+
|
|
192
|
+
- .letra/constitution.md — workspace rules
|
|
193
|
+
- .letra/context.md — intent, domain, stack, constraints
|
|
194
|
+
- .letra/glossary.md — terms
|
|
195
|
+
- .letra/workflow.json — SDLC stages
|
|
196
|
+
- .letra/specs/ — spec template
|
|
197
|
+
- .github/copilot-instructions.md — Copilot adapter with full workspace context
|
|
198
|
+
|
|
199
|
+
Infer everything from actual codebase analysis.`};function b0({onComplete:s}){var xe;const[o,u]=v.useState("name"),c=["name","directories","template","review"],d={name:"Nome",directories:"Diretórios",template:"Template",review:"Revisão",done:"Concluído"},m=c.indexOf(o),[p,x]=v.useState(""),[y,g]=v.useState(""),[N,j]=v.useState(""),E=p.trim().length>0,M=y.trim().length>=10,B=N.trim().length>0,J=E&&M&&B,P=v.useRef(null),[ee,ue]=v.useState([]),[ve,Y]=v.useState(""),[de,he]=v.useState([]),[te,H]=v.useState(g0.map(q=>({name:q.label,path:q.path,expanded:!1,loading:!1,children:[]}))),pe=[...ee,...de],Ee=pe.length>=1;function me(q){ue(we=>we.includes(q)?we.filter(Oe=>Oe!==q):[...we,q])}function R(){const q=ve.trim();q&&!de.includes(q)&&!pe.includes(q)&&(he([...de,q]),Y(""))}function re(q){he(de.filter(we=>we!==q))}function ce(q){const we=q.target.files;if(we&&we.length>0){const Oe=we[0].webkitRelativePath;Oe&&j(Oe.split("/")[0])}}async function Se(q){if(q.expanded){q.expanded=!1,H([...te]);return}if(q.children.length===0&&!q.loading){q.loading=!0,H([...te]);try{const Oe=await(await fetch(`/api/fs/dirs?path=${encodeURIComponent(q.path)}`)).json();q.children=(Oe.dirs||[]).map(kt=>({name:kt.name,path:kt.path,expanded:!1,loading:!1,children:[]}))}catch{}q.loading=!1}q.expanded=!0,H([...te])}const[z,L]=v.useState(["opencode"]),le=z.length>=1;function ie(q){L(we=>we.includes(q)?we.filter(Oe=>Oe!==q):[...we,q])}const[D,b]=v.useState(!1),[A,$]=v.useState(""),[I,fe]=v.useState(""),[V,T]=v.useState(null);async function Q(){b(!0),$("");const q={tools:z,name:p.trim(),description:y.trim(),workspacePath:N.trim(),directories:pe,template:"padrao"};try{const Oe=await(await fetch("/api/workflow/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)})).json();if(b(!1),Oe&&!Oe.error){T(Oe);const kt=z[0],ht=ip[kt]||ip.opencode;fe(ht({dirs:pe,name:p.trim(),description:y.trim(),workspacePath:N.trim()})),u("done")}else $((Oe==null?void 0:Oe.error)||"Erro desconhecido ao criar workspace")}catch{b(!1),$("Erro de conexão com o servidor")}}function oe(){const q=c.indexOf(o);q<c.length-1&&u(c[q+1])}function De(){const q=c.indexOf(o);q>0&&u(c[q-1])}function ne(q,we=0){return q.map(Oe=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1",style:{paddingLeft:we*16},children:[l.jsx(F,{onClick:()=>Se(Oe),className:"flex items-center justify-center w-5 h-5 rounded hover:bg-primary/10 transition-colors shrink-0","aria-label":Oe.expanded?"Recolher":"Expandir",children:Oe.loading?l.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-primary border-t-transparent animate-spin"}):l.jsx(C,{name:"chevron-right",size:12,className:xt("transition-transform",Oe.expanded&&"rotate-90"),style:Oe.children.length===0?{opacity:.3}:void 0})}),l.jsxs("label",{className:"flex items-center gap-2 flex-1 py-1 rounded cursor-pointer hover:bg-primary/5 px-1",children:[l.jsx(as,{checked:ee.includes(Oe.path),onChange:()=>me(Oe.path)}),l.jsx(C,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{className:"text-sm truncate",children:Oe.name}),l.jsx("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--color-text-secondary)"},children:Oe.path})]})]}),Oe.expanded&&Oe.children.length>0&&ne(Oe.children,we+1)]},Oe.path))}const be="transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] disabled:opacity-40 disabled:hover:scale-100";return l.jsx("div",{className:"h-full overflow-y-auto p-6",children:l.jsxs("div",{className:"max-w-2xl mx-auto flex flex-col gap-6",children:[o!=="done"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-center justify-center gap-0",children:c.map((q,we)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx(F,{onClick:()=>{we<m&&u(q)},disabled:we>m,className:xt("w-8 h-8 rounded-full text-xs font-medium flex items-center justify-center transition-all",we===m&&"ring-2 ring-primary/30",we<m&&"cursor-pointer"),style:{background:we<m?"var(--color-success)":we===m?"var(--color-primary)":"var(--color-bg-surface)",color:we<m?"var(--color-success)":we===m?"var(--color-primary)":"var(--color-text-secondary)"},"aria-label":`Passo ${we+1}: ${d[q]}${we<m?" (concluído)":""}`,children:we<m?l.jsx(C,{name:"check",size:14}):we+1}),we<c.length-1&&l.jsx("div",{className:"w-8 h-0.5 mx-1",style:{background:we<m?"var(--color-success)":"var(--color-border)"}})]},q))}),l.jsx("div",{className:"flex justify-center gap-0 text-xs -mt-4",style:{color:"var(--color-text-secondary)"},children:c.map((q,we)=>l.jsxs("div",{className:"flex items-center",children:[l.jsx("span",{className:xt("px-1",we===m&&"font-semibold text-primary"),children:d[q]}),we<c.length-1&&l.jsx("span",{className:"w-8"})]},q))})]}),o==="name"&&l.jsxs("div",{className:"flex flex-col items-center text-center gap-6 pt-8 animate-fade-in",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-[var(--radius-lg)] bg-primary/10",children:l.jsx(C,{name:"grid",size:24,className:"text-primary"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Configurar Workspace"}),l.jsx("p",{className:"text-muted-foreground text-base max-w-md",children:"Defina o nome, descrição e local do workspace."})]}),l.jsxs("div",{className:"w-full max-w-sm flex flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Nome do workspace ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(Dt,{placeholder:"Ex: Meu Projeto",value:p,onChange:q=>x(q.target.value)})]}),l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Descrição ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(Li,{className:"w-full px-3 py-2 rounded-[var(--radius-sm)] border text-sm resize-none",rows:3,placeholder:"Descreva o propósito do workspace (mín. 10 caracteres)",value:y,onChange:q=>g(q.target.value),style:{borderColor:"var(--color-border)",background:"var(--color-bg-base)",color:"var(--color-text-primary)"}}),y.length>0&&!M&&l.jsxs("span",{className:"text-xs text-red-500",children:["Faltam ",10-y.trim().length," caracteres"]})]}),l.jsxs("div",{className:"flex flex-col gap-1.5 text-left",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Caminho do workspace ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Dt,{placeholder:"Ex: C:/MeusProjetos/meu-app",value:N,onChange:q=>j(q.target.value),className:"flex-1 font-mono text-xs"}),l.jsx(Dt,{ref:P,type:"file",webkitdirectory:"",style:{display:"none"},onChange:ce}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>{var q;return(q=P.current)==null?void 0:q.click()},children:l.jsx(C,{name:"search",size:14})})]}),l.jsxs("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:["Onde o ",l.jsx("code",{children:".letra/"})," será criado"]})]}),l.jsx(F,{className:be,disabled:!J,onClick:oe,children:"Próximo"})]})]}),o==="directories"&&l.jsxs("div",{className:"flex flex-col gap-4 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Diretórios do Projeto"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Navegue e selecione os diretórios que o Letra deve monitorar."})]}),l.jsx("div",{className:"rounded-[var(--radius-md)] border p-2 max-h-64 overflow-y-auto",style:{borderColor:"var(--color-border)"},children:ne(te)}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Adicionar outro diretório"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Dt,{placeholder:"Ex: D:/Projects",value:ve,onChange:q=>Y(q.target.value),onKeyDown:q=>{q.key==="Enter"&&R()},className:"flex-1 font-mono text-xs"}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:R,disabled:!ve.trim(),children:[l.jsx(C,{name:"plus",size:14,className:"mr-1"})," Adicionar"]})]}),de.length>0&&l.jsx("div",{className:"flex flex-col gap-1 mt-1",children:de.map(q=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-[var(--radius-sm)] border text-sm font-mono",style:{borderColor:"var(--color-border)"},children:[l.jsx(C,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{className:"flex-1",children:q}),l.jsx(F,{onClick:()=>re(q),className:"w-6 h-6 rounded hover:bg-red-500/10 hover:text-red-500",style:{color:"var(--color-text-secondary)"},"aria-label":`Remover ${q}`,children:l.jsx(C,{name:"x",size:12})})]},q))})]}),!Ee&&l.jsx("p",{className:"text-xs text-red-500",children:"Selecione ou adicione pelo menos 1 diretório"}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:De,children:"Voltar"}),l.jsx(F,{disabled:!Ee,onClick:oe,className:be,children:"Próximo"})]})]}),o==="template"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Template e Ferramentas"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Escolha o template de fluxo e as ferramentas agênticas."})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Template de fluxo"}),l.jsx("div",{className:"rounded-[var(--radius-md)] border border-primary bg-primary/5 ring-2 ring-primary/20 p-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(C,{name:"flow",size:16,className:"text-primary"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-semibold",children:"SDLC — Desenvolvimento de Software"}),l.jsx(ke,{variant:"info",children:"5 estágios"})]}),l.jsx("p",{className:"text-sm mt-0.5",style:{color:"var(--color-text-secondary)"},children:"Fluxo completo: Backlog, Design, Code, Review, Done"}),l.jsx("div",{className:"flex gap-1.5 mt-2 flex-wrap",children:["Backlog","Design","Code","Review","Done"].map(q=>l.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full border border-amber-500/30 text-amber-600 dark:text-amber-400 bg-amber-500/10",children:q},q))})]})]})})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Ferramentas agênticas"}),z.length>0&&l.jsxs(ke,{variant:"info",children:[z.length," selecionada",z.length>1?"s":""]})]}),l.jsx("div",{className:"grid grid-cols-2 gap-3",children:iu.map((q,we)=>l.jsxs("label",{className:xt("flex items-center gap-3 p-4 rounded-[var(--radius-md)] border transition-all duration-200 cursor-pointer hover:scale-[1.02] hover:shadow-sm",z.includes(q.id)?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/50"),style:{animation:`fade-in 0.2s ease-out ${we*40}ms both`},children:[l.jsx(as,{checked:z.includes(q.id),onChange:()=>ie(q.id)}),l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary/10 flex items-center justify-center shrink-0",children:l.jsx(C,{name:"code",size:16,className:"text-primary"})}),l.jsx("span",{className:"font-medium",children:q.label})]},q.id))}),!le&&l.jsx("p",{className:"text-xs text-red-500 mt-2",children:"Selecione pelo menos 1 ferramenta"})]}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:De,children:"Voltar"}),l.jsx(F,{disabled:!le,onClick:oe,className:be,children:"Revisar"})]})]}),o==="review"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold",children:"Revisar Configuração"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:"Confira os dados antes de finalizar."})]}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Workspace"}),l.jsxs("div",{className:"text-sm space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Nome:"})," ",l.jsx("span",{className:"font-medium",children:p})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Descrição:"})," ",y]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--color-text-secondary)"},children:"Caminho:"})," ",l.jsx("span",{className:"font-mono text-xs",children:N})]})]})]}),l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Diretórios monitorados"}),pe.map(q=>l.jsxs("div",{className:"flex items-center gap-2 text-sm font-mono",children:[l.jsx(C,{name:"folder",size:14,className:"text-primary shrink-0"}),l.jsx("span",{children:q})]},q))]}),l.jsxs("div",{className:"p-4 rounded-[var(--radius-md)]",style:{background:"var(--color-bg-surface)"},children:[l.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Template e Ferramentas"}),l.jsx("div",{className:"text-sm",children:"SDLC — Desenvolvimento de Software"}),l.jsx("div",{className:"flex gap-2 flex-wrap mt-2",children:z.map(q=>{const we=iu.find(Oe=>Oe.id===q);return we?l.jsx(ke,{variant:"info",children:we.label},q):null})})]})]}),A&&l.jsxs("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm text-red-500",style:{background:"var(--surface-1)",border:"1px solid var(--color-border)"},children:[l.jsx(C,{name:"alert-triangle",size:14,className:"inline mr-1"}),A]}),l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsx(F,{variant:"ghost",onClick:De,children:"Voltar"}),l.jsx(F,{disabled:D,onClick:Q,className:be,children:D?l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-white border-t-transparent animate-spin"}),"Criando..."]}):"Finalizar"})]})]}),o==="done"&&l.jsxs("div",{className:"flex flex-col gap-6 pt-4 animate-fade-in",children:[l.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-[var(--radius-lg)] bg-success/20",children:l.jsx(C,{name:"check-circle",size:24,className:"text-success"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold",children:"Workspace criado!"}),l.jsxs("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:["O workspace ",l.jsx("strong",{children:p})," foi registrado."]}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Agora cole o prompt abaixo na sua ferramenta agêntica para gerar o harness Letra completo."})]}),V?l.jsx(F,{onClick:()=>s(V),className:"mt-2",children:"Abrir workspace"}):null]}),I&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border",style:{borderColor:"var(--color-border)",background:"var(--surface-1)"},children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 p-4 border-b",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C,{name:"code",size:16,className:"text-primary"}),l.jsxs("h3",{className:"text-sm font-semibold",children:["Prompt para"," ",((xe=iu.find(q=>q.id===z[0]))==null?void 0:xe.label)||z[0]]})]}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>navigator.clipboard.writeText(I),children:[l.jsx(C,{name:"copy",size:14,className:"mr-1"}),"Copiar"]})]}),l.jsxs("div",{className:"p-4",children:[l.jsx("p",{className:"text-xs mb-3",style:{color:"var(--color-text-secondary)"},children:"Este prompt instrui o agente a analisar profundamente o projeto e configurar o harness Letra."}),l.jsx("pre",{className:"text-xs p-4 rounded-[var(--radius-sm)] whitespace-pre-wrap font-code leading-relaxed",style:{background:"var(--color-bg-surface)",color:"var(--color-text-primary)",border:"1px solid var(--color-border)",maxHeight:"50vh",overflowY:"auto"},children:I})]})]})]})]})})}function oa(s,o){var u;return(u=o==null?void 0:o.stages)!=null&&u.length?[...o.stages].sort((c,d)=>c.order-d.order):s.stages.map(c=>({id:c.id,name:c.name,order:c.order,zone:c.zone,description:void 0,roleIds:[],roles:[],agents:[],gate:null,provenance:"workflow-instance"})).sort((c,d)=>c.order-d.order)}function cr(s,o){return new Set(oa(s,o).filter(u=>{var c;return((c=u.gate)==null?void 0:c.type)==="human"&&u.gate.blocking}).map(u=>u.id))}function sx(s,o){return new Set(oa(s,o).filter((u,c,d)=>u.zone==="done"||!u.zone&&c===d.length-1).map(u=>u.id))}function y0(s,o,u){const c=oa(o,u),d=c.findIndex(m=>m.id===s);return d<0||d>=c.length-1?null:c[d+1].id}function op(s,o,u){var d;const c=oa(o,u).find(m=>m.id===s);return c?((d=c.gate)==null?void 0:d.type)==="human"?"Human":c.roles[0]?c.roles[0].label:c.roleIds[0]?c.roleIds[0]:c.name:"Agent"}function Bi(s){var o;return((o=s.gate)==null?void 0:o.type)==="human"?`Aguardando ${s.gate.name.toLowerCase()}`:s.zone==="done"?"Concluído":s.description?s.description:`Processando em ${s.name}`}function j0(s){var o;return s.zone==="done"?"check":((o=s.gate)==null?void 0:o.type)==="human"?"user":s.gate?"shield":s.roles.length>0||s.roleIds.length>0?"cpu":"circle"}function Hu(s){var d,m,p;const o=((d=s.gate)==null?void 0:d.type)==="human"&&s.gate.blocking,u=!!((m=s.gate)!=null&&m.blocking);return{actorLabel:o?"Human":((p=s.roles[0])==null?void 0:p.label)??s.roleIds[0]??s.name,actionLabel:Bi(s),icon:j0(s),color:s.zone==="done"?"var(--success)":o?"var(--gate-available)":u?"var(--gate-blocked)":"var(--primary)",isHumanGate:o,isBlockingGate:u}}function La(s,o,u){var d,m;const c=oa(o,u).find(p=>p.id===s.stage);return c?c.zone==="done"?"done":((d=c.gate)==null?void 0:d.type)==="human"&&c.gate.blocking?"waiting":(m=c.gate)!=null&&m.blocking?"blocked":s.claimedBy?"running":"idle":s.claimedBy?"running":"idle"}function N0(s,o){return oa(s,o).map(u=>{const c=s.items.filter(p=>p.stage===u.id),d=c.map(p=>La(p,s,o)),m=d.includes("waiting")?"waiting":d.includes("blocked")?"blocked":d.includes("running")?"running":d.includes("done")?"done":"idle";return{...u,itemCount:c.length,status:m,presentation:Hu(u)}})}function S0(s){return(s==null?void 0:s.warnings.map(o=>({...o})))??[]}function w0(s){try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return s}}function C0(s){return s==="alta"?"error":s==="baixa"?"info":"amber"}function z0(s){return s==="alta"?"danger":s==="baixa"?"info":"warning"}function E0(s){return s==="ciente"?"em acompanhamento":s==="descartado"?"descartado":s==="resolvido"?"resolvido":"novo"}function A0(s){return s==="ciente"?"warning":s==="resolvido"?"success":s==="descartado"?"default":"info"}function k0(s){const o=s.toLowerCase();return o.includes("fail")||o.includes("erro")||o.includes("error")?{icon:"circle-x",variant:"error",tagVariant:"danger",tone:"danger",label:"falha"}:o.includes("validate")||o.includes("build")||o.includes("test")?{icon:"terminal",variant:"amber",tagVariant:"warning",tone:"warning",label:"validacao"}:o.includes("done")||o.includes("complete")||o.includes("pass")?{icon:"circle-check",variant:"success",tagVariant:"success",tone:"success",label:"concluido"}:o.includes("agent")||o.includes("automation")?{icon:"bot",variant:"agent",tagVariant:"agent",tone:"info",label:"agente"}:{icon:"activity",variant:"info",tagVariant:"info",tone:"info",label:"evento"}}function T0({decisions:s,signals:o,healthSummary:u,activity:c,signalsAvailable:d=!0,activityAvailable:m=!0,primaryItemId:p,primaryWork:x,onReviewDecision:y,onOpenItem:g,onOpenActivity:N,onOpenWork:j,onOpenSignal:E,onScanHealth:M,healthBusy:B=!1}){const J=x??(p?{id:p,title:p}:null),P=s[0]?{label:"Revisar decisao prioritaria",reason:"Um gate humano impede o fluxo de avancar sem sua decisao.",description:`Responder a solicitacao sobre ${s[0].itemId}.`,consequence:"A revisao abre a evidencia do item; nenhuma mudanca ocorre antes da sua decisao.",icon:"shield",tone:"warning",run:()=>y(s[0].itemId)}:o.length>0?{label:"Examinar evidencias",reason:"Ha sinal ativo de saude pedindo investigacao antes de qualquer correcao.",description:"Compreender o impacto e a evidencia do sinal antes de agir.",consequence:"Abre a central de saude; nenhuma correcao e aplicada automaticamente.",icon:"alert-triangle",tone:"info",run:()=>E(o[0])}:J?{label:"Abrir trabalho em foco",reason:"Nao ha decisao ou sinal ativo; acompanhe o item central da sessao.",description:`Continuar a supervisao de ${J.id}.`,consequence:"Abre o item sem alterar seu estagio ou estado canonico.",icon:"box",tone:"default",run:()=>g(J.id)}:{label:"Ver trabalho disponivel",reason:"Nao ha decisao ou sinal ativo; escolha um item para supervisionar.",description:"Escolher com seguranca o proximo trabalho a supervisionar.",consequence:"Abre Trabalho sem iniciar ou mover qualquer item.",icon:"grid",tone:"default",run:j},ue=s.length+o.length>0?l.jsxs("div",{className:"ds-cluster justify-end",children:[s.length>0?l.jsxs(ke,{icon:"shield",variant:"amber",tone:"soft",children:[s.length," decisoes"]}):null,o.length>0?l.jsxs(ke,{icon:"alert-triangle",variant:"amber",tone:"soft",children:[o.length," ",o.length===1?"sinal":"sinais"]}):null]}):l.jsx(ke,{icon:"circle-check",variant:"success",tone:"soft",children:"nada aguardando voce"}),ve=J?[{label:"Item",value:l.jsx(ke,{icon:"box",variant:"info",tone:"soft",children:J.id}),icon:l.jsx(C,{name:"box",size:14})},...J.stage?[{label:"Estagio",value:l.jsx(Je,{variant:"info",children:J.stage}),icon:l.jsx(C,{name:"circle",size:14})}]:[],...J.ageLabel?[{label:"Idade",value:J.ageLabel,icon:l.jsx(C,{name:"clock",size:14})}]:[],...J.actor?[{label:"Responsavel",value:J.actor,icon:l.jsx(C,{name:"user",size:14})}]:[]]:[];return l.jsxs("section",{"aria-labelledby":"supervision-inbox-title",className:"ds-section",children:[l.jsx(nx,{className:"rounded-[var(--radius-md)]",titleId:"supervision-inbox-title",title:"Supervisao",description:"O que precisa da sua atencao agora, sem misturar acompanhamento com operacao.",left:l.jsx(C,{name:"shield",size:20}),right:ue}),l.jsx(tr,{tone:P.tone,icon:l.jsx(C,{name:P.icon,size:20}),title:"Prioridade agora",description:P.description,action:l.jsx(F,{onClick:P.run,children:P.label}),children:l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Je,{variant:"info",children:P.label}),l.jsx(Je,{children:"nao altera estado"})]}),l.jsx("p",{className:"text-caption font-medium text-[var(--color-text-primary)]",children:P.reason}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:P.consequence})]})}),l.jsxs("div",{className:"ds-panel-grid",children:[l.jsxs("div",{className:"ds-panel-grid content-start xl:grid-cols-2",children:[l.jsxs(it,{children:[l.jsxs(ja,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(C,{name:"shield",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Decisoes pendentes"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Gates humanos que precisam da sua decisao antes do fluxo avancar."})]})]}),l.jsx(ke,{icon:s.length>0?"alert-triangle":"circle",variant:s.length>0?"amber":"info",tone:"soft",children:s.length})]}),l.jsx(ot,{children:s.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"circle-check",size:20}),title:"Nenhuma decisao aguarda voce.",description:"Quando um gate humano aparecer, ele entra nesta fila com origem e consequencia."}):l.jsx(rl,{children:s.map(Y=>l.jsx(il,{leading:l.jsx(C,{name:"shield",size:18}),title:Y.title,description:"Aguardando decisao humana antes do fluxo avancar.",meta:l.jsxs(l.Fragment,{children:[l.jsx(ke,{icon:"box",variant:"info",tone:"soft",children:Y.itemId}),l.jsx(Je,{variant:"warning",children:"gate humano"})]}),action:l.jsx(F,{size:"sm",onClick:()=>y(Y.itemId),"aria-label":`Revisar ${Y.itemId}`,children:"Revisar"}),tone:"warning",children:l.jsx(Ea,{className:"mt-[var(--space-2)]",items:[{label:"Estagio",value:l.jsx(Je,{variant:"info",children:Y.stage}),icon:l.jsx(C,{name:"circle",size:14})},{label:"Responsavel",value:Y.actor,icon:l.jsx(C,{name:"user",size:14})},{label:"Desde",value:Y.since,icon:l.jsx(C,{name:"clock",size:14})}]})},Y.itemId))})})]}),l.jsxs(it,{children:[l.jsxs(ja,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(C,{name:"alert-triangle",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Saude do workspace"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Sinais priorizados por impacto, evidencia e proxima acao segura."})]})]}),l.jsxs("div",{className:"ds-cluster",children:[l.jsx(ke,{icon:o.length>0?"alert-triangle":"circle",variant:o.length>0?"amber":"info",tone:"soft",children:o.length}),M?l.jsxs(F,{variant:"secondary",size:"sm",onClick:M,disabled:B,children:[l.jsx(C,{name:B?"loader-circle":"activity",size:14}),B?"Verificando":"Verificar agora"]}):null]})]}),l.jsxs(ot,{children:[u&&o.length>0?l.jsx(Ea,{className:"mb-[var(--space-4)]",items:[{label:"Novos",value:u.novo,icon:l.jsx(C,{name:"alert-triangle",size:14})},{label:"Em acompanhamento",value:u.ciente,icon:l.jsx(C,{name:"clock",size:14})},{label:"Resolvidos",value:u.resolvido,icon:l.jsx(C,{name:"circle-check",size:14})},{label:"Descartados",value:u.descartado,icon:l.jsx(C,{name:"circle-x",size:14})}]}):null,d?o.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"circle-check",size:20}),title:"Nenhum sinal ativo de saude.",description:"Historico resolvido ou descartado fica em Atividade; esta area mostra apenas o que pede investigacao agora."}):l.jsx(rl,{children:o.map(Y=>l.jsx(il,{leading:l.jsx(C,{name:"alert-triangle",size:18}),title:Y.title,description:Y.impact??"Pede investigacao antes de qualquer correcao.",meta:l.jsxs(l.Fragment,{children:[l.jsx(ke,{icon:"alert-triangle",variant:C0(Y.severity),tone:"soft",children:Y.impact??"pede investigacao"}),l.jsx(Je,{variant:A0(Y.status),children:E0(Y.status)})]}),action:l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>E(Y),children:"Detalhes"}),tone:z0(Y.severity),children:l.jsx(Ea,{className:"mt-[var(--space-2)]",items:[{label:"Origem",value:Y.source,icon:l.jsx(C,{name:"file-text",size:14})},{label:"Urgencia",value:l.jsx(Je,{variant:Y.severity==="alta"?"danger":Y.severity==="baixa"?"info":"warning",children:Y.severity}),icon:l.jsx(C,{name:"alert-triangle",size:14})},{label:"Acao segura",value:Y.nextAction??"investigar",icon:l.jsx(C,{name:"activity",size:14})}]})},Y.id))}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"alert-circle",size:20}),title:"Saude indisponivel agora.",description:"A supervisao continua disponivel, mas sem a fotografia de saude do workspace."})]})]})]}),l.jsx("div",{className:"ds-panel-grid content-start",children:l.jsxs(it,{children:[l.jsxs(ja,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(C,{name:"box",size:16}),l.jsx("h2",{className:"font-semibold",children:"Trabalho em foco"})]}),J?l.jsx(ke,{icon:"box",variant:"info",tone:"soft",children:J.id}):null]}),l.jsx(ot,{children:J?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(Je,{variant:"agent",children:"supervisionavel"}),J.actor?l.jsx(Je,{children:J.actor}):null]}),l.jsx("h3",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:J.title}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:s.length>0?"Em foco porque esta relacionado a uma decisao humana.":o.length>0?"Em foco para cruzar sinais ativos com o trabalho atual.":"Em foco por ser o item central da sessao atual."})]}),l.jsx(Ea,{items:ve}),l.jsxs("div",{className:"flex flex-wrap items-center gap-[var(--layout-toolbar-gap)]",children:[l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>g(J.id),children:"Abrir item"}),l.jsx(Je,{variant:"info",children:"somente leitura"})]})]}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"grid",size:20}),title:"Nenhum trabalho em foco.",description:"Abra Trabalho para escolher o proximo item a supervisionar.",action:l.jsx(F,{variant:"secondary",size:"sm",onClick:j,children:"Ver trabalho disponivel"})})})]})})]}),l.jsxs(it,{children:[l.jsxs(ja,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster min-w-0",children:[l.jsx(C,{name:"activity",size:16}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"font-semibold",children:"Ultimas evidencias"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Eventos recentes que comprovam o que aconteceu no workspace."})]})]}),l.jsx(F,{variant:"ghost",size:"sm",onClick:N,children:"Ver toda atividade"})]}),l.jsx(ot,{children:m?c.length===0?l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"activity",size:20}),title:"Nenhuma atividade registrada.",description:"Eventos reais do workspace aparecem aqui como evidencia."}):l.jsx(rl,{tone:"surface",children:c.map(Y=>{const de=k0(Y.action);return l.jsx(il,{leading:l.jsx(C,{name:de.icon,size:18}),title:Y.description,description:w0(Y.timestamp),meta:l.jsxs(l.Fragment,{children:[l.jsx(ke,{icon:de.icon,variant:de.variant,tone:"soft",children:de.label}),l.jsx(Je,{variant:de.tagVariant,children:Y.action}),Y.itemId?l.jsx(Je,{children:Y.itemId}):null]}),action:Y.itemId?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>g(Y.itemId),children:"Abrir item"}):null,tone:de.tone},Y.id)})}):l.jsx(on,{className:"items-start text-left",icon:l.jsx(C,{name:"alert-circle",size:20}),title:"Atividade indisponivel no momento.",description:"A timeline completa permanece em Atividade quando o log voltar."})})]})]})}function M0(){return l.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-[var(--layout-page-gap)] p-[var(--layout-page-padding)]",children:[l.jsx(It,{}),l.jsxs("div",{className:"ds-panel-grid xl:grid-cols-[minmax(0,1.15fr)_minmax(20rem,0.85fr)]",children:[l.jsx(It,{}),l.jsx(It,{})]}),l.jsx(It,{})]})}function D0(s){return Math.floor((Date.now()-new Date(s).getTime())/(1e3*60*60*24))}function rx(s){const o=D0(s);return o===0?"Hoje":o===1?"1 dia":`${o} dias`}function O0(s){const o=Date.now()-new Date(s).getTime(),u=Math.floor(o/(1e3*60*60));return u<1?`há ${Math.max(1,Math.floor(o/6e4))}min`:u<24?`há ${u}h`:`há ${Math.floor(u/24)}d`}function _0(s){if(!s)return"media";const o=s.toLowerCase();return o.includes("crit")||o.includes("alta")||o.includes("high")?"alta":o.includes("low")||o.includes("baixa")?"baixa":"media"}function R0(s){return s==="alta"?"bloqueia conclusao":s==="media"?"pede investigacao":"pode aguardar"}function L0(s){return s==="ciente"?"acompanhar":s==="resolvido"?"ver evidencia":s==="descartado"?"ver justificativa":"investigar"}function cp(s){if(!s)return"nao registrado";try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function U0(s){var u,c,d,m;const o=s.entries??[];return{novo:((u=s.summary)==null?void 0:u.novo)??o.filter(p=>p.status==="novo").length,ciente:((c=s.summary)==null?void 0:c.ciente)??o.filter(p=>p.status==="ciente").length,resolvido:((d=s.summary)==null?void 0:d.resolvido)??o.filter(p=>p.status==="resolvido").length,descartado:((m=s.summary)==null?void 0:m.descartado)??o.filter(p=>p.status==="descartado").length}}function H0(s,o){const u=[s.id,s.type,s.source,s.where,s.title,s.what].filter(Boolean).map(c=>String(c).toLowerCase());return o.find(c=>{const d=c.diagnosticId.toLowerCase(),m=c.diagnosticTitle.toLowerCase();return u.some(p=>p?d===p||d.includes(p)||m.includes(p):!1)})}function up(s){return(s.snapshots??[]).filter(o=>Array.isArray(o.files))}function B0(s,o,u=16){const c=s.split(/\r?\n/),d=o.split(/\r?\n/);let m=0;for(;m<c.length&&m<d.length&&c[m]===d[m];)m+=1;let p=c.length-1,x=d.length-1;for(;p>=m&&x>=m&&c[p]===d[x];)p-=1,x-=1;const y=c.slice(m,p+1).slice(0,Math.floor(u/2)),g=d.slice(m,x+1).slice(0,u-y.length),N=[...y.map(j=>`- ${j||"(linha vazia)"}`),...g.map(j=>`+ ${j||"(linha vazia)"}`)];return N.length>0?N:["Sem diferenca textual entre before/after."]}function q0(s,o=[]){return(s.active??[]).slice(0,4).map((u,c)=>{const d=_0(u.severity);return{id:u.id??`health-${c}`,title:u.title??u.what??"Alerta ativo",source:u.source??u.where??"health",severity:d,status:u.status??"novo",detectedAt:u.detectedAt,impact:R0(d),nextAction:L0(u.status),technicalType:u.type,relatedSnapshot:H0(u,o)}})}function G0({spec:s,primaryItem:o,primaryStageName:u}){return l.jsx(tr,{density:"compact",tone:"info",icon:l.jsx(C,{name:"file-text",size:20}),title:"Governança do workspace",description:"Contexto canônico usado para interpretar decisões, evidências e trabalho em foco nesta sessão.",meta:l.jsxs(l.Fragment,{children:[l.jsx(ke,{icon:"file-text",variant:"info",tone:"soft",children:s}),l.jsx(Je,{variant:"info",children:"contrato ativo"})]}),children:l.jsx(Ea,{items:[{label:"Spec",value:s,icon:l.jsx(C,{name:"file-text",size:14})},...o?[{label:"Item vinculado",value:l.jsx(ke,{icon:"box",variant:"info",tone:"soft",children:o.id}),icon:l.jsx(C,{name:"box",size:14})}]:[],...u?[{label:"Estágio",value:l.jsx(Je,{variant:"info",children:u}),icon:l.jsx(C,{name:"circle",size:14})}]:[]]})})}function V0({item:s,stageName:o,open:u,onOpenChange:c}){if(!s)return null;const d=[{label:"Estágio",value:l.jsx(Je,{variant:"info",children:o??s.stage}),icon:l.jsx(C,{name:"circle",size:14})},{label:"Idade",value:rx(s.createdAt),icon:l.jsx(C,{name:"clock",size:14})},...s.spec?[{label:"Spec",value:s.spec,icon:l.jsx(C,{name:"file-text",size:14})}]:[],...s.claimedBy?[{label:"Responsável",value:s.claimedBy,icon:l.jsx(C,{name:"user",size:14})}]:[]];return l.jsx(nr,{open:u,onOpenChange:c,children:l.jsxs(sr,{children:[l.jsx(Ui,{children:l.jsx(Hi,{children:s.id})}),l.jsx("div",{className:"grid gap-[var(--layout-panel-gap)] p-[var(--card-padding)]",children:l.jsx(it,{children:l.jsx(ot,{children:l.jsxs("div",{className:"ds-stack",children:[l.jsxs("div",{className:"grid gap-[var(--space-1)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(ke,{icon:"box",variant:"info",tone:"soft",children:s.id}),s.claimedBy?l.jsx(Je,{children:s.claimedBy}):null]}),l.jsx("p",{className:"text-body-sm font-medium text-[var(--color-text-primary)]",children:s.description||"Sem descrição"})]}),l.jsx(Ea,{items:d}),s.tasks&&s.tasks.length>0?l.jsxs("div",{className:"ds-stack",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(C,{name:"list-three",size:16}),l.jsx("h3",{className:"font-semibold",children:"Tasks"}),l.jsx(ke,{variant:"info",tone:"soft",children:s.tasks.length})]}),l.jsx(rl,{children:s.tasks.map(m=>l.jsx(il,{leading:l.jsx(C,{name:m.done?"circle-check":"circle",size:18}),title:m.description,meta:l.jsx(Je,{variant:m.done?"success":"info",children:m.done?"feito":"pendente"})},m.id))})]}):null]})})})}),l.jsx(Lu,{children:l.jsx(F,{variant:"secondary",onClick:()=>c(!1),children:"Fechar"})})]})})}function Y0({signal:s,open:o,onOpenChange:u,onAcknowledge:c,onDismiss:d,onScan:m,actionBusy:p,actionMessage:x}){var N;if(!s)return null;const y=(N=s.relatedSnapshot)==null?void 0:N.files[0],g=y?B0(y.before,y.after):[];return l.jsx(nr,{open:o,onOpenChange:u,children:l.jsxs(sr,{side:"right",className:"w-full max-w-[100vw] sm:max-w-3xl lg:max-w-4xl","aria-labelledby":"signal-sheet-title","aria-describedby":"signal-sheet-description",children:[l.jsxs(Ui,{className:"items-start gap-4",children:[l.jsxs("div",{className:"grid min-w-0 gap-[var(--space-2)]",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(ke,{icon:"alert-triangle",variant:s.severity==="alta"?"error":s.severity==="baixa"?"info":"amber",tone:"soft",children:s.impact??"pede investigacao"}),l.jsx(Je,{variant:s.status==="ciente"?"warning":s.status==="resolvido"?"success":s.status==="descartado"?"default":"info",children:s.status==="ciente"?"em acompanhamento":s.status??"novo"})]}),l.jsx(Hi,{id:"signal-sheet-title",className:"break-words leading-tight",children:s.title}),l.jsx(Ru,{id:"signal-sheet-description",children:"Evidencia do workspace para entender o impacto antes de agir."})]}),l.jsx(tx,{"aria-label":"Fechar detalhes do sinal",onClick:()=>u(!1),children:l.jsx(C,{name:"x",size:16})})]}),l.jsxs("div",{className:"grid gap-[var(--layout-panel-gap)] overflow-y-auto p-[var(--card-padding)]",children:[l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(C,{name:"shield",size:16}),l.jsx("h3",{className:"font-semibold",children:"Leitura de supervisao"})]})}),l.jsx(ot,{children:l.jsx(Ea,{items:[{label:"Impacto",value:s.impact??"pede investigacao",icon:l.jsx(C,{name:"alert-triangle",size:14})},{label:"Acao segura",value:s.nextAction??"investigar",icon:l.jsx(C,{name:"activity",size:14})},{label:"Detectado em",value:cp(s.detectedAt),icon:l.jsx(C,{name:"clock",size:14})}]})})]}),l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(C,{name:"file-text",size:16}),l.jsx("h3",{className:"font-semibold",children:"Evidencia"})]})}),l.jsx(ot,{children:l.jsx(rl,{tone:"surface",children:l.jsx(il,{leading:l.jsx(C,{name:"alert-circle",size:18}),title:s.title,description:"Sinal ativo registrado no prontuario de saude do workspace.",meta:l.jsxs(l.Fragment,{children:[l.jsx(Je,{variant:"info",children:s.source}),l.jsx(Je,{children:s.id})]}),tone:s.severity==="alta"?"danger":s.severity==="baixa"?"info":"warning"})})})]}),l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"ds-cluster",children:[l.jsx(C,{name:"git-branch",size:16}),l.jsx("h3",{className:"font-semibold",children:"Comparacao de drift"})]})}),l.jsx(ot,{children:s.relatedSnapshot?l.jsxs("div",{className:"grid gap-[var(--space-4)]",children:[l.jsx(Ea,{items:[{label:"Snapshot",value:s.relatedSnapshot.id,icon:l.jsx(C,{name:"info",size:14})},{label:"Registrado em",value:cp(s.relatedSnapshot.timestamp),icon:l.jsx(C,{name:"clock",size:14})},{label:"Arquivos",value:s.relatedSnapshot.files.length,icon:l.jsx(C,{name:"file-text",size:14})}]}),l.jsx(rl,{tone:"surface",children:s.relatedSnapshot.files.map(j=>l.jsx(il,{leading:l.jsx(C,{name:"file-text",size:18}),title:j.path,description:"Arquivo capturado no snapshot do diagnostico.",meta:l.jsx(Je,{variant:"info",children:"before/after"})},j.path))}),y?l.jsx("pre",{className:"max-h-72 max-w-full overflow-auto rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-[var(--space-3)] text-xs leading-relaxed text-[var(--color-text-primary)]",children:g.join(`
|
|
200
|
+
`)}):null]}):l.jsx(rl,{tone:"surface",children:l.jsx(il,{leading:l.jsx(C,{name:"info",size:18}),title:"Nenhum snapshot relacionado encontrado.",description:"Este sinal nao possui comparacao before/after disponivel; a evidencia atual vem do health-record.",meta:l.jsx(Je,{children:"fallback honesto"}),tone:"info"})})})]}),l.jsx(rr,{children:l.jsxs(it,{children:[l.jsxs(ja,{className:"flex flex-wrap items-center justify-between",children:[l.jsxs("div",{className:"ds-cluster",children:[l.jsx(C,{name:"code",size:16}),l.jsx("h3",{className:"font-semibold",children:"Origem tecnica"})]}),l.jsx(ir,{className:"rounded-[var(--radius-md)] px-[var(--space-3)] py-[var(--space-2)] text-body-sm font-medium text-[var(--color-text-secondary)] hover:bg-[var(--surface-hover)]",children:"Mostrar dados"})]}),l.jsx(or,{children:l.jsx(ot,{children:l.jsx(Ea,{items:[{label:"ID",value:s.id,icon:l.jsx(C,{name:"info",size:14})},{label:"Origem",value:s.source,icon:l.jsx(C,{name:"file-text",size:14})},{label:"Tipo",value:s.technicalType??"nao informado",icon:l.jsx(C,{name:"code",size:14})},{label:"Urgencia",value:s.severity,icon:l.jsx(C,{name:"alert-triangle",size:14})}]})})})]})})]}),l.jsxs(Lu,{className:"grid gap-[var(--space-2)] sm:flex sm:flex-wrap sm:justify-between",children:[x?l.jsx("p",{className:"min-w-0 break-words text-caption text-[var(--color-text-secondary)] sm:mr-auto",children:x}):null,l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:m,disabled:p,children:[l.jsx(C,{name:p?"loader-circle":"activity",size:14}),"Verificar agora"]}),l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>c(s),disabled:p||s.status==="ciente",children:[l.jsx(C,{name:"clock",size:14}),"Acompanhar"]}),l.jsxs(F,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>d(s),disabled:p,children:[l.jsx(C,{name:"circle-x",size:14}),"Descartar"]})]})]})})}function dp({workflow:s,activeFlow:o,onTabChange:u}){var Q,oe,De;const[c,d]=v.useState(null),[m,p]=v.useState([]),[x,y]=v.useState(null),[g,N]=v.useState(!0),[j,E]=v.useState([]),[M,B]=v.useState([]),[J,P]=v.useState(!0),[ee,ue]=v.useState(!0),[ve,Y]=v.useState(!1),[de,he]=v.useState(null),[te,H]=v.useState(null),[pe,Ee]=v.useState(!1),[me,R]=v.useState(""),re=v.useCallback((ne,be=[])=>{const xe=q0(ne,be);return y(U0(ne)),p(xe),N(!0),H(q=>q&&(xe.find(we=>we.id===q.id)??null)),xe},[]),ce=v.useCallback(async()=>{const[ne,be]=await Promise.all([fetch("/api/health"),fetch("/api/diagnostics/snapshots?limit=20")]);if(!ne.ok)throw new Error("health unavailable");const xe=await ne.json(),q=be.ok?up(await be.json()):j;return E(q),re(xe,q)},[re]);v.useEffect(()=>{let ne=!1;async function be(){ue(!0),Y(!1);const[xe,q,we,Oe]=await Promise.allSettled([fetch("/api/focus").then(ht=>ht.json()),fetch("/api/health").then(ht=>ht.json()),fetch("/api/diagnostics/snapshots?limit=20").then(ht=>ht.json()),fetch("/api/log?limit=4").then(ht=>ht.json())]);if(ne)return;xe.status==="fulfilled"&&d(xe.value);const kt=we.status==="fulfilled"?up(we.value):[];if(E(kt),q.status==="fulfilled"){const ht=q.value;re(ht,kt)}else p([]),y(null),N(!1);if(Oe.status==="fulfilled"){const ht=Oe.value;B((ht.entries??[]).slice(0,4).map(Vt=>({id:Vt.id,action:Vt.action,description:Vt.description,timestamp:Vt.timestamp,itemId:Vt.itemId??null}))),P(!0)}else B([]),P(!1);xe.status==="rejected"&&q.status==="rejected"&&Oe.status==="rejected"&&Y(!0),ue(!1)}return be(),()=>{ne=!0}},[re]);const Se=v.useMemo(()=>oa(s,o),[o,s]),z=v.useMemo(()=>{const ne=cr(s,o);return s.items.filter(be=>ne.has(be.stage)).map(be=>{var xe;return{itemId:be.id,title:be.description||be.id,stage:((xe=Se.find(q=>q.id===be.stage))==null?void 0:xe.name)??be.stage,actor:op(be.stage,s,o),since:O0(be.createdAt)}})},[o,Se,s]),L=de?s.items.find(ne=>ne.id===de)??null:null,le=L?((Q=Se.find(ne=>ne.id===L.stage))==null?void 0:Q.name)??null:null,ie=(c==null?void 0:c.itemId)??s.primaryItemId??((oe=s.items[0])==null?void 0:oe.id),D=ie?s.items.find(ne=>ne.id===ie):void 0,b=D?((De=Se.find(ne=>ne.id===D.stage))==null?void 0:De.name)??D.stage:void 0,A=D?{id:D.id,title:D.description||D.id,description:"Resumo operacional do item que está no centro da supervisão agora.",stage:b,spec:D.spec??(c==null?void 0:c.spec),ageLabel:rx(D.createdAt),actor:D.claimedBy??op(D.stage,s,o)}:void 0;function $(ne){he(ne),window.dispatchEvent(new CustomEvent("letra-open-item",{detail:ne}))}async function I(ne,be){Ee(!0),R("Atualizando saude do workspace...");try{if(!(await fetch(ne,{method:"POST",headers:be?{"Content-Type":"application/json"}:void 0,body:be?JSON.stringify(be):void 0})).ok)throw new Error("health action failed");const q=await ce();return R("Saude do workspace atualizada."),q}catch{return R("Nao foi possivel atualizar a saude agora."),null}finally{Ee(!1)}}async function fe(){await I("/api/health/scan")}async function V(ne){const be=await I("/api/health/ack",{id:ne.id});be&&H(be.find(xe=>xe.id===ne.id)??null)}async function T(ne){await I("/api/health/dismiss",{id:ne.id})&&H(null)}return ee?l.jsx(M0,{}):l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-[var(--layout-page-gap)] p-[var(--layout-page-padding)]",children:[ve?l.jsx(qy,{onRetry:()=>window.location.reload(),children:"Não foi possível carregar a supervisão agora."}):null,l.jsx(T0,{decisions:z,signals:m,healthSummary:x??void 0,activity:M,signalsAvailable:g,activityAvailable:J,primaryItemId:ie,primaryWork:A,onReviewDecision:$,onOpenItem:$,onOpenActivity:()=>u==null?void 0:u("activity"),onOpenWork:()=>u==null?void 0:u("work"),onOpenSignal:H,onScanHealth:fe,healthBusy:pe}),c!=null&&c.active&&c.spec?l.jsx(G0,{spec:c.spec,primaryItem:D,primaryStageName:b}):null]})}),l.jsx(V0,{item:L,stageName:le,open:!!L,onOpenChange:ne=>{ne||he(null)}}),l.jsx(Y0,{signal:te,open:!!te,onOpenChange:ne=>{ne||H(null)},onAcknowledge:V,onDismiss:T,onScan:fe,actionBusy:pe,actionMessage:me})]})}function Bu(s,o,u){var y;if(s.spec&&((y=u.specLinks)==null?void 0:y[s.spec]))return s.spec.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");const d=s.description.trim().split(/\s+/).filter(Boolean).slice(0,3).join("-").toLowerCase().replace(/[^a-z0-9-]/g,"")||s.id.toLowerCase(),m=new Set(u.items.filter(g=>g.id!==s.id).map(g=>Q0(g,o,u)));let p=d,x=2;for(;m.has(p);)p=`${d}-${x}`,x++;return p}function Q0(s,o,u){var d;return s.spec&&((d=u.specLinks)==null?void 0:d[s.spec])?s.spec.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""):s.description.trim().split(/\s+/).filter(Boolean).slice(0,3).join("-").toLowerCase().replace(/[^a-z0-9-]/g,"")||s.id.toLowerCase()}function X0(s){const o=s.split(`
|
|
201
|
+
`);let u=0,c=0;for(const d of o){const m=d.trim();/^- \[ \]/.test(m)&&c++,/^- \[x\]/i.test(m)&&(u++,c++)}return{done:u,total:c}}const Z0={approve:"Decisão aprovada e registrada.","request-changes":"Alterações solicitadas e registradas.",reject:"Rejeição registrada."};function K0({itemId:s,onDecided:o}){const{toast:u}=lr(),[c,d]=v.useState(null),[m,p]=v.useState(null);async function x(y,g){p(y);try{const N=await fetch(`/api/items/${s}/gate-decisions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:y,reason:g})}),j=await N.json().catch(()=>({}));if(!N.ok)throw new Error(j.error||"Não foi possível registrar a decisão.");u(Z0[y],"success"),o==null||o()}catch(N){u(N instanceof Error?N.message:"Não foi possível registrar a decisão.","error")}finally{p(null)}}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(F,{variant:"primary",size:"sm",disabled:m!==null,onClick:()=>void x("approve"),children:[l.jsx(C,{name:"check",size:14}),m==="approve"?"Registrando...":"Aprovar"]}),l.jsxs(F,{variant:"ghost",size:"sm",disabled:m!==null,onClick:()=>d("request-changes"),children:[l.jsx(C,{name:"edit",size:14}),"Solicitar alterações"]}),l.jsxs(F,{variant:"ghost",size:"sm",disabled:m!==null,onClick:()=>d("reject"),children:[l.jsx(C,{name:"x",size:14}),"Rejeitar"]})]}),l.jsx(Pp,{open:c!==null,onClose:()=>d(null),onSubmit:y=>{c&&x(c,y)},title:c==="reject"?"Rejeitar item":"Solicitar alterações",label:"Motivo obrigatório",placeholder:"Explique o direcionamento para manter a decisão auditável",submitLabel:c==="reject"?"Rejeitar":"Solicitar alterações"})]})}function J0(s){return s==="done"?{key:s,label:"Concluído",variant:"success",tagVariant:"success",action:"Sem ação pendente",icon:"check-circle",animate:""}:s==="waiting"?{key:s,label:"Precisa de atenção",variant:"amber",tagVariant:"warning",action:"Revisar decisão humana",icon:"clock",animate:"animate-timeline-dot"}:s==="blocked"?{key:s,label:"Bloqueado",variant:"error",tagVariant:"danger",action:"Examinar bloqueio",icon:"shield",animate:""}:s==="running"?{key:s,label:"Em andamento",variant:"agent",tagVariant:"agent",action:"Acompanhar trabalho ativo",icon:"chevron-right",animate:"animate-agent-running"}:{key:s,label:"Na fila",variant:"info",tagVariant:"default",action:"Aguardando responsável",icon:"circle",animate:""}}function $0(s){return s==="attention"?{title:"Nenhum trabalho precisa de atenção agora.",description:"Gates humanos e bloqueios aparecerão aqui quando exigirem revisão."}:s==="running"?{title:"Nenhum trabalho está em andamento.",description:"Quando um item estiver associado a um ator, ele aparecerá neste recorte."}:s==="queued"?{title:"Nenhum trabalho está na fila.",description:"Itens sem responsável declarado aparecerão aqui antes de entrarem em andamento."}:s==="done"?{title:"Nenhum trabalho concluído ainda.",description:"Itens em estágios finais aparecerão neste recorte."}:{title:"Nenhum trabalho neste fluxo.",description:"Crie um item quando houver algo para supervisionar."}}function W0({item:s,workflow:o,activeFlow:u,specs:c,onClick:d,onDragStart:m,onDragEnd:p}){var pe,Ee;const x=Bu(s,c,o),y=Math.floor((Date.now()-new Date(s.createdAt).getTime())/864e5),g=cr(o,u).has(s.stage),N=J0(La(s,o,u)),j=s.spec?c.find(me=>me.id===s.spec):null,E=j?(()=>{const me=(j.content.match(/-\s+\[x\]/g)||[]).length,R=(j.content.match(/-\s+\[(\s|x)\]/g)||[]).length;return{done:me,total:R,label:R>0?`${me}/${R} critérios`:"Sem critérios",source:"Critérios"}})():s.tasks&&s.tasks.length>0?{done:s.tasks.filter(me=>me.done).length,total:s.tasks.length,label:`${s.tasks.filter(me=>me.done).length}/${s.tasks.length} tarefas`,source:"Tarefas"}:{done:0,total:0,label:"Sem checklist",source:"Evidência"},M=oa(o,u).find(me=>me.id===s.stage),B=s.claimedBy??((pe=M==null?void 0:M.roles[0])==null?void 0:pe.label)??"Não atribuído",J=M?Bi(M):"Processando",P=N.key==="running",ee=E.total>0,ue=E.total>0?E.done:0,ve=E.total>0?E.total:1,Y=N.key==="blocked"?"error":N.key==="waiting"?"warning":N.key==="done"?"complete":N.key==="running"?"agent":"default",de=((Ee=s.description)==null?void 0:Ee.trim())||(j==null?void 0:j.id)||x,he=y===0?"Hoje no fluxo":`${y}d no fluxo`,te=N.key==="blocked"?"var(--color-danger)":N.key==="waiting"?"var(--color-primary)":P?"var(--color-agent)":g?"var(--color-success)":"var(--color-border)",H=N.key==="blocked"?"color-mix(in oklch, var(--color-danger) 5%, var(--color-bg-surface))":N.key==="waiting"?"color-mix(in oklch, var(--color-primary) 6%, var(--color-bg-surface))":P?"color-mix(in oklch, var(--color-agent) 5%, var(--color-bg-surface))":"var(--color-bg-surface)";return l.jsx(it,{variant:P?"agent":"default",className:xt("app-board-card cursor-grab select-none active:cursor-grabbing hover:-translate-y-0.5 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",g&&"animate-human-pulse",s.claimedBy&&"ring-1"),style:{borderColor:te,background:H},"data-claimed":s.claimedBy?"true":"false","data-gate":g?"true":"false","data-running":P?"true":"false",draggable:!0,role:"button",tabIndex:0,"aria-label":`Abrir ${s.id}: ${de}`,onClick:d,onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),d())},onDragStart:m,onDragEnd:p,children:l.jsxs(ot,{className:"min-w-0 gap-3 p-3.5",children:[l.jsxs("div",{className:"grid min-w-0 gap-2",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[l.jsx("span",{className:"min-w-0 truncate font-mono text-[11px] font-medium text-[var(--color-text-tertiary)]",children:s.id}),l.jsx(ke,{variant:N.variant,tone:"soft",className:xt("max-w-full shrink-0",N.animate),icon:N.icon,children:N.label})]}),l.jsx("h3",{className:"line-clamp-3 text-body-sm font-semibold leading-snug text-[var(--color-text-primary)]",children:de})]}),l.jsxs("div",{className:"grid gap-1.5",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[l.jsx(Je,{children:(M==null?void 0:M.name)??s.stage}),l.jsx(Je,{children:he})]}),l.jsx("p",{className:"line-clamp-2 text-caption leading-snug text-[var(--color-text-secondary)]",children:j?`Especificação ${j.id}`:`Evidência ${x}`})]}),l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5 text-caption text-[var(--color-text-secondary)]",children:[l.jsxs(Je,{variant:s.claimedBy?"agent":"default",children:[l.jsx(C,{name:s.claimedBy?"bot":"circle",size:10}),B]}),l.jsx("span",{className:"min-w-0 flex-1 basis-32 truncate",children:J})]}),ee?l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-caption font-medium text-[var(--color-text-secondary)]",children:E.source}),l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:E.label})]}),l.jsx(Ou,{value:ue,max:ve,size:"xs",state:Y})]}):null,l.jsx("div",{className:"rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] px-2 py-1.5",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-caption font-medium text-[var(--color-text-primary)]",children:[l.jsx(C,{name:N.icon,size:12}),l.jsx("span",{className:"min-w-0 whitespace-normal leading-snug",children:N.action})]})})]})})}function F0({workflow:s,activeFlow:o,onSelectItem:u,onDropItem:c,onApproveGate:d,onItemDecided:m,allowDrop:p,specRefreshKey:x,onAddItem:y,filter:g="all",className:N}){const[j,E]=v.useState(null),[M,B]=v.useState(null),[J,P]=v.useState([]),ee=v.useRef(null),ue=v.useCallback(async()=>{try{const L=await fetch("/api/specs");if(!L.ok)return;const le=await L.json();P(le)}catch{}},[]);v.useEffect(()=>{ue()},[ue]),v.useEffect(()=>{x&&ue()},[x,ue]);const ve=v.useCallback((L,le)=>{const ie=s.items.find(D=>D.id===le);ie&&(ee.current=ie,B(le),L.dataTransfer.setData("text/plain",le),L.dataTransfer.dropEffect="move")},[s.items]),Y=v.useCallback(()=>{E(null),B(null),ee.current=null},[]),de=v.useCallback(L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},[]),he=v.useCallback(L=>{E(L)},[]),te=v.useCallback(()=>{E(null)},[]),H=v.useCallback((L,le)=>{L.preventDefault(),E(null);const ie=L.dataTransfer.getData("text/plain"),D=s.items.find(b=>b.id===ie);D&&D.stage!==le&&(p&&!p(D,le)||c(ie,le))},[s.items,p,c]),pe=cr(s,o),Ee=sx(s,o),me=oa(s,o).map(L=>({id:L.id,label:L.name,color:Hu(L).color,gate:pe.has(L.id)})),R={all:()=>!0,attention:L=>{const le=La(L,s,o);return le==="waiting"||le==="blocked"},running:L=>La(L,s,o)==="running",queued:L=>La(L,s,o)==="idle",done:L=>Ee.has(L.stage)},re=R[g]||R.all,ce=s.items.filter(re),Se=$0(g);function z(L){const le=s.items.filter(A=>A.stage===L.id).filter(re),ie=j===L.id,D=L.gate,b=s.items.some(A=>A.stage===L.id);return l.jsxs("div",{className:"flex min-h-[200px] w-[18rem] min-w-[18rem] flex-none flex-col gap-2 xl:w-[19.5rem] xl:min-w-[19.5rem]",children:[l.jsx("div",{className:"app-board-column-header flex items-center justify-between px-1 pb-1","data-gate":D&&b?"true":"false",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[D&&b?l.jsx("div",{className:"w-2 h-4 rounded-full bg-[var(--color-success)] animate-timeline-dot"}):l.jsx("div",{className:"w-1.5 h-4 rounded-full",style:{background:L.color}}),l.jsx("span",{className:xt("min-w-0 truncate text-xs font-semibold",D&&b&&"text-[var(--color-success)]"),children:L.label}),l.jsx(ke,{variant:D&&b?"amber":"info",className:xt("shrink-0 text-caption px-1.5",D&&b&&"animate-pulse"),children:s.items.filter(A=>A.stage===L.id).length})]})}),l.jsxs("div",{className:"app-board-dropzone flex flex-col gap-2 p-2","data-over":ie?"true":"false","data-gate":D&&b?"true":"false",onDragOver:de,onDragEnter:()=>he(L.id),onDragLeave:te,onDrop:A=>H(A,L.id),children:[le.length===0&&!ie&&l.jsx("div",{className:"flex items-center justify-center h-full py-4",children:l.jsx("span",{className:"app-board-empty text-[11px]",children:"Vazio"})}),le.map(A=>l.jsx(W0,{item:A,workflow:s,activeFlow:o,specs:J,onClick:()=>u(A.id),onDragStart:$=>ve($,A.id),onDragEnd:Y},A.id)),D&&b&&l.jsxs("div",{className:"app-board-gate-banner mt-1 pt-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-caption mb-1.5 px-1",children:[l.jsx(C,{name:"clock",size:10,style:{color:"var(--color-success)"}}),l.jsx("span",{style:{color:"var(--color-success)"},className:"font-medium",children:"Aprovação necessária"})]}),le.map(A=>l.jsx("div",{className:"mb-2",children:l.jsx(K0,{itemId:A.id,onDecided:m})},A.id))]})]})]},L.id)}return l.jsxs("div",{className:xt("flex min-h-0 min-w-0 flex-1 flex-col gap-4 p-4",N),children:[ce.length===0?l.jsxs("div",{className:"app-board-filter-empty flex min-h-[16rem] flex-1 flex-col items-center justify-center gap-3 rounded-[var(--radius-lg)] border border-dashed border-[var(--color-border)] p-6 text-center",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-[var(--color-bg-sunken)] text-[var(--color-text-secondary)]",children:l.jsx(C,{name:g==="attention"?"shield":g==="running"?"cpu":g==="done"?"check-circle":"circle",size:18})}),l.jsxs("div",{className:"grid max-w-sm gap-1",children:[l.jsx("p",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:Se.title}),l.jsx("p",{className:"text-caption leading-snug text-[var(--color-text-secondary)]",children:Se.description})]})]}):l.jsx("div",{className:"flex min-w-max gap-4 overflow-x-auto pb-2 [scrollbar-width:thin]",children:me.map(z)}),y&&l.jsx("div",{className:"flex justify-center",children:l.jsxs(F,{variant:"secondary",size:"sm",onClick:y,children:[l.jsx(C,{name:"plus",size:14}),"Adicionar item"]})})]})}function I0(s){const o=new Date(s).getTime();return Number.isNaN(o)?0:Math.max(0,Math.floor((Date.now()-o)/864e5))}function P0(s){return s===0?"Hoje":s===1?"1d no fluxo":`${s}d no fluxo`}function ej(s,o){return s==="waiting"?{statusLabel:"Decisão",actionLabel:"Revisar gate",tone:"warning",badgeVariant:"amber",icon:"clock",priority:0}:s==="blocked"?{statusLabel:"Bloqueio",actionLabel:"Examinar causa",tone:"danger",badgeVariant:"error",icon:"shield",priority:1}:s==="running"?{statusLabel:"Em execução",actionLabel:"Acompanhar",tone:"info",badgeVariant:"agent",icon:"chevron-right",priority:2}:s==="done"?{statusLabel:"Concluído",actionLabel:"Ver evidência",tone:"success",badgeVariant:"success",icon:"check-circle",priority:o>14?5:4}:{statusLabel:o>=14?"Maior espera":"Na fila",actionLabel:"Avaliar prioridade",tone:"default",badgeVariant:"info",icon:"circle",priority:o>=14?3:6}}function tj({workflow:s,activeFlow:o,onSelectItem:u}){const c=s.items,d=oa(s,o),m=c.map(x=>{var B,J;const y=d.find(P=>P.id===x.stage),g=y?Hu(y):null,N=La(x,s,o),j=I0(x.createdAt),E=ej(N,j),M=Bu(x,[],s);return{id:`signal-${x.id}-${x.stage}`,itemId:x.id,title:((B=x.description)==null?void 0:B.trim())||M,subtitle:x.spec??M,owner:x.claimedBy??((J=y==null?void 0:y.roles[0])==null?void 0:J.label)??"Não atribuído",age:P0(j),stage:(y==null?void 0:y.name)??x.stage,...E,icon:(g==null?void 0:g.icon)??E.icon,createdAt:new Date(x.createdAt).getTime()}}).sort((x,y)=>x.priority-y.priority||y.createdAt-x.createdAt).slice(0,6),p=m.filter(x=>x.priority<=3).length;return m.length===0?l.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[l.jsx("h3",{className:"app-section-muted text-xs font-semibold uppercase tracking-wider",children:"O que observar agora"}),l.jsx("p",{className:"app-section-muted text-xs",children:"Nenhum item para observar agora."})]}):l.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[l.jsxs("div",{className:"grid gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("h3",{className:"app-section-muted text-xs font-semibold uppercase tracking-wider",children:"O que observar agora"}),l.jsxs(ke,{variant:p>0?"amber":"info",tone:"soft",className:"tabular-nums",children:[p," prioridade",p===1?"":"s"]})]}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:"Decisões, bloqueios e esperas aparecem antes do restante."})]}),l.jsx(rl,{className:"gap-2",children:m.map(x=>l.jsx(il,{tone:x.tone,className:"grid-cols-1 items-start p-3 sm:grid-cols-1",meta:l.jsxs(l.Fragment,{children:[l.jsx(ke,{variant:x.badgeVariant,tone:"soft",icon:x.icon,children:x.statusLabel}),l.jsx(Je,{children:x.stage}),l.jsx(Je,{children:x.age})]}),title:l.jsx("span",{className:"line-clamp-2",children:x.title}),description:l.jsxs("span",{className:"grid gap-1",children:[l.jsx("span",{className:"truncate font-mono",children:x.subtitle}),l.jsxs("span",{className:"truncate",children:[x.owner," · ",x.actionLabel]})]}),action:u?l.jsxs(F,{type:"button",variant:"secondary",size:"sm",className:"w-full justify-between text-caption",onClick:()=>u(x.itemId),"aria-label":`Abrir ${x.itemId}`,children:["Abrir",l.jsx(C,{name:"chevron-right",size:12})]}):null},x.id))}),c.length>m.length&&l.jsxs("p",{className:"app-section-muted text-caption text-center",children:["Mostrando 6 de ",c.length," itens"]})]})}function ix(s){let o,u=!1,c=1e3,d=null;const m=new Map;function p(j,E){var M;m.has(j)||m.set(j,new Set),(M=m.get(j))==null||M.add(E),o.addEventListener(j,E)}function x(j,E){var M;(M=m.get(j))==null||M.delete(E),o.removeEventListener(j,E)}function y(){u=!0,d&&clearTimeout(d),o.close()}function g(){u||(console.warn(`[SSE] Reconnecting in ${c/1e3}s...`),d=setTimeout(()=>{N(),c=Math.min(c*2,3e4)},c))}function N(){u||(o=new EventSource(s),o.onopen=()=>{c=1e3,console.warn("[SSE] Connected")},m.forEach((j,E)=>{for(const M of j)o.addEventListener(E,M)}),o.onerror=()=>{o.close(),g()})}return N(),new Proxy({},{get(j,E){return E==="addEventListener"?p:E==="removeEventListener"?x:E==="close"?y:Reflect.get(o,E)},set(j,E,M){return Reflect.set(o,E,M)}})}function aj(s){const o=new Date(s).getTime();return Number.isNaN(o)?0:Math.max(0,Math.floor((Date.now()-o)/864e5))}function lj(s){return s==="waiting"?{label:"Aguardando decisão",action:"Revisar o gate antes de avançar.",tone:"warning",badge:"amber",icon:"clock"}:s==="blocked"?{label:"Bloqueado",action:"Examinar a causa do bloqueio.",tone:"danger",badge:"error",icon:"shield"}:s==="running"?{label:"Em execução",action:"Acompanhar o responsável e evidências.",tone:"info",badge:"agent",icon:"chevron-right"}:s==="done"?{label:"Concluído",action:"Verificar evidências registradas.",tone:"success",badge:"success",icon:"check-circle"}:{label:"Na fila",action:"Avaliar prioridade e próximo responsável.",tone:"default",badge:"info",icon:"circle"}}function nj({item:s,workflow:o,activeFlow:u,specs:c,onClose:d,onItemMoved:m,onOpenSpec:p}){var T,Q,oe,De;const x=v.useRef(null),y=v.useRef(null),[g,N]=v.useState(""),[j,E]=v.useState(null),[M,B]=v.useState(!0),[J,P]=v.useState([]),[ee,ue]=v.useState(!1),[ve,Y]=v.useState(!1),[de,he]=v.useState(!1),[te,H]=v.useState(!1),pe=Bu(s,c,o),Ee=((T=s.description)==null?void 0:T.trim())||pe,me=oa(o,u),R=me.find(ne=>ne.id===s.stage),re=s.spec?c.find(ne=>ne.id===s.spec):null,ce=re?X0(re.content):null,Se=s.tasks&&s.tasks.length>0,z=ce?ce.total:Se?((Q=s.tasks)==null?void 0:Q.length)??0:0,L=ce?ce.done:Se?((oe=s.tasks)==null?void 0:oe.filter(ne=>ne.done).length)??0:0,le=aj(s.createdAt),ie=La(s,o,u),D=lj(ie),b=R?Bi(R):"Item registrado no fluxo.",A=s.claimedBy??((De=R==null?void 0:R.roles[0])==null?void 0:De.label)??"Não atribuído",$=me.filter(ne=>ne.id!==s.stage);v.useEffect(()=>{var ne;return y.current=document.activeElement,(ne=x.current)==null||ne.focus(),()=>{var be;(be=y.current)==null||be.focus()}},[]),v.useEffect(()=>{const ne='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function be(xe){const q=x.current;if(!q)return;if(xe.key==="Escape"){d();return}if(xe.key!=="Tab")return;const we=q.querySelectorAll(ne);if(we.length===0)return;const Oe=we[0],kt=we[we.length-1];xe.shiftKey&&document.activeElement===Oe?(xe.preventDefault(),kt.focus()):!xe.shiftKey&&document.activeElement===kt&&(xe.preventDefault(),Oe.focus())}return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[d]),v.useEffect(()=>{const ne=ix("/events");return ne.addEventListener("workflow-updated",be=>{try{const xe=JSON.parse(be.data);if(xe.itemId===s.id&&xe.stage&&xe.stage!==s.stage){const q=me.find(we=>we.id===xe.stage);E(`${s.id} movido para ${(q==null?void 0:q.name)??xe.stage}`),(q==null?void 0:q.zone)==="done"&&setTimeout(()=>d(),3e3)}}catch{}}),()=>ne.close()},[s.id,s.stage,d,me]),v.useEffect(()=>{const ne=setTimeout(()=>B(!1),150);return()=>clearTimeout(ne)},[]),v.useEffect(()=>{fetch(`/api/log?item=${s.id}&limit=100`).then(ne=>ne.json()).then(ne=>{ne.entries&&P(ne.entries)}).catch(()=>{}).finally(()=>ue(!0))},[s.id]);const I=v.useCallback(()=>{g&&fetch(`/api/items/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stage:g})}).then(()=>{m(),N("")})},[s.id,g,m]),fe=v.useCallback(()=>{fetch(`/api/items/${s.id}`,{method:"DELETE"}).then(()=>{m(),d()})},[s.id,d,m]),V=v.useCallback((ne,be)=>{var xe;fetch(`/api/items/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tasks:(xe=s.tasks)==null?void 0:xe.map(q=>q.id===ne?{...q,done:be}:q)})}).then(()=>m())},[s.id,s.tasks,m]);return l.jsxs(l.Fragment,{children:[l.jsxs(ls,{open:!0,onClose:d,title:Ee,variant:"fullscreen",hideHeader:!0,contentRef:x,className:"animate-fade-in",children:[j&&l.jsxs("div",{className:"app-warning-banner flex shrink-0 items-center gap-2 px-4 py-2 text-sm",children:[l.jsx(C,{name:"alert-triangle",size:14}),l.jsx("span",{children:j}),l.jsx(F,{onClick:()=>E(null),className:"ml-auto",size:"sm",variant:"ghost","aria-label":"Dispensar aviso",children:l.jsx(C,{name:"x",size:14})})]}),l.jsxs("header",{className:"app-header-surface flex shrink-0 items-start gap-3 px-5 py-4",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[l.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[l.jsx(ke,{variant:"info",tone:"soft",className:"font-mono",children:s.id}),l.jsx(ke,{variant:D.badge,tone:"soft",icon:D.icon,children:D.label}),l.jsx(Je,{children:(R==null?void 0:R.name)??s.stage})]}),l.jsx("h2",{className:"line-clamp-2 text-lg font-semibold leading-snug text-[var(--color-text-primary)]",children:Ee}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:s.spec??pe})]}),s.spec&&p&&l.jsxs(F,{size:"sm",variant:"secondary",onClick:p,children:[l.jsx(C,{name:"file-text",size:14}),"Abrir especificação"]}),l.jsx(F,{onClick:d,size:"sm",variant:"ghost","aria-label":"Fechar",children:l.jsx(C,{name:"x",size:16})})]}),l.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]",children:[l.jsxs("aside",{className:"app-section-card hidden min-h-0 flex-col gap-4 overflow-y-auto rounded-none border-y-0 border-l-0 p-4 lg:flex",children:[l.jsx(tr,{tone:D.tone,density:"compact",icon:l.jsx(C,{name:D.icon,size:16}),title:"Próxima ação",description:`${D.action} ${b}`}),l.jsx(it,{children:l.jsxs(ot,{className:"gap-3 p-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Estado do trabalho"}),l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:z>0?`${L}/${z}`:"sem checklist"})]}),z>0&&l.jsx(Ou,{value:L,max:z,size:"sm",state:ie==="done"?"complete":ie==="blocked"?"error":ie==="waiting"?"warning":"default"}),l.jsx(Ea,{className:"grid-cols-1",items:[{label:"Responsável",value:A},{label:"Tempo no fluxo",value:le===0?"Hoje":`${le}d`},{label:"Evidência",value:re?re.id:"Sem especificação vinculada"}]})]})}),l.jsx(it,{children:l.jsxs(ot,{className:"gap-3 p-4",children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Movimentação"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(hu,{value:g,onValueChange:N,children:[l.jsx(pu,{className:"app-select-surface flex-1 text-xs","aria-label":"Mover para",children:l.jsx(Ph,{placeholder:"Mover para..."})}),l.jsx(xu,{children:$.map(ne=>l.jsx(Ps,{value:ne.id,children:ne.name},ne.id))})]}),l.jsx(F,{size:"sm",disabled:!g,onClick:I,children:"Mover"})]}),s.spec&&p&&l.jsxs(F,{size:"sm",variant:"secondary",onClick:p,children:[l.jsx(C,{name:"file-text",size:14}),"Abrir especificação vinculada"]}),l.jsxs(rr,{open:de,onOpenChange:he,children:[l.jsxs(ir,{className:"app-section-muted flex w-full items-center gap-2 text-xs font-semibold",children:[l.jsx(C,{name:"chevron-right",size:12,className:xt("transition-transform",de&&"rotate-90")}),"Ações avançadas"]}),l.jsx(or,{className:"mt-2",children:l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>H(!0),className:"app-danger-text w-full justify-start",children:[l.jsx(C,{name:"trash",size:14}),"Excluir item"]})})]})]})}),l.jsx(rj,{activities:J,loaded:ee,open:ve,onOpenChange:Y})]}),l.jsx("main",{className:"flex min-h-0 flex-col overflow-hidden",children:l.jsx("div",{className:"app-section-shell flex min-h-0 flex-1 overflow-y-auto p-5",children:l.jsxs("div",{className:"mx-auto grid w-full max-w-5xl gap-4",children:[l.jsx(tr,{className:"lg:hidden",tone:D.tone,icon:l.jsx(C,{name:D.icon,size:18}),title:D.label,description:`${D.action} ${b}`,meta:l.jsxs(l.Fragment,{children:[l.jsx(Je,{children:A}),l.jsx(Je,{children:le===0?"Hoje no fluxo":`${le}d no fluxo`})]}),action:s.spec&&p?l.jsxs(F,{size:"sm",variant:"secondary",onClick:p,children:[l.jsx(C,{name:"file-text",size:14}),"Abrir especificação"]}):null}),Se&&l.jsx(sj,{item:s,onToggle:V}),l.jsx(it,{children:l.jsxs(ot,{className:"gap-4 p-5",children:[l.jsx("div",{className:"flex items-center justify-between gap-2",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-body-sm font-semibold",children:"Evidência vinculada"}),l.jsx("p",{className:"text-caption text-[var(--color-text-secondary)]",children:re?re.id:"Nenhuma especificação vinculada a este item."})]})}),M?l.jsxs("div",{className:"grid gap-3",children:[l.jsx(un,{className:"h-6 w-48"}),l.jsx(un,{className:"h-4 w-full"}),l.jsx(un,{className:"h-4 w-3/4"}),l.jsx(un,{className:"h-20 w-full"})]}):re?l.jsx("div",{className:"max-w-none rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-base)] p-4",children:l.jsx(Rl,{content:re.content})}):l.jsx("div",{className:"flex min-h-48 items-center justify-center rounded-[var(--radius-md)] border border-dashed border-[var(--color-border)]",children:l.jsxs("div",{className:"grid justify-items-center gap-2 text-center",children:[l.jsx(C,{name:"file-text",size:24,className:"app-section-muted"}),l.jsx("p",{className:"app-section-muted text-sm",children:s.spec?"Especificação não encontrada":"Nenhuma especificação vinculada"})]})})]})})]})})})]}),l.jsxs("div",{className:"app-section-card flex shrink-0 items-center gap-2 rounded-none border-x-0 border-b-0 px-4 py-3 lg:hidden",children:[l.jsxs(hu,{value:g,onValueChange:N,children:[l.jsx(pu,{className:"app-select-surface flex-1 text-xs","aria-label":"Mover para",children:l.jsx(Ph,{placeholder:"Mover para..."})}),l.jsx(xu,{children:$.map(ne=>l.jsx(Ps,{value:ne.id,children:ne.name},ne.id))})]}),l.jsx(F,{size:"sm",disabled:!g,onClick:I,children:"Mover"})]})]}),l.jsx(Du,{open:te,onClose:()=>H(!1),onConfirm:fe,title:"Excluir item",message:`Excluir ${s.id} remove este item do fluxo. Esta ação deve ser usada apenas quando o item não representa mais trabalho real.`,confirmLabel:"Excluir",cancelLabel:"Cancelar",variant:"danger"})]})}function sj({item:s,onToggle:o}){return!s.tasks||s.tasks.length===0?null:l.jsx(it,{children:l.jsxs(ot,{className:"gap-3 p-4",children:[l.jsxs("h3",{className:"text-body-sm font-semibold",children:["Tarefas (",s.tasks.filter(u=>u.done).length,"/",s.tasks.length,")"]}),l.jsx("div",{className:"grid gap-1",children:s.tasks.map(u=>l.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-[var(--radius-sm)] px-1 py-1 text-xs hover:bg-[var(--surface-hover)]",children:[l.jsx(as,{checked:u.done,onChange:c=>o(u.id,c.target.checked)}),l.jsx("span",{className:xt("text-[var(--color-text-primary)]",u.done&&"text-[var(--color-text-secondary)] line-through"),children:u.description})]},u.id))})]})})}function rj({activities:s,loaded:o,open:u,onOpenChange:c}){return l.jsx(it,{children:l.jsx(ot,{className:"gap-3 p-4",children:l.jsxs(rr,{open:u,onOpenChange:c,children:[l.jsxs(ir,{className:"app-section-muted flex w-full items-center gap-2 text-xs font-semibold",children:[l.jsx(C,{name:"chevron-right",size:12,className:xt("transition-transform",u&&"rotate-90")}),"Log de eventos",o&&l.jsxs("span",{className:"text-caption font-normal",children:["(",s.length,")"]})]}),l.jsx(or,{className:"mt-3",children:l.jsx("div",{className:"grid max-h-72 gap-2 overflow-y-auto",children:o?s.length===0?l.jsx("p",{className:"app-section-muted text-xs",children:"Nenhum evento registrado para este item."}):s.map(d=>l.jsxs("div",{className:"grid gap-0.5 border-l-2 border-[var(--color-primary)] pl-2",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"app-primary-text text-caption font-medium uppercase",children:d.action}),l.jsx("span",{className:"app-section-muted text-caption",children:new Date(d.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),l.jsx("p",{className:"text-xs leading-relaxed",children:d.description})]},d.id)):l.jsx("p",{className:"app-section-muted text-xs",children:"Carregando..."})})})]})})})}function ij({workflow:s,activeFlow:o,specRefreshKey:u,onItemMoved:c,onOpenSpec:d}){var Yt;const[m,p]=v.useState(null),[x,y]=v.useState([]),[g,N]=v.useState(!1),[j,E]=v.useState(!1),[M,B]=v.useState(null),[J,P]=v.useState(s.webhooks??[]),[ee,ue]=v.useState(null),[ve,Y]=v.useState("all"),[de,he]=v.useState(()=>{try{return localStorage.getItem("letra-observation-panel")!=="false"}catch{return!0}}),te=cr(s,o),H=sx(s,o),pe=oa(s,o),Ee=()=>{const Z=!de;he(Z);try{localStorage.setItem("letra-observation-panel",String(Z))}catch{}},me=v.useCallback(()=>{fetch("/api/specs").then(Z=>Z.json()).then(Z=>{Array.isArray(Z)&&y(Z)}).catch(()=>{})},[]);v.useEffect(()=>{me()},[me,u]),v.useEffect(()=>{function Z(Te){const Le=Te.detail;if(!Le)return;s.items.some(pt=>pt.id===Le)&&p(Le)}return window.addEventListener("letra-open-item",Z),()=>window.removeEventListener("letra-open-item",Z)},[s.items]),v.useEffect(()=>{P(s.webhooks??[])},[s.webhooks]);const R=m?s.items.find(Z=>Z.id===m):null;R&&pe.find(Z=>Z.id===R.stage),R!=null&&R.spec&&x.find(Z=>Z.id===R.spec);const re=R?y0(R.stage,s,o):null;re&&((Yt=pe.find(Z=>Z.id===re))==null||Yt.name);function ce(Z,Te){const Le=s.stages.find(at=>at.id===Z.stage);return!Le||!Le.allow||Le.allow.length===0?!0:!(!Le.allow.includes(Te)||te.has(Te))}function Se(Z){const Te=s.stages.find(Le=>Le.id===Z.stage);return(Te==null?void 0:Te.validate)??[]}const{toast:z}=lr();function L(Z,Te){if(te.has(Te)){fetch(`/api/items/${Z}/gate-decisions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:"approve"})}).then(Le=>Le.json().then(at=>({ok:Le.ok,data:at}))).then(({ok:Le,data:at})=>{if(!Le){z(at.error||"Não foi possível registrar a decisão.","error");return}z("Decisão aprovada e registrada.","success"),c(),m===Z&&p(null)}).catch(()=>z("Erro ao registrar decisão.","error"));return}fetch(`/api/items/${Z}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stage:Te})}).then(Le=>{if(!Le.ok)throw new Error("Falha ao mover item");c(),m===Z&&p(null)}).catch(()=>z("Erro ao mover item.","error"))}function le(Z,Te){const Le=s.items.find(pt=>pt.id===Z);if(!Le||Le.stage===Te||!ce(Le,Te))return;const at=Se(Le);if(at.length>0){ue({itemId:Z,targetStage:Te,pendingChecks:at.map(()=>!1)});return}L(Z,Te)}function ie(){ee&&(L(ee.itemId,ee.targetStage),ue(null))}function D(){R&&fetch(`/api/items/${R.id}`,{method:"DELETE"}).then(()=>{c(),p(null)})}function b(Z){var Le;const Te=(Le=pe[0])==null?void 0:Le.id;Te&&fetch("/api/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:Z.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),description:Z.trim(),stage:Te})}).then(at=>at.json()).then(at=>{at&&!at.error&&c()})}function A(){fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({webhooks:J})}).then(Z=>Z.json()).then(()=>{B(null),c()})}function $(){const Z=`wh-${Date.now()}`;P(Te=>[...Te,{id:Z,url:"",events:["item.moved"],label:""}])}function I(Z,Te,Le){P(at=>{const pt=[...at];return pt[Z]={...pt[Z],[Te]:Le},pt})}function fe(Z){P(Te=>Te.filter((Le,at)=>at!==Z))}const V=s.items.length,T=s.items.map(Z=>({item:Z,state:La(Z,s,o)})),Q=T.filter(({state:Z})=>Z==="done").length,oe=V>0?Math.round(Q/V*100):0,De=s.items.filter(Z=>Z.claimedBy&&!H.has(Z.stage)).length,ne=T.filter(({state:Z})=>Z==="waiting").length,be=T.filter(({state:Z})=>Z==="blocked").length,xe=ne+be,q=T.filter(({state:Z})=>Z==="running").length,we=T.filter(({state:Z})=>Z==="idle").length;N0(s,o).map(Z=>({...Z,pct:Z.status==="done"?100:0,isRunning:Z.status==="running",isHumanGate:Z.presentation.isHumanGate})).findIndex(Z=>Z.itemCount>0&&!H.has(Z.id)&&Z.zone!=="todo");const kt=s.items.filter(Z=>Z.claimedBy).reduce((Z,Te)=>((Z[Te.claimedBy]=Z[Te.claimedBy]||[]).push(Te),Z),{}),ht=["var(--color-primary)","var(--color-warning)","var(--color-primary)","var(--color-success)","var(--color-danger)"],Vt={all:V,attention:xe,running:q,queued:we,done:Q},Pt=[{key:"all",label:"Todos"},{key:"attention",label:"Precisa de atenção"},{key:"running",label:"Em andamento"},{key:"queued",label:"Na fila"},{key:"done",label:"Concluídos"}],ol=M==="webhooks",Ie=s.items.find(Z=>te.has(Z.stage))??s.items.find(Z=>La(Z,s,o)==="blocked")??s.items.find(Z=>Z.claimedBy&&!H.has(Z.stage))??s.items.find(Z=>!H.has(Z.stage))??s.items[0]??null,ca=Ie?pe.find(Z=>Z.id===Ie.stage):null,tt=Ie?La(Ie,s,o):null,Ul=tt==="blocked"?"danger":tt==="waiting"?"warning":tt==="done"?"success":"info",cl=tt==="blocked"?"Examinar bloqueio":tt==="waiting"?"Revisar decisão":Ie?"Abrir trabalho em foco":"Criar item",Hl=Ie?`${Ie.description||Ie.id} está em ${(ca==null?void 0:ca.name)??Ie.stage}. ${Ie.claimedBy?`${Ie.claimedBy} está responsável por este trabalho.`:"Nenhum responsável declarado."}`:"Nenhum item foi criado neste fluxo. Crie o primeiro item quando houver trabalho supervisionável.";return l.jsxs("div",{className:"app-section-shell min-w-0",children:[l.jsx(nx,{title:"Trabalho",description:`${V} itens · ${xe} atenção`,left:l.jsx(C,{name:"grid",size:20}),right:l.jsxs(l.Fragment,{children:[l.jsxs(ke,{icon:"cpu",variant:De>0?"agent":"info",tone:"soft",children:[De," em andamento"]}),l.jsxs(ke,{icon:"shield",variant:xe>0?be>0?"error":"amber":"info",tone:"soft",children:[xe," atenção"]}),l.jsxs(F,{variant:de?"secondary":"ghost",size:"sm",onClick:Ee,className:"h-8 px-2 text-caption",children:[l.jsx(C,{name:"list-three",size:12}),"Observar"]}),l.jsx(Jy,{children:({open:Z,setOpen:Te})=>l.jsxs(l.Fragment,{children:[l.jsxs($y,{className:"h-8 px-2 text-caption",onClick:()=>Te(!Z),children:[l.jsx(C,{name:"settings",size:12}),"Administração"]}),Z?l.jsxs(Wy,{align:"end",className:"min-w-48",children:[l.jsx(Iy,{children:"Operações do fluxo"}),l.jsxs(Ih,{onClick:()=>{N(!0),Te(!1)},children:[l.jsx(C,{name:"plus",size:12}),"Novo item"]}),l.jsx(Fy,{}),l.jsxs(Ih,{onClick:()=>{B("webhooks"),Te(!1)},children:[l.jsx(C,{name:"activity",size:12}),"Configurar webhooks"]})]}):null]})})]})}),l.jsxs("div",{className:"flex min-w-0 flex-1 overflow-hidden",children:[ol?l.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:l.jsxs("div",{className:"flex flex-col gap-3 max-w-2xl",children:[l.jsx("p",{className:"app-section-muted text-xs font-medium",children:"Configure webhooks para receber notificações quando itens forem movidos entre estágios."}),J.map((Z,Te)=>l.jsx("div",{className:"app-section-card p-3",children:l.jsx("div",{className:"flex flex-col gap-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Dt,{value:Z.label??"",onChange:Le=>I(Te,"label",Le.target.value||void 0),placeholder:"Label",className:"app-input-surface flex-1 text-sm px-2 py-1 rounded border-none focus:outline-none focus:ring-2 focus:ring-primary/30"}),l.jsx(F,{onClick:()=>fe(Te),className:"app-danger-button text-xs px-2 py-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30","aria-label":"Remover webhook",children:l.jsx(C,{name:"x",size:12})})]})})},Z.id)),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(F,{size:"sm",variant:"secondary",onClick:$,children:"Adicionar webhook"}),l.jsx(F,{size:"sm",onClick:A,children:"Salvar"}),l.jsx(F,{size:"sm",variant:"secondary",onClick:()=>{B(null),P(s.webhooks??[])},children:"Voltar"})]})]})}):l.jsxs("div",{className:"flex min-w-0 flex-1 overflow-y-hidden",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-y-auto p-3 sm:p-4 gap-3",children:[l.jsx(tr,{className:"min-w-0",tone:Ul,icon:l.jsx(C,{name:tt==="blocked"?"shield":tt==="waiting"?"clock":"grid",size:20}),title:Ie?`Próximo trabalho seguro: ${Ie.id}`:"Nenhum trabalho em foco",description:Hl,meta:l.jsxs(l.Fragment,{children:[Ie?l.jsx(ke,{variant:"info",tone:"soft",children:(ca==null?void 0:ca.name)??Ie.stage}):null,Ie!=null&&Ie.claimedBy?l.jsx(Je,{children:Ie.claimedBy}):null]}),action:l.jsx(F,{size:"sm",onClick:()=>{Ie?p(Ie.id):N(!0)},children:cl}),secondaryAction:Ie?l.jsx(F,{size:"sm",variant:"secondary",onClick:()=>N(!0),children:"Novo item"}):null}),l.jsx("div",{className:"grid shrink-0 grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Atenção",value:xe,sub:be>0?`${be} bloqueado${be===1?"":"s"}`:"decisão humana",color:xe>0?"var(--color-warning)":"var(--color-text-secondary)",icon:"shield",urgent:xe>0},{label:"Em andamento",value:q,sub:`${De} ator${De===1?"":"es"} ativo${De===1?"":"s"}`,color:"var(--color-primary)",icon:"cpu",pulse:q>0},{label:"Na fila",value:we,sub:"sem responsável",color:"var(--color-text-secondary)",icon:"circle"},{label:"Progresso",value:`${oe}%`,sub:`${Q}/${V} concluídos`,color:"var(--color-primary)",icon:"bar-chart"}].map(Z=>l.jsx(it,{className:"app-summary-card hover:shadow-sm","data-urgent":Z.urgent?"true":"false",children:l.jsxs(ot,{className:"grid gap-0.5 p-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"app-section-muted text-caption font-medium uppercase tracking-wider",children:Z.label}),Z.icon&&l.jsx(C,{name:Z.icon,size:10,style:{color:Z.color}})]}),l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:xt("text-lg font-bold tabular-nums",Z.pulse&&"animate-pulse"),style:{color:Z.color},children:Z.value}),Z.pulse&&l.jsx("span",{className:"w-1 h-1 rounded-full bg-[var(--color-primary)] animate-pulse"})]}),l.jsx("span",{className:"app-section-muted text-caption",children:Z.sub})]})},Z.label))}),Object.keys(kt).length>0&&l.jsxs("div",{className:"min-w-0 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--color-text-primary)]",children:"Atores em andamento"}),l.jsxs("div",{className:"app-section-muted flex items-center gap-1 text-caption",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-primary)] animate-pulse"}),l.jsxs("span",{children:[De," ativo",De!==1?"s":""]})]})]}),l.jsx("div",{className:"flex min-w-0 gap-2 overflow-x-auto pb-1 scrollbar-none",children:Object.entries(kt).map(([Z,Te],Le)=>{const at=Te[0],pt=oa(s,o).find(Xt=>Xt.id===at.stage),ut=pt?Bi(pt):"Processando",Tt=Te.reduce((Xt,Ot)=>Ot.tasks?Xt+Ot.tasks.filter(Na=>Na.done).length:Xt,0),Ct=Te.reduce((Xt,Ot)=>{var Na;return Xt+(((Na=Ot.tasks)==null?void 0:Na.length)||0)},0),ua=Ct>0?Math.round(Tt/Ct*100):null,Qt=!te.has(at.stage)&&!H.has(at.stage);return l.jsxs("div",{className:xt("app-agent-card p-3 min-w-[160px] flex flex-col gap-1.5 shrink-0 transition-all hover:shadow-sm",Qt&&"animate-agent-breathe"),"data-running":Qt?"true":"false",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-caption font-bold",style:{background:`color-mix(in oklch, ${ht[Le%ht.length]} 20%, transparent)`,color:ht[Le%ht.length]},children:Z.charAt(0).toUpperCase()}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-xs font-semibold truncate",children:Z}),Qt&&l.jsx("span",{className:"w-1 h-1 rounded-full bg-[var(--color-primary)] animate-pulse"})]}),l.jsx("span",{className:"app-section-muted text-caption",children:ut})]})]}),l.jsxs("div",{className:"flex flex-col gap-0.5",children:[ua===null?l.jsx("span",{className:"app-section-muted text-caption",children:"Sem progresso declarado"}):l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Ou,{value:ua,max:100,size:"xs",className:"flex-1"}),l.jsxs("span",{className:"text-caption tabular-nums font-medium text-[var(--color-text-primary)]",children:[ua,"%"]})]}),l.jsxs("span",{className:"app-section-muted text-caption",children:[Te.length," ",Te.length===1?"item":"itens"]})]}),l.jsx("div",{className:xt("text-caption font-medium px-1.5 py-0.5 rounded-full self-start",Qt?"":"bg-muted text-muted-foreground"),style:Qt?{backgroundColor:"#282414",color:"#FFB800"}:void 0,children:Qt?"Em andamento":"Na fila"})]},Z)})})]}),l.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-1.5 overflow-x-auto pb-1 [scrollbar-width:thin]",children:l.jsx(Tu,{ariaLabel:"Filtrar trabalho",className:"w-max max-w-none flex-nowrap sm:w-auto sm:max-w-full sm:flex-wrap",children:Pt.map(({key:Z,label:Te})=>l.jsx(Mu,{selected:ve===Z,count:Vt[Z],onClick:()=>Y(Z),children:Te},Z))})}),l.jsx("div",{className:"app-section-card flex min-w-0 flex-1 flex-col overflow-hidden",children:l.jsx(F0,{workflow:s,activeFlow:o,onSelectItem:p,onDropItem:le,allowDrop:ce,specRefreshKey:u,filter:ve,onItemDecided:c})})]}),l.jsx("div",{className:xt("app-section-card shrink-0 overflow-y-auto transition-all duration-300 ease-in-out",de?"w-80 border-l opacity-100":"w-0 border-l-0 opacity-0 overflow-hidden"),children:l.jsx(tj,{workflow:s,activeFlow:o,onSelectItem:p})})]}),R&&l.jsx(nj,{item:R,workflow:s,activeFlow:o,specs:x,onClose:()=>p(null),onItemMoved:c,onOpenSpec:d})]}),l.jsx(Pp,{open:g,onClose:()=>N(!1),onSubmit:b,title:"Adicionar Item",label:"Nome do item",placeholder:"ex: my-feature",submitLabel:"Criar"}),l.jsx(Du,{open:j,onClose:()=>E(!1),onConfirm:D,title:"Excluir Item",message:`Tem certeza que deseja excluir ${R==null?void 0:R.id}?`,confirmLabel:"Excluir",cancelLabel:"Cancelar",variant:"danger"}),l.jsx(ls,{open:ee!==null,onClose:()=>ue(null),title:"Validação necessária",actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{onClick:()=>ue(null),className:"inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary/30 text-sm px-4 py-2 rounded-[var(--radius-sm)] border border-border bg-transparent hover:bg-muted text-foreground cursor-pointer",children:"Cancelar"}),l.jsx(F,{onClick:ie,disabled:!(ee!=null&&ee.pendingChecks.every(Boolean)),className:"app-primary-button inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary/30 text-sm px-4 py-2 rounded-[var(--radius-sm)] border border-transparent cursor-pointer disabled:opacity-50",children:"Mover"})]}),children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("p",{className:"app-section-muted text-xs mb-1",children:"Antes de mover, confirme os itens abaixo:"}),ee==null?void 0:ee.pendingChecks.map((Z,Te)=>{const Le=s.stages.find(pt=>pt.id===((R==null?void 0:R.stage)??"")),at=(Le==null?void 0:Le.validate)??[];return l.jsx(as,{checked:Z,label:at[Te]??`Check ${Te+1}`,onChange:pt=>{ue(ut=>{if(!ut)return ut;const Tt=[...ut.pendingChecks];return Tt[Te]=pt.target.checked,{...ut,pendingChecks:Tt}})}},Te)})]})})]})}const oj={l1:{title:"Contexto Principal",icon:"book",desc:"Arquivos fundamentais do projeto"},l2:{title:"Foco e Especificação",icon:"target",desc:"Foco atual e especificação ativa"},l3:{title:"Sinais e Estado",icon:"activity",desc:"Alertas, eventos e estado da sessão"},l4:{title:"Restrições e Regras",icon:"shield",desc:"Regras compiladas do sistema"}};function cj(){const[s,o]=v.useState(!1);return{copy:v.useCallback(async c=>{try{await navigator.clipboard.writeText(c),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[]),copied:s}}function Mi({layerKey:s,children:o,defaultOpen:u=!1}){const[c,d]=v.useState(u),m=oj[s];return l.jsxs(rr,{open:c,onOpenChange:d,children:[l.jsxs(ir,{className:"flex items-center gap-2.5 w-full text-left px-3 py-2.5 rounded-[var(--radius-sm)] text-sm transition-all duration-150 hover:bg-primary/5 active:scale-[0.98]",style:{color:"var(--color-text-primary)"},children:[l.jsx(C,{name:m.icon,size:16,className:"text-primary shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-semibold text-sm",children:m.title}),l.jsx("div",{className:"text-xs truncate",style:{color:"var(--color-text-secondary)"},children:m.desc})]}),l.jsx(C,{name:"chevron-down",size:16,style:{color:"var(--color-text-secondary)"},className:c?"rotate-180":""})]}),l.jsx(or,{className:"overflow-hidden transition-all duration-200",children:l.jsx("div",{className:"px-3 pb-3 pt-1",children:o})})]})}function uj({files:s}){return l.jsx("div",{className:"space-y-3",children:s.map(o=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(C,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:o.path})]}),o.content?l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Rl,{content:o.content})}):l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"(vazio)"})]},o.path))})}function dj({l2:s}){return l.jsxs("div",{className:"space-y-3",children:[s.focus&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(C,{name:"star",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/focus.md"}),s.focus.specName&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium",style:{backgroundColor:"var(--color-primary)",color:"var(--color-primary)"},children:s.focus.specName})]}),s.focus.content?l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Rl,{content:s.focus.content})}):l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"(sem conteúdo de foco)"})]}),s.spec&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(C,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:s.spec.path})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Rl,{content:s.spec.content})})]}),!s.focus&&!s.spec&&l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"Nenhum foco ou spec ativo no momento."})]})}function fj({l3:s}){return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(C,{name:"alert-triangle",size:12,className:"text-amber-500"}),l.jsxs("span",{children:[s.alertCount," alerta(s) ativo(s)"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(C,{name:"activity",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsxs("span",{children:[s.sessionEventCount," evento(s) na sessão"]})]})]}),s.alerts.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--color-text-secondary)"},children:"Alertas recentes"}),l.jsx("div",{className:"space-y-1",children:s.alerts.map(o=>l.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs",style:{backgroundColor:"var(--color-bg-surface)"},children:[l.jsx(C,{name:"alert-circle",size:12,style:{color:o.severity==="alta"?"var(--color-danger)":"var(--color-warning)"}}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"font-medium",children:o.id}),l.jsx("div",{style:{color:"var(--color-text-secondary)"},children:o.message})]})]},o.id))})]})]})}function mj({l4:s}){return l.jsxs("div",{className:"space-y-3",children:[s.constraintsContent&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(C,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/constraints.md"})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Rl,{content:s.constraintsContent})})]}),s.glossaryContent&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx(C,{name:"file-text",size:12,style:{color:"var(--color-text-secondary)"}}),l.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-text-secondary)"},children:".letra/glossary.md"})]}),l.jsx("div",{className:"p-3 rounded-[var(--radius-sm)] text-sm leading-relaxed",style:{backgroundColor:"var(--color-bg-surface)"},children:l.jsx(Rl,{content:s.glossaryContent})})]}),!s.constraintsContent&&!s.glossaryContent&&l.jsx("p",{className:"text-xs italic",style:{color:"var(--color-text-secondary)"},children:"Nenhuma regra ou restrição adicional."})]})}function hj(){const[s,o]=v.useState(null),[u,c]=v.useState(!0),{copy:d,copied:m}=cj();return v.useEffect(()=>{fetch("/api/harness-viewer").then(p=>p.ok?p.json():Promise.reject()).then(p=>{o(p),c(!1)}).catch(()=>{c(!1)})},[]),u?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm animate-pulse",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):s?l.jsxs("div",{className:"flex flex-col min-h-0 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b shrink-0",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Composição da Configuração"}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Camadas do prompt compilado para o agente"})]}),l.jsxs(F,{type:"button",onClick:()=>{const p=JSON.stringify(s,null,2);d(p)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-sm)] text-xs transition-all duration-150 hover:bg-primary/10 active:scale-95",style:{backgroundColor:"var(--color-bg-surface)"},"aria-label":"Copiar dados da configuração",children:[l.jsx(C,{name:m?"check":"copy",size:12}),m?"Copiado!":"Copiar"]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:[l.jsx(Mi,{layerKey:"l1",defaultOpen:!0,children:l.jsx(uj,{files:s.layers.l1})}),l.jsx(Mi,{layerKey:"l2",defaultOpen:!0,children:l.jsx(dj,{l2:s.layers.l2})}),l.jsx(Mi,{layerKey:"l3",children:l.jsx(fj,{l3:s.layers.l3})}),l.jsx(Mi,{layerKey:"l4",children:l.jsx(mj,{l4:s.layers.l4})})]})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Não foi possível carregar os dados da configuração."})})}const pj={read_code:"Ler código",write_code:"Escrever código",run_tests:"Executar testes",write_spec:"Escrever especificações",generate_doc:"Gerar documentação",comment_pr:"Comentar PR",suggest_changes:"Sugerir alterações",scan_dependencies:"Escaneiar dependências",report_findings:"Reportar vulnerabilidades",create_pr:"Criar PR",assign_reviewers:"Atribuir revisores"},xj={analyst:"search",builder:"code",reviewer:"info",security:"shield","pr-bot":"user"};function vj(){const[s,o]=v.useState([]),[u,c]=v.useState(!0);return v.useEffect(()=>{fetch("/api/harness/roles").then(d=>d.json()).then(d=>{Array.isArray(d)&&o(d),c(!1)}).catch(()=>{o([]),c(!1)})},[]),u?l.jsx("div",{className:"flex h-full items-center justify-center p-6",children:l.jsx("p",{className:"animate-pulse text-sm text-[var(--color-text-secondary)]",children:"Carregando papéis..."})}):s.length===0?l.jsx("div",{className:"flex h-full items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Nenhum papel configurado no harness."})}):l.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Papéis do Harness"}),l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Agentes disponíveis no fluxo e suas capacidades."})]}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:s.map(d=>l.jsx("div",{className:"app-section-card p-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--color-bg-sunken)]",children:l.jsx(C,{name:xj[d.id]??"user",size:16,className:"text-[var(--color-text-secondary)]"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-medium",children:d.label}),l.jsx(ke,{variant:"info",tone:"soft",className:"text-[10px]",children:d.id})]}),l.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-secondary)]",children:d.description}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(d.allowedStages??[]).map(m=>l.jsx(ke,{variant:"amber",tone:"soft",className:"text-[10px]",children:m},m))}),(d.capabilities??[]).length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-[var(--color-text-secondary)]",children:"Capacidades"}),l.jsx("div",{className:"flex flex-wrap gap-1",children:(d.capabilities??[]).map(m=>l.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-[var(--color-bg-sunken)] px-1.5 py-0.5 text-[10px] text-[var(--color-text-secondary)]",children:pj[m]||m},m))})]})]})]})},d.id))})]})}const gj=`# Spec: {{name}}
|
|
202
|
+
|
|
203
|
+
> Updated: {{date}}
|
|
204
|
+
|
|
205
|
+
## Outcome
|
|
206
|
+
|
|
207
|
+
O que o usuário consegue fazer quando isso estiver pronto.
|
|
208
|
+
|
|
209
|
+
## Constraints
|
|
210
|
+
|
|
211
|
+
- Limitação técnica ou de negócio
|
|
212
|
+
|
|
213
|
+
## Exclusions
|
|
214
|
+
|
|
215
|
+
O que explicitamente NÃO está neste escopo.
|
|
216
|
+
|
|
217
|
+
## Acceptance Criteria
|
|
218
|
+
|
|
219
|
+
- [ ] **Critério 1**: Descrição binária (passa/falha).
|
|
220
|
+
- [ ] **Critério 2**: Descrição binária (passa/falha).
|
|
221
|
+
|
|
222
|
+
## Context
|
|
223
|
+
|
|
224
|
+
Por que estamos construindo isso. Trade-offs considerados. Decisões anteriores relevantes.
|
|
225
|
+
`;function bj(s){const o=s.split(`
|
|
226
|
+
`),u=[];let c=!1;return o.forEach((d,m)=>{if(/^## Acceptance Criteria/.test(d))c=!0;else if(/^## /.test(d)&&c)c=!1;else if(c){const p=d.match(/^\s*-\s+\[(\s|x)\]\s+(.+)/i);p&&u.push({text:p[2],checked:p[1].toLowerCase()==="x",line:m})}}),u}function yj(s){const o=s.match(/## Outcome\s+([\s\S]*?)(?=\n## |$)/);return o?o[1].replace(/\*\*/g,"").replace(/\n+/g," ").trim():""}function jj(s){const o=[],u=["Outcome","Constraints","Exclusions","Acceptance Criteria","Context"];for(const d of u)new RegExp(`## ${d}`).test(s)||o.push({type:"error",msg:`Seção obrigatória ausente: ## ${d}`});const c=s.match(/## Acceptance Criteria\s+([\s\S]*?)(?=\n## |$)/);return c&&[...c[1].matchAll(/-\s+\[(\s|x)\]\s+/g)].length===0&&o.push({type:"warning",msg:"Critérios de aceite sem itens de checklist"}),s.length>3e3&&o.push({type:"warning",msg:"Especificação excede 3000 caracteres; considere manter enxuta"}),{id:"",issues:o,valid:o.filter(d=>d.type==="error").length===0}}function Nj(s,o,u){const c=s.split(`
|
|
227
|
+
`),m=c[o].match(/^(\s*-\s+\[)(\s|x)(\]\s+.*)/i);return m&&(c[o]=`${m[1]}${u?"x":" "}${m[3]}`),c.join(`
|
|
228
|
+
`)}function fp(s,o){const u=new Date().toISOString().split("T")[0];return s.replace(/(# Spec:?)\s*.*/,`$1 ${o}`).replace(/\{\{date\}\}/g,u)}function gu(s){const o=s.match(/> Updated:\s*(\d{4}-\d{2}-\d{2})/);return o?o[1]:""}function Sj(s){if(!s)return"";const[o,u,c]=s.split("-");return`${c}/${u}/${o}`}function wj(s){return s?s.valid?s.issues.some(o=>o.type==="warning")?"warning":"success":"danger":"neutral"}function Cj({tone:s}){return s==="danger"?l.jsx(C,{name:"x",size:14,className:"text-[var(--color-danger)]"}):s==="warning"?l.jsx(C,{name:"alert-triangle",size:14,className:"text-[var(--color-warning)]"}):s==="success"?l.jsx(C,{name:"check",size:14,className:"text-[var(--color-success)]"}):l.jsx(C,{name:"circle",size:14,className:"text-[var(--color-text-secondary)]"})}function zj({spec:s,selected:o,validation:u,onSelect:c,onValidate:d}){const m=wj(u),p=yj(s.content),x=Sj(gu(s.content)),y=(u==null?void 0:u.issues.filter(N=>N.type==="error").length)??0,g=(u==null?void 0:u.issues.filter(N=>N.type==="warning").length)??0;return l.jsx(F,{type:"button",variant:"ghost",onClick:c,onContextMenu:N=>{N.preventDefault(),d()},"aria-pressed":o,className:xt("h-auto w-full justify-start rounded-[var(--radius-sm)] border border-transparent px-3 py-3 text-left","hover:border-[var(--color-border)] hover:bg-[var(--surface-hover)]",o&&"border-[var(--color-border)] bg-[var(--surface-selected)] shadow-sm"),children:l.jsxs("span",{className:"grid min-w-0 flex-1 gap-2",children:[l.jsxs("span",{className:"flex min-w-0 items-start gap-2",children:[l.jsx("span",{className:"mt-0.5 shrink-0",children:l.jsx(Cj,{tone:m})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-sm font-semibold text-[var(--color-text-primary)]",children:s.id}),p?l.jsx("span",{className:"mt-1 line-clamp-2 block text-xs font-normal leading-snug text-[var(--color-text-secondary)]",children:p}):null]})]}),l.jsxs("span",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[u&&u.issues.length>0?l.jsxs(ke,{variant:u.valid?"amber":"error",tone:"soft",children:[y," erros · ",g," avisos"]}):u?l.jsx(ke,{variant:"success",children:"Válida"}):l.jsx(ke,{variant:"info",tone:"outline",children:"Não validada"}),x?l.jsx("span",{className:"text-caption tabular-nums text-[var(--color-text-secondary)]",children:x}):null]})]})})}function Ej(){var Ee,me;const{toast:s}=lr(),[o,u]=v.useState([]),[c,d]=v.useState(null),[m,p]=v.useState(""),[x,y]=v.useState("all"),[g,N]=v.useState(!1),[j,E]=v.useState(""),[M,B]=v.useState(new Map),J=v.useRef(new Set),P=v.useCallback(()=>{fetch("/api/specs").then(R=>R.json()).then(R=>{Array.isArray(R)&&u(R)}).catch(()=>{})},[]);v.useEffect(()=>{P()},[P]),v.useEffect(()=>{if(o.length===0)return;const R=new Map(M);let re=!1;for(const ce of o)if(!J.current.has(ce.id)){const Se=jj(ce.content);Se.id=ce.id,R.set(ce.id,Se),J.current.add(ce.id),re=!0}re&&B(R),!c&&!g&&d(o[0].id)},[o,c,g,M]);const ee=o.find(R=>R.id===c),ue=v.useMemo(()=>ee?bj(ee.content):[],[ee]),ve=ue.filter(R=>R.checked).length,de=[...o].sort((R,re)=>{const ce=gu(R.content),Se=gu(re.content);return!ce&&!Se?R.id.localeCompare(re.id):ce?Se?Se.localeCompare(ce):-1:1}).filter(R=>{if(m){const ce=m.toLowerCase();if(!R.id.toLowerCase().includes(ce)&&!R.content.toLowerCase().includes(ce))return!1}const re=M.get(R.id);switch(x){case"errors":return re&&!re.valid;case"warnings":return re==null?void 0:re.issues.some(ce=>ce.type==="warning");case"valid":return re==null?void 0:re.valid;default:return!0}});function he(R){d(R),N(!1)}function te(R){fetch(`/api/specs/${R}/validate`,{method:"POST"}).then(re=>re.json()).then(re=>{B(Se=>new Map(Se).set(R,re));const ce=re.issues.filter(Se=>Se.type==="error").length;ce===0?s("Spec válida","success"):s(`${ce} erro(s) encontrado(s)`,"error")})}function H(){if(!j.trim())return;const R=j.trim().toLowerCase().replace(/\s+/g,"-"),re=fp(gj,R);fetch("/api/specs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:R,content:re})}).then(ce=>ce.json()).then(ce=>{ce&&!ce.error&&(N(!1),E(""),d(R),P())})}function pe(R){return R==="all"?o.length:o.filter(re=>{const ce=M.get(re.id);switch(R){case"errors":return ce&&!ce.valid;case"warnings":return ce==null?void 0:ce.issues.some(Se=>Se.type==="warning");case"valid":return ce==null?void 0:ce.valid;default:return!0}}).length}return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden lg:flex-row",children:[l.jsxs("aside",{className:"app-surface-panel flex max-h-[46svh] w-full shrink-0 flex-col overflow-hidden border-b border-l-0 border-r-0 border-t-0 lg:max-h-none lg:w-[24rem] lg:border-b-0 lg:border-r",children:[l.jsxs("div",{className:"grid shrink-0 gap-3 border-b border-border p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Especificações"}),l.jsx("p",{className:"text-xs text-[var(--color-text-secondary)]",children:"Outcomes, constraints e critérios aprovados."})]}),l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>{N(!0),d(null)},children:[l.jsx(C,{name:"plus",size:14}),"Nova"]})]}),l.jsx(Dt,{placeholder:"Buscar especificações...",value:m,onChange:R=>p(R.target.value),"aria-label":"Buscar especificações"}),l.jsx("div",{className:"overflow-x-auto",tabIndex:0,children:l.jsx(Tu,{ariaLabel:"Filtrar especificações",className:"w-max flex-nowrap lg:w-full",children:[{id:"all",label:"Todas"},{id:"errors",label:"Erros"},{id:"warnings",label:"Avisos"},{id:"valid",label:"Válidas"}].map(R=>l.jsx(Mu,{selected:x===R.id,count:pe(R.id),onClick:()=>y(R.id),className:"justify-center lg:flex-1",title:R.id==="errors"?"Especificações com erro de validação":R.id==="warnings"?"Especificações com avisos":R.id==="valid"?"Especificações válidas":"Todas as especificações",children:R.label},R.id))})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-2",tabIndex:0,children:[g?l.jsxs("div",{className:"mb-2 grid gap-2 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] p-3",children:[l.jsx(Dt,{placeholder:"Nome da especificação (ex: fluxo-de-autenticacao)",value:j,onChange:R=>E(R.target.value),"aria-label":"Nome da nova especificação",autoFocus:!0}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(F,{size:"sm",onClick:H,children:"Criar"}),l.jsx(F,{size:"sm",variant:"ghost",onClick:()=>N(!1),children:"Cancelar"})]})]}):null,l.jsx("div",{className:"grid gap-1",children:de.map(R=>l.jsx(zj,{spec:R,selected:c===R.id,validation:M.get(R.id),onSelect:()=>he(R.id),onValidate:()=>te(R.id)},R.id))}),de.length===0&&!g?l.jsx("p",{className:"px-3 py-4 text-center text-sm text-[var(--color-text-secondary)]",children:m?"Nenhuma especificação encontrada.":"Nenhuma especificação registrada."}):null]})]}),l.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:ee?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid shrink-0 gap-3 border-b border-border px-4 py-3 lg:px-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(ke,{variant:"info",tone:"outline",children:[ue.length," critérios"]}),l.jsxs(ke,{variant:ve===ue.length&&ue.length>0?"success":"amber",children:[ve,"/",ue.length," concluídos"]}),l.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>te(ee.id),children:[l.jsx(C,{name:"check",size:14}),"Validar"]})]}),M.get(ee.id)?l.jsxs("div",{className:"flex flex-wrap gap-2",children:[(Ee=M.get(ee.id))==null?void 0:Ee.issues.map((R,re)=>l.jsxs(ke,{variant:R.type==="error"?"error":"amber",tone:"soft",children:[R.type==="error"?"Erro":"Aviso"," ·"," ",R.msg]},`${R.msg}-${re}`)),((me=M.get(ee.id))==null?void 0:me.issues.length)===0?l.jsx(ke,{variant:"success",children:"Especificação válida"}):null]}):null,ue.length>0?l.jsx("div",{className:"grid max-h-40 gap-2 overflow-y-auto pr-1",tabIndex:0,children:ue.map(R=>l.jsx(as,{checked:R.checked,label:R.text,onChange:re=>{const ce=Nj(ee.content,R.line,re.target.checked);fetch(`/api/specs/${ee.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ce})}).then(()=>P())}},R.line))}):null]}),l.jsx(vu,{file:ee.id,initialContent:ee.content,onSave:async R=>{const re=fp(R,ee.id);await fetch(`/api/specs/${ee.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:re})}),P()},title:ee.id,description:"Especificação de funcionalidade: define objetivo, restrições, critérios de aceite e contexto."},ee.id)]}):l.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Selecione uma especificação ou crie uma nova."})})})]})}const Aj=[{title:"Verdade do workspace",sources:[{id:"context.md",label:"Contexto do workspace",description:"Propósito, estado atual, domínio e restrições em vigor.",icon:"context"},{id:"glossary.md",label:"Glossário",description:"Linguagem comum para decisões, specs e comunicação.",icon:"search"},{id:"decisions",label:"Decisões",description:"Registro de escolhas relevantes e seus motivos.",icon:"list-three"}]},{title:"Regras de governança",sources:[{id:"constitution.md",label:"Constituição",description:"Regras não negociáveis de produto, arquitetura e workflow.",icon:"star"},{id:"harness",label:"Harness",description:"Autoridade versionada que define fluxos, gates e agentes.",icon:"cpu"},{id:"roles",label:"Papéis",description:"Quem são os agentes e suas capacidades no fluxo.",icon:"user"}]},{title:"Trabalho especificado",sources:[{id:"specs",label:"Especificações",description:"Outcomes, constraints e critérios de aceite aprovados.",icon:"specs"}]}],mp={"context.md":{description:"Fonte de verdade operacional do workspace: propósito, domínio, estado atual e restrições."},"constitution.md":{description:"Regras fundamentais que governam decisões, implementação, supervisão humana e regressão."},"glossary.md":{description:"Termos e definições para manter a linguagem do produto consistente."},decisions:{description:"Registro de decisões e seus contextos operacionais."},specs:{description:"Especificações ativas do workspace e seus critérios de aceite."},harness:{description:"Autoridade versionada que define como o workspace deve operar."},roles:{description:"Agentes disponíveis no fluxo e suas capacidades."}};function ou(s){const o=s.match(/^#\s+(.+)/m);return o?o[1]:""}function kj(s){const o=s.match(/^(\d{4}-\d{2}-\d{2})/);if(o){const[u,c,d]=o[1].split("-");return`${d}/${c}/${u}`}return s.replace(/\.md$/,"").replace(/-/g," ")}function Tj({entry:s,selected:o,onSelect:u}){return l.jsxs(F,{type:"button",variant:"ghost",onClick:u,role:"tab","aria-selected":o,className:xt("h-auto min-w-[15rem] flex-1 items-start justify-start gap-2.5 rounded-[var(--radius-sm)] border border-transparent px-3 py-2.5 text-left md:min-w-0","hover:border-[var(--color-border)] hover:bg-[var(--surface-hover)]",o&&"border-[var(--color-border)] bg-[var(--surface-selected)] text-[var(--color-primary)] shadow-sm"),children:[l.jsx(C,{name:s.icon,size:16,className:xt("mt-0.5 shrink-0",o?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]")}),l.jsxs("span",{className:"min-w-0",children:[l.jsx("span",{className:"block text-sm font-medium leading-tight",children:s.label}),l.jsx("span",{className:xt("mt-1 line-clamp-2 block text-xs font-normal leading-snug",o?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]"),children:s.description})]})]})}function Mj({initialTab:s="context.md"}){var E;const[o,u]=v.useState(s),[c,d]=v.useState(""),[m,p]=v.useState([]),[x,y]=v.useState(null),[g,N]=v.useState(!0);v.useEffect(()=>{u(s),y(null)},[s]),v.useEffect(()=>{if(N(!0),o==="specs"||o==="harness"||o==="roles"){N(!1);return}if(o==="decisions"){fetch("/api/context?file=decisions").then(M=>M.ok?M.json():Promise.reject()).then(M=>{Array.isArray(M)&&p(M),N(!1)}).catch(()=>{p([]),N(!1)});return}fetch(`/api/context?file=${o}`).then(M=>M.ok?M.text():Promise.reject()).then(M=>{d(M||`# ${o}
|
|
229
|
+
|
|
230
|
+
Arquivo vazio.`),N(!1)}).catch(()=>{d(`# ${o}
|
|
231
|
+
|
|
232
|
+
Arquivo não encontrado ou indisponível.`),N(!1)})},[o]);const j=m.find(M=>M.name===x);return l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden md:flex-row",children:[l.jsxs("aside",{className:"app-surface-panel flex max-h-[42svh] w-full shrink-0 flex-col overflow-hidden border-b border-l-0 border-r-0 border-t-0 md:max-h-none md:w-80 md:border-b-0 md:border-r",children:[l.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-4",children:[l.jsxs("h1",{className:"flex items-center gap-2 text-sm font-semibold",children:[l.jsx(C,{name:"book",size:16,className:"text-[var(--color-primary)]"}),"Biblioteca de governança"]}),l.jsx("p",{className:"mt-1 text-xs leading-relaxed text-[var(--color-text-secondary)]",children:"Contexto, regras e specs que explicam o que pode ser feito e por quê."})]}),l.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto overflow-y-hidden p-3 md:flex-col md:gap-4 md:overflow-x-hidden md:overflow-y-auto",children:Aj.map(M=>l.jsxs("section",{className:"flex min-w-[17rem] flex-col gap-1 md:min-w-0",children:[l.jsx("h3",{className:"px-1 text-xs font-semibold uppercase text-[var(--color-text-secondary)]",children:M.title}),l.jsx("div",{role:"tablist","aria-label":M.title,children:M.sources.map(B=>l.jsx(Tj,{entry:B,selected:o===B.id,onSelect:()=>{u(B.id),y(null)}},B.id))})]},M.title))}),o==="decisions"&&m.length>0?l.jsxs("div",{className:"shrink-0 border-t border-border",children:[l.jsxs("h3",{className:"flex items-center gap-1.5 px-4 py-2 text-xs font-semibold uppercase text-[var(--color-text-secondary)]",children:[l.jsx(C,{name:"list-three",size:14}),"Decisões (",m.length,")"]}),l.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto px-2 pb-2 md:max-h-64",children:m.map(M=>l.jsxs(F,{type:"button",variant:"ghost",onClick:()=>y(M.name),className:xt("h-auto w-full justify-start gap-2 rounded-[var(--radius-sm)] px-3 py-2 text-left text-sm","hover:bg-[var(--surface-hover)]",x===M.name&&"bg-[var(--surface-selected)] text-[var(--color-primary)]"),children:[l.jsx(C,{name:"chevron-right",size:14,className:xt("shrink-0",x===M.name?"text-[var(--color-primary)]":"text-[var(--color-text-secondary)]")}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block text-xs text-[var(--color-text-secondary)]",children:kj(M.name)}),l.jsx("span",{className:"block truncate",children:ou(M.content)||M.name})]})]},M.name))})]}):null]}),l.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:g?l.jsx("div",{className:"flex h-full animate-fade-in items-center justify-center",children:l.jsx("p",{className:"animate-pulse text-sm text-[var(--color-text-secondary)]",children:"Carregando..."})}):o==="harness"?l.jsx(hj,{}):o==="roles"?l.jsx(vj,{}):o==="specs"?l.jsx(Ej,{}):o==="decisions"&&j?l.jsx(vu,{file:`decisions/${j.name}`,initialContent:j.content,onSave:async M=>{await fetch(`/api/context?file=decisions/${j.name}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:M})});const J=await(await fetch("/api/context?file=decisions")).json();Array.isArray(J)&&p(J)},title:ou(j.content)||j.name,description:mp.decisions.description},`${o}-${x}`):o==="decisions"?l.jsx("div",{className:"flex h-full animate-fade-in items-center justify-center p-6 text-center",children:l.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Selecione uma decisão para visualizar."})}):l.jsx(vu,{file:o,initialContent:c,onSave:async M=>{await fetch(`/api/context?file=${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:M})})},title:ou(c)||o,description:(E=mp[o])==null?void 0:E.description},o)})]})}function Dj(s){return{item:"Item",spec:"Especificação",ac:"Critério",gate:"Aprovação",workspace:"Ambiente",execution:"Execução",artifact:"Artefato"}[s]||s}const Oj={ac_done:"Critério concluído",ac_complete:"Critério concluído",item_move:"Item movido",item_release:"Item liberado",spec_create:"Especificação criada",spec_update:"Especificação atualizada",validate:"Validação",diagnose:"Diagnóstico",health_scan:"Verificação de saúde",health_ack:"Alerta reconhecido",health_dismiss:"Alerta descartado",focus_set:"Foco definido",focus_sync:"Foco sincronizado",focus_clear:"Foco limpo",decision:"Decisão registrada",sitrep:"Situação atualizada",system:"Automação",manual:"Ação manual",session_end:"Sessão encerrada",agent_direction_read:"Direção consultada",agent_validation_run:"Validação executada",agent_ac_completion_requested:"Conclusão solicitada",agent_transition_requested:"Transição solicitada",agent_operation_rejected:"Operação rejeitada",flow_move:"Movimento no fluxo",flow_init:"Fluxo inicializado",flow_import:"Fluxo importado",flow_export:"Fluxo exportado",harness_load:"Configuração carregada",mcp_serve:"MCP iniciado",workspace_init:"Ambiente inicializado",workspace_switch:"Ambiente alternado"};function cu(s){return Oj[s]||s}const _j=[{label:"Todos",value:""},{label:"Humano",value:"human"},{label:"Agente",value:"flow"},{label:"Sistema",value:"system"},{label:"Execução",value:"execution"}];function hp(s){const o=new Date(s),c=Math.floor((new Date().getTime()-o.getTime())/864e5);return c===0?{label:"Hoje",order:0}:c===1?{label:"Ontem",order:1}:c<=7?{label:"Esta semana",order:2}:c<=30?{label:"Este mês",order:3}:{label:"Mais antigo",order:4}}function pp(s){try{return new Date(s).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}catch{return s}}function uu(s){try{return new Date(s).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return s}}function xp(s){var u,c;if(s.kind!=="system")return null;const o=s.correlationId||((u=s.details)==null?void 0:u.actionId);return o?`${o}:${((c=s.details)==null?void 0:c.outcome)||"unknown"}`:null}function vp(s){return s==="succeeded"?"success":s==="failed"||s==="blocked"?"amber":"info"}function Rj(s){return s.status==="failed"||s.status==="blocked"?"error":s.status==="succeeded"?"success":s.kind==="system"?"info":s.kind==="human"?"default":"agent"}function Lj(s){return s.status==="failed"||s.status==="blocked"?"circle-x":s.status==="succeeded"?"circle-check":s.kind==="system"?"activity":s.kind==="human"?"user":"bot"}function cn(s,o){var c;const u=(c=s.details)==null?void 0:c[o];return typeof u=="string"&&u.trim()?u.trim():null}function bu(s){return Dj(s)}function Uj(s){const o=[];s.subject&&o.push({label:bu(s.subject.type),value:s.subject.id,tone:"info"});const u=cn(s,"decisionFile");u&&o.push({label:"Decisão",value:u,tone:"info"});const c=cn(s,"path");return c&&o.push({label:"Arquivo",value:c,tone:"info"}),o}function Hj(s){var u,c;const o=cn(s,"path")??cn(s,"decisionFile");return{who:s.actor.label,what:s.summary||s.action,where:((u=s.subject)==null?void 0:u.id)||o||cn(s,"source")||"Workspace",result:cn(s,"outcome")||((c=s.details)==null?void 0:c.effect)||"Registrado como evidência",why:s.reason||cn(s,"trigger")||null,evidence:Uj(s)}}function Bj(){var fe;const[s,o]=v.useState([]),[u,c]=v.useState({kinds:{},statuses:{},sources:{},actions:{}}),[d,m]=v.useState(0),[p,x]=v.useState(1),[y,g]=v.useState(!0),[N,j]=v.useState(null),[E,M]=v.useState(""),[B,J]=v.useState(""),[P,ee]=v.useState(""),[ue,ve]=v.useState(""),[Y,de]=v.useState(""),[he,te]=v.useState(!1),[H,pe]=v.useState(null),[Ee,me]=v.useState(!1),[R,re]=v.useState(new Set),[ce,Se]=v.useState(new Set(["Hoje","Ontem"])),z=50;v.useEffect(()=>{const V=setTimeout(()=>J(E),300);return()=>clearTimeout(V)},[E]);const L=v.useCallback(async V=>{g(!0),j(null);try{const T=new URLSearchParams;B&&T.set("q",B),P&&T.set("action",P),Y&&T.set("since",Y),he&&T.set("debug","true"),T.set("page",String(V)),T.set("limit",String(z));const Q=await fetch(`/api/log?${T}`);if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const oe=await Q.json();o(oe.items||[]),c(oe.facets||{kinds:{},statuses:{},sources:{},actions:{}}),m(oe.total||0),x(oe.page||1)}catch(T){j(T instanceof Error?T.message:"Falha ao carregar log"),o([]),m(0)}finally{g(!1)}},[B,P,Y,he]);v.useEffect(()=>{x(1)},[B,P,ue,Y,he]),v.useEffect(()=>{L(p)},[L,p]),v.useEffect(()=>{me(!1)},[H==null?void 0:H.id]);const le=v.useMemo(()=>{const V=ue?s.filter(oe=>oe.kind===ue):s,T=[];let Q=0;for(;Q<V.length;){const oe=xp(V[Q]);if(oe){const De=[V[Q]];let ne=Q+1;for(;ne<V.length&&xp(V[ne])===oe;)De.push(V[ne]),ne++;De.length>1?R.has(oe)?T.push(...De):T.push({...De[0],_noiseCount:De.length,_noiseKey:oe}):T.push(De[0]),Q=ne}else T.push(V[Q]),Q++}return T},[s,ue,R]),ie=v.useMemo(()=>{const V=new Map;for(const Q of le){const{label:oe}=hp(Q.timestamp),De=V.get(oe)||[];De.push(Q),V.set(oe,De)}const T={Hoje:0,Ontem:1,"Esta semana":2,"Este mês":3};return Array.from(V.entries()).map(([Q,oe])=>({label:Q,entries:oe,order:T[Q]??4})).sort((Q,oe)=>Q.order-oe.order)},[le]),D=v.useMemo(()=>{const V=s.length,T=s.filter(xe=>xe.kind==="system").length,Q=s.filter(xe=>xe.kind==="human").length,oe=s.filter(xe=>xe.kind==="execution"||xe.kind==="flow").length,De=s.filter(xe=>hp(xe.timestamp).label==="Hoje").length,ne=s.filter(xe=>xe.status==="succeeded").length,be=s.filter(xe=>xe.status==="failed").length;return{totalEvents:V,systemEvents:T,humanEvents:Q,agentEvents:oe,todayEvents:De,succeededEvents:ne,failedEvents:be}},[s]),b=Math.ceil(d/z),A=H?Hj(H):null;function $(V){re(T=>{const Q=new Set(T);return Q.has(V)?Q.delete(V):Q.add(V),Q})}function I(V){Se(T=>{const Q=new Set(T);return Q.has(V)?Q.delete(V):Q.add(V),Q})}return N?l.jsxs("div",{className:"app-section-shell items-center justify-center gap-3 p-12",children:[l.jsx(C,{name:"alert-circle",size:24,style:{color:"var(--color-danger)"}}),l.jsx("p",{className:"app-section-muted text-sm",children:N}),l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>L(1),children:[l.jsx(C,{name:"check",size:12}),"Tentar novamente"]})]}):l.jsxs("div",{className:"app-section-shell",children:[l.jsx(nr,{open:!!H,onOpenChange:V=>{V||pe(null)},children:l.jsx(sr,{side:"right",className:"w-full sm:max-w-3xl lg:max-w-4xl",children:H&&l.jsxs(l.Fragment,{children:[l.jsxs(Ui,{className:"items-start gap-4",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx(ke,{variant:vp(H.status),tone:"soft",className:"text-caption uppercase",children:cu(H.action)}),l.jsx(ke,{variant:H.kind==="human"||H.kind==="system"?"info":"agent",tone:"soft",children:H.actor.label}),H.status==="failed"||H.status==="blocked"?l.jsx(ke,{variant:"amber",tone:"soft",children:H.status}):null]}),l.jsx(Hi,{className:"leading-tight",children:"Evidência da atividade"}),l.jsx(Ru,{className:"mt-1",children:A?`${A.what} · ${uu(H.timestamp)}`:uu(H.timestamp)})]}),l.jsx(tx,{"aria-label":"Fechar detalhes da atividade",onClick:()=>pe(null),children:l.jsx(C,{name:"x",size:16})})]}),l.jsxs("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto p-6",children:[A&&l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Resumo investigativo"}),l.jsxs("p",{className:"text-body-sm leading-relaxed text-[var(--color-text-secondary)]",children:[A.who," registrou"," ",l.jsx("strong",{className:"text-[var(--color-text-primary)]",children:A.what})," ","em"," ",l.jsx("strong",{className:"text-[var(--color-text-primary)]",children:A.where}),". Resultado: ",String(A.result),"."]})]})}),l.jsxs(ot,{children:[l.jsx(Ea,{items:[{label:"Ator",value:`${H.actor.label} (${H.actor.type})`,icon:l.jsx(C,{name:"user",size:14})},{label:"Quando",value:uu(H.timestamp),icon:l.jsx(C,{name:"clock",size:14})},{label:"Onde",value:((fe=H.subject)==null?void 0:fe.id)||A.where,icon:l.jsx(C,{name:"box",size:14})},{label:"Resultado",value:H.status,icon:l.jsx(C,{name:"check-circle",size:14})}]}),A.why?l.jsxs("div",{className:"grid gap-1 rounded-[var(--radius-sm)] border border-[var(--color-border)] bg-[var(--color-bg-sunken)] p-3",children:[l.jsx("h4",{className:"text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",children:"Por quê"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-primary)]",children:String(A.why)})]}):null]})]}),A&&A.evidence.length>0?l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Evidências relacionadas"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Referências que sustentam este registro."})]})}),l.jsx(ot,{children:l.jsx(rl,{children:A.evidence.map(V=>l.jsx(il,{leading:l.jsx(C,{name:V.label==="Item"?"box":V.label==="Spec"?"specs":"activity",size:16}),title:V.value,meta:l.jsx(ke,{variant:V.tone,tone:"soft",children:V.label}),action:V.label==="Item"?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>window.dispatchEvent(new CustomEvent("letra-open-item",{detail:V.value})),children:"Abrir"}):V.label==="Spec"?l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>window.dispatchEvent(new CustomEvent("letra-open-spec",{detail:V.value})),children:"Abrir"}):null},`${V.label}-${V.value}`))})})]}):null,l.jsxs(it,{children:[l.jsx(ja,{children:l.jsxs("div",{className:"grid gap-1",children:[l.jsx("h3",{className:"text-body font-semibold",children:"Registro original"}),l.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Mensagem capturada na trilha de atividade."})]})}),l.jsxs(ot,{className:"grid gap-3",children:[l.jsx("p",{className:"text-body-sm leading-relaxed text-[var(--color-text-primary)]",children:H.summary}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.correlationId?l.jsx(Je,{children:H.correlationId}):null,H.subject?l.jsxs(Je,{children:[bu(H.subject.type),":"," ",H.subject.id]}):null,l.jsx(Je,{children:H.id})]})]})]}),H.details?l.jsx(it,{children:l.jsxs(rr,{open:Ee,onOpenChange:me,children:[l.jsxs(ir,{className:"flex w-full items-center justify-between gap-3 p-4 text-left transition-colors hover:bg-[var(--color-bg-sunken)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring-color)]",children:[l.jsxs("div",{className:"grid gap-1",children:[l.jsx("span",{className:"text-body font-semibold text-[var(--color-text-primary)]",children:"Detalhes técnicos"}),l.jsx("span",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"JSON bruto para auditoria e depuração."})]}),l.jsx(C,{name:Ee?"chevron-up":"chevron-down",size:16})]}),l.jsx(or,{children:l.jsx(ot,{className:"border-t border-[var(--color-border)] pt-4",children:l.jsx("pre",{className:"max-h-80 overflow-auto rounded-[var(--radius-sm)] bg-[var(--color-bg-base)] p-4 text-caption text-[var(--color-text-secondary)]",children:JSON.stringify(H.details,null,2)})})})]})}):null]})]})})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"p-6",children:[l.jsxs(it,{className:"mb-6",children:[l.jsxs(ja,{className:"flex flex-wrap items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(C,{name:"activity",size:18}),l.jsx(ke,{variant:"info",className:"text-caption",children:"trilha investigativa"})]}),l.jsx("h1",{className:"text-xl font-bold",children:"Atividade"}),l.jsx("p",{className:"app-section-muted mt-1 max-w-3xl text-sm",style:{color:void 0},children:"Origem, resultado e evidências do workspace em uma linha do tempo auditável."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-right",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",children:D.succeededEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"sucesso"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",style:{color:"var(--color-primary)"},children:D.failedEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"falhas"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-lg font-bold",children:D.todayEvents}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"hoje"})]})]})]}),l.jsx(ot,{children:l.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Origem"}),l.jsx("p",{className:"mt-1 text-sm",children:"quem ou qual automação registrou"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Evento"}),l.jsx("p",{className:"mt-1 text-sm",children:"o que mudou no trabalho"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Evidência"}),l.jsx("p",{className:"mt-1 text-sm",children:"item, AC, decisão ou arquivo"})]}),l.jsxs("div",{className:"min-w-0 border-l pl-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Resultado"}),l.jsx("p",{className:"mt-1 text-sm",children:"efeito observável antes de agir"})]})]})})]}),he?l.jsx(it,{className:"mb-6 border-[var(--color-border-warning)]",children:l.jsxs(ot,{className:"flex flex-wrap items-center justify-between gap-3 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx(C,{name:"activity",size:18,className:"text-[var(--color-warning)]"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-body-sm font-semibold text-[var(--color-text-primary)]",children:"Eventos técnicos incluídos"}),l.jsxs("p",{className:"text-caption text-[var(--color-text-secondary)]",children:[D.systemEvents," automaçõ",D.systemEvents!==1?"es":"o"," nesta consulta"]})]})]}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>te(!1),children:"Ocultar"})]})}):null,l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[l.jsx(it,{children:l.jsxs(ot,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",children:D.totalEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Total"})]})}),l.jsx(it,{children:l.jsxs(ot,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-text-secondary)"},children:D.systemEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Sistema"})]})}),l.jsx(it,{children:l.jsxs(ot,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-primary)"},children:D.humanEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Humano"})]})}),l.jsx(it,{children:l.jsxs(ot,{className:"p-4",children:[l.jsx("p",{className:"text-2xl font-bold",style:{color:"var(--color-success)"},children:D.agentEvents}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:"Agente"})]})})]}),l.jsx(it,{className:"mb-6",children:l.jsx(ot,{className:"grid gap-4 p-4",children:l.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("label",{className:"mb-1.5 block text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",htmlFor:"activity-search",children:"Buscar"}),l.jsx(Dt,{id:"activity-search",placeholder:"Buscar atividade e evidências...",value:E,onChange:V=>M(V.target.value),"aria-label":"Buscar atividade"})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"mb-1.5 text-caption font-semibold uppercase text-[var(--color-text-tertiary)]",children:"Ator"}),l.jsx(Tu,{ariaLabel:"Filtrar atividade por ator",className:"w-full sm:w-auto",children:_j.map(V=>l.jsx(Mu,{selected:ue===V.value,onClick:()=>ve(V.value),children:V.label},V.label))})]}),l.jsx("div",{className:"w-full min-w-0 sm:w-[220px]",children:l.jsx(Ky,{id:"activity-since",label:"Desde",value:Y,onChange:V=>de(V.target.value)})}),l.jsxs("div",{className:"flex flex-wrap gap-2 lg:pb-0.5",children:[l.jsxs(F,{variant:"secondary",size:"sm",onClick:()=>L(p),children:[l.jsx(C,{name:"check",size:14}),"Atualizar"]}),(E||ue||Y)&&l.jsx(F,{variant:"ghost",size:"sm",onClick:()=>{M(""),J(""),ve(""),de("")},children:"Limpar"})]})]})})}),y?l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):s.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-2 py-16",children:[l.jsx(C,{name:"search",size:24,style:{color:"var(--color-text-secondary)"}}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Nenhuma atividade encontrada"})]}):l.jsx("div",{className:"space-y-6",children:ie.map(V=>{const T=ce.has(V.label);return l.jsxs("section",{"aria-label":`${V.label} — ${V.entries.length} atividades`,children:[l.jsxs(F,{type:"button",variant:"ghost",onClick:()=>I(V.label),"aria-expanded":T,"aria-label":`${V.label} — ${V.entries.length} atividades`,className:"mb-3 h-auto justify-start gap-2 bg-transparent px-0 py-0 text-xs font-semibold uppercase hover:bg-transparent",style:{color:"var(--color-text-secondary)"},children:[l.jsx(C,{name:T?"chevron-down":"chevron-right",size:12}),V.label,l.jsxs("span",{className:"font-normal normal-case ml-1",children:[V.entries.length," atividade",V.entries.length!==1?"s":""]})]}),T&&l.jsx(o0,{className:"rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-bg-surface)] p-4",children:V.entries.map((Q,oe)=>{var q;const De=Q._noiseCount!==void 0,ne=Q._noiseCount,be=Q._noiseKey,xe=oe===V.entries.length-1;return De?l.jsx(rp,{status:"info",icon:l.jsx(C,{name:R.has(be||"")?"chevron-down":"chevron-right",size:16}),title:cu(Q.action),description:`${ne} atividades similares agrupadas para reduzir ruído operacional.`,timestamp:pp(Q.timestamp),action:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(ke,{variant:"info",tone:"soft",children:["x",ne]}),l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>be&&$(be),children:R.has(be||"")?"Recolher":"Expandir"})]}),last:xe},`${Q.id}-${oe}`):l.jsx(rp,{status:Rj(Q),icon:l.jsx(C,{name:Lj(Q),size:16}),title:Q.summary||Q.action,description:`${Q.actor.label} · ${((q=Q.subject)==null?void 0:q.id)||"workspace"}`,timestamp:pp(Q.timestamp),action:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ke,{variant:vp(Q.status),tone:"soft",className:"text-caption uppercase",children:cu(Q.action)}),l.jsx(ke,{variant:Q.kind==="human"||Q.kind==="system"?"info":"agent",tone:"soft",className:"text-[10px]",children:Q.actor.label}),Q.subject?l.jsxs(Je,{variant:"info",children:[bu(Q.subject.type),": ",Q.subject.id]}):null,l.jsx(F,{variant:"secondary",size:"sm",onClick:()=>pe(Q),children:"Detalhes"})]}),last:xe},`${Q.id}-${oe}`)})})]},V.label)})}),d>0&&l.jsxs("div",{className:"app-section-muted mt-6 flex items-center justify-between border-t pt-4 text-xs",style:{borderColor:"var(--color-border)",color:void 0},children:[l.jsxs("span",{children:[d," atividade",d!==1?"s":""," no total"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{variant:"secondary",size:"sm",disabled:p<=1,onClick:()=>x(V=>Math.max(1,V-1)),children:"Anterior"}),l.jsxs("span",{children:["Página ",p," de ",b]}),l.jsx(F,{variant:"secondary",size:"sm",disabled:p>=b,onClick:()=>x(V=>V+1),children:"Próxima"})]})]})]})})]})}function rn(s,o){return`${s}:${o}`}function qj(s){return(s||"workspace").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"workspace"}function gp(s){return s.replace(/\\/g,"/").replace(/\/+$/,"")}function Gj({onComplete:s,onCancel:o,existingNames:u}){const{toast:c}=lr(),[d,m]=v.useState(""),[p,x]=v.useState(""),[y,g]=v.useState(""),[N,j]=v.useState(!1),[E,M]=v.useState(null),[B,J]=v.useState(null),[P,ee]=v.useState(!1),[ue,ve]=v.useState({}),[Y,de]=v.useState(!1),[he,te]=v.useState(""),H=u.some(T=>T.toLowerCase()===d.trim().toLowerCase()),pe=`~/.letra/workspaces/${qj(d.trim())}`,Ee=d.trim()?H?"Já existe um workspace com este nome":"":"Nome é obrigatório",me=!Ee&&y.trim().length>0&&!Y,R=v.useMemo(()=>E?E.locations??[]:[],[E]),re=v.useMemo(()=>R.map(T=>({id:T.id,label:T.label,path:T.path,adapters:T.adapters.filter(Q=>ue[rn(T.id,Q.tool)]).map(Q=>Q.tool)})),[R,ue]),ce=v.useMemo(()=>[...new Set(re.flatMap(T=>T.adapters))],[re]),Se=(B==null?void 0:B.operations.filter(T=>T.path.endsWith("/workflow.json")).length)??0,z=(B==null?void 0:B.operations.filter(T=>T.path.endsWith("/.letra-link")).length)??0,L=(B==null?void 0:B.operations.filter(T=>!T.path.endsWith("/workflow.json")&&!T.path.endsWith("/.letra-link")).length)??0,le=re.filter(T=>T.adapters.length>0),ie=!!E&&re.length>0&&!Y,D=!!E&&!!B&&B.conflictCount===0&&!Y;async function b(){if(me){de(!0),te(""),J(null),ee(!1);try{const T=await fetch("/api/workspace/setup/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.trim(),root:y.trim()})}),Q=await T.json();if(!T.ok)throw new Error(Q.error||"Não foi possível analisar a pasta.");const oe=Q,De={},ne=oe.locations??[];for(const be of ne)for(const xe of be.adapters)De[rn(be.id,xe.tool)]=xe.selected;M(oe),ve(De)}catch(T){te(T.message)}finally{de(!1)}}}async function A(){if(!(!E||re.length===0)){de(!0),te("");try{const T=await fetch("/api/workspace/setup/plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposalId:E.id,workspaceRoot:pe,dataDir:pe,name:d.trim(),template:"padrao",locations:re})}),Q=await T.json();if(!T.ok)throw new Error(Q.error||"Não foi possível revisar a instalação.");J(Q)}catch(T){te(T.message)}finally{de(!1)}}}async function $(){if(!(!E||!B||B.conflictCount>0)){de(!0),te("");try{const T=await fetch("/api/workflow/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proposalId:E.id,name:d.trim(),description:p.trim(),workspacePath:pe,dataDir:pe,directories:re.map(oe=>oe.path),locations:re,tools:ce,template:"padrao"})}),Q=await T.json();if(!T.ok)throw new Error(Q.error||"Não foi possível criar o workspace.");c("Workspace criado com sucesso!","success"),ee(!0),s({name:d.trim()})}catch(T){te(T.message)}finally{de(!1)}}}function I(T,Q){const oe=rn(T,Q);ve(De=>({...De,[oe]:!De[oe]})),J(null),ee(!1)}function fe(T){return T.adapters.filter(Q=>ue[rn(T.id,Q.tool)]).length}function V(T){return gp(T.path)===gp((E==null?void 0:E.workspace.root)??"")?"Raiz da solução":fe(T)>0?"Pasta com adapters":"Somente vínculo"}return l.jsx("div",{className:"h-full overflow-y-auto p-6",children:l.jsxs("div",{className:"mx-auto grid max-w-6xl gap-6 lg:grid-cols-[minmax(0,1.12fr)_minmax(340px,0.88fr)]",children:[l.jsxs("section",{className:"flex flex-col gap-6",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 sm:grid sm:grid-cols-[1fr_auto]",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Novo workspace"}),l.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:"Crie a pasta de governança do Letra e vincule as pastas/projetos que ela deve acompanhar."})]}),l.jsx(F,{type:"button",variant:"ghost",onClick:o,children:"Voltar para Meus Workspaces"})]}),l.jsxs("div",{className:"grid gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Workspace e pastas/projetos"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Informe o nome do workspace e uma pasta de projeto inicial. Nada será escrito antes da confirmação final."})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Nome do workspace"}),l.jsx(Dt,{value:d,onBlur:()=>j(!0),onChange:T=>{m(T.target.value),M(null),J(null),ee(!1)},placeholder:"Ex: Portal de atendimento","aria-invalid":N&&!!Ee}),N&&Ee&&l.jsx("span",{className:"text-xs",style:{color:"var(--color-danger)"},children:Ee})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Descrição opcional"}),l.jsx(Li,{value:p,onChange:T=>x(T.target.value),placeholder:"Descreva o propósito deste workspace",rows:3})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Data directory do workspace"}),l.jsx(Dt,{value:pe,readOnly:!0,"aria-readonly":"true"})]}),l.jsxs("label",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium",children:"Pasta/projeto inicial"}),l.jsx(Dt,{value:y,onChange:T=>{g(T.target.value),M(null),J(null),ee(!1)},placeholder:"C:/Workspace/meu-projeto"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(F,{type:"button",onClick:b,loading:Y,disabled:!me,children:[l.jsx(C,{name:"search",size:14}),"Analisar pasta/projeto"]}),l.jsx("span",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"O harness fica fora do projeto; a pasta recebe apenas o vínculo."})]})]}),l.jsxs("div",{className:"flex flex-col gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Proposta do Letra"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Revise as pastas/projetos vinculadas ao workspace antes de gerar a prévia."})]}),E?l.jsxs(l.Fragment,{children:[E.warnings.map(T=>l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3 text-sm",style:{borderColor:"var(--color-border)"},children:[T,l.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--color-text-secondary)"},children:"Adapters disponíveis aparecem nas opções avançadas e só serão escritos nas pastas onde forem marcados."})]},T)),l.jsx("div",{className:"flex flex-col gap-3",children:R.map(T=>l.jsx("div",{className:"rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("h3",{className:"font-semibold",children:T.label}),l.jsx(ke,{variant:"info",tone:"soft",children:V(T)})]}),l.jsx("p",{className:"truncate font-mono text-xs",style:{color:"var(--color-text-secondary)"},children:T.path})]}),l.jsx(ke,{variant:fe(T)>0?"success":"info",tone:"soft",children:fe(T)>0?`${fe(T)} adapter(s)`:"só .letra-link"})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[T.stack.map(Q=>l.jsx(ke,{variant:"info",tone:"soft",children:Q},Q)),T.evidence.map(Q=>l.jsx(ke,{variant:"info",tone:"soft",children:Q},Q))]}),l.jsxs("details",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Opções avançadas"}),l.jsx("p",{className:"mt-2 text-xs",style:{color:"var(--color-text-secondary)"},children:"Marque adapters apenas nas pastas onde o Letra deve criar instruções para agentes. Em geral, use a raiz Git/solução."}),l.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:T.adapters.map(Q=>l.jsxs("div",{className:xt("rounded-[var(--radius-sm)] border p-3",ue[rn(T.id,Q.tool)]&&"bg-[var(--color-primary-subtle)]"),style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(as,{"aria-label":`${Q.label} em ${T.label}`,checked:!!ue[rn(T.id,Q.tool)],onChange:()=>I(T.id,Q.tool)}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:Q.label}),l.jsx("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:ue[rn(T.id,Q.tool)]?`Será escrito em ${T.label}`:`Disponível para ${T.label}`})]})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[l.jsx(ke,{variant:Q.state==="detected"?"success":"info",tone:"soft",children:Q.state==="detected"?"detectado":"disponível"}),Q.evidence.map(oe=>l.jsx(ke,{variant:"info",tone:"soft",children:oe},oe))]})]},Q.tool))})]})]})},T.id))}),l.jsx("div",{className:"flex justify-end",children:l.jsx(F,{type:"button",onClick:A,loading:Y,disabled:!ie,children:"Gerar prévia de escrita"})})]}):l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-4 text-sm",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"A proposta aparecerá aqui depois da análise da pasta/projeto inicial."})]}),P&&l.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-[var(--radius-md)] border p-8 text-center",style:{borderColor:"var(--color-border)"},children:[l.jsx(C,{name:"check-circle",size:24,style:{color:"var(--color-success)"}}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold",children:"Workspace criado!"}),l.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:["O workspace ",d.trim()," já pode ser supervisionado no Letra."]})]}),l.jsx(F,{type:"button",onClick:o,children:"Ir para Meus Workspaces"})]}),he&&l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-3 text-sm",style:{borderColor:"var(--color-danger)",color:"var(--color-danger)"},children:he})]}),l.jsxs("aside",{className:"flex flex-col gap-4 rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-border)"},children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Prévia de escrita"}),l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Confira os artefatos antes de criar o workspace."})]}),E&&B?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-2 rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Resumo"}),l.jsxs("p",{className:"text-sm",children:[Se||1," pasta de governança fora do projeto, ",z," vínculo(s) .letra-link e"," ",L," arquivo(s) de adapter."]}),l.jsxs("p",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:["Adapters serão escritos em"," ",le.length>0?le.map(T=>T.label).join(", "):"nenhuma pasta","."]})]}),l.jsxs("div",{className:"grid gap-3",children:[l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"workflow.json"}),l.jsxs("p",{className:"mt-1 text-sm",children:["Criado em ",pe,"/workflow.json"]})]}),l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Vínculo"}),l.jsx("p",{className:"mt-1 text-sm",children:"Cada pasta/projeto recebe apenas .letra-link apontando para o data directory."})]}),l.jsxs("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Adapters"}),l.jsx("p",{className:"mt-1 text-sm",children:ce.length>0?ce.join(", "):"Nenhum adapter selecionado"})]})]}),l.jsx("div",{className:"flex flex-col gap-2",children:B.operations.map(T=>l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate font-mono text-xs",children:T.path}),l.jsx("p",{className:"mt-1 text-sm",style:{color:"var(--color-text-secondary)"},children:T.reason})]}),l.jsx(ke,{variant:T.kind==="conflict"?"error":T.kind==="preserve"?"info":"success",tone:"soft",children:T.kind})]})},`${T.kind}:${T.path}:${T.tool||""}`))}),B.conflictCount>0&&l.jsx("p",{className:"text-sm",style:{color:"var(--color-danger)"},children:"Resolva os conflitos antes de criar o workspace."})]}):l.jsx("div",{className:"rounded-[var(--radius-sm)] border p-4 text-sm",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Gere a prévia para ver exatamente quais arquivos serão criados, preservados ou bloqueados por conflito."}),l.jsx(F,{type:"button",onClick:$,loading:Y,disabled:!D,children:"Criar workspace"}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Checklist do cadastro"}),[["Analisar pasta",!!E],["Revisar proposta",!!B],["Revisar opções avançadas",!!E],["Confirmar criação",P],["Validar workflow.json",P],["Validar .letra-link",P],["Validar pastas/projetos",P]].map(([T,Q])=>l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(C,{name:Q?"check":"circle",size:14,style:{color:Q?"var(--color-success)":"var(--color-text-secondary)"}}),l.jsx("span",{children:T})]},String(T)))]}),E&&l.jsxs("div",{className:"mt-2 rounded-[var(--radius-sm)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"var(--color-text-secondary)"},children:"Pasta analisada"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs",children:E.workspace.root}),l.jsxs("p",{className:"mt-2 text-sm",children:[R.length," pasta(s)/projeto(s) detectado(s)"]}),l.jsxs("p",{className:"text-sm",children:[ce.length," adapter(s): ",ce.join(", ")]})]})]})]})})}function Vj(s){try{return new Date(s).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return s}}function Yj({onSelect:s,activeSlug:o,gateMode:u,activeDirectory:c}){const[d,m]=v.useState([]),[p,x]=v.useState(!1),[y,g]=v.useState(!0);v.useEffect(()=>{fetch("/api/workspaces").then(j=>j.json()).then(j=>{Array.isArray(j)&&m(j)}).catch(()=>{}).finally(()=>g(!1))},[]);function N(j){m(E=>{var M;return[...E,{id:((M=crypto.randomUUID)==null?void 0:M.call(crypto))||`${Date.now()}`,name:j.name,slug:j.name.toLowerCase().replace(/[^a-z0-9]+/g,"-"),createdAt:new Date().toISOString()}]}),x(!1)}return p?l.jsx(Gj,{onComplete:j=>{N(j),s&&fetch("/api/workspaces").then(E=>E.json()).then(E=>{if(Array.isArray(E)&&E.length>0){const M=E[E.length-1];s(M)}}).catch(()=>{})},onCancel:()=>x(!1),existingNames:d.map(j=>j.name)}):l.jsxs("div",{className:"flex flex-col flex-1 p-6 gap-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Meus Workspaces"}),l.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-secondary)"},children:u?"Selecione ou crie um workspace para começar":"Gerencie seus espaços de trabalho"})]}),l.jsxs(F,{onClick:()=>x(!0),children:[l.jsx(C,{name:"plus",size:16,className:"mr-1"}),u?"Criar novo workspace":"Novo Workspace"]})]}),y?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx("p",{className:"text-sm",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):d.length===0?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(on,{icon:l.jsx(C,{name:"box",size:24}),title:"Nenhum workspace encontrado",description:"Crie seu primeiro workspace para organizar seus projetos e começar a trabalhar.",action:l.jsx(F,{onClick:()=>x(!0),children:"Crie agora seu workspace"})})}):l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4",children:d.map(j=>l.jsx(it,{className:`transition-all duration-200 hover:shadow-md hover:-translate-y-0.5 ${s?"cursor-pointer":""} ${o===j.slug?"ring-2 ring-primary":""}`,onClick:()=>s==null?void 0:s(j),children:l.jsxs(ot,{className:"p-4 flex flex-col gap-3",children:[l.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[l.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center shrink-0",style:{background:o===j.slug?"var(--color-primary)":"var(--color-bg-surface)",color:o===j.slug?"var(--color-primary)":"var(--color-text-secondary)"},children:l.jsx(C,{name:o===j.slug?"check":"box",size:16})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-sm font-semibold truncate",children:j.name}),j.description&&l.jsx("p",{className:"text-xs mt-0.5 truncate",style:{color:"var(--color-text-secondary)"},children:j.description}),l.jsxs("span",{className:"text-[11px]",style:{color:"var(--color-text-secondary)"},children:["Criado em ",Vj(j.createdAt)]})]})]}),j.directories&&j.directories.length>0&&l.jsxs("div",{className:"flex flex-col gap-1 pt-1 border-t",style:{borderColor:"var(--color-border)"},children:[l.jsx("span",{className:"text-caption uppercase tracking-wider font-semibold",style:{color:"var(--color-text-secondary)"},children:"Pastas gerenciadas"}),j.directories.map(E=>{const M=o===j.slug&&c===E,B=E.split(/[/\\]/).pop()||E;return l.jsxs("div",{className:"flex items-center gap-1.5 text-xs",style:{color:M?"var(--color-primary)":"var(--color-text-secondary)"},children:[l.jsx(C,{name:M?"check":"folder",size:12}),l.jsx("span",{className:"truncate",children:B})]},E)})]})]})},j.id))})]})}function Qj({workspace:s,onWorkspaceUpdated:o,onWorkspaceDeleted:u,onRefreshWorkflow:c,onCreateWorkspace:d,onClose:m}){const{toast:p,toastWithOptions:x}=lr(),[y,g]=v.useState("general"),[N,j]=v.useState(s.name),[E,M]=v.useState(s.description||""),[B,J]=v.useState(!1),[P,ee]=v.useState(!1),[ue,ve]=v.useState("confirm"),[Y,de]=v.useState(""),[he,te]=v.useState([]),[H,pe]=v.useState(!1),[Ee,me]=v.useState(!1),[R,re]=v.useState(null),[ce,Se]=v.useState(""),[z,L]=v.useState(null),[le,ie]=v.useState(""),[D,b]=v.useState({}),[A,$]=v.useState(!1),[I,fe]=v.useState(!1),[V,T]=v.useState(""),[Q,oe]=v.useState([]),[De,ne]=v.useState(!1),[be,xe]=v.useState(""),[q,we]=v.useState(null),[Oe,kt]=v.useState([]),[ht,Vt]=v.useState(!1),[Pt,ol]=v.useState(null),[Ie,ca]=v.useState(""),[tt,Ul]=v.useState([]),[cl,Hl]=v.useState(!1),[Yt,Z]=v.useState([]),[Te,Le]=v.useState(!1),[at,pt]=v.useState(!1),[ut,Tt]=v.useState(!1),[Ct,ua]=v.useState(""),Qt=v.useState(null),Xt=v.useState(null);function Ot(se,ae){Qt[0]&&clearTimeout(Qt[0]),Xt[0]={undo:ae,label:se};const ye=setTimeout(()=>{Xt[0]=null},3e4);Qt[0]=ye,x(`${se} — desfazer disponível por 30s`,{type:"success",duration:3e4,action:{label:"Desfazer",onClick:Na}})}function Na(){Xt[0]&&(Xt[0].undo(),Xt[0]=null,Qt[0]&&clearTimeout(Qt[0]),p("Alteração desfeita","success"))}v.useEffect(()=>{j(s.name),M(s.description||""),g("general"),ve("confirm"),de(""),Bl(),fn(),Ua(),mn()},[s.name,s.description]);const fn=v.useCallback(async()=>{Vt(!0);try{const ae=await(await fetch("/api/harness/templates")).json();kt(Array.isArray(ae)?ae:[])}catch{kt([])}finally{Vt(!1)}},[]),Ua=v.useCallback(async()=>{var se;try{const ye=await(await fetch("/api/workflow")).json();ca(ye.template||""),Ul(((se=ye.stages)==null?void 0:se.map(_e=>({id:_e.id,name:_e.name})))||[])}catch{}},[]),mn=v.useCallback(async()=>{Le(!0);try{const ae=await(await fetch("/api/workflow/adapters")).json();Z(Array.isArray(ae)?ae:[])}catch{Z([])}finally{Le(!1)}},[]),Bl=v.useCallback(async()=>{pe(!0);try{const ye=(await(await fetch("/api/workflow")).json()).locations||[];te(ye);const _e={};for(const Be of ye)Be.id&&(_e[Be.id]=Array.isArray(Be.adapters)?Be.adapters:[]);b(_e)}catch{te([]),b({})}finally{pe(!1)}},[]),qi=N!==s.name||E!==(s.description||""),hn=N.trim().length>=2;async function ns(){if(!hn||B)return;const se=s.name,ae=s.description||"";J(!0);try{const ye=await fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.trim(),description:E.trim()})});if(!ye.ok)throw new Error("Failed to save");const _e=await ye.json();o({...s,name:_e.name||N.trim(),description:_e.description??E.trim()}),Ot("Configurações salvas",()=>{j(se),M(ae),fetch("/api/workflow",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:se,description:ae})}),o({...s,name:se,description:ae})})}catch{p("Erro ao salvar configurações","error")}finally{J(!1)}}async function ql(){if(Y===s.name)try{if(!(await fetch(`/api/workspaces/${s.id}`,{method:"DELETE"})).ok)throw new Error("Failed to delete");p("Workspace excluído","success"),ee(!1),u()}catch{p("Erro ao excluir workspace","error")}}async function Gi(){if(!q)return;const se=`loc-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ae=q.name,ye=[...he];try{const _e=await fetch("/api/workflow/locations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:se,path:q.path,label:ae})});if(!_e.ok)throw new Error("Failed to add location");const Be=await _e.json();te(qe=>[...qe,Be]),fe(!1),we(null),T(""),oe([]),Ot("Local adicionado",()=>{te(ye),fetch(`/api/workflow/locations/${se}`,{method:"DELETE"})})}catch{p("Erro ao adicionar local","error")}}async function ss(se){if(!ce.trim())return;const ae=he.find(ye=>ye.id===se);try{const ye=await fetch(`/api/workflow/locations/${se}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:ce.trim()})});if(!ye.ok)throw new Error("Failed to update");const _e=await ye.json();te(Be=>Be.map(qe=>qe.id===se?_e:qe)),re(null),ae?Ot("Label atualizado",()=>{te(Be=>Be.map(qe=>qe.id===se?ae:qe)),fetch(`/api/workflow/locations/${se}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:ae.label})})}):p("Label atualizado","success")}catch{p("Erro ao atualizar label","error")}}async function ur(){if(!z)return;const se=he.find(ye=>ye.id===z),ae=[...he];try{if(!(await fetch(`/api/workflow/locations/${z}`,{method:"DELETE"})).ok)throw new Error("Failed to delete");te(_e=>_e.filter(Be=>Be.id!==z)),L(null),ie(""),se&&Ot("Local removido",()=>{te(ae),fetch("/api/workflow/locations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(se)})})}catch{p("Erro ao remover local","error")}}async function dr(se){const ae=he.find(ye=>ye.id===se);try{const ye=await fetch(`/api/workflow/locations/${se}/repair-link`,{method:"POST"});if(!ye.ok)throw new Error("Failed to repair link");const _e=await ye.json();_e.location?te(Be=>Be.map(qe=>qe.id===se?{...qe,..._e.location,linkStatus:"ok",linkOk:!0}:qe)):ae&&te(Be=>Be.map(qe=>qe.id===se?{...qe,linkStatus:"ok",linkOk:!0}:qe)),p("Vínculo reparado","success")}catch{p("Erro ao reparar vínculo","error")}}function rs(se){return se.linkOk===!0||se.linkStatus==="ok"?"Vínculo ok":se.linkOk===!1||se.linkStatus==="missing"?".letra-link ausente":se.linkStatus==="broken"?".letra-link quebrado":"Vínculo não verificado"}function pn(se){return se.linkOk===!0||se.linkStatus==="ok"?"success":se.linkOk===!1||se.linkStatus==="missing"||se.linkStatus==="broken"?"warning":"info"}const fr=[{id:"opencode",label:"OpenCode"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude-code",label:"Claude Code"},{id:"vscode",label:"VS Code"},{id:"windsurf",label:"Windsurf"},{id:"hermes",label:"Hermes"}];async function mr(se,ae){const ye=D[se]||[],_e=ye.includes(ae)?ye.filter(Be=>Be!==ae):[...ye,ae];b(Be=>({...Be,[se]:_e})),$(!0);try{if(!(await fetch(`/api/workflow/locations/${se}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapters:_e})})).ok)throw new Error("Failed to update adapters");Ot("Adapters atualizados",()=>{b(qe=>({...qe,[se]:ye})),fetch(`/api/workflow/locations/${se}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapters:ye})})})}catch{b(Be=>({...Be,[se]:ye})),p("Erro ao atualizar adapters","error")}finally{$(!1)}}async function ka(se){var qe,Bt;const ae=[...Yt],ye=((qe=Yt.find(Ve=>Ve.id===se))==null?void 0:qe.displayName)||se,_e=Yt.map(Ve=>Ve.id===se?{...Ve,active:!Ve.active}:Ve),Be=_e.filter(Ve=>Ve.active).map(Ve=>Ve.id);Z(_e),pt(!0);try{if(!(await fetch("/api/workflow/adapters",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tools:Be})})).ok)throw new Error("Failed to update adapters");c();const lt=(Bt=ae.find(Sa=>Sa.id===se))==null?void 0:Bt.active;Ot(`${ye} ${lt?"desativado":"ativado"}`,()=>{Z(ae),fetch("/api/workflow/adapters",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tools:ae.filter(Sa=>Sa.active).map(Sa=>Sa.id)})}),c()})}catch{Z(Yt),p("Erro ao atualizar adapters","error")}finally{pt(!1)}}async function zt(){var Be;if(!Pt||cl)return;const se=Ie,ae=[...tt],ye=Oe.find(qe=>qe.id===Pt),_e=ae.filter(qe=>!(ye!=null&&ye.stages.some(Bt=>Bt.id===qe.id)));Hl(!0);try{const qe=await fetch("/api/workflow/template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:Pt})});if(!qe.ok)throw new Error("Failed to switch template");const Bt=await qe.json();ca(Bt.template||Pt),Ul(((Be=Bt.stages)==null?void 0:Be.map(Ve=>({id:Ve.id,name:Ve.name})))||[]),ol(null),c(),_e.length>0&&p(`${_e.length} estágio(s) removido(s); itens preservados no backlog`,"success"),Ot("Template atualizado",()=>{ca(se),Ul(ae),fetch("/api/workflow/template",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:se})}),c()})}catch{p("Erro ao atualizar template","error")}finally{Hl(!1)}}async function Ht(){if(!(!s.root||ut)){Tt(!0),ua("");try{const se=await fetch("/api/workflow/migrate-harness",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceRoot:s.root,clean:!1})});if(!se.ok)throw new Error(`Migration failed (${se.status})`);const ae=await se.json();ae.ok?(p("Workspace externalizado com sucesso","success"),c()):ua(ae.message||"Erro ao externalizar")}catch(se){ua((se==null?void 0:se.message)||"Erro ao externalizar")}finally{Tt(!1)}}}async function ul(){if(!(!s.root||ut)){Tt(!0),ua("");try{const se=await fetch("/api/workflow/migrate-harness",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceRoot:s.root,clean:!0})});if(!se.ok)throw new Error(`Migration failed (${se.status})`);const ae=await se.json();ae.ok?(p("Workspace externalizado e pasta original removida","success"),c()):ua(ae.message||"Erro ao externalizar")}catch(se){ua((se==null?void 0:se.message)||"Erro ao externalizar")}finally{Tt(!1)}}}async function Gl(se){ne(!0),xe("");try{const ae=se?`/api/fs/dirs?path=${encodeURIComponent(se)}`:"/api/fs/dirs",_e=await(await fetch(ae)).json();T(_e.path||""),oe(_e.dirs||[]),_e.error&&xe(_e.error)}catch{xe("Erro ao listar diretórios")}finally{ne(!1)}}function hr(){fe(!0),we(null),T(""),oe([]),Gl()}return l.jsxs("div",{className:"flex h-full flex-col",children:[l.jsx("div",{className:"border-b px-6 py-4",style:{borderColor:"var(--color-border)"},children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold",children:"Configurações do Workspace"}),l.jsx("p",{className:"text-caption mt-0.5",style:{color:"var(--color-text-secondary)"},children:s.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[d?l.jsxs(F,{type:"button",variant:"secondary",onClick:d,children:[l.jsx(C,{name:"plus",size:14}),"Novo workspace"]}):null,y==="general"&&l.jsx(F,{onClick:ns,disabled:!qi||!hn||B,loading:B,children:"Salvar"}),m?l.jsx(F,{type:"button",variant:"ghost",size:"sm",className:"size-8 px-0","aria-label":"Fechar configurações do workspace",onClick:m,children:l.jsx(C,{name:"x",size:16})}):null]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsx(Ly,{tabs:[{id:"general",label:"Geral",icon:l.jsx(C,{name:"settings",size:14})},{id:"locations",label:"Pastas/projetos",icon:l.jsx(C,{name:"folder",size:14})},{id:"flow",label:"Fluxo",icon:l.jsx(C,{name:"flow",size:14})},{id:"adapters",label:"Adapters",icon:l.jsx(C,{name:"cpu",size:14})},{id:"advanced",label:"Avançado",icon:l.jsx(C,{name:"shield",size:14})},{id:"externalization",label:"Externalização",icon:l.jsx(C,{name:"folder",size:14})}],activeTab:y,onChange:g,ariaLabel:"Configurações do workspace",children:se=>l.jsxs("div",{"data-testid":"workspace-settings-tab-panel",className:"px-4 py-5 sm:px-6 lg:px-8",children:[se==="general"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Nome"}),l.jsx(Dt,{value:N,onChange:ae=>j(ae.target.value),placeholder:"Nome do workspace",autoFocus:!0}),!hn&&N.length>0&&l.jsx("span",{className:"text-caption",style:{color:"var(--color-error)"},children:"Mínimo 2 caracteres"})]}),l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Descrição"}),l.jsx(Li,{value:E,onChange:ae=>M(ae.target.value),placeholder:"Descreva o propósito deste workspace",rows:3})]})]}),l.jsxs("div",{className:"pt-2",children:[l.jsxs("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:["Criado em"," ",new Date(s.createdAt).toLocaleDateString("pt-BR")]}),s.root&&l.jsx("p",{className:"text-caption mt-1 font-mono",style:{color:"var(--color-text-secondary)"},children:s.root})]})]}),se==="locations"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Data directory do workspace"}),l.jsx(Dt,{value:s.dataDir||s.root||"",readOnly:!0,"aria-readonly":"true"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Gerencie as pastas/projetos vinculadas a este workspace."}),l.jsxs(F,{size:"sm",onClick:hr,children:[l.jsx(C,{name:"plus",size:14}),"Adicionar pasta"]})]}),H?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):he.length===0?l.jsxs("div",{className:"rounded-[var(--radius-md)] border border-dashed p-6 text-center",style:{borderColor:"var(--color-border)"},children:[l.jsx(C,{name:"folder",size:24,className:"mx-auto mb-2",style:{color:"var(--color-text-secondary)"}}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhuma pasta/projeto vinculada"}),l.jsx(F,{size:"sm",className:"mt-3",onClick:hr,children:"Adicionar primeira pasta"})]}):l.jsx("div",{className:"space-y-2",children:he.map(ae=>l.jsxs("div",{className:"flex items-center gap-3 rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx(C,{name:"folder",size:16,style:{color:"var(--color-text-secondary)"}}),l.jsx("div",{className:"flex-1 min-w-0",children:R===ae.id?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Dt,{value:ce,onChange:ye=>Se(ye.target.value),className:"h-8","aria-label":`Label do local ${ae.label}`,autoFocus:!0,onKeyDown:ye=>{ye.key==="Enter"&&ss(ae.id),ye.key==="Escape"&&re(null)}}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Salvar local ${ae.label}`,onClick:()=>ss(ae.id),children:l.jsx(C,{name:"check",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Cancelar edição de ${ae.label}`,onClick:()=>re(null),children:l.jsx(C,{name:"x",size:14})})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm font-medium truncate",children:ae.label}),l.jsx("p",{className:"text-caption font-mono truncate",style:{color:"var(--color-text-secondary)"},children:ae.path}),l.jsx("span",{className:"mt-2 inline-flex rounded-full px-2 py-0.5 text-caption",style:{background:pn(ae)==="success"?"var(--color-success-subtle)":"var(--color-surface-secondary)",color:pn(ae)==="success"?"var(--color-success)":"var(--color-text-secondary)"},children:rs(ae)}),!A&&l.jsxs("details",{className:"mt-2 rounded-[var(--radius-sm)] border p-2",style:{borderColor:"var(--color-border)"},children:[l.jsx("summary",{className:"cursor-pointer text-caption font-medium",children:"Adapters da pasta"}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:fr.map(ye=>{const _e=(D[ae.id]||[]).includes(ye.id);return l.jsx(F,{size:"sm",variant:_e?"secondary":"ghost",className:"h-7 px-2","aria-pressed":_e,disabled:A,onClick:()=>mr(ae.id,ye.id),children:ye.label},ye.id)})})]})]})}),R!==ae.id&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Editar label da pasta ${ae.label}`,onClick:()=>{re(ae.id),Se(ae.label)},children:l.jsx(C,{name:"edit",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Reparar vínculo da pasta ${ae.label}`,onClick:()=>dr(ae.id),children:l.jsx(C,{name:"activity",size:14})}),l.jsx(F,{size:"sm",variant:"ghost","aria-label":`Remover vínculo da pasta ${ae.label}`,onClick:()=>{L(ae.id),ie(ae.path)},children:l.jsx(C,{name:"trash",size:14})})]})]},ae.id))})]}),se==="flow"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Altere o template do fluxo de trabalho. Itens em estágios removidos vão para o backlog."}),Ie&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsxs("p",{className:"text-caption font-medium",children:["Template atual: ",Ie]}),l.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:tt.map(ae=>l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-surface-secondary)",color:"var(--color-text-secondary)"},children:ae.name},ae.id))})]}),ht?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando templates..."})}):Oe.length===0?l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhum template disponível"}):l.jsx("div",{className:"space-y-2",children:Oe.map(ae=>{const ye=ae.id===Ie,_e=ae.id===Pt,Be=ae.stages.filter(Ve=>!tt.some(lt=>lt.id===Ve.id)),qe=tt.filter(Ve=>!ae.stages.some(lt=>lt.id===Ve.id)),Bt=ae.stages.filter(Ve=>tt.some(lt=>lt.id===Ve.id));return l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full flex-col items-stretch gap-2 rounded-[var(--radius-md)] border p-3 text-left ${_e?"border-[var(--color-primary)] bg-[var(--color-primary-subtle)]":"hover:bg-[var(--color-surface-secondary)]"}`,style:{borderColor:_e?void 0:"var(--color-border)"},onClick:()=>ol(ye?null:ae.id),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:[ae.name,ye&&l.jsx("span",{className:"ml-2 text-caption",style:{color:"var(--color-text-secondary)"},children:"(atual)"})]}),ye&&l.jsx(C,{name:"check",size:14,style:{color:"var(--color-primary)"}})]}),ae.description&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:ae.description}),l.jsx("div",{className:"flex flex-wrap gap-1",children:ae.stages.map(Ve=>{const lt=tt.some(xn=>xn.id===Ve.id),Sa=Be.some(xn=>xn.id===Ve.id);return l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:Sa?"var(--color-success-subtle)":"var(--color-surface-secondary)",color:Sa?"var(--color-success)":"var(--color-text-secondary)"},children:Ve.name},Ve.id)})}),!ye&&(Be.length>0||qe.length>0)&&l.jsxs("div",{className:"text-caption flex flex-col gap-1",style:{color:"var(--color-text-secondary)"},children:[Bt.length>0&&l.jsxs("p",{children:["Inalterados:"," ",Bt.map(Ve=>Ve.name).join(", ")]}),Be.length>0&&l.jsxs("p",{style:{color:"var(--color-success)"},children:["Adicionados:"," ",Be.map(Ve=>Ve.name).join(", ")]}),qe.length>0&&l.jsxs("p",{style:{color:"var(--color-error)"},children:["Removidos:"," ",qe.map(Ve=>Ve.name).join(", ")]}),qe.length>0&&l.jsx("p",{children:"Itens nesses estágios serão preservados no backlog."})]})]},ae.id)})}),Pt&&Pt!==Ie&&l.jsx(F,{onClick:zt,disabled:cl,loading:cl,children:"Aplicar template"})]}),se==="adapters"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Selecione quais adapters estão ativos. Adapters são regenerados automaticamente."}),Te?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando adapters..."})}):Yt.length===0?l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Nenhum adapter disponível"}):l.jsx("div",{className:"space-y-2",children:Yt.map(ae=>{const ye=[];return ae.capabilities.instructions&&ye.push("Instructions"),ae.capabilities.skills&&ye.push("Skills"),ae.capabilities.mcp&&ye.push("MCP"),ae.capabilities.hooks&&ye.push("Hooks"),l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full items-start justify-start gap-3 rounded-[var(--radius-md)] border p-3 text-left ${ae.active?"border-[var(--color-primary)] bg-[var(--color-primary-subtle)]":"hover:bg-[var(--color-surface-secondary)]"}`,style:{borderColor:ae.active?void 0:"var(--color-border)"},"aria-label":`${ae.active?"Desativar":"Ativar"} adapter ${ae.displayName}`,"aria-pressed":ae.active,onClick:()=>ka(ae.id),disabled:at,children:[l.jsx("div",{className:"mt-0.5",children:l.jsx("div",{className:`flex h-4 w-4 items-center justify-center rounded border ${ae.active?"border-[var(--color-primary)] bg-[var(--color-primary)]":"border-[var(--color-border)]"}`,children:ae.active&&l.jsx(C,{name:"check",size:10,style:{color:"var(--color-text-on-primary)"}})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium",children:ae.displayName}),ae.detected&&l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-success-subtle)",color:"var(--color-success)"},children:"Detectado"})]}),ye.length>0&&l.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:ye.map(_e=>l.jsx("span",{className:"rounded-full px-2 py-0.5 text-caption",style:{background:"var(--color-surface-secondary)",color:"var(--color-text-secondary)"},children:_e},_e))}),l.jsxs("p",{className:"text-caption mt-1",style:{color:"var(--color-text-secondary)"},children:["Arquivo(s) esperado(s):"," ",ae.detectionPaths.join(", ")]})]})]},ae.id)})})]}),se==="advanced"&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-4",style:{borderColor:"var(--color-error)"},children:[l.jsx("h4",{className:"text-sm font-semibold",style:{color:"var(--color-error)"},children:"Zona de perigo"}),l.jsx("p",{className:"text-caption mt-1",style:{color:"var(--color-text-secondary)"},children:"Excluir este workspace remove o registro mas preserva os arquivos no disco."}),l.jsx(F,{variant:"danger",size:"sm",className:"mt-3",onClick:()=>ee(!0),children:"Excluir Workspace"})]})}),se==="externalization"&&l.jsxs("div",{className:"space-y-6",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Externalização de dados"}),l.jsx("p",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Os arquivos do workspace (workflow.json, harness, specs, memories) podem ser externalizados para fora do projeto, mantendo apenas o link .le.etra-link."}),s.dataDir?l.jsx("div",{className:"text-caption break-all",style:{color:"var(--color-text-secondary)"},children:s.dataDir}):l.jsx(F,{size:"sm",variant:"secondary",onClick:c,children:"Atualizar localização"}),Ct&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-error)"},children:Ct}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{size:"sm",loading:ut,onClick:Ht,children:"Migrar para diretório externo"}),l.jsx(F,{size:"sm",variant:"secondary",loading:ut,onClick:ul,children:"Migrar e remover origem"})]})]})]})})}),ue==="confirm"&&l.jsx(ls,{open:P,onClose:()=>ee(!1),title:"Excluir workspace?",actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:()=>ee(!1),children:"Cancelar"}),l.jsx(F,{type:"button",variant:"danger",onClick:()=>ve("type-name"),children:"Continuar"})]}),children:l.jsxs("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:['Tem certeza que deseja excluir "',s.name,'"? Esta ação é irreversível.']})}),ue==="type-name"&&l.jsx(ls,{open:P,onClose:()=>{ee(!1),ve("confirm"),de("")},title:`Digite "${s.name}" para confirmar`,actions:l.jsxs(l.Fragment,{children:[l.jsx(F,{type:"button",variant:"secondary",onClick:()=>{ee(!1),ve("confirm"),de("")},children:"Cancelar"}),l.jsx(F,{type:"button",variant:"danger",disabled:Y!==s.name,onClick:ql,children:"Excluir permanentemente"})]}),children:l.jsxs("div",{className:"grid gap-3",children:[l.jsx("p",{className:"text-body",style:{color:"var(--color-text-secondary)"},children:"Todos os dados serão preservados no disco, mas o registro será removido."}),l.jsxs(ts,{className:"flex flex-col items-start gap-[var(--space-2)]",children:[l.jsx("span",{className:"text-caption font-medium",style:{color:"var(--color-text-secondary)"},children:"Nome do workspace"}),l.jsx(Dt,{value:Y,onChange:se=>de(se.target.value),"aria-label":"Digite o nome do workspace para confirmar exclusão",placeholder:s.name,autoFocus:!0})]})]})}),z&&l.jsx(Du,{open:!!z,onClose:()=>{L(null),ie("")},onConfirm:ur,title:"Remover local?",message:`Remover ${le}?`,confirmLabel:"Confirmar remoção",variant:"danger"}),I&&l.jsx(nr,{open:I,onOpenChange:fe,children:l.jsxs(sr,{side:"right",className:"w-full sm:max-w-md flex flex-col",children:[l.jsxs(Ui,{children:[l.jsx(Hi,{children:"Selecionar diretório"}),l.jsx(Ru,{children:"Navegue e selecione o diretório para adicionar como local."})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Dt,{value:V,onChange:se=>T(se.target.value),"aria-label":"Caminho do diretório",placeholder:"Caminho do diretório",onKeyDown:se=>{se.key==="Enter"&&Gl(V)}}),l.jsx(F,{size:"sm","aria-label":"Buscar diretório",onClick:()=>Gl(V),children:l.jsx(C,{name:"search",size:14})})]}),be&&l.jsx("p",{className:"text-caption",style:{color:"var(--color-error)"},children:be}),De?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("span",{className:"text-caption",style:{color:"var(--color-text-secondary)"},children:"Carregando..."})}):l.jsxs("div",{className:"space-y-1",children:[Q.map(se=>l.jsxs(F,{type:"button",variant:"ghost",className:`h-auto w-full justify-start gap-2 rounded-[var(--radius-sm)] px-3 py-2 text-left text-sm ${(q==null?void 0:q.path)===se.path?"bg-[var(--color-primary)] text-[var(--color-text-on-primary)]":"hover:bg-[var(--color-surface-secondary)]"}`,onClick:()=>we(se),children:[l.jsx(C,{name:"folder",size:14}),l.jsx("span",{className:"truncate",children:se.name})]},se.path)),q&&l.jsxs("div",{className:"rounded-[var(--radius-md)] border p-3",style:{borderColor:"var(--color-border)"},children:[l.jsx("p",{className:"text-caption font-medium",children:"Diretório selecionado"}),l.jsx("p",{className:"mt-1 truncate font-mono text-caption",style:{color:"var(--color-text-secondary)"},children:q.path})]}),Q.length===0&&!be&&l.jsx("p",{className:"text-caption py-4 text-center",style:{color:"var(--color-text-secondary)"},children:"Nenhum subdiretório encontrado"})]})]})}),l.jsxs(Lu,{children:[l.jsx(F,{variant:"secondary",onClick:()=>fe(!1),children:"Cancelar"}),l.jsx(F,{disabled:!q,onClick:Gi,children:"Adicionar"})]})]})})]})}function Xj({activeFlow:s}){const o=S0(s);return o.length===0?null:l.jsx("div",{className:"p-4",children:l.jsx(By,{variant:"warning",title:`Flow ativo com ${o.length} aviso${o.length===1?"":"s"}`,children:l.jsx("div",{className:"grid grid-cols-1 gap-2 pt-1 lg:grid-cols-2",children:o.map((u,c)=>l.jsxs("div",{className:"grid grid-cols-1 items-start gap-1.5 sm:grid-cols-[auto_minmax(0,1fr)] sm:gap-2",children:[l.jsx(ke,{variant:"info",className:"w-fit max-w-full break-all text-caption",children:u.code}),l.jsxs("span",{children:[u.message,u.artifactRef?` (${u.artifactRef})`:""]})]},`${u.code}-${u.artifactRef??c}`))})})})}function Zj({sidebar:s,header:o,children:u}){const{open:c}=Aa();return l.jsx(u0,{sidebar:s,header:o,sidebarCollapsed:!c,className:"app-surface-base min-h-svh",style:{"--layout-sidebar-width":"var(--sidebar-width)","--layout-sidebar-width-collapsed":"var(--sidebar-width-icon)"},children:u})}function Kj(){const[s,o]=v.useState(null),[u,c]=v.useState(null),[d,m]=v.useState(!0),[p,x]=v.useState("supervision"),[y,g]=v.useState("context.md"),[N,j]=v.useState(()=>{try{const b=localStorage.getItem("letra-active-workspace");return b?JSON.parse(b):null}catch{return null}}),[E,M]=v.useState([]),[B,J]=v.useState(()=>{var A;if(typeof window>"u")return"dark";const b=localStorage.getItem("letra-theme");return b==="light"||b==="dark"?b:(A=window.matchMedia)!=null&&A.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}),[P,ee]=v.useState(null),[ue,ve]=v.useState(0),[Y,de]=v.useState(""),[he,te]=v.useState(()=>{try{return localStorage.getItem("letra-active-directory")}catch{return null}}),[H,pe]=v.useState(!1);v.useEffect(()=>{document.documentElement.classList.toggle("dark",B==="dark"),document.documentElement.classList.toggle("light",B==="light"),localStorage.setItem("letra-theme",B)},[B]);function Ee(b){pe(!1),localStorage.setItem("letra-active-workspace",JSON.stringify(b)),he&&(localStorage.removeItem("letra-active-directory"),te(null)),j(b),x("supervision"),(b.root?fetch("/api/workspace/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:b.root})}):Promise.resolve()).then(()=>re()).catch(()=>re())}function me(b){b?localStorage.setItem("letra-active-directory",b):localStorage.removeItem("letra-active-directory"),te(b),fetch("/api/workspace/directory/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:b})}).then(()=>re()).catch(()=>re())}function R(){localStorage.removeItem("letra-active-workspace"),localStorage.removeItem("letra-active-directory"),j(null),te(null),pe(!0),x("supervision")}function re(){Promise.all([fetch("/api/workflow").then(b=>b.json()),fetch("/api/workflow/active-flow").then(b=>b.json()).catch(()=>null)]).then(([b,A])=>{b&&!b.error&&o(b),c(A)})}function ce(b){b==="knowledge"&&g("context.md"),x(b)}function Se(b="context.md"){g(b),x("knowledge")}const z=v.useCallback(()=>{fetch("/api/health").then(b=>b.json()).then(b=>{const A=Array.isArray(b==null?void 0:b.active)?b.active:[],$=(b==null?void 0:b.summary)??{};ee({activeAlerts:typeof $.activeAlerts=="number"?$.activeAlerts:A.length,criticalAlerts:typeof $.criticalAlerts=="number"?$.criticalAlerts:A.filter(I=>/crit|alta|high/.test(String((I==null?void 0:I.severity)??"").toLowerCase())).length})}).catch(()=>ee(null))},[]);if(v.useEffect(()=>{const b=N!=null&&N.root?fetch("/api/workspace/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:N.root})}).then(()=>{}):Promise.resolve(),A=he?fetch("/api/workspace/directory/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:he})}).then(()=>{}):Promise.resolve();Promise.all([b,A]).then(()=>Promise.all([fetch("/api/workflow").then(I=>I.json()),fetch("/api/workflow/active-flow").then(I=>I.json()).catch(()=>null)])).then(([I,fe])=>{I&&!I.error&&o(I),c(fe),m(!1)}).catch(()=>m(!1)),z(),fetch("/api/workspaces").then(I=>I.json()).then(I=>{Array.isArray(I)&&M(I)}).catch(()=>{});const $=ix("/events");return $.addEventListener("workflow-updated",()=>{re(),ve(I=>I+1),de("Fluxo atualizado.")}),$.addEventListener("diagnostics-updated",()=>{z(),ve(I=>I+1),de("Diagnosticos atualizados.")}),()=>$.close()},[z]),d)return l.jsxs("div",{className:"app-surface-base flex h-screen flex-col gap-6 p-6",children:[l.jsxs("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-4",children:[l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{})]}),l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3",children:[l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{}),l.jsx(It,{})]})]});const L=new URLSearchParams(window.location.search).get("setup")==="true";function le(){if(!s||L)return l.jsx(b0,{onComplete:b=>{o(b);const A=new URL(window.location.href);A.searchParams.delete("setup"),window.history.replaceState({},"",A.toString())}});if(!N)return l.jsx(Yj,{onSelect:Ee,onWorkspacesLoaded:M,gateMode:!0,activeDirectory:he,startCreating:H});switch(p){case"supervision":return l.jsx(dp,{workflow:s,activeFlow:u,onTabChange:b=>x(b)});case"work":return l.jsx(ij,{workflow:s,activeFlow:u,specRefreshKey:ue,onItemMoved:re,onOpenSpec:()=>Se("specs")});case"knowledge":return l.jsx(Mj,{initialTab:y});case"activity":return l.jsx(Bj,{});case"settings":return l.jsx(Qj,{workspace:N,onWorkspaceUpdated:b=>{j(b),M(A=>A.map($=>$.id===b.id?b:$))},onWorkspaceDeleted:()=>{pe(!1),j(null),x("supervision")},onRefreshWorkflow:re,onCreateWorkspace:R});default:return l.jsx(dp,{workflow:s,activeFlow:u,onTabChange:b=>x(b)})}}const ie=s?cr(s,u):new Set,D=(s==null?void 0:s.items.filter(b=>ie.has(b.stage)).length)??0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Y}),l.jsx(t0,{className:"min-h-svh w-full",style:{"--sidebar-width":"308px","--sidebar-width-icon":"3rem"},children:l.jsx(Zj,{sidebar:l.jsx(v0,{activeTab:p,onTabChange:ce,gateCount:D,workspaceActive:!!N,activeWorkspace:N,activeDirectory:he,onDirectoryChange:me,onOpenWorkspaceSettings:()=>x("settings")}),header:l.jsx(m0,{theme:B,onThemeChange:J,gateCount:D,activeDirectory:he,workspaces:E,activeWorkspace:N,onWorkspaceChange:Ee,onDirectoryChange:me,health:P,onOpenHealthCenter:()=>x("supervision"),onOpenWorkspaceSettings:()=>x("settings")}),children:l.jsxs("main",{className:"flex min-h-0 flex-1 flex-col animate-fade-in",children:[l.jsx(Xj,{activeFlow:u}),le()]})})})]})}function Jj(){return l.jsx(Ry,{children:l.jsx(Kj,{})})}Mg.createRoot(document.getElementById("root")).render(l.jsx(v.StrictMode,{children:l.jsx(Jj,{})}));
|